playbook_ui 9.14.1.alpha.highcharts9 → 9.14.1.alpha.radio.alignment

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: 302b8076ceb084d02f4d81d43be02e350a68ccf8778631b7fc8c400225ec22e4
4
- data.tar.gz: 4391b64b9bab485e4cba1337b71a39af28bfab57c36b962284f80efc4de2850e
3
+ metadata.gz: 5e08eae10f004ec81d07fd357b310852d1dc8de8de4c0732836b9df38437fb20
4
+ data.tar.gz: 74d7d8c6ec38282118b1d0bc2894b1fe09e75dc3dddf86df41a479b440069958
5
5
  SHA512:
6
- metadata.gz: b380585499868dc1a5bc1a99d2ec6884c66e6de4ff565562eb955a82e24ea976658efd5333f60e51681275882c5cf9106ba972d7af8e7721353bbe67f2bdde85
7
- data.tar.gz: aa300d2ed023130ecb4da83bf87ce3e72f3ec26ee29006adf190e2ec8127fce98dbe87fb69591e287961b3814981cd1e3091caafdc51ffa5bb1a9bfdb92d2e7d
6
+ metadata.gz: 59b7d3d14fd1f7f705793552ff6484f8726e0e0fbc70b0caeae9c78886856e84ddb701bebf8ef05f2f87762c7461fdb0e49690e226504971f81ff289c075f9f1
7
+ data.tar.gz: d50354e9536aba0c40f449c5b6dd3b1bd50d27da181c961ecfc6fb074690a6740dd89d25c9a7fc903969f369a174dc43b066d224cdff637b040d96d94d1a3f33
@@ -9,6 +9,7 @@ import { globalProps } from '../utilities/globalProps.js'
9
9
 
10
10
  type RadioProps = {
11
11
  aria?: object,
12
+ alignment?: String,
12
13
  checked?: Boolean,
13
14
  children?: Node,
14
15
  className?: String,
@@ -25,6 +26,7 @@ type RadioProps = {
25
26
 
26
27
  const Radio = ({
27
28
  aria = {},
29
+ alignment = '',
28
30
  children,
29
31
  className,
30
32
  dark = false,
@@ -40,7 +42,7 @@ const Radio = ({
40
42
  }: RadioProps, ref) => {
41
43
  const ariaProps = buildAriaProps(aria)
42
44
  const dataProps = buildDataProps(data)
43
- const classes = classnames(buildCss('pb_radio_kit'), { error }, { dark }, globalProps(props), className)
45
+ const classes = classnames(buildCss('pb_radio_kit'), { error }, { dark }, globalProps(props), alignment, className)
44
46
 
45
47
  return (
46
48
  <label
@@ -38,6 +38,16 @@
38
38
  }
39
39
  }
40
40
  }
41
+
42
+ &.vertical {
43
+ flex-direction: column;
44
+ align-items: center;
45
+ .pb_radio_button {
46
+ margin-right: 0px;
47
+ margin-bottom: $space_xs;
48
+ }
49
+ }
50
+
41
51
  &.dark {
42
52
  .pb_radio_button {
43
53
  border-color: $border_dark;
@@ -0,0 +1,27 @@
1
+ <%= pb_rails("flex") do %>
2
+ <%= pb_rails("radio", props: {
3
+ alignment: "vertical",
4
+ text: "Power",
5
+ input_options: {
6
+ tabindex: 0
7
+ },
8
+ margin_right: "sm",
9
+ name: "group 1",
10
+ value: "Power"
11
+ }) %>
12
+
13
+ <%= pb_rails("radio", props: {
14
+ alignment: "vertical",
15
+ text: "Nitro",
16
+ margin_right: "sm",
17
+ name: "group 1",
18
+ value: "Nitro"
19
+ }) %>
20
+
21
+ <%= pb_rails("radio", props: {
22
+ alignment: "vertical",
23
+ text: "Google",
24
+ name: "group 1",
25
+ value: "Google"
26
+ }) %>
27
+ <% end %>
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import { Flex, Radio } from '../../'
3
+
4
+ const RadioAlignment = () => {
5
+ return (
6
+ <Flex>
7
+ <Radio
8
+ alignment="vertical"
9
+ label="Power"
10
+ marginRight="sm"
11
+ name="Group2"
12
+ tabIndex={0}
13
+ value="Power"
14
+ />
15
+ <br />
16
+ <Radio
17
+ alignment="vertical"
18
+ defaultChecked={false}
19
+ label="Nitro"
20
+ marginRight="sm"
21
+ name="Group2"
22
+ value="Nitro"
23
+ />
24
+ <br />
25
+ <Radio
26
+ alignment="vertical"
27
+ defaultChecked={false}
28
+ label="Google"
29
+ name="Group2"
30
+ value="Google"
31
+ />
32
+ </Flex>
33
+ )
34
+ }
35
+
36
+ export default RadioAlignment
@@ -5,8 +5,10 @@ examples:
5
5
  - radio_custom: Custom
6
6
  - radio_error: With Error
7
7
  - radio_options: With Options
8
+ - radio_alignment: Alignment
8
9
 
9
10
  react:
10
11
  - radio_default: Default
11
12
  - radio_custom: Custom
12
13
  - radio_error: With Error
14
+ - radio_alignment: Alignment
@@ -1,3 +1,4 @@
1
1
  export { default as RadioDefault } from './_radio_default.jsx'
2
2
  export { default as RadioCustom } from './_radio_custom.jsx'
3
3
  export { default as RadioError } from './_radio_error.jsx'
4
+ export { default as RadioAlignment } from './_radio_alignment.jsx'
@@ -5,6 +5,8 @@ require "action_view"
5
5
  module Playbook
6
6
  module PbRadio
7
7
  class Radio < Playbook::KitBase
8
+ prop :alignment, type: Playbook::Props::String,
9
+ default: ""
8
10
  prop :checked, type: Playbook::Props::Boolean,
9
11
  default: false
10
12
  prop :error, type: Playbook::Props::Boolean,
@@ -19,7 +21,7 @@ module Playbook
19
21
  default: "radio_text"
20
22
 
21
23
  def classname
22
- generate_classname("pb_radio_kit") + error_class
24
+ generate_classname("pb_radio_kit") + error_class + alignment_class
23
25
  end
24
26
 
25
27
  def selected
@@ -35,6 +37,10 @@ module Playbook
35
37
  def error_class
36
38
  error ? " error" : ""
37
39
  end
40
+
41
+ def alignment_class
42
+ alignment == "vertical" ? " vertical" : ""
43
+ end
38
44
  end
39
45
  end
40
46
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "9.14.1"
5
- VERSION = "9.14.1.alpha.highcharts9"
4
+ PREVIOUS_VERSION = "9.13.0"
5
+ VERSION = "9.14.1.alpha.radio.alignment"
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: 9.14.1.alpha.highcharts9
4
+ version: 9.14.1.alpha.radio.alignment
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: 2021-05-13 00:00:00.000000000 Z
12
+ date: 2021-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1536,6 +1536,8 @@ files:
1536
1536
  - app/pb_kits/playbook/pb_radio/_radio.scss
1537
1537
  - app/pb_kits/playbook/pb_radio/docs/_description.md
1538
1538
  - app/pb_kits/playbook/pb_radio/docs/_footer.md
1539
+ - app/pb_kits/playbook/pb_radio/docs/_radio_alignment.html.erb
1540
+ - app/pb_kits/playbook/pb_radio/docs/_radio_alignment.jsx
1539
1541
  - app/pb_kits/playbook/pb_radio/docs/_radio_custom.html.erb
1540
1542
  - app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
1541
1543
  - app/pb_kits/playbook/pb_radio/docs/_radio_default.html.erb
@@ -2172,8 +2174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2172
2174
  - !ruby/object:Gem::Version
2173
2175
  version: 1.3.1
2174
2176
  requirements: []
2175
- rubyforge_project:
2176
- rubygems_version: 2.7.3
2177
+ rubygems_version: 3.1.4
2177
2178
  signing_key:
2178
2179
  specification_version: 4
2179
2180
  summary: Playbook Design System