@krumio/trailhand-ui 1.5.0 → 1.6.0

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 (89) hide show
  1. package/README.md +102 -11
  2. package/dist/components/button/button.d.ts +20 -0
  3. package/dist/components/button/button.d.ts.map +1 -0
  4. package/dist/components/button/button.js +189 -0
  5. package/dist/components/button/button.js.map +1 -0
  6. package/dist/components/button/index.d.ts +2 -0
  7. package/dist/components/button/index.d.ts.map +1 -0
  8. package/dist/components/button/index.js +2 -0
  9. package/dist/components/button/index.js.map +1 -0
  10. package/dist/components/icon/icon.d.ts +18 -0
  11. package/dist/components/icon/icon.d.ts.map +1 -0
  12. package/dist/components/icon/icon.js +44 -0
  13. package/dist/components/icon/icon.js.map +1 -0
  14. package/dist/components/icon/index.d.ts +2 -0
  15. package/dist/components/icon/index.d.ts.map +1 -0
  16. package/dist/components/icon/index.js +2 -0
  17. package/dist/components/icon/index.js.map +1 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/styles/colors.css +132 -0
  23. package/package.json +17 -8
  24. package/dist/Button.d.ts +0 -15
  25. package/dist/Button.d.ts.map +0 -1
  26. package/dist/Button.js +0 -18
  27. package/dist/Button.js.map +0 -1
  28. package/dist/Header.d.ts +0 -15
  29. package/dist/Header.d.ts.map +0 -1
  30. package/dist/Header.js +0 -44
  31. package/dist/Header.js.map +0 -1
  32. package/dist/Page.d.ts +0 -9
  33. package/dist/Page.d.ts.map +0 -1
  34. package/dist/Page.js +0 -61
  35. package/dist/Page.js.map +0 -1
  36. package/dist/action-menu.d.ts +0 -79
  37. package/dist/action-menu.d.ts.map +0 -1
  38. package/dist/action-menu.js +0 -321
  39. package/dist/action-menu.js.map +0 -1
  40. package/dist/assets/index-B7q5L5KS.js +0 -91
  41. package/dist/components/action-menu/action-menu.stories.d.ts +0 -261
  42. package/dist/components/action-menu/action-menu.stories.d.ts.map +0 -1
  43. package/dist/components/action-menu/action-menu.stories.js +0 -363
  44. package/dist/components/action-menu/action-menu.stories.js.map +0 -1
  45. package/dist/components/data-table/data-table.stories.d.ts +0 -507
  46. package/dist/components/data-table/data-table.stories.d.ts.map +0 -1
  47. package/dist/components/data-table/data-table.stories.js +0 -601
  48. package/dist/components/data-table/data-table.stories.js.map +0 -1
  49. package/dist/components/th-card/index.d.ts +0 -3
  50. package/dist/components/th-card/index.d.ts.map +0 -1
  51. package/dist/components/th-card/index.js +0 -2
  52. package/dist/components/th-card/index.js.map +0 -1
  53. package/dist/components/th-card/th-card.d.ts +0 -78
  54. package/dist/components/th-card/th-card.d.ts.map +0 -1
  55. package/dist/components/th-card/th-card.js +0 -449
  56. package/dist/components/th-card/th-card.js.map +0 -1
  57. package/dist/components/th-card/th-card.stories.d.ts +0 -232
  58. package/dist/components/th-card/th-card.stories.d.ts.map +0 -1
  59. package/dist/components/th-card/th-card.stories.js +0 -385
  60. package/dist/components/th-card/th-card.stories.js.map +0 -1
  61. package/dist/components/th-tag/index.d.ts +0 -3
  62. package/dist/components/th-tag/index.d.ts.map +0 -1
  63. package/dist/components/th-tag/index.js +0 -2
  64. package/dist/components/th-tag/index.js.map +0 -1
  65. package/dist/components/th-tag/th-tag.d.ts +0 -65
  66. package/dist/components/th-tag/th-tag.d.ts.map +0 -1
  67. package/dist/components/th-tag/th-tag.js +0 -307
  68. package/dist/components/th-tag/th-tag.js.map +0 -1
  69. package/dist/components/th-tag/th-tag.stories.d.ts +0 -277
  70. package/dist/components/th-tag/th-tag.stories.d.ts.map +0 -1
  71. package/dist/components/th-tag/th-tag.stories.js +0 -415
  72. package/dist/components/th-tag/th-tag.stories.js.map +0 -1
  73. package/dist/components/toggle-switch/toggle-switch.stories.d.ts +0 -239
  74. package/dist/components/toggle-switch/toggle-switch.stories.d.ts.map +0 -1
  75. package/dist/components/toggle-switch/toggle-switch.stories.js +0 -408
  76. package/dist/components/toggle-switch/toggle-switch.stories.js.map +0 -1
  77. package/dist/data-table.d.ts +0 -191
  78. package/dist/data-table.d.ts.map +0 -1
  79. package/dist/data-table.js +0 -796
  80. package/dist/data-table.js.map +0 -1
  81. package/dist/design-system/color-palette.stories.d.ts +0 -24
  82. package/dist/design-system/color-palette.stories.d.ts.map +0 -1
  83. package/dist/design-system/color-palette.stories.js +0 -361
  84. package/dist/design-system/color-palette.stories.js.map +0 -1
  85. package/dist/index.html +0 -102
  86. package/dist/toggle-switch.d.ts +0 -38
  87. package/dist/toggle-switch.d.ts.map +0 -1
  88. package/dist/toggle-switch.js +0 -175
  89. package/dist/toggle-switch.js.map +0 -1
@@ -1,91 +0,0 @@
1
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const n of s)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const n={};return s.integrity&&(n.integrity=s.integrity),s.referrerPolicy&&(n.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?n.credentials="include":s.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(s){if(s.ep)return;s.ep=!0;const n=t(s);fetch(s.href,n)}})();/**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const N=globalThis,K=N.ShadowRoot&&(N.ShadyCSS===void 0||N.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,V=Symbol(),Z=new WeakMap;let oe=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==V)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(K&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Z.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Z.set(t,e))}return e}toString(){return this.cssText}};const pe=r=>new oe(typeof r=="string"?r:r+"",void 0,V),ue=(r,...e)=>{const t=r.length===1?r[0]:e.reduce(((i,s,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[n+1]),r[0]);return new oe(t,r,V)},fe=(r,e)=>{if(K)r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),s=N.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,r.appendChild(i)}},X=K?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return pe(t)})(r):r;/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:$e,defineProperty:ge,getOwnPropertyDescriptor:me,getOwnPropertyNames:_e,getOwnPropertySymbols:ye,getPrototypeOf:Ae}=Object,g=globalThis,G=g.trustedTypes,be=G?G.emptyScript:"",j=g.reactiveElementPolyfillSupport,C=(r,e)=>r,R={toAttribute(r,e){switch(e){case Boolean:r=r?be:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},W=(r,e)=>!$e(r,e),Q={attribute:!0,type:String,converter:R,reflect:!1,useDefault:!1,hasChanged:W};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Q){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&ge(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:n}=me(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);n==null||n.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Q}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;const e=Ae(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){const t=this.properties,i=[..._e(t),...ye(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(X(s))}else e!==void 0&&t.push(X(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return fe(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var n;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:R).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var n,o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),h=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:R;this._$Em=s;const c=h.fromAttribute(t,a.type);this[s]=c??((o=this._$Ej)==null?void 0:o.get(s))??c,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const n=this.constructor,o=this[e];if(i??(i=n.getPropertyOptions(e)),!((i.hasChanged??W)(o,t)||i.useDefault&&i.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(n._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),n!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[n,o]of s){const{wrapped:a}=o,h=this[n];a!==!0||this._$AL.has(n)||h===void 0||this.C(n,void 0,o,h)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach((s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)})),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[C("elementProperties")]=new Map,v[C("finalized")]=new Map,j==null||j({ReactiveElement:v}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.1");/**
10
- * @license
11
- * Copyright 2017 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */const x=globalThis,D=x.trustedTypes,Y=D?D.createPolicy("lit-html",{createHTML:r=>r}):void 0,he="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,ae="?"+$,ve=`<${ae}>`,b=document,O=()=>b.createComment(""),k=r=>r===null||typeof r!="object"&&typeof r!="function",F=Array.isArray,Ee=r=>F(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",z=`[
14
- \f\r]`,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ee=/-->/g,te=/>/g,_=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),se=/'/g,ie=/"/g,le=/^(?:script|style|textarea|title)$/i,Se=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),we=Se(1),E=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),re=new WeakMap,y=b.createTreeWalker(b,129);function ce(r,e){if(!F(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Y!==void 0?Y.createHTML(e):e}const Ce=(r,e)=>{const t=r.length-1,i=[];let s,n=e===2?"<svg>":e===3?"<math>":"",o=w;for(let a=0;a<t;a++){const h=r[a];let c,p,l=-1,u=0;for(;u<h.length&&(o.lastIndex=u,p=o.exec(h),p!==null);)u=o.lastIndex,o===w?p[1]==="!--"?o=ee:p[1]!==void 0?o=te:p[2]!==void 0?(le.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=_):p[3]!==void 0&&(o=_):o===_?p[0]===">"?(o=s??w,l=-1):p[1]===void 0?l=-2:(l=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?_:p[3]==='"'?ie:se):o===ie||o===se?o=_:o===ee||o===te?o=w:(o=_,s=void 0);const f=o===_&&r[a+1].startsWith("/>")?" ":"";n+=o===w?h+ve:l>=0?(i.push(c),h.slice(0,l)+he+h.slice(l)+$+f):h+$+(l===-2?a:f)}return[ce(r,n+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class U{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0;const a=e.length-1,h=this.parts,[c,p]=Ce(e,t);if(this.el=U.createElement(c,i),y.currentNode=this.el.content,t===2||t===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(s=y.nextNode())!==null&&h.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const l of s.getAttributeNames())if(l.endsWith(he)){const u=p[o++],f=s.getAttribute(l).split($),L=/([.?@])?(.*)/.exec(u);h.push({type:1,index:n,name:L[2],strings:f,ctor:L[1]==="."?Pe:L[1]==="?"?Oe:L[1]==="@"?ke:I}),s.removeAttribute(l)}else l.startsWith($)&&(h.push({type:6,index:n}),s.removeAttribute(l));if(le.test(s.tagName)){const l=s.textContent.split($),u=l.length-1;if(u>0){s.textContent=D?D.emptyScript:"";for(let f=0;f<u;f++)s.append(l[f],O()),y.nextNode(),h.push({type:2,index:++n});s.append(l[u],O())}}}else if(s.nodeType===8)if(s.data===ae)h.push({type:2,index:n});else{let l=-1;for(;(l=s.data.indexOf($,l+1))!==-1;)h.push({type:7,index:n}),l+=$.length-1}n++}}static createElement(e,t){const i=b.createElement("template");return i.innerHTML=e,i}}function S(r,e,t=r,i){var o,a;if(e===E)return e;let s=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const n=k(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==n&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=S(r,s._$AS(r,e.values),s,i)),e}class xe{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=((e==null?void 0:e.creationScope)??b).importNode(t,!0);y.currentNode=s;let n=y.nextNode(),o=0,a=0,h=i[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new T(n,n.nextSibling,this,e):h.type===1?c=new h.ctor(n,h.name,h.strings,this,e):h.type===6&&(c=new Ue(n,this,e)),this._$AV.push(c),h=i[++a]}o!==(h==null?void 0:h.index)&&(n=y.nextNode(),o++)}return y.currentNode=b,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class T{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=S(this,e,t),k(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==E&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ee(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&k(this._$AH)?this._$AA.nextSibling.data=e:this.T(b.createTextNode(e)),this._$AH=e}$(e){var n;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=U.createElement(ce(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===s)this._$AH.p(t);else{const o=new xe(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=re.get(e.strings);return t===void 0&&re.set(e.strings,t=new U(e)),t}k(e){F(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const n of e)s===t.length?t.push(i=new T(this.O(O()),this.O(O()),this,this.options)):i=t[s],i._$AI(n),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(e,t=this,i,s){const n=this.strings;let o=!1;if(n===void 0)e=S(this,e,t,0),o=!k(e)||e!==this._$AH&&e!==E,o&&(this._$AH=e);else{const a=e;let h,c;for(e=n[0],h=0;h<n.length-1;h++)c=S(this,a[i+h],t,h),c===E&&(c=this._$AH[h]),o||(o=!k(c)||c!==this._$AH[h]),c===d?e=d:e!==d&&(e+=(c??"")+n[h+1]),this._$AH[h]=c}o&&!s&&this.j(e)}j(e){e===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Pe extends I{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===d?void 0:e}}class Oe extends I{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==d)}}class ke extends I{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=S(this,e,t,0)??d)===E)return;const i=this._$AH,s=e===d&&i!==d||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Ue{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){S(this,e)}}const B=x.litHtmlPolyfillSupport;B==null||B(U,T),(x.litHtmlVersions??(x.litHtmlVersions=[])).push("3.3.1");const Te=(r,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const n=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new T(e.insertBefore(O(),n),n,void 0,t??{})}return s._$AI(r),s};/**
16
- * @license
17
- * Copyright 2017 Google LLC
18
- * SPDX-License-Identifier: BSD-3-Clause
19
- */const A=globalThis;class P extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Te(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return E}}var ne;P._$litElement$=!0,P.finalized=!0,(ne=A.litElementHydrateSupport)==null||ne.call(A,{LitElement:P});const q=A.litElementPolyfillSupport;q==null||q({LitElement:P});(A.litElementVersions??(A.litElementVersions=[])).push("4.2.1");/**
20
- * @license
21
- * Copyright 2017 Google LLC
22
- * SPDX-License-Identifier: BSD-3-Clause
23
- */const He={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:W},Me=(r=He,e,t)=>{const{kind:i,metadata:s}=t;let n=globalThis.litPropertyMetadata.get(s);if(n===void 0&&globalThis.litPropertyMetadata.set(s,n=new Map),i==="setter"&&((r=Object.create(r)).wrapped=!0),n.set(t.name,r),i==="accessor"){const{name:o}=t;return{set(a){const h=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,h,r)},init(a){return a!==void 0&&this.C(o,void 0,r,a),a}}}if(i==="setter"){const{name:o}=t;return function(a){const h=this[o];e.call(this,a),this.requestUpdate(o,h,r)}}throw Error("Unsupported decorator location: "+i)};function H(r){return(e,t)=>typeof t=="object"?Me(r,e,t):((i,s,n)=>{const o=s.hasOwnProperty(n);return s.constructor.createProperty(n,i),o?Object.getOwnPropertyDescriptor(s,n):void 0})(r,e,t)}var Le=Object.defineProperty,M=(r,e,t,i)=>{for(var s=void 0,n=r.length-1,o;n>=0;n--)(o=r[n])&&(s=o(e,t,s)||s);return s&&Le(e,t,s),s};const J=class J extends P{constructor(){super(),this.checked=!1,this.onLabel="On",this.offLabel="Off",this.storageKey=null,this.name="",this.boundHandleExternalChange=this.handleExternalChange.bind(this),window.addEventListener("toggle-changed",this.boundHandleExternalChange)}connectedCallback(){if(super.connectedCallback(),this.storageKey){const e=localStorage.getItem(this.storageKey);e!==null&&(this.checked=e==="true")}}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("toggle-changed",this.boundHandleExternalChange)}handleExternalChange(e){const t=e;this.name&&t.detail.name===this.name&&(this.checked=t.detail.checked)}dispatchChangeEvent(e){const t=new CustomEvent("toggle-change",{bubbles:!0,composed:!0,detail:{checked:e,name:this.name}});this.dispatchEvent(t),this.name&&window.dispatchEvent(new CustomEvent("toggle-changed",{detail:{checked:e,name:this.name}}))}handleToggleChange(e){const t=e.target;this.checked=t.checked,this.storageKey&&localStorage.setItem(this.storageKey,this.checked.toString()),this.dispatchChangeEvent(this.checked)}render(){return we`
24
- <span class="label">${this.offLabel}</span>
25
- <label class="toggle-switch">
26
- <input
27
- type="checkbox"
28
- .checked=${this.checked}
29
- @change=${this.handleToggleChange}
30
- >
31
- <span class="slider"></span>
32
- </label>
33
- <span class="label">${this.onLabel}</span>
34
- `}};J.styles=ue`
35
- :host {
36
- display: flex;
37
- align-items: center;
38
- margin-right: 10px;
39
- }
40
-
41
- .toggle-switch {
42
- position: relative;
43
- display: inline-block;
44
- width: 44px;
45
- height: 24px;
46
- margin: 0 8px;
47
- }
48
-
49
- .toggle-switch input {
50
- opacity: 0;
51
- width: 0;
52
- height: 0;
53
- }
54
-
55
- .slider {
56
- position: absolute;
57
- cursor: pointer;
58
- top: 0;
59
- left: 0;
60
- right: 0;
61
- bottom: 0;
62
- background-color: #4a5568;
63
- transition: .3s;
64
- border-radius: 24px;
65
- }
66
-
67
- .slider:before {
68
- position: absolute;
69
- content: "";
70
- height: 18px;
71
- width: 18px;
72
- left: 3px;
73
- bottom: 3px;
74
- background-color: white;
75
- transition: .3s;
76
- border-radius: 50%;
77
- }
78
-
79
- input:checked + .slider {
80
- background-color: #3b82f6;
81
- }
82
-
83
- input:checked + .slider:before {
84
- transform: translateX(20px);
85
- }
86
-
87
- .label {
88
- font-size: 14px;
89
- user-select: none;
90
- }
91
- `;let m=J;M([H({type:Boolean})],m.prototype,"checked");M([H({type:String,attribute:"on-label"})],m.prototype,"onLabel");M([H({type:String,attribute:"off-label"})],m.prototype,"offLabel");M([H({type:String,attribute:"storage-key"})],m.prototype,"storageKey");M([H({type:String})],m.prototype,"name");customElements.define("toggle-switch",m);const Ne=()=>{const r=localStorage.getItem("user-theme-preference");return r==="dark"||r==="light"?(de(r),r==="dark"):window.matchMedia("(prefers-color-scheme: dark)").matches},de=r=>{document.body.classList.remove("theme-dark","theme-light"),document.body.classList.add(`theme-${r}`)};customElements.whenDefined("toggle-switch").then(()=>{const r=document.querySelectorAll("toggle-switch"),e=Ne();r.forEach(t=>{t.checked=e}),r.forEach(t=>{t.addEventListener("toggle-change",i=>{const s=i.detail.checked?"dark":"light";localStorage.setItem("user-theme-preference",s),de(s)})})});customElements.whenDefined("toggle-switch").then(()=>{const r=document.querySelector("header toggle-switch");r.onLabel="🌙 Dark",r.offLabel="☀️ Light"});customElements.whenDefined("toggle-switch").then(()=>{const r=document.getElementById("sync1");r.onLabel="🌙",r.offLabel="☀️"});
@@ -1,261 +0,0 @@
1
- declare namespace _default {
2
- let title: string;
3
- let tags: string[];
4
- function render(args: any): HTMLElement;
5
- namespace argTypes {
6
- namespace actions {
7
- let control: string;
8
- let description: string;
9
- }
10
- namespace resource {
11
- let control_1: string;
12
- export { control_1 as control };
13
- let description_1: string;
14
- export { description_1 as description };
15
- }
16
- namespace disabled {
17
- let control_2: string;
18
- export { control_2 as control };
19
- let description_2: string;
20
- export { description_2 as description };
21
- export let defaultValue: boolean;
22
- }
23
- }
24
- namespace parameters {
25
- namespace docs {
26
- export namespace description_3 {
27
- let component: string;
28
- }
29
- export { description_3 as description };
30
- }
31
- }
32
- }
33
- export default _default;
34
- export namespace Default {
35
- export namespace args {
36
- let actions_1: ({
37
- label: string;
38
- action: (resource: any) => void;
39
- danger?: undefined;
40
- } | {
41
- label: string;
42
- action: (resource: any) => void;
43
- danger: boolean;
44
- })[];
45
- export { actions_1 as actions };
46
- export namespace resource_1 {
47
- let id: number;
48
- let name: string;
49
- }
50
- export { resource_1 as resource };
51
- }
52
- export namespace parameters_1 {
53
- export namespace docs_1 {
54
- namespace source {
55
- let code: string;
56
- }
57
- }
58
- export { docs_1 as docs };
59
- }
60
- export { parameters_1 as parameters };
61
- }
62
- export namespace WithDividers {
63
- export namespace args_1 {
64
- let actions_2: ({
65
- label: string;
66
- action: (resource: any) => void;
67
- divider?: undefined;
68
- danger?: undefined;
69
- } | {
70
- divider: boolean;
71
- label?: undefined;
72
- action?: undefined;
73
- danger?: undefined;
74
- } | {
75
- label: string;
76
- action: (resource: any) => void;
77
- danger: boolean;
78
- divider?: undefined;
79
- })[];
80
- export { actions_2 as actions };
81
- export namespace resource_2 {
82
- let id_1: number;
83
- export { id_1 as id };
84
- let name_1: string;
85
- export { name_1 as name };
86
- }
87
- export { resource_2 as resource };
88
- }
89
- export { args_1 as args };
90
- export namespace parameters_2 {
91
- export namespace docs_2 {
92
- export namespace description_4 {
93
- let story: string;
94
- }
95
- export { description_4 as description };
96
- }
97
- export { docs_2 as docs };
98
- }
99
- export { parameters_2 as parameters };
100
- }
101
- export namespace ConditionalVisibility {
102
- export namespace args_2 {
103
- let actions_3: ({
104
- label: string;
105
- action: (resource: any) => void;
106
- visible: (resource: any) => any;
107
- danger?: undefined;
108
- } | {
109
- label: string;
110
- action: (resource: any) => void;
111
- danger: boolean;
112
- visible: (resource: any) => any;
113
- })[];
114
- export { actions_3 as actions };
115
- export namespace resource_3 {
116
- let id_2: number;
117
- export { id_2 as id };
118
- let name_2: string;
119
- export { name_2 as name };
120
- export let status: string;
121
- export let canEdit: boolean;
122
- export let canDelete: boolean;
123
- }
124
- export { resource_3 as resource };
125
- }
126
- export { args_2 as args };
127
- export namespace parameters_3 {
128
- export namespace docs_3 {
129
- export namespace description_5 {
130
- let story_1: string;
131
- export { story_1 as story };
132
- }
133
- export { description_5 as description };
134
- }
135
- export { docs_3 as docs };
136
- }
137
- export { parameters_3 as parameters };
138
- }
139
- export namespace DisabledActions {
140
- export namespace args_3 {
141
- let actions_4: ({
142
- label: string;
143
- action: (resource: any) => void;
144
- enabled: (resource: any) => any;
145
- danger?: undefined;
146
- } | {
147
- label: string;
148
- action: (resource: any) => void;
149
- enabled: boolean;
150
- danger?: undefined;
151
- } | {
152
- label: string;
153
- action: (resource: any) => void;
154
- enabled?: undefined;
155
- danger?: undefined;
156
- } | {
157
- label: string;
158
- action: (resource: any) => void;
159
- danger: boolean;
160
- enabled: (resource: any) => any;
161
- })[];
162
- export { actions_4 as actions };
163
- export namespace resource_4 {
164
- let id_3: number;
165
- export { id_3 as id };
166
- let name_3: string;
167
- export { name_3 as name };
168
- export let isEditable: boolean;
169
- export let isDeletable: boolean;
170
- }
171
- export { resource_4 as resource };
172
- }
173
- export { args_3 as args };
174
- export namespace parameters_4 {
175
- export namespace docs_4 {
176
- export namespace description_6 {
177
- let story_2: string;
178
- export { story_2 as story };
179
- }
180
- export { description_6 as description };
181
- }
182
- export { docs_4 as docs };
183
- }
184
- export { parameters_4 as parameters };
185
- }
186
- export namespace DisabledMenu {
187
- export namespace args_4 {
188
- let actions_5: ({
189
- label: string;
190
- action: (resource: any) => void;
191
- danger?: undefined;
192
- } | {
193
- label: string;
194
- action: (resource: any) => void;
195
- danger: boolean;
196
- })[];
197
- export { actions_5 as actions };
198
- export namespace resource_5 {
199
- let id_4: number;
200
- export { id_4 as id };
201
- let name_4: string;
202
- export { name_4 as name };
203
- }
204
- export { resource_5 as resource };
205
- let disabled_1: boolean;
206
- export { disabled_1 as disabled };
207
- }
208
- export { args_4 as args };
209
- export namespace parameters_5 {
210
- export namespace docs_5 {
211
- export namespace description_7 {
212
- let story_3: string;
213
- export { story_3 as story };
214
- }
215
- export { description_7 as description };
216
- }
217
- export { docs_5 as docs };
218
- }
219
- export { parameters_5 as parameters };
220
- }
221
- export namespace EmptyMenu {
222
- export namespace args_5 {
223
- let actions_6: never[];
224
- export { actions_6 as actions };
225
- export namespace resource_6 {
226
- let id_5: number;
227
- export { id_5 as id };
228
- let name_5: string;
229
- export { name_5 as name };
230
- }
231
- export { resource_6 as resource };
232
- }
233
- export { args_5 as args };
234
- export namespace parameters_6 {
235
- export namespace docs_6 {
236
- export namespace description_8 {
237
- let story_4: string;
238
- export { story_4 as story };
239
- }
240
- export { description_8 as description };
241
- }
242
- export { docs_6 as docs };
243
- }
244
- export { parameters_6 as parameters };
245
- }
246
- export namespace InTableContext {
247
- export function render_1(): HTMLDivElement;
248
- export { render_1 as render };
249
- export namespace parameters_7 {
250
- export namespace docs_7 {
251
- export namespace description_9 {
252
- let story_5: string;
253
- export { story_5 as story };
254
- }
255
- export { description_9 as description };
256
- }
257
- export { docs_7 as docs };
258
- }
259
- export { parameters_7 as parameters };
260
- }
261
- //# sourceMappingURL=action-menu.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-menu.stories.d.ts","sourceRoot":"","sources":["../../../src/components/action-menu/action-menu.stories.js"],"names":[],"mappings":";;;IASU,wCAYP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0QO,2CA2FP"}