playbook_ui 15.1.0 → 15.2.0.pre.alpha.buttonfix11269

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +7 -0
  3. data/app/pb_kits/playbook/pb_button/_button.scss +6 -0
  4. data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +7 -3
  5. data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +29 -0
  6. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb +31 -0
  7. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md +7 -0
  8. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb +21 -0
  9. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.md +7 -0
  10. data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
  11. data/app/pb_kits/playbook/pb_button/index.js +99 -0
  12. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +4 -0
  13. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.html.erb +16 -16
  14. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx +2 -1
  15. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.html.erb +31 -31
  16. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +4 -3
  17. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +105 -29
  18. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +11 -0
  19. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +2 -2
  20. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +15 -21
  21. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +6 -5
  22. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +2 -0
  23. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +11 -3
  24. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +9 -8
  25. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +36 -9
  26. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +3 -0
  27. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +14 -6
  28. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +8 -4
  29. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +5 -0
  30. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +1 -0
  31. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +3 -1
  32. data/app/pb_kits/playbook/pb_text_input/text_input.rb +6 -0
  33. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
  34. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +39 -1
  35. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -0
  36. data/app/pb_kits/playbook/utilities/_hover.scss +2 -2
  37. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -2
  38. data/dist/chunks/{_line_graph-CW8Ygzyq.js → _line_graph-BxcVBQsJ.js} +1 -1
  39. data/dist/chunks/_typeahead-eZENQ_Y_.js +6 -0
  40. data/dist/chunks/{_weekday_stacked-3-FtXg76.js → _weekday_stacked-BhPyFGlS.js} +3 -3
  41. data/dist/chunks/{lib-izYrkvOQ.js → lib-QZuu1ltS.js} +2 -2
  42. data/dist/chunks/{pb_form_validation-Cah5Z5J3.js → pb_form_validation-CleM960_.js} +1 -1
  43. data/dist/chunks/vendor.js +1 -1
  44. data/dist/menu.yml +1 -1
  45. data/dist/playbook-doc.js +2 -2
  46. data/dist/playbook-rails-react-bindings.js +1 -1
  47. data/dist/playbook-rails.js +1 -1
  48. data/dist/playbook.css +1 -1
  49. data/lib/playbook/hover.rb +5 -1
  50. data/lib/playbook/version.rb +2 -2
  51. metadata +13 -7
  52. data/dist/chunks/_typeahead-DUIMqJiu.js +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a9b97f8b1cfbe21c7f5950db6fb2a233b94de20e5f2dc2d5d41222f71bce0f3
4
- data.tar.gz: 825330d08fa7304d115fc3b6916855f9b04ff43e6cc6fc6839ea3dea2269e871
3
+ metadata.gz: dd441e8b4c1d1123deb792c33923f58723d1d215a2e600d57fd794c1b7fc02b1
4
+ data.tar.gz: 1fe6118d87e309c21a2829d8eaf2289c5a858adfb3edfdb957d42924398df5ca
5
5
  SHA512:
6
- metadata.gz: 83f8b4447c6cf013383fcfe5932a52d5a50865c4c27db488cd082d76f124a3c34ef542289de2f2fc0b5f36827c968cb1f693c99cefbdb3c543de35caed2ed5f6
7
- data.tar.gz: 03f0a987a4da2bbe382ea13c1fe18525d2a23f4ff637794218686aa57beed6b48c86c94565519df870b48165566c4c9635c319c263a568a6f8bae7ff92a77435
6
+ metadata.gz: 23005df9552a84b78102f4be73435e0e03f4d9dff0eb3f434a9c4d0e8817f15e54aa2d8443a2433d86dd900c24abfd9d120838162d597eafdd5a3863f053e10d
7
+ data.tar.gz: '039709fb78e0cc12324d100ffa6a5da8649f4a05b406e1156050466a29742a960813cf42a70b2e871a81eb8c0460e54da407465ab8d3b53fd46407b5f5f4de8b'
@@ -203,6 +203,13 @@ export function useTableState({
203
203
  onRowPinningChange({ top: allPinned });
204
204
  }, [table, pinnedRows?.value?.top?.join(',')]);
205
205
 
206
+ // Set pagination state when pagination is enabled
207
+ useEffect(() => {
208
+ if (pagination && paginationProps?.pageSize) {
209
+ table.setPageSize(paginationProps.pageSize);
210
+ }
211
+ }, [pagination, paginationProps?.pageSize, table]);
212
+
206
213
  // Check if table has any sub-rows
207
214
  const hasAnySubRows = table.getRowModel().rows.some(row => row.subRows && row.subRows.length > 0);
208
215
  const selectedRowsLength = Object.keys(table.getState().rowSelection).length;
@@ -81,6 +81,12 @@ $pb_button_sizes: (
81
81
  // Loading state
82
82
  &.pb_button_loading {
83
83
  @include pb_button_loading(true);
84
+ &.pb_button_size_sm {
85
+ min-height: 30px;
86
+ }
87
+ &.pb_button_size_lg {
88
+ min-height: 45px;
89
+ }
84
90
  }
85
91
 
86
92
  // Disabled state
@@ -1,3 +1,7 @@
1
- <%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", loading: true, margin_right: "lg" }) %>
2
- <%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "secondary", loading: true, margin_right: "lg" }) %>
3
- <%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "link", loading: true, margin_right: "lg" }) %>
1
+ <%= pb_rails("caption", props: { margin_y: "md", text: "Button variants with loading" }) %>
2
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg" }) %>
3
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "secondary", loading: true, margin_right: "lg" }) %>
4
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "link", loading: true, margin_right: "lg" }) %>
5
+ <%= pb_rails("caption", props: { margin_y: "md", text: "Button sizes with loading" }) %>
6
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "sm", margin_right: "lg" }) %>
7
+ <%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "lg", margin_right: "lg" }) %>
@@ -1,8 +1,13 @@
1
1
  import React from 'react'
2
2
  import Button from "../../pb_button/_button"
3
+ import Caption from "../../pb_caption/_caption"
3
4
 
4
5
  const ButtonLoading = (props) => (
5
6
  <div>
7
+ <Caption
8
+ marginY="md"
9
+ text="Button variants with loading"
10
+ />
6
11
  <Button
7
12
  aria={{ label: 'Loading' }}
8
13
  loading
@@ -31,6 +36,30 @@ const ButtonLoading = (props) => (
31
36
  variant="link"
32
37
  {...props}
33
38
  />
39
+ <br/>
40
+ <Caption
41
+ marginY="md"
42
+ text="Button sizes with loading"
43
+ />
44
+ <Button
45
+ aria={{ label: 'Loading' }}
46
+ loading
47
+ marginRight='lg'
48
+ size="sm"
49
+ tabIndex={0}
50
+ text="Small Button"
51
+ {...props}
52
+ />
53
+ {' '}
54
+ <Button
55
+ aria={{ label: 'Loading' }}
56
+ loading
57
+ marginRight='lg'
58
+ size="lg"
59
+ tabIndex={0}
60
+ text="Small Button"
61
+ {...props}
62
+ />
34
63
  </div>
35
64
  )
36
65
 
@@ -0,0 +1,31 @@
1
+ <%= pb_rails("body", props: { text: "Click to disable the Buttons below", id: "toggle-disabled-demo", cursor: "pointer", color:"link", margin_bottom:"sm" }) %>
2
+ <%= pb_rails("body", props: { text: "Click to enable the Buttons below", id: "toggle-enabled-demo", cursor: "pointer", color:"link", margin_bottom:"sm" }) %>
3
+
4
+ <%= pb_rails("card", props:{display:"flex", flex_direction:"row", justify_content:"center"}) do %>
5
+ <%= pb_rails("button", props: { text: "I am a Button", id: "normal_managed_button", data:{pb_button_managed: true}, margin_right: "lg" }) %>
6
+ <%= pb_rails("button", props: { text: "I am an <a> Button", id: "a_tag_managed_button", tag:"a", data:{pb_button_managed: true}, link: "http://google.com"}) %>
7
+ <% end %>
8
+ <script>
9
+ document.addEventListener('DOMContentLoaded', function () {
10
+ const disableTrigger = document.querySelector('#toggle-disabled-demo')
11
+ const enableTrigger = document.querySelector('#toggle-enabled-demo')
12
+
13
+ // Find the Buttons you want to 'manage'
14
+ const btn = document.querySelector('#normal_managed_button');
15
+ const link = document.querySelector('#a_tag_managed_button');
16
+
17
+ disableTrigger.addEventListener('click', (e) => {
18
+ // Disable default button
19
+ btn.setAttribute('disabled', true)
20
+ // Disable a tag button
21
+ link.setAttribute('aria-disabled', 'true')
22
+ });
23
+
24
+ enableTrigger.addEventListener('click', (e) => {
25
+ // Enable default button
26
+ btn.removeAttribute('disabled')
27
+ // Enable a tag button
28
+ link.removeAttribute('aria-disabled')
29
+ });
30
+ });
31
+ </script>
@@ -0,0 +1,7 @@
1
+ If needing to toggle the disabled state of the Button dynamically (for example, within a Turbo or Stimulus context), you can now do so in rails using the `pb-button-managed` data attribute.
2
+
3
+ 1) Add the following data attribute to your button kit: `data:{ pb-button-managed: true }`
4
+
5
+ 2) To toggle enabled/disabled state via attributes: for buttons set/remove disabled, for links set/remove aria-disabled="true". This will handle disabling the button, preventing clicks as well as all style changes so you don't have to.
6
+
7
+ Click to enable or disable the buttons above and view the code snippet below for details!
@@ -0,0 +1,21 @@
1
+ <%= pb_rails("body", props: { text: "Click to disable the Button below", id: "toggle-disabled-demo-with-helper", cursor: "pointer", color:"link", margin_bottom:"sm" }) %>
2
+ <%= pb_rails("body", props: { text: "Click to enable the Button below", id: "toggle-enabled-demo-with-helper", cursor: "pointer", color:"link", margin_bottom:"sm" }) %>
3
+ <br/>
4
+ <%= pb_rails("card", props:{display:"flex", flex_direction:"row", justify_content:"center"}) do %>
5
+ <%= pb_rails("button", props: { text: "Watch me Change!", id: "managed_button_with_helper", data:{pb_button_managed: true} }) %>
6
+ <% end %>
7
+
8
+ <script>
9
+ document.addEventListener('DOMContentLoaded', function () {
10
+ const disable = document.querySelector('#toggle-disabled-demo-with-helper')
11
+ const enable = document.querySelector('#toggle-enabled-demo-with-helper')
12
+
13
+ // Find the Button you want to 'manage'
14
+ const demoBtn = document.querySelector('#managed_button_with_helper')
15
+
16
+ // Use the pbButton object created by the kit to call the enable/disable methods
17
+ disable.addEventListener('click', (e) => {demoBtn._pbButton.disable()});
18
+ enable.addEventListener('click', (e) => {demoBtn._pbButton.enable()});
19
+
20
+ });
21
+ </script>
@@ -0,0 +1,7 @@
1
+ The disabled state for the button can also be toggled via small helpers available through the `pb-button-managed` data attribute.
2
+
3
+ 1) Add the following data attribute to your button kit: `data:{ pb-button-managed: true }`
4
+
5
+ 2) Toggle state via the provided `_pbButton.disable()` and `_pbButton.enable()` helpers as shown in the code snippet below.
6
+
7
+ Click to enable or disable the buttons above to see this in action!
@@ -11,6 +11,8 @@ examples:
11
11
  - button_options: Button Additional Options
12
12
  - button_size: Button Size
13
13
  - button_form: Button Form Attribute
14
+ - button_managed_disabled: Button Toggle Disabled State
15
+ - button_managed_disabled_helper: Button Toggle Disabled State Helper
14
16
 
15
17
  react:
16
18
  - button_default: Button Variants
@@ -0,0 +1,99 @@
1
+ import PbEnhancedElement from "../pb_enhanced_element"
2
+
3
+ const BUTTON_SELECTOR = "[data-pb-button-managed]"
4
+
5
+ export default class PbButton extends PbEnhancedElement {
6
+ static get selector() {
7
+ return BUTTON_SELECTOR
8
+ }
9
+
10
+ connect() {
11
+ this._attrManaged = this._attributesPresent()
12
+ this.element._pbButton = this
13
+
14
+ this._onClick = (e) => {
15
+ if (this.isDisabled()) {
16
+ e.preventDefault()
17
+ e.stopImmediatePropagation()
18
+ }
19
+ }
20
+ this.element.addEventListener("click", this._onClick, true)
21
+
22
+ if (this._attrManaged) this._syncClassesFromAttributes()
23
+
24
+ this._observer = new MutationObserver(() => {
25
+ this._attrManaged = true
26
+ this._syncClassesFromAttributes()
27
+ })
28
+ this._observer.observe(this.element, {
29
+ attributes: true,
30
+ attributeFilter: ["disabled", "aria-disabled"],
31
+ })
32
+ }
33
+
34
+ disconnect() {
35
+ this.element.removeEventListener("click", this._onClick, true)
36
+ this._observer?.disconnect()
37
+ delete this.element._pbButton
38
+ }
39
+
40
+ disable() { this.setDisabled(true) }
41
+ enable() { this.setDisabled(false) }
42
+
43
+ setDisabled(state) {
44
+ if (this._isButton()) {
45
+ state
46
+ ? this.element.setAttribute("disabled", "disabled")
47
+ : this.element.removeAttribute("disabled")
48
+ } else {
49
+ state
50
+ ? this.element.setAttribute("aria-disabled", "true")
51
+ : this.element.removeAttribute("aria-disabled")
52
+ }
53
+ this._attrManaged = true
54
+ this._applyClassState(state)
55
+ }
56
+
57
+ isDisabled() {
58
+ if (this._isButton()) {
59
+ if (this.element.hasAttribute("disabled")) return true
60
+ if (this._attrManaged && !this.element.hasAttribute("disabled")) return false
61
+ } else {
62
+ const aria = this.element.getAttribute("aria-disabled")
63
+ if (aria === "true") return true
64
+ if (this._attrManaged && aria !== "true") return false
65
+ }
66
+ return this.element.classList.contains("pb_button_disabled")
67
+ }
68
+
69
+ _isButton() {
70
+ return this.element.tagName === "BUTTON"
71
+ }
72
+
73
+ _attributesPresent() {
74
+ return this.element.hasAttribute("disabled") || this.element.hasAttribute("aria-disabled")
75
+ }
76
+
77
+ _syncClassesFromAttributes() {
78
+ const state = this._attrDisabledState()
79
+ const disabled = (state === null) ? false : state
80
+ this._applyClassState(disabled)
81
+ }
82
+
83
+ _attrDisabledState() {
84
+ if (this._isButton()) {
85
+ return this.element.hasAttribute("disabled") ? true : null
86
+ } else {
87
+ const aria = this.element.getAttribute("aria-disabled")
88
+ if (aria === "true") return true
89
+ if (aria === "false") return false
90
+ return this.element.hasAttribute("aria-disabled") ? false : null
91
+ }
92
+ }
93
+
94
+ _applyClassState(disabled) {
95
+ this.element.classList.toggle("pb_button_disabled", !!disabled)
96
+ this.element.classList.toggle("pb_button_enabled", !disabled)
97
+ }
98
+ }
99
+
@@ -19,6 +19,10 @@
19
19
  @import "./sass_partials/calendar_input_icon";
20
20
  }
21
21
 
22
+ label {
23
+ display: block !important;
24
+ }
25
+
22
26
  &:focus,
23
27
  :focus-within {
24
28
  div.cal_icon_wrapper,
@@ -3,12 +3,12 @@
3
3
  <%= pb_rails("button", props: { text: "Delete Status", data: {"open-dialog": "dialog-stacked-delete"}, margin_right: "md" }) %>
4
4
 
5
5
 
6
- <%= pb_rails("dialog", props: {
7
- id:"dialog-stacked-default",
6
+ <%= pb_rails("dialog", props: {
7
+ id:"dialog-stacked-default",
8
8
  status: "default",
9
- size: "sm",
10
- title: "Are you sure?",
11
- text: "Text explaining why there is an alert",
9
+ size: "sm",
10
+ title: "Are you sure?",
11
+ text: "Text explaining why there is an alert",
12
12
  }) do %>
13
13
  <%= pb_rails("dialog/dialog_footer") do %>
14
14
  <%= pb_rails("flex", props: { orientation: "column", padding_x:"md", padding: "sm" }) do %>
@@ -18,12 +18,12 @@
18
18
  <% end %>
19
19
  <% end %>
20
20
 
21
- <%= pb_rails("dialog", props: {
22
- id:"dialog-stacked-caution",
21
+ <%= pb_rails("dialog", props: {
22
+ id:"dialog-stacked-caution",
23
23
  status: "caution",
24
- size: "sm",
25
- title: "Are you sure?",
26
- text: "This is the action you will be taking",
24
+ size: "sm",
25
+ title: "Are you sure?",
26
+ text: "This is the action you will be taking",
27
27
  }) do %>
28
28
  <%= pb_rails("dialog/dialog_footer") do %>
29
29
  <%= pb_rails("flex", props: { orientation: "column", padding_x:"md", padding: "sm" }) do %>
@@ -33,16 +33,16 @@
33
33
  <% end %>
34
34
  <% end %>
35
35
 
36
- <%= pb_rails("dialog", props: {
37
- id:"dialog-stacked-delete",
36
+ <%= pb_rails("dialog", props: {
37
+ id:"dialog-stacked-delete",
38
38
  status: "delete",
39
- size: "sm",
40
- title: "Delete",
41
- text: "You are about to delete ...",
39
+ size: "sm",
40
+ title: "Delete",
41
+ text: "You are about to delete ...",
42
42
  }) do %>
43
43
  <%= pb_rails("dialog/dialog_footer") do %>
44
44
  <%= pb_rails("flex", props: { orientation: "column", padding_x:"md", padding: "sm" }) do %>
45
- <%= pb_rails("button", props: { text: "Yes, Action", full_width: true }) %>
45
+ <%= pb_rails("button", props: { text: "Yes, Action", variant: "danger", full_width: true }) %>
46
46
  <%= pb_rails("button", props: { text: "No, Cancel", variant: "secondary", full_width: true, margin_top: "sm", data: {"close-dialog": "dialog-stacked-delete" } }) %>
47
47
  <% end %>
48
48
  <% end %>
@@ -51,7 +51,7 @@ const DialogStackedAlert = () => {
51
51
  return (
52
52
  <div>
53
53
  <Flex
54
- rowGap="xs"
54
+ rowGap="xs"
55
55
  wrap
56
56
  >
57
57
  <Button
@@ -93,6 +93,7 @@ const DialogStackedAlert = () => {
93
93
  <Button
94
94
  fullWidth
95
95
  onClick={dialog.toggle}
96
+ variant= {dialog.status == "delete" ? "danger" : "primary"}
96
97
  >
97
98
  {dialog.buttonOneText}
98
99
  </Button>
@@ -8,12 +8,12 @@
8
8
  <%= pb_rails("button", props: { text: "Success Status", data: {"open-dialog": "dialog-status-success"}, margin_right: "md" }) %>
9
9
  <% end %>
10
10
 
11
- <%= pb_rails("dialog", props: {
12
- id:"dialog-status-default",
11
+ <%= pb_rails("dialog", props: {
12
+ id:"dialog-status-default",
13
13
  status: "default",
14
- size: "status_size",
15
- title: "Are you sure?",
16
- text: "Text explaining why there is an alert",
14
+ size: "status_size",
15
+ title: "Are you sure?",
16
+ text: "Text explaining why there is an alert",
17
17
  }) do %>
18
18
  <%= pb_rails("dialog/dialog_footer") do %>
19
19
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
@@ -23,12 +23,12 @@
23
23
  <% end %>
24
24
  <% end %>
25
25
 
26
- <%= pb_rails("dialog", props: {
27
- id:"dialog-status-info",
26
+ <%= pb_rails("dialog", props: {
27
+ id:"dialog-status-info",
28
28
  status: "info",
29
- size: "status_size",
30
- title: "Information",
31
- text: "Text explaining why there is an alert",
29
+ size: "status_size",
30
+ title: "Information",
31
+ text: "Text explaining why there is an alert",
32
32
  }) do %>
33
33
  <%= pb_rails("dialog/dialog_footer") do %>
34
34
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
@@ -37,12 +37,12 @@
37
37
  <% end %>
38
38
  <% end %>
39
39
 
40
- <%= pb_rails("dialog", props: {
41
- id:"dialog-status-caution",
40
+ <%= pb_rails("dialog", props: {
41
+ id:"dialog-status-caution",
42
42
  status: "caution",
43
- size: "status_size",
44
- title: "Are you Sure?",
45
- text: "This is the action you will be taking",
43
+ size: "status_size",
44
+ title: "Are you Sure?",
45
+ text: "This is the action you will be taking",
46
46
  }) do %>
47
47
  <%= pb_rails("dialog/dialog_footer") do %>
48
48
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
@@ -52,27 +52,27 @@
52
52
  <% end %>
53
53
  <% end %>
54
54
 
55
- <%= pb_rails("dialog", props: {
56
- id:"dialog-status-delete",
55
+ <%= pb_rails("dialog", props: {
56
+ id:"dialog-status-delete",
57
57
  status: "delete",
58
- size: "status_size",
59
- title: "Delete",
60
- text: "You are about to delete ...",
58
+ size: "status_size",
59
+ title: "Delete",
60
+ text: "You are about to delete ...",
61
61
  }) do %>
62
62
  <%= pb_rails("dialog/dialog_footer") do %>
63
63
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
64
- <%= pb_rails("button", props: { text: "Yes, Delete" }) %>
64
+ <%= pb_rails("button", props: { text: "Yes, Delete", variant: "danger" }) %>
65
65
  <%= pb_rails("button", props: { text: "No, Cancel", variant: "secondary", data: {"close-dialog": "dialog-status-delete" } }) %>
66
66
  <% end %>
67
67
  <% end %>
68
68
  <% end %>
69
69
 
70
- <%= pb_rails("dialog", props: {
71
- id:"dialog-status-error",
70
+ <%= pb_rails("dialog", props: {
71
+ id:"dialog-status-error",
72
72
  status: "error",
73
- size: "status_size",
74
- title: "Error Message",
75
- text: "Text explaining the error",
73
+ size: "status_size",
74
+ title: "Error Message",
75
+ text: "Text explaining the error",
76
76
  }) do %>
77
77
  <%= pb_rails("dialog/dialog_footer") do %>
78
78
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
@@ -81,12 +81,12 @@
81
81
  <% end %>
82
82
  <% end %>
83
83
 
84
- <%= pb_rails("dialog", props: {
85
- id:"dialog-status-success",
84
+ <%= pb_rails("dialog", props: {
85
+ id:"dialog-status-success",
86
86
  status: "success",
87
- size: "status_size",
88
- title: "Success!",
89
- text: "Text explaining what is successful",
87
+ size: "status_size",
88
+ title: "Success!",
89
+ text: "Text explaining what is successful",
90
90
  }) do %>
91
91
  <%= pb_rails("dialog/dialog_footer") do %>
92
92
  <%= pb_rails("flex", props: { spacing:"between", padding_x:"md", padding_bottom:"md", padding: "sm" }) do %>
@@ -83,8 +83,8 @@ const DialogStatus = () => {
83
83
 
84
84
  return (
85
85
  <div>
86
- <Flex
87
- rowGap="xs"
86
+ <Flex
87
+ rowGap="xs"
88
88
  wrap
89
89
  >
90
90
  <Button
@@ -117,7 +117,7 @@ const DialogStatus = () => {
117
117
  >
118
118
  {"Success Status"}
119
119
  </Button>
120
- <Button
120
+ <Button
121
121
  marginRight="md"
122
122
  onClick={toggleErrorAlert}
123
123
  >
@@ -152,6 +152,7 @@ const DialogStatus = () => {
152
152
  <Button
153
153
  onClick={dialog.toggle}
154
154
  paddingRight="xl"
155
+ variant={dialog.status == "delete" ? "danger" : "primary"}
155
156
  >
156
157
  {dialog.buttonOneText}
157
158
  </Button>