@symbo.ls/timepicker 2.11.55 → 2.11.132

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/TimePickerItem.js CHANGED
@@ -1,24 +1,12 @@
1
1
  'use strict'
2
2
 
3
3
  import { Flex } from '@symbo.ls/atoms'
4
- import { Input } from '@symbo.ls/input'
5
- import { Button } from '@symbo.ls/button'
6
4
 
7
5
  const props = {
8
6
  align: 'center center',
9
7
  flow: 'column',
10
8
  gap: 'X',
11
9
  style: {
12
- 'input[type=number]::-webkit-inner-spin-button': {
13
- '-webkit-appearance': 'none',
14
- margin: 0
15
- },
16
- 'input[type=number]::-webkit-outer-spin-button': {
17
- '-webkit-appearance': 'none',
18
- margin: 0
19
- },
20
- 'input[type=number]': { '-webkit-appearance': 'textfield' },
21
- 'input:focus < button': { border: '3px solid red' },
22
10
  '> button': {
23
11
  padding: '0',
24
12
  background: 'transparent',
@@ -26,16 +14,6 @@ const props = {
26
14
  fontSize: `${12 / 16}em`,
27
15
  display: 'none'
28
16
  }
29
- },
30
-
31
- input: {
32
- boxSize: 'C C',
33
- round: 'Z',
34
- padding: '0',
35
- align: 'center center',
36
- textAlign: 'center',
37
- color: 'white',
38
- background: 'white .15'
39
17
  }
40
18
  }
41
19
 
@@ -43,7 +21,27 @@ export const TimePickerItem = {
43
21
  tag: 'label',
44
22
  extend: Flex,
45
23
  props,
46
- upButton: { extend: Button, props: { icon: 'plus' } },
47
- input: { extend: [Input, Flex], attr: { type: 'number', min: '1', max: '24', value: '1' } },
48
- downButton: { extend: Button, props: { icon: 'minus' } }
24
+ Button_plus: { icon: 'plus' },
25
+ NumberInput: {
26
+ boxSize: 'C C',
27
+ round: 'Z',
28
+ padding: '0',
29
+ align: 'center center',
30
+ textAlign: 'center',
31
+ min: 0,
32
+ max: 24,
33
+ placeholder: '00',
34
+ appearance: 'textfield',
35
+ theme: 'secondary',
36
+
37
+ '::-webkit-inner-spin-button': {
38
+ style: { appearance: 'none' },
39
+ margin: 0
40
+ },
41
+ '::-webkit-outer-spin-button': {
42
+ style: { appearance: 'none' },
43
+ margin: 0
44
+ }
45
+ },
46
+ Button_minus: { icon: 'minus' }
49
47
  }
@@ -0,0 +1,42 @@
1
+ 'use strict'
2
+
3
+ import { Flex } from '@symbo.ls/atoms'
4
+ import { Button } from '@symbo.ls/button'
5
+
6
+ const props = {
7
+ boxSize: 'C B2',
8
+ flow: 'column',
9
+ overflow: 'hidden',
10
+ round: 'Z',
11
+ theme: 'secondary'
12
+ }
13
+
14
+ export const TimeSwitcher = {
15
+ props,
16
+ extend: Flex,
17
+
18
+ childExtend: {
19
+ extend: Button,
20
+ props: ({ state, key }) => ({
21
+ active: state.activeShift === key,
22
+ padding: '0',
23
+ flex: '1',
24
+ width: '100%',
25
+ fontSize: 'Y',
26
+ textTransform: 'uppercase',
27
+ round: '0',
28
+ background: 'transparent',
29
+ color: 'currentColor',
30
+ lineHeight: '1',
31
+ '.active': { theme: 'primary' }
32
+ }),
33
+ on: {
34
+ click: (event, element, state) => {
35
+ state.update({ activeShift: element.key })
36
+ }
37
+ }
38
+ },
39
+
40
+ am: { text: 'am' },
41
+ pm: { text: 'pm' }
42
+ }
package/index.js CHANGED
@@ -2,34 +2,70 @@
2
2
 
3
3
  import { Flex } from '@symbo.ls/atoms'
4
4
  import { Dialog } from '@symbo.ls/dialog'
5
- import { TimePickerItem } from './TimePickerItem'
6
5
 
7
- const props = {
8
- flow: 'column',
9
- width: 'fit-content',
10
- background: 'rgba(255, 255, 255, .15)',
11
- padding: 'A A B A',
12
- round: 'Z',
6
+ export const TimePicker = {
7
+ extend: [Dialog, Flex],
8
+
9
+ state: {
10
+ activeShift: 'am'
11
+ },
12
+
13
+ props: {
14
+ flow: 'column',
15
+ width: 'fit-content',
16
+ padding: 'Z A'
17
+ },
13
18
 
14
- title: {
19
+ Title: {
15
20
  fontSize: 'Z1',
16
21
  textTransform: 'capitalize',
17
- padding: '- - B -'
22
+ padding: '- - A -',
23
+ text: 'enter time'
18
24
  },
19
25
 
20
- content: {
21
- align: 'center center',
22
- gap: 'A',
23
- timePickers: {
26
+ Flex: {
27
+ props: {
24
28
  align: 'center center',
25
- gap: 'Y2'
26
- }
29
+ gap: 'A'
30
+ },
31
+
32
+ Flex: {
33
+ tag: 'label',
34
+ props: {
35
+ align: 'center center',
36
+ gap: 'Y2'
37
+ },
38
+ TimePickerItem_hh: {
39
+ NumberInput: {
40
+ placeholder: 'HH',
41
+ min: '0',
42
+ max: '11'
43
+ }
44
+ },
45
+ Span: ':',
46
+ TimePickerItem_mm: {
47
+ NumberInput: {
48
+ placeholder: 'MM',
49
+ min: '0',
50
+ max: '59'
51
+ }
52
+ },
53
+ Span_2: ':',
54
+ TimePickerItem_ss: {
55
+ NumberInput: {
56
+ placeholder: 'SS',
57
+ min: '0',
58
+ max: '59'
59
+ }
60
+ }
61
+ },
62
+ TimeSwitcher: {}
27
63
  },
28
64
 
29
- footButtons: {
65
+ DialogFooter: {
30
66
  align: 'center flex-end',
31
- gap: 'A1',
32
- padding: 'B1 - - -',
67
+ gap: 'X',
68
+ margin: 'Z2 -Z2 -Z',
33
69
  childProps: {
34
70
  background: 'transparent',
35
71
  padding: '0',
@@ -38,25 +74,5 @@ const props = {
38
74
  }
39
75
  }
40
76
 
41
- export const TimePicker = {
42
- extend: [Dialog, Flex],
43
- props,
44
- title: { text: 'enter time' },
45
- content: {
46
- extend: Flex,
47
- timePickers: {
48
- tag: 'label',
49
- extend: Flex,
50
- ...[
51
- { extend: TimePickerItem },
52
- ':',
53
- { extend: TimePickerItem },
54
- ':',
55
- { extend: TimePickerItem }
56
- ]
57
- },
58
- TimeSwitcher: {}
59
- },
60
-
61
- DialogFooter: {}
62
- }
77
+ export * from './TimePickerItem'
78
+ export * from './TimeSwitcher'
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/timepicker",
3
- "version": "2.11.55",
3
+ "version": "2.11.132",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "f4a6af272593be22cbf1337ddb25afec00ba359d",
6
+ "gitHead": "13027443598f113dd2b79ddf7aaf1adbd46d97d7",
7
7
  "dependencies": {
8
8
  "@symbo.ls/atoms": "latest",
9
9
  "@symbo.ls/button": "latest",
package/TimeSwithcher.js DELETED
@@ -1,63 +0,0 @@
1
- 'use strict'
2
-
3
- import { Flex } from '@symbo.ls/atoms'
4
- import { Button } from '@symbo.ls/button'
5
-
6
- const props = {
7
- boxSize: `C ${34 / 16}em`,
8
- flow: 'column',
9
- overflow: 'hidden',
10
- round: 'Z',
11
- background: 'rgba(255, 255, 255, .15)',
12
- childProps: {
13
- padding: '0',
14
- background: 'transparent',
15
- color: 'white',
16
- flex: '1',
17
- width: '100%',
18
- fontSize: 'Y',
19
- textTransform: 'capitalize',
20
- round: '0'
21
- }
22
- }
23
-
24
- export const TimeSwitcher = {
25
- props,
26
- extend: Flex,
27
-
28
- childExtend: Button,
29
- ...[
30
- {
31
- text: 'am',
32
- on: {
33
- click: (event, element, state) => {
34
- state.update({ activeTime: true })
35
- }
36
- },
37
- class: {
38
- show: (element, state) => state.activeTime
39
- ? {
40
- background: '#0079FD',
41
- pointerEvents: 'none'
42
- }
43
- : {}
44
- }
45
- },
46
- {
47
- text: 'pm',
48
- on: {
49
- click: (event, element, state) => {
50
- state.update({ activeTime: false })
51
- }
52
- },
53
- class: {
54
- show: (element, state) => state.activeTime === false
55
- ? {
56
- background: '#0079FD',
57
- pointerEvents: 'none'
58
- }
59
- : {}
60
- }
61
- }
62
- ]
63
- }