@webority/ui-react 0.60.0 → 0.60.1
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"./renderIconProp.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a={success:{icon:`check-circle`,tone:`success`},error:{icon:`x-circle`,tone:`danger`},warning:{icon:`alert-triangle`,tone:`warning`},info:{icon:`info`,tone:`info`},403:{tone:`muted`},404:{tone:`muted`},500:{tone:`muted`}};function o({status:o=`info`,title:s,subtitle:c,icon:l,actions:u,children:d,className:
|
|
1
|
+
import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";var a={success:{icon:`check-circle`,tone:`success`},error:{icon:`x-circle`,tone:`danger`},warning:{icon:`alert-triangle`,tone:`warning`},info:{icon:`info`,tone:`info`},403:{tone:`muted`},404:{tone:`muted`},500:{tone:`muted`}};function o({status:o=`info`,title:s,subtitle:c,icon:l,actions:u,children:d,headingLevel:f=2,className:p=``,...m}){t(`AppResult`,m),e(`AppResult`,`status`,o,Object.keys(a)),e(`AppResult`,`headingLevel`,f,[1,2,3]);let h=[1,2,3].includes(f)?`h${f}`:`h2`,g=a[o]||a.info,_=g.tone,v=/^\d+$/.test(o),y=l??(v?null:g.icon);return i(`div`,{className:[`result`,`result-${_}`,p].filter(Boolean).join(` `),...m,children:[v?r(`div`,{className:`result-code`,"aria-hidden":`true`,children:o}):y?r(`div`,{className:`result-icon`,children:n(y,{size:48})}):null,s!=null&&r(h,{className:`result-title`,children:s}),c!=null&&r(`div`,{className:`result-subtitle`,children:c}),u&&r(`div`,{className:`result-actions`,children:u}),d&&r(`div`,{className:`result-extra`,children:d})]})}export{o as default};
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
* @param {string|import('react').ReactNode} [props.icon] Override the status-default icon (name or node).
|
|
15
15
|
* @param {import('react').ReactNode} [props.actions] Usually one or two AppButtons.
|
|
16
16
|
* @param {import('react').ReactNode} [props.children] Extra content below the actions.
|
|
17
|
+
* @param {1|2|3} [props.headingLevel=2] The title's heading level: 1 when the result is the whole page.
|
|
17
18
|
* @param {string} [props.className] Extra classes on the result container.
|
|
18
19
|
*/
|
|
19
|
-
export default function AppResult({ status, title, subtitle, icon, actions, children, className, ...rest }: {
|
|
20
|
+
export default function AppResult({ status, title, subtitle, icon, actions, children, headingLevel, className, ...rest }: {
|
|
20
21
|
status?: 'success' | 'error' | 'warning' | 'info' | '403' | '404' | '500';
|
|
21
22
|
title: string;
|
|
22
23
|
subtitle?: import('react').ReactNode;
|
|
23
24
|
icon?: string | import('react').ReactNode;
|
|
24
25
|
actions?: import('react').ReactNode;
|
|
25
26
|
children?: import('react').ReactNode;
|
|
27
|
+
headingLevel?: 1 | 2 | 3;
|
|
26
28
|
className?: string;
|
|
27
29
|
}): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.1",
|
|
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.60.
|
|
31
|
-
"@webority/ui-elements": "0.60.
|
|
30
|
+
"@webority/theme": "0.60.1",
|
|
31
|
+
"@webority/ui-elements": "0.60.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@webority/analytics": "^0.23.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "^19.2.17",
|
|
46
46
|
"@vitejs/plugin-react": "^6.0.1",
|
|
47
47
|
"@vitest/coverage-v8": "5.0.1",
|
|
48
|
-
"@webority/analytics": "0.23.
|
|
48
|
+
"@webority/analytics": "0.23.1",
|
|
49
49
|
"bootstrap": "5.3.3",
|
|
50
50
|
"jsdom": "30.1.1",
|
|
51
51
|
"react": "^19.2.6",
|