@muraldevkit/ui-toolkit 1.0.0 → 1.1.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.
@@ -1,21 +1,23 @@
1
1
  import React from 'react';
2
- import { AttrsObject } from '../../../utils';
2
+ import { MrlComponentProps } from '../../../utils';
3
3
  import { SVGSize } from '../constants';
4
- export interface SvgPropTypes {
5
- /** The theme associated to an SVG Component */
6
- theme?: string;
4
+ export interface SvgPropTypes extends Omit<MrlComponentProps, "style">, React.ComponentProps<"svg"> {
5
+ /**
6
+ * @todo: Add optional path prop to point to a static SVG url
7
+ * @todo: Make SVG prop optional and must pass one of path or SVG
8
+ */
9
+ isClone?: boolean;
7
10
  /** The size of an SVG Component */
8
11
  size?: SVGSize;
9
- /** The SVG object to parse into an HTML SVG element */
10
- svg: Record<string, unknown> | string;
11
12
  /**
12
- * Applies additional HTML attributes to the `svg` element.
13
- * When using in a framework wrapper (e.g., React), treat it as an object and don't stringify.
14
- * Otherwise, the value object needs to be stringified to not receive `"[Object object]"`.
15
- * Example: `attrs='{ "data-foo": "bar" }'`
13
+ * A object of CSS properties. Please use style sparingly, and only in cases where your
14
+ * needs can not be met by passing a class to the component.
16
15
  */
17
- attrs?: AttrsObject | string;
18
- isClone?: boolean;
16
+ style?: Record<string, unknown>;
17
+ /** The SVG object to parse into an HTML SVG element */
18
+ svg: Record<string, unknown> | string;
19
+ /** The theme associated to an SVG Component */
20
+ theme?: string;
19
21
  }
20
22
  /**
21
23
  * Creating and exporting component class for Mural SVG
@@ -1,2 +1,2 @@
1
- export { MrlSvg } from "./MrlSvg/MrlSvg";
1
+ export * from "./MrlSvg/MrlSvg";
2
2
  export * from './constants';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("classnames"));else if("function"==typeof define&&define.amd)define(["React","classnames"],r);else{var t="object"==typeof exports?r(require("react"),require("classnames")):r(e.React,e.classnames);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,r)=>(()=>{"use strict";var t={899:(e,r,t)=>{t.d(r,{Z:()=>i});var n=t(81),a=t.n(n),o=t(645),s=t.n(o)()(a());s.push([e.id,".MrlSvg--StPVX{--mrl-svg-size: var(--mrl-spacing-07)}.MrlSvg--small--zP1On{--mrl-svg-size: var(--mrl-spacing-06)}.MrlSvg--large--HeoAa{--mrl-svg-size: var(--mrl-spacing-10)}.MrlSvg--auto--w9gVr{--mrl-svg-size: 100%}.MrlSvg--StPVX{display:inline-block;fill:currentcolor;height:var(--mrl-svg-size);width:var(--mrl-svg-size)}.MrlSvg--StPVX *{pointer-events:none}.MrlSvg--auto--w9gVr{width:100%}",""]),s.locals={MrlSvg:"MrlSvg--StPVX","MrlSvg--small":"MrlSvg--small--zP1On","MrlSvg--large":"MrlSvg--large--HeoAa","MrlSvg--auto":"MrlSvg--auto--w9gVr"};const i=s},645:e=>{e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t="",n=void 0!==r[5];return r[4]&&(t+="@supports (".concat(r[4],") {")),r[2]&&(t+="@media ".concat(r[2]," {")),n&&(t+="@layer".concat(r[5].length>0?" ".concat(r[5]):""," {")),t+=e(r),n&&(t+="}"),r[2]&&(t+="}"),r[4]&&(t+="}"),t})).join("")},r.i=function(e,t,n,a,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);n&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),t&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=t):u[2]=t),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),r.push(u))}},r}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var r=[];function t(e){for(var t=-1,n=0;n<r.length;n++)if(r[n].identifier===e){t=n;break}return t}function n(e,n){for(var o={},s=[],i=0;i<e.length;i++){var c=e[i],l=n.base?c[0]+n.base:c[0],u=o[l]||0,f="".concat(l," ").concat(u);o[l]=u+1;var p=t(f),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)r[p].references++,r[p].updater(d);else{var v=a(d,n);n.byIndex=i,r.splice(i,0,{identifier:f,updater:v,references:1})}s.push(f)}return s}function a(e,r){var t=r.domAPI(r);return t.update(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap&&r.supports===e.supports&&r.layer===e.layer)return;t.update(e=r)}else t.remove()}}e.exports=function(e,a){var o=n(e=e||[],a=a||{});return function(e){e=e||[];for(var s=0;s<o.length;s++){var i=t(o[s]);r[i].references--}for(var c=n(e,a),l=0;l<o.length;l++){var u=t(o[l]);0===r[u].references&&(r[u].updater(),r.splice(u,1))}o=c}}},569:e=>{var r={};e.exports=function(e,t){var n=function(e){if(void 0===r[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}r[e]=t}return r[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(t)}},216:e=>{e.exports=function(e){var r=document.createElement("style");return e.setAttributes(r,e.attributes),e.insert(r,e.options),r}},565:(e,r,t)=>{e.exports=function(e){var r=t.nc;r&&e.setAttribute("nonce",r)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var r=e.insertStyleElement(e);return{update:function(t){!function(e,r,t){var n="";t.supports&&(n+="@supports (".concat(t.supports,") {")),t.media&&(n+="@media ".concat(t.media," {"));var a=void 0!==t.layer;a&&(n+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),n+=t.css,a&&(n+="}"),t.media&&(n+="}"),t.supports&&(n+="}");var o=t.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),r.styleTagTransform(n,e,r.options)}(r,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)}}}},589:e=>{e.exports=function(e,r){if(r.styleSheet)r.styleSheet.cssText=e;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(e))}}},200:e=>{e.exports=r},639:r=>{r.exports=e}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,a),o.exports}a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var o={};return(()=>{a.r(o),a.d(o,{MrlSvg:()=>N,allowedValues:()=>v,defaults:()=>m,getCamelCase:()=>s,getUniqueId:()=>d,isObject:()=>i,setAttributes:()=>f,setClasses:()=>u});var e=a(639),r=a.n(e),t=a(200),n=a.n(t),s=function(e){return e.trim().replace(/[-_]+/g," ").replace(/[`"',.;:?!@#$%^&*()~[\]{}|/\\<>]+/g,"").replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(function(e,r){return 0==+e?"":0===r?e.toLowerCase():e.toUpperCase()}))},i=function(e){return(!e||!Array.isArray(e))&&e instanceof Object},c=function(){return c=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},c.apply(this,arguments)},l=function(e){try{return JSON.parse(e)}catch(r){return console.error("The attrs property is not properly-formatted JSON:"),console.error(e),console.error(r),r}},u=function(e,r){var t,n="string"==typeof e?l(e):e;return i(n)&&n.class?c(((t={})["".concat(n.class)]=void 0!==n.class&&n.class.length>0,t),r):r},f=function(e,r,t){void 0===r&&(r={});var a="string"==typeof e?l(e):e;return a?Object.assign({},r,a,{class:n()(t,a.class)}):{}},p=0,d=function(e){return void 0===e&&(e="mrl"),p++,"".concat(e,"-").concat(p)},v={sizes:["medium","small","large","auto"],themes:["classic","default"]},m={attrs:{role:"presentation"},size:"medium",theme:"default"},g=a(379),y=a.n(g),h=a(795),b=a.n(h),S=a(569),M=a.n(S),O=a(565),x=a.n(O),w=a(216),j=a.n(w),A=a(589),P=a.n(A),C=a(899),T={};T.styleTagTransform=P(),T.setAttributes=x(),T.insert=M().bind(null,"head"),T.domAPI=b(),T.insertStyleElement=j(),y()(C.Z,T);const E=C.Z&&C.Z.locals?C.Z.locals:void 0;var z=function(){return z=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},z.apply(this,arguments)},N=function(e){var t,a=e.theme,o=e.size,c=void 0===o?"medium":o,l=e.svg,p=e.attrs,v=void 0===p?{}:p,g=e.isClone,y="There has been an issue rendering your SVG!",h=function(e,t,a){if(void 0===t&&(t={}),"text"===e.type)return e.value;var o=e.name,i=e.attributes||{};return Object.keys(i).forEach((function(e){var r="data-"===e.slice(0,5)?e:s(e);i[r]=i[e],e!==r&&delete i[e]})),"svg"===o?r().createElement("svg",z({},i,t,{className:n()(a),key:d()}),Array.isArray(e.children)&&e.children.map((function(e){return h(e)}))):r().createElement(o,z({},i,{key:d()}),Array.isArray(e.children)&&e.children.map((function(e){return h(e)})))},b=function(e,t,o,s){void 0===t&&(t={});var i=""===o?"This icon":o,c=Object.keys(e).length>0?"".concat(i," has no '").concat(a,"' theme found! Please try another SVG or theme."):"No valid themes found.";return console.warn(y),console.warn(c),r().createElement("span",z({className:n()(s)},t))};if(void 0!==g&&g)return r().createElement("span",null);if(!l)return r().createElement("span",null);var S=f(v,m.attrs),M=u(v,((t={})[E.MrlSvg]=!0,t[E["MrlSvg--".concat(c)]]="medium"!==c,t));delete S.class;var O="string"==typeof l;if(O&&!function(e){try{JSON.parse(e)}catch(r){return console.warn("".concat(y," Invalid SVG code:")),console.warn(e),!1}return!0}(l))return r().createElement("span",null);var x=O?JSON.parse(l):l,w=Object.keys(x),j=function(e){var r=e.indexOf("default")>=0,t=e.indexOf("rebrand")>=0;return"rebrand"!==a||t?a&&""!==a?a:r?"default":null:"default"}(w);return j&&""!==j?x[j]?h(x[j],S,M):i(x[w[0]])?b(x,S,x[w[0]].attributes["data-mrl-svg-name"],M):b(x):h(x,S,M)}})(),o})()));
1
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("react"),require("classnames"));else if("function"==typeof define&&define.amd)define(["React","classnames"],r);else{var t="object"==typeof exports?r(require("react"),require("classnames")):r(e.React,e.classnames);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,r)=>(()=>{"use strict";var t={899:(e,r,t)=>{t.d(r,{Z:()=>i});var n=t(81),a=t.n(n),o=t(645),s=t.n(o)()(a());s.push([e.id,".MrlSvg--StPVX{--mrl-svg-size: var(--mrl-spacing-07)}.MrlSvg--small--zP1On{--mrl-svg-size: var(--mrl-spacing-06)}.MrlSvg--large--HeoAa{--mrl-svg-size: var(--mrl-spacing-10)}.MrlSvg--auto--w9gVr{--mrl-svg-size: 100%}.MrlSvg--StPVX{display:inline-block;fill:currentcolor;height:var(--mrl-svg-size);width:var(--mrl-svg-size)}.MrlSvg--StPVX *{pointer-events:none}.MrlSvg--auto--w9gVr{width:100%}",""]),s.locals={MrlSvg:"MrlSvg--StPVX","MrlSvg--small":"MrlSvg--small--zP1On","MrlSvg--large":"MrlSvg--large--HeoAa","MrlSvg--auto":"MrlSvg--auto--w9gVr"};const i=s},645:e=>{e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t="",n=void 0!==r[5];return r[4]&&(t+="@supports (".concat(r[4],") {")),r[2]&&(t+="@media ".concat(r[2]," {")),n&&(t+="@layer".concat(r[5].length>0?" ".concat(r[5]):""," {")),t+=e(r),n&&(t+="}"),r[2]&&(t+="}"),r[4]&&(t+="}"),t})).join("")},r.i=function(e,t,n,a,o){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(s[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);n&&s[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),t&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=t):u[2]=t),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),r.push(u))}},r}},81:e=>{e.exports=function(e){return e[1]}},379:e=>{var r=[];function t(e){for(var t=-1,n=0;n<r.length;n++)if(r[n].identifier===e){t=n;break}return t}function n(e,n){for(var o={},s=[],i=0;i<e.length;i++){var c=e[i],l=n.base?c[0]+n.base:c[0],u=o[l]||0,f="".concat(l," ").concat(u);o[l]=u+1;var p=t(f),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)r[p].references++,r[p].updater(d);else{var v=a(d,n);n.byIndex=i,r.splice(i,0,{identifier:f,updater:v,references:1})}s.push(f)}return s}function a(e,r){var t=r.domAPI(r);return t.update(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap&&r.supports===e.supports&&r.layer===e.layer)return;t.update(e=r)}else t.remove()}}e.exports=function(e,a){var o=n(e=e||[],a=a||{});return function(e){e=e||[];for(var s=0;s<o.length;s++){var i=t(o[s]);r[i].references--}for(var c=n(e,a),l=0;l<o.length;l++){var u=t(o[l]);0===r[u].references&&(r[u].updater(),r.splice(u,1))}o=c}}},569:e=>{var r={};e.exports=function(e,t){var n=function(e){if(void 0===r[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}r[e]=t}return r[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(t)}},216:e=>{e.exports=function(e){var r=document.createElement("style");return e.setAttributes(r,e.attributes),e.insert(r,e.options),r}},565:(e,r,t)=>{e.exports=function(e){var r=t.nc;r&&e.setAttribute("nonce",r)}},795:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var r=e.insertStyleElement(e);return{update:function(t){!function(e,r,t){var n="";t.supports&&(n+="@supports (".concat(t.supports,") {")),t.media&&(n+="@media ".concat(t.media," {"));var a=void 0!==t.layer;a&&(n+="@layer".concat(t.layer.length>0?" ".concat(t.layer):""," {")),n+=t.css,a&&(n+="}"),t.media&&(n+="}"),t.supports&&(n+="}");var o=t.sourceMap;o&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),r.styleTagTransform(n,e,r.options)}(r,e,t)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)}}}},589:e=>{e.exports=function(e,r){if(r.styleSheet)r.styleSheet.cssText=e;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(e))}}},200:e=>{e.exports=r},639:r=>{r.exports=e}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,a),o.exports}a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var o={};return(()=>{a.r(o),a.d(o,{MrlSvg:()=>N,allowedValues:()=>v,defaults:()=>m,getCamelCase:()=>s,getUniqueId:()=>d,isObject:()=>i,setAttributes:()=>f,setClasses:()=>u});var e=a(639),r=a.n(e),t=a(200),n=a.n(t),s=function(e){return e.trim().replace(/[-_]+/g," ").replace(/[`"',.;:?!@#$%^&*()~[\]{}|/\\<>]+/g,"").replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(function(e,r){return 0==+e?"":0===r?e.toLowerCase():e.toUpperCase()}))},i=function(e){return(!e||!Array.isArray(e))&&e instanceof Object},c=function(){return c=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},c.apply(this,arguments)},l=function(e){try{return JSON.parse(e)}catch(r){return console.error("The attrs property is not properly-formatted JSON:"),console.error(e),console.error(r),r}},u=function(e,r){var t,n="string"==typeof e?l(e):e;return i(n)&&n.class?c(((t={})["".concat(n.class)]=void 0!==n.class&&n.class.length>0,t),r):r},f=function(e,r,t){void 0===r&&(r={});var a="string"==typeof e?l(e):e;return a?Object.assign({},r,a,{class:n()(t,a.class)}):{}},p=0,d=function(e){return void 0===e&&(e="mrl"),p++,"".concat(e,"-").concat(p)},v={sizes:["medium","small","large","auto"],themes:["classic","default"]},m={attrs:{role:"presentation"},size:"medium",theme:"default"},g=a(379),y=a.n(g),h=a(795),b=a.n(h),S=a(569),O=a.n(S),M=a(565),x=a.n(M),w=a(216),j=a.n(w),P=a(589),A=a.n(P),C=a(899),E={};E.styleTagTransform=A(),E.setAttributes=x(),E.insert=O().bind(null,"head"),E.domAPI=b(),E.insertStyleElement=j(),y()(C.Z,E);const T=C.Z&&C.Z.locals?C.Z.locals:void 0;var z=function(){return z=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},z.apply(this,arguments)},N=function(e){var t,a=e.theme,o=e.size,c=void 0===o?"medium":o,l=e.svg,p=e.attrs,v=void 0===p?{}:p,g=e.isClone,y=void 0!==g&&g,h=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)r.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(t[n[a]]=e[n[a]])}return t}(e,["theme","size","svg","attrs","isClone"]),b="There has been an issue rendering your SVG!",S=function(e,t,a){if(void 0===t&&(t={}),"text"===e.type)return e.value;var o=e.name,i=e.attributes||{};return Object.keys(i).forEach((function(e){var r="data-"===e.slice(0,5)?e:s(e);i[r]=i[e],e!==r&&delete i[e]})),"svg"===o?r().createElement("svg",z({},i,t,h,{className:n()(a),key:d()}),Array.isArray(e.children)&&e.children.map((function(e){return S(e)}))):r().createElement(o,z({},i,{key:d()}),Array.isArray(e.children)&&e.children.map((function(e){return S(e)})))},O=function(e,t,o,s){void 0===t&&(t={});var i=""===o?"This icon":o,c=Object.keys(e).length>0?"".concat(i," has no '").concat(a,"' theme found! Please try another SVG or theme."):"No valid themes found.";return console.warn(b),console.warn(c),r().createElement("span",z({className:n()(s)},t))};if(y)return r().createElement("span",null);if(!l)return r().createElement("span",null);var M=f(v,m.attrs),x=u(v,((t={})[T.MrlSvg]=!0,t[T["MrlSvg--".concat(c)]]="medium"!==c,t));delete M.class;var w="string"==typeof l;if(w&&!function(e){try{JSON.parse(e)}catch(r){return console.warn("".concat(b," Invalid SVG code:")),console.warn(e),!1}return!0}(l))return r().createElement("span",null);var j=w?JSON.parse(l):l,P=Object.keys(j),A=function(e){var r=e.indexOf("default")>=0,t=e.indexOf("rebrand")>=0;return"rebrand"!==a||t?a&&""!==a?a:r?"default":null:"default"}(P);return A&&""!==A?j[A]?S(j[A],M,x):i(j[P[0]])?O(j,M,j[P[0]].attributes["data-mrl-svg-name"],x):O(j):S(j,M,x)}})(),o})()));
@@ -0,0 +1,26 @@
1
+ import { AttrsObject } from "../setAttributes";
2
+ /**
3
+ * These common props are used available on all UI Toolkit components.
4
+ */
5
+ export interface MrlComponentProps {
6
+ /**
7
+ * Applies additional HTML attributes to the `svg` element.
8
+ * When using in a framework wrapper (e.g., React), treat it as an object and don't stringify.
9
+ * Otherwise, the value object needs to be stringified to not receive `"[Object object]"`.
10
+ * Example: `attrs='{ "data-foo": "bar" }'`
11
+ *
12
+ * @deprecated - `attrs` will be removed in favor of using HTML Attributes directly on components. Please update your usage accordingly.
13
+ */
14
+ attrs?: AttrsObject | string;
15
+ /**
16
+ * The slot to place a component in inside of a Web Component
17
+ *
18
+ * @deprecated - `slot` will be removed at the next major release. Please make sure you are not mixing React components with Web Components.
19
+ */
20
+ slot?: string | undefined;
21
+ /**
22
+ * A object of CSS properties. Please use style sparingly, and only in cases where your
23
+ * needs can not be met by passing a class to the component.
24
+ */
25
+ style?: Record<string, unknown>;
26
+ }
@@ -1,3 +1,4 @@
1
+ export * from './commonProps';
1
2
  export * from './getCamelCase';
2
3
  export * from './isObject';
3
4
  export * from './setAttributes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",