@onewelcome/react-lib-components 6.4.2 → 6.4.3

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("./useAddNewBtn.module.cjs.js");var t=require("react");function n(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var a=n(t);const d=({addNew:n,filter:d})=>{var o;const r=t.useRef(null);const s=(o=n===null||n===void 0?void 0:n.label)!==null&&o!==void 0?o:"Create new";const l=()=>n&&a["default"].createElement("button",{"data-testid":"select-action-button",className:e["default"]["action-button"],onClick:()=>n.onAddNew(d),ref:r,...n.btnProps},!d&&s,d&&a["default"].createElement("span",{style:{fontWeight:"700"}},`"${d}"`),d&&` (${s.toLowerCase()})`);const u=n?e["default"]["has-sibling"]:"";return{addNewBtnOptionsContainerClassName:u,renderAddNew:l,addBtnRef:r}};exports.useAddNewBtn=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("./useAddNewBtn.module.cjs.js");var t=require("react");function n(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var a=n(t);const o=({addNew:n,filter:o})=>{var d;const r=t.useRef(null);const s=(d=n===null||n===void 0?void 0:n.label)!==null&&d!==void 0?d:"Create new";const l=()=>n&&a["default"].createElement("button",{"data-testid":"select-action-button",className:e["default"]["action-button"],onClick:()=>n.onAddNew(o),ref:r,type:"button",...n.btnProps},!o&&s,o&&a["default"].createElement("span",{style:{fontWeight:"700"}},`"${o}"`),o&&` (${s.toLowerCase()})`);const u=n?e["default"]["has-sibling"]:"";return{addNewBtnOptionsContainerClassName:u,renderAddNew:l,addBtnRef:r}};exports.useAddNewBtn=o;
2
2
  //# sourceMappingURL=useAddNewBtn.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddNewBtn.cjs.js","sources":["../../../../../../src/components/Form/Select/useAddNewBtn.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classes from \"./useAddNewBtn.module.scss\";\n\nimport React, { useRef } from \"react\";\nimport { AddNewProps } from \"./Select.interfaces\";\n\ninterface Props {\n addNew?: AddNewProps;\n filter: string;\n}\n\nexport const useAddNewBtn = ({ addNew, filter }: Props) => {\n const addBtnRef = useRef<HTMLButtonElement>(null);\n\n const addNewLabel = addNew?.label ?? \"Create new\";\n\n const renderAddNew = () =>\n addNew && (\n <button\n data-testid={\"select-action-button\"}\n className={classes[\"action-button\"]}\n onClick={() => addNew.onAddNew(filter)}\n ref={addBtnRef}\n {...addNew.btnProps}\n >\n {!filter && addNewLabel}\n {filter && <span style={{ fontWeight: \"700\" }}>{`\"${filter}\"`}</span>}\n {filter && ` (${addNewLabel.toLowerCase()})`}\n </button>\n );\n\n const addNewBtnOptionsContainerClassName = addNew ? classes[\"has-sibling\"] : \"\";\n\n return {\n addNewBtnOptionsContainerClassName,\n renderAddNew,\n addBtnRef\n };\n};\n"],"names":["useAddNewBtn","addNew","filter","addBtnRef","useRef","addNewLabel","_a","label","renderAddNew","React","createElement","className","classes","onClick","onAddNew","ref","btnProps","style","fontWeight","toLowerCase","addNewBtnOptionsContainerClassName"],"mappings":"+NA0Ba,MAAAA,EAAe,EAAGC,SAAQC,mBACrC,MAAMC,EAAYC,SAA0B,MAE5C,MAAMC,GAAcC,EAAAL,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQM,SAAS,MAAAD,SAAA,EAAAA,EAAA,aAErC,MAAME,EAAe,IACnBP,GACEQ,aACeC,cAAA,SAAA,CAAA,cAAA,uBACbC,UAAWC,EAAO,WAAC,iBACnBC,QAAS,IAAMZ,EAAOa,SAASZ,GAC/Ba,IAAKZ,KACDF,EAAOe,WAETd,GAAUG,EACXH,GAAUO,EAAAA,WAAAC,cAAA,OAAA,CAAMO,MAAO,CAAEC,WAAY,QAAU,IAAIhB,MACnDA,GAAU,KAAKG,EAAYc,kBAIlC,MAAMC,EAAqCnB,EAASW,EAAO,WAAC,eAAiB,GAE7E,MAAO,CACLQ,qCACAZ,eACAL,YACD"}
1
+ {"version":3,"file":"useAddNewBtn.cjs.js","sources":["../../../../../../src/components/Form/Select/useAddNewBtn.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classes from \"./useAddNewBtn.module.scss\";\n\nimport React, { useRef } from \"react\";\nimport { AddNewProps } from \"./Select.interfaces\";\n\ninterface Props {\n addNew?: AddNewProps;\n filter: string;\n}\n\nexport const useAddNewBtn = ({ addNew, filter }: Props) => {\n const addBtnRef = useRef<HTMLButtonElement>(null);\n\n const addNewLabel = addNew?.label ?? \"Create new\";\n\n const renderAddNew = () =>\n addNew && (\n <button\n data-testid={\"select-action-button\"}\n className={classes[\"action-button\"]}\n onClick={() => addNew.onAddNew(filter)}\n ref={addBtnRef}\n type=\"button\"\n {...addNew.btnProps}\n >\n {!filter && addNewLabel}\n {filter && <span style={{ fontWeight: \"700\" }}>{`\"${filter}\"`}</span>}\n {filter && ` (${addNewLabel.toLowerCase()})`}\n </button>\n );\n\n const addNewBtnOptionsContainerClassName = addNew ? classes[\"has-sibling\"] : \"\";\n\n return {\n addNewBtnOptionsContainerClassName,\n renderAddNew,\n addBtnRef\n };\n};\n"],"names":["useAddNewBtn","addNew","filter","addBtnRef","useRef","addNewLabel","_a","label","renderAddNew","React","createElement","className","classes","onClick","onAddNew","ref","type","btnProps","style","fontWeight","toLowerCase","addNewBtnOptionsContainerClassName"],"mappings":"+NA0Ba,MAAAA,EAAe,EAAGC,SAAQC,mBACrC,MAAMC,EAAYC,SAA0B,MAE5C,MAAMC,GAAcC,EAAAL,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQM,SAAS,MAAAD,SAAA,EAAAA,EAAA,aAErC,MAAME,EAAe,IACnBP,GACEQ,EAAAA,WAAAC,cAAA,SAAA,CAAA,cACe,uBACbC,UAAWC,EAAO,WAAC,iBACnBC,QAAS,IAAMZ,EAAOa,SAASZ,GAC/Ba,IAAKZ,EACLa,KAAK,YACDf,EAAOgB,WAETf,GAAUG,EACXH,GAAUO,EAAAA,WAAAC,cAAA,OAAA,CAAMQ,MAAO,CAAEC,WAAY,QAAU,IAAIjB,MACnDA,GAAU,KAAKG,EAAYe,kBAIlC,MAAMC,EAAqCpB,EAASW,EAAO,WAAC,eAAiB,GAE7E,MAAO,CACLS,qCACAb,eACAL,YACD"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../Icon/Icon.cjs.js");var r=require("../src/readyclasses.module.cjs.js");var a=require("./RemoveButton.module.cjs.js");function o(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var s=o(e);const l=({removeLabel:e="Remove",label:o,onRemove:l,...c},n)=>{var u;return l&&s["default"].createElement("button",{...c,ref:n,className:`${a["default"]["remove"]} ${(u=c.className)!==null&&u!==void 0?u:""}`,title:"",onClick:l},s["default"].createElement(t.Icon,{icon:t.Icons.Times,className:a["default"]["icon"]}),s["default"].createElement("span",{className:r["default"]["sr-only"]},e,o?" "+o:""))};const c=e.forwardRef(l);exports.RemoveButton=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});var e=require("react");var t=require("../Icon/Icon.cjs.js");var r=require("../src/readyclasses.module.cjs.js");var a=require("./RemoveButton.module.cjs.js");function o(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var s=o(e);const l=({removeLabel:e="Remove",label:o,onRemove:l,...c},n)=>{var u;return l&&s["default"].createElement("button",{title:"",type:"button",...c,ref:n,className:`${a["default"]["remove"]} ${(u=c.className)!==null&&u!==void 0?u:""}`,onClick:l},s["default"].createElement(t.Icon,{icon:t.Icons.Times,className:a["default"]["icon"]}),s["default"].createElement("span",{className:r["default"]["sr-only"]},e,o?" "+o:""))};const c=e.forwardRef(l);exports.RemoveButton=c;
2
2
  //# sourceMappingURL=RemoveButton.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveButton.cjs.js","sources":["../../../../../src/components/Tag/RemoveButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, HTMLAttributes, forwardRef } from \"react\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nimport readyclasses from \"../../readyclasses.module.scss\";\nimport classes from \"./RemoveButton.module.scss\";\n\nexport interface Props extends HTMLAttributes<HTMLButtonElement> {\n removeLabel?: string;\n label?: string;\n onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst RemoveButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n { removeLabel = \"Remove\", label, onRemove, ...rest }: Props,\n ref\n) => {\n return (\n onRemove && (\n <button\n {...rest}\n ref={ref}\n className={`${classes[\"remove\"]} ${rest.className ?? \"\"}`}\n title=\"\"\n onClick={onRemove}\n >\n <Icon icon={Icons.Times} className={classes[\"icon\"]} />\n <span className={readyclasses[\"sr-only\"]}>\n {removeLabel}\n {label ? \" \" + label : \"\"}\n </span>\n </button>\n )\n );\n};\n\nexport const RemoveButton = forwardRef(RemoveButtonComponent);\n"],"names":["RemoveButtonComponent","removeLabel","label","onRemove","rest","ref","React","className","classes","_a","title","onClick","createElement","Icon","icon","Icons","Times","readyclasses","RemoveButton","forwardRef"],"mappings":"uTA4BA,MAAMA,EAA4E,EAC9EC,cAAc,SAAUC,QAAOC,cAAaC,GAC9CC,WAEA,OACEF,GACEG,wCACMF,EACJC,IAAKA,EACLE,UAAW,GAAGC,EAAO,WAAC,cAAaC,EAAAL,EAAKG,aAAa,MAAAE,SAAA,EAAAA,EAAA,KACrDC,MAAM,GACNC,QAASR,GAETG,EAAAA,WAAAM,cAACC,OAAI,CAACC,KAAMC,EAAAA,MAAMC,MAAOT,UAAWC,EAAAA,WAAQ,UAC5CF,EAAA,WAAAM,cAAA,OAAA,CAAML,UAAWU,EAAAA,WAAa,YAC3BhB,EACAC,EAAQ,IAAMA,EAAQ,IAI7B,QAGSgB,EAAeC,EAAUA,WAACnB"}
1
+ {"version":3,"file":"RemoveButton.cjs.js","sources":["../../../../../src/components/Tag/RemoveButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, HTMLAttributes, forwardRef } from \"react\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nimport readyclasses from \"../../readyclasses.module.scss\";\nimport classes from \"./RemoveButton.module.scss\";\n\nexport interface Props extends HTMLAttributes<HTMLButtonElement> {\n removeLabel?: string;\n label?: string;\n onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst RemoveButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n { removeLabel = \"Remove\", label, onRemove, ...rest }: Props,\n ref\n) => {\n return (\n onRemove && (\n <button\n title=\"\"\n type=\"button\"\n {...rest}\n ref={ref}\n className={`${classes[\"remove\"]} ${rest.className ?? \"\"}`}\n onClick={onRemove}\n >\n <Icon icon={Icons.Times} className={classes[\"icon\"]} />\n <span className={readyclasses[\"sr-only\"]}>\n {removeLabel}\n {label ? \" \" + label : \"\"}\n </span>\n </button>\n )\n );\n};\n\nexport const RemoveButton = forwardRef(RemoveButtonComponent);\n"],"names":["RemoveButtonComponent","removeLabel","label","onRemove","rest","ref","React","createElement","title","type","className","classes","_a","onClick","Icon","icon","Icons","Times","readyclasses","RemoveButton","forwardRef"],"mappings":"uTA4BA,MAAMA,EAA4E,EAC9EC,cAAc,SAAUC,QAAOC,cAAaC,GAC9CC,WAEA,OACEF,GACEG,EAAA,WAAAC,cAAA,SAAA,CACEC,MAAM,GACNC,KAAK,YACDL,EACJC,IAAKA,EACLK,UAAW,GAAGC,EAAO,WAAC,cAAaC,EAAAR,EAAKM,aAAa,MAAAE,SAAA,EAAAA,EAAA,KACrDC,QAASV,GAETG,EAAAA,WAAAC,cAACO,OAAI,CAACC,KAAMC,EAAAA,MAAMC,MAAOP,UAAWC,EAAAA,WAAQ,UAC5CL,EAAA,WAAAC,cAAA,OAAA,CAAMG,UAAWQ,EAAAA,WAAa,YAC3BjB,EACAC,EAAQ,IAAMA,EAAQ,IAI7B,QAGSiB,EAAeC,EAAUA,WAACpB"}
@@ -1,2 +1,2 @@
1
- import e from"./useAddNewBtn.module.esm.js";import t,{useRef as n}from"react";const o=({addNew:o,filter:a})=>{var s;const d=n(null);const r=(s=o===null||o===void 0?void 0:o.label)!==null&&s!==void 0?s:"Create new";const l=()=>o&&t.createElement("button",{"data-testid":"select-action-button",className:e["action-button"],onClick:()=>o.onAddNew(a),ref:d,...o.btnProps},!a&&r,a&&t.createElement("span",{style:{fontWeight:"700"}},`"${a}"`),a&&` (${r.toLowerCase()})`);const i=o?e["has-sibling"]:"";return{addNewBtnOptionsContainerClassName:i,renderAddNew:l,addBtnRef:d}};export{o as useAddNewBtn};
1
+ import t from"./useAddNewBtn.module.esm.js";import e,{useRef as n}from"react";const o=({addNew:o,filter:a})=>{var s;const d=n(null);const r=(s=o===null||o===void 0?void 0:o.label)!==null&&s!==void 0?s:"Create new";const l=()=>o&&e.createElement("button",{"data-testid":"select-action-button",className:t["action-button"],onClick:()=>o.onAddNew(a),ref:d,type:"button",...o.btnProps},!a&&r,a&&e.createElement("span",{style:{fontWeight:"700"}},`"${a}"`),a&&` (${r.toLowerCase()})`);const i=o?t["has-sibling"]:"";return{addNewBtnOptionsContainerClassName:i,renderAddNew:l,addBtnRef:d}};export{o as useAddNewBtn};
2
2
  //# sourceMappingURL=useAddNewBtn.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddNewBtn.esm.js","sources":["../../../../../../src/components/Form/Select/useAddNewBtn.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classes from \"./useAddNewBtn.module.scss\";\n\nimport React, { useRef } from \"react\";\nimport { AddNewProps } from \"./Select.interfaces\";\n\ninterface Props {\n addNew?: AddNewProps;\n filter: string;\n}\n\nexport const useAddNewBtn = ({ addNew, filter }: Props) => {\n const addBtnRef = useRef<HTMLButtonElement>(null);\n\n const addNewLabel = addNew?.label ?? \"Create new\";\n\n const renderAddNew = () =>\n addNew && (\n <button\n data-testid={\"select-action-button\"}\n className={classes[\"action-button\"]}\n onClick={() => addNew.onAddNew(filter)}\n ref={addBtnRef}\n {...addNew.btnProps}\n >\n {!filter && addNewLabel}\n {filter && <span style={{ fontWeight: \"700\" }}>{`\"${filter}\"`}</span>}\n {filter && ` (${addNewLabel.toLowerCase()})`}\n </button>\n );\n\n const addNewBtnOptionsContainerClassName = addNew ? classes[\"has-sibling\"] : \"\";\n\n return {\n addNewBtnOptionsContainerClassName,\n renderAddNew,\n addBtnRef\n };\n};\n"],"names":["useAddNewBtn","addNew","filter","addBtnRef","useRef","addNewLabel","_a","label","renderAddNew","React","createElement","className","classes","onClick","onAddNew","ref","btnProps","style","fontWeight","toLowerCase","addNewBtnOptionsContainerClassName"],"mappings":"8EA0Ba,MAAAA,EAAe,EAAGC,SAAQC,mBACrC,MAAMC,EAAYC,EAA0B,MAE5C,MAAMC,GAAcC,EAAAL,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQM,SAAS,MAAAD,SAAA,EAAAA,EAAA,aAErC,MAAME,EAAe,IACnBP,GACEQ,EACeC,cAAA,SAAA,CAAA,cAAA,uBACbC,UAAWC,EAAQ,iBACnBC,QAAS,IAAMZ,EAAOa,SAASZ,GAC/Ba,IAAKZ,KACDF,EAAOe,WAETd,GAAUG,EACXH,GAAUO,EAAAC,cAAA,OAAA,CAAMO,MAAO,CAAEC,WAAY,QAAU,IAAIhB,MACnDA,GAAU,KAAKG,EAAYc,kBAIlC,MAAMC,EAAqCnB,EAASW,EAAQ,eAAiB,GAE7E,MAAO,CACLQ,qCACAZ,eACAL,YACD"}
1
+ {"version":3,"file":"useAddNewBtn.esm.js","sources":["../../../../../../src/components/Form/Select/useAddNewBtn.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classes from \"./useAddNewBtn.module.scss\";\n\nimport React, { useRef } from \"react\";\nimport { AddNewProps } from \"./Select.interfaces\";\n\ninterface Props {\n addNew?: AddNewProps;\n filter: string;\n}\n\nexport const useAddNewBtn = ({ addNew, filter }: Props) => {\n const addBtnRef = useRef<HTMLButtonElement>(null);\n\n const addNewLabel = addNew?.label ?? \"Create new\";\n\n const renderAddNew = () =>\n addNew && (\n <button\n data-testid={\"select-action-button\"}\n className={classes[\"action-button\"]}\n onClick={() => addNew.onAddNew(filter)}\n ref={addBtnRef}\n type=\"button\"\n {...addNew.btnProps}\n >\n {!filter && addNewLabel}\n {filter && <span style={{ fontWeight: \"700\" }}>{`\"${filter}\"`}</span>}\n {filter && ` (${addNewLabel.toLowerCase()})`}\n </button>\n );\n\n const addNewBtnOptionsContainerClassName = addNew ? classes[\"has-sibling\"] : \"\";\n\n return {\n addNewBtnOptionsContainerClassName,\n renderAddNew,\n addBtnRef\n };\n};\n"],"names":["useAddNewBtn","addNew","filter","addBtnRef","useRef","addNewLabel","_a","label","renderAddNew","React","createElement","className","classes","onClick","onAddNew","ref","type","btnProps","style","fontWeight","toLowerCase","addNewBtnOptionsContainerClassName"],"mappings":"8EA0Ba,MAAAA,EAAe,EAAGC,SAAQC,mBACrC,MAAMC,EAAYC,EAA0B,MAE5C,MAAMC,GAAcC,EAAAL,IAAA,MAAAA,SAAA,OAAA,EAAAA,EAAQM,SAAS,MAAAD,SAAA,EAAAA,EAAA,aAErC,MAAME,EAAe,IACnBP,GACEQ,EAAAC,cAAA,SAAA,CAAA,cACe,uBACbC,UAAWC,EAAQ,iBACnBC,QAAS,IAAMZ,EAAOa,SAASZ,GAC/Ba,IAAKZ,EACLa,KAAK,YACDf,EAAOgB,WAETf,GAAUG,EACXH,GAAUO,EAAAC,cAAA,OAAA,CAAMQ,MAAO,CAAEC,WAAY,QAAU,IAAIjB,MACnDA,GAAU,KAAKG,EAAYe,kBAIlC,MAAMC,EAAqCpB,EAASW,EAAQ,eAAiB,GAE7E,MAAO,CACLS,qCACAb,eACAL,YACD"}
@@ -1,2 +1,2 @@
1
- import e,{forwardRef as o}from"react";import{Icon as m,Icons as s}from"../Icon/Icon.esm.js";import r from"../src/readyclasses.module.esm.js";import t from"./RemoveButton.module.esm.js";const a=({removeLabel:o="Remove",label:a,onRemove:l,...c},n)=>{var i;return l&&e.createElement("button",{...c,ref:n,className:`${t["remove"]} ${(i=c.className)!==null&&i!==void 0?i:""}`,title:"",onClick:l},e.createElement(m,{icon:s.Times,className:t["icon"]}),e.createElement("span",{className:r["sr-only"]},o,a?" "+a:""))};const l=o(a);export{l as RemoveButton};
1
+ import e,{forwardRef as o}from"react";import{Icon as m,Icons as t}from"../Icon/Icon.esm.js";import s from"../src/readyclasses.module.esm.js";import r from"./RemoveButton.module.esm.js";const a=({removeLabel:o="Remove",label:a,onRemove:l,...n},c)=>{var i;return l&&e.createElement("button",{title:"",type:"button",...n,ref:c,className:`${r["remove"]} ${(i=n.className)!==null&&i!==void 0?i:""}`,onClick:l},e.createElement(m,{icon:t.Times,className:r["icon"]}),e.createElement("span",{className:s["sr-only"]},o,a?" "+a:""))};const l=o(a);export{l as RemoveButton};
2
2
  //# sourceMappingURL=RemoveButton.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveButton.esm.js","sources":["../../../../../src/components/Tag/RemoveButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, HTMLAttributes, forwardRef } from \"react\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nimport readyclasses from \"../../readyclasses.module.scss\";\nimport classes from \"./RemoveButton.module.scss\";\n\nexport interface Props extends HTMLAttributes<HTMLButtonElement> {\n removeLabel?: string;\n label?: string;\n onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst RemoveButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n { removeLabel = \"Remove\", label, onRemove, ...rest }: Props,\n ref\n) => {\n return (\n onRemove && (\n <button\n {...rest}\n ref={ref}\n className={`${classes[\"remove\"]} ${rest.className ?? \"\"}`}\n title=\"\"\n onClick={onRemove}\n >\n <Icon icon={Icons.Times} className={classes[\"icon\"]} />\n <span className={readyclasses[\"sr-only\"]}>\n {removeLabel}\n {label ? \" \" + label : \"\"}\n </span>\n </button>\n )\n );\n};\n\nexport const RemoveButton = forwardRef(RemoveButtonComponent);\n"],"names":["RemoveButtonComponent","removeLabel","label","onRemove","rest","ref","React","className","classes","_a","title","onClick","createElement","Icon","icon","Icons","Times","readyclasses","RemoveButton","forwardRef"],"mappings":"yLA4BA,MAAMA,EAA4E,EAC9EC,cAAc,SAAUC,QAAOC,cAAaC,GAC9CC,WAEA,OACEF,GACEG,6BACMF,EACJC,IAAKA,EACLE,UAAW,GAAGC,EAAQ,cAAaC,EAAAL,EAAKG,aAAa,MAAAE,SAAA,EAAAA,EAAA,KACrDC,MAAM,GACNC,QAASR,GAETG,EAAAM,cAACC,EAAI,CAACC,KAAMC,EAAMC,MAAOT,UAAWC,EAAQ,UAC5CF,EAAAM,cAAA,OAAA,CAAML,UAAWU,EAAa,YAC3BhB,EACAC,EAAQ,IAAMA,EAAQ,IAI7B,QAGSgB,EAAeC,EAAWnB"}
1
+ {"version":3,"file":"RemoveButton.esm.js","sources":["../../../../../src/components/Tag/RemoveButton.tsx"],"sourcesContent":["/*\n * Copyright 2022 OneWelcome B.V.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ForwardRefRenderFunction, HTMLAttributes, forwardRef } from \"react\";\nimport { Icon, Icons } from \"../Icon/Icon\";\n\nimport readyclasses from \"../../readyclasses.module.scss\";\nimport classes from \"./RemoveButton.module.scss\";\n\nexport interface Props extends HTMLAttributes<HTMLButtonElement> {\n removeLabel?: string;\n label?: string;\n onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n}\n\nconst RemoveButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (\n { removeLabel = \"Remove\", label, onRemove, ...rest }: Props,\n ref\n) => {\n return (\n onRemove && (\n <button\n title=\"\"\n type=\"button\"\n {...rest}\n ref={ref}\n className={`${classes[\"remove\"]} ${rest.className ?? \"\"}`}\n onClick={onRemove}\n >\n <Icon icon={Icons.Times} className={classes[\"icon\"]} />\n <span className={readyclasses[\"sr-only\"]}>\n {removeLabel}\n {label ? \" \" + label : \"\"}\n </span>\n </button>\n )\n );\n};\n\nexport const RemoveButton = forwardRef(RemoveButtonComponent);\n"],"names":["RemoveButtonComponent","removeLabel","label","onRemove","rest","ref","React","createElement","title","type","className","classes","_a","onClick","Icon","icon","Icons","Times","readyclasses","RemoveButton","forwardRef"],"mappings":"yLA4BA,MAAMA,EAA4E,EAC9EC,cAAc,SAAUC,QAAOC,cAAaC,GAC9CC,WAEA,OACEF,GACEG,EAAAC,cAAA,SAAA,CACEC,MAAM,GACNC,KAAK,YACDL,EACJC,IAAKA,EACLK,UAAW,GAAGC,EAAQ,cAAaC,EAAAR,EAAKM,aAAa,MAAAE,SAAA,EAAAA,EAAA,KACrDC,QAASV,GAETG,EAAAC,cAACO,EAAI,CAACC,KAAMC,EAAMC,MAAOP,UAAWC,EAAQ,UAC5CL,EAAAC,cAAA,OAAA,CAAMG,UAAWQ,EAAa,YAC3BjB,EACAC,EAAQ,IAAMA,EAAQ,IAI7B,QAGSiB,EAAeC,EAAWpB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "homepage": "http://onewelcome.github.io/react-lib-components",
3
3
  "name": "@onewelcome/react-lib-components",
4
- "version": "6.4.2",
4
+ "version": "6.4.3",
5
5
  "license": "Apache-2.0",
6
6
  "author": "OneWelcome B.V.",
7
7
  "main": "dist/cjs/src/index.cjs.js",
@@ -36,6 +36,7 @@ export const useAddNewBtn = ({ addNew, filter }: Props) => {
36
36
  className={classes["action-button"]}
37
37
  onClick={() => addNew.onAddNew(filter)}
38
38
  ref={addBtnRef}
39
+ type="button"
39
40
  {...addNew.btnProps}
40
41
  >
41
42
  {!filter && addNewLabel}
@@ -33,10 +33,11 @@ const RemoveButtonComponent: ForwardRefRenderFunction<HTMLButtonElement, Props>
33
33
  return (
34
34
  onRemove && (
35
35
  <button
36
+ title=""
37
+ type="button"
36
38
  {...rest}
37
39
  ref={ref}
38
40
  className={`${classes["remove"]} ${rest.className ?? ""}`}
39
- title=""
40
41
  onClick={onRemove}
41
42
  >
42
43
  <Icon icon={Icons.Times} className={classes["icon"]} />