playbook_ui_docs 15.0.0.pre.alpha.renovatenpmtrixvulnerability10692 → 15.0.0.pre.alpha.stimulusbutton10763

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: f4a577fec3aedaf37a12e21e06b72ab83770437ab57ec2afd35939365b982e73
4
- data.tar.gz: bd3709d9b488f2fa059c39967fa903d83be76f6e90391ac289d96986780e2f8b
3
+ metadata.gz: 5502cf92d841f167813a4288067616d35882ec8104e593f25a900940397d4c7a
4
+ data.tar.gz: eab2af3154f8a86ec8da0a7080f4aecb2cec77de3227f2f3b9f266d65ab4252e
5
5
  SHA512:
6
- metadata.gz: 438f2547fce07026e19c43a8fef21edeeb9abd0bb006ed90a808877e4337bc9e4987b25fced270961b411601c4cd5a1362d1c60a1c984a3ab77c58f4362d396e
7
- data.tar.gz: 7713b5858dd9ab4b22814fe90eb6745805c042c24a039979ce93b843c4464ac892384acd49f5e1321a4ce0c162f665ccf9ff10068c8f7cb4caf784708beeb307
6
+ metadata.gz: 297cde1570bc5b8ead5fcd0dea29270ff28fc4771b2a8256ed76f61024879af7fa732dc9496392e5baa589515013d9f68ef56a7b37e2bfb142e648af0839a199
7
+ data.tar.gz: 5b194a51746088a4d063cf029f742d759229d34b5d25791843fe989363df66df8328828df483ae38d2c9c3504c799abe9d0a1cc69b7ec4d2b71ea69c48593c86
@@ -44,9 +44,9 @@ const AdvancedTableColumnHeadersVerticalBorder = (props) => {
44
44
  ],
45
45
  },
46
46
  ];
47
-
47
+
48
48
  const tableProps = {
49
- verticalBorder: true
49
+ verticalBorder: true,
50
50
  }
51
51
 
52
52
  return (
@@ -0,0 +1,29 @@
1
+ <br/>
2
+ <%= pb_rails("button", props: { text: "Disable Buttons", variant: "link", id: "toggle-disabled-demo" }) %>
3
+ <%= pb_rails("button", props: { text: "Enable Buttons", variant: "link", id: "toggle-enabled-demo" }) %>
4
+ <br/>
5
+ <%= pb_rails("button", props: { text: "I am a Normal Button", id: "normal_managed_button", data:{pb_button_managed: true}, margin_bottom: "lg" }) %>
6
+ <br/>
7
+ <%= 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", margin_right: "lg" }) %>
8
+
9
+ <script>
10
+ document.addEventListener('DOMContentLoaded', function () {
11
+ const disableTrigger = document.querySelector('#toggle-disabled-demo')
12
+ const enableTrigger = document.querySelector('#toggle-enabled-demo')
13
+
14
+ // Managed Buttons
15
+ const btn = document.querySelector('#normal_managed_button');
16
+ const link = document.querySelector('#a_tag_managed_button');
17
+
18
+ disableTrigger.addEventListener('click', (e) => {
19
+ // Disable both default button and a tag button
20
+ btn.setAttribute('disabled', true)
21
+ link.setAttribute('aria-disabled', 'true')
22
+ });
23
+ enableTrigger.addEventListener('click', (e) => {
24
+ // Enable both default button and a tag button
25
+ btn.removeAttribute('disabled')
26
+ link.removeAttribute('aria-disabled')
27
+ });
28
+ });
29
+ </script>
@@ -0,0 +1,5 @@
1
+ If needing to toggle the disabled state of the Button dynmically, you can now do so in rails using the `pb-button-managed` data attribute.
2
+
3
+ If your button has `data:{ pb-button-managed: true }` on it, you can then toggle 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.
4
+
5
+ Click to enable or disable the buttons above and view the code snippet below for details!
@@ -0,0 +1,18 @@
1
+ <%= pb_rails("button", props: { text: "Disable Button", variant: "link", id: "toggle-disabled-demo-with-helper" }) %>
2
+ <%= pb_rails("button", props: { text: "Enable Button", variant: "link", id: "toggle-enabled-demo-with-helper" }) %>
3
+ <br/>
4
+ <%= pb_rails("button", props: { text: "Watch me Change!", id: "managed_button_with_helper", data:{pb_button_managed: true} }) %>
5
+
6
+ <script>
7
+ document.addEventListener('DOMContentLoaded', function () {
8
+ const demoBtn = document.querySelector('#managed_button_with_helper')
9
+
10
+ const disable = document.querySelector('#toggle-disabled-demo-with-helper')
11
+ const enable = document.querySelector('#toggle-enabled-demo-with-helper')
12
+
13
+ disable.addEventListener('click', (e) => {demoBtn._pbButton.disable()});
14
+
15
+ enable.addEventListener('click', (e) => {demoBtn._pbButton.enable()});
16
+
17
+ });
18
+ </script>
@@ -0,0 +1,5 @@
1
+ The disabled state for the button can also be toggled via small helpers available through the `pb-button-managed` data attribute.
2
+
3
+ If your button has `data:{ pb-button-managed: true }` on it, you can then toggle state via the provided `_pbButton.disable()` and `_pbButton.enable()` helpers as shoen in the code snippet below.
4
+
5
+ Click to enable or disable the buttons above!
@@ -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,6 @@
1
+ <%= pb_rails("nav", props: { orientation: "horizontal", extended_underline: true }) do %>
2
+ <%= pb_rails("nav/item", props: { text: "About", link: "#" }) %>
3
+ <%= pb_rails("nav/item", props: { text: "Case Studies", link: "#", active: true }) %>
4
+ <%= pb_rails("nav/item", props: { text: "Service ", link: "#" }) %>
5
+ <%= pb_rails("nav/item", props: { text: "Contacts", link: "#" }) %>
6
+ <% end %>
@@ -0,0 +1,39 @@
1
+ import React from 'react'
2
+
3
+ import Nav from '../_nav'
4
+ import NavItem from '../_item'
5
+
6
+ const HorizontalNavExtendedunderline = (props) => {
7
+ return (
8
+ <Nav
9
+ extendedUnderline
10
+ link="#"
11
+ orientation="horizontal"
12
+ {...props}
13
+ >
14
+ <NavItem
15
+ link="#"
16
+ text="About"
17
+ {...props}
18
+ />
19
+ <NavItem
20
+ active
21
+ link="#"
22
+ text="Case Studies"
23
+ {...props}
24
+ />
25
+ <NavItem
26
+ link="#"
27
+ text="Service"
28
+ {...props}
29
+ />
30
+ <NavItem
31
+ link="#"
32
+ text="Contacts"
33
+ {...props}
34
+ />
35
+ </Nav>
36
+ )
37
+ }
38
+
39
+ export default HorizontalNavExtendedunderline
@@ -0,0 +1 @@
1
+ The optional `extendedUnderline`/`extended_underline` prop can be used with the default `normal` variant of the horizontal orientation of the nav to extend the underline to take up the full width of the container.
@@ -17,6 +17,7 @@ examples:
17
17
  - horizontal_nav: Horizontal Nav
18
18
  - subtle_horizontal_nav: Subtle Horizontal Nav
19
19
  - bold_horizontal_nav: Bold Horizontal Nav
20
+ - horizontal_nav_extendedunderline: Horizontal Nav With Extended Underline
20
21
  - block_nav: Block
21
22
  - block_no_title_nav: Without Title
22
23
  - new_tab: Open in a New Tab
@@ -42,6 +43,7 @@ examples:
42
43
  - horizontal_nav: Horizontal Nav
43
44
  - subtle_horizontal_nav: Subtle Horizontal Nav
44
45
  - bold_horizontal_nav: Bold Horizontal Nav
46
+ - horizontal_nav_extendedunderline: Horizontal Nav With Extended Underline
45
47
  - block_nav: Block
46
48
  - block_no_title_nav: Without Title
47
49
  - new_tab: Open in a New Tab
@@ -19,4 +19,5 @@ export { default as CollapsibleNavWithAllOptions} from "./_collapsible_nav_with_
19
19
  export { default as NavWithFontControl } from "./_nav_with_font_control.jsx"
20
20
  export { default as NavWithSpacingControl } from "./_nav_with_spacing_control.jsx"
21
21
  export { default as CollapsibleNavItemSpacing } from "./_collapsible_nav_item_spacing.jsx"
22
- export { default as CollapsibleNavNoIcon } from "./_collapsible_nav_no_icon.jsx"
22
+ export { default as CollapsibleNavNoIcon } from "./_collapsible_nav_no_icon.jsx"
23
+ export { default as HorizontalNavExtendedunderline } from './_horizontal_nav_extendedunderline.jsx'
@@ -4,8 +4,8 @@
4
4
 
5
5
  <%= pb_rails("caption", props: { size: 'xs', text: "hello", id: "caption_breached" }) %>
6
6
 
7
- <%= javascript_tag do %>
8
- window.addEventListener("DOMContentLoaded", () => {
7
+ <script>
8
+ window.addEventListener("load", () => {
9
9
 
10
10
  // variables for the kits you are targeting
11
11
  const passphrase = document.querySelector(".passphrase_breached").querySelector("input")
@@ -142,4 +142,4 @@
142
142
  });
143
143
 
144
144
  })
145
- <% end %>
145
+ </script>
@@ -10,8 +10,8 @@
10
10
  <%= pb_rails("caption", props: { size: 'xs', text: "hello", id: "caption_common" }) %>
11
11
 
12
12
 
13
- <%= javascript_tag do %>
14
- window.addEventListener("DOMContentLoaded", () => {
13
+ <script>
14
+ window.addEventListener("load", () => {
15
15
 
16
16
  const commonText = document.querySelector("#body_common")
17
17
 
@@ -133,4 +133,4 @@
133
133
  });
134
134
 
135
135
  })
136
- <% end %>
136
+ </script>
@@ -4,8 +4,8 @@
4
4
 
5
5
  <div id="match"> </div>
6
6
 
7
- <%= javascript_tag do %>
8
- window.addEventListener("DOMContentLoaded", () => {
7
+ <script>
8
+ window.addEventListener("load", () => {
9
9
 
10
10
  const useState = (defaultValue) => {
11
11
  let value = defaultValue;
@@ -48,4 +48,4 @@
48
48
 
49
49
  }
50
50
  })
51
- <% end %>
51
+ </script>
@@ -32,8 +32,8 @@
32
32
 
33
33
 
34
34
 
35
- <%= javascript_tag do %>
36
- window.addEventListener("DOMContentLoaded", () => {
35
+ <script>
36
+ window.addEventListener("load", () => {
37
37
 
38
38
 
39
39
  // variables for the passphrase kits you are targeting
@@ -320,4 +320,4 @@
320
320
 
321
321
 
322
322
  })
323
- <% end %>
323
+ </script>
@@ -7,8 +7,8 @@
7
7
  <%= pb_rails("text_input", props: { label: "Passphrase Strength", value: "0", disabled: true, id: "calc_strength_change" }) %>
8
8
 
9
9
 
10
- <%= javascript_tag do %>
11
- window.addEventListener("DOMContentLoaded", () => {
10
+ <script>
11
+ window.addEventListener("load", () => {
12
12
 
13
13
  // variables for the kits you are targeting
14
14
  const passphrase = document.querySelector(".passphrase_change").querySelector("input")
@@ -120,4 +120,4 @@
120
120
  });
121
121
 
122
122
  })
123
- <% end %>
123
+ </script>
@@ -13,8 +13,8 @@
13
13
  <script>
14
14
  document.addEventListener('DOMContentLoaded', () => {
15
15
  function handleButtonClick() {
16
- const editorContainer = [...document.querySelectorAll('[data-react-props]')]
17
- .find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
16
+ const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
17
+ .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
18
18
 
19
19
  const editorElement = editorContainer?.querySelector('trix-editor')
20
20
  const inputId = editorElement?.getAttribute('input')