@ilo-org/react 0.28.4 → 0.28.6
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/lib/cjs/_store/Logo-entry-BtBNFSSE.js +1 -0
- package/lib/cjs/_store/NumberPicker-chunk-ho5F2J60.js +1 -0
- package/lib/cjs/_store/{NumberPicker-entry-z9i-7tAg.js → NumberPicker-entry-WRcxS34e.js} +1 -1
- package/lib/cjs/_store/{components-entry-BybNCccy.js → components-entry-CYrq8K46.js} +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/_store/Logo-entry-CNT0VLHB.js +121 -0
- package/lib/esm/_store/{NumberPicker-chunk-DGfBEswe.js → NumberPicker-chunk-Dnzrt8V_.js} +18 -16
- package/lib/esm/_store/NumberPicker-entry-DRUpQKat.js +4 -0
- package/lib/esm/_store/{components-entry-BY0r4sij.js → components-entry-sM7klP51.js} +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/types/components/NumberPicker/NumberPicker.props.d.ts +4 -0
- package/package.json +3 -2
- package/lib/cjs/_store/Logo-entry-nsoJtWSa.js +0 -1
- package/lib/cjs/_store/NumberPicker-chunk-CTlAxdIK.js +0 -1
- package/lib/esm/_store/Logo-entry-CYL-mIHC.js +0 -121
- package/lib/esm/_store/NumberPicker-entry-BYmb-h1Z.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),t=require("react"),A=require("./useGlobalSettings-chunk-Cd48T6lS.js"),p=require("./index-chunk-Cxg31gtu.js"),D=({clientHeight:e,clientWidth:r,scrollHeight:n,scrollWidth:o})=>n>e||o>r,J=(e,{maxSize:r=600,startingHeight:n=9,step:o=.5})=>{let s=n,c=!1;for(;!c&&s<r;)e.style.fontSize=`${s}px`,e.style.lineHeight=`${s}px`,c=D(e),c||(s=s+o);return e.style.fontSize="",e.style.lineHeight="",s-o},H=({baseClass:e,className:r,subbrand:n,alt:o,src:s,style:c,size:f="fluid",theme:l="light",...$})=>{const g=t.useRef(null),S=t.useRef(null),L=t.useRef(null),a=t.useRef(null),j=t.useRef(0),v=t.useRef(0),[d,N]=t.useState(!1),[z,k]=t.useState(0),[y,w]=t.useState(0),[E,q]=t.useState(!n),I=t.useRef(new ResizeObserver(i=>{const{height:m}=i[0].contentRect,R=Math.round(m*10)/10;a.current||(a.current=R),Math.abs(R-j.current)>=.1&&(j.current=R,k(R))}));t.useEffect(()=>{n&&d&&y&&q(!0)},[d,y,n]),t.useLayoutEffect(()=>{if(d&&S.current&&g.current){const i=g.current;return I.current.observe(i),()=>I.current.unobserve(i)}},[d]),t.useLayoutEffect(()=>{b()},[d,a.current]),t.useLayoutEffect(()=>{b()},[n]);function b(){if(S.current&&L.current&&a.current){const m=J(S.current,{maxSize:a.current})/a.current;Math.abs(m-v.current)>=.001&&(v.current=m,w(m))}}function B(){N(!0)}const h=!!n,F=f==="fluid",M=!F&&typeof f=="number",x=`${e}--sub-brand`,O=`${e}--size--fluid`,W=`${e}--visibility--hidden`,C=p.classNames(e,r,`${e}--theme--${l}`,{[W]:!E,[O]:F,[x]:h}),G=`${e}--image`,T=`${x}--image`,V=()=>{const i={};return h&&(i["--logo-image-height"]=`${z}px`,i["--logo-font-size"]=`${y*z}px`),M&&(i.width=`${f}px`),{...c,...i}},P=()=>typeof s=="string"?s:s[l];return u.jsxs("figure",{className:C,style:V(),children:[u.jsx("img",{ref:g,alt:o,src:P(),className:p.classNames({[T]:h,[G]:!h}),onLoad:B,...$}),h&&u.jsxs("div",{ref:S,className:`${x}--lock-up`,children:[u.jsx("span",{className:`${x}--lock-up--separator`}),u.jsx("span",{ref:L,children:n})]})]})},K=({className:e,url:r,target:n,style:o,size:s,...c})=>{const{prefix:f}=A.useGlobalSettings(),l=`${f}--logo`,$=`${l}--link`,g=`${l}--size--fluid`;return r?u.jsx("a",{href:r,target:n,className:p.classNames($,e,{[g]:s==="fluid"}),style:o,children:u.jsx(H,{...c,baseClass:l,size:s})}):u.jsx(H,{baseClass:l,className:e,style:o,size:s,...c})};exports.Logo=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),l=require("react"),g=require("./index-chunk-Cxg31gtu.js"),p=require("./useGlobalSettings-chunk-Cd48T6lS.js"),u=require("./FormControl-chunk-bBkCVOW6.js"),F=l.forwardRef(({onChange:e,onBlur:n,disabled:s=!1,error:o,id:t,name:r,placeholder:c,required:m,max:b,min:d,step:f,value:C},x)=>{const{prefix:a}=p.useGlobalSettings(),y=u.useFormControl(),{ariaDescribedBy:N}=y,k=`${a}--input`,q=`${a}--numberpicker`,h=!s&&!!o,j=g.classNames(k,q,{error:h}),P=R=>{e&&e(R)};return i.jsx("input",{value:C,ref:x,id:t||r,name:r,onChange:P,onBlur:n,disabled:s,placeholder:c,required:m,type:"number",className:j,pattern:"[0-9]*",inputMode:"numeric","aria-describedby":N,max:b,min:d,step:f})}),S=l.forwardRef((e,n)=>{const{style:s,inputStyle:o,className:t,...r}=e,c=e.id?e.id:e.name;return i.jsx(u.FormControl,{fieldId:c,style:s,className:t,...r,children:i.jsx(F,{ref:n,style:o,...r})})});exports.LabelledNumberPicker=S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NumberPicker-chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NumberPicker-chunk-ho5F2J60.js");exports.NumberPicker=e.LabelledNumberPicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Accordion-entry-CmEtc6xU.js"),i=require("./Form-chunk-CyfJEjS9.js"),a=require("./Collapse-chunk-ocNUOS_3.js"),n=require("./Empty-chunk-CSXmTnRW.js"),u=require("./Image-chunk-bZyx8E0O.js"),d=require("./Loading-chunk-BAVpKjsu.js"),c=require("./Radio-chunk-C4PweUcm.js"),l=require("./Tag-chunk-RApwQiSR.js"),s=require("./Button-chunk-OmVJkQqc.js"),C=require("./ContextMenu-chunk-Bt4IM9J7.js"),q=require("./Fieldset-chunk-ChHFEwgQ.js"),b=require("./GlobalProvider-chunk-BInwj8Vo.js"),g=require("./GlobalCtx-chunk-D_GlGcgw.js"),r=require("./TextInput.args-chunk-CZIwr5h8.js"),L=require("./Notification-chunk-ZNuM-7Xk.js"),T=require("./ReadMore-chunk-DjPhO-lH.js"),m=require("./Textarea-chunk-yD7hFNC1.js"),p=require("./Callout-chunk-XF2yUV-r.js"),x=require("./FileUpload-chunk-Cs3yHoZ7.js"),P=require("./Heading-chunk-t4FvnOcp.js"),F=require("./Link-chunk-CP7cvvcX.js"),k=require("./NumberPicker-chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Accordion-entry-CmEtc6xU.js"),i=require("./Form-chunk-CyfJEjS9.js"),a=require("./Collapse-chunk-ocNUOS_3.js"),n=require("./Empty-chunk-CSXmTnRW.js"),u=require("./Image-chunk-bZyx8E0O.js"),d=require("./Loading-chunk-BAVpKjsu.js"),c=require("./Radio-chunk-C4PweUcm.js"),l=require("./Tag-chunk-RApwQiSR.js"),s=require("./Button-chunk-OmVJkQqc.js"),C=require("./ContextMenu-chunk-Bt4IM9J7.js"),q=require("./Fieldset-chunk-ChHFEwgQ.js"),b=require("./GlobalProvider-chunk-BInwj8Vo.js"),g=require("./GlobalCtx-chunk-D_GlGcgw.js"),r=require("./TextInput.args-chunk-CZIwr5h8.js"),L=require("./Notification-chunk-ZNuM-7Xk.js"),T=require("./ReadMore-chunk-DjPhO-lH.js"),m=require("./Textarea-chunk-yD7hFNC1.js"),p=require("./Callout-chunk-XF2yUV-r.js"),x=require("./FileUpload-chunk-Cs3yHoZ7.js"),P=require("./Heading-chunk-t4FvnOcp.js"),F=require("./Link-chunk-CP7cvvcX.js"),k=require("./NumberPicker-chunk-ho5F2J60.js"),S=require("./RichText-chunk-vKgvdzZl.js"),M=require("./Tooltip-chunk-DlKiieYX.js"),v=require("./Checkbox-chunk-IcVAXUrv.js"),I=require("./DatePicker-chunk-3IOigKn5.js"),N=require("./Hero-chunk-CDJrCpL6.js"),f=require("./HeroCard-chunk-BO2BICG5.js"),D=require("./LinkList-chunk-CmVHEiqZ.js"),h=require("./Pagination-chunk-mrfIdsCC.js"),G=require("./SearchField-chunk-DtJTqVM9.js"),H=require("./Video-chunk-D9hf1AKM.js"),R=require("./Dropdown-chunk-DmxZPa5u.js"),y=require("./Icon-chunk-DLR0d6ii.js"),A=require("./List-entry-31dXgvRv.js"),B=require("./Profile-chunk-Bnn1-Z78.js"),O=require("./TableOfContents-chunk-CLa_-Dhd.js"),w=require("./Footer-chunk-Dt1p9vMD.js"),e=require("./CardGroup-chunk-Cn8ewunq.js"),E=require("./Breadcrumb-chunk-Bc1WgkRf.js"),U=require("./Status-chunk-CaABjeKb.js"),V=require("./Tabs-chunk-DXWL7rh9.js"),_=require("./AudioPlayer-chunk-B7JUo7j6.js"),j=require("./LanguageToggle-chunk-Dq721sHc.js"),o=require("./MainNav-chunk-DIQJwoJV.js");exports.Accordion=t.Accordion;exports.Form=i.Form;exports.Collapse=a.Collapse;exports.Empty=n.Empty;exports.Image=u.Image;exports.Loading=d.Loading;exports.Radio=c.LabelledRadio;exports.Tag=l.Tag;exports.Button=s.Button;exports.ContextMenu=C.ContextMenu;exports.Fieldset=q.Fieldset;exports.GlobalProvider=b.GlobalProvider;exports.GlobalProviderContext=g.GlobalProviderContext;exports.TextInput=r.LabelledTextInput;exports.TextInputArgs=r.TextInput_args;exports.Notification=L.Notification;exports.ReadMore=T.ReadMore;exports.Textarea=m.LabelledTextarea;exports.Callout=p.Callout;exports.FileUpload=x.LabelledFileUpload;exports.Heading=P.Heading;exports.Link=F.Link;exports.NumberPicker=k.LabelledNumberPicker;exports.RichText=S.RichText;exports.Tooltip=M.Tooltip;exports.Checkbox=v.LabelledCheckbox;exports.DatePicker=I.LabelledDatePicker;exports.Hero=N.Hero;exports.HeroCard=f.HeroCard;exports.LinkList=D.LinkList;exports.Pagination=h.Pagination;exports.SearchField=G.SearchField;exports.Video=H.Video;exports.Dropdown=R.LabelledDropdown;exports.Icon=y.Icon;exports.List=A.List;exports.Profile=B.Profile;exports.TableOfContents=O.TableOfContents;exports.Footer=w.Footer;exports.CardGroup=e.CardGroup;exports.DataCard=e.DataCardCombined;exports.DetailCard=e.DetailCardCombined;exports.FactListCard=e.FactListCardCombined;exports.FeatureCard=e.FeatureCardCombined;exports.MultiLinkCard=e.MultiLinkCardCombined;exports.PromoCard=e.PromoCardCombined;exports.ScoreCard=e.ScoreCardCombined;exports.StatCard=e.StatCardCombined;exports.TextCard=e.TextCardCombined;exports.Breadcrumb=E.Breadcrumb;exports.Status=U.Status;exports.Tabs=V.Tabs;exports.AudioPlayer=_.AudioPlayer;exports.LanguageToggle=j.LanguageToggle;exports.MainNav=o.MainNav;exports.SubsiteNav=o.SubsiteNav;
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./_store/Accordion-entry-CmEtc6xU.js"),a=require("./_store/Form-chunk-CyfJEjS9.js"),n=require("./_store/Collapse-chunk-ocNUOS_3.js"),u=require("./_store/Empty-chunk-CSXmTnRW.js"),s=require("./_store/Image-chunk-bZyx8E0O.js"),c=require("./_store/Loading-chunk-BAVpKjsu.js"),d=require("./_store/Radio-chunk-C4PweUcm.js"),l=require("./_store/Tag-chunk-RApwQiSR.js"),C=require("./_store/Button-chunk-OmVJkQqc.js"),q=require("./_store/ContextMenu-chunk-Bt4IM9J7.js"),b=require("./_store/Fieldset-chunk-ChHFEwgQ.js"),g=require("./_store/GlobalProvider-chunk-BInwj8Vo.js"),T=require("./_store/GlobalCtx-chunk-D_GlGcgw.js"),r=require("./_store/TextInput.args-chunk-CZIwr5h8.js"),p=require("./_store/Notification-chunk-ZNuM-7Xk.js"),L=require("./_store/ReadMore-chunk-DjPhO-lH.js"),m=require("./_store/Textarea-chunk-yD7hFNC1.js"),P=require("./_store/Callout-chunk-XF2yUV-r.js"),x=require("./_store/FileUpload-chunk-Cs3yHoZ7.js"),k=require("./_store/Heading-chunk-t4FvnOcp.js"),F=require("./_store/Link-chunk-CP7cvvcX.js"),S=require("./_store/NumberPicker-chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./_store/Accordion-entry-CmEtc6xU.js"),a=require("./_store/Form-chunk-CyfJEjS9.js"),n=require("./_store/Collapse-chunk-ocNUOS_3.js"),u=require("./_store/Empty-chunk-CSXmTnRW.js"),s=require("./_store/Image-chunk-bZyx8E0O.js"),c=require("./_store/Loading-chunk-BAVpKjsu.js"),d=require("./_store/Radio-chunk-C4PweUcm.js"),l=require("./_store/Tag-chunk-RApwQiSR.js"),C=require("./_store/Button-chunk-OmVJkQqc.js"),q=require("./_store/ContextMenu-chunk-Bt4IM9J7.js"),b=require("./_store/Fieldset-chunk-ChHFEwgQ.js"),g=require("./_store/GlobalProvider-chunk-BInwj8Vo.js"),T=require("./_store/GlobalCtx-chunk-D_GlGcgw.js"),r=require("./_store/TextInput.args-chunk-CZIwr5h8.js"),p=require("./_store/Notification-chunk-ZNuM-7Xk.js"),L=require("./_store/ReadMore-chunk-DjPhO-lH.js"),m=require("./_store/Textarea-chunk-yD7hFNC1.js"),P=require("./_store/Callout-chunk-XF2yUV-r.js"),x=require("./_store/FileUpload-chunk-Cs3yHoZ7.js"),k=require("./_store/Heading-chunk-t4FvnOcp.js"),F=require("./_store/Link-chunk-CP7cvvcX.js"),S=require("./_store/NumberPicker-chunk-ho5F2J60.js"),v=require("./_store/RichText-chunk-vKgvdzZl.js"),G=require("./_store/Tooltip-chunk-DlKiieYX.js"),M=require("./_store/Checkbox-chunk-IcVAXUrv.js"),I=require("./_store/DatePicker-chunk-3IOigKn5.js"),N=require("./_store/Hero-chunk-CDJrCpL6.js"),f=require("./_store/HeroCard-chunk-BO2BICG5.js"),D=require("./_store/LinkList-chunk-CmVHEiqZ.js"),h=require("./_store/Pagination-chunk-mrfIdsCC.js"),H=require("./_store/SearchField-chunk-DtJTqVM9.js"),R=require("./_store/Video-chunk-D9hf1AKM.js"),y=require("./_store/Dropdown-chunk-DmxZPa5u.js"),B=require("./_store/Icon-chunk-DLR0d6ii.js"),O=require("./_store/List-entry-31dXgvRv.js"),A=require("./_store/Profile-chunk-Bnn1-Z78.js"),w=require("./_store/TableOfContents-chunk-CLa_-Dhd.js"),E=require("./_store/Footer-chunk-Dt1p9vMD.js"),e=require("./_store/CardGroup-chunk-Cn8ewunq.js"),U=require("./_store/Breadcrumb-chunk-Bc1WgkRf.js"),V=require("./_store/Status-chunk-CaABjeKb.js"),_=require("./_store/Tabs-chunk-DXWL7rh9.js"),j=require("./_store/AudioPlayer-chunk-B7JUo7j6.js"),$=require("./_store/LanguageToggle-chunk-Dq721sHc.js"),o=require("./_store/MainNav-chunk-DIQJwoJV.js"),z=require("./_store/useGlobalSettings-chunk-Cd48T6lS.js"),J=require("./_store/usePrevious-chunk-DENrwKF1.js"),t=require("./_store/useOutsideClick-chunk-B3G_jqci.js"),K=require("./_store/useFocusTrap-chunk-CB0jpZY1.js");exports.Accordion=i.Accordion;exports.Form=a.Form;exports.Collapse=n.Collapse;exports.Empty=u.Empty;exports.Image=s.Image;exports.Loading=c.Loading;exports.Radio=d.LabelledRadio;exports.Tag=l.Tag;exports.Button=C.Button;exports.ContextMenu=q.ContextMenu;exports.Fieldset=b.Fieldset;exports.GlobalProvider=g.GlobalProvider;exports.GlobalProviderContext=T.GlobalProviderContext;exports.TextInput=r.LabelledTextInput;exports.TextInputArgs=r.TextInput_args;exports.Notification=p.Notification;exports.ReadMore=L.ReadMore;exports.Textarea=m.LabelledTextarea;exports.Callout=P.Callout;exports.FileUpload=x.LabelledFileUpload;exports.Heading=k.Heading;exports.Link=F.Link;exports.NumberPicker=S.LabelledNumberPicker;exports.RichText=v.RichText;exports.Tooltip=G.Tooltip;exports.Checkbox=M.LabelledCheckbox;exports.DatePicker=I.LabelledDatePicker;exports.Hero=N.Hero;exports.HeroCard=f.HeroCard;exports.LinkList=D.LinkList;exports.Pagination=h.Pagination;exports.SearchField=H.SearchField;exports.Video=R.Video;exports.Dropdown=y.LabelledDropdown;exports.Icon=B.Icon;exports.List=O.List;exports.Profile=A.Profile;exports.TableOfContents=w.TableOfContents;exports.Footer=E.Footer;exports.CardGroup=e.CardGroup;exports.DataCard=e.DataCardCombined;exports.DetailCard=e.DetailCardCombined;exports.FactListCard=e.FactListCardCombined;exports.FeatureCard=e.FeatureCardCombined;exports.MultiLinkCard=e.MultiLinkCardCombined;exports.PromoCard=e.PromoCardCombined;exports.ScoreCard=e.ScoreCardCombined;exports.StatCard=e.StatCardCombined;exports.TextCard=e.TextCardCombined;exports.Breadcrumb=U.Breadcrumb;exports.Status=V.Status;exports.Tabs=_.Tabs;exports.AudioPlayer=j.AudioPlayer;exports.LanguageToggle=$.LanguageToggle;exports.MainNav=o.MainNav;exports.SubsiteNav=o.SubsiteNav;exports.useGlobalSettings=z.useGlobalSettings;exports.usePrevious=J.usePrevious;exports.useBreakpoint=t.useBreakpoint;exports.useOutsideClick=t.useOutsideClick;exports.useFocusTrap=K.useFocusTrap;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx as a, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useState as x, useEffect as P, useLayoutEffect as v } from "react";
|
|
3
|
+
import { u as Q } from "./useGlobalSettings-chunk-BhfWlTcd.js";
|
|
4
|
+
import { c as I } from "./index-chunk-CY3PQDr4.js";
|
|
5
|
+
const U = ({
|
|
6
|
+
clientHeight: e,
|
|
7
|
+
clientWidth: s,
|
|
8
|
+
scrollHeight: n,
|
|
9
|
+
scrollWidth: i
|
|
10
|
+
}) => n > e || i > s, X = (e, { maxSize: s = 600, startingHeight: n = 9, step: i = 0.5 }) => {
|
|
11
|
+
let t = n, r = !1;
|
|
12
|
+
for (; !r && t < s; )
|
|
13
|
+
e.style.fontSize = `${t}px`, e.style.lineHeight = `${t}px`, r = U(e), r || (t = t + i);
|
|
14
|
+
return e.style.fontSize = "", e.style.lineHeight = "", t - i;
|
|
15
|
+
}, B = ({
|
|
16
|
+
baseClass: e,
|
|
17
|
+
className: s,
|
|
18
|
+
subbrand: n,
|
|
19
|
+
alt: i,
|
|
20
|
+
src: t,
|
|
21
|
+
style: r,
|
|
22
|
+
size: f = "fluid",
|
|
23
|
+
theme: c = "light",
|
|
24
|
+
...y
|
|
25
|
+
}) => {
|
|
26
|
+
const g = l(null), $ = l(null), L = l(null), u = l(null), R = l(0), F = l(0), [d, E] = x(!1), [H, M] = x(0), [z, W] = x(0), [j, C] = x(!n), k = l(
|
|
27
|
+
new ResizeObserver((o) => {
|
|
28
|
+
const { height: h } = o[0].contentRect, S = Math.round(h * 10) / 10;
|
|
29
|
+
u.current || (u.current = S), Math.abs(S - R.current) >= 0.1 && (R.current = S, M(S));
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
P(() => {
|
|
33
|
+
n && d && z && C(!0);
|
|
34
|
+
}, [d, z, n]), v(() => {
|
|
35
|
+
if (d && $.current && g.current) {
|
|
36
|
+
const o = g.current;
|
|
37
|
+
return k.current.observe(o), () => k.current.unobserve(o);
|
|
38
|
+
}
|
|
39
|
+
}, [d]), v(() => {
|
|
40
|
+
N();
|
|
41
|
+
}, [d, u.current]), v(() => {
|
|
42
|
+
N();
|
|
43
|
+
}, [n]);
|
|
44
|
+
function N() {
|
|
45
|
+
if ($.current && L.current && u.current) {
|
|
46
|
+
const h = X($.current, {
|
|
47
|
+
maxSize: u.current
|
|
48
|
+
}) / u.current;
|
|
49
|
+
Math.abs(h - F.current) >= 1e-3 && (F.current = h, W(h));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function O() {
|
|
53
|
+
E(!0);
|
|
54
|
+
}
|
|
55
|
+
const m = !!n, b = f === "fluid", V = !b && typeof f == "number", p = `${e}--sub-brand`, G = `${e}--size--fluid`, T = `${e}--visibility--hidden`, q = I(
|
|
56
|
+
e,
|
|
57
|
+
s,
|
|
58
|
+
`${e}--theme--${c}`,
|
|
59
|
+
{
|
|
60
|
+
[T]: !j,
|
|
61
|
+
[G]: b,
|
|
62
|
+
[p]: m
|
|
63
|
+
}
|
|
64
|
+
), A = `${e}--image`, D = `${p}--image`, J = () => {
|
|
65
|
+
const o = {};
|
|
66
|
+
return m && (o["--logo-image-height"] = `${H}px`, o["--logo-font-size"] = `${z * H}px`), V && (o.width = `${f}px`), { ...r, ...o };
|
|
67
|
+
}, K = () => typeof t == "string" ? t : t[c];
|
|
68
|
+
return /* @__PURE__ */ w("figure", { className: q, style: J(), children: [
|
|
69
|
+
/* @__PURE__ */ a(
|
|
70
|
+
"img",
|
|
71
|
+
{
|
|
72
|
+
ref: g,
|
|
73
|
+
alt: i,
|
|
74
|
+
src: K(),
|
|
75
|
+
className: I({
|
|
76
|
+
[D]: m,
|
|
77
|
+
[A]: !m
|
|
78
|
+
}),
|
|
79
|
+
onLoad: O,
|
|
80
|
+
...y
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
m && /* @__PURE__ */ w("div", { ref: $, className: `${p}--lock-up`, children: [
|
|
84
|
+
/* @__PURE__ */ a("span", { className: `${p}--lock-up--separator` }),
|
|
85
|
+
/* @__PURE__ */ a("span", { ref: L, children: n })
|
|
86
|
+
] })
|
|
87
|
+
] });
|
|
88
|
+
}, te = ({
|
|
89
|
+
className: e,
|
|
90
|
+
url: s,
|
|
91
|
+
target: n,
|
|
92
|
+
style: i,
|
|
93
|
+
size: t,
|
|
94
|
+
...r
|
|
95
|
+
}) => {
|
|
96
|
+
const { prefix: f } = Q(), c = `${f}--logo`, y = `${c}--link`, g = `${c}--size--fluid`;
|
|
97
|
+
return s ? /* @__PURE__ */ a(
|
|
98
|
+
"a",
|
|
99
|
+
{
|
|
100
|
+
href: s,
|
|
101
|
+
target: n,
|
|
102
|
+
className: I(y, e, {
|
|
103
|
+
[g]: t === "fluid"
|
|
104
|
+
}),
|
|
105
|
+
style: i,
|
|
106
|
+
children: /* @__PURE__ */ a(B, { ...r, baseClass: c, size: t })
|
|
107
|
+
}
|
|
108
|
+
) : /* @__PURE__ */ a(
|
|
109
|
+
B,
|
|
110
|
+
{
|
|
111
|
+
baseClass: c,
|
|
112
|
+
className: e,
|
|
113
|
+
style: i,
|
|
114
|
+
size: t,
|
|
115
|
+
...r
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
te as Logo
|
|
121
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { c as
|
|
4
|
-
import { u as
|
|
5
|
-
import { F, u as
|
|
6
|
-
const
|
|
3
|
+
import { c as g } from "./index-chunk-CY3PQDr4.js";
|
|
4
|
+
import { u as F } from "./useGlobalSettings-chunk-BhfWlTcd.js";
|
|
5
|
+
import { F as P, u as R } from "./FormControl-chunk-CA1OQzEu.js";
|
|
6
|
+
const w = m.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
onChange: r,
|
|
9
9
|
onBlur: o,
|
|
@@ -15,48 +15,50 @@ const R = m.forwardRef(
|
|
|
15
15
|
required: l,
|
|
16
16
|
max: u,
|
|
17
17
|
min: f,
|
|
18
|
-
step: d
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
step: d,
|
|
19
|
+
value: b
|
|
20
|
+
}, p) => {
|
|
21
|
+
const { prefix: i } = F(), C = R(), { ariaDescribedBy: h } = C, y = `${i}--input`, N = `${i}--numberpicker`, k = g(y, N, {
|
|
21
22
|
error: !s && !!n
|
|
22
23
|
});
|
|
23
24
|
return /* @__PURE__ */ c(
|
|
24
25
|
"input",
|
|
25
26
|
{
|
|
26
|
-
|
|
27
|
+
value: b,
|
|
28
|
+
ref: p,
|
|
27
29
|
id: t || e,
|
|
28
30
|
name: e,
|
|
29
|
-
onChange: (
|
|
30
|
-
r && r(
|
|
31
|
+
onChange: (x) => {
|
|
32
|
+
r && r(x);
|
|
31
33
|
},
|
|
32
34
|
onBlur: o,
|
|
33
35
|
disabled: s,
|
|
34
36
|
placeholder: a,
|
|
35
37
|
required: l,
|
|
36
38
|
type: "number",
|
|
37
|
-
className:
|
|
39
|
+
className: k,
|
|
38
40
|
pattern: "[0-9]*",
|
|
39
41
|
inputMode: "numeric",
|
|
40
|
-
"aria-describedby":
|
|
42
|
+
"aria-describedby": h,
|
|
41
43
|
max: u,
|
|
42
44
|
min: f,
|
|
43
45
|
step: d
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
|
-
),
|
|
49
|
+
), G = m.forwardRef((r, o) => {
|
|
48
50
|
const { style: s, inputStyle: n, className: t, ...e } = r, a = r.id ? r.id : r.name;
|
|
49
51
|
return /* @__PURE__ */ c(
|
|
50
|
-
|
|
52
|
+
P,
|
|
51
53
|
{
|
|
52
54
|
fieldId: a,
|
|
53
55
|
style: s,
|
|
54
56
|
className: t,
|
|
55
57
|
...e,
|
|
56
|
-
children: /* @__PURE__ */ c(
|
|
58
|
+
children: /* @__PURE__ */ c(w, { ref: o, style: n, ...e })
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
61
|
});
|
|
60
62
|
export {
|
|
61
|
-
|
|
63
|
+
G as L
|
|
62
64
|
};
|
|
@@ -19,7 +19,7 @@ import { C as E } from "./Callout-chunk-Cqttz2p6.js";
|
|
|
19
19
|
import { L as w } from "./FileUpload-chunk-CcPyoSNs.js";
|
|
20
20
|
import { H as U } from "./Heading-chunk-KETAd3FV.js";
|
|
21
21
|
import { L as q } from "./Link-chunk-DgmjE6xb.js";
|
|
22
|
-
import { L as J } from "./NumberPicker-chunk-
|
|
22
|
+
import { L as J } from "./NumberPicker-chunk-Dnzrt8V_.js";
|
|
23
23
|
import { R as Q } from "./RichText-chunk-DxfEl4aR.js";
|
|
24
24
|
import { T as X } from "./Tooltip-chunk-D5CzbDEd.js";
|
|
25
25
|
import { L as Z } from "./Checkbox-chunk-CICqXNag.js";
|
package/lib/esm/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { C as E } from "./_store/Callout-chunk-Cqttz2p6.js";
|
|
|
19
19
|
import { L as V } from "./_store/FileUpload-chunk-CcPyoSNs.js";
|
|
20
20
|
import { H as U } from "./_store/Heading-chunk-KETAd3FV.js";
|
|
21
21
|
import { L as q } from "./_store/Link-chunk-DgmjE6xb.js";
|
|
22
|
-
import { L as J } from "./_store/NumberPicker-chunk-
|
|
22
|
+
import { L as J } from "./_store/NumberPicker-chunk-Dnzrt8V_.js";
|
|
23
23
|
import { R as Q } from "./_store/RichText-chunk-DxfEl4aR.js";
|
|
24
24
|
import { T as X } from "./_store/Tooltip-chunk-D5CzbDEd.js";
|
|
25
25
|
import { L as Z } from "./_store/Checkbox-chunk-CICqXNag.js";
|
|
@@ -17,5 +17,9 @@ export interface NumberPickerProps extends FormFieldProps<HTMLInputElement> {
|
|
|
17
17
|
* The step value of the input.
|
|
18
18
|
* */
|
|
19
19
|
step?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The value of the input.
|
|
22
|
+
*/
|
|
23
|
+
value?: number;
|
|
20
24
|
}
|
|
21
25
|
export type LabelledNumberPickerProps = LabelledFormFieldProps<NumberPickerProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/react",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.6",
|
|
4
4
|
"description": "React components for the ILO's Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui_patterns",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"video.js": "^7.21.2",
|
|
76
76
|
"videojs-youtube": "^3.0.1",
|
|
77
77
|
"@ilo-org/brand-assets": "1.0.1",
|
|
78
|
-
"@ilo-org/fonts": "2.0.0",
|
|
79
78
|
"@ilo-org/icons-react": "1.0.6",
|
|
79
|
+
"@ilo-org/fonts": "2.0.0",
|
|
80
80
|
"@ilo-org/styles": "1.11.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"@vitest/ui": "^2.0.5",
|
|
107
107
|
"chromatic": "^13.3.4",
|
|
108
108
|
"glob": "^10.3.10",
|
|
109
|
+
"html-to-image": "^1.11.11",
|
|
109
110
|
"http-server": "^14.1.0",
|
|
110
111
|
"jsdom": "^25.0.0",
|
|
111
112
|
"storybook": "^8.6.11",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react"),V=require("./useGlobalSettings-chunk-Cd48T6lS.js"),R=require("./index-chunk-Cxg31gtu.js"),M=({clientHeight:e,clientWidth:l,scrollHeight:n,scrollWidth:o})=>n>e||o>l,P=(e,{maxSize:l=600,startingHeight:n=9,step:o=.5})=>{let t=n,c=!1;for(;!c&&t<l;)e.style.fontSize=`${t}px`,e.style.lineHeight=`${t}px`,c=M(e),c||(t=t+o);return e.style.fontSize="",e.style.lineHeight="",t-o},I=({baseClass:e,className:l,subbrand:n,alt:o,src:t,style:c,size:f="fluid",theme:u="light",...$})=>{const g=s.useRef(null),h=s.useRef(null),p=s.useRef(null),a=s.useRef(null),[d,N]=s.useState(!1),[L,F]=s.useState(0),[y,b]=s.useState(0),[k,H]=s.useState(!n),j=s.useRef(new ResizeObserver(i=>{const{height:x}=i[0].contentRect;a.current||(a.current=x),F(x)}));s.useEffect(()=>{n&&d&&y&&H(!0)},[d,y,n]),s.useLayoutEffect(()=>{if(d&&h.current&&g.current){const i=g.current;return j.current.observe(i),()=>j.current.unobserve(i)}},[d]),s.useLayoutEffect(()=>{v()},[d,a.current]),s.useLayoutEffect(()=>{v()},[n]);function v(){if(h.current&&p.current&&a.current){const x=P(h.current,{maxSize:a.current})/a.current;b(x)}}function w(){N(!0)}const m=!!n,z=f==="fluid",E=!z&&typeof f=="number",S=`${e}--sub-brand`,q=`${e}--size--fluid`,B=`${e}--visibility--hidden`,O=R.classNames(e,l,`${e}--theme--${u}`,{[B]:!k,[q]:z,[S]:m}),W=`${e}--image`,C=`${S}--image`,G=()=>{const i={};return m&&(i["--logo-image-height"]=`${L}px`,i["--logo-font-size"]=`${y*L}px`),E&&(i.width=`${f}px`),{...c,...i}},T=()=>typeof t=="string"?t:t[u];return r.jsxs("figure",{className:O,style:G(),children:[r.jsx("img",{ref:g,alt:o,src:T(),className:R.classNames({[C]:m,[W]:!m}),onLoad:w,...$}),m&&r.jsxs("div",{ref:h,className:`${S}--lock-up`,children:[r.jsx("span",{className:`${S}--lock-up--separator`}),r.jsx("span",{ref:p,children:n})]})]})},A=({className:e,url:l,target:n,style:o,size:t,...c})=>{const{prefix:f}=V.useGlobalSettings(),u=`${f}--logo`,$=`${u}--link`,g=`${u}--size--fluid`;return l?r.jsx("a",{href:l,target:n,className:R.classNames($,e,{[g]:t==="fluid"}),style:o,children:r.jsx(I,{...c,baseClass:u,size:t})}):r.jsx(I,{baseClass:u,className:e,style:o,size:t,...c})};exports.Logo=A;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),l=require("react"),R=require("./index-chunk-Cxg31gtu.js"),g=require("./useGlobalSettings-chunk-Cd48T6lS.js"),u=require("./FormControl-chunk-bBkCVOW6.js"),p=l.forwardRef(({onChange:e,onBlur:n,disabled:s=!1,error:o,id:t,name:r,placeholder:c,required:m,max:b,min:d,step:f},C)=>{const{prefix:a}=g.useGlobalSettings(),x=u.useFormControl(),{ariaDescribedBy:y}=x,N=`${a}--input`,k=`${a}--numberpicker`,q=!s&&!!o,h=R.classNames(N,k,{error:q}),j=P=>{e&&e(P)};return i.jsx("input",{ref:C,id:t||r,name:r,onChange:j,onBlur:n,disabled:s,placeholder:c,required:m,type:"number",className:h,pattern:"[0-9]*",inputMode:"numeric","aria-describedby":y,max:b,min:d,step:f})}),F=l.forwardRef((e,n)=>{const{style:s,inputStyle:o,className:t,...r}=e,c=e.id?e.id:e.name;return i.jsx(u.FormControl,{fieldId:c,style:s,className:t,...r,children:i.jsx(p,{ref:n,style:o,...r})})});exports.LabelledNumberPicker=F;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { jsx as u, jsxs as H } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as m, useState as S, useEffect as J, useLayoutEffect as v } from "react";
|
|
3
|
-
import { u as K } from "./useGlobalSettings-chunk-BhfWlTcd.js";
|
|
4
|
-
import { c as z } from "./index-chunk-CY3PQDr4.js";
|
|
5
|
-
const M = ({
|
|
6
|
-
clientHeight: e,
|
|
7
|
-
clientWidth: s,
|
|
8
|
-
scrollHeight: n,
|
|
9
|
-
scrollWidth: i
|
|
10
|
-
}) => n > e || i > s, P = (e, { maxSize: s = 600, startingHeight: n = 9, step: i = 0.5 }) => {
|
|
11
|
-
let t = n, r = !1;
|
|
12
|
-
for (; !r && t < s; )
|
|
13
|
-
e.style.fontSize = `${t}px`, e.style.lineHeight = `${t}px`, r = M(e), r || (t = t + i);
|
|
14
|
-
return e.style.fontSize = "", e.style.lineHeight = "", t - i;
|
|
15
|
-
}, N = ({
|
|
16
|
-
baseClass: e,
|
|
17
|
-
className: s,
|
|
18
|
-
subbrand: n,
|
|
19
|
-
alt: i,
|
|
20
|
-
src: t,
|
|
21
|
-
style: r,
|
|
22
|
-
size: f = "fluid",
|
|
23
|
-
theme: l = "light",
|
|
24
|
-
...x
|
|
25
|
-
}) => {
|
|
26
|
-
const a = m(null), h = m(null), L = m(null), c = m(null), [g, w] = S(!1), [I, B] = S(0), [y, b] = S(0), [E, W] = S(!n), R = m(
|
|
27
|
-
new ResizeObserver((o) => {
|
|
28
|
-
const { height: p } = o[0].contentRect;
|
|
29
|
-
c.current || (c.current = p), B(p);
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
J(() => {
|
|
33
|
-
n && g && y && W(!0);
|
|
34
|
-
}, [g, y, n]), v(() => {
|
|
35
|
-
if (g && h.current && a.current) {
|
|
36
|
-
const o = a.current;
|
|
37
|
-
return R.current.observe(o), () => R.current.unobserve(o);
|
|
38
|
-
}
|
|
39
|
-
}, [g]), v(() => {
|
|
40
|
-
F();
|
|
41
|
-
}, [g, c.current]), v(() => {
|
|
42
|
-
F();
|
|
43
|
-
}, [n]);
|
|
44
|
-
function F() {
|
|
45
|
-
if (h.current && L.current && c.current) {
|
|
46
|
-
const p = P(h.current, {
|
|
47
|
-
maxSize: c.current
|
|
48
|
-
}) / c.current;
|
|
49
|
-
b(p);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
function j() {
|
|
53
|
-
w(!0);
|
|
54
|
-
}
|
|
55
|
-
const d = !!n, k = f === "fluid", C = !k && typeof f == "number", $ = `${e}--sub-brand`, O = `${e}--size--fluid`, V = `${e}--visibility--hidden`, G = z(
|
|
56
|
-
e,
|
|
57
|
-
s,
|
|
58
|
-
`${e}--theme--${l}`,
|
|
59
|
-
{
|
|
60
|
-
[V]: !E,
|
|
61
|
-
[O]: k,
|
|
62
|
-
[$]: d
|
|
63
|
-
}
|
|
64
|
-
), T = `${e}--image`, q = `${$}--image`, A = () => {
|
|
65
|
-
const o = {};
|
|
66
|
-
return d && (o["--logo-image-height"] = `${I}px`, o["--logo-font-size"] = `${y * I}px`), C && (o.width = `${f}px`), { ...r, ...o };
|
|
67
|
-
}, D = () => typeof t == "string" ? t : t[l];
|
|
68
|
-
return /* @__PURE__ */ H("figure", { className: G, style: A(), children: [
|
|
69
|
-
/* @__PURE__ */ u(
|
|
70
|
-
"img",
|
|
71
|
-
{
|
|
72
|
-
ref: a,
|
|
73
|
-
alt: i,
|
|
74
|
-
src: D(),
|
|
75
|
-
className: z({
|
|
76
|
-
[q]: d,
|
|
77
|
-
[T]: !d
|
|
78
|
-
}),
|
|
79
|
-
onLoad: j,
|
|
80
|
-
...x
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
d && /* @__PURE__ */ H("div", { ref: h, className: `${$}--lock-up`, children: [
|
|
84
|
-
/* @__PURE__ */ u("span", { className: `${$}--lock-up--separator` }),
|
|
85
|
-
/* @__PURE__ */ u("span", { ref: L, children: n })
|
|
86
|
-
] })
|
|
87
|
-
] });
|
|
88
|
-
}, Z = ({
|
|
89
|
-
className: e,
|
|
90
|
-
url: s,
|
|
91
|
-
target: n,
|
|
92
|
-
style: i,
|
|
93
|
-
size: t,
|
|
94
|
-
...r
|
|
95
|
-
}) => {
|
|
96
|
-
const { prefix: f } = K(), l = `${f}--logo`, x = `${l}--link`, a = `${l}--size--fluid`;
|
|
97
|
-
return s ? /* @__PURE__ */ u(
|
|
98
|
-
"a",
|
|
99
|
-
{
|
|
100
|
-
href: s,
|
|
101
|
-
target: n,
|
|
102
|
-
className: z(x, e, {
|
|
103
|
-
[a]: t === "fluid"
|
|
104
|
-
}),
|
|
105
|
-
style: i,
|
|
106
|
-
children: /* @__PURE__ */ u(N, { ...r, baseClass: l, size: t })
|
|
107
|
-
}
|
|
108
|
-
) : /* @__PURE__ */ u(
|
|
109
|
-
N,
|
|
110
|
-
{
|
|
111
|
-
baseClass: l,
|
|
112
|
-
className: e,
|
|
113
|
-
style: i,
|
|
114
|
-
size: t,
|
|
115
|
-
...r
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
export {
|
|
120
|
-
Z as Logo
|
|
121
|
-
};
|