@lifesg/react-design-system 1.0.0-alpha.10 → 1.0.0-alpha.12
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/breadcrumb/index.js +1 -1
- package/breadcrumb/index.js.map +1 -1
- package/breadcrumb/types.d.ts +5 -1
- package/card/card.d.ts +3 -0
- package/card/card.style.d.ts +1 -0
- package/card/index.d.ts +1 -0
- package/card/index.js +135 -0
- package/card/index.js.map +1 -0
- package/card/package.json +7 -0
- package/card/types.d.ts +4 -0
- package/cjs/index.js +101 -35
- package/cjs/index.js.map +1 -1
- package/form/index.js +240 -239
- package/form/index.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +102 -36
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/popover/index.js +175 -174
- package/popover/index.js.map +1 -1
- package/popover/popover.styles.d.ts +1 -1
- package/progress-indicator/index.js +69 -69
- package/progress-indicator/index.js.map +1 -1
- package/smart-app-banner/index.d.ts +1 -0
- package/smart-app-banner/index.js +351 -0
- package/smart-app-banner/index.js.map +1 -0
- package/smart-app-banner/package.json +7 -0
- package/smart-app-banner/smart-app-banner.d.ts +19 -0
- package/smart-app-banner/smart-app-banner.styles.d.ts +15 -0
- package/tooltip/index.js +21 -16
- package/tooltip/index.js.map +1 -1
- package/tooltip/tooltip.styles.d.ts +3 -1
package/breadcrumb/index.js
CHANGED
|
@@ -179,5 +179,5 @@ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import*as C from
|
|
|
179
179
|
margin: 0.25rem !important;
|
|
180
180
|
`,tC=h(In.Hyperlink.Small)`
|
|
181
181
|
margin: 0.25rem !important;
|
|
182
|
-
`,nC=({links:C,fadeColor:r,fadePosition:l="both",itemStyle:a,id:d,...u})=>{const[f,h]=o(!!l),[p,s]=o("left"===l||"both"===l),[g,v]=o("right"===l||"both"===l),V=i(null),y=i(null);!function(e){void 0===e&&(e={});var t=e.skipOnMount,n=void 0!==t&&t,C=e.refreshMode,r=e.refreshRate,l=void 0===r?1e3:r,a=e.refreshOptions,d=e.handleWidth,c=void 0===d||d,u=e.handleHeight,L=void 0===u||u,f=e.targetRef,h=e.observerOptions,p=e.onResize,s=i(n),g=i(null),v=null!=f?f:g,V=i(),y=o({width:void 0,height:void 0}),m=y[0],M=y[1];de((function(){if(!oe()){var e=ae(p,M,c,L);V.current=re((function(t){(c||L)&&t.forEach((function(t){var n=t&&t.contentRect||{},C=n.width,r=n.height;!s.current&&!oe()&&e({width:C,height:r}),s.current=!1}))}),C,l,a);var t=new window.ResizeObserver(V.current);return v.current&&t.observe(v.current,h),function(){t.disconnect();var e=V.current;e&&e.cancel&&e.cancel()}}}),[C,l,a,c,L,p,h,v.current]),H({ref:v},m)}({onResize:L((()=>{const e=y.current,t=V.current;e&&t&&C&&C.length>1&&window.innerWidth<=ce.tablet&&(e.scrollLeft=e.scrollWidth-t.offsetWidth)}),[C.length]),targetRef:V,refreshMode:"debounce",refreshRate:50});const m=()=>{if(f){h(window.innerWidth<ce.tablet);const e=y.current,t=V.current;e&&t&&e.scrollWidth>t.offsetWidth?(h(!0),s(e.scrollLeft>=1),v(e.scrollWidth-e.scrollLeft>t.offsetWidth)):h(!1)}};if(c((()=>{const e=y.current;return m(),window.addEventListener("resize",m),e&&e.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),e&&e.removeEventListener("scroll",m)}}),[]),!C)return null;return e(qn,{ref:V,id:d||"breadcrumb",...u,children:[t("nav",{children:t(Jn,{ref:y,children:C.map(((n,r)=>{let i;return n.children?(i=r!==C.length-1&&n.href?t(tC,{...n,weight:"semibold"}):t(eC,{weight:"semibold",children:n.children}),e(Qn,{$styleProps:a,children:[i,r<C.length-1&&t(Yn,{type:"chevron-right"})]},r)):null}))})}),f&&e(n,{children:[p&&t(Kn,{$backgroundColor:
|
|
182
|
+
`,nC=({links:C,fadeColor:r,fadePosition:l="both",itemStyle:a,id:d,...u})=>{const[f,h]=o(!!l),[p,s]=o("left"===l||"both"===l),[g,v]=o("right"===l||"both"===l),V=i(null),y=i(null);!function(e){void 0===e&&(e={});var t=e.skipOnMount,n=void 0!==t&&t,C=e.refreshMode,r=e.refreshRate,l=void 0===r?1e3:r,a=e.refreshOptions,d=e.handleWidth,c=void 0===d||d,u=e.handleHeight,L=void 0===u||u,f=e.targetRef,h=e.observerOptions,p=e.onResize,s=i(n),g=i(null),v=null!=f?f:g,V=i(),y=o({width:void 0,height:void 0}),m=y[0],M=y[1];de((function(){if(!oe()){var e=ae(p,M,c,L);V.current=re((function(t){(c||L)&&t.forEach((function(t){var n=t&&t.contentRect||{},C=n.width,r=n.height;!s.current&&!oe()&&e({width:C,height:r}),s.current=!1}))}),C,l,a);var t=new window.ResizeObserver(V.current);return v.current&&t.observe(v.current,h),function(){t.disconnect();var e=V.current;e&&e.cancel&&e.cancel()}}}),[C,l,a,c,L,p,h,v.current]),H({ref:v},m)}({onResize:L((()=>{const e=y.current,t=V.current;e&&t&&C&&C.length>1&&window.innerWidth<=ce.tablet&&(e.scrollLeft=e.scrollWidth-t.offsetWidth)}),[C.length]),targetRef:V,refreshMode:"debounce",refreshRate:50});const m=()=>{if(f){h(window.innerWidth<ce.tablet);const e=y.current,t=V.current;e&&t&&e.scrollWidth>t.offsetWidth?(h(!0),s(e.scrollLeft>=1),v(e.scrollWidth-e.scrollLeft>t.offsetWidth)):h(!1)}};if(c((()=>{const e=y.current;return m(),window.addEventListener("resize",m),e&&e.addEventListener("scroll",m),()=>{window.removeEventListener("resize",m),e&&e.removeEventListener("scroll",m)}}),[]),!C)return null;return e(qn,{ref:V,id:d||"breadcrumb",...u,children:[t("nav",{children:t(Jn,{ref:y,children:C.map(((n,r)=>{let i;return n.children?(i=r!==C.length-1&&n.href?t(tC,{...n,weight:"semibold"}):t(eC,{weight:"semibold",children:n.children}),e(Qn,{$styleProps:a,children:[i,r<C.length-1&&t(Yn,{type:"chevron-right"})]},r)):null}))})}),f&&(()=>{let C;return C=Array.isArray(r)&&r.length>0?{left:r,right:r}:r||{left:void 0,right:void 0},e(n,{children:[p&&t(Kn,{$backgroundColor:C.left,$position:"left"}),g&&t(Kn,{$backgroundColor:C.right,$position:"right"})]})})()]})};export{nC as Breadcrumb};
|
|
183
183
|
//# sourceMappingURL=index.js.map
|