@loadsmart/miranda-react
Advanced tools
Comparing version 1.17.0 to 1.18.0
import type { HTMLAttributes } from 'react'; | ||
import type { SidebarProps as WCSidebarProps, SidebarAttributes } from '@loadsmart/miranda-wc'; | ||
import type { SidebarAttributes, SidebarProps as WCSidebarProps } from '@loadsmart/miranda-wc'; | ||
import { type BoxProps } from './Box'; | ||
@@ -4,0 +4,0 @@ declare global { |
@@ -6,3 +6,3 @@ "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} | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/const a=new Set(["children","localName","ref","style","className"]),l=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=l.get(e);void 0===t&&l.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},c=(e,r,t,i,l)=>{const c=new Set(Object.keys(null!=i?i:{}));class d 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))c.has(e)||!a.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)}}d.displayName=null!=l?l:t.name;const u=n.forwardRef(((e,r)=>n.createElement(d,Object.assign(Object.assign({},e),{__forwardedRef:r}),e.children)));return u.displayName=d.displayName,u},d=c(0,"m-banner-action-primary",r.BannerActionPrimary);function u(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(d,Object.assign({},a,{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=c(0,"m-banner-action-secondary",r.BannerActionSecondary);function h(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(p,Object.assign({},a,{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=c(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=c(0,"m-button",r.Button);const v=c(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=c(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 B(n){var{padding:t=r.defaultBoxProps.padding,backgroundColor:i,borderRadius:a=r.defaultBoxProps.borderRadius,borderWidth:l=r.defaultBoxProps.borderWidth,borderColor:o=r.defaultBoxProps.borderColor,textAlign:c=r.defaultBoxProps.textAlign,children:d}=n,u=s(n,["padding","backgroundColor","borderRadius","borderWidth","borderColor","textAlign","children"]);const g={padding:t,"background-color":i,"border-radius":a,"border-width":l,"border-color":o,"text-align":c};return e.jsx("m-box",Object.assign({},g,u,{children:d}))}function _(n){var{gap:t=r.defaultGroupProps.gap,align:i=r.defaultGroupProps.align,justify:a=r.defaultGroupProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-group",Object.assign({gap:t,align:i,justify:a},o,{children:l}))}function S(n){var{gap:t=r.defaultStackProps.gap,align:i=r.defaultStackProps.align,justify:a=r.defaultStackProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-stack",Object.assign({gap:t,align:i,justify:a},o,{children:l}))}function C(n){var{gap:t=r.defaultGridProps.gap,rowGap:i,columnGap:a,minColumnWidth:l=r.defaultGridProps.minColumnWidth,children:o}=n,c=s(n,["gap","rowGap","columnGap","minColumnWidth","children"]);const d={gap:t,"row-gap":i,"column-gap":a,"min-column-width":l};return e.jsx("m-grid",Object.assign({},d,c,{children:o}))}function G(n){var{gap:t=r.defaultSidebarProps.gap,sideWidth:i=r.defaultSidebarProps.sideWidth,minContentWidth:a=r.defaultSidebarProps.minContentWidth,reversed:l=r.defaultSidebarProps.reversed,children:o}=n,c=s(n,["gap","sideWidth","minContentWidth","reversed","children"]);const d={gap:t,"side-width":i,"min-content-width":a,reversed:l};return e.jsx("m-sidebar",Object.assign({},d,c,{children:o}))}function R(n){var{gap:t=r.defaultSwitcherProps.gap,rowGap:i,columnGap:a,threshold:l=r.defaultSwitcherProps.threshold,limit:o,children:c}=n,d=s(n,["gap","rowGap","columnGap","threshold","limit","children"]);const u={gap:t,"row-gap":i,"column-gap":a,threshold:l,limit:o};return e.jsx("m-switcher",Object.assign({},u,d,{children:c}))}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]}))},G.Side=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(B,Object.assign({slot:"sidebar"},t,{children:r}))},G.Content=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(B,Object.assign({slot:"content"},t,{children:r}))};const W=()=>null;W.Box=B,W.Group=_,W.Stack=S,W.Grid=C,W.Sidebar=G,W.Switcher=R;const E=c(0,"m-progress-bar",r.ProgressBar);const N=c(0,"m-progress-bar-countdown",r.ProgressBarCountdown);const k=c(0,"m-radio-group",r.RadioGroup,{onChange:"m-change"}),T=c(0,"m-radio",r.Radio);const A=c(0,"m-text-field",r.TextField,{onInput:"input",onChange:"change",onClear:"m-clear"});const D=c(0,"m-toggle",r.Toggle);function M(n){const{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs(D,Object.assign({},i,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))}const L=c(0,"m-toggle-group",r.ToggleGroup,{onChange:"m-change"});exports.Banner=x,exports.Box=B,exports.Button=function(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(O,Object.assign({},a,{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=C,exports.Group=_,exports.Layout=W,exports.ProgressBar=function(n){return e.jsx(E,Object.assign({},n))},exports.ProgressBarCountdown=function(n){return e.jsx(N,Object.assign({},n))},exports.Radio=function(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]}))},exports.RadioGroup=k,exports.Sidebar=G,exports.Stack=S,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(A,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=M,exports.ToggleGroup=function(n){const{value:r,options:t,children:a,disabled:l}=n,o=s(n,["value","options","children","disabled"]),c=i.useRef(null);return i.useEffect((function(){null!=c.current&&(c.current.value=r)}),[r]),e.jsx(L,Object.assign({ref:c,disabled:l},o,{children:null!=a?a:(t||[]).map((function(n){const{label:r,value:t}=n,i=s(n,["label","value"]);return e.jsx(M,Object.assign({},i,{disabled:Boolean(l||n.disabled),value:t},{children:r}),t)}))}))}; | ||
*/const a=new Set(["children","localName","ref","style","className"]),l=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=l.get(e);void 0===t&&l.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},c=(e,r,t,i,l)=>{const c=new Set(Object.keys(null!=i?i:{}));class d 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))c.has(e)||!a.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)}}d.displayName=null!=l?l:t.name;const u=n.forwardRef(((e,r)=>n.createElement(d,Object.assign(Object.assign({},e),{__forwardedRef:r}),e.children)));return u.displayName=d.displayName,u},d=c(0,"m-banner-action-primary",r.BannerActionPrimary);function u(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(d,Object.assign({},a,{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=c(0,"m-banner-action-secondary",r.BannerActionSecondary);function h(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(p,Object.assign({},a,{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=c(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=c(0,"m-button",r.Button);const v=c(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=c(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 B(n){var{padding:t=r.defaultBoxProps.padding,backgroundColor:i,borderRadius:a=r.defaultBoxProps.borderRadius,borderWidth:l=r.defaultBoxProps.borderWidth,borderColor:o=r.defaultBoxProps.borderColor,textAlign:c=r.defaultBoxProps.textAlign,children:d}=n,u=s(n,["padding","backgroundColor","borderRadius","borderWidth","borderColor","textAlign","children"]);const g={padding:t,"background-color":i,"border-radius":a,"border-width":l,"border-color":o,"text-align":c};return e.jsx("m-box",Object.assign({},g,u,{children:d}))}function _(n){var{gap:t=r.defaultGroupProps.gap,align:i=r.defaultGroupProps.align,justify:a=r.defaultGroupProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-group",Object.assign({gap:t,align:i,justify:a},o,{children:l}))}function S(n){var{gap:t=r.defaultStackProps.gap,align:i=r.defaultStackProps.align,justify:a=r.defaultStackProps.justify,children:l}=n,o=s(n,["gap","align","justify","children"]);return e.jsx("m-stack",Object.assign({gap:t,align:i,justify:a},o,{children:l}))}function C(n){var{gap:t=r.defaultGridProps.gap,rowGap:i,columnGap:a,minColumnWidth:l=r.defaultGridProps.minColumnWidth,children:o}=n,c=s(n,["gap","rowGap","columnGap","minColumnWidth","children"]);const d={gap:t,"row-gap":i,"column-gap":a,"min-column-width":l};return e.jsx("m-grid",Object.assign({},d,c,{children:o}))}function G(n){var{gap:t=r.defaultSidebarProps.gap,sideWidth:i=r.defaultSidebarProps.sideWidth,minContentWidth:a=r.defaultSidebarProps.minContentWidth,reversed:l=r.defaultSidebarProps.reversed,children:o}=n,c=s(n,["gap","sideWidth","minContentWidth","reversed","children"]);const d=Object.assign({gap:t,"side-width":i,"min-content-width":a},l&&{reversed:l});return e.jsx("m-sidebar",Object.assign({},d,c,{children:o}))}function R(n){var{gap:t=r.defaultSwitcherProps.gap,rowGap:i,columnGap:a,threshold:l=r.defaultSwitcherProps.threshold,limit:o,children:c}=n,d=s(n,["gap","rowGap","columnGap","threshold","limit","children"]);const u={gap:t,"row-gap":i,"column-gap":a,threshold:l,limit:o};return e.jsx("m-switcher",Object.assign({},u,d,{children:c}))}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]}))},G.Side=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(B,Object.assign({slot:"sidebar"},t,{children:r}))},G.Content=function(n){var{children:r}=n,t=s(n,["children"]);return e.jsx(B,Object.assign({slot:"content"},t,{children:r}))};const W=()=>null;W.Box=B,W.Group=_,W.Stack=S,W.Grid=C,W.Sidebar=G,W.Switcher=R;const E=c(0,"m-progress-bar",r.ProgressBar);const N=c(0,"m-progress-bar-countdown",r.ProgressBarCountdown);const k=c(0,"m-radio-group",r.RadioGroup,{onChange:"m-change"}),T=c(0,"m-radio",r.Radio);const A=c(0,"m-text-field",r.TextField,{onInput:"input",onChange:"change",onClear:"m-clear"});const D=c(0,"m-toggle",r.Toggle);function M(n){const{children:r,leading:t}=n,i=s(n,["children","leading"]);return e.jsxs(D,Object.assign({},i,{children:[null!=t&&e.jsx("span",Object.assign({slot:"leading"},{children:t})),r]}))}const L=c(0,"m-toggle-group",r.ToggleGroup,{onChange:"m-change"});exports.Banner=x,exports.Box=B,exports.Button=function(n){const{leading:r,trailing:t,children:i}=n,a=s(n,["leading","trailing","children"]);return e.jsxs(O,Object.assign({},a,{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=C,exports.Group=_,exports.Layout=W,exports.ProgressBar=function(n){return e.jsx(E,Object.assign({},n))},exports.ProgressBarCountdown=function(n){return e.jsx(N,Object.assign({},n))},exports.Radio=function(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]}))},exports.RadioGroup=k,exports.Sidebar=G,exports.Stack=S,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(A,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=M,exports.ToggleGroup=function(n){const{value:r,options:t,children:a,disabled:l}=n,o=s(n,["value","options","children","disabled"]),c=i.useRef(null);return i.useEffect((function(){null!=c.current&&(c.current.value=r)}),[r]),e.jsx(L,Object.assign({ref:c,disabled:l},o,{children:null!=a?a:(t||[]).map((function(n){const{label:r,value:t}=n,i=s(n,["label","value"]);return e.jsx(M,Object.assign({},i,{disabled:Boolean(l||n.disabled),value:t},{children:r}),t)}))}))}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@loadsmart/miranda-react", | ||
"version": "1.17.0", | ||
"version": "1.18.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83423
84
820