playbook_ui 11.1.1.pre.alpha1 → 11.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 187ac4ecc55b431fc4c30a316c1cf4b0e137b2c7a1956931636b66f79bfbce7e
4
- data.tar.gz: ace3fd58252e59d2e97be20a23bc563b4fc243e6d9325cba616ada666d4b5942
3
+ metadata.gz: 562b6e96ab5327c8f7c820f22c6304f2df04d38f0b39d544a594d0753462ff0c
4
+ data.tar.gz: b8dd273bf4290aca790e51a7ec16606f9720e494d254e20f1955c21c96ef2dd9
5
5
  SHA512:
6
- metadata.gz: 61c1344a4ca56732440d0b00fc2cc3a8783f828f331b9561ab7b679e9d6e48c7019b24aadeea31cc808a14be3cd079fa98af43a9852c7f431548c032dfa62a76
7
- data.tar.gz: 7a57d012285cb509b304fa482b6b8d0db59fd9fa57a29c8464312eb2bb03be40ab49979a2efd9546cd9d6894c5fc8db98c1d81e157705ac53e560a67be03502e
6
+ metadata.gz: 81ecd308bdd90d159ba03b8ab04042a618bab5ad68f390bb150da8fbf34b4379ffe59131638efd75a9b77e427b5a210f0cda92ddf3d602a4be613c0a5f4b04c7
7
+ data.tar.gz: 3937a0adf41df49005d81d3fb19abb2188e75201735660ff32430e7f1e50e31ea6bbb73aaf86b42ac60e7faa3ba31ab1b3461d874661108a0814dc70a939d015
@@ -0,0 +1,86 @@
1
+ /*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
2
+
3
+ import React, { forwardRef } from 'react'
4
+ import Body from '../pb_body/_body'
5
+ import classnames from 'classnames'
6
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
8
+
9
+ type RadioProps = {
10
+ aria?: {[key: string]: string},
11
+ alignment?: string,
12
+ checked?: boolean,
13
+ children?: Node,
14
+ className?: string,
15
+ dark?: boolean,
16
+ data?: {[key: string]: string},
17
+ error?: boolean,
18
+ id?: string,
19
+ label: string,
20
+ name: string,
21
+ value: string,
22
+ text: string,
23
+ onChange: (event: React.FormEvent<HTMLInputElement> | null)=>void,
24
+ } & GlobalProps
25
+
26
+ const Radio = ({
27
+ aria = {},
28
+ alignment,
29
+ children,
30
+ className,
31
+ dark = false,
32
+ data = {},
33
+ error = false,
34
+ id,
35
+ label,
36
+ name = 'radio_name',
37
+ text = 'Radio Text',
38
+ value = 'radio_text',
39
+ onChange = () => { void 0 },
40
+ ...props
41
+ }: RadioProps, ref: any) => {
42
+ const ariaProps = buildAriaProps(aria)
43
+ const dataProps = buildDataProps(data)
44
+ const classes = classnames(
45
+ buildCss('pb_radio_kit', alignment ),
46
+ dark ? 'dark': null, error ? 'error': null,
47
+ globalProps(props),
48
+ className)
49
+
50
+ const displayRadio = (props: RadioProps & any) => {
51
+ if (children)
52
+ return (children)
53
+ else
54
+ return (
55
+ <input
56
+ id={id}
57
+ name={name}
58
+ onChange={onChange}
59
+ ref={ref}
60
+ text={text}
61
+ type="radio"
62
+ value={value}
63
+ {...props}
64
+ />
65
+ )}
66
+
67
+ return (
68
+ <label
69
+ {...ariaProps}
70
+ {...dataProps}
71
+ className={classes}
72
+ htmlFor={id}
73
+ >
74
+ <>{displayRadio(props)}</>
75
+ <span className="pb_radio_button" />
76
+ <Body
77
+ dark={dark}
78
+ status={error ? 'negative' : null}
79
+ text={label}
80
+ variant={null}
81
+ />
82
+ </label>
83
+ )
84
+ }
85
+
86
+ export default forwardRef(Radio)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "11.1.0"
5
- VERSION = "11.1.1.pre.alpha1"
4
+ PREVIOUS_VERSION = "11.1.1"
5
+ VERSION = "11.1.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.1.1.pre.alpha1
4
+ version: 11.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-07-15 00:00:00.000000000 Z
12
+ date: 2022-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1491,8 +1491,8 @@ files:
1491
1491
  - app/pb_kits/playbook/pb_progress_step/progress_step.rb
1492
1492
  - app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb
1493
1493
  - app/pb_kits/playbook/pb_progress_step/progress_step_item.rb
1494
- - app/pb_kits/playbook/pb_radio/_radio.jsx
1495
1494
  - app/pb_kits/playbook/pb_radio/_radio.scss
1495
+ - app/pb_kits/playbook/pb_radio/_radio.tsx
1496
1496
  - app/pb_kits/playbook/pb_radio/docs/_description.md
1497
1497
  - app/pb_kits/playbook/pb_radio/docs/_footer.md
1498
1498
  - app/pb_kits/playbook/pb_radio/docs/_radio_alignment.html.erb
@@ -2224,9 +2224,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
2224
2224
  version: '0'
2225
2225
  required_rubygems_version: !ruby/object:Gem::Requirement
2226
2226
  requirements:
2227
- - - ">"
2227
+ - - ">="
2228
2228
  - !ruby/object:Gem::Version
2229
- version: 1.3.1
2229
+ version: '0'
2230
2230
  requirements: []
2231
2231
  rubygems_version: 3.3.7
2232
2232
  signing_key:
@@ -1,78 +0,0 @@
1
- /* @flow */
2
- /*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
3
-
4
- import React, { forwardRef } from 'react'
5
- import Body from '../pb_body/_body'
6
- import classnames from 'classnames'
7
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
8
- import { globalProps } from '../utilities/globalProps'
9
-
10
- type RadioProps = {
11
- aria?: object,
12
- alignment?: String,
13
- checked?: Boolean,
14
- children?: Node,
15
- className?: String,
16
- dark?: boolean,
17
- data?: object,
18
- error?: Boolean,
19
- id?: String,
20
- label: String,
21
- name: String,
22
- value: String,
23
- text: String,
24
- onChange: (Boolean)=>void,
25
- }
26
-
27
- const Radio = ({
28
- aria = {},
29
- alignment = '',
30
- children,
31
- className,
32
- dark = false,
33
- data = {},
34
- error = false,
35
- id,
36
- label,
37
- name = 'radio_name',
38
- text = 'Radio Text',
39
- value = 'radio_text',
40
- onChange = () => {},
41
- ...props
42
- }: RadioProps, ref) => {
43
- const ariaProps = buildAriaProps(aria)
44
- const dataProps = buildDataProps(data)
45
- const classes = classnames(buildCss('pb_radio_kit'), { error }, { dark }, globalProps(props), alignment, className)
46
-
47
- return (
48
- <label
49
- {...ariaProps}
50
- {...dataProps}
51
- className={classes}
52
- htmlFor={id}
53
- >
54
- <If condition={children}>
55
- {children}
56
- <Else />
57
- <input
58
- {...props}
59
- id={id}
60
- name={name}
61
- onChange={onChange}
62
- ref={ref}
63
- text={text}
64
- type="radio"
65
- value={value}
66
- />
67
- </If>
68
- <span className="pb_radio_button" />
69
- <Body
70
- dark={dark}
71
- status={error ? 'negative' : null}
72
- text={label}
73
- />
74
- </label>
75
- )
76
- }
77
-
78
- export default forwardRef(Radio)