@symbo.ls/input 2.11.160 → 2.11.164
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/CheckBox.js +56 -0
- package/Input.js +42 -0
- package/Number.js +13 -0
- package/Radio.js +35 -0
- package/TextArea.js +61 -0
- package/Toggle.js +40 -0
- package/index.js +6 -52
- package/package.json +5 -3
package/CheckBox.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from '@symbo.ls/atoms'
|
|
4
|
+
|
|
5
|
+
export const CheckBox = {
|
|
6
|
+
tag: 'label',
|
|
7
|
+
|
|
8
|
+
props: {
|
|
9
|
+
boxSize: 'fit-content fit-content',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
round: 'Y'
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
Input: {
|
|
15
|
+
type: 'checkbox',
|
|
16
|
+
display: 'none',
|
|
17
|
+
':checked ~ div': {
|
|
18
|
+
background: '#0474F2',
|
|
19
|
+
border: '1px solid transparent'
|
|
20
|
+
},
|
|
21
|
+
':checked ~ div > svg': { opacity: '1' }
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
Flex: {
|
|
25
|
+
props: {
|
|
26
|
+
align: 'center center',
|
|
27
|
+
fontSize: 'B1',
|
|
28
|
+
padding: 'V',
|
|
29
|
+
border: '1px solid #57575C',
|
|
30
|
+
round: 'X2',
|
|
31
|
+
transition: 'background .15s ease-in-out'
|
|
32
|
+
},
|
|
33
|
+
Icon: {
|
|
34
|
+
props: {
|
|
35
|
+
icon: 'check',
|
|
36
|
+
opacity: '0',
|
|
37
|
+
transition: 'opacity .15s ease-in-out'
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const CheckBoxTitleParagraph = {
|
|
44
|
+
extend: Flex,
|
|
45
|
+
props: {
|
|
46
|
+
boxSize: 'fit-content',
|
|
47
|
+
align: 'flex-start flex-start',
|
|
48
|
+
gap: 'A'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
CheckBox: {},
|
|
52
|
+
TitleParagraph: {
|
|
53
|
+
gap: 'Z1',
|
|
54
|
+
margin: 'Y - - -'
|
|
55
|
+
}
|
|
56
|
+
}
|
package/Input.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { isString, replaceLiteralsWithObjectFields } from '@domql/utils'
|
|
4
|
+
import { Focusable } from '@symbo.ls/atoms'
|
|
5
|
+
|
|
6
|
+
export const Input = {
|
|
7
|
+
tag: 'input',
|
|
8
|
+
extend: [Focusable],
|
|
9
|
+
|
|
10
|
+
deps: { isString, replaceLiteralsWithObjectFields },
|
|
11
|
+
|
|
12
|
+
props: {
|
|
13
|
+
border: 'none',
|
|
14
|
+
type: 'input',
|
|
15
|
+
// theme: 'tertiary',
|
|
16
|
+
fontSize: 'A',
|
|
17
|
+
round: 'C',
|
|
18
|
+
lineHeight: 1,
|
|
19
|
+
fontFamily: 'smbls',
|
|
20
|
+
padding: 'Z A'
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
attr: {
|
|
24
|
+
pattern: ({ props }) => props.pattern,
|
|
25
|
+
minLength: ({ props }) => props.minlength,
|
|
26
|
+
maxLength: ({ props }) => props.maxlength,
|
|
27
|
+
name: ({ props }) => props.name,
|
|
28
|
+
autocomplete: ({ props }) => props.autocomplete,
|
|
29
|
+
placeholder: ({ props }) => props.placeholder,
|
|
30
|
+
value: ({ props, state, deps }) => {
|
|
31
|
+
const { isString, replaceLiteralsWithObjectFields } = deps
|
|
32
|
+
if (isString(props.value) && props.value.includes('{{')) {
|
|
33
|
+
return replaceLiteralsWithObjectFields(props.value, state)
|
|
34
|
+
}
|
|
35
|
+
return props.value
|
|
36
|
+
},
|
|
37
|
+
disabled: ({ props }) => props.disabled || null,
|
|
38
|
+
readonly: ({ props }) => props.readonly,
|
|
39
|
+
required: ({ props }) => props.required,
|
|
40
|
+
type: ({ props }) => props.type
|
|
41
|
+
}
|
|
42
|
+
}
|
package/Number.js
ADDED
package/Radio.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { CheckBox, CheckBoxTitleParagraph } from './CheckBox'
|
|
4
|
+
|
|
5
|
+
export const Radio = {
|
|
6
|
+
extend: CheckBox,
|
|
7
|
+
|
|
8
|
+
Input: {
|
|
9
|
+
type: 'radio',
|
|
10
|
+
':checked ~ div:after': { opacity: '1' }
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
Flex: {
|
|
14
|
+
props: {
|
|
15
|
+
round: '100%',
|
|
16
|
+
padding: 'Y',
|
|
17
|
+
':after': {
|
|
18
|
+
content: '""',
|
|
19
|
+
display: 'block',
|
|
20
|
+
boxSize: 'X+W1',
|
|
21
|
+
round: '100%',
|
|
22
|
+
background: 'white',
|
|
23
|
+
opacity: '0',
|
|
24
|
+
transition: 'opacity .15s ease-in-out'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
Icon: null
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const RadioTitleParagraph = {
|
|
32
|
+
extend: CheckBoxTitleParagraph,
|
|
33
|
+
CheckBox: null,
|
|
34
|
+
Radio: {}
|
|
35
|
+
}
|
package/TextArea.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import { Flex } from '@symbo.ls/atoms'
|
|
3
|
+
import { Input } from './Input'
|
|
4
|
+
|
|
5
|
+
export const TextArea = {
|
|
6
|
+
tag: 'textarea',
|
|
7
|
+
extend: [Input, Flex],
|
|
8
|
+
props: {
|
|
9
|
+
border: '1px solid #3F3F43',
|
|
10
|
+
background: 'transparent',
|
|
11
|
+
round: 'Y+W',
|
|
12
|
+
width: 'G1',
|
|
13
|
+
height: 'D2+W',
|
|
14
|
+
lineHeight: 1.4,
|
|
15
|
+
placeholder: 'Leave us a message...',
|
|
16
|
+
fontSize: 'Y2',
|
|
17
|
+
outline: 'none !important',
|
|
18
|
+
color: 'white',
|
|
19
|
+
style: { resize: 'none' }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const TextAreaWithTitle = {
|
|
24
|
+
extend: Flex,
|
|
25
|
+
props: {
|
|
26
|
+
flow: 'column',
|
|
27
|
+
boxSize: 'fit-content fit-content',
|
|
28
|
+
gap: 'Y+W'
|
|
29
|
+
},
|
|
30
|
+
Title: {
|
|
31
|
+
props: {
|
|
32
|
+
text: 'Label',
|
|
33
|
+
fontSize: 'Z',
|
|
34
|
+
lineHeight: '1em',
|
|
35
|
+
padding: '- - - Z',
|
|
36
|
+
color: 'gray4'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
TextArea: {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const TextAreaWithButton = {
|
|
43
|
+
extend: Flex,
|
|
44
|
+
props: { gap: 'Y2' },
|
|
45
|
+
TextArea: {
|
|
46
|
+
height: '52px',
|
|
47
|
+
padding: 'A',
|
|
48
|
+
fontSize: 'Z1',
|
|
49
|
+
color: 'white',
|
|
50
|
+
placeholder: 'Message',
|
|
51
|
+
round: 'Z2'
|
|
52
|
+
// background: 'gray'
|
|
53
|
+
|
|
54
|
+
},
|
|
55
|
+
IconButton: {
|
|
56
|
+
props: {
|
|
57
|
+
background: 'blue',
|
|
58
|
+
icon: { name: 'send' }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
package/Toggle.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { CheckBox, CheckBoxTitleParagraph } from './CheckBox'
|
|
4
|
+
|
|
5
|
+
export const Toggle = {
|
|
6
|
+
extend: CheckBox,
|
|
7
|
+
|
|
8
|
+
Input: {
|
|
9
|
+
':checked ~ div': {
|
|
10
|
+
background: 'green2 +8',
|
|
11
|
+
justifyContent: 'flex-end'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
Flex: {
|
|
16
|
+
props: {
|
|
17
|
+
boxSize: 'A+X B+Z',
|
|
18
|
+
padding: '- W',
|
|
19
|
+
round: 'D',
|
|
20
|
+
align: 'center flex-start',
|
|
21
|
+
background: 'gray .8 +68',
|
|
22
|
+
border: 'none',
|
|
23
|
+
transition: 'opacity .15s ease',
|
|
24
|
+
':after': {
|
|
25
|
+
content: '""',
|
|
26
|
+
boxSize: 'A A',
|
|
27
|
+
round: '100%',
|
|
28
|
+
background: 'white',
|
|
29
|
+
boxShadow: '1px, 1px, Z, gray .2'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
Icon: null
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const ToggleTitleParagraph = {
|
|
37
|
+
extend: CheckBoxTitleParagraph,
|
|
38
|
+
CheckBox: null,
|
|
39
|
+
Toggle: {}
|
|
40
|
+
}
|
package/index.js
CHANGED
|
@@ -1,54 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
deps: { isString, replaceLiteralsWithObjectFields },
|
|
11
|
-
|
|
12
|
-
props: {
|
|
13
|
-
border: 'none',
|
|
14
|
-
type: 'input',
|
|
15
|
-
theme: 'tertiary',
|
|
16
|
-
fontSize: 'A',
|
|
17
|
-
round: 'C',
|
|
18
|
-
lineHeight: 1,
|
|
19
|
-
fontFamily: 'smbls',
|
|
20
|
-
padding: 'Z A'
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
attr: {
|
|
24
|
-
pattern: ({ props }) => props.pattern,
|
|
25
|
-
minLength: ({ props }) => props.minlength,
|
|
26
|
-
maxLength: ({ props }) => props.maxlength,
|
|
27
|
-
name: ({ props }) => props.name,
|
|
28
|
-
autocomplete: ({ props }) => props.autocomplete,
|
|
29
|
-
placeholder: ({ props }) => props.placeholder,
|
|
30
|
-
value: ({ props, state, deps }) => {
|
|
31
|
-
const { isString, replaceLiteralsWithObjectFields } = deps
|
|
32
|
-
if (isString(props.value) && props.value.includes('{{')) {
|
|
33
|
-
return replaceLiteralsWithObjectFields(props.value, state)
|
|
34
|
-
}
|
|
35
|
-
return props.value
|
|
36
|
-
},
|
|
37
|
-
disabled: ({ props }) => props.disabled || null,
|
|
38
|
-
readonly: ({ props }) => props.readonly,
|
|
39
|
-
required: ({ props }) => props.required,
|
|
40
|
-
type: ({ props }) => props.type
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export const NumberInput = {
|
|
45
|
-
extend: Input,
|
|
46
|
-
props: {
|
|
47
|
-
type: 'number'
|
|
48
|
-
},
|
|
49
|
-
attr: {
|
|
50
|
-
step: ({ props }) => props.step,
|
|
51
|
-
min: ({ props }) => props.min,
|
|
52
|
-
max: ({ props }) => props.max
|
|
53
|
-
}
|
|
54
|
-
}
|
|
3
|
+
export * from './Input'
|
|
4
|
+
export * from './Number'
|
|
5
|
+
export * from './CheckBox'
|
|
6
|
+
export * from './Radio'
|
|
7
|
+
export * from './Toggle'
|
|
8
|
+
export * from './TextArea'
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/input",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.164",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"source": "index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"gitHead": "
|
|
7
|
+
"gitHead": "943a48800e5959b8c1f15d5d8d49224565038c23",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@
|
|
9
|
+
"@domql/utils": "latest",
|
|
10
|
+
"@symbo.ls/atoms": "latest",
|
|
11
|
+
"@symbo.ls/paragraphbutton": "latest"
|
|
10
12
|
}
|
|
11
13
|
}
|