@webority/ui-react 0.39.0 → 0.40.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 +1 @@
|
|
|
1
|
-
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./renderIconProp.js";import i from"./AppSparkline.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`plain`,`filled`,`accent`,`spotlight`],c=[`sm`,`md`,`lg`],l=[`primary`,`success`,`warning`,`danger`,`info`,`neutral`],u=[`up`,`down`,`flat`],d=[`success`,`danger`,`neutral`],f={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function p(e){if(typeof e!=`string`)return`flat`;let t=e.trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function m({label:m,value:h,caption:g,icon:_,iconTone:v,delta:y,deltaDirection:b,deltaTone:x,sparkline:S,variant:C=`plain`,size:w=`md`,valueSize:T,inline:E=!1,attention:D=!1,href:O,linkComponent:k,className:A=``,style:j,iconClassName:M=``,labelClassName:N=``,valueClassName:P=``,captionClassName:F=``,deltaClassName:I=``,sparklineClassName:L=``,...R}){t(`AppKpiTile`,R),e(`AppKpiTile`,`variant`,C,s),e(`AppKpiTile`,`size`,w,c),e(`AppKpiTile`,`iconTone`,v,l),e(`AppKpiTile`,`deltaDirection`,b,u),e(`AppKpiTile`,`deltaTone`,x,d);let z=`kpi${E?` kpi-inline`:``}${C===`filled`?` kpi-filled`:C===`accent`?` kpi-accent`:C===`spotlight`?` kpi-spotlight`:``}${w===`lg`?` kpi-lg`:w===`sm`?` kpi-sm`:``}${D?` kpi-attention`:``}${A?` ${A}`:``}`,B=typeof T==`number`&&T>0?{...j,"--wui-kpi-value-size":`${T}px`}:j,V=b??p(y),H=V===`up`?`arrow-up`:V===`down`?`arrow-down`:null,U=Object.hasOwn(f,x??``)?f[x]:``,W=
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import r from"./renderIconProp.js";import i from"./AppSparkline.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=[`plain`,`filled`,`accent`,`spotlight`],c=[`sm`,`md`,`lg`],l=[`primary`,`success`,`warning`,`danger`,`info`,`neutral`],u=[`up`,`down`,`flat`],d=[`success`,`danger`,`neutral`],f={success:` wui-kpi-delta--success`,danger:` wui-kpi-delta--danger`,neutral:` wui-kpi-delta--neutral`};function p(e){if(typeof e!=`string`)return`flat`;let t=e.trim();return t.startsWith(`+`)?`up`:t.startsWith(`-`)||t.startsWith(`−`)?`down`:`flat`}function m({label:m,value:h,caption:g,icon:_,iconTone:v,delta:y,deltaDirection:b,deltaTone:x,sparkline:S,variant:C=`plain`,size:w=`md`,valueSize:T,inline:E=!1,attention:D=!1,href:O,linkComponent:k,className:A=``,style:j,iconClassName:M=``,labelClassName:N=``,valueClassName:P=``,captionClassName:F=``,deltaClassName:I=``,sparklineClassName:L=``,...R}){t(`AppKpiTile`,R),e(`AppKpiTile`,`variant`,C,s),e(`AppKpiTile`,`size`,w,c),e(`AppKpiTile`,`iconTone`,v,l),e(`AppKpiTile`,`deltaDirection`,b,u),e(`AppKpiTile`,`deltaTone`,x,d);let z=`kpi${E?` kpi-inline`:``}${C===`filled`?` kpi-filled`:C===`accent`?` kpi-accent`:C===`spotlight`?` kpi-spotlight`:``}${w===`lg`?` kpi-lg`:w===`sm`?` kpi-sm`:``}${D?` kpi-attention`:``}${A?` ${A}`:``}`,B=typeof T==`number`&&T>0?{...j,"--wui-kpi-value-size":`${T}px`}:j,V=b??p(y),H=V===`up`?`arrow-up`:V===`down`?`arrow-down`:null,U=Object.hasOwn(f,x??``)?f[x]:``,W=O==null?`div`:k||`a`,G=O==null?{}:k?{to:O}:{href:O};return o(W,{className:z,style:B,...R,...G,children:[_&&a(`span`,{className:`kpi-icon${v?` kpi-icon-${v}`:``}${M?` ${M}`:``}`,children:r(_,{size:20})}),a(`div`,{className:`kpi-label${N?` ${N}`:``}`,children:m}),a(`div`,{className:`kpi-value${P?` ${P}`:``}`,children:h}),g&&a(`div`,{className:`kpi-caption${F?` ${F}`:``}`,children:g}),y&&o(`div`,{className:`kpi-delta${V===`flat`?``:` ${V}`}${U}${I?` ${I}`:``}`,children:[H&&a(n,{name:H,size:13}),y]}),S&&S.length>0&&a(i,{data:S,className:`kpi-sparkline${L?` ${L}`:``}`})]})}export{m as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@webority/theme": "0.
|
|
31
|
-
"@webority/ui-elements": "0.
|
|
30
|
+
"@webority/theme": "0.40.0",
|
|
31
|
+
"@webority/ui-elements": "0.40.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0",
|