@webority/ui-react 0.175.0 → 0.177.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.
- package/dist/canvas-kit/kit.js +92 -92
- package/dist/canvas-kit/manifest.json +25 -14
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppButton.js +1 -1
- package/dist/components/AppColumnMenu.js +1 -1
- package/dist/components/AppDataTable.js +1 -1
- package/dist/components/AppFilePicker.js +1 -1
- package/dist/components/AppInlineEdit.js +1 -1
- package/dist/components/AppMeter.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/components/AppSplitView.js +1 -1
- package/dist/components/AppTextarea.js +1 -1
- package/dist/guidance.json +2 -8
- package/dist/types/components/AppButton.d.ts +5 -5
- package/dist/types/components/AppCheckbox.d.ts +1 -2
- package/dist/types/components/AppDataTable.d.ts +4 -2
- package/dist/types/components/AppFilePicker.d.ts +2 -2
- package/dist/types/components/AppIcon.d.ts +1 -1
- package/dist/types/components/AppShell.d.ts +2 -0
- package/dist/types/components/AppTextarea.d.ts +1 -1
- package/dist/web-core/dist/api/idempotencyKey.js +1 -1
- package/dist/web-core/dist/errors/extractApiError.js +2 -2
- package/package.json +11 -11
package/dist/guidance.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"format": "webority-guidance/1",
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.177.0"
|
|
6
6
|
},
|
|
7
7
|
"components": [
|
|
8
8
|
{
|
|
@@ -976,13 +976,7 @@
|
|
|
976
976
|
{
|
|
977
977
|
"component": "AppButton",
|
|
978
978
|
"props": {
|
|
979
|
-
"leftIcon":
|
|
980
|
-
"component": "AppIcon",
|
|
981
|
-
"props": {
|
|
982
|
-
"name": "plus",
|
|
983
|
-
"size": 16
|
|
984
|
-
}
|
|
985
|
-
}
|
|
979
|
+
"leftIcon": "plus"
|
|
986
980
|
},
|
|
987
981
|
"children": "Add member"
|
|
988
982
|
}
|
|
@@ -33,10 +33,10 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
33
33
|
* @default false
|
|
34
34
|
*/
|
|
35
35
|
block?: boolean | undefined;
|
|
36
|
-
/** An icon name,
|
|
37
|
-
leftIcon?: string |
|
|
38
|
-
/** An icon name,
|
|
39
|
-
rightIcon?: string |
|
|
36
|
+
/** An icon name, drawn in the icon set. */
|
|
37
|
+
leftIcon?: string | undefined;
|
|
38
|
+
/** An icon name, drawn in the icon set. */
|
|
39
|
+
rightIcon?: string | undefined;
|
|
40
40
|
/** Render as a button-styled link (an <a href>) instead of a <button>; matches Razor <app-button href>. */
|
|
41
41
|
href?: string | undefined;
|
|
42
42
|
/**
|
|
@@ -66,7 +66,7 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
|
|
|
66
66
|
*/
|
|
67
67
|
shape?: "rounded" | "pill" | "sharp" | undefined;
|
|
68
68
|
/**
|
|
69
|
-
* The iconsax style of a named leftIcon / rightIcon
|
|
69
|
+
* The iconsax style of a named leftIcon / rightIcon.
|
|
70
70
|
* @default "linear"
|
|
71
71
|
*/
|
|
72
72
|
iconVariant?: IconVariant | undefined;
|
|
@@ -56,8 +56,7 @@ export interface AppCheckboxProps extends Omit<ComponentPropsWithoutRef<"input">
|
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Shared checkbox on Bootstrap `.form-check` markup (Razor <app-checkbox> matches).
|
|
59
|
-
* Theme restyles `.form-check-input` as the one selection glyph
|
|
60
|
-
* uses the `.wui-check` alias of the same skin.
|
|
59
|
+
* Theme restyles `.form-check-input` as the one selection glyph, table row-select included.
|
|
61
60
|
*
|
|
62
61
|
* The label is bound with id/htmlFor rather than react-bootstrap's `label` prop:
|
|
63
62
|
* that rendered a <label> with no `for`, so clicking the text did nothing.
|
|
@@ -43,6 +43,8 @@ export interface AppDataTableColumn<Row> {
|
|
|
43
43
|
/** Draws the cell as the row's header, a th with scope row. Default off. */
|
|
44
44
|
rowHeader?: boolean | undefined;
|
|
45
45
|
cellClassName?: string | undefined;
|
|
46
|
+
/** Added to the header cell and every body cell of the column, for CSS that targets one column. */
|
|
47
|
+
columnClassName?: string | undefined;
|
|
46
48
|
cellStyle?: CSSProperties | undefined;
|
|
47
49
|
hideable?: boolean | undefined;
|
|
48
50
|
pin?: AppDataTablePin | undefined;
|
|
@@ -181,8 +183,8 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
|
|
|
181
183
|
/** Keys of hideable columns to leave out, from useTableView. A column that is not hideable always shows. */
|
|
182
184
|
hiddenColumns?: string[] | undefined;
|
|
183
185
|
/**
|
|
184
|
-
*
|
|
185
|
-
* @default
|
|
186
|
+
* Stacks on phones by default: below 768px each row is a card, the first column on top, then label and value lines from the column labels, actions at the bottom. A virtual table defaults to false. Set false to keep the scrolling table.
|
|
187
|
+
* @default true
|
|
186
188
|
*/
|
|
187
189
|
stackOnMobile?: boolean | undefined;
|
|
188
190
|
/**
|
|
@@ -98,7 +98,7 @@ interface AppFilePickerBaseProps extends Omit<ComponentPropsWithoutRef<"input">,
|
|
|
98
98
|
*/
|
|
99
99
|
readOnly?: boolean | undefined;
|
|
100
100
|
/**
|
|
101
|
-
* The control height: sm, md or lg. The button form takes it too
|
|
101
|
+
* The control height: sm, md or lg, md when unset. The button form takes it too.
|
|
102
102
|
* @default "md"
|
|
103
103
|
*/
|
|
104
104
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -177,7 +177,7 @@ export type AppFilePickerProps = AppFilePickerSingleProps | AppFilePickerMultipl
|
|
|
177
177
|
* @param [props.helperText]
|
|
178
178
|
* @param [props.loading]
|
|
179
179
|
* @param [props.readOnly] Shows the value but blocks picking, dropping, changing and removing. The control takes aria-readonly.
|
|
180
|
-
* @param [props.size] The control height: sm, md or lg. The button form takes it too
|
|
180
|
+
* @param [props.size] The control height: sm, md or lg, md when unset. The button form takes it too.
|
|
181
181
|
* @param [props.disabled] Locks the picker and keeps it out of the form post.
|
|
182
182
|
* @param [props.help] The content of the info-tip beside the label.
|
|
183
183
|
* @param [props.helpLabel] The accessible name of the info-tip button.
|
|
@@ -45,6 +45,6 @@ export interface AppIconProps extends Omit<ComponentPropsWithoutRef<"svg">, "cla
|
|
|
45
45
|
*
|
|
46
46
|
* The glyph bodies are GENERATED (iconGlyphs.g.ts) from one source shared with the Razor
|
|
47
47
|
* RCL and the wui elements, so every surface draws the identical icon. Add or change an
|
|
48
|
-
* icon in scripts/icon-map.json and run `node scripts/gen-icons.
|
|
48
|
+
* icon in scripts/icon-map.json and run `node scripts/gen-icons.mts`.
|
|
49
49
|
*/
|
|
50
50
|
export default function AppIcon(props: AppIconProps): ReactNode;
|
|
@@ -139,6 +139,8 @@ export interface SearchShape {
|
|
|
139
139
|
onFocus?: ((event: React.FocusEvent<HTMLInputElement>) => void) | undefined;
|
|
140
140
|
/** Default "Search"; also the field's accessible name. */
|
|
141
141
|
placeholder?: string | undefined;
|
|
142
|
+
/** One letter (a to z): Ctrl or Cmd with it focuses the field and the placeholder names the chord. */
|
|
143
|
+
shortcutKey?: string | undefined;
|
|
142
144
|
}
|
|
143
145
|
export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div">, "children" | "className" | "style"> {
|
|
144
146
|
/**
|
|
@@ -72,7 +72,7 @@ export interface AppTextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
|
72
72
|
/**
|
|
73
73
|
* The shared multi-line field: the textarea counterpart to AppInput. Wraps react-bootstrap
|
|
74
74
|
* Form.Group / Form.Label / Form.Control (as="textarea"), keeping the `.field`/`.label`/
|
|
75
|
-
* `.
|
|
75
|
+
* `.form-control` classes so the look is unchanged. Forwards `ref` for react-hook-form and
|
|
76
76
|
* controlled use alike.
|
|
77
77
|
*/
|
|
78
78
|
declare function AppTextarea({ ref, ...props }: AppTextareaProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=()=>globalThis.crypto,t=()=>{let t=/* @__PURE__ */ new Uint8Array(16),n=e();if(typeof n?.getRandomValues
|
|
1
|
+
var e=()=>globalThis.crypto,t=()=>{let t=/* @__PURE__ */ new Uint8Array(16),n=e();if(typeof n?.getRandomValues!=`function`)throw Error(`newIdempotencyKey needs crypto.randomUUID or crypto.getRandomValues, and this runtime has neither.`);return n.getRandomValues(t),t},n=e=>{let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`},r=()=>{let r=e();return typeof r?.randomUUID==`function`?r.randomUUID():n(Array.from(t(),(e,t)=>t===6?e&15|64:t===8?e&63|128:e))};export{r as newIdempotencyKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isOfflineFailure as e}from"./requestPlatform.js";var t=`You appear to be offline. Check your connection and try again.`,n=`We
|
|
2
|
-
at `)||/(Exception|StackTrace):/.test(e)||/\b(System|Microsoft)\.[A-Za-z]+\.[A-Za-z]/.test(e),
|
|
1
|
+
import{isOfflineFailure as e}from"./requestPlatform.js";var t=`You appear to be offline. Check your connection and try again.`,n=`We could not reach the server. Check your network or firewall and try again.`,r=`That took too long to respond. Check your connection and try again.`,i=`Something went wrong. Please try again.`,a=`A network check stopped this request. Try again, or report it if it keeps happening.`,o=`request_canceled`,s=`contract_error`,c=`timeout`,l=`network`,u=`offline`,d=`network_check`,f=300,p=`internal_error`,m=e=>`Request failed (${e})`,h={401:{code:`unauthorized`,sentence:`Please sign in to continue.`},403:{code:`forbidden`,sentence:`You do not have access to this.`}},g=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_=e=>typeof e==`string`&&e.trim().length>0?e:null,v=(e,t)=>{let n=h[e];if(n===void 0||t===null||t.code!==n.code)return null;let r=_(t.detail);return r===null||r===n.sentence?n.sentence:null},y=e=>/^\s*</.test(e)||e.includes(`
|
|
2
|
+
at `)||/(Exception|StackTrace):/.test(e)||/\b(System|Microsoft)\.[A-Za-z]+\.[A-Za-z]/.test(e),b=(e,t)=>{let n=_(e);return n!==null&&!y(n)&&!(t&&n.length>f)?n:null},x=e=>e.replace(/^\$\.?/,``).split(`.`).map(e=>e.charAt(0).toLowerCase()+e.slice(1)).join(`.`),S=e=>{if(Array.isArray(e)){for(let t of e){let e=_(t);if(e!==null)return e}return null}return _(e)},C=(e,t,n)=>{let r=x(t);r===``?e.form??=n:r in e.fields||(e.fields[r]=n)},w=e=>{let t={fields:{},form:null};if(Array.isArray(e)){for(let n of e){if(!g(n))continue;let e=_(n.message);e!==null&&C(t,typeof n.field==`string`?n.field:``,e)}return t}if(!g(e))return t;for(let[n,r]of Object.entries(e)){let e=S(r);e!==null&&C(t,n,e)}return t},T=e=>g(e)&&typeof e.message==`string`&&typeof e.status==`number`&&typeof e.offline==`boolean`&&g(e.fieldErrors)&&g(e.extensions),E=e=>({code:null,fieldErrors:{},status:0,offline:!1,traceId:null,diagnostic:null,extensions:{},...e}),D=/* @__PURE__ */ new Set([`type`,`title`,`status`,`detail`,`instance`,`code`,`errors`,`traceId`]),O=e=>e===null?{}:Object.fromEntries(Object.entries(e).filter(([e])=>!D.has(e))),k=e=>{let t=g(e.config)?e.config.headers:void 0;if(!g(t))return null;let n=typeof t.get==`function`?t.get(`traceparent`):t.traceparent??t.Traceparent;return(typeof n==`string`?/^00-([0-9a-f]{32})-[0-9a-f]{16}-[0-9a-f]{2}$/.exec(n):null)?.[1]??null},A=e=>{let t=e?.headers;return g(t)?(typeof t.get==`function`?t.get(`cf-mitigated`):t[`cf-mitigated`])===`challenge`:!1},j=a=>{let s=_(a.code),d=_(a.name),f=_(a.message),p=k(a);return d===`CanceledError`||s===`ERR_CANCELED`?E({code:o,message:i,traceId:p,diagnostic:f}):s===`ECONNABORTED`||s===`ETIMEDOUT`?E({code:c,message:r,offline:!0,traceId:p,diagnostic:f}):d===`RequestOfflineError`||s===`ERR_NETWORK`||f===`Network Error`||f===`Network request failed`?e(a)?E({code:u,message:t,offline:!0,traceId:p,diagnostic:f}):E({code:l,message:n,offline:!0,traceId:p,diagnostic:f}):E({message:i,traceId:p,diagnostic:f})};function M(e){if(T(e))return e;if(typeof e==`string`)return E({message:b(e,!0)??`Something went wrong. Please try again.`,diagnostic:e||null});if(!g(e))return E({message:i,diagnostic:e==null?null:String(e)});if(e.isContractError===!0)return E({code:s,message:b(e.message,!0)??`Something went wrong. Please try again.`,diagnostic:_(e.message)});let t=g(e.response)?e.response:null,n=typeof t?.status==`number`?t.status:typeof e.status==`number`?e.status:0,r=t?t.data:e.body;if(n===0&&r==null)return j(e);if(n===403&&A(t))return E({code:d,message:a,status:n,traceId:k(e),diagnostic:_(e.message)});let o=g(r)?r:null,{fields:c,form:l}=w(o?.errors),u=_(o?.code),f=n>=500||u===null,h=_(o?.traceId)??k(e),y=_(o?.detail)??_(o?.title)??_(r)??_(e.message),x;x=n>=500?(u!==null&&u!==p?b(o?.detail,!0):null)??`Something went wrong on our side. Please try again in a moment.`:v(n,o)??b(Object.values(c)[0],f)??b(l,f)??b(o?.detail,f)??b(o?.title,f)??b(r,f)??(n?m(n):`Something went wrong. Please try again.`);let S=g(e.config)?e.config:null,C=S===null?null:_(S.url),D=S!==null&&`_accountId`in S?_(S._accountId):null;return E({code:u,message:x,fieldErrors:c,status:n,traceId:h,diagnostic:y,extensions:O(o),...C===null?{}:{requestUrl:C},...D===null?{}:{accountId:D}})}export{s as CONTRACT_ERROR_CODE,d as NETWORK_CHECK_CODE,a as NETWORK_CHECK_MESSAGE,l as NETWORK_CODE,u as OFFLINE_CODE,t as OFFLINE_MESSAGE,o as REQUEST_CANCELED_CODE,c as TIMEOUT_CODE,r as TIMEOUT_MESSAGE,i as UNEXPECTED_MESSAGE,n as UNREACHABLE_MESSAGE,M as extractApiError,T as isApiError,x as toFieldPath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.177.0",
|
|
4
4
|
"description": "Webority shared React component library: App* primitives on react-bootstrap and the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"./src/elements/*.ts"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@webority/markdown-core": "0.
|
|
45
|
-
"@webority/theme": "0.
|
|
46
|
-
"@webority/ui-elements": "0.
|
|
47
|
-
"@webority/web-core": "0.
|
|
44
|
+
"@webority/markdown-core": "0.177.0",
|
|
45
|
+
"@webority/theme": "0.177.0",
|
|
46
|
+
"@webority/ui-elements": "0.177.0",
|
|
47
|
+
"@webority/web-core": "0.177.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@webority/analytics": "^0.
|
|
50
|
+
"@webority/analytics": "^0.43.0",
|
|
51
51
|
"bootstrap": "5.3.9",
|
|
52
52
|
"react": "^19.0.0",
|
|
53
53
|
"react-bootstrap": "^2.10.0",
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"@types/react-dom": "^19.3.0",
|
|
70
70
|
"@vitejs/plugin-react": "^6.0.1",
|
|
71
71
|
"@vitest/coverage-v8": "5.1.0",
|
|
72
|
-
"@webority/analytics": "0.
|
|
73
|
-
"@webority/canvas-kit": "0.
|
|
74
|
-
"@webority/biome-config": "0.
|
|
75
|
-
"@webority/tokens": "0.
|
|
72
|
+
"@webority/analytics": "0.43.0",
|
|
73
|
+
"@webority/canvas-kit": "0.177.0",
|
|
74
|
+
"@webority/biome-config": "0.177.0",
|
|
75
|
+
"@webority/tokens": "0.177.0",
|
|
76
76
|
"bootstrap": "5.3.9",
|
|
77
77
|
"jsdom": "30.1.1",
|
|
78
78
|
"react": "^19.3.1",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"vitest": "5.1.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
|
-
"build": "
|
|
87
|
+
"build": "vite build && node -e \"require('node:fs').cpSync('../elements/dist/pdfjs','dist/pdfjs',{recursive:true})\" && tsc -p tsconfig.build.json && node ../../scripts/inject-meta-docs.mts && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mts analytics",
|
|
88
88
|
"typecheck": "tsc -p tsconfig.json",
|
|
89
89
|
"test": "vitest run",
|
|
90
90
|
"test:watch": "vitest",
|