playbook_ui 14.3.0.pre.rc.1 → 14.3.0.pre.rc.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: 0f6db1dde8cbc0520b9232aac926dd45d49152d977a5105fd717019d42e7c18a
4
- data.tar.gz: 8d6a83da07074cea753a6367f0968edb5fbcdd62a3af1aec19c6b3d76257fd40
3
+ metadata.gz: f47148e7be42c7c8683dd6ba7b555e7d9f4461b285cbe9687888f3c4a79ed9f1
4
+ data.tar.gz: 88585a241ac13801752029b6c1d28eabd3fded78b711a4c749602d51e0286900
5
5
  SHA512:
6
- metadata.gz: 6a433022a63e782208530b3b831f6d6eddfada78103e5a645ff22b663fa138b5766bb61b29592374d795fb3d1b417ccba408c10f4e110eb45f690631e335c30c
7
- data.tar.gz: 815301f27a81d6d1ec02b038db7d601cce656c07118b6a67f88502583630be3db987f0bbe75ecadb5bbdbfc97896d1d74b6566bb7848c8dd1f25e00611d0cca3
6
+ metadata.gz: db96992d3c93a7b446613954d26fb36c1488eabbd9d47cead53950a3751053e05d473f495a23360cc34b580edb53f6c401c57492b7ad59e93fed4fab37155472
7
+ data.tar.gz: '0843c1e25291a8b97bab9bb61f7415f708cfa0b82e2cd93933fe0aeee9133c740d2c740821c20eca3b27182c44047aff843c02e108020805ce90489b78d70470'
@@ -16,6 +16,7 @@ type CircleIconButtonProps = {
16
16
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  link?: string,
19
+ loading?: boolean,
19
20
  onClick?: React.MouseEventHandler<HTMLElement>,
20
21
  newWindow?: boolean,
21
22
  type?: 'button' | 'submit' | 'reset' | undefined,
@@ -32,6 +33,7 @@ const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
32
33
  htmlOptions = {},
33
34
  icon,
34
35
  id,
36
+ loading = false,
35
37
  onClick = noop,
36
38
  type,
37
39
  link,
@@ -61,6 +63,7 @@ const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
61
63
  disabled={disabled}
62
64
  htmlType={type}
63
65
  link={link}
66
+ loading={loading}
64
67
  newWindow={newWindow}
65
68
  onClick={onClick}
66
69
  text={null}
@@ -1,5 +1,5 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
2
+ <%= pb_rails("button", props: {type: object.type, loading: object.loading, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
3
3
  <%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
4
4
  <% end %>
5
5
  <% end %>
@@ -12,6 +12,8 @@ module Playbook
12
12
  prop :disabled, type: Playbook::Props::Boolean,
13
13
  default: false
14
14
  prop :icon, required: true
15
+ prop :loading, type: Playbook::Props::Boolean,
16
+ default: false
15
17
  prop :link
16
18
  prop :new_window, type: Playbook::Props::Boolean,
17
19
  default: false
@@ -15,3 +15,18 @@ test('default test', () => {
15
15
 
16
16
  expect(kit).toHaveClass('pb_circle_icon_button_kit')
17
17
  })
18
+
19
+ test('passes loading prop to button', () => {
20
+ render(
21
+ <CircleIconButton
22
+ data={{ testid: 'loading-test' }}
23
+ icon="plus"
24
+ loading
25
+ />
26
+ )
27
+
28
+ const kit = screen.getByTestId('loading-test')
29
+ const button = kit.querySelector('.pb_button_kit_primary_inline_enabled_loading')
30
+
31
+ expect(button).toBeInTheDocument()
32
+ })
@@ -0,0 +1,29 @@
1
+ <%= pb_rails("circle_icon_button", props: {
2
+ variant: "primary",
3
+ icon: "plus",
4
+ loading: true
5
+ }) %>
6
+
7
+ <br/>
8
+
9
+ <%= pb_rails("circle_icon_button", props: {
10
+ variant: "secondary",
11
+ icon: "pen",
12
+ loading: true
13
+ }) %>
14
+
15
+ <br/>
16
+
17
+ <%= pb_rails("circle_icon_button", props: {
18
+ disabled: true,
19
+ icon: "times",
20
+ loading: true
21
+ }) %>
22
+
23
+ <br/>
24
+
25
+ <%= pb_rails("circle_icon_button", props: {
26
+ variant: "link",
27
+ icon: "user",
28
+ loading: true
29
+ }) %>
@@ -0,0 +1,43 @@
1
+ import React from 'react'
2
+
3
+ import CircleIconButton from '../_circle_icon_button'
4
+
5
+ const CircleIconButtonLoading = (props) => (
6
+ <div>
7
+ <CircleIconButton
8
+ icon="plus"
9
+ loading
10
+ variant="primary"
11
+ {...props}
12
+ />
13
+
14
+ <br />
15
+
16
+ <CircleIconButton
17
+ icon="pen"
18
+ loading
19
+ variant="secondary"
20
+ {...props}
21
+ />
22
+
23
+ <br />
24
+
25
+ <CircleIconButton
26
+ disabled
27
+ icon="times"
28
+ loading
29
+ {...props}
30
+ />
31
+
32
+ <br />
33
+
34
+ <CircleIconButton
35
+ icon="user"
36
+ loading
37
+ variant="link"
38
+ {...props}
39
+ />
40
+ </div>
41
+ )
42
+
43
+ export default CircleIconButtonLoading
@@ -3,8 +3,10 @@ examples:
3
3
  rails:
4
4
  - circle_icon_button_default: Default
5
5
  - circle_icon_button_link: Link
6
+ - circle_icon_button_loading: Loading
6
7
 
7
8
  react:
8
9
  - circle_icon_button_default: Default
9
10
  - circle_icon_button_click: Click Handler
10
11
  - circle_icon_button_link: Link
12
+ - circle_icon_button_loading: Loading
@@ -1,3 +1,4 @@
1
1
  export { default as CircleIconButtonDefault } from './_circle_icon_button_default.jsx'
2
2
  export { default as CircleIconButtonClick } from './_circle_icon_button_click.jsx'
3
3
  export { default as CircleIconButtonLink } from './_circle_icon_button_link.jsx'
4
+ export { default as CircleIconButtonLoading } from './_circle_icon_button_loading.jsx'