@symbo.ls/input 2.11.160 → 2.11.162

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 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
@@ -0,0 +1,13 @@
1
+ 'use strict'
2
+
3
+ import { Input } from './Input'
4
+
5
+ export const NumberInput = {
6
+ extend: Input,
7
+ props: { type: 'number' },
8
+ attr: {
9
+ step: ({ props }) => props.step,
10
+ min: ({ props }) => props.min,
11
+ max: ({ props }) => props.max
12
+ }
13
+ }
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/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: '#47FF09',
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: '#CFCFD1',
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,7 @@
1
1
  'use strict'
2
2
 
3
- import { isString, replaceLiteralsWithObjectFields } from '@domql/utils'
4
- import { Focusable } from '@symbo.ls/atoms'
5
-
6
- export const Input = {
7
- extend: [Focusable],
8
- tag: 'input',
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'
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@symbo.ls/input",
3
- "version": "2.11.160",
3
+ "version": "2.11.162",
4
4
  "main": "index.js",
5
5
  "source": "index.js",
6
6
  "license": "MIT",
7
- "gitHead": "f36bc99a2d0c1b771e3d8e104d1b1005b2b0a33a",
7
+ "gitHead": "fe3359a1d6c14d38f45f5e5db10ef2056947a228",
8
8
  "dependencies": {
9
+ "@domql/utils": "latest",
9
10
  "@symbo.ls/atoms": "latest"
10
11
  }
11
12
  }