@webority/ui-react 0.92.0 → 0.94.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 +525 -460
- package/dist/canvas-kit/manifest.json +19 -3
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppCompareTable.js +1 -1
- package/dist/components/AppKanban.js +1 -1
- package/dist/components/AppNumberInput.js +1 -1
- package/dist/components/AppSectionHero.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/lib/sectionShell.js +1 -1
- package/dist/lib/shellCookie.js +1 -1
- package/dist/types/components/AppNumberInput.d.ts +3 -3
- package/dist/types/components/AppSectionHero.d.ts +3 -0
- package/dist/types/components/AppSelect.d.ts +2 -2
- package/dist/types/lib/sectionShell.d.ts +3 -1
- package/dist/types/lib/shellCookie.d.ts +2 -2
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.94.0"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 7,
|
|
8
8
|
"platform": "Web",
|
|
@@ -12699,7 +12699,8 @@
|
|
|
12699
12699
|
"name": "value",
|
|
12700
12700
|
"type": "number",
|
|
12701
12701
|
"required": false,
|
|
12702
|
-
"
|
|
12702
|
+
"nullable": true,
|
|
12703
|
+
"description": "The current number; null or unset for an empty field."
|
|
12703
12704
|
}
|
|
12704
12705
|
],
|
|
12705
12706
|
"itemsTakeAction": [],
|
|
@@ -16590,6 +16591,20 @@
|
|
|
16590
16591
|
"required": false,
|
|
16591
16592
|
"description": "A short label above the heading: any node, including a styled container drawn as a pill."
|
|
16592
16593
|
},
|
|
16594
|
+
{
|
|
16595
|
+
"name": "eyebrowTone",
|
|
16596
|
+
"type": "enum",
|
|
16597
|
+
"enum": [
|
|
16598
|
+
"danger",
|
|
16599
|
+
"info",
|
|
16600
|
+
"neutral",
|
|
16601
|
+
"primary",
|
|
16602
|
+
"success",
|
|
16603
|
+
"warning"
|
|
16604
|
+
],
|
|
16605
|
+
"required": false,
|
|
16606
|
+
"description": "Draws the eyebrow as a pill in this tone; unset keeps plain text."
|
|
16607
|
+
},
|
|
16593
16608
|
{
|
|
16594
16609
|
"name": "media",
|
|
16595
16610
|
"type": "node",
|
|
@@ -17260,11 +17275,12 @@
|
|
|
17260
17275
|
"name": "floatingLabel",
|
|
17261
17276
|
"type": "enum",
|
|
17262
17277
|
"enum": [
|
|
17278
|
+
"above",
|
|
17263
17279
|
"border",
|
|
17264
17280
|
"off"
|
|
17265
17281
|
],
|
|
17266
17282
|
"required": false,
|
|
17267
|
-
"description": "Where the label rests. Off keeps it above the control. Border sits the label inside as a placeholder, then slides it onto the top border on focus or once a value is chosen. Needs label.",
|
|
17283
|
+
"description": "Where the label rests. Off keeps it above the control. Border sits the label inside as a placeholder, then slides it onto the top border on focus or once a value is chosen. Above rests it above the box, clear of the border. Needs label.",
|
|
17268
17284
|
"default": "off"
|
|
17269
17285
|
},
|
|
17270
17286
|
{
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"platform": "Web",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 7,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/ui-react",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.94.0"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "db29d8a4856ad6c367007fecfd804c308c06bda38fd2a05eb158a667350aa516",
|
|
14
|
+
"bytes": 834608
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "a8ec68f3827a35d3073d65c2624b88d9e3bf937ddfea2eeda3e2f5082f16c5e9",
|
|
18
|
+
"bytes": 10845132
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{columns:o
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{columns:o,rows:s,caption:c,className:l=``,...u}=a;if(!Array.isArray(o))throw Error(`<AppCompareTable> columns is required: pass the feature-name column, then one per option.`);if(!Array.isArray(s))throw Error(`<AppCompareTable> rows is required: pass one row per capability.`);t(`AppCompareTable`,u);let d=e=>e===!0?r(`span`,{className:`compare-yes`,children:r(n,{name:`check`,size:16})}):e===!1?r(`span`,{className:`compare-no`,children:`-`}):e;return r(`div`,{className:`compare-table${l?` ${l}`:``}`,...e(`AppCompareTable`,a),...u,children:i(`table`,{children:[c&&r(`caption`,{className:`visually-hidden`,children:c}),r(`thead`,{children:r(`tr`,{children:o.map((e,t)=>r(`th`,{scope:`col`,className:e.highlight?`is-highlight`:void 0,children:e.label},e.label?`col-${t}-${e.label}`:`col-${t}`))})}),r(`tbody`,{children:s.map((e,t)=>i(`tr`,{children:[r(`th`,{scope:`row`,children:e.label}),e.values.map((e,t)=>r(`td`,{className:o[t+1]?.highlight?`is-highlight`:void 0,children:d(e)},o[t+1]?.label??t))]},e.key??`${e.label}-${t}`))})]})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{errorToast as i}from"./toast.js";import{formatValue as a}from"@webority/ui-elements/helpers";import{useEffect as o,useId as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{KANBAN_SUMMARY_FORMATS as p,KANBAN_TEXT as m,KANBAN_TONES as h,kanbanOverflow as g,kanbanSummaryFormat as _,kanbanVisibleLimit as v,sumKanbanValues as ee}from"@webority/ui-elements/elements/kanban";var te=e=>e.key??e.id,ne=e=>e.column,y=[`rupees`,`paise`],re=[`inline`,`stacked`];function b(b){let{columns:x
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{errorToast as i}from"./toast.js";import{formatValue as a}from"@webority/ui-elements/helpers";import{useEffect as o,useId as s,useMemo as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{KANBAN_SUMMARY_FORMATS as p,KANBAN_TEXT as m,KANBAN_TONES as h,kanbanOverflow as g,kanbanSummaryFormat as _,kanbanVisibleLimit as v,sumKanbanValues as ee}from"@webority/ui-elements/elements/kanban";var te=e=>e.key??e.id,ne=e=>e.column,y=[`rupees`,`paise`],re=[`inline`,`stacked`];function b(b){let{columns:x,cards:S,renderCard:ie,renderColumnActions:ae,getCardKey:C=te,getCardColumn:w=ne,getCardValue:T,cardLabel:E,isCardLocked:D,onLocked:O,onMove:k,accept:A,filter:j,boardId:oe,ariaLabel:se=`Board`,emptyText:ce=m.empty,readOnly:le=!1,swipeHint:ue=!1,fill:M=!1,columnWidth:N,fillOffset:P,activeCardKey:F,headLayout:I=`inline`,summaryFormat:L,summaryUnit:R,className:z=``,id:B,...V}=b;if(!Array.isArray(x))throw Error(`<AppKanban> columns is required: pass the board's stage columns.`);if(!Array.isArray(S))throw Error(`<AppKanban> cards is required: pass the cards, an empty array for an empty board.`);n(`AppKanban`,V),t(`AppKanban`,`summaryFormat`,L,p),t(`AppKanban`,`summaryUnit`,R,y),t(`AppKanban`,`headLayout`,I,re);for(let e of x)t(`AppKanban`,`columns[].tone`,e.tone,h);let H=s(),U=B||`kanban-${H.replace(/[^a-zA-Z0-9_-]/g,``)}`,W=l(null),[G,K]=u(()=>new Map),[q,de]=u(()=>new Set),[fe,J]=u(()=>new Set),pe=c(()=>new Map(S.map(e=>[String(C(e)),e])),[S,C]),Y=l(null);Y.current={accept:A,onMove:k,onLocked:O,byKey:pe,columns:x};let X=L&&p.includes(L)&&(R==null||y.includes(R))?_(L,R):null,Z=c(()=>{let e=new Map(x.map(e=>[e.key,[]])),t=[];for(let n of S){let r=String(C(n)),i=G.get(r);i?t.push([n,i]):e.get(w(n))?.push(n)}for(let[n,r]of t){let t=e.get(r.to);t&&t.splice(Math.min(r.index,t.length),0,n)}return e},[x,S,G,C,w]);o(()=>{let e=W.current;if(!e)return;e.accept=(e,t,n)=>{let r=Y.current.accept;return!r||r(Y.current.byKey.get(e.getAttribute(`data-wui-card`)),t,n)};let t=e=>{let{key:t,from:n,to:r,index:a}=e.detail,o=Y.current.onMove,s=Y.current.byKey.get(t);if(!o||!s)return;let c=Y.current.columns.find(e=>e.key===r)?.visibleLimit!=null;c&&J(e=>new Set(e).add(t)),K(e=>new Map(e).set(t,{to:r,index:a}));let l=()=>K(e=>{let n=new Map(e);return n.delete(t),n}),u;try{u=o({card:s,key:t,from:n,to:r,index:a})}catch(e){u=Promise.reject(e)}Promise.resolve(u).then(l,e=>{l(),c&&J(e=>{let n=new Set(e);return n.delete(t),n}),i(e?.message||m.failed.server)})},n=e=>{let{key:t,reason:n}=e.detail,r=Y.current.byKey.get(t);r&&Y.current.onLocked?.({card:r,key:t,reason:n})};return e.addEventListener(`wui:kanban:move`,t),e.addEventListener(`wui:kanban:locked`,n),()=>{e.removeEventListener(`wui:kanban:move`,t),e.removeEventListener(`wui:kanban:locked`,n),e.accept=void 0}},[]);let Q=e=>!j||j(e)!==!1,me=(e,t)=>{q.has(e)&&J(e=>{let n=new Set(e);for(let e of t)n.delete(String(C(e)));return n}),de(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},$={};return N!=null&&($[`--wui-kanban-column-width`]=`${N}px`),P!=null&&($[`--wui-kanban-fill-offset`]=`${P}px`),f(`wui-kanban`,{ref:W,id:U,class:z?`wui-kanban ${z}`:`wui-kanban`,role:`region`,"aria-label":se,"board-id":oe||void 0,"summary-format":X?L:void 0,"summary-unit":X&&R?R:void 0,readonly:le?``:void 0,fill:M?``:void 0,"data-head-layout":I===`stacked`?`stacked`:void 0,style:$,controlled:``,...e(`AppKanban`,b),...V,children:[d(`nav`,{className:`wui-kanban-switcher`,"aria-label":`Board columns`,children:x.map((e,t)=>f(`button`,{type:`button`,className:`wui-kanban-switch`,"data-wui-switch":e.key,"aria-controls":`${U}-${e.key}`,"aria-current":t===0?`true`:void 0,children:[d(`span`,{className:`wui-kanban-switch-title`,children:e.title}),d(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:(Z.get(e.key)||[]).filter(Q).length})]},e.key))}),ue&&f(`p`,{className:`wui-kanban-hint`,"aria-hidden":`true`,children:[d(r,{name:`arrow-swap-horizontal`,size:14}),m.swipeHint]}),d(`div`,{className:`wui-kanban-board`,"data-wui-scroller":``,children:x.map(e=>{let t=`${U}-${e.key}`,n=Z.get(e.key)||[],i=n.filter(Q),o=!!(e.collapsible&&e.collapsed),s=v(e.visibleLimit),c=q.has(e.key),l=g(i.map(e=>String(C(e))),s,c,fe),u=typeof e.summary==`function`?e.summary(i):e.summary;X&&(u=a(ee(i.map(e=>T?.(e))),X));let p=ae?.(e,i);return f(`section`,{className:`wui-kanban-column`,id:t,"data-wui-column":e.key,"data-tone":e.tone&&h.includes(e.tone)?e.tone:`neutral`,"aria-labelledby":`${t}-title`,"data-accept-from":e.acceptFrom?e.acceptFrom.join(` `):void 0,"data-collapsible":e.collapsible?``:void 0,"data-collapsed":o?``:void 0,children:[f(`header`,{className:`wui-kanban-head`,children:[d(`span`,{className:`wui-kanban-dot`,"aria-hidden":`true`}),d(`h2`,{className:`wui-kanban-title`,id:`${t}-title`,children:e.href?d(`a`,{href:e.href,children:e.title}):e.title}),d(`span`,{className:`wui-kanban-count`,"data-wui-count":``,children:i.length}),e.collapsible&&d(`span`,{className:`wui-kanban-lock`,"aria-hidden":`true`,children:d(r,{name:`lock`,size:14})}),p!=null&&p!==!1&&d(`div`,{className:`wui-kanban-actions`,"data-wui-no-drag":``,children:p}),e.collapsible&&d(`button`,{type:`button`,className:`wui-kanban-collapse`,"data-wui-collapse":``,"aria-expanded":o?`false`:`true`,"aria-controls":`${t}-body`,"aria-label":o?m.expand(e.title):m.collapse(e.title),children:d(r,{name:`chevron-left`,size:16})}),u!=null&&d(`div`,{className:`wui-kanban-summary`,"data-wui-summary":``,children:u})]}),d(`p`,{className:`wui-kanban-drop-note`,"data-wui-drop-note":``,hidden:!0}),d(`div`,{className:`wui-kanban-body`,id:`${t}-body`,"data-wui-body":``,children:n.map(e=>{let t=String(C(e)),n=G.has(t);return d(`article`,{className:`wui-kanban-card`,"data-wui-card":t,tabIndex:0,"aria-label":E?E(e):void 0,"data-wui-locked":D?.(e)?``:void 0,"data-wui-value":T?T(e)??void 0:void 0,"aria-current":F!=null&&t===String(F)?`true`:void 0,"aria-busy":n?`true`:void 0,"data-wui-saving":n?``:void 0,"data-wui-overflow":l.has(t)?``:void 0,hidden:!Q(e),children:ie?.(e)},t)})}),s!=null&&d(`button`,{type:`button`,className:`wui-kanban-more`,"data-wui-more":``,"aria-controls":`${t}-body`,"aria-expanded":c?`true`:`false`,hidden:c?i.length<=s:l.size===0,onClick:()=>me(e.key,n),children:c?m.fewer:m.more(l.size)}),d(`p`,{className:`wui-kanban-empty`,"data-wui-empty":``,hidden:i.length>0,children:e.emptyText??ce})]},e.key)})}),d(`p`,{className:`visually-hidden`,id:`${U}-help`,"data-wui-help":``,children:m.help}),d(`div`,{className:`visually-hidden`,"data-wui-live":``,"aria-live":`polite`,"aria-atomic":`true`})]})}export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"../lib/FieldMessage.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import{forwardRef as s,useEffect as c,useId as l,useState as u}from"react";import{Form as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=e=>{if(e===``||e===null)return null;let t=parseFloat(e);return Number.isNaN(t)?null:t},g=(e,t)=>t>0&&Number.isFinite(e)?e.toFixed(t):String(e??``),_=s(function(s,_){let{label:v,required:y=!1,error:b,hint:x,help:S,helpLabel:C=`More information`,value:w,onChange:T,min:E,max:D,step:O=1,precision:k=0,unit:A,size:j=`md`,id:M,name:N,className:P=``,fieldClassName:F=``,disabled:I=!1,"data-canvas":ee,...L}=s;n(`AppNumberInput`,L),t(`AppNumberInput`,`size`,j,m);let R=l(),z=M||R,B=e=>{if(k===0)return Math.round(e);let t=10**k;return Math.round(e*t)/t},V=e=>{let t=e;return typeof E==`number`&&(t=Math.max(t,E)),typeof D==`number`&&(t=Math.min(t,D)),t},H=e=>g(e,k),[U,W]=u(()=>H(w));c(()=>{W(e=>h(e)===(w
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import i from"../lib/FieldMessage.js";import a from"./AppInfoTip.js";import o from"./AppRequiredMark.js";import{forwardRef as s,useEffect as c,useId as l,useState as u}from"react";import{Form as d}from"react-bootstrap";import{jsx as f,jsxs as p}from"react/jsx-runtime";var m=[`sm`,`md`,`lg`],h=e=>{if(e===``||e===null)return null;let t=parseFloat(e);return Number.isNaN(t)?null:t},g=(e,t)=>t>0&&Number.isFinite(e)?e.toFixed(t):String(e??``),_=s(function(s,_){let{label:v,required:y=!1,error:b,hint:x,help:S,helpLabel:C=`More information`,value:w,onChange:T,min:E,max:D,step:O=1,precision:k=0,unit:A,size:j=`md`,id:M,name:N,className:P=``,fieldClassName:F=``,disabled:I=!1,"data-canvas":ee,...L}=s;n(`AppNumberInput`,L),t(`AppNumberInput`,`size`,j,m);let R=l(),z=M||R,B=e=>{if(k===0)return Math.round(e);let t=10**k;return Math.round(e*t)/t},V=e=>{let t=e;return typeof E==`number`&&(t=Math.max(t,E)),typeof D==`number`&&(t=Math.min(t,D)),t},H=e=>g(e,k),[U,W]=u(()=>H(w));c(()=>{W(e=>h(e)===(w??null)?e:g(w,k))},[w,k]);let G=e=>{let t=(h(U)??V(0))+e*O,n=V(B(t));W(H(n)),T?.(n)},K=h(U),q=I||K!==null&&typeof E==`number`&&K<=E,J=I||K!==null&&typeof D==`number`&&K>=D,Y=b&&z?`${z}-error`:void 0,X=x&&z?`${z}-hint`:void 0,Z=Y||X,Q=[`input`,j===`sm`?`input-sm`:``,j===`lg`?`input-lg`:``,b?`error`:``,`num-input`,P].filter(Boolean).join(` `),$=RegExp(`^${typeof E==`number`&&E>=0?``:`-?`}\\d*${k>0?`(\\.\\d*)?`:``}$`),te=e=>{let t=e.target.value;if(!$.test(t))return;W(t);let n=h(t);n!==null&&T?.(n)},ne=e=>{let t=h(e.target.value);if(t===null)W(``),T?.(null);else{let e=V(B(t));W(H(e)),T?.(e)}L.onBlur?.(e)},re=e=>{e.key===`ArrowUp`?(e.preventDefault(),G(1)):e.key===`ArrowDown`&&(e.preventDefault(),G(-1)),L.onKeyDown?.(e)},ie=f(d.Control,{...L,id:z,name:N,type:`text`,inputMode:k>0?`decimal`:`numeric`,className:Q,disabled:I,required:y,"aria-invalid":b?`true`:`false`,"aria-describedby":Z,value:U,ref:_,onChange:te,onBlur:ne,onKeyDown:re}),ae=p(`div`,{className:[`num-wrap`,j===`sm`?`num-wrap-sm`:``,j===`lg`?`num-wrap-lg`:``].filter(Boolean).join(` `),children:[f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Decrease`,tabIndex:-1,disabled:q,onClick:()=>G(-1),children:f(r,{name:`minus`,size:16})}),ie,A&&f(`span`,{className:`affix`,children:A}),f(`button`,{type:`button`,className:`num-btn`,"aria-label":`Increase`,tabIndex:-1,disabled:J,onClick:()=>G(1),children:f(r,{name:`plus`,size:16})})]});return p(d.Group,{...e(`AppNumberInput`,s),className:`field${F?` ${F}`:``}`,children:[v&&p(d.Label,{className:`label`,htmlFor:z,children:[v,y&&f(o,{}),S&&f(a,{label:C,children:S})]}),ae,f(i,{error:b,hint:x,errorId:Y,hintId:X})]})});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r,{SECTION_ALIGNS as i,
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r,{SECTION_ALIGNS as i,SECTION_EYEBROW_TONES as a,SECTION_HEADINGS as o,SECTION_VARIANTS as s,sectionHeading as c}from"../lib/sectionShell.js";import{jsx as l}from"react/jsx-runtime";function u(u){let{title:d,as:f=`h1`,eyebrow:p,subtitle:m,align:h=`start`,variant:g=`default`,eyebrowTone:_,actions:v,media:y,className:b=``,...x}=u;return n(`AppSectionHero`,x),t(`AppSectionHero`,`as`,f,o),t(`AppSectionHero`,`align`,h,i),t(`AppSectionHero`,`variant`,g,s),_!==void 0&&t(`AppSectionHero`,`eyebrowTone`,_,a),l(r,{component:`AppSectionHero`,kind:`hero`,title:d,as:c(f,`h1`),eyebrow:p,subtitle:m,align:h,variant:g,eyebrowTone:_,actions:v,className:b,rest:{...e(`AppSectionHero`,u),...x},children:y!=null&&y!==!1&&l(`div`,{className:`wui-section-media`,children:y})})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import ee from"../lib/FieldMessage.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import{forwardRef as s,useId as ne,useLayoutEffect as re,useRef as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var f=[`sm`,`lg`,`xl`],p=[`off`,`border`],m=(e,t)=>({value:e.value,label:t,icon:e.icon}),h=s(function(s,h){let{value:g,onChange:_,options:v=[],placeholder:y=`Select...`,searchPlaceholder:ie=`Search...`,searchable:ae=!1,clearable:oe=!1,size:b,icon:se,prefix:x,suffix:S,floatingLabel:C=`off`,disabled:w,label:T,required:E=!1,error:D,hint:O,help:k,helpLabel:A=`More information`,id:j,name:M,className:N=``,fieldClassName:P=``,"aria-label":F,"aria-labelledby":I,"aria-describedby":L,"data-canvas":ce,...R}=s;n(`AppSelect`,R),t(`AppSelect`,`size`,b,f),t(`AppSelect`,`floatingLabel`,C,p);let z=ne(),{setRef:B,innerRef:V}=a({ref:h,value:g??``,onChange:_}),{portal:H,toElementOptions:U}=te(v),W=c({el:null,options:null,map:null});re(()=>{let e=V.current;if(!e||W.current.el===e&&W.current.options===v&&W.current.map===U)return;W.current={el:e,options:v,map:U};let t=U(v,m);o(t,e.options)||(e.options=t)});let G=j||z,K=C!==`off`&&T,q=D&&G?`${G}-error`:void 0,J=O&&G?`${G}-hint`:void 0,le=q||J||L,Y=!K&&(x!=null||S!=null),X=!T&&!D&&!O,Z=e(`AppSelect`,s),Q=d(l,{children:[u(`wui-select`,{"aria-label":F||(typeof T==`string`?T:void 0),"aria-labelledby":I||void 0,"aria-describedby":le||void 0,"aria-invalid":D?`true`:void 0,ref:B,value:g||void 0,id:G,name:M,placeholder:C!==`off`&&T?` `:y,"search-placeholder":ie,searchable:ae?``:void 0,clearable:oe?``:void 0,size:b||void 0,icon:se||void 0,disabled:w?``:void 0,required:E?``:void 0,className:N||void 0,...X&&!Y?Z:null,...R}),H]}),$=Y?d(`div`,{...X?Z:null,className:`input-affixed`,children:[x!=null&&u(`span`,{className:`affix affix-pre`,children:x}),Q,S!=null&&u(`span`,{className:`affix affix-suf`,children:S})]}):Q;if(X)return $;let ue=[`field`,P].filter(Boolean).join(` `);return d(`div`,{...Z,className:ue,children:[T&&!K&&d(`label`,{className:`label`,htmlFor:G,children:[T,E&&u(i,{}),k&&u(r,{label:A,children:k})]}),K?d(`div`,{className
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import ee from"../lib/FieldMessage.js";import r from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import a,{optionsEqual as o}from"./useWuiControl.js";import{forwardRef as s,useId as ne,useLayoutEffect as re,useRef as c}from"react";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var f=[`sm`,`lg`,`xl`],p=[`off`,`border`,`above`],m=(e,t)=>({value:e.value,label:t,icon:e.icon}),h=s(function(s,h){let{value:g,onChange:_,options:v=[],placeholder:y=`Select...`,searchPlaceholder:ie=`Search...`,searchable:ae=!1,clearable:oe=!1,size:b,icon:se,prefix:x,suffix:S,floatingLabel:C=`off`,disabled:w,label:T,required:E=!1,error:D,hint:O,help:k,helpLabel:A=`More information`,id:j,name:M,className:N=``,fieldClassName:P=``,"aria-label":F,"aria-labelledby":I,"aria-describedby":L,"data-canvas":ce,...R}=s;n(`AppSelect`,R),t(`AppSelect`,`size`,b,f),t(`AppSelect`,`floatingLabel`,C,p);let z=ne(),{setRef:B,innerRef:V}=a({ref:h,value:g??``,onChange:_}),{portal:H,toElementOptions:U}=te(v),W=c({el:null,options:null,map:null});re(()=>{let e=V.current;if(!e||W.current.el===e&&W.current.options===v&&W.current.map===U)return;W.current={el:e,options:v,map:U};let t=U(v,m);o(t,e.options)||(e.options=t)});let G=j||z,K=C!==`off`&&T,q=D&&G?`${G}-error`:void 0,J=O&&G?`${G}-hint`:void 0,le=q||J||L,Y=!K&&(x!=null||S!=null),X=!T&&!D&&!O,Z=e(`AppSelect`,s),Q=d(l,{children:[u(`wui-select`,{"aria-label":F||(typeof T==`string`?T:void 0),"aria-labelledby":I||void 0,"aria-describedby":le||void 0,"aria-invalid":D?`true`:void 0,ref:B,value:g||void 0,id:G,name:M,placeholder:C!==`off`&&T?` `:y,"search-placeholder":ie,searchable:ae?``:void 0,clearable:oe?``:void 0,size:b||void 0,icon:se||void 0,disabled:w?``:void 0,required:E?``:void 0,className:N||void 0,...X&&!Y?Z:null,...R}),H]}),$=Y?d(`div`,{...X?Z:null,className:`input-affixed`,children:[x!=null&&u(`span`,{className:`affix affix-pre`,children:x}),Q,S!=null&&u(`span`,{className:`affix affix-suf`,children:S})]}):Q;if(X)return $;let ue=[`field`,P].filter(Boolean).join(` `);return d(`div`,{...Z,className:ue,children:[T&&!K&&d(`label`,{className:`label`,htmlFor:G,children:[T,E&&u(i,{}),k&&u(r,{label:A,children:k})]}),K?d(`div`,{className:C===`above`?`field-float wui-float-above`:`field-float`,children:[Q,d(`label`,{className:`float-label`,htmlFor:G,children:[T,E&&u(i,{})]})]}):$,u(ee,{error:D,hint:O,errorId:q,hintId:J})]})});export{h as default};
|
package/dist/guidance.json
CHANGED
package/dist/lib/sectionShell.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";var n=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],r=[`start`,`center`],i=[`default`,`muted`];function
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";var n=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],r=[`start`,`center`],i=[`default`,`muted`],a=[`neutral`,`primary`,`success`,`warning`,`danger`,`info`];function o(e,t){return n.includes(e)?e:t}function s(e){return n[Math.min(n.indexOf(e)+1,5)]}function c({className:t,src:n,alt:r,width:i,height:a}){return e(`img`,{className:t,src:n,alt:r,width:i,height:a,loading:`lazy`,decoding:`async`})}function l({component:n,kind:r,title:i,as:o,eyebrow:s,subtitle:c,align:l,variant:u,eyebrowTone:d,actions:f,extraClass:p,className:m,rest:h,children:g}){if(i==null||i===``)throw Error(`${n} needs a title: every section opens with its heading.`);let _=o,v=h.id?`${h.id}-title`:void 0,y=a.includes(d);return e(`section`,{className:[`wui-section`,`wui-section-${r}`,l===`center`?`wui-section-center`:``,u===`muted`?`wui-section-muted`:``,p,m].filter(Boolean).join(` `),"aria-labelledby":v,...h,children:t(`div`,{className:`wui-section-inner`,children:[t(`div`,{className:`wui-section-head`,children:[s!=null&&s!==``&&e(`div`,{className:y?`wui-section-eyebrow wui-section-eyebrow-pill wui-section-eyebrow-${d}`:`wui-section-eyebrow`,children:s}),e(_,{className:`wui-section-title`,id:v,children:i}),c!=null&&c!==``&&e(`p`,{className:`wui-section-subtitle`,children:c}),f!=null&&f!==!1&&e(`div`,{className:`wui-section-actions`,children:f})]}),g]})})}export{r as SECTION_ALIGNS,a as SECTION_EYEBROW_TONES,n as SECTION_HEADINGS,i as SECTION_VARIANTS,c as SectionImage,l as default,s as itemHeading,o as sectionHeading};
|
package/dist/lib/shellCookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`wui-shell-collapsed`;function
|
|
1
|
+
var e=`wui-shell-collapsed`,t=e=>e instanceof DOMException&&e.name===`SecurityError`;function n(n=e,r=document){let i;try{i=r.cookie}catch(e){if(t(e))return null;throw e}for(let e of i.split(`;`)){let t=e.indexOf(`=`);if(t<0||e.slice(0,t).trim()!==n)continue;let r=e.slice(t+1).trim();return r===`1`||r!==`0`&&null}return null}function r(n,r=e,i=document){try{i.cookie=`${r}=${n?`1`:`0`}; Path=/; Max-Age=31536000; SameSite=Lax`}catch(e){if(!t(e))throw e}}export{e as SHELL_COLLAPSED_COOKIE,n as readShellCollapsed,r as writeShellCollapsed};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const AppNumberInput: import("react").ForwardRefExoticComponent<{
|
|
2
|
-
/** The current number
|
|
3
|
-
value?: number;
|
|
4
|
-
onChange?: (next: number |
|
|
2
|
+
/** The current number; null or unset for an empty field. */
|
|
3
|
+
value?: number | null;
|
|
4
|
+
onChange?: (next: number | null) => void;
|
|
5
5
|
/** The label above the field. A required field shows a required mark after it. */
|
|
6
6
|
label?: import('react').ReactNode;
|
|
7
7
|
/**
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @param {import('react').ReactNode} [props.subtitle]
|
|
16
16
|
* @param {"start"|"center"} [props.align]
|
|
17
17
|
* @param {"default"|"muted"} [props.variant]
|
|
18
|
+
* @param {"neutral"|"primary"|"success"|"warning"|"danger"|"info"} [props.eyebrowTone] Draws the eyebrow as a pill in this tone; unset keeps plain text.
|
|
18
19
|
* @param {import('react').ReactNode} [props.actions]
|
|
19
20
|
* @param {import('react').ReactNode} [props.media]
|
|
20
21
|
* @param {string} [props.className]
|
|
@@ -41,6 +42,8 @@ export default function AppSectionHero(props: {
|
|
|
41
42
|
* @default "default"
|
|
42
43
|
*/
|
|
43
44
|
variant?: "default" | "muted";
|
|
45
|
+
/** Draws the eyebrow as a pill in this tone; unset keeps plain text. */
|
|
46
|
+
eyebrowTone?: "neutral" | "primary" | "success" | "warning" | "danger" | "info";
|
|
44
47
|
/** The calls to action, usually one or two `AppButton`s. */
|
|
45
48
|
actions?: import('react').ReactNode;
|
|
46
49
|
/** An `<img>` with `width` and `height`, beside the copy. */
|
|
@@ -52,10 +52,10 @@ declare const AppSelect: import("react").ForwardRefExoticComponent<{
|
|
|
52
52
|
/** Icon name shown in the control. */
|
|
53
53
|
icon?: string;
|
|
54
54
|
/**
|
|
55
|
-
* Where the label rests. Off keeps it above the control. Border sits the label inside as a placeholder, then slides it onto the top border on focus or once a value is chosen. Needs label.
|
|
55
|
+
* Where the label rests. Off keeps it above the control. Border sits the label inside as a placeholder, then slides it onto the top border on focus or once a value is chosen. Above rests it above the box, clear of the border. Needs label.
|
|
56
56
|
* @default "off"
|
|
57
57
|
*/
|
|
58
|
-
floatingLabel?: "off" | "border";
|
|
58
|
+
floatingLabel?: "off" | "border" | "above";
|
|
59
59
|
/** Disables the control. */
|
|
60
60
|
disabled?: boolean;
|
|
61
61
|
/** The visible field label. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const SECTION_HEADINGS: string[];
|
|
2
2
|
export declare const SECTION_ALIGNS: string[];
|
|
3
3
|
export declare const SECTION_VARIANTS: string[];
|
|
4
|
+
export declare const SECTION_EYEBROW_TONES: string[];
|
|
4
5
|
/** The heading tag for the section title: `as` when it is a heading, otherwise the section's default. */
|
|
5
6
|
export declare function sectionHeading(as: any, fallback: any): any;
|
|
6
7
|
/** The level under a section title, for an item's title (h2 gives h3; h6 stays h6). */
|
|
@@ -26,7 +27,7 @@ export declare function SectionImage({ className, src, alt, width, height }: {
|
|
|
26
27
|
* a generated one would differ from Razor's on every render.
|
|
27
28
|
* @internal not exported from the package barrel
|
|
28
29
|
*/
|
|
29
|
-
export default function SectionShell({ component, kind, title, as, eyebrow, subtitle, align, variant, actions, extraClass, className, rest, children, }: {
|
|
30
|
+
export default function SectionShell({ component, kind, title, as, eyebrow, subtitle, align, variant, eyebrowTone, actions, extraClass, className, rest, children, }: {
|
|
30
31
|
actions: any;
|
|
31
32
|
align: any;
|
|
32
33
|
as: any;
|
|
@@ -35,6 +36,7 @@ export default function SectionShell({ component, kind, title, as, eyebrow, subt
|
|
|
35
36
|
component: any;
|
|
36
37
|
extraClass: any;
|
|
37
38
|
eyebrow: any;
|
|
39
|
+
eyebrowTone: any;
|
|
38
40
|
kind: any;
|
|
39
41
|
rest: any;
|
|
40
42
|
subtitle: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Default cookie name (AppShellTagHelper.CollapsedCookie). */
|
|
2
2
|
export declare const SHELL_COLLAPSED_COOKIE = "wui-shell-collapsed";
|
|
3
|
-
/** true / false from the cookie ("1" / "0"), or null when it is absent
|
|
3
|
+
/** true / false from the cookie ("1" / "0"), or null when it is absent, holds anything else or cannot be read. */
|
|
4
4
|
export declare function readShellCollapsed(name?: string, doc?: Document): boolean;
|
|
5
|
-
/** Remember the rail state for a year, site-wide. */
|
|
5
|
+
/** Remember the rail state for a year, site-wide; a frame without cookie access remembers nothing. */
|
|
6
6
|
export declare function writeShellCollapsed(collapsed: any, name?: string, doc?: Document): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.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",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/theme": "0.
|
|
33
|
-
"@webority/ui-elements": "0.
|
|
32
|
+
"@webority/theme": "0.94.0",
|
|
33
|
+
"@webority/ui-elements": "0.94.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@webority/analytics": "^0.26.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"typescript": "^7.0.2",
|
|
57
57
|
"vite": "^8.0.12",
|
|
58
58
|
"vitest": "5.0.1",
|
|
59
|
-
"@webority/
|
|
60
|
-
"@webority/
|
|
59
|
+
"@webority/tokens": "0.94.0",
|
|
60
|
+
"@webority/canvas-kit": "0.94.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && 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.mjs analytics",
|