@haiilo/catalyst 0.10.7 → 0.12.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 (72) hide show
  1. package/dist/catalyst/catalyst.css +1 -1
  2. package/dist/catalyst/catalyst.esm.js +1 -1
  3. package/dist/catalyst/catalyst.esm.js.map +1 -1
  4. package/dist/catalyst/{p-eddcea2b.entry.js → p-14edfc2b.entry.js} +5 -5
  5. package/dist/catalyst/p-14edfc2b.entry.js.map +1 -0
  6. package/dist/catalyst/p-5ba5e33c.entry.js +2 -0
  7. package/dist/catalyst/{p-c0b4200d.entry.js.map → p-5ba5e33c.entry.js.map} +1 -1
  8. package/dist/catalyst/scss/core/_base.scss +0 -1
  9. package/dist/catalyst/scss/index.scss +1 -1
  10. package/dist/catalyst/scss/utils/_layout.scss +4 -4
  11. package/dist/catalyst/scss/utils/_typography.mixins.scss +3 -3
  12. package/dist/cjs/cat-alert_21.cjs.entry.js +128 -105
  13. package/dist/cjs/cat-alert_21.cjs.entry.js.map +1 -1
  14. package/dist/cjs/cat-textarea.cjs.entry.js +1 -1
  15. package/dist/cjs/cat-textarea.cjs.entry.js.map +1 -1
  16. package/dist/cjs/catalyst.cjs.js +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/collection-manifest.json +1 -1
  19. package/dist/collection/components/cat-badge/cat-badge.css +15 -15
  20. package/dist/collection/components/cat-button/cat-button.css +185 -0
  21. package/dist/collection/components/cat-checkbox/cat-checkbox.css +16 -9
  22. package/dist/collection/components/cat-input/cat-input.css +3 -0
  23. package/dist/collection/components/cat-input/cat-input.js +1 -1
  24. package/dist/collection/components/cat-input/cat-input.js.map +1 -1
  25. package/dist/collection/components/cat-radio/cat-radio.css +4 -0
  26. package/dist/collection/components/cat-radio-group/cat-radio-group.js +62 -28
  27. package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
  28. package/dist/collection/components/cat-select/cat-select.css +4 -2
  29. package/dist/collection/components/cat-select/cat-select.js +136 -198
  30. package/dist/collection/components/cat-select/cat-select.js.map +1 -1
  31. package/dist/collection/components/cat-textarea/cat-textarea.css +3 -0
  32. package/dist/collection/components/cat-toggle/cat-toggle.css +9 -9
  33. package/dist/collection/components/cat-tooltip/cat-tooltip.css +2 -3
  34. package/dist/collection/index.js.map +1 -1
  35. package/dist/collection/scss/core/_base.scss +0 -1
  36. package/dist/collection/scss/index.scss +1 -1
  37. package/dist/collection/scss/utils/_layout.scss +4 -4
  38. package/dist/collection/scss/utils/_typography.mixins.scss +3 -3
  39. package/dist/components/cat-badge.js +1 -1
  40. package/dist/components/cat-badge.js.map +1 -1
  41. package/dist/components/cat-button2.js +1 -1
  42. package/dist/components/cat-button2.js.map +1 -1
  43. package/dist/components/cat-checkbox.js +1 -1
  44. package/dist/components/cat-checkbox.js.map +1 -1
  45. package/dist/components/cat-input.js +1 -1
  46. package/dist/components/cat-input.js.map +1 -1
  47. package/dist/components/cat-radio-group.js +18 -13
  48. package/dist/components/cat-radio-group.js.map +1 -1
  49. package/dist/components/cat-radio.js +1 -1
  50. package/dist/components/cat-radio.js.map +1 -1
  51. package/dist/components/cat-select.js +112 -98
  52. package/dist/components/cat-select.js.map +1 -1
  53. package/dist/components/cat-textarea.js +1 -1
  54. package/dist/components/cat-textarea.js.map +1 -1
  55. package/dist/components/cat-toggle.js +1 -1
  56. package/dist/components/cat-toggle.js.map +1 -1
  57. package/dist/components/cat-tooltip.js +1 -1
  58. package/dist/components/cat-tooltip.js.map +1 -1
  59. package/dist/esm/cat-alert_21.entry.js +128 -105
  60. package/dist/esm/cat-alert_21.entry.js.map +1 -1
  61. package/dist/esm/cat-textarea.entry.js +1 -1
  62. package/dist/esm/cat-textarea.entry.js.map +1 -1
  63. package/dist/esm/catalyst.js +1 -1
  64. package/dist/esm/loader.js +1 -1
  65. package/dist/types/components/cat-input/cat-input.d.ts +1 -1
  66. package/dist/types/components/cat-radio-group/cat-radio-group.d.ts +17 -2
  67. package/dist/types/components/cat-select/cat-select.d.ts +22 -28
  68. package/dist/types/components.d.ts +36 -35
  69. package/dist/types/index.d.ts +1 -1
  70. package/package.json +2 -2
  71. package/dist/catalyst/p-c0b4200d.entry.js +0 -2
  72. package/dist/catalyst/p-eddcea2b.entry.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{r as t,c as n,h as e,H as i,g as o}from"./p-659073b5.js";import{l as r}from"./p-2ad6f8d8.js";import{C as a}from"./p-6fce43dd.js";var s,h,l="function"==typeof Map?new Map:(s=[],h=[],{has:function(t){return s.indexOf(t)>-1},get:function(t){return h[s.indexOf(t)]},set:function(t,n){-1===s.indexOf(t)&&(s.push(t),h.push(n))},delete:function(t){var n=s.indexOf(t);n>-1&&(s.splice(n,1),h.splice(n,1))}}),c=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(s){c=function(t){var n=document.createEvent("Event");return n.initEvent(t,!0,!1),n}}function u(t){var n=l.get(t);n&&n.destroy()}function d(t){var n=l.get(t);n&&n.update()}var f=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((f=function(t){return t}).destroy=function(t){return t},f.update=function(t){return t}):((f=function(t,n){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return function(t){if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!l.has(t)){var n,e=null,i=null,o=null,r=function(){t.clientWidth!==i&&u()},a=function(n){window.removeEventListener("resize",r,!1),t.removeEventListener("input",u,!1),t.removeEventListener("keyup",u,!1),t.removeEventListener("autosize:destroy",a,!1),t.removeEventListener("autosize:update",u,!1),Object.keys(n).forEach((function(e){t.style[e]=n[e]})),l.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",a,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",u,!1),window.addEventListener("resize",r,!1),t.addEventListener("input",u,!1),t.addEventListener("autosize:update",u,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",l.set(t,{destroy:a,update:u}),"vertical"===(n=window.getComputedStyle(t,null)).resize?t.style.resize="none":"both"===n.resize&&(t.style.resize="horizontal"),e="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(e)&&(e=0),u()}function s(n){var e=t.style.width;t.style.width="0px",t.style.width=e,t.style.overflowY=n}function h(){if(0!==t.scrollHeight){var n=function(t){for(var n=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&n.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return n}(t),o=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+e+"px",i=t.clientWidth,n.forEach((function(t){t.node.scrollTop=t.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function u(){h();var n=Math.round(parseFloat(t.style.height)),e=window.getComputedStyle(t,null),i="content-box"===e.boxSizing?Math.round(parseFloat(e.height)):t.offsetHeight;if(i<n?"hidden"===e.overflowY&&(s("scroll"),h(),i="content-box"===e.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight):"hidden"!==e.overflowY&&(s("hidden"),h(),i="content-box"===e.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight),o!==i){o=i;var r=c("autosize:resized");try{t.dispatchEvent(r)}catch(t){}}}}(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],u),t},f.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],d),t});var p=f;const m=".hint-section{display:flex;gap:0.5rem;flex-direction:column}.hint-section .input-hint,.hint-section ::slotted([slot=hint]){font-size:0.875rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);margin:0}:host{display:flex;flex-direction:column;gap:0.5rem;font-size:0.9375rem;line-height:1.25rem;font-weight:var(--cat-font-weight-body, 400);margin-bottom:1rem}:host([hidden]){display:none}label{align-self:flex-start}label.hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.input-optional{margin-left:0.25rem;font-size:0.75rem;line-height:1rem;font-weight:var(--cat-font-weight-body, 400);color:rgb(var(--cat-font-color-muted, 105, 118, 135))}textarea{margin:0;padding:0.625rem 0.75rem;min-height:2.5rem;font:inherit;background:white;border-radius:0.25rem;border:none;box-shadow:0 0 0 1px #d7dbe0;transition:box-shadow 0.13s linear}textarea:disabled{background:#f8f8fb;cursor:not-allowed;color:rgb(var(--cat-font-color-muted, 105, 118, 135));resize:none}textarea:hover:not(:disabled){box-shadow:0 0 0 2px #d7dbe0}textarea:focus{outline:2px solid rgb(var(--cat-border-color-focus, 0, 113, 255))}textarea::placeholder{color:rgb(var(--cat-font-color-muted, 105, 118, 135))}";let b=0;const w=class{constructor(e){t(this,e);this.catChange=n(this,"catChange",7);this.catFocus=n(this,"catFocus",7);this.catBlur=n(this,"catBlur",7);this.id=`cat-textarea-${b++}`;this.hasSlottedLabel=false;this.disabled=false;this.label="";this.labelHidden=false;this.name="";this.readonly=false;this.required=false;this.rows=3}componentWillRender(){this.hasSlottedLabel=!!this.hostElement.querySelector('[slot="label"]');if(!this.label&&!this.hasSlottedLabel){r.error("[A11y] Missing ARIA label on textarea",this)}}componentDidLoad(){p(this.textarea)}async setFocus(t){this.textarea.focus(t)}render(){return e(i,null,(this.hasSlottedLabel||this.label)&&e("label",{htmlFor:this.id,class:{hidden:this.labelHidden}},e("span",{part:"label"},this.hasSlottedLabel&&e("slot",{name:"label"})||this.label,!this.required&&e("span",{class:"input-optional","aria-hidden":"true"},"(Optional)"))),e("textarea",{ref:t=>this.textarea=t,id:this.id,disabled:this.disabled,maxlength:this.maxLength,minlength:this.minLength,name:this.name,placeholder:this.placeholder,readonly:this.readonly,required:this.required,rows:this.rows,value:this.value,onInput:this.onInput.bind(this),onFocus:this.onFocus.bind(this),onBlur:this.onBlur.bind(this)}),this.hintSection)}get hintSection(){const t=!!this.hostElement.querySelector('[slot="hint"]');return(this.hint||t)&&e(a,{hint:this.hint,slottedHint:t&&e("slot",{name:"hint"})})}onInput(t){this.value=this.textarea.value;this.catChange.emit(t)}onFocus(t){this.catFocus.emit(t)}onBlur(t){this.catBlur.emit(t)}get hostElement(){return o(this)}};w.style=m;export{w as cat_textarea};
2
+ //# sourceMappingURL=p-5ba5e33c.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../node_modules/autosize/dist/autosize.esm.js","src/components/cat-textarea/cat-textarea.scss?tag=cat-textarea&encapsulation=shadow","src/components/cat-textarea/cat-textarea.tsx"],"names":["e","t","n","Map","has","indexOf","get","set","o","push","delete","splice","Event","bubbles","document","createEvent","initEvent","r","destroy","i","update","l","window","getComputedStyle","Array","prototype","forEach","call","length","nodeName","d","clientWidth","c","a","removeEventListener","Object","keys","style","bind","height","resize","overflowY","overflowX","wordWrap","addEventListener","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","isNaN","u","width","s","scrollHeight","parentNode","Element","scrollTop","node","documentElement","Math","round","offsetHeight","dispatchEvent","catTextareaCss","nextUniqueId","CatTextarea","[object Object]","hostRef","this","id","hasSlottedLabel","disabled","label","labelHidden","name","readonly","required","rows","hostElement","querySelector","log","error","autosize","textarea","options","focus","h","Host","htmlFor","class","hidden","part","aria-hidden","ref","el","maxlength","maxLength","minlength","minLength","placeholder","value","onInput","onFocus","onBlur","hintSection","hasSlottedHint","hint","CatFormHint","slottedHint","event","catChange","emit","catFocus","catBlur"],"mappings":"wIAAA,IAAIA,EAAEC,EAAEC,EAAE,mBAAmBC,IAAI,IAAIA,KAAKH,EAAE,GAAGC,EAAE,GAAG,CAACG,IAAI,SAASH,GAAG,OAAOD,EAAEK,QAAQJ,IAAI,GAAGK,IAAI,SAASJ,GAAG,OAAOD,EAAED,EAAEK,QAAQH,KA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fC,SAAUR,KAAKQ,SACfC,KAAMT,KAAKS,KACXuB,MAAOhC,KAAKgC,MACZC,QAASjC,KAAKiC,QAAQjE,KAAKgC,MAC3BkC,QAASlC,KAAKkC,QAAQlE,KAAKgC,MAC3BmC,OAAQnC,KAAKmC,OAAOnE,KAAKgC,QAE1BA,KAAKoC,aAKZA,kBACE,MAAMC,IAAmBrC,KAAKU,YAAYC,cAAc,iBACxD,OACGX,KAAKsC,MAAQD,IACZnB,EAACqB,EAAW,CAACD,KAAMtC,KAAKsC,KAAME,YAAaH,GAAkBnB,EAAA,OAAA,CAAMZ,KAAK,WAKtER,QAAQ2C,GACdzC,KAAKgC,MAAQhC,KAAKe,SAASiB,MAC3BhC,KAAK0C,UAAUC,KAAKF,GAGd3C,QAAQ2C,GACdzC,KAAK4C,SAASD,KAAKF,GAGb3C,OAAO2C,GACbzC,KAAK6C,QAAQF,KAAKF","sourcesContent":["var e,t,n=\"function\"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event(\"test\")}catch(e){o=function(e){var t=document.createEvent(\"Event\");return t.initEvent(e,!0,!1),t}}function r(e){var t=n.get(e);t&&t.destroy()}function i(e){var t=n.get(e);t&&t.update()}var l=null;\"undefined\"==typeof window||\"function\"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&\"TEXTAREA\"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c()},a=function(t){window.removeEventListener(\"resize\",d,!1),e.removeEventListener(\"input\",c,!1),e.removeEventListener(\"keyup\",c,!1),e.removeEventListener(\"autosize:destroy\",a,!1),e.removeEventListener(\"autosize:update\",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener(\"autosize:destroy\",a,!1),\"onpropertychange\"in e&&\"oninput\"in e&&e.addEventListener(\"keyup\",c,!1),window.addEventListener(\"resize\",d,!1),e.addEventListener(\"input\",c,!1),e.addEventListener(\"autosize:update\",c,!1),e.style.overflowX=\"hidden\",e.style.wordWrap=\"break-word\",n.set(e,{destroy:a,update:c}),\"vertical\"===(t=window.getComputedStyle(e,null)).resize?e.style.resize=\"none\":\"both\"===t.resize&&(e.style.resize=\"horizontal\"),r=\"content-box\"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c()}function u(t){var n=e.style.width;e.style.width=\"0px\",e.style.width=n,e.style.overflowY=t}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height=\"\",e.style.height=e.scrollHeight+r+\"px\",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),n&&(document.documentElement.scrollTop=n)}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?\"hidden\"===n.overflowY&&(u(\"scroll\"),s(),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):\"hidden\"!==n.overflowY&&(u(\"hidden\"),s(),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o(\"autosize:resized\");try{e.dispatchEvent(i)}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;export default d;\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n @include cat-body('m');\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n align-self: flex-start;\n\n &.hidden {\n @include cat-visually-hidden;\n }\n}\n\n.input-optional {\n margin-left: 0.25rem;\n @include cat-body('xs');\n color: cat-token('color.ui.font.muted');\n}\n\ntextarea {\n margin: 0;\n padding: 0.625rem 0.75rem;\n min-height: cat-size('m');\n font: inherit;\n background: cat-token('color.ui.background.input');\n border-radius: cat-border-radius('m');\n border: none;\n box-shadow: 0 0 0 1px cat-token('color.ui.border.input');\n transition: box-shadow cat-token('time.transition.s') linear;\n\n &:disabled {\n background: cat-token('color.ui.background.inputDisabled');\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n resize: none;\n }\n\n &:hover:not(:disabled) {\n box-shadow: 0 0 0 2px cat-token('color.ui.border.input');\n }\n\n &:focus {\n outline: 2px solid cat-token('color.ui.border.focus');\n }\n\n &::placeholder {\n color: cat-token('color.ui.font.muted');\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport autosize from 'autosize';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n shadow: true\n})\nexport class CatTextarea {\n private readonly id = `cat-textarea-${nextUniqueId++}`;\n private textarea!: HTMLTextAreaElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The label for the textarea.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name = '';\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial value of the control.\n */\n @Prop({ mutable: true }) value?: string | number;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on textarea', this);\n }\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Sets focus on the textarea. Use this method instead of `textarea.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.textarea.focus(options);\n }\n\n render() {\n return (\n <Host>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n {!this.required && (\n <span class=\"input-optional\" aria-hidden=\"true\">\n (Optional)\n </span>\n )}\n </span>\n </label>\n )}\n <textarea\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n ></textarea>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.value = this.textarea.value;\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
1
+ {"version":3,"sources":["../node_modules/autosize/dist/autosize.esm.js","src/components/cat-textarea/cat-textarea.scss?tag=cat-textarea&encapsulation=shadow","src/components/cat-textarea/cat-textarea.tsx"],"names":["e","t","n","Map","has","indexOf","get","set","o","push","delete","splice","Event","bubbles","document","createEvent","initEvent","r","destroy","i","update","l","window","getComputedStyle","Array","prototype","forEach","call","length","nodeName","d","clientWidth","c","a","removeEventListener","Object","keys","style","bind","height","resize","overflowY","overflowX","wordWrap","addEventListener","boxSizing","parseFloat","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth","isNaN","u","width","s","scrollHeight","parentNode","Element","scrollTop","node","documentElement","Math","round","offsetHeight","dispatchEvent","catTextareaCss","nextUniqueId","CatTextarea","[object Object]","hostRef","this","id","hasSlottedLabel","disabled","label","labelHidden","name","readonly","required","rows","hostElement","querySelector","log","error","autosize","textarea","options","focus","h","Host","htmlFor","class","hidden","part","aria-hidden","ref","el","maxlength","maxLength","minlength","minLength","placeholder","value","onInput","onFocus","onBlur","hintSection","hasSlottedHint","hint","CatFormHint","slottedHint","event","catChange","emit","catFocus","catBlur"],"mappings":"wIAAA,IAAIA,EAAEC,EAAEC,EAAE,mBAAmBC,IAAI,IAAIA,KAAKH,EAAE,GAAGC,EAAE,GAAG,CAACG,IAAI,SAASH,GAAG,OAAOD,EAAEK,QAAQJ,IAAI,GAAGK,IAAI,SAASJ,GAAG,OAAOD,EAAED,EAAEK,QAAQH,KAAKK,IAAI,SAASL,EAAEM,IAAI,IAAIR,EAAEK,QAAQH,KAAKF,EAAES,KAAKP,GAAGD,EAAEQ,KAAKD,KAAKE,OAAO,SAASR,GAAG,IAAIM,EAAER,EAAEK,QAAQH,GAAGM,GAAG,IAAIR,EAAEW,OAAOH,EAAE,GAAGP,EAAEU,OAAOH,EAAE,OAAOA,EAAE,SAASR,GAAG,OAAO,IAAIY,MAAMZ,EAAE,CAACa,SAAS,KAAK,IAAI,IAAID,MAAM,QAAQ,MAAMZ,GAAGQ,EAAE,SAASR,GAAG,IAAIC,EAAEa,SAASC,YAAY,SAAS,OAAOd,EAAEe,UAAUhB,GAAG,GAAG,GAAGC,GAAG,SAASgB,EAAEjB,GAAG,IAAIC,EAAEC,EAAEI,IAAIN,GAAGC,GAAGA,EAAEiB,UAAU,SAASC,EAAEnB,GAAG,IAAIC,EAAEC,EAAEI,IAAIN,GAAGC,GAAGA,EAAEmB,SAAS,IAAIC,EAAE,KAAK,oBAAoBC,QAAQ,mBAAmBA,OAAOC,mBAAmBF,EAAE,SAASrB,GAAG,OAAOA,IAAIkB,QAAQ,SAASlB,GAAG,OAAOA,GAAGqB,EAAED,OAAO,SAASpB,GA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BAAmBF,KAAKI,QAC7Bc,EAAA,QAAA,CAAOE,QAASpB,KAAKC,GAAIoB,MAAO,CAAEC,OAAQtB,KAAKK,cAC7Ca,EAAA,OAAA,CAAMK,KAAK,SACPvB,KAAKE,iBAAmBgB,EAAA,OAAA,CAAMZ,KAAK,WAAoBN,KAAKI,OAC5DJ,KAAKQ,UACLU,EAAA,OAAA,CAAMG,MAAM,iBAAgBG,cAAa,QAAM,gBAOvDN,EAAA,WAAA,CACEO,IAAKC,GAAO1B,KAAKe,SAAWW,EAC5BzB,GAAID,KAAKC,GACTE,SAAUH,KAAKG,SACfwB,UAAW3B,KAAK4B,UAChBC,UAAW7B,KAAK8B,UAChBxB,KAAMN,KAAKM,KACXyB,YAAa/B,KAAK+B,YAClBxB,SAAUP,KAAKO,SACfC,SAAUR,KAAKQ,SACfC,KAAMT,KAAKS,KACXuB,MAAOhC,KAAKgC,MACZC,QAASjC,KAAKiC,QAAQjE,KAAKgC,MAC3BkC,QAASlC,KAAKkC,QAAQlE,KAAKgC,MAC3BmC,OAAQnC,KAAKmC,OAAOnE,KAAKgC,QAE1BA,KAAKoC,aAKZA,kBACE,MAAMC,IAAmBrC,KAAKU,YAAYC,cAAc,iBACxD,OACGX,KAAKsC,MAAQD,IACZnB,EAACqB,EAAW,CAACD,KAAMtC,KAAKsC,KAAME,YAAaH,GAAkBnB,EAAA,OAAA,CAAMZ,KAAK,WAKtER,QAAQ2C,GACdzC,KAAKgC,MAAQhC,KAAKe,SAASiB,MAC3BhC,KAAK0C,UAAUC,KAAKF,GAGd3C,QAAQ2C,GACdzC,KAAK4C,SAASD,KAAKF,GAGb3C,OAAO2C,GACbzC,KAAK6C,QAAQF,KAAKF","sourcesContent":["var e,t,n=\"function\"==typeof Map?new Map:(e=[],t=[],{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,o){-1===e.indexOf(n)&&(e.push(n),t.push(o))},delete:function(n){var o=e.indexOf(n);o>-1&&(e.splice(o,1),t.splice(o,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event(\"test\")}catch(e){o=function(e){var t=document.createEvent(\"Event\");return t.initEvent(e,!0,!1),t}}function r(e){var t=n.get(e);t&&t.destroy()}function i(e){var t=n.get(e);t&&t.update()}var l=null;\"undefined\"==typeof window||\"function\"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return function(e){if(e&&e.nodeName&&\"TEXTAREA\"===e.nodeName&&!n.has(e)){var t,r=null,i=null,l=null,d=function(){e.clientWidth!==i&&c()},a=function(t){window.removeEventListener(\"resize\",d,!1),e.removeEventListener(\"input\",c,!1),e.removeEventListener(\"keyup\",c,!1),e.removeEventListener(\"autosize:destroy\",a,!1),e.removeEventListener(\"autosize:update\",c,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),n.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener(\"autosize:destroy\",a,!1),\"onpropertychange\"in e&&\"oninput\"in e&&e.addEventListener(\"keyup\",c,!1),window.addEventListener(\"resize\",d,!1),e.addEventListener(\"input\",c,!1),e.addEventListener(\"autosize:update\",c,!1),e.style.overflowX=\"hidden\",e.style.wordWrap=\"break-word\",n.set(e,{destroy:a,update:c}),\"vertical\"===(t=window.getComputedStyle(e,null)).resize?e.style.resize=\"none\":\"both\"===t.resize&&(e.style.resize=\"horizontal\"),r=\"content-box\"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(r)&&(r=0),c()}function u(t){var n=e.style.width;e.style.width=\"0px\",e.style.width=n,e.style.overflowY=t}function s(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),n=document.documentElement&&document.documentElement.scrollTop;e.style.height=\"\",e.style.height=e.scrollHeight+r+\"px\",i=e.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),n&&(document.documentElement.scrollTop=n)}}function c(){s();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?\"hidden\"===n.overflowY&&(u(\"scroll\"),s(),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):\"hidden\"!==n.overflowY&&(u(\"hidden\"),s(),r=\"content-box\"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==r){l=r;var i=o(\"autosize:resized\");try{e.dispatchEvent(i)}catch(e){}}}}(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e});var d=l;export default d;\n","@use 'variables' as *;\n@use 'mixins' as *;\n@use 'src/components/cat-form-hint/cat-form-hint';\n\n:host {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n @include cat-body('m');\n margin-bottom: $cat-body-margin-bottom;\n}\n\n:host([hidden]) {\n display: none;\n}\n\nlabel {\n align-self: flex-start;\n\n &.hidden {\n @include cat-visually-hidden;\n }\n}\n\n.input-optional {\n margin-left: 0.25rem;\n @include cat-body('xs');\n color: cat-token('color.ui.font.muted');\n}\n\ntextarea {\n margin: 0;\n padding: 0.625rem 0.75rem;\n min-height: cat-size('m');\n font: inherit;\n background: cat-token('color.ui.background.input');\n border-radius: cat-border-radius('m');\n border: none;\n box-shadow: 0 0 0 1px cat-token('color.ui.border.input');\n transition: box-shadow cat-token('time.transition.s') linear;\n\n &:disabled {\n background: cat-token('color.ui.background.inputDisabled');\n cursor: not-allowed;\n color: cat-token('color.ui.font.muted');\n resize: none;\n }\n\n &:hover:not(:disabled) {\n box-shadow: 0 0 0 2px cat-token('color.ui.border.input');\n }\n\n &:focus {\n outline: 2px solid cat-token('color.ui.border.focus');\n }\n\n &::placeholder {\n color: cat-token('color.ui.font.muted');\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport autosize from 'autosize';\nimport log from 'loglevel';\nimport { CatFormHint } from '../cat-form-hint/cat-form-hint';\n\nlet nextUniqueId = 0;\n\n/**\n * Textarea specifies a control that allows user to write text over multiple\n * rows. Used when the expected user input is long. For shorter input, use the\n * input component.\n *\n * @slot hint - Optional hint element to be displayed with the textarea.\n * @slot label - The slotted label. If both the label property and the label slot are present, only the label slot will be displayed.\n * @part label - The label content.\n */\n@Component({\n tag: 'cat-textarea',\n styleUrl: 'cat-textarea.scss',\n shadow: true\n})\nexport class CatTextarea {\n private readonly id = `cat-textarea-${nextUniqueId++}`;\n private textarea!: HTMLTextAreaElement;\n\n @Element() hostElement!: HTMLElement;\n\n @State() hasSlottedLabel = false;\n\n /**\n * Whether the textarea is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Optional hint text(s) to be displayed with the textarea.\n */\n @Prop() hint?: string | string[];\n\n /**\n * The label for the textarea.\n */\n @Prop() label = '';\n\n /**\n * Visually hide the label, but still show it to assistive technologies like screen readers.\n */\n @Prop() labelHidden = false;\n\n /**\n * A maximum length (number of characters) for textual values.\n */\n @Prop() maxLength?: number;\n\n /**\n * A minimum length (number of characters) for textual values.\n */\n @Prop() minLength?: number;\n\n /**\n * The name of the form control. Submitted with the form as part of a name/value pair.\n */\n @Prop() name = '';\n\n /**\n * The placeholder text to display within the input.\n */\n @Prop() placeholder?: string;\n\n /**\n * The value is not editable.\n */\n @Prop() readonly = false;\n\n /**\n * A value is required or must be check for the form to be submittable.\n */\n @Prop() required = false;\n\n /**\n * Specifies the initial number of lines in the textarea.\n */\n @Prop() rows = 3;\n\n /**\n * The initial value of the control.\n */\n @Prop({ mutable: true }) value?: string | number;\n\n /**\n * Emitted when the value is changed.\n */\n @Event() catChange!: EventEmitter;\n\n /**\n * Emitted when the textarea received focus.\n */\n @Event() catFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the textarea loses focus.\n */\n @Event() catBlur!: EventEmitter<FocusEvent>;\n\n componentWillRender(): void {\n this.hasSlottedLabel = !!this.hostElement.querySelector('[slot=\"label\"]');\n if (!this.label && !this.hasSlottedLabel) {\n log.error('[A11y] Missing ARIA label on textarea', this);\n }\n }\n\n componentDidLoad(): void {\n autosize(this.textarea);\n }\n\n /**\n * Sets focus on the textarea. Use this method instead of `textarea.focus()`.\n *\n * @param options An optional object providing options to control aspects of\n * the focusing process.\n */\n @Method()\n async setFocus(options?: FocusOptions): Promise<void> {\n this.textarea.focus(options);\n }\n\n render() {\n return (\n <Host>\n {(this.hasSlottedLabel || this.label) && (\n <label htmlFor={this.id} class={{ hidden: this.labelHidden }}>\n <span part=\"label\">\n {(this.hasSlottedLabel && <slot name=\"label\"></slot>) || this.label}\n {!this.required && (\n <span class=\"input-optional\" aria-hidden=\"true\">\n (Optional)\n </span>\n )}\n </span>\n </label>\n )}\n <textarea\n ref={el => (this.textarea = el as HTMLTextAreaElement)}\n id={this.id}\n disabled={this.disabled}\n maxlength={this.maxLength}\n minlength={this.minLength}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n rows={this.rows}\n value={this.value}\n onInput={this.onInput.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onBlur={this.onBlur.bind(this)}\n ></textarea>\n {this.hintSection}\n </Host>\n );\n }\n\n private get hintSection() {\n const hasSlottedHint = !!this.hostElement.querySelector('[slot=\"hint\"]');\n return (\n (this.hint || hasSlottedHint) && (\n <CatFormHint hint={this.hint} slottedHint={hasSlottedHint && <slot name=\"hint\"></slot>} />\n )\n );\n }\n\n private onInput(event: Event) {\n this.value = this.textarea.value;\n this.catChange.emit(event);\n }\n\n private onFocus(event: FocusEvent) {\n this.catFocus.emit(event);\n }\n\n private onBlur(event: FocusEvent) {\n this.catBlur.emit(event);\n }\n}\n"]}
@@ -6,7 +6,6 @@
6
6
  body {
7
7
  @include cat-body('m');
8
8
  font-family: cat-body-font-family();
9
- font-weight: cat-token('font.weight.body');
10
9
  color: cat-token('color.ui.font.body');
11
10
  background-color: cat-token('color.ui.background.canvas');
12
11
  }
@@ -68,7 +68,7 @@ section {
68
68
  padding: 2rem 0;
69
69
 
70
70
  &:not(:last-of-type) {
71
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
71
+ border-bottom: 1px solid rgba(0, 0, 0, 10%);
72
72
  }
73
73
 
74
74
  > h2:not(:first-child),
@@ -43,8 +43,8 @@
43
43
 
44
44
  @include -layout-property('justify-items-start', 'justify-items', 'flex-start');
45
45
  @include -layout-property('justify-items-end', 'justify-items', 'flex-end');
46
- @include -layout-property('justify-items-center', 'justify-items', 'flex-center');
47
- @include -layout-property('justify-items-stretch', 'justify-items', 'flex-stretch');
46
+ @include -layout-property('justify-items-center', 'justify-items', 'center');
47
+ @include -layout-property('justify-items-stretch', 'justify-items', 'stretch');
48
48
 
49
49
  @include -layout-property('content-start', 'align-content', 'flex-start');
50
50
  @include -layout-property('content-end', 'align-content', 'flex-end');
@@ -55,8 +55,8 @@
55
55
 
56
56
  @include -layout-property('items-start', 'align-items', 'flex-start');
57
57
  @include -layout-property('items-end', 'align-items', 'flex-end');
58
- @include -layout-property('items-center', 'align-items', 'flex-center');
59
- @include -layout-property('items-stretch', 'align-items', 'flex-stretch');
58
+ @include -layout-property('items-center', 'align-items', 'center');
59
+ @include -layout-property('items-stretch', 'align-items', 'stretch');
60
60
 
61
61
  // -- Grid
62
62
 
@@ -14,7 +14,7 @@
14
14
  @return cat-token('size.line.head.#{$size}');
15
15
  }
16
16
 
17
- @mixin cat-head($size, $weight: null) {
17
+ @mixin cat-head($size, $weight: cat-token('font.weight.head')) {
18
18
  font-family: cat-head-font-family();
19
19
  font-size: cat-head-font-size($size);
20
20
  line-height: cat-head-line-height($size);
@@ -36,7 +36,7 @@
36
36
  @return cat-token('size.line.body.#{$size}');
37
37
  }
38
38
 
39
- @mixin cat-body($size, $weight: null) {
39
+ @mixin cat-body($size, $weight: cat-token('font.weight.body')) {
40
40
  // skip font family, as it is set on the body
41
41
  // skip color, as it is set on the body
42
42
  font-size: cat-body-font-size($size);
@@ -58,7 +58,7 @@
58
58
  @return cat-token('size.line.mono.#{$size}');
59
59
  }
60
60
 
61
- @mixin cat-mono($size, $weight: null) {
61
+ @mixin cat-mono($size, $weight: cat-token('font.weight.mono')) {
62
62
  font-family: cat-mono-font-family();
63
63
  font-size: cat-mono-font-size($size);
64
64
  line-height: cat-mono-line-height($size);