playbook_ui 13.32.0.pre.alpha.PLAY14143288 → 13.32.0.pre.alpha.PLAY14143297
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +4 -0
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +9 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +31 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -1
- data/app/pb_kits/playbook/pb_dropdown/index.js +33 -7
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +108 -5
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx +53 -0
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +11 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.html.erb +5 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.jsx +1 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.html.erb +4 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx +3 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +2 -0
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +5 -1
- data/app/pb_kits/playbook/pb_icon/_icon.scss +210 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +100 -41
- data/app/pb_kits/playbook/pb_icon/icon.rb +33 -19
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +2 -2
- data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb +48 -0
- data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.md +3 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_nav/index.js +43 -0
- data/app/pb_kits/playbook/pb_nav/nav.rb +9 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +1 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +11 -2
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.html.erb +1 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_star_rating/index.js +50 -0
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +25 -5
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +6 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/index.ts +4 -4
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_cell.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +2 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +45 -27
- data/app/pb_kits/playbook/pb_textarea/index.ts +3 -3
- data/app/pb_kits/playbook/pb_time/_time.tsx +3 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +10 -10
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +2 -2
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -2
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +2 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -3
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +11 -7
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +18 -19
- data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +22 -57
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -2
- data/app/pb_kits/playbook/pb_typeahead/index.ts +31 -31
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +6 -6
- data/app/pb_kits/playbook/pb_user_badge/badges/million-dollar.tsx +236 -235
- data/app/pb_kits/playbook/pb_user_badge/badges/veteran.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +68 -63
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/dist/chunks/_typeahead.js +11 -11
- data/dist/chunks/_weekday_stacked.js +7 -7
- data/dist/playbook-doc.js +26 -26
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/star_rating_field.rb +14 -0
- data/lib/playbook/forms/builder.rb +1 -0
- data/lib/playbook/version.rb +1 -1
- metadata +11 -3
- data/app/pb_kits/playbook/pb_icon/icon_aliases.json +0 -39
data/dist/playbook-rails.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import"./chunks/pb_form_validation.js";import{P as
|
1
|
+
import"./chunks/pb_form_validation.js";import{P as r,d as m,a as E,b,c as f,e as v,f as _,g as T}from"./chunks/lib.js";import"./chunks/lazysizes.js";import"./playbook-rails-react-bindings.js";import"react";import"webpacker-react";import"./chunks/_typeahead.js";import"react/jsx-runtime";import"react-dom";import"react-is";const L="[data-collapsible-main]",O="[data-collapsible-content]",S="#collapsible_open_icon",A="#collapsible_close_icon";class C extends r{static get selector(){return L}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)}),this.target.classList.contains("is-visible")?this.displayUpArrow():this.displayDownArrow(),document.addEventListener(`${this.target.id}`,()=>{this.toggleElement(this.target)})}get target(){return this.element.parentNode.querySelector(O)}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},300)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},300)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}toggleArrows(t){const e=this.element.querySelector(S),s=this.element.querySelector(A);e&&(e.style.display=t?"inline-block":"none"),s&&(s.style.display=t?"none":"inline-block")}displayDownArrow(){this.toggleArrows(!0)}displayUpArrow(){this.toggleArrows(!1)}}class D extends r{static get selector(){return".remove_toast"}connect(){this.self=this.element,this.autoCloseToast(this.self),this.self.addEventListener("click",()=>{this.removeToast(this.self)})}removeToast(t){t.parentNode.removeChild(t)}autoCloseToast(t){const e=t.classList.value;if(e.includes("auto_close")){const o=e.split(" "),i=o[o.length-1].split("_")[2],l=parseInt(i);setTimeout(()=>{this.removeToast(t)},l)}}}const R="[data-dropdown-option-label]";class k{constructor(t){this.dropdown=t,this.dropdownElement=t.element,this.options=Array.from(this.dropdownElement.querySelectorAll(R)),this.focusedOptionIndex=-1,this.init()}init(){this.dropdownElement.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0)),this.moveFocus(1);break;case"ArrowUp":t.preventDefault(),this.moveFocus(-1);break;case"Enter":t.preventDefault(),this.focusedOptionIndex!==-1?this.selectOption():this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0));break;case"Escape":this.dropdown.hideElement(this.dropdown.target);break;case"Tab":this.dropdown.hideElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!1),this.resetFocus();break}}moveFocus(t){this.focusedOptionIndex!==-1&&this.options[this.focusedOptionIndex].classList.remove("pb_dropdown_option_focused"),this.focusedOptionIndex=(this.focusedOptionIndex+t+this.options.length)%this.options.length,this.options[this.focusedOptionIndex].classList.add("pb_dropdown_option_focused")}selectOption(){const t=this.options[this.focusedOptionIndex];this.dropdown.onOptionSelected(t.dataset.dropdownOptionLabel,t),this.dropdown.hideElement(this.dropdown.target)}}const q="[data-pb-dropdown]",N="[data-dropdown-trigger]",u="[data-dropdown-container]",I="#dropdown_open_icon",P="#dropdown_close_icon",a="[data-dropdown-option-label]",h="[data-dropdown-custom-trigger]",d="#dropdown-form-validation",g="#dropdown_trigger_display",x="[data-dropdown-placeholder]";class V extends r{static get selector(){return q}get target(){return this.element.parentNode.querySelector(u)}connect(){this.keyboardHandler=new k(this),this.setDefaultValue(),this.bindEventListeners(),this.updateArrowDisplay(!1),this.handleFormValidation(),this.handleFormReset()}bindEventListeners(){(this.element.querySelector(h)||this.element).addEventListener("click",()=>this.toggleElement(this.target)),this.target.addEventListener("click",this.handleOptionClick.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this),!0)}handleOptionClick(t){const e=t.target.closest(a),s=this.element.querySelector("#dropdown-selected-option"),o=this.element.querySelector(d);if(e){const i=e.dataset.dropdownOptionLabel;s.value=JSON.parse(i).id,o.value=JSON.parse(i).id,this.clearFormValidation(o),this.onOptionSelected(i,e)}}handleDocumentClick(t){this.isClickOutside(t)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1))}isClickOutside(t){const e=this.element.querySelector(h);if(e)return!e.contains(t.target);{const s=this.element.querySelector(N),o=this.element.parentNode.querySelector(u),i=s?!s.contains(t.target):!0,l=o?!o.contains(t.target):!0;return i&&l}}onOptionSelected(t,e){const s=this.element.querySelector(g),o=this.element.querySelector("#dropdown_trigger_custom_display");if(s){const c=JSON.parse(t).label;s.textContent=c,o&&(o.style.display="block",o.style.paddingRight="8px")}this.element.querySelector(h)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1)),this.element.querySelectorAll(a).forEach(c=>{c.classList.remove("pb_dropdown_option_selected")}),e.classList.add("pb_dropdown_option_selected")}showElement(t){t.classList.remove("close"),t.classList.add("open"),t.style.height=t.scrollHeight+"px"}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.classList.add("close"),t.classList.remove("open"),this.resetFocus()},0)}resetFocus(){this.keyboardHandler&&(this.keyboardHandler.focusedOptionIndex=-1,this.element.querySelectorAll(a).forEach(e=>e.classList.remove("pb_dropdown_option_focused")))}toggleElement(t){if(t.classList.contains("open")){this.hideElement(t),this.updateArrowDisplay(!1);return}this.showElement(t),this.updateArrowDisplay(!0)}updateArrowDisplay(t){const e=this.element.querySelector(I),s=this.element.querySelector(P);e&&s&&(e.style.display=t?"none":"inline-block",s.style.display=t?"inline-block":"none")}handleFormValidation(){const t=this.element.querySelector(d);t.addEventListener("invalid",function(e){t.hasAttribute("required")&&t.value===""&&(e.preventDefault(),t.closest(".dropdown_wrapper").classList.add("error"))},!0)}clearFormValidation(t){if(t.checkValidity()){const e=t.closest(".dropdown_wrapper");e.classList.remove("error");const s=e.querySelector(".pb_body_kit_negative");s&&s.remove()}}setDefaultValue(){const t=this.element.querySelector("#dropdown-selected-option");if(t.value){const e=this.element.querySelector(d),s=JSON.parse(t.value.replaceAll("=>",":"));this.element.querySelectorAll(a).forEach(i=>{s.id===JSON.parse(i.dataset.dropdownOptionLabel).id&&i.classList.add("pb_dropdown_option_selected")}),this.setTriggerElementText(s.label),t.value=s.id,e.value=s.id}}handleFormReset(){const t=this.element.closest("form");t&&t.addEventListener("reset",()=>{this.resetDropdownValue()})}resetDropdownValue(){const t=this.element.querySelector("#dropdown-selected-option"),e=this.element.querySelector(d);t.value="",e.value="";const s=this.element.querySelector(x);this.setTriggerElementText(s.dataset.dropdownPlaceholder)}setTriggerElementText(t){const e=this.element.querySelector(g);e&&(e.textContent=t)}}const F="[data-advanced-table]",H='[data-advanced-table-content="id"]',w="#advanced-table_open_icon",y="#advanced-table_close_icon";class W extends r{static get selector(){return F}get target(){return document.querySelector(H.replace("id",this.element.id))}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)})}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},250)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},200)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}displayDownArrow(){this.element.querySelector(w).style.display="inline-block",this.element.querySelector(y).style.display="none"}displayUpArrow(){this.element.querySelector(y).style.display="inline-block",this.element.querySelector(w).style.display="none"}}const U="[data-pb-nav-tab]",p="[data-pb-tab-target]";class $ extends r{static get selector(){return U}connect(){this.hideAndAddEventListeners()}hideAndAddEventListeners(){this.element.querySelectorAll(p).forEach(e=>{e.className.includes("active")||this.changeContentDisplay(e.dataset.pbTabTarget,"none"),e.addEventListener("click",s=>this.handleNavItemClick(s))})}handleNavItemClick(t){t.preventDefault();const e=t.target.closest(p);this.changeContentDisplay(e.dataset.pbTabTarget,"block"),this.element.querySelectorAll(p).forEach(o=>{e!==o&&this.changeContentDisplay(o.dataset.pbTabTarget,"none")})}changeContentDisplay(t,e){const s=document.getElementById(t);s.style.display=e}}window.datePickerHelper=m;window.dialogHelper=E;C.start();b.start();f.start();D.start();v.start();_.start();T.start();V.start();W.start();$.start();
|