playbook_ui 14.25.0.pre.alpha.PLAY2379datekitjesttestreact9838 → 14.25.0.pre.alpha.PLAY2413togglefocusstate9789

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 857c4db77c5449512c36477aee37bde4f65f88c6c33b2bf9df0d9d350e37d4fd
4
- data.tar.gz: ca0e8b52fd24f54ce65cdbe782bf3c6051de6b1c2624b10d466762a06e76d9ff
3
+ metadata.gz: de6d77764e1005d84f779b54ad0d3c2e2f5ee63c1691aed260cf27c693218404
4
+ data.tar.gz: 145ef5440f3929315bf4c3d99a29f50e1caa587d0672ce09d145878cb650939b
5
5
  SHA512:
6
- metadata.gz: 1e3aac8890787a5379a71b4b28c880dd8df9cb4182d7b8af41252ae59fad1593c979cd590b1226e8d66fd7c0f4a2a44c86fb075724f21f24289173bcc64942df
7
- data.tar.gz: 746dcffc0cd545b5e8d3077401a7371da9b08812f4edf60ee5f77fa5e117f5bb5c143995acd3e9784d57383ef0f84fcaab0c3d6ceea7d235294ebbd140be7dd2
6
+ metadata.gz: 22c3c0a055a6d6f1743bcdabbd23e5a7cb6b1fa0f103e29db749364b85b8012fb2438cf0008877d14465545d033e6ef136220b569b6438c4589c028aea9ff7b0
7
+ data.tar.gz: b4f81fcd52d01d76e0d03cdf23df691384a1c8f24d2dc76f85b4759d045d2734a920fb624b08cf5e55cb1b1b102ff245f572379a9c362103d270c73cf3d64158
@@ -46,7 +46,16 @@ $transition: .2s ease-in-out;
46
46
  }
47
47
 
48
48
  input {
49
- display: none;
49
+ position: absolute;
50
+ opacity: 0;
51
+ width: 1px;
52
+ height: 1px;
53
+ overflow: hidden;
54
+
55
+ &:focus + .pb_toggle_control {
56
+ box-shadow: 0px 0px 0px 2px $white, 0px 0px 0px 4px $primary;
57
+ outline: none;
58
+ }
50
59
 
51
60
  &:disabled + .pb_toggle_control {
52
61
  cursor: not-allowed;
@@ -61,7 +70,11 @@ $transition: .2s ease-in-out;
61
70
  }
62
71
 
63
72
  input:checked {
64
- display: none;
73
+ position: absolute;
74
+ opacity: 0;
75
+ width: 1px;
76
+ height: 1px;
77
+ overflow: hidden;
65
78
 
66
79
  &:checked + .pb_toggle_control {
67
80
  border: $border_success;
@@ -73,6 +86,11 @@ $transition: .2s ease-in-out;
73
86
  }
74
87
  }
75
88
 
89
+ &:checked:focus + .pb_toggle_control {
90
+ box-shadow: 0px 0px 0px 2px $white, 0px 0px 0px 4px $primary;
91
+ outline: none;
92
+ }
93
+
76
94
  &:disabled + .pb_toggle_control {
77
95
  cursor: not-allowed;
78
96
  opacity: 0.5;
@@ -23,6 +23,7 @@ type Props = {
23
23
  name?: string,
24
24
  onChange?: InputCallback<HTMLInputElement>,
25
25
  size?: "sm" | "md",
26
+ tabIndex?: number,
26
27
  value?: string,
27
28
  } & GlobalProps
28
29
 
@@ -40,6 +41,7 @@ const Toggle = ({
40
41
  // Function body here
41
42
  },
42
43
  size = 'sm',
44
+ tabIndex,
43
45
  value,
44
46
  ...props
45
47
  }: Props): React.ReactElement => {
@@ -73,6 +75,7 @@ const Toggle = ({
73
75
  disabled={disabled}
74
76
  name={name}
75
77
  onChange={onChange}
78
+ tabIndex={tabIndex}
76
79
  type="checkbox"
77
80
  value={value}
78
81
  />
@@ -1,9 +1,11 @@
1
1
  <%= pb_rails("toggle", props: {
2
- checked: true
2
+ checked: true,
3
+ input_options: { tabindex: 0 }
3
4
  }) %>
4
5
 
5
6
  <br>
6
7
 
7
8
  <%= pb_rails("toggle", props: {
8
- checked: false
9
+ checked: false,
10
+ input_options: { tabindex: 0 }
9
11
  }) %>
@@ -6,11 +6,12 @@ const ToggleDefault = () => {
6
6
  <>
7
7
  <Toggle
8
8
  checked
9
+ tabIndex={0}
9
10
  />
10
11
 
11
12
  <br />
12
13
 
13
- <Toggle />
14
+ <Toggle tabIndex={0} />
14
15
  </>
15
16
  )
16
17
  }