@symbo.ls/dropdown 1.1.5 → 1.2.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 (3) hide show
  1. package/index.js +40 -29
  2. package/package.json +4 -4
  3. package/style.js +0 -37
package/index.js CHANGED
@@ -1,41 +1,52 @@
1
1
  'use strict'
2
2
 
3
- import { IconText } from '@symbo.ls/icon-text'
4
-
5
- import { styleRow, styleRowActive, styleDropDown } from './style'
3
+ import { Flex } from '@symbo.ls/atoms'
4
+ import { Button } from '@symbo.ls/button'
6
5
 
7
6
  export const DropdownList = {
8
- style: styleDropDown,
9
- tag: 'ul',
7
+ extend: Flex,
10
8
 
11
- state: {
12
- active: 0
9
+ props: {
10
+ padding: '0 Y',
11
+ maxHeight: 'G',
12
+ flow: 'column',
13
+ theme: 'quaternary',
14
+ overflow: 'hidden auto',
15
+ style: { listStyleType: 'none' }
13
16
  },
14
17
 
15
- childExtends: {
16
- tag: 'li',
18
+ childExtend: {
19
+ extend: Button,
17
20
 
18
- style: styleRow,
19
21
  props: (el, s) => ({
20
- depth: 0,
21
- round: 0
22
- // theme: el.parent.props.rowTheme
23
- }),
24
-
25
- span: {
26
- extends: [IconText],
27
- props: {
28
- icon: 'checkmark',
29
- text: ''
30
- }
31
- },
32
- class: {
33
- active: (element, state) => (state.active === element.key) ? styleRowActive : {}
34
- },
35
- on: {
36
- click: (event, element, state) => {
37
- state.update({ active: element.key })
22
+ active: s.active === el.key,
23
+ position: 'relative',
24
+ round: '0',
25
+ align: 'center flex-end',
26
+ flow: 'row-reverse',
27
+ padding: 'Z2 C Z2 Y2',
28
+ margin: '0',
29
+ gap: 'Y2',
30
+ theme: 'quaternary .child',
31
+
32
+ ':hover': {
33
+ style: {
34
+ svg: { opacity: '0.5' }
35
+ }
36
+ },
37
+
38
+ icon: {
39
+ active: s.active === el.key,
40
+ name: 'checkmark',
41
+ opacity: '0.1',
42
+ '.active': { opacity: '1' }
43
+ },
44
+
45
+ ':not(:first-child)': {
46
+ '@dark': { border: 'gray4 .65, solid' },
47
+ '@light': { border: 'gray11, solid' },
48
+ borderWidth: '1px 0 0'
38
49
  }
39
- }
50
+ })
40
51
  }
41
52
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@symbo.ls/dropdown",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "8590863dfd2c60cbe59db0b4bb8239c8a7585259",
6
+ "gitHead": "769d39aee2ab66f0d64b1e0052893442857e7432",
7
7
  "dependencies": {
8
- "@symbo.ls/icon-text": "latest",
9
- "@symbo.ls/shape": "latest"
8
+ "@symbo.ls/atoms": "latest",
9
+ "@symbo.ls/button": "latest"
10
10
  },
11
11
  "source": "src/index.js"
12
12
  }
package/style.js DELETED
@@ -1,37 +0,0 @@
1
- 'use strict'
2
-
3
- export const styleDropDown = {
4
- listStyleType: 'none',
5
- padding: '4px',
6
- maxHeight: '17.6em'
7
- }
8
-
9
- export const styleRow = {
10
- height: `${42 / 16}em`,
11
- width: `${178 / 16}em`,
12
- position: 'relative',
13
- padding: 0,
14
- span: {
15
- height: '100%',
16
- display: 'flex',
17
- alignItems: 'center',
18
- justifyContent: 'space-between',
19
- padding: '0 10px',
20
- margin: '0 6px',
21
- svg: { display: 'none' }
22
- },
23
- '&:not(:last-child) > span': {
24
- borderBottom: '.5px solid rgba(0, 0, 0, .12)'
25
- }
26
- }
27
-
28
- export const styleRowActive = {
29
- // '&:not(:last-child) > span': {
30
- // borderBottom: 'none'
31
- // },
32
- 'span > svg': { display: 'inline' }
33
- }
34
-
35
- export const styleSelectDropdown = {
36
- color: 'red'
37
- }