imbric-theme 0.3.5 → 0.3.6

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.
@@ -5,7 +5,8 @@ import styles from './Checkbox.module.css'
5
5
  import { options } from './constants'
6
6
  import withStyles from '../../hocs/withStyles'
7
7
 
8
- export const Checkbox = ({ getStyles, onChange, label, id, value, name }) => {
8
+
9
+ export const Checkbox = ({ getStyles, onChange, label, id, value, name, linkCheck, nameLinkCheck }) => {
9
10
 
10
11
  const [checked, setChecked] = React.useState(false);
11
12
 
@@ -14,17 +15,29 @@ export const Checkbox = ({ getStyles, onChange, label, id, value, name }) => {
14
15
 
15
16
  <div className={getStyles('checkbox')}>
16
17
 
17
- <input
18
- type="checkbox"
18
+ {/* <input
19
+ type="checkbox"
19
20
  id={id}
20
21
  name={name}
21
22
  label={label}
22
23
  value={value}
23
24
  onChange={onChange}
24
25
  />
25
- {label}
26
+ &nbsp;{label} */}
27
+
28
+ <input className={getStyles('checkbox-custom')}
29
+ type="checkbox"
30
+ id={id}
31
+ name={name}
32
+ label={label}
33
+ value={value}
34
+ onChange={onChange}
35
+ />
36
+ <label htmlFor={name} className={getStyles('checkbox-custom-label')}>{label}<a className={getStyles('checkbox-custom-link')} href={linkCheck} target="_black"> {nameLinkCheck}</a> </label>
37
+
38
+
26
39
  </div>
27
-
40
+
28
41
  )
29
42
  }
30
43
 
@@ -33,17 +46,21 @@ Checkbox.propTypes = {
33
46
  onChange: PropTypes.func.isRequired,
34
47
  id: PropTypes.string.isRequired,
35
48
  name: PropTypes.string.isRequired,
36
- value: PropTypes.string.isRequired,
37
- label: PropTypes.string
49
+ value: PropTypes.bool.isRequired,
50
+ label: PropTypes.string,
51
+ nameLinkCheck: PropTypes.string,
52
+ linkCheck: PropTypes.string,
38
53
  }
39
54
 
40
55
  Checkbox.defaultProps = {
41
56
  getStyles: () => { },
42
57
  onChange: () => { },
43
- id: '1',
44
- name: '1',
58
+ id: 'hola',
59
+ name: 'hola',
45
60
  value: true,
46
61
  label: 'Hola',
62
+ nameLinkCheck: '',
63
+ linkCheck: '',
47
64
  }
48
65
 
49
66
  export default withStyles(styles)(Checkbox)
@@ -1,3 +1,54 @@
1
1
  .checkbox {
2
2
  display: flex;
3
3
  }
4
+
5
+ /* ////////////////////// */
6
+
7
+
8
+ .checkbox-custom {
9
+ opacity: 0;
10
+ position: absolute;
11
+ }
12
+
13
+ .checkbox-custom, .checkbox-custom-label {
14
+ display: inline-block;
15
+ vertical-align: middle;
16
+ margin: 5px;
17
+ cursor: pointer;
18
+ color: var(--color-brand-regent-gray);
19
+ font-weight: var(--font-weight-light);
20
+ }
21
+
22
+ .checkbox-custom + .checkbox-custom-label:before {
23
+ content: '';
24
+ background: #fff;
25
+ border-radius: 5px;
26
+ border: 2px solid #ddd;
27
+ display: inline-block;
28
+ vertical-align: middle;
29
+ width: 10px;
30
+ height: 10px;
31
+ padding: 2px;
32
+ margin-right: 10px;
33
+ text-align: center;
34
+ }
35
+
36
+ .checkbox-custom:checked + .checkbox-custom-label:before {
37
+ content: "";
38
+ display: inline-block;
39
+ width: 1px;
40
+ height: 5px;
41
+ border: solid var(--color-brand-smalt);
42
+ border-width: 0 3px 3px 0;
43
+ transform: rotate(45deg);
44
+ -webkit-transform: rotate(45deg);
45
+ -ms-transform: rotate(45deg);
46
+ border-radius: 0px;
47
+ margin: 0px 15px 5px 5px;
48
+ }
49
+
50
+ .checkbox-custom, .checkbox-custom-link {
51
+ font-weight: var(--font-weight-normal);
52
+ color: var(--color-primary);
53
+ text-decoration: underline;
54
+ }
@@ -13,10 +13,12 @@ export default {
13
13
  title: 'Atoms/Checkbox',
14
14
  component: Checkbox,
15
15
  args: {
16
- id: '1',
17
- name: '1',
16
+ id: 'hola',
17
+ name: 'hola',
18
18
  value: true,
19
19
  label: 'Hola',
20
+ nameLinkCheck: '',
21
+ linkCheck: '',
20
22
  },
21
23
  argTypes: {
22
24
  // types: getOptionsArgTypes(options.types),
@@ -20,6 +20,7 @@ export const Input = ({
20
20
  onChange,
21
21
  onClick,
22
22
  placeholder,
23
+ pattern,
23
24
  }) => (
24
25
  <input
25
26
  className={getStyles('input', {
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+ import Link from 'next/link'
4
+
5
+ import styles from './LinkItem.module.css'
6
+ import { options } from './constants'
7
+ import withStyles from '../../hocs/withStyles'
8
+ import Paragraph from '../Paragraph'
9
+
10
+ export const LinkItem = ({ children, size, color, getStyles, isHref }) => {
11
+ return (
12
+ <Link href={isHref} passHref>
13
+ <a className={getStyles('link', ['color'])}>
14
+ <Paragraph size={size} color={color} weight="semibold" isInline>
15
+ {children}
16
+ </Paragraph>
17
+ </a>
18
+ </Link>
19
+ )
20
+ }
21
+
22
+ LinkItem.propTypes = {
23
+ children: PropTypes.node.isRequired,
24
+ getStyles: PropTypes.func.isRequired,
25
+ color: PropTypes.oneOf(options.colors),
26
+ size: PropTypes.oneOf(options.sizes),
27
+ }
28
+
29
+ LinkItem.defaultProps = {
30
+ getStyles: () => { },
31
+ color: 'primary',
32
+ size: 'md',
33
+ isHref: '/',
34
+ }
35
+
36
+ export default withStyles(styles)(LinkItem)
@@ -1,7 +1,7 @@
1
1
  .link {
2
2
  display: inline;
3
3
  max-width: max-content;
4
- border-bottom: 1px solid currentColor;
4
+ /* border-bottom: 1px solid currentColor; */
5
5
  cursor: pointer;
6
6
  }
7
7
 
@@ -12,3 +12,8 @@
12
12
  .color-tertiary {
13
13
  color: var(--color-tertiary);
14
14
  }
15
+
16
+ .link p {
17
+ font-weight: var(--font-weight-normal);
18
+ text-decoration: underline;
19
+ }
@@ -1,4 +1,4 @@
1
- import { Link, styles, options } from '.'
1
+ import { LinkItem, styles, options } from '.'
2
2
 
3
3
  import {
4
4
  getTemplate,
@@ -6,12 +6,12 @@ import {
6
6
  getOptionsArgTypes,
7
7
  } from '../../helpers/storybook'
8
8
 
9
- const Template = getTemplate(Link, styles)
10
- const ListTemplate = getListTemplate(Link, styles)
9
+ const Template = getTemplate(LinkItem, styles)
10
+ const ListTemplate = getListTemplate(LinkItem, styles)
11
11
 
12
12
  export default {
13
- title: 'Atoms/Link',
14
- component: Link,
13
+ title: 'Atoms/LinkItem',
14
+ component: LinkItem,
15
15
  args: {
16
16
  children: 'Mouths Muil',
17
17
  },
File without changes
@@ -0,0 +1,3 @@
1
+ export { default, LinkItem } from './LinkItem'
2
+ export { options } from './constants'
3
+ export { default as styles } from './LinkItem.module.css'
package/index.js CHANGED
@@ -24,7 +24,7 @@ export { default as Heading } from './atoms/Heading'
24
24
  export { default as Icon } from './atoms/Icon'
25
25
  export { default as Input } from './atoms/Input'
26
26
  export { default as Label } from './atoms/Label'
27
- export { default as Link } from './atoms/Link'
27
+ export { default as LinkItem } from './atoms/LinkItem'
28
28
  export { default as Modal } from './atoms/Modal'
29
29
  export { default as Paragraph } from './atoms/Paragraph'
30
30
  export { default as Picture } from './atoms/Picture'
@@ -113,12 +113,14 @@ ColumnTable.propTypes = {
113
113
  handleSorting: PropTypes.func.isRequired,
114
114
  getStyles: PropTypes.func.isRequired,
115
115
  columnUppercase: PropTypes.bool,
116
+ onChangeInput: PropTypes.func,
116
117
  }
117
118
 
118
119
  ColumnTable.defaultProps = {
119
120
  getStyles: () => { },
120
121
  handleSorting: () => { },
121
122
  columnUppercase: false,
123
+ onChangeInput: () => { },
122
124
  }
123
125
 
124
126
  export default withStyles(styles)(ColumnTable)
@@ -16,9 +16,9 @@ export default {
16
16
  columnUppercase: false,
17
17
  columnsData: options.columns,
18
18
  },
19
- argTypes: {
20
- // typeInput: getOptionsArgTypes(options.typeInput),
21
- },
19
+ // argTypes: {
20
+ // // typeInput: getOptionsArgTypes(options.typeInput),
21
+ // },
22
22
  }
23
23
 
24
24
  export const Default = Template.bind({})
@@ -43,6 +43,15 @@ export const DynamicSelect = ({ getStyles, optionsSelect, defaultValue, placehol
43
43
  paddingTop: '2px',
44
44
  }),
45
45
 
46
+ placeholder: (base) => ({
47
+ ...base,
48
+ color: 'var(--color-brand-white-lilac)',
49
+ fontWeight: 'var(--font-weight-light)',
50
+ whiteSpace: 'nowrap',
51
+ overflow: 'hidden',
52
+ textOverflow: 'ellipsis',
53
+ }),
54
+
46
55
  }
47
56
 
48
57
  // const handleChange = (value) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imbric-theme",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Components library IMBRIC",
5
5
  "private": false,
6
6
  "main": "index.js",
@@ -1,33 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
-
4
- import styles from './Link.module.css'
5
- import { options } from './constants'
6
- import withStyles from '../../hocs/withStyles'
7
-
8
- import Paragraph from '../Paragraph'
9
-
10
- export const Link = ({ children, size, color, getStyles }) => {
11
- return (
12
- <a className={getStyles('link', ['color'])}>
13
- <Paragraph size={size} color={color} weight="semibold" isInline>
14
- {children}
15
- </Paragraph>
16
- </a>
17
- )
18
- }
19
-
20
- Link.propTypes = {
21
- children: PropTypes.node.isRequired,
22
- getStyles: PropTypes.func.isRequired,
23
- color: PropTypes.oneOf(options.colors),
24
- size: PropTypes.oneOf(options.sizes),
25
- }
26
-
27
- Link.defaultProps = {
28
- getStyles: () => {},
29
- color: 'primary',
30
- size: 'md',
31
- }
32
-
33
- export default withStyles(styles)(Link)
@@ -1,3 +0,0 @@
1
- export { default, Link } from './Link'
2
- export { options } from './constants'
3
- export { default as styles } from './Link.module.css'