New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cfpb/cfpb-design-system

Package Overview
Dependencies
Maintainers
8
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cfpb/cfpb-design-system - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

2

cfpb-design-system.js

@@ -1,1 +0,1 @@

!function(){var t,e,n={852:function(t){"use strict";function e(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=e.prototype.handle.bind(this),this._removedListeners=[]}t.exports=e,e.prototype.root=function(t){var e,n=this.listenerMap;if(this.rootElement){for(e in n[1])n[1].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!1)}if(!t||!t.addEventListener)return this.rootElement&&delete this.rootElement,this;for(e in this.rootElement=t,n[1])n[1].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!1);return this},e.prototype.captureForType=function(t){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(t)},e.prototype.on=function(t,e,o,a){var l,c,h,u;if(!t)throw new TypeError("Invalid event type: "+t);if("function"==typeof e&&(a=o,o=e,e=null),void 0===a&&(a=this.captureForType(t)),"function"!=typeof o)throw new TypeError("Handler must be a type of Function");return l=this.rootElement,(c=this.listenerMap[a?1:0])[t]||(l&&l.addEventListener(t,this.handle,a),c[t]=[]),e?/^[a-z]+$/i.test(e)?(u=e,h=i):/^#[a-z0-9\-_]+$/i.test(e)?(u=e.slice(1),h=r):(u=e,h=n):(u=null,h=s.bind(this)),c[t].push({selector:e,handler:o,matcher:h,matcherParam:u}),this},e.prototype.off=function(t,e,n,i){var s,r,o,a,l;if("function"==typeof e&&(i=n,n=e,e=null),void 0===i)return this.off(t,e,n,!0),this.off(t,e,n,!1),this;if(o=this.listenerMap[i?1:0],!t){for(l in o)o.hasOwnProperty(l)&&this.off(l,e,n);return this}if(!(a=o[t])||!a.length)return this;for(s=a.length-1;s>=0;s--)r=a[s],e&&e!==r.selector||n&&n!==r.handler||(this._removedListeners.push(r),a.splice(s,1));return a.length||(delete o[t],this.rootElement&&this.rootElement.removeEventListener(t,this.handle,i)),this},e.prototype.handle=function(t){var e,n,i,s,r,o=t.type,a=[],l="ftLabsDelegateIgnore";if(!0!==t[l]){switch(3===(r=t.target).nodeType&&(r=r.parentNode),r.correspondingUseElement&&(r=r.correspondingUseElement),i=this.rootElement,t.eventPhase||(t.target!==t.currentTarget?3:2)){case 1:a=this.listenerMap[1][o];break;case 2:this.listenerMap[0]&&this.listenerMap[0][o]&&(a=a.concat(this.listenerMap[0][o])),this.listenerMap[1]&&this.listenerMap[1][o]&&(a=a.concat(this.listenerMap[1][o]));break;case 3:a=this.listenerMap[0][o]}var c,h=[];for(n=a.length;r&&n;){for(e=0;e<n&&(s=a[e]);e++)r.tagName&&["button","input","select","textarea"].indexOf(r.tagName.toLowerCase())>-1&&r.hasAttribute("disabled")?h=[]:s.matcher.call(r,s.matcherParam,r)&&h.push([t,r,s]);if(r===i)break;if(n=a.length,(r=r.parentElement||r.parentNode)instanceof HTMLDocument)break}for(e=0;e<h.length;e++)if(!(this._removedListeners.indexOf(h[e][2])>-1)&&!1===this.fire.apply(this,h[e])){h[e][0][l]=!0,h[e][0].preventDefault(),c=!1;break}return c}},e.prototype.fire=function(t,e,n){return n.handler.call(e,t,e)};var n=function(t){if(t){var e=t.prototype;return e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector}}(Element);function i(t,e){return t.toLowerCase()===e.tagName.toLowerCase()}function s(t,e){return this.rootElement===window?e===document||e===document.documentElement||e===window:this.rootElement===e}function r(t,e){return t===e.id}e.prototype.destroy=function(){this.off(),this.root()}},161:function(t,e,n){"use strict";var i=n(852);t.exports=function(t){return new i(t)},t.exports.Delegate=i},186:function(t,e,n){"use strict";n.d(e,{Z:function(){return d}});var i=n(147);function s(t){return"[object Object]"===Object.prototype.toString.call(t)}function r(t){t=t||{};for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e]||{},o=void 0;for(o in i)if(Object.prototype.hasOwnProperty.call(i,o)){var a=i[o];s(a)?r(t[o]||(t[o]={}),a):t[o]=a}}return t}var o=n(752);var a=o.uJ+"atomic_init";function l(t){return!function(t,e){if(!t)return!1;var n=t.getAttribute(o.kQ);return!!n&&(n=n.split(" ")).indexOf(e)>-1}(t,a)&&(function(t,e){if(-1!==e.indexOf(" ")){var n=o.kQ+" values cannot contain spaces!";throw new Error(n)}var i=t.getAttribute(o.kQ);null!==i&&(e=i+" "+e),t.setAttribute(o.kQ,e)}(t,a),!0)}var c=n(291),h=n(161).Delegate;function u(t,e){this.element=t,this.initializers=[],this.uId=this.uniqueId("ac"),r(this,e),this.processModifiers(),this.ensureElement(),this.setCachedElements(),this.initializers.push(this.initialize)}r(u.prototype,new i.Z,{init:function(){return this.initializers.forEach((function(t){c.Z.isFunction(t)&&t.apply(this,arguments)}),this),this.dispatchEvent("component:initialized"),this},processModifiers:function(){this.modifiers&&this.modifiers.forEach((function(t){var e=t.ui.base.substring(1);this.element.classList.contains(e)&&(t.initialize&&(this.initializers.push(t.initialize),delete t.initialize),r(this,t))}),this)},render:function(){return this},ensureElement:function(){if(this.element)this.setElement(this.element);else{var t=r({},this.attributes);t.id=this.id||this.u_id,this.className&&(t.class=this.className),this.setElement(document.createElement("div")),this.setElementAttributes(t)}l(this.element)},setElement:function(t){return this.element&&this.undelegateEvents(),this.element=t,this.delegateEvents(),this},setCachedElements:function(){var t,e,n=r({},this.ui);for(t in n)n.hasOwnProperty(t)&&(1===(e=this.element.querySelectorAll(n[t])).length?n[t]=e[0]:e.length>1?n[t]=e:n[t]=null);return this.ui=n,n},destroy:function(){return this.element&&(this.element.parentNode.removeChild(this.element),this.element.view&&delete this.element.view,delete this.element),this.undelegateEvents(),this.dispatchEvent("component:destroyed"),!0},setElementAttributes:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.element.setAttribute(e,t[e])},delegateEvents:function(t){var e,n,i,s=/^(\S+)\s*(.*)$/;if(!(t=t||(t=this.events)))return this;for(e in this.undelegateEvents(),this._delegate=new h(this.element),t)({}).hasOwnProperty.call(t,e)&&(n=t[e],c.Z.isFunction(this[n])&&(n=this[n]),n&&(i=e.match(s),this.delegate(i[1],i[2],n.bind(this))));return this.dispatchEvent("component:bound"),this},delegate:function(t,e,n){return this._delegate.on(t,e,n),this},undelegateEvents:function(){return this._delegate&&this._delegate.destroy(),this.element.removeAttribute("data-js-hook"),this},uniqueId:function(t){return t+"_"+Math.random().toString(36).substr(2,9)}}),u.init=function(t){return function(t,e,n){for(var i,s,r=(n||document).querySelectorAll(t),o=[],a=0,l=r.length;a<l;a++)!1===(s=r[a]).hasAttribute("data-js-hook")&&((i=new e(s)).init(),o.push(i));return o}(this.selector,this,t)},u.extend=function(t){function e(){return this._super=u.prototype,u.apply(this,arguments)}return e.prototype=Object.create(u.prototype),r(e.prototype,t),r(e,u),t.hasOwnProperty("ui")&&t.ui.hasOwnProperty("base")&&(e.selector=t.ui.base),e.constants={},e};var d=u},147:function(t,e){"use strict";e.Z=function(){var t={};return this.addEventListener=function(e,n){return t.hasOwnProperty(e)?t[e].push(n):t[e]=[n],this},this.removeEventListener=function(e,n){if(!t.hasOwnProperty(e))return this;var i=t[e].indexOf(n);return-1!==i&&t[e].splice(i,1),this},this.dispatchEvent=function(e,n){if(!t.hasOwnProperty(e))return this;n=n||{};for(var i=t[e],s=0,r=i.length;s<r;s++)i[s].call(this,n);return this},this.getRegisteredEvents=function(){return t},this}},928:function(t,e,n){"use strict";n.d(e,{o:function(){return i}});n(291);function i(t,e){if("closest"in t)return t.closest(e);for(var n,i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;t;)if(i.bind(t)(e)?n=t:t=t.parentElement,n)return t;return null}},752:function(t,e,n){"use strict";n.d(e,{kQ:function(){return i},uJ:function(){return s},mQ:function(){return r}});var i="data-js-hook",s="state_";var r={UP:0,RIGHT:1,DOWN:-1,LEFT:-2}},291:function(t,e){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=Object.prototype.toString;function s(t){return void 0===t}function r(t){return"[object String]"===i.call(t)}var o=Array.isArray||function(t){return"[object Array]"===i.call(t)};e.Z={isUndefined:s,isDefined:function(t){return void 0!==t},isObject:function(t){return null!==t&&"object"===n(t)},isString:r,isNumber:function(t){return"[object Number]"===i.call(t)},isDate:function(t){return"[object Date]"===i.call(t)},isArray:o,isFunction:function(t){return"[object Function]"===i.call(t)},isEmpty:function(t){return s(t)||null===t||r(t)&&t.length<=0||/^\s*$/.test(t)}}},270:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return m}});var i=n(186),s=n(147);function r(t,e){var n,i,o,a,l,c=e,h=!1,u=!1;function d(t){n&&(g(),p()),(n=t).classList.add(c.BASE_CLASS),o=function(t){if(!t){throw new Error("Element does not have TransitionEnd event. It may be null!")}var e,n,i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(n in i)if(i.hasOwnProperty(n)&&void 0!==t.style[n]){e=i[n];break}return e}(n)}function p(){return n?(n.classList.remove(r.NO_ANIMATION_CLASS),this):this}function f(){h&&(n.style.webkitTransitionDuration="0",n.style.mozTransitionDuration="0",n.style.oTransitionDuration="0",n.style.transitionDuration="0",n.removeEventListener(o,a),a(),n.style.webkitTransitionDuration="",n.style.mozTransitionDuration="",n.style.oTransitionDuration="",n.style.transitionDuration="")}function m(){h=!0,o?(n.addEventListener(o,a),this.dispatchEvent(r.BEGIN_EVENT,{target:this})):(this.dispatchEvent(r.BEGIN_EVENT,{target:this}),a())}function v(){n.removeEventListener(o,a)}function E(){v(),this.dispatchEvent(r.END_EVENT,{target:this}),h=!1}function b(){var t;for(t in c)c.hasOwnProperty(t)&&c[t]!==c.BASE_CLASS&&n.classList.contains(c[t])&&n.classList.remove(c[t])}function g(){return!!n&&(f(),n.classList.remove(c.BASE_CLASS),b(),!0)}var y=new s.Z;return this.addEventListener=y.addEventListener,this.dispatchEvent=y.dispatchEvent,this.removeEventListener=y.removeEventListener,this.animateOff=function(){return n?(n.classList.add(r.NO_ANIMATION_CLASS),this):this},this.animateOn=p,this.applyClass=function(t){return!!n&&(u||(b(),u=!0),!n.classList.contains(t)&&(v(),n.classList.remove(i),i=t,l(),n.classList.add(i),!0))},this.halt=f,this.init=function(){return a=E.bind(this),l=m.bind(this),d(t),this},this.isAnimated=function(){return!!n&&!n.classList.contains(r.NO_ANIMATION_CLASS)},this.remove=g,this.setElement=d,this}r.BEGIN_EVENT="transitionBegin",r.END_EVENT="transitionEnd",r.NO_ANIMATION_CLASS="u-no-animation";var o=r,a={BASE_CLASS:"o-expandable_content__transition",EXPANDED:"o-expandable_content__expanded",COLLAPSED:"o-expandable_content__collapsed",OPEN_DEFAULT:"o-expandable_content__onload-open"};function l(t){var e,n=new o(t,a);function i(){t.classList.contains(a.EXPANDED)?(this.dispatchEvent("expandEnd",{target:this}),t.scrollHeight>e&&(t.style.maxHeight=t.scrollHeight+"px")):t.classList.contains(a.COLLAPSED)&&this.dispatchEvent("collapseEnd",{target:this})}var r=new s.Z;return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=n.animateOff,this.animateOn=n.animateOn,this.halt=n.halt,this.isAnimated=n.isAnimated,this.setElement=n.setElement,this.remove=n.remove,this.init=function(){return n.init(),n.addEventListener(o.END_EVENT,i.bind(this)),t.classList.contains(a.OPEN_DEFAULT)?this.expand():this.collapse(),this},this.toggleExpandable=function(){return t.classList.contains(a.COLLAPSED)?this.expand():this.collapse(),this},this.collapse=function(){return this.dispatchEvent("collapseBegin",{target:this}),e=t.scrollHeight,t.style.maxHeight="0",n.applyClass(a.COLLAPSED),this},this.expand=function(){return this.dispatchEvent("expandBegin",{target:this}),(!e||t.scrollHeight>e)&&(e=t.scrollHeight),t.style.maxHeight=e+"px",n.applyClass(a.EXPANDED),this},this}l.CLASSES=a;var c=l,h=n(928),u=new s.Z;function d(){this.activeAccordion&&(this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.activeAccordion=!1)}function p(){this.ui.content.classList.remove("u-hidden")}function f(){this.ui.content.classList.add("u-hidden")}var m=i.Z.extend({ui:{base:".o-expandable",target:".o-expandable_target",content:".o-expandable_content",header:".o-expandable_header",label:".o-expandable_label"},classes:{targetExpanded:"o-expandable_target__expanded",targetCollapsed:"o-expandable_target__collapsed",group:"o-expandable-group",groupAccordion:"o-expandable-group__accordion"},events:{"click .o-expandable_target":"expandableClickHandler"},transition:null,isAccordionGroup:!1,activeAccordion:!1,initialize:function(){var t=new c(this.ui.content);this.transition=t.init(),this.transition.addEventListener("expandBegin",p.bind(this)),this.transition.addEventListener("collapseEnd",f.bind(this)),this.ui.content.classList.contains(c.CLASSES.EXPANDED)?this.ui.target.classList.add(this.classes.targetExpanded):(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.content.classList.add("u-hidden"));var e=(0,h.o)(this.ui.target,"."+this.classes.group);this.isAccordionGroup=null!==e&&e.classList.contains(this.classes.groupAccordion),this.isAccordionGroup&&u.addEventListener("accordionActivated",d.bind(this))},expandableClickHandler:function(){this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.isAccordionGroup&&(this.activeAccordion?this.activeAccordion=!1:(u.dispatchEvent("accordionActivated",{target:this}),this.activeAccordion=!0))},toggleTargetState:function(t){t.classList.contains(this.classes.targetExpanded)?(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.target.classList.remove(this.classes.targetExpanded)):(this.ui.target.classList.add(this.classes.targetExpanded),this.ui.target.classList.remove(this.classes.targetCollapsed))},getLabelText:function(){return this.ui.label.textContent.trim()}})},681:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return h}});var i=n(186),s=n(928);var r,o={ui:{base:".o-table__row-links"},events:{"click tbody tr":"onRowLinkClick"},onRowLinkClick:function(t){var e=t.target;if(e&&"A"===e.tagName)return;var n=(e=(0,s.o)(t.target,"tr")).querySelector("a");n&&(window.location=n.getAttribute("href"))}},a=n(752);var l={ui:{base:".o-table__sortable",tableBody:"tbody",sortButton:".sorted-up, .sorted-down"},classes:{sortDown:"sorted-down",sortUp:"sorted-up"},events:{"click .sortable":"onSortableClick"},initialize:function(){this.sortClass=r,this.sortColumnIndex=r,this.sortDirection=r,this.tableData=[],this.bindProperties(),this.ui.sortButton&&(this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP,this.ui.sortButton.classList.contains(this.classes.sortDown)&&(this.sortDirection=a.mQ.DOWN),this.updateTable())},bindProperties:function(){var t;Object.defineProperty(this,"sortDirection",{configurable:!0,get:function(){return t},set:function(e){e===a.mQ.UP?this.sortClass=this.classes.sortUp:e===a.mQ.DOWN&&(this.sortClass=this.classes.sortDown),t=e}})},getColumnIndex:function(t){return(0,s.o)(t||this.ui.sortButton,"td, th").cellIndex},updateTable:function(){return this.updateTableData()&&this.updateTableDom()},updateTableData:function(t){var e,n=this.ui.tableBody.querySelectorAll("tr");this.tableData=[],t=t||this.sortColumnIndex;for(var i=0,s=n.length;i<s;++i)(e=n[i].cells[t])&&(e=e.textContent.trim()),this.tableData.push([e,n[i]]);var r=this.ui.sortButton.getAttribute("data-sort_type");return this.tableData.sort(this.tableDataSorter(this.sortDirection,r)),this.tableData},updateTableDom:function(){var t=this.ui.tableBody;for(;t.lastChild;)t.removeChild(t.lastChild);for(var e=document.createDocumentFragment(),n=0;n<this.tableData.length;n++)e.appendChild(this.tableData[n][1]);return t.appendChild(e),this.dispatchEvent("table:updated"),t},tableDataSorter:function(t,e){return function(n,i){var s=t===a.mQ.DOWN?-1:1,r=0,o=/[^\d.-]/g;return n=n[0],i=i[0],"number"===e&&(n=Number(n.replace(o,"")),i=Number(i.replace(o,""))),n<i?r=-1*s:n>i&&(r=s),r}},onSortableClick:function(t){this.ui.sortButton&&this.ui.sortButton.classList.remove(this.sortClass);this.ui.sortButton===t.target?this.sortDirection=~this.sortDirection:(this.ui.sortButton=t.target,this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP);return this.ui.sortButton.classList.add(this.sortClass),this.updateTable(),this}},c=i.Z.extend({ui:{base:".o-table"},modifiers:[l,o]});c.constants.DIRECTIONS=a.mQ;var h=c}},i={};function s(t){if(i[t])return i[t].exports;var e=i[t]={exports:{}};return n[t](e,e.exports,s),e.exports}s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=s(270),e=s(681),t.init(),e.init()}();
!function(){var t,e,n={852:function(t){"use strict";function e(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=e.prototype.handle.bind(this),this._removedListeners=[]}t.exports=e,e.prototype.root=function(t){var e,n=this.listenerMap;if(this.rootElement){for(e in n[1])n[1].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!1)}if(!t||!t.addEventListener)return this.rootElement&&delete this.rootElement,this;for(e in this.rootElement=t,n[1])n[1].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!1);return this},e.prototype.captureForType=function(t){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(t)},e.prototype.on=function(t,e,o,a){var l,c,h,u;if(!t)throw new TypeError("Invalid event type: "+t);if("function"==typeof e&&(a=o,o=e,e=null),void 0===a&&(a=this.captureForType(t)),"function"!=typeof o)throw new TypeError("Handler must be a type of Function");return l=this.rootElement,(c=this.listenerMap[a?1:0])[t]||(l&&l.addEventListener(t,this.handle,a),c[t]=[]),e?/^[a-z]+$/i.test(e)?(u=e,h=i):/^#[a-z0-9\-_]+$/i.test(e)?(u=e.slice(1),h=r):(u=e,h=n):(u=null,h=s.bind(this)),c[t].push({selector:e,handler:o,matcher:h,matcherParam:u}),this},e.prototype.off=function(t,e,n,i){var s,r,o,a,l;if("function"==typeof e&&(i=n,n=e,e=null),void 0===i)return this.off(t,e,n,!0),this.off(t,e,n,!1),this;if(o=this.listenerMap[i?1:0],!t){for(l in o)o.hasOwnProperty(l)&&this.off(l,e,n);return this}if(!(a=o[t])||!a.length)return this;for(s=a.length-1;s>=0;s--)r=a[s],e&&e!==r.selector||n&&n!==r.handler||(this._removedListeners.push(r),a.splice(s,1));return a.length||(delete o[t],this.rootElement&&this.rootElement.removeEventListener(t,this.handle,i)),this},e.prototype.handle=function(t){var e,n,i,s,r,o=t.type,a=[],l="ftLabsDelegateIgnore";if(!0!==t[l]){switch(3===(r=t.target).nodeType&&(r=r.parentNode),r.correspondingUseElement&&(r=r.correspondingUseElement),i=this.rootElement,t.eventPhase||(t.target!==t.currentTarget?3:2)){case 1:a=this.listenerMap[1][o];break;case 2:this.listenerMap[0]&&this.listenerMap[0][o]&&(a=a.concat(this.listenerMap[0][o])),this.listenerMap[1]&&this.listenerMap[1][o]&&(a=a.concat(this.listenerMap[1][o]));break;case 3:a=this.listenerMap[0][o]}var c,h=[];for(n=a.length;r&&n;){for(e=0;e<n&&(s=a[e]);e++)r.tagName&&["button","input","select","textarea"].indexOf(r.tagName.toLowerCase())>-1&&r.hasAttribute("disabled")?h=[]:s.matcher.call(r,s.matcherParam,r)&&h.push([t,r,s]);if(r===i)break;if(n=a.length,(r=r.parentElement||r.parentNode)instanceof HTMLDocument)break}for(e=0;e<h.length;e++)if(!(this._removedListeners.indexOf(h[e][2])>-1)&&!1===this.fire.apply(this,h[e])){h[e][0][l]=!0,h[e][0].preventDefault(),c=!1;break}return c}},e.prototype.fire=function(t,e,n){return n.handler.call(e,t,e)};var n=function(t){if(t){var e=t.prototype;return e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector}}(Element);function i(t,e){return t.toLowerCase()===e.tagName.toLowerCase()}function s(t,e){return this.rootElement===window?e===document||e===document.documentElement||e===window:this.rootElement===e}function r(t,e){return t===e.id}e.prototype.destroy=function(){this.off(),this.root()}},161:function(t,e,n){"use strict";var i=n(852);t.exports=function(t){return new i(t)},t.exports.Delegate=i},186:function(t,e,n){"use strict";n.d(e,{Z:function(){return d}});var i=n(752);var s=i.uJ+"atomic_init";function r(t){return!function(t,e){if(!t)return!1;var n=t.getAttribute(i.kQ);return!!n&&(n=n.split(" ")).indexOf(e)>-1}(t,s)&&(function(t,e){if(-1!==e.indexOf(" ")){var n=i.kQ+" values cannot contain spaces!";throw new Error(n)}var s=t.getAttribute(i.kQ);null!==s&&(e=s+" "+e),t.setAttribute(i.kQ,e)}(t,s),!0)}function o(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){t=t||{};for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e]||{},s=void 0;for(s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];o(r)?a(t[s]||(t[s]={}),r):t[s]=r}}return t}var l=n(147),c=n(291),h=n(161).Delegate;function u(t,e){this.element=t,this.initializers=[],this.uId=this.uniqueId("ac"),a(this,e),this.processModifiers(),this.ensureElement(),this.setCachedElements(),this.initializers.push(this.initialize)}a(u.prototype,new l.Z,{init:function(){return this.initializers.forEach((function(t){c.Z.isFunction(t)&&t.apply(this,arguments)}),this),this.dispatchEvent("component:initialized"),this},processModifiers:function(){this.modifiers&&this.modifiers.forEach((function(t){var e=t.ui.base.substring(1);this.element.classList.contains(e)&&(t.initialize&&(this.initializers.push(t.initialize),delete t.initialize),a(this,t))}),this)},render:function(){return this},ensureElement:function(){if(this.element)this.setElement(this.element);else{var t=a({},this.attributes);t.id=this.id||this.u_id,this.className&&(t.class=this.className),this.setElement(document.createElement("div")),this.setElementAttributes(t)}r(this.element)},setElement:function(t){return this.element&&this.undelegateEvents(),this.element=t,this.delegateEvents(),this},setCachedElements:function(){var t,e,n=a({},this.ui);for(t in n)n.hasOwnProperty(t)&&(1===(e=this.element.querySelectorAll(n[t])).length?n[t]=e[0]:e.length>1?n[t]=e:n[t]=null);return this.ui=n,n},destroy:function(){return this.element&&(this.element.parentNode.removeChild(this.element),this.element.view&&delete this.element.view,delete this.element),this.undelegateEvents(),this.dispatchEvent("component:destroyed"),!0},setElementAttributes:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.element.setAttribute(e,t[e])},delegateEvents:function(t){var e,n,i,s=/^(\S+)\s*(.*)$/;if(!(t=t||(t=this.events)))return this;for(e in this.undelegateEvents(),this._delegate=new h(this.element),t)({}).hasOwnProperty.call(t,e)&&(n=t[e],c.Z.isFunction(this[n])&&(n=this[n]),n&&(i=e.match(s),this.delegate(i[1],i[2],n.bind(this))));return this.dispatchEvent("component:bound"),this},delegate:function(t,e,n){return this._delegate.on(t,e,n),this},undelegateEvents:function(){return this._delegate&&this._delegate.destroy(),this.element.removeAttribute("data-js-hook"),this},uniqueId:function(t){return t+"_"+Math.random().toString(36).substr(2,9)}}),u.init=function(t){return function(t,e,n){for(var i,s,r=(n||document).querySelectorAll(t),o=[],a=0,l=r.length;a<l;a++)!1===(s=r[a]).hasAttribute("data-js-hook")&&((i=new e(s)).init(),o.push(i));return o}(this.selector,this,t)},u.extend=function(t){function e(){return this._super=u.prototype,u.apply(this,arguments)}return e.prototype=Object.create(u.prototype),a(e.prototype,t),a(e,u),t.hasOwnProperty("ui")&&t.ui.hasOwnProperty("base")&&(e.selector=t.ui.base),e.constants={},e};var d=u},147:function(t,e){"use strict";e.Z=function(){var t={};return this.addEventListener=function(e,n){return t.hasOwnProperty(e)?t[e].push(n):t[e]=[n],this},this.removeEventListener=function(e,n){if(!t.hasOwnProperty(e))return this;var i=t[e].indexOf(n);return-1!==i&&t[e].splice(i,1),this},this.dispatchEvent=function(e,n){if(!t.hasOwnProperty(e))return this;n=n||{};for(var i=t[e],s=0,r=i.length;s<r;s++)i[s].call(this,n);return this},this.getRegisteredEvents=function(){return t},this}},928:function(t,e,n){"use strict";n.d(e,{o:function(){return i}});n(291);function i(t,e){if("closest"in t)return t.closest(e);for(var n,i=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;t;)if(i.bind(t)(e)?n=t:t=t.parentElement,n)return t;return null}},752:function(t,e,n){"use strict";n.d(e,{kQ:function(){return i},uJ:function(){return s},mQ:function(){return r}});var i="data-js-hook",s="state_";var r={UP:0,RIGHT:1,DOWN:-1,LEFT:-2}},291:function(t,e){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=Object.prototype.toString;function s(t){return void 0===t}function r(t){return"[object String]"===i.call(t)}var o=Array.isArray||function(t){return"[object Array]"===i.call(t)};e.Z={isUndefined:s,isDefined:function(t){return void 0!==t},isObject:function(t){return null!==t&&"object"===n(t)},isString:r,isNumber:function(t){return"[object Number]"===i.call(t)},isDate:function(t){return"[object Date]"===i.call(t)},isArray:o,isFunction:function(t){return"[object Function]"===i.call(t)},isEmpty:function(t){return s(t)||null===t||r(t)&&t.length<=0||/^\s*$/.test(t)}}},270:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return m}});var i=n(186),s=n(147);function r(t,e){var n,i,o,a,l,c=e,h=!1,u=!1;function d(t){n&&(g(),p()),(n=t).classList.add(c.BASE_CLASS),o=function(t){if(!t){throw new Error("Element does not have TransitionEnd event. It may be null!")}var e,n,i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(n in i)if(i.hasOwnProperty(n)&&void 0!==t.style[n]){e=i[n];break}return e}(n)}function p(){return n?(n.classList.remove(r.NO_ANIMATION_CLASS),this):this}function f(){h&&(n.style.webkitTransitionDuration="0",n.style.mozTransitionDuration="0",n.style.oTransitionDuration="0",n.style.transitionDuration="0",n.removeEventListener(o,a),a(),n.style.webkitTransitionDuration="",n.style.mozTransitionDuration="",n.style.oTransitionDuration="",n.style.transitionDuration="")}function m(){h=!0,o?(n.addEventListener(o,a),this.dispatchEvent(r.BEGIN_EVENT,{target:this})):(this.dispatchEvent(r.BEGIN_EVENT,{target:this}),a())}function v(){n.removeEventListener(o,a)}function E(){v(),this.dispatchEvent(r.END_EVENT,{target:this}),h=!1}function b(){var t;for(t in c)c.hasOwnProperty(t)&&c[t]!==c.BASE_CLASS&&n.classList.contains(c[t])&&n.classList.remove(c[t])}function g(){return!!n&&(f(),n.classList.remove(c.BASE_CLASS),b(),!0)}var y=new s.Z;return this.addEventListener=y.addEventListener,this.dispatchEvent=y.dispatchEvent,this.removeEventListener=y.removeEventListener,this.animateOff=function(){return n?(n.classList.add(r.NO_ANIMATION_CLASS),this):this},this.animateOn=p,this.applyClass=function(t){return!!n&&(u||(b(),u=!0),!n.classList.contains(t)&&(v(),n.classList.remove(i),i=t,l(),n.classList.add(i),!0))},this.halt=f,this.init=function(){return a=E.bind(this),l=m.bind(this),d(t),this},this.isAnimated=function(){return!!n&&!n.classList.contains(r.NO_ANIMATION_CLASS)},this.remove=g,this.setElement=d,this}r.BEGIN_EVENT="transitionBegin",r.END_EVENT="transitionEnd",r.NO_ANIMATION_CLASS="u-no-animation";var o=r,a={BASE_CLASS:"o-expandable_content__transition",EXPANDED:"o-expandable_content__expanded",COLLAPSED:"o-expandable_content__collapsed",OPEN_DEFAULT:"o-expandable_content__onload-open"};function l(t){var e,n=new o(t,a);function i(){t.classList.contains(a.EXPANDED)?(this.dispatchEvent("expandEnd",{target:this}),t.scrollHeight>e&&(t.style.maxHeight=t.scrollHeight+"px")):t.classList.contains(a.COLLAPSED)&&this.dispatchEvent("collapseEnd",{target:this})}var r=new s.Z;return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=n.animateOff,this.animateOn=n.animateOn,this.halt=n.halt,this.isAnimated=n.isAnimated,this.setElement=n.setElement,this.remove=n.remove,this.init=function(){return n.init(),n.addEventListener(o.END_EVENT,i.bind(this)),t.classList.contains(a.OPEN_DEFAULT)?this.expand():this.collapse(),this},this.toggleExpandable=function(){return t.classList.contains(a.COLLAPSED)?this.expand():this.collapse(),this},this.collapse=function(){return this.dispatchEvent("collapseBegin",{target:this}),e=t.scrollHeight,t.style.maxHeight="0",n.applyClass(a.COLLAPSED),this},this.expand=function(){return this.dispatchEvent("expandBegin",{target:this}),(!e||t.scrollHeight>e)&&(e=t.scrollHeight),t.style.maxHeight=e+"px",n.applyClass(a.EXPANDED),this},this}l.CLASSES=a;var c=l,h=n(928),u=new s.Z;function d(){this.activeAccordion&&(this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.activeAccordion=!1)}function p(){this.ui.content.classList.remove("u-hidden")}function f(){this.ui.content.classList.add("u-hidden")}var m=i.Z.extend({ui:{base:".o-expandable",target:".o-expandable_target",content:".o-expandable_content",header:".o-expandable_header",label:".o-expandable_label"},classes:{targetExpanded:"o-expandable_target__expanded",targetCollapsed:"o-expandable_target__collapsed",group:"o-expandable-group",groupAccordion:"o-expandable-group__accordion"},events:{"click .o-expandable_target":"expandableClickHandler"},transition:null,isAccordionGroup:!1,activeAccordion:!1,initialize:function(){var t=new c(this.ui.content);this.transition=t.init(),this.transition.addEventListener("expandBegin",p.bind(this)),this.transition.addEventListener("collapseEnd",f.bind(this)),this.ui.content.classList.contains(c.CLASSES.EXPANDED)?this.ui.target.classList.add(this.classes.targetExpanded):(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.content.classList.add("u-hidden"));var e=(0,h.o)(this.ui.target,"."+this.classes.group);this.isAccordionGroup=null!==e&&e.classList.contains(this.classes.groupAccordion),this.isAccordionGroup&&u.addEventListener("accordionActivated",d.bind(this))},expandableClickHandler:function(){this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.isAccordionGroup&&(this.activeAccordion?this.activeAccordion=!1:(u.dispatchEvent("accordionActivated",{target:this}),this.activeAccordion=!0))},toggleTargetState:function(t){t.classList.contains(this.classes.targetExpanded)?(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.target.classList.remove(this.classes.targetExpanded)):(this.ui.target.classList.add(this.classes.targetExpanded),this.ui.target.classList.remove(this.classes.targetCollapsed))},getLabelText:function(){return this.ui.label.textContent.trim()}})},681:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return h}});var i=n(186),s=n(928);var r,o={ui:{base:".o-table__row-links"},events:{"click tbody tr":"onRowLinkClick"},onRowLinkClick:function(t){var e=t.target;if(e&&"A"===e.tagName)return;var n=(e=(0,s.o)(t.target,"tr")).querySelector("a");n&&(window.location=n.getAttribute("href"))}},a=n(752);var l={ui:{base:".o-table__sortable",tableBody:"tbody",sortButton:".sorted-up, .sorted-down"},classes:{sortDown:"sorted-down",sortUp:"sorted-up"},events:{"click .sortable":"onSortableClick"},initialize:function(){this.sortClass=r,this.sortColumnIndex=r,this.sortDirection=r,this.tableData=[],this.bindProperties(),this.ui.sortButton&&(this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP,this.ui.sortButton.classList.contains(this.classes.sortDown)&&(this.sortDirection=a.mQ.DOWN),this.updateTable())},bindProperties:function(){var t;Object.defineProperty(this,"sortDirection",{configurable:!0,get:function(){return t},set:function(e){e===a.mQ.UP?this.sortClass=this.classes.sortUp:e===a.mQ.DOWN&&(this.sortClass=this.classes.sortDown),t=e}})},getColumnIndex:function(t){return(0,s.o)(t||this.ui.sortButton,"td, th").cellIndex},updateTable:function(){return this.updateTableData()&&this.updateTableDom()},updateTableData:function(t){var e,n=this.ui.tableBody.querySelectorAll("tr");this.tableData=[],t=t||this.sortColumnIndex;for(var i=0,s=n.length;i<s;++i)(e=n[i].cells[t])&&(e=e.textContent.trim()),this.tableData.push([e,n[i]]);var r=this.ui.sortButton.getAttribute("data-sort_type");return this.tableData.sort(this.tableDataSorter(this.sortDirection,r)),this.tableData},updateTableDom:function(){var t=this.ui.tableBody;for(;t.lastChild;)t.removeChild(t.lastChild);for(var e=document.createDocumentFragment(),n=0;n<this.tableData.length;n++)e.appendChild(this.tableData[n][1]);return t.appendChild(e),this.dispatchEvent("table:updated"),t},tableDataSorter:function(t,e){return function(n,i){var s=t===a.mQ.DOWN?-1:1,r=0,o=/[^\d.-]/g;return n=n[0],i=i[0],"number"===e&&(n=Number(n.replace(o,"")),i=Number(i.replace(o,""))),n<i?r=-1*s:n>i&&(r=s),r}},onSortableClick:function(t){this.ui.sortButton&&this.ui.sortButton.classList.remove(this.sortClass);this.ui.sortButton===t.target?this.sortDirection=~this.sortDirection:(this.ui.sortButton=t.target,this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP);return this.ui.sortButton.classList.add(this.sortClass),this.updateTable(),this}},c=i.Z.extend({ui:{base:".o-table"},modifiers:[l,o]});c.constants.DIRECTIONS=a.mQ;var h=c}},i={};function s(t){if(i[t])return i[t].exports;var e=i[t]={exports:{}};return n[t](e,e.exports,s),e.exports}s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=s(270),e=s(681),t.init(),e.init()}();
{
"name": "@cfpb/cfpb-design-system",
"version": "0.7.0",
"version": "0.7.1",
"description": "CFPB's UI framework",

@@ -28,3 +28,3 @@ "main": "src/cfpb-design-system.js",

"@cfpb/cfpb-expandables": "^0.7.0",
"@cfpb/cfpb-forms": "^0.7.0",
"@cfpb/cfpb-forms": "^0.7.1",
"@cfpb/cfpb-grid": "^0.7.0",

@@ -38,3 +38,3 @@ "@cfpb/cfpb-icons": "^0.7.0",

},
"gitHead": "6cd9639374c987030a84d78fcf2428a2db8dc9cf"
"gitHead": "96a86a1054545d3ddbbbbe8b72d275905a0543e7"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc