@public-ui/components 1.5.2-rc.0 → 1.5.2-rc.2

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 (33) hide show
  1. package/assets/codicons/codicon.css +12 -1
  2. package/assets/codicons/codicon.csv +7 -2
  3. package/assets/codicons/codicon.html +53 -13
  4. package/assets/codicons/codicon.svg +1 -1
  5. package/assets/codicons/codicon.ttf +0 -0
  6. package/cheat-sheet.html +6 -6
  7. package/custom-elements.json +1 -1
  8. package/dist/cjs/kol-button-wc_3.cjs.entry.js.map +1 -1
  9. package/dist/cjs/kol-progress.cjs.entry.js +1 -1
  10. package/dist/cjs/kol-progress.cjs.entry.js.map +1 -1
  11. package/dist/cjs/kol-spin.cjs.entry.js +1 -1
  12. package/dist/cjs/kol-spin.cjs.entry.js.map +1 -1
  13. package/dist/components/component3.js.map +1 -1
  14. package/dist/components/kol-progress.js +1 -1
  15. package/dist/components/kol-progress.js.map +1 -1
  16. package/dist/components/kol-spin.js +1 -1
  17. package/dist/components/kol-spin.js.map +1 -1
  18. package/dist/esm/kol-button-wc_3.entry.js.map +1 -1
  19. package/dist/esm/kol-progress.entry.js +1 -1
  20. package/dist/esm/kol-progress.entry.js.map +1 -1
  21. package/dist/esm/kol-spin.entry.js +1 -1
  22. package/dist/esm/kol-spin.entry.js.map +1 -1
  23. package/dist/kolibri/kol-button-wc_3.entry.js.map +1 -1
  24. package/dist/kolibri/kol-progress.entry.js +1 -1
  25. package/dist/kolibri/kol-progress.entry.js.map +1 -1
  26. package/dist/kolibri/kol-spin.entry.js +1 -1
  27. package/dist/kolibri/kol-spin.entry.js.map +1 -1
  28. package/dist/types/components/spin/component.d.ts +7 -13
  29. package/dist/types/components.d.ts +4 -2
  30. package/dist/types/types/props/variant/spin.d.ts +6 -0
  31. package/doc/spin.md +69 -53
  32. package/jest-test-results.json +1 -1
  33. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * KoliBri - The accessible HTML-Standard
3
3
  */
4
- import{r as i,h as a,F as n,H as t}from"./index-50adf9a0.js";import{b as s,a as e}from"./prop.validators-2c20cdf8.js";import{a as r}from"./i18n-b8589f01.js";import"./a11y.tipps-2e27f8e6.js";import"./dev.utils-157f0499.js";import"./reuse-3a02afb9.js";import"./index-f4596895.js";import"./index-0962b5a1.js";const o=":host{--a11y-min-size:44px}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}button,input,option,select,textarea{font-family:inherit}.icon-only>kol-span-wc>span>span{display:none}.spin{display:inline-block;height:1rem;position:relative;width:3rem}.spin span{animation-timing-function:cubic-bezier(0, 1, 1, 0);border-radius:50%;border:0.1rem solid #fff;height:0.8rem;position:absolute;top:0.1rem;width:0.8rem}.spin span:first-child{background-color:#fc0;z-index:0;animation:2s infinite spin1;left:0.1rem}.spin span:nth-child(2){background-color:red;z-index:1;animation:2s infinite spin2;left:0.1rem}.spin span:nth-child(3){background-color:#000;z-index:1;animation:2s infinite spin2;left:1.1rem}.spin span:nth-child(4){background-color:#666;z-index:0;animation:2s infinite spin3;left:2.1rem}@keyframes spin1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes spin2{0%{transform:translate(0, 0)}100%{transform:translate(1rem, 0)}}@keyframes spin3{0%{transform:scale(1)}100%{transform:scale(0)}}",l=class{constructor(a){i(this,a),this.showToggled=!1,this._show=!1,this._variant="default",this.state={_variant:"default"}}render(){return a(t,null,this.state._show?a("span",{"aria-busy":"true","aria-label":r("kol-action-running"),"aria-live":"polite",class:"spin",role:"alert"},"default"===this.state._variant?a(n,null,a("span",{class:"bg-spin-1"}),a("span",{class:"bg-spin-2"}),a("span",{class:"bg-spin-3"}),a("span",{class:"bg-neutral"})):a("slot",{name:"expert"})):this.showToggled&&a("span",{"aria-label":r("kol-action-done"),"aria-busy":"false","aria-live":"polite",role:"alert"}))}validateShow(a){this.showToggled=!0===this.state._show&&!1===this._show,s(this,"_show",a)}validateVariant(a){e(this,"_variant",(a=>"default"===a||"none"===a),new Set(["default","none"]),a)}componentWillLoad(){this.validateShow(this._show),this.validateVariant(this._variant)}static get watchers(){return{_show:["validateShow"],_variant:["validateVariant"]}}};l.style={default:o};export{l as kol_spin};
4
+ import{r as i,h as n,F as a,H as t}from"./index-50adf9a0.js";import{a as s}from"./i18n-b8589f01.js";import{a as e,b as r}from"./prop.validators-2c20cdf8.js";import"./index-0962b5a1.js";import"./index-f4596895.js";import"./a11y.tipps-2e27f8e6.js";import"./dev.utils-157f0499.js";import"./reuse-3a02afb9.js";const o=(i,n)=>{e(i,"_variant",(i=>"default"===i||"none"===i),new Set(["default","none"]),n)},l=":host{--a11y-min-size:44px}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}button,input,option,select,textarea{font-family:inherit}.icon-only>kol-span-wc>span>span{display:none}.spin{display:inline-block;height:1rem;position:relative;width:3rem}.spin span{animation-timing-function:cubic-bezier(0, 1, 1, 0);border-radius:50%;border:0.1rem solid #fff;height:0.8rem;position:absolute;top:0.1rem;width:0.8rem}.spin span:first-child{background-color:#fc0;z-index:0;animation:1s infinite spin1;left:0.1rem}.spin span:nth-child(2){background-color:red;z-index:1;animation:1s infinite spin2;left:0.1rem}.spin span:nth-child(3){background-color:#000;z-index:1;animation:1s infinite spin2;left:1.1rem}.spin span:nth-child(4){background-color:#666;z-index:0;animation:1s infinite spin3;left:2.1rem}@keyframes spin1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes spin2{0%{transform:translate(0, 0)}100%{transform:translate(1rem, 0)}}@keyframes spin3{0%{transform:scale(1)}100%{transform:scale(0)}}@media (prefers-reduced-motion){.spin span:first-child,.spin span:nth-child(2),.spin span:nth-child(3),.spin span:nth-child(4){animation-duration:2s}}",p=class{constructor(n){i(this,n),this.showToggled=!1,this._show=!1,this._variant="default",this.state={_variant:"default"}}render(){return n(t,null,this.state._show?n("span",{"aria-busy":"true","aria-label":s("kol-action-running"),"aria-live":"polite",class:"spin",role:"alert"},"default"===this.state._variant?n(a,null,n("span",{class:"bg-spin-1"}),n("span",{class:"bg-spin-2"}),n("span",{class:"bg-spin-3"}),n("span",{class:"bg-neutral"})):n("slot",{name:"expert"})):this.showToggled&&n("span",{"aria-label":s("kol-action-done"),"aria-busy":"false","aria-live":"polite",role:"alert"}))}validateShow(i){this.showToggled=!0===this.state._show&&!1===this._show,r(this,"_show",i)}validateVariant(i){o(this,i)}componentWillLoad(){this.validateShow(this._show),this.validateVariant(this._variant)}static get watchers(){return{_show:["validateShow"],_variant:["validateVariant"]}}};p.style={default:l};export{p as kol_spin};
@@ -1 +1 @@
1
- {"version":3,"names":["defaultStyleCss","KolSpin","this","showToggled","_variant","render","h","Host","state","_show","translate","class","role","Fragment","name","validateShow","value","watchBoolean","validateVariant","watchValidator","Set","componentWillLoad"],"sources":["./src/components/spin/style.css?tag=kol-spin&mode=default&encapsulation=shadow","./src/components/spin/component.tsx"],"sourcesContent":["@import url(../style.css);\n.spin {\n\tdisplay: inline-block;\n\theight: 1rem;\n\tposition: relative;\n\twidth: 3rem;\n}\n.spin span {\n\tanimation-timing-function: cubic-bezier(0, 1, 1, 0);\n\tborder-radius: 50%;\n\tborder: 0.1rem solid #fff;\n\theight: 0.8rem;\n\tposition: absolute;\n\ttop: 0.1rem;\n\twidth: 0.8rem;\n}\n.spin span:first-child {\n\tbackground-color: #fc0;\n\tz-index: 0;\n\tanimation: 2s infinite spin1;\n\tleft: 0.1rem;\n}\n.spin span:nth-child(2) {\n\tbackground-color: red;\n\tz-index: 1;\n\tanimation: 2s infinite spin2;\n\tleft: 0.1rem;\n}\n.spin span:nth-child(3) {\n\tbackground-color: #000;\n\tz-index: 1;\n\tanimation: 2s infinite spin2;\n\tleft: 1.1rem;\n}\n.spin span:nth-child(4) {\n\tbackground-color: #666;\n\tz-index: 0;\n\tanimation: 2s infinite spin3;\n\tleft: 2.1rem;\n}\n@keyframes spin1 {\n\t0% {\n\t\ttransform: scale(0);\n\t}\n\t100% {\n\t\ttransform: scale(1);\n\t}\n}\n@keyframes spin2 {\n\t0% {\n\t\ttransform: translate(0, 0);\n\t}\n\t100% {\n\t\ttransform: translate(1rem, 0);\n\t}\n}\n@keyframes spin3 {\n\t0% {\n\t\ttransform: scale(1);\n\t}\n\t100% {\n\t\ttransform: scale(0);\n\t}\n}\n","import { Component, Fragment, h, Host, JSX, Prop, State, Watch } from '@stencil/core';\n\nimport { Generic } from '@a11y-ui/core';\nimport { watchBoolean, watchValidator } from '../../utils/prop.validators';\nimport { translate } from '../../i18n';\n\n/**\n * Loadingspinner\n * - https://github.com/vineethtrv/css-loader\n */\ntype SpinAnimation = 'default' | 'none';\n\ntype RequiredProps = unknown;\ntype OptionalProps = {\n\tshow: boolean;\n\tvariant: SpinAnimation;\n};\nexport type Props = Generic.Element.Members<RequiredProps, OptionalProps>;\n\ntype RequiredStates = {\n\tvariant: SpinAnimation;\n};\ntype OptionalStates = {\n\tshow: boolean;\n};\ntype States = Generic.Element.Members<RequiredStates, OptionalStates>;\n\n@Component({\n\ttag: 'kol-spin',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolSpin implements Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates> {\n\tprivate showToggled = false;\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t{this.state._show ? (\n\t\t\t\t\t<span aria-busy=\"true\" aria-label={translate('kol-action-running')} aria-live=\"polite\" class=\"spin\" role=\"alert\">\n\t\t\t\t\t\t{this.state._variant === 'default' ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-1\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-2\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-3\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-neutral\"></span>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot name=\"expert\"></slot>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\tthis.showToggled && <span aria-label={translate('kol-action-done')} aria-busy=\"false\" aria-live=\"polite\" role=\"alert\"></span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt an, ob die Ladeanzeige eingeblendet wird oder nicht.\n\t */\n\t@Prop({ reflect: true }) public _show?: boolean = false;\n\n\t/**\n\t * Gibt an, welche Ladeanimation oder ob keine Animation verwendet werden soll.\n\t */\n\t@Prop() public _variant?: SpinAnimation = 'default';\n\n\t@State() public state: States = {\n\t\t_variant: 'default',\n\t};\n\n\t@Watch('_show')\n\tpublic validateShow(value?: boolean): void {\n\t\tthis.showToggled = this.state._show === true && this._show === false;\n\t\twatchBoolean(this, '_show', value);\n\t}\n\n\t@Watch('_variant')\n\tpublic validateVariant(value?: SpinAnimation): void {\n\t\twatchValidator(this, '_variant', (value) => value === 'default' || value === 'none', new Set(['default', 'none']), value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateShow(this._show);\n\t\tthis.validateVariant(this._variant);\n\t}\n}\n"],"mappings":";;;kTAAA,MAAMA,EAAkB,y9C,MCkCXC,EAAO,M,yBACXC,KAAAC,YAAc,M,WA4B4B,M,cAKR,U,WAEV,CAC/BC,SAAU,U,CAlCJC,SACN,OACCC,EAACC,EAAI,KACHL,KAAKM,MAAMC,MACXH,EAAA,oBAAgB,OAAM,aAAaI,EAAU,sBAAqB,YAAY,SAASC,MAAM,OAAOC,KAAK,SACvGV,KAAKM,MAAMJ,WAAa,UACxBE,EAACO,EAAQ,KACRP,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,gBAGbL,EAAA,QAAMQ,KAAK,YAIbZ,KAAKC,aAAeG,EAAA,qBAAkBI,EAAU,mBAAkB,YAAY,QAAO,YAAW,SAASE,KAAK,U,CAqB3GG,aAAaC,GACnBd,KAAKC,YAAcD,KAAKM,MAAMC,QAAU,MAAQP,KAAKO,QAAU,MAC/DQ,EAAaf,KAAM,QAASc,E,CAItBE,gBAAgBF,GACtBG,EAAejB,KAAM,YAAac,GAAUA,IAAU,WAAaA,IAAU,QAAQ,IAAII,IAAI,CAAC,UAAW,SAAUJ,E,CAG7GK,oBACNnB,KAAKa,aAAab,KAAKO,OACvBP,KAAKgB,gBAAgBhB,KAAKE,S"}
1
+ {"version":3,"names":["validateSpinVariant","component","value","watchValidator","Set","defaultStyleCss","KolSpin","this","showToggled","_variant","render","h","Host","state","_show","translate","class","role","Fragment","name","validateShow","watchBoolean","validateVariant","componentWillLoad"],"sources":["./src/types/props/variant/spin.ts","./src/components/spin/style.css?tag=kol-spin&mode=default&encapsulation=shadow","./src/components/spin/component.tsx"],"sourcesContent":["import { Generic } from '@a11y-ui/core';\nimport { watchValidator } from '../../../utils/prop.validators';\n\n/* types */\n/**\n * Loadingspinner\n * - https://github.com/vineethtrv/css-loader\n */\nexport type SpinVariant = 'default' | 'none';\n\n/** de\n * Macht die Fehlermeldung dieses Elements von Screenreadern lesbar.\n */\n/** en\n * Makes hints readable for screenreaders.\n */\nexport type PropSpinVariant = {\n\tvariant: SpinVariant;\n};\n\n/* validator */\nexport const validateSpinVariant = (component: Generic.Element.Component, value?: SpinVariant): void => {\n\twatchValidator(component, '_variant', (value) => value === 'default' || value === 'none', new Set(['default', 'none']), value);\n};\n","@import url(../style.css);\n.spin {\n\tdisplay: inline-block;\n\theight: 1rem;\n\tposition: relative;\n\twidth: 3rem;\n}\n.spin span {\n\tanimation-timing-function: cubic-bezier(0, 1, 1, 0);\n\tborder-radius: 50%;\n\tborder: 0.1rem solid #fff;\n\theight: 0.8rem;\n\tposition: absolute;\n\ttop: 0.1rem;\n\twidth: 0.8rem;\n}\n.spin span:first-child {\n\tbackground-color: #fc0;\n\tz-index: 0;\n\tanimation: 1s infinite spin1;\n\tleft: 0.1rem;\n}\n.spin span:nth-child(2) {\n\tbackground-color: red;\n\tz-index: 1;\n\tanimation: 1s infinite spin2;\n\tleft: 0.1rem;\n}\n.spin span:nth-child(3) {\n\tbackground-color: #000;\n\tz-index: 1;\n\tanimation: 1s infinite spin2;\n\tleft: 1.1rem;\n}\n.spin span:nth-child(4) {\n\tbackground-color: #666;\n\tz-index: 0;\n\tanimation: 1s infinite spin3;\n\tleft: 2.1rem;\n}\n@keyframes spin1 {\n\t0% {\n\t\ttransform: scale(0);\n\t}\n\t100% {\n\t\ttransform: scale(1);\n\t}\n}\n@keyframes spin2 {\n\t0% {\n\t\ttransform: translate(0, 0);\n\t}\n\t100% {\n\t\ttransform: translate(1rem, 0);\n\t}\n}\n@keyframes spin3 {\n\t0% {\n\t\ttransform: scale(1);\n\t}\n\t100% {\n\t\ttransform: scale(0);\n\t}\n} /* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#toning_down_the_animation_scaling */\n@media (prefers-reduced-motion) {\n\t.spin span:first-child,\n\t.spin span:nth-child(2),\n\t.spin span:nth-child(3),\n\t.spin span:nth-child(4) {\n\t\tanimation-duration: 2s;\n\t}\n}\n","import { Component, Fragment, Host, JSX, Prop, State, Watch, h } from '@stencil/core';\n\nimport { Generic } from '@a11y-ui/core';\nimport { translate } from '../../i18n';\nimport { PropSpinVariant, SpinVariant, validateSpinVariant } from '../../types/props/variant/spin';\nimport { watchBoolean } from '../../utils/prop.validators';\nimport { PropShow } from '../../types/props';\n\ntype RequiredProps = unknown;\ntype OptionalProps = PropSpinVariant & PropShow;\nexport type Props = Generic.Element.Members<RequiredProps, OptionalProps>;\n\ntype RequiredStates = PropSpinVariant;\ntype OptionalStates = PropShow;\ntype States = Generic.Element.Members<RequiredStates, OptionalStates>;\n\n@Component({\n\ttag: 'kol-spin',\n\tstyleUrls: {\n\t\tdefault: './style.css',\n\t},\n\tshadow: true,\n})\nexport class KolSpin implements Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates> {\n\tprivate showToggled = false;\n\n\tpublic render(): JSX.Element {\n\t\treturn (\n\t\t\t<Host>\n\t\t\t\t{this.state._show ? (\n\t\t\t\t\t<span aria-busy=\"true\" aria-label={translate('kol-action-running')} aria-live=\"polite\" class=\"spin\" role=\"alert\">\n\t\t\t\t\t\t{this.state._variant === 'default' ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-1\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-2\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-spin-3\"></span>\n\t\t\t\t\t\t\t\t<span class=\"bg-neutral\"></span>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot name=\"expert\"></slot>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\tthis.showToggled && <span aria-label={translate('kol-action-done')} aria-busy=\"false\" aria-live=\"polite\" role=\"alert\"></span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t/**\n\t * Gibt an, ob die Ladeanzeige eingeblendet wird oder nicht.\n\t */\n\t@Prop({ reflect: true }) public _show?: boolean = false;\n\n\t/**\n\t * Gibt an, welche Ladeanimation oder ob keine Animation verwendet werden soll.\n\t */\n\t@Prop() public _variant?: SpinVariant = 'default';\n\n\t@State() public state: States = {\n\t\t_variant: 'default',\n\t};\n\n\t@Watch('_show')\n\tpublic validateShow(value?: boolean): void {\n\t\tthis.showToggled = this.state._show === true && this._show === false;\n\t\twatchBoolean(this, '_show', value);\n\t}\n\n\t@Watch('_variant')\n\tpublic validateVariant(value?: SpinVariant): void {\n\t\tvalidateSpinVariant(this, value);\n\t}\n\n\tpublic componentWillLoad(): void {\n\t\tthis.validateShow(this._show);\n\t\tthis.validateVariant(this._variant);\n\t}\n}\n"],"mappings":";;;kTAqBO,MAAMA,EAAsB,CAACC,EAAsCC,KACzEC,EAAeF,EAAW,YAAaC,GAAUA,IAAU,WAAaA,IAAU,QAAQ,IAAIE,IAAI,CAAC,UAAW,SAAUF,EAAM,ECtB/H,MAAMG,EAAkB,+mD,MCuBXC,EAAO,M,yBACXC,KAAAC,YAAc,M,WA4B4B,M,cAKV,U,WAER,CAC/BC,SAAU,U,CAlCJC,SACN,OACCC,EAACC,EAAI,KACHL,KAAKM,MAAMC,MACXH,EAAA,oBAAgB,OAAM,aAAaI,EAAU,sBAAqB,YAAY,SAASC,MAAM,OAAOC,KAAK,SACvGV,KAAKM,MAAMJ,WAAa,UACxBE,EAACO,EAAQ,KACRP,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,cACZL,EAAA,QAAMK,MAAM,gBAGbL,EAAA,QAAMQ,KAAK,YAIbZ,KAAKC,aAAeG,EAAA,qBAAkBI,EAAU,mBAAkB,YAAY,QAAO,YAAW,SAASE,KAAK,U,CAqB3GG,aAAalB,GACnBK,KAAKC,YAAcD,KAAKM,MAAMC,QAAU,MAAQP,KAAKO,QAAU,MAC/DO,EAAad,KAAM,QAASL,E,CAItBoB,gBAAgBpB,GACtBF,EAAoBO,KAAML,E,CAGpBqB,oBACNhB,KAAKa,aAAab,KAAKO,OACvBP,KAAKe,gBAAgBf,KAAKE,S"}
@@ -1,27 +1,21 @@
1
1
  import { JSX } from '../../stencil-public-runtime';
2
2
  import { Generic } from '@a11y-ui/core';
3
- type SpinAnimation = 'default' | 'none';
3
+ import { PropSpinVariant, SpinVariant } from '../../types/props/variant/spin';
4
+ import { PropShow } from '../../types/props';
4
5
  type RequiredProps = unknown;
5
- type OptionalProps = {
6
- show: boolean;
7
- variant: SpinAnimation;
8
- };
6
+ type OptionalProps = PropSpinVariant & PropShow;
9
7
  export type Props = Generic.Element.Members<RequiredProps, OptionalProps>;
10
- type RequiredStates = {
11
- variant: SpinAnimation;
12
- };
13
- type OptionalStates = {
14
- show: boolean;
15
- };
8
+ type RequiredStates = PropSpinVariant;
9
+ type OptionalStates = PropShow;
16
10
  type States = Generic.Element.Members<RequiredStates, OptionalStates>;
17
11
  export declare class KolSpin implements Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates> {
18
12
  private showToggled;
19
13
  render(): JSX.Element;
20
14
  _show?: boolean;
21
- _variant?: SpinAnimation;
15
+ _variant?: SpinVariant;
22
16
  state: States;
23
17
  validateShow(value?: boolean): void;
24
- validateVariant(value?: SpinAnimation): void;
18
+ validateVariant(value?: SpinVariant): void;
25
19
  componentWillLoad(): void;
26
20
  }
27
21
  export {};
@@ -34,6 +34,7 @@ import { PaginationHasButton } from "./components/pagination/component";
34
34
  import { KoliBriPaginationButtonCallbacks } from "./components/pagination/types";
35
35
  import { KoliBriProgressType } from "./types/progress";
36
36
  import { KoliBriQuoteVariant } from "./components/quote/types";
37
+ import { SpinVariant } from "./types/props/variant/spin";
37
38
  import { KoliBriSplitButtonCallback } from "./components/split-button/types";
38
39
  import { KoliBriDataType, KoliBriTableHeaders, KoliBriTablePaginationProps } from "./types/table";
39
40
  import { KoliBriTabsCallbacks, TabButtonProps } from "./components/tabs/component";
@@ -68,6 +69,7 @@ export { PaginationHasButton } from "./components/pagination/component";
68
69
  export { KoliBriPaginationButtonCallbacks } from "./components/pagination/types";
69
70
  export { KoliBriProgressType } from "./types/progress";
70
71
  export { KoliBriQuoteVariant } from "./components/quote/types";
72
+ export { SpinVariant } from "./types/props/variant/spin";
71
73
  export { KoliBriSplitButtonCallback } from "./components/split-button/types";
72
74
  export { KoliBriDataType, KoliBriTableHeaders, KoliBriTablePaginationProps } from "./types/table";
73
75
  export { KoliBriTabsCallbacks, TabButtonProps } from "./components/tabs/component";
@@ -2099,7 +2101,7 @@ export namespace Components {
2099
2101
  /**
2100
2102
  * Gibt an, welche Ladeanimation oder ob keine Animation verwendet werden soll.
2101
2103
  */
2102
- "_variant"?: SpinAnimation;
2104
+ "_variant"?: SpinVariant;
2103
2105
  }
2104
2106
  interface KolSplitButton {
2105
2107
  /**
@@ -4830,7 +4832,7 @@ declare namespace LocalJSX {
4830
4832
  /**
4831
4833
  * Gibt an, welche Ladeanimation oder ob keine Animation verwendet werden soll.
4832
4834
  */
4833
- "_variant"?: SpinAnimation;
4835
+ "_variant"?: SpinVariant;
4834
4836
  }
4835
4837
  interface KolSplitButton {
4836
4838
  /**
@@ -0,0 +1,6 @@
1
+ import { Generic } from '@a11y-ui/core';
2
+ export type SpinVariant = 'default' | 'none';
3
+ export type PropSpinVariant = {
4
+ variant: SpinVariant;
5
+ };
6
+ export declare const validateSpinVariant: (component: Generic.Element.Component, value?: SpinVariant) => void;
package/doc/spin.md CHANGED
@@ -7,71 +7,87 @@ Ladeanzeigen, wie die **Spin**-Komponente, informieren die Nutzer:innen über La
7
7
  ### Code
8
8
 
9
9
  ```html
10
+ <style>
11
+ /* https://github.com/vineethtrv/css-loader */
12
+ .loader {
13
+ width: 48px;
14
+ height: 48px;
15
+ border: 3px dotted #444;
16
+ border-style: solid solid dotted dotted;
17
+ border-radius: 50%;
18
+ display: inline-block;
19
+ position: relative;
20
+ box-sizing: border-box;
21
+ animation: rotation 2s linear infinite;
22
+ }
23
+ .loader::after {
24
+ content: '';
25
+ box-sizing: border-box;
26
+ position: absolute;
27
+ left: 0;
28
+ right: 0;
29
+ top: 0;
30
+ bottom: 0;
31
+ margin: auto;
32
+ border: 3px dotted #ff3d00;
33
+ border-style: solid solid dotted;
34
+ width: 24px;
35
+ height: 24px;
36
+ border-radius: 50%;
37
+ animation: rotationBack 1s linear infinite;
38
+ transform-origin: center center;
39
+ }
40
+
41
+ @keyframes rotation {
42
+ 0% {
43
+ transform: rotate(0deg);
44
+ }
45
+ 100% {
46
+ transform: rotate(360deg);
47
+ }
48
+ }
49
+ @keyframes rotationBack {
50
+ 0% {
51
+ transform: rotate(0deg);
52
+ }
53
+ 100% {
54
+ transform: rotate(-360deg);
55
+ }
56
+ }
57
+
58
+ /* https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#toning_down_the_animation_scaling */
59
+ @media (prefers-reduced-motion) {
60
+ .loader {
61
+ animation-duration: 6s;
62
+ }
63
+ .loader::after {
64
+ animation-duration: 3s;
65
+ }
66
+ }
67
+ </style>
10
68
  <div>
11
69
  <kol-spin _show></kol-spin>
12
70
  <!-- for a11y experts - own animation -->
13
71
  <kol-spin _show="true" _variant="none">
14
72
  <!-- slot for own animation : https://github.com/vineethtrv/css-loader -->
15
- <span class="loader" slot="expert"></span>
73
+ <span className="loader" slot="expert"></span>
16
74
  </kol-spin>
17
75
  </div>
18
76
  ```
19
77
 
20
- ### Beispiel
78
+ <kol-alert _heading="Reduce Motion" _level="4" _type="warning">Wenn möglich sollte stets auf Animationen verzichtet werden. Wenn Animationen genutzt werden, sollte immer darauf geachtet werden, eine Variante mit reduzierter Animationsgeschwindigkeit anzubieten. Mehr Informationen dazu findet sich hier:
79
+ <kol-link _label="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion" _href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion" _target="_blank"></kol-link></kol-alert>
21
80
 
22
- <style>
23
- /* https://github.com/vineethtrv/css-loader */
24
- .loader {
25
- width: 48px;
26
- height: 48px;
27
- border: 3px dotted #3d3d3d;
28
- border-style: solid solid dotted dotted;
29
- border-radius: 50%;
30
- display: inline-block;
31
- position: relative;
32
- box-sizing: border-box;
33
- animation: rotation 4s linear infinite;
34
- }
35
- .loader::after {
36
- content: '';
37
- box-sizing: border-box;
38
- position: absolute;
39
- left: 0;
40
- right: 0;
41
- top: 0;
42
- bottom: 0;
43
- margin: auto;
44
- border: 3px dotted #ff3d00;
45
- border-style: solid solid dotted;
46
- width: 24px;
47
- height: 24px;
48
- border-radius: 50%;
49
- animation: rotationBack 2s linear infinite;
50
- transform-origin: center center;
51
- }
52
-
53
- @keyframes rotation {
54
- 0% {
55
- transform: rotate(0deg);
56
- }
57
- 100% {
58
- transform: rotate(360deg);
59
- }
60
- }
61
- @keyframes rotationBack {
62
- 0% {
63
- transform: rotate(0deg);
64
- }
65
- 100% {
66
- transform: rotate(-360deg);
67
- }
68
- }
69
- </style>
81
+ ### Beispiel
70
82
 
71
83
  <kol-spin _show></kol-spin>
72
- <kol-spin _show="true" _variant="none">
73
- <span class="loader" slot="expert"></span>
74
- </kol-spin>
84
+
85
+ <kol-spin _show="true" _variant="none"><span className="loader" slot="expert"></span></kol-spin>
86
+
87
+ <kol-details _summary="CSS Loaders & Spinners" _open>
88
+ Es gibt im Internet viele verschiedene CSS Loaders und Spinners. Beispielsweise bietet _Vineeth_ eine ganze Reihe interessanter CSS Loaders an. Diese können auch in der KoliBri Bibliothek genutzt werden. Dazu muss lediglich der Link zu der entsprechenden CSS Datei in den Head der HTML Datei eingebunden werden. Anschließend kann die gewünschte Animation über den Expert-Slot in die KoliBri-Komponente eingebunden werden. Hier sind einige Beispiele (ohne reduzierte Animationsgeschwindigkeit):
89
+ <kol-link _label="https://github.com/vineethtrv/css-loader" _href="https://github.com/vineethtrv/css-loader" _target="_blank"></kol-link>
90
+ </kol-details>
75
91
 
76
92
  ## Verwendung
77
93