@loadsmart/miranda-react
Advanced tools
Comparing version 1.15.0 to 1.16.0
export * from './components/Banner'; | ||
export * from './components/Button'; | ||
export * from './components/Card'; | ||
export * from './components/Field'; | ||
export * from './components/Layout'; | ||
@@ -5,0 +6,0 @@ export * from './components/RadioGroup'; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("@loadsmart/miranda-wc");function r(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var i=r(n);function s(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]])}return t} | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("@loadsmart/miranda-wc");function t(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}})),n.default=e,Object.freeze(n)}var i=t(n);function s(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)n.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(r[t[i]]=e[t[i]])}return r} | ||
/** | ||
@@ -6,3 +6,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/const a=new Set(["children","localName","ref","style","className"]),l=new WeakMap,o=(e,n,t,r,i)=>{const s=null==i?void 0:i[n];void 0!==s?t!==r&&((e,n,t)=>{let r=l.get(e);void 0===r&&l.set(e,r=new Map);let i=r.get(n);void 0!==t?void 0===i?(r.set(n,i={handleEvent:t}),e.addEventListener(n,i)):i.handleEvent=t:void 0!==i&&(r.delete(n),e.removeEventListener(n,i))})(e,s,t):e[n]=t},d=(e,t,r,i,l)=>{const d=new Set(Object.keys(null!=i?i:{}));class c extends n.Component{constructor(){super(...arguments),this._element=null}_updateElement(e){if(null!==this._element)for(const n in this._elementProps)o(this._element,n,this.props[n],e?e[n]:void 0,i)}componentDidMount(){this._updateElement()}componentDidUpdate(e){this._updateElement(e)}render(){const e=this.props,{__forwardedRef:i}=e,l=s(e,["__forwardedRef"]);void 0!==this._ref&&this._userRef===i||(this._ref=e=>{null===this._element&&(this._element=e),null!==i&&((e,n)=>{"function"==typeof e?e(n):e.current=n})(i,e),this._userRef=i}),this._elementProps={};const o={ref:this._ref};for(const[e,n]of Object.entries(l))d.has(e)||!a.has(e)&&!(e in HTMLElement.prototype)&&e in r.prototype?this._elementProps[e]=n:o["className"===e?"class":e]=n;return n.createElement(t,o)}}c.displayName=null!=l?l:r.name;const u=n.forwardRef(((e,t)=>n.createElement(c,Object.assign(Object.assign({},e),{__forwardedRef:t}),e.children)));return u.displayName=c.displayName,u},c=d(0,"m-banner-action-primary",t.BannerActionPrimary);function u(n){const{leading:t,trailing:r,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(c,Object.assign({},a,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),i,null!=r&&e.jsx("span",Object.assign({slot:"trailing"},{children:r}))]}))}function g(n){var t=s(n,[]);return e.jsx("m-banner-actions",Object.assign({},t))}u.displayName="BannerActionPrimary",g.displayName="BannerActions";const p=d(0,"m-banner-action-secondary",t.BannerActionSecondary);function h(n){const{leading:t,trailing:r,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(p,Object.assign({},a,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),i,null!=r&&e.jsx("span",Object.assign({slot:"trailing"},{children:r}))]}))}function b(n){var t=s(n,[]);return e.jsx("m-banner-description",Object.assign({},t))}function j(n){var t=s(n,[]);return e.jsx("m-banner-icon",Object.assign({},t))}function f(n){var t=s(n,[]);return e.jsx("m-banner-title",Object.assign({},t))}h.displayName="BannerActionSecondary",b.displayName="BannerDescription",j.displayName="BannerIcon",f.displayName="BannerTitle";const m=d(0,"m-banner",t.Banner,{onDismiss:"m-dismiss"},"WiredBanner");function x(n){return e.jsx(m,Object.assign({},n))}x.displayName="Banner",x.ActionPrimary=u,x.Actions=g,x.ActionSecondary=h,x.Description=b,x.Icon=j,x.Title=f;const O=d(0,"m-button",t.Button);const v=d(0,"m-card",t.Card);function y(n){var{children:t}=n,r=s(n,["children"]);return e.jsx(v,Object.assign({},r,{children:t}))}function P(n){var{padding:r=t.defaultBoxProps.padding,backgroundColor:i,borderRadius:a=t.defaultBoxProps.borderRadius,borderWidth:l=t.defaultBoxProps.borderWidth,borderColor:o=t.defaultBoxProps.borderColor,textAlign:d=t.defaultBoxProps.textAlign,children:c}=n,u=s(n,["padding","backgroundColor","borderRadius","borderWidth","borderColor","textAlign","children"]);const g={padding:r,"background-color":i,"border-radius":a,"border-width":l,"border-color":o,"text-align":d};return e.jsx("m-box",Object.assign({},g,u,{children:c}))}function w(n){var{gap:r=t.defaultGroupProps.gap,align:i=t.defaultGroupProps.align,justify:a=t.defaultGroupProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-group",Object.assign({gap:r,align:i,justify:a},o,{children:l}))}function _(n){var{gap:r=t.defaultStackProps.gap,align:i=t.defaultStackProps.align,justify:a=t.defaultStackProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-stack",Object.assign({gap:r,align:i,justify:a},o,{children:l}))}function S(n){var{gap:r=t.defaultGridProps.gap,rowGap:i,columnGap:a,minColumnWidth:l=t.defaultGridProps.minColumnWidth,children:o}=n,d=s(n,["gap","rowGap","columnGap","minColumnWidth","children"]);const c={gap:r,"row-gap":i,"column-gap":a,"min-column-width":l};return e.jsx("m-grid",Object.assign({},c,d,{children:o}))}function B(n){var{gap:r=t.defaultSidebarProps.gap,sideWidth:i=t.defaultSidebarProps.sideWidth,minContentWidth:a=t.defaultSidebarProps.minContentWidth,reversed:l=t.defaultSidebarProps.reversed,children:o}=n,d=s(n,["gap","sideWidth","minContentWidth","reversed","children"]);const c={gap:r,"side-width":i,"min-content-width":a,reversed:l};return e.jsx("m-sidebar",Object.assign({},c,d,{children:o}))}function G(n){var{gap:r=t.defaultSwitcherProps.gap,rowGap:i,columnGap:a,threshold:l=t.defaultSwitcherProps.threshold,limit:o,children:d}=n,c=s(n,["gap","rowGap","columnGap","threshold","limit","children"]);const u={gap:r,"row-gap":i,"column-gap":a,threshold:l,limit:o};return e.jsx("m-switcher",Object.assign({},u,c,{children:d}))}y.Title=function(n){var{children:t,leading:r}=n,i=s(n,["children","leading"]);return e.jsxs("m-card-title",Object.assign({},i,{slot:"title"},{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),t]}))},y.Subtitle=function(n){var{children:t}=n,r=s(n,["children"]);return e.jsx("m-card-subtitle",Object.assign({},r,{slot:"subtitle"},{children:t}))},y.Body=function(n){var{children:t}=n,r=s(n,["children"]);return e.jsx("m-card-body",Object.assign({slot:"body"},r,{children:t}))},B.Side=function(n){var{children:t}=n,r=s(n,["children"]);return e.jsx(P,Object.assign({slot:"sidebar"},r,{children:t}))},B.Content=function(n){var{children:t}=n,r=s(n,["children"]);return e.jsx(P,Object.assign({slot:"content"},r,{children:t}))};const C=()=>null;C.Box=P,C.Group=w,C.Stack=_,C.Grid=S,C.Sidebar=B,C.Switcher=G;const R=d(0,"m-radio-group",t.RadioGroup,{onChange:"m-change"}),W=d(0,"m-radio",t.Radio);const E=d(0,"m-text-field",t.TextField,{onInput:"input",onChange:"change",onClear:"m-clear"});const N=d(0,"m-toggle",t.Toggle);function k(n){const{children:t,leading:r}=n,i=s(n,["children","leading"]);return e.jsxs(N,Object.assign({},i,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),t]}))}const T=d(0,"m-toggle-group",t.ToggleGroup,{onChange:"m-change"});exports.Banner=x,exports.Box=P,exports.Button=function(n){const{leading:t,trailing:r,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(O,Object.assign({},a,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),i,null!=r&&e.jsx("span",Object.assign({slot:"trailing"},{children:r}))]}))},exports.Card=y,exports.Grid=S,exports.Group=w,exports.Layout=C,exports.Radio=function(n){const{children:t,leading:r}=n,i=s(n,["children","leading"]);return e.jsxs(W,Object.assign({},i,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),t]}))},exports.RadioGroup=R,exports.Sidebar=B,exports.Stack=_,exports.Switcher=G,exports.Tag=function(n){const{leading:t,children:r}=n,i=s(n,["leading","children"]);return e.jsxs("m-tag",Object.assign({},i,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))},exports.Text=function(n){var{children:t}=n,r=s(n,["children"]);return e.jsx("m-text",Object.assign({},r,{children:t}))},exports.TextField=function(n){var{leading:t,trailing:r}=n,i=s(n,["leading","trailing"]);return e.jsxs(E,Object.assign({},i,{children:[null!=t&&e.jsx("div",Object.assign({slot:"leading"},{children:t})),null!=r&&e.jsx("div",Object.assign({slot:"trailing"},{children:r}))]}))},exports.Toggle=k,exports.ToggleGroup=function(n){const{value:t,options:r,children:a,disabled:l}=n,o=s(n,["value","options","children","disabled"]),d=i.useRef(null);return i.useEffect((function(){null!=d.current&&(d.current.value=t)}),[t]),e.jsx(T,Object.assign({ref:d,disabled:l},o,{children:null!=a?a:(r||[]).map((function(n){const{label:t,value:r}=n,i=s(n,["label","value"]);return e.jsx(k,Object.assign({},i,{disabled:Boolean(l||n.disabled),value:r},{children:t}),r)}))}))}; | ||
*/const l=new Set(["children","localName","ref","style","className"]),a=new WeakMap,o=(e,n,r,t,i)=>{const s=null==i?void 0:i[n];void 0!==s?r!==t&&((e,n,r)=>{let t=a.get(e);void 0===t&&a.set(e,t=new Map);let i=t.get(n);void 0!==r?void 0===i?(t.set(n,i={handleEvent:r}),e.addEventListener(n,i)):i.handleEvent=r:void 0!==i&&(t.delete(n),e.removeEventListener(n,i))})(e,s,r):e[n]=r},d=(e,r,t,i,a)=>{const d=new Set(Object.keys(null!=i?i:{}));class c extends n.Component{constructor(){super(...arguments),this._element=null}_updateElement(e){if(null!==this._element)for(const n in this._elementProps)o(this._element,n,this.props[n],e?e[n]:void 0,i)}componentDidMount(){this._updateElement()}componentDidUpdate(e){this._updateElement(e)}render(){const e=this.props,{__forwardedRef:i}=e,a=s(e,["__forwardedRef"]);void 0!==this._ref&&this._userRef===i||(this._ref=e=>{null===this._element&&(this._element=e),null!==i&&((e,n)=>{"function"==typeof e?e(n):e.current=n})(i,e),this._userRef=i}),this._elementProps={};const o={ref:this._ref};for(const[e,n]of Object.entries(a))d.has(e)||!l.has(e)&&!(e in HTMLElement.prototype)&&e in t.prototype?this._elementProps[e]=n:o["className"===e?"class":e]=n;return n.createElement(r,o)}}c.displayName=null!=a?a:t.name;const u=n.forwardRef(((e,r)=>n.createElement(c,Object.assign(Object.assign({},e),{__forwardedRef:r}),e.children)));return u.displayName=c.displayName,u},c=d(0,"m-banner-action-primary",r.BannerActionPrimary);function u(n){const{leading:r,trailing:t,children:i}=n,l=s(n,["leading","trailing","children"]);return e.jsxs(c,Object.assign({},l,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),i,null!=t&&e.jsx("span",Object.assign({slot:"trailing"},{children:t}))]}))}function g(n){var r=s(n,[]);return e.jsx("m-banner-actions",Object.assign({},r))}u.displayName="BannerActionPrimary",g.displayName="BannerActions";const p=d(0,"m-banner-action-secondary",r.BannerActionSecondary);function h(n){const{leading:r,trailing:t,children:i}=n,l=s(n,["leading","trailing","children"]);return e.jsxs(p,Object.assign({},l,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),i,null!=t&&e.jsx("span",Object.assign({slot:"trailing"},{children:t}))]}))}function j(n){var r=s(n,[]);return e.jsx("m-banner-description",Object.assign({},r))}function b(n){var r=s(n,[]);return e.jsx("m-banner-icon",Object.assign({},r))}function f(n){var r=s(n,[]);return e.jsx("m-banner-title",Object.assign({},r))}h.displayName="BannerActionSecondary",j.displayName="BannerDescription",b.displayName="BannerIcon",f.displayName="BannerTitle";const m=d(0,"m-banner",r.Banner,{onDismiss:"m-dismiss"},"WiredBanner");function x(n){return e.jsx(m,Object.assign({},n))}x.displayName="Banner",x.ActionPrimary=u,x.Actions=g,x.ActionSecondary=h,x.Description=j,x.Icon=b,x.Title=f;const O=d(0,"m-button",r.Button);const v=d(0,"m-card",r.Card);function y(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(v,Object.assign({},t,{children:r}))}y.Title=function(n){var{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs("m-card-title",Object.assign({},i,{slot:"title"},{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))},y.Subtitle=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx("m-card-subtitle",Object.assign({},t,{slot:"subtitle"},{children:r}))},y.Body=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx("m-card-body",Object.assign({slot:"body"},t,{children:r}))};const P=d(0,"m-field",r.Field);function w(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(P,Object.assign({},t,{children:r}))}function _(n){var{padding:t=r.defaultBoxProps.padding,backgroundColor:i,borderRadius:l=r.defaultBoxProps.borderRadius,borderWidth:a=r.defaultBoxProps.borderWidth,borderColor:o=r.defaultBoxProps.borderColor,textAlign:d=r.defaultBoxProps.textAlign,children:c}=n,u=s(n,["padding","backgroundColor","borderRadius","borderWidth","borderColor","textAlign","children"]);const g={padding:t,"background-color":i,"border-radius":l,"border-width":a,"border-color":o,"text-align":d};return e.jsx("m-box",Object.assign({},g,u,{children:c}))}function S(n){var{gap:t=r.defaultGroupProps.gap,align:i=r.defaultGroupProps.align,justify:l=r.defaultGroupProps.justify,children:a}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-group",Object.assign({gap:t,align:i,justify:l},o,{children:a}))}function B(n){var{gap:t=r.defaultStackProps.gap,align:i=r.defaultStackProps.align,justify:l=r.defaultStackProps.justify,children:a}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-stack",Object.assign({gap:t,align:i,justify:l},o,{children:a}))}function G(n){var{gap:t=r.defaultGridProps.gap,rowGap:i,columnGap:l,minColumnWidth:a=r.defaultGridProps.minColumnWidth,children:o}=n,d=s(n,["gap","rowGap","columnGap","minColumnWidth","children"]);const c={gap:t,"row-gap":i,"column-gap":l,"min-column-width":a};return e.jsx("m-grid",Object.assign({},c,d,{children:o}))}function C(n){var{gap:t=r.defaultSidebarProps.gap,sideWidth:i=r.defaultSidebarProps.sideWidth,minContentWidth:l=r.defaultSidebarProps.minContentWidth,reversed:a=r.defaultSidebarProps.reversed,children:o}=n,d=s(n,["gap","sideWidth","minContentWidth","reversed","children"]);const c={gap:t,"side-width":i,"min-content-width":l,reversed:a};return e.jsx("m-sidebar",Object.assign({},c,d,{children:o}))}function R(n){var{gap:t=r.defaultSwitcherProps.gap,rowGap:i,columnGap:l,threshold:a=r.defaultSwitcherProps.threshold,limit:o,children:d}=n,c=s(n,["gap","rowGap","columnGap","threshold","limit","children"]);const u={gap:t,"row-gap":i,"column-gap":l,threshold:a,limit:o};return e.jsx("m-switcher",Object.assign({},u,c,{children:d}))}w.Label=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx("m-field-label",Object.assign({},t,{slot:"label"},{children:r}))},w.Hint=function(n){var{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs("m-field-hint",Object.assign({},i,{slot:"hint"},{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))},C.Side=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(_,Object.assign({slot:"sidebar"},t,{children:r}))},C.Content=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(_,Object.assign({slot:"content"},t,{children:r}))};const W=()=>null;W.Box=_,W.Group=S,W.Stack=B,W.Grid=G,W.Sidebar=C,W.Switcher=R;const E=d(0,"m-radio-group",r.RadioGroup,{onChange:"m-change"}),N=d(0,"m-radio",r.Radio);const k=d(0,"m-text-field",r.TextField,{onInput:"input",onChange:"change",onClear:"m-clear"});const T=d(0,"m-toggle",r.Toggle);function A(n){const{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs(T,Object.assign({},i,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))}const D=d(0,"m-toggle-group",r.ToggleGroup,{onChange:"m-change"});exports.Banner=x,exports.Box=_,exports.Button=function(n){const{leading:r,trailing:t,children:i}=n,l=s(n,["leading","trailing","children"]);return e.jsxs(O,Object.assign({},l,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),i,null!=t&&e.jsx("span",Object.assign({slot:"trailing"},{children:t}))]}))},exports.Card=y,exports.Field=w,exports.Grid=G,exports.Group=S,exports.Layout=W,exports.Radio=function(n){const{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs(N,Object.assign({},i,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))},exports.RadioGroup=E,exports.Sidebar=C,exports.Stack=B,exports.Switcher=R,exports.Tag=function(n){const{leading:r,children:t}=n,i=s(n,["leading","children"]);return e.jsxs("m-tag",Object.assign({},i,{children:[null!=r&&e.jsx("span",Object.assign({slot:"leading"},{children:r})),t]}))},exports.Text=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx("m-text",Object.assign({},t,{children:r}))},exports.TextField=function(n){var{leading:r,trailing:t}=n,i=s(n,["leading","trailing"]);return e.jsxs(k,Object.assign({},i,{children:[null!=r&&e.jsx("div",Object.assign({slot:"leading"},{children:r})),null!=t&&e.jsx("div",Object.assign({slot:"trailing"},{children:t}))]}))},exports.Toggle=A,exports.ToggleGroup=function(n){const{value:r,options:t,children:l,disabled:a}=n,o=s(n,["value","options","children","disabled"]),d=i.useRef(null);return i.useEffect((function(){null!=d.current&&(d.current.value=r)}),[r]),e.jsx(D,Object.assign({ref:d,disabled:a},o,{children:null!=l?l:(t||[]).map((function(n){const{label:r,value:t}=n,i=s(n,["label","value"]);return e.jsx(A,Object.assign({},i,{disabled:Boolean(a||n.disabled),value:t},{children:r}),t)}))}))}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@loadsmart/miranda-react", | ||
"version": "1.15.0", | ||
"version": "1.16.0", | ||
"description": "React component library based on Miranda Web Components", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
Sorry, the diff of this file is not supported yet
80243
75
768