@agregio-solutions/design-system 1.101.0 → 1.101.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.
package/dist/design-system.cjs
CHANGED
|
@@ -214,7 +214,7 @@ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-sev
|
|
|
214
214
|
`,Sw=T.div`
|
|
215
215
|
padding: var(--spacing-xs) var(--spacing-md) var(--spacing-md)
|
|
216
216
|
var(--spacing-md);
|
|
217
|
-
`;function je(e){const{locale:t}=Me(),r=t||"";return`${r[0]}${r[1]}`.toLowerCase()==="fr"?e.fr:e.en}function Pw(e){const{duration:t,onComplete:r,onPressStart:n,onPressEnd:a}=e,o=!!t&&t>0,[i,l]=s.useState(!1),c=s.useRef(void 0),u=s.useCallback(()=>{clearTimeout(c.current),c.current=void 0,l(!1)},[]);return s.useEffect(()=>u,[u]),{requiresHold:o,isHolding:i,pressProps:{onPressStart:p=>{n?.(p)
|
|
217
|
+
`;function je(e){const{locale:t}=Me(),r=t||"";return`${r[0]}${r[1]}`.toLowerCase()==="fr"?e.fr:e.en}function Pw(e){const{duration:t,onComplete:r,onPressStart:n,onPressEnd:a}=e,o=!!t&&t>0,[i,l]=s.useState(!1),c=s.useRef(void 0),u=s.useCallback(()=>{clearTimeout(c.current),c.current=void 0,l(!1)},[]);return s.useEffect(()=>u,[u]),{requiresHold:o,isHolding:i,pressProps:{onPressStart:p=>{if(n?.(p),!o)return;l(!0);const g=p.target;c.current=setTimeout(()=>{u(),r?.(g)},t)},onPressEnd:p=>{a?.(p),o&&u()}}}}const $2=T.span`
|
|
218
218
|
// This reflect the little space between text and y-axis paddings (see Figma file)
|
|
219
219
|
&[data-size="medium"] {
|
|
220
220
|
padding: 2px 0;
|
|
@@ -736,7 +736,7 @@ See https://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-sev
|
|
|
736
736
|
&[data-invisible="true"] {
|
|
737
737
|
visibility: hidden;
|
|
738
738
|
}
|
|
739
|
-
`,V1=s.forwardRef(({value:e,nature:t="default",max:r,showZero:n,invisible:a,variant:o="standard",...i},l)=>{if(Bw({value:e,variant:o,showZero:n}))return null;let c=e;return e&&r&&typeof e=="number"&&e>r&&(c=`${r}+`),o==="dot"&&(c=""),d.jsx(Aw,{ref:l,"data-nature":t,"data-invisible":a,"data-variant":o,$value:e,$max:r,...i,children:c})}),Bw=({value:e,variant:t,showZero:r})=>t==="dot"?!1:e==null||e===0&&!r,Se=s.forwardRef(({text:e,mode:t="primary",size:r="medium",nature:n="action",iconLeft:a,iconRight:o,type:i,onClick:l,disabled:c,fullWidth:u,isLoading:f,href:h,target:p,tooltip:g,tooltipProps:m,badgeProps:C,holdToSubmitDuration:b,onPressStart:y,onPressEnd:x,...v},S)=>{const{requiresHold:E,isHolding:k,pressProps:w}=Pw({duration:b,onComplete:l,onPressStart:y,onPressEnd:x}),D=e==null||e==="";if(D&&!a&&!o)throw new Error("You must provide a text or an icon");if(a&&o)throw new Error("You can't provide both an iconLeft and an iconRight");const L=h?Mw:Ew,j=d.jsxs(L,{...v,ref:S,type:i||"button","data-size":r,"data-nature":n,"data-mode":t,"data-has-icon-left":!!a||f,"data-has-icon-right":!!o,"data-has-no-text":D,"data-fullwidth":u,"data-holding":k,onPress:E?void 0:l,...w,isDisabled:c||f,href:h,target:p,"data-is-loading":f,children:[d.jsx(jw,{iconLeft:a,isLoading:f,size:r}),!D&&d.jsx($2,{"data-size":r,children:e}),d.jsx(Hw,{iconRight:o,text:e,isLoading:f,size:r}),!!C&&d.jsx(Dw,{children:d.jsx(V1,{...C})}),k&&!!b&&d.jsx(Vw,{size:r,duration:b})]});return g?d.jsx(Za,{label:g,...m,children:j}):j});function Kw({children:e,title:t,titleContentLeft:r,titleContentRight:n,description:a,unmountOnExit:o=!1,defaultExpanded:i=!1,isExpanded:l,onExpandedChange:c,isDisabled:u=!1,className:f,style:h,nature:p="default",noPadding:g=!1,withBottomCloseButton:m=!1}){const C=je(Zw);return d.jsx(gw,{defaultExpanded:i,isExpanded:l,onExpandedChange:c,isDisabled:u,className:f,style:h,"data-nature":p,"data-no-padding":g,children:({isExpanded:b})=>{const y=o&&!b;return d.jsxs(d.Fragment,{children:[d.jsxs(mw,{children:[d.jsxs(Cw,{children:[d.jsxs(bw,{children:[r,d.jsx(h5,{slot:"trigger","data-open":b,"data-disabled":u,"data-nature":p,"data-full-width":!n,children:d.jsx(vw,{slot:"trigger",children:t})}),!!n&&d.jsx(xw,{children:n})]}),d.jsx(h5,{slot:"trigger","data-open":b,"data-disabled":u,"data-nature":p,excludeFromTabOrder:!0,"data-close-button":!0,children:d.jsx(yw,{name:b?"minimize":"add"})})]}),a&&d.jsx(ww,{"data-disabled":u,children:a})]}),d.jsx($w,{"data-padding":!g,children:y?null:d.jsx(d.Fragment,{children:e})}),b&&m&&d.jsx(Sw,{children:d.jsx(Se,{slot:"trigger",text:C.close,mode:"tertiary",size:"small",iconLeft:"expand_less"})})]})}})}const Zw={en:{close:"Close"},fr:{close:"Fermer"}},_a=ln`
|
|
739
|
+
`,V1=s.forwardRef(({value:e,nature:t="default",max:r,showZero:n,invisible:a,variant:o="standard",...i},l)=>{if(Bw({value:e,variant:o,showZero:n}))return null;let c=e;return e&&r&&typeof e=="number"&&e>r&&(c=`${r}+`),o==="dot"&&(c=""),d.jsx(Aw,{ref:l,"data-nature":t,"data-invisible":a,"data-variant":o,$value:e,$max:r,...i,children:c})}),Bw=({value:e,variant:t,showZero:r})=>t==="dot"?!1:e==null||e===0&&!r,Se=s.forwardRef(({text:e,mode:t="primary",size:r="medium",nature:n="action",iconLeft:a,iconRight:o,type:i,onClick:l,disabled:c,fullWidth:u,isLoading:f,href:h,target:p,tooltip:g,tooltipProps:m,badgeProps:C,holdToSubmitDuration:b,onPressStart:y,onPressEnd:x,...v},S)=>{const{requiresHold:E,isHolding:k,pressProps:w}=Pw({duration:b,onComplete:O=>{if(l?.(),i!=="submit")return;const B=O;B.type="submit",B.form?.requestSubmit(B),B.type="button"},onPressStart:y,onPressEnd:x}),D=e==null||e==="";if(D&&!a&&!o)throw new Error("You must provide a text or an icon");if(a&&o)throw new Error("You can't provide both an iconLeft and an iconRight");const L=h?Mw:Ew,j=d.jsxs(L,{...v,ref:S,type:E?"button":i||"button","data-size":r,"data-nature":n,"data-mode":t,"data-has-icon-left":!!a||f,"data-has-icon-right":!!o,"data-has-no-text":D,"data-fullwidth":u,"data-holding":k,onPress:E?void 0:l,...w,isDisabled:c||f,href:h,target:p,"data-is-loading":f,children:[d.jsx(jw,{iconLeft:a,isLoading:f,size:r}),!D&&d.jsx($2,{"data-size":r,children:e}),d.jsx(Hw,{iconRight:o,text:e,isLoading:f,size:r}),!!C&&d.jsx(Dw,{children:d.jsx(V1,{...C})}),k&&!!b&&d.jsx(Vw,{size:r,duration:b})]});return g?d.jsx(Za,{label:g,...m,children:j}):j});function Kw({children:e,title:t,titleContentLeft:r,titleContentRight:n,description:a,unmountOnExit:o=!1,defaultExpanded:i=!1,isExpanded:l,onExpandedChange:c,isDisabled:u=!1,className:f,style:h,nature:p="default",noPadding:g=!1,withBottomCloseButton:m=!1}){const C=je(Zw);return d.jsx(gw,{defaultExpanded:i,isExpanded:l,onExpandedChange:c,isDisabled:u,className:f,style:h,"data-nature":p,"data-no-padding":g,children:({isExpanded:b})=>{const y=o&&!b;return d.jsxs(d.Fragment,{children:[d.jsxs(mw,{children:[d.jsxs(Cw,{children:[d.jsxs(bw,{children:[r,d.jsx(h5,{slot:"trigger","data-open":b,"data-disabled":u,"data-nature":p,"data-full-width":!n,children:d.jsx(vw,{slot:"trigger",children:t})}),!!n&&d.jsx(xw,{children:n})]}),d.jsx(h5,{slot:"trigger","data-open":b,"data-disabled":u,"data-nature":p,excludeFromTabOrder:!0,"data-close-button":!0,children:d.jsx(yw,{name:b?"minimize":"add"})})]}),a&&d.jsx(ww,{"data-disabled":u,children:a})]}),d.jsx($w,{"data-padding":!g,children:y?null:d.jsx(d.Fragment,{children:e})}),b&&m&&d.jsx(Sw,{children:d.jsx(Se,{slot:"trigger",text:C.close,mode:"tertiary",size:"small",iconLeft:"expand_less"})})]})}})}const Zw={en:{close:"Close"},fr:{close:"Fermer"}},_a=ln`
|
|
740
740
|
margin: 0;
|
|
741
741
|
max-height: 200px; /* 5 items of 40px height */
|
|
742
742
|
overflow-y: auto;
|
package/dist/design-system.js
CHANGED
|
@@ -22508,9 +22508,12 @@ function Mw(e) {
|
|
|
22508
22508
|
isHolding: i,
|
|
22509
22509
|
pressProps: {
|
|
22510
22510
|
onPressStart: (h) => {
|
|
22511
|
-
n?.(h), o
|
|
22512
|
-
|
|
22513
|
-
|
|
22511
|
+
if (n?.(h), !o) return;
|
|
22512
|
+
l(!0);
|
|
22513
|
+
const p = h.target;
|
|
22514
|
+
s.current = setTimeout(() => {
|
|
22515
|
+
c(), r?.(p);
|
|
22516
|
+
}, t);
|
|
22514
22517
|
},
|
|
22515
22518
|
onPressEnd: (h) => {
|
|
22516
22519
|
a?.(h), o && c();
|
|
@@ -23230,7 +23233,11 @@ const _w = T.span`
|
|
|
23230
23233
|
}, P) => {
|
|
23231
23234
|
const { requiresHold: E, isHolding: k, pressProps: w } = Mw({
|
|
23232
23235
|
duration: C,
|
|
23233
|
-
onComplete:
|
|
23236
|
+
onComplete: (F) => {
|
|
23237
|
+
if (l?.(), i !== "submit") return;
|
|
23238
|
+
const K = F;
|
|
23239
|
+
K.type = "submit", K.form?.requestSubmit(K), K.type = "button";
|
|
23240
|
+
},
|
|
23234
23241
|
onPressStart: b,
|
|
23235
23242
|
onPressEnd: x
|
|
23236
23243
|
}), M = e == null || e === "";
|
|
@@ -23243,7 +23250,7 @@ const _w = T.span`
|
|
|
23243
23250
|
{
|
|
23244
23251
|
...v,
|
|
23245
23252
|
ref: P,
|
|
23246
|
-
type: i || "button",
|
|
23253
|
+
type: E ? "button" : i || "button",
|
|
23247
23254
|
"data-size": r,
|
|
23248
23255
|
"data-nature": n,
|
|
23249
23256
|
"data-mode": t,
|
|
@@ -69,6 +69,8 @@ export type Props = Omit<ButtonProps, "onPress" | "isDisabled" | "children"> & {
|
|
|
69
69
|
* before `onClick` is called. While pressed, text and icons are hidden (the button
|
|
70
70
|
* keeps its size) and a circular progress fills up. Releasing early resets
|
|
71
71
|
* everything without calling `onClick`.
|
|
72
|
+
* Works with `type="submit"`: the owner form is submitted once the hold completes,
|
|
73
|
+
* and never on a short click.
|
|
72
74
|
* Omit it (or pass 0) to get a regular click button. Not supported with `href`.
|
|
73
75
|
*/
|
|
74
76
|
holdToSubmitDuration?: number;
|
|
@@ -143,6 +145,8 @@ declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps
|
|
|
143
145
|
* before `onClick` is called. While pressed, text and icons are hidden (the button
|
|
144
146
|
* keeps its size) and a circular progress fills up. Releasing early resets
|
|
145
147
|
* everything without calling `onClick`.
|
|
148
|
+
* Works with `type="submit"`: the owner form is submitted once the hold completes,
|
|
149
|
+
* and never on a short click.
|
|
146
150
|
* Omit it (or pass 0) to get a regular click button. Not supported with `href`.
|
|
147
151
|
*/
|
|
148
152
|
holdToSubmitDuration?: number;
|
package/package.json
CHANGED