@harpercollins/harpercollins-design-system 1.16.2 → 1.16.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/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/overlay/Drawer/Drawer.d.ts +3 -4
- package/dist/cjs/types/src/hooks/index.d.ts +1 -0
- package/dist/cjs/types/src/hooks/useSentryFeedbackOpen.d.ts +6 -0
- package/dist/cjs/types/src/hooks/useSentryFeedbackOpen.stories.d.ts +16 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/overlay/Drawer/Drawer.d.ts +3 -4
- package/dist/esm/types/src/hooks/index.d.ts +1 -0
- package/dist/esm/types/src/hooks/useSentryFeedbackOpen.d.ts +6 -0
- package/dist/esm/types/src/hooks/useSentryFeedbackOpen.stories.d.ts +16 -0
- package/dist/index.d.ts +11 -6
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { DrawerProps } from "@mui/joy";
|
|
3
|
+
export interface ModalWindowProps extends Omit<DrawerProps, "open" | "anchor"> {
|
|
3
4
|
side: "left" | "right";
|
|
4
5
|
size?: "sm" | "md" | "lg";
|
|
5
6
|
open: boolean;
|
|
@@ -9,7 +10,5 @@ export interface ModalWindowProps {
|
|
|
9
10
|
closeBlocked?: boolean;
|
|
10
11
|
showCloseButton?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare const Modal: React.ForwardRefExoticComponent<ModalWindowProps &
|
|
13
|
-
children?: React.ReactNode | undefined;
|
|
14
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const Modal: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<ModalWindowProps>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
14
|
export default Modal;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook to determine if the Sentry feedback dialog is open.
|
|
3
|
+
* We are using MutationObserver to watch for changes in the shadow DOM of the Sentry feedback container because Sentry doesn't provide a direct API to check if the feedback dialog is open.
|
|
4
|
+
* @returns {boolean} - Returns true if the Sentry feedback dialog is open, false otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSentryFeedbackOpen(): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example component to demonstrate useSentryFeedbackOpen hook.
|
|
3
|
+
*/
|
|
4
|
+
export declare function Demo(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: typeof Demo;
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
package/dist/esm/index.js
CHANGED
|
@@ -1244,5 +1244,5 @@ function MR(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=
|
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
1246
|
`}
|
|
1247
|
-
`;function aN({message:n}){const r="success"===n.level?e(dC,{icon:gw}):e(dC,{icon:Dw});return t(oN,"html"in n?{level:n.level,noFade:n.noFade,role:"alert","aria-live":"error"===n.level?"assertive":"polite",children:[r,e("span",{dangerouslySetInnerHTML:{__html:n.html}})]}:{level:n.level,noFade:n.noFade,role:"alert","aria-live":"error"===n.level?"assertive":"polite",children:[r,n.text]})}function iN({messages:t}){return e(nN,{children:e(rN,{style:{top:`-${55*t.length}px`},children:t.map((t=>e(aN,{message:t},String(t))))})})}function lN(e){const[t,n]=p(e);return{value:t,toggle:h((()=>n((e=>!e))),[]),setTrue:h((()=>n(!0)),[]),setFalse:h((()=>n(!1)),[])}}
|
|
1247
|
+
`;function aN({message:n}){const r="success"===n.level?e(dC,{icon:gw}):e(dC,{icon:Dw});return t(oN,"html"in n?{level:n.level,noFade:n.noFade,role:"alert","aria-live":"error"===n.level?"assertive":"polite",children:[r,e("span",{dangerouslySetInnerHTML:{__html:n.html}})]}:{level:n.level,noFade:n.noFade,role:"alert","aria-live":"error"===n.level?"assertive":"polite",children:[r,n.text]})}function iN({messages:t}){return e(nN,{children:e(rN,{style:{top:`-${55*t.length}px`},children:t.map((t=>e(aN,{message:t},String(t))))})})}function lN(e){const[t,n]=p(e);return{value:t,toggle:h((()=>n((e=>!e))),[]),setTrue:h((()=>n(!0)),[]),setFalse:h((()=>n(!1)),[])}}function sN(){const[e,t]=p(!1),n="sentry-feedback";return s((()=>{let e=null,r=null;const o=()=>t((()=>{const e=document.getElementById(n),t=e?.shadowRoot;return!!t?.querySelector("dialog[open]")})()),a=()=>{const t=document.getElementById(n);t?.shadowRoot&&(e?.disconnect(),e=new MutationObserver(o),e.observe(t.shadowRoot,{subtree:!0,attributes:!0,childList:!0,attributeFilter:["open"]}),o())};return r=new MutationObserver(a),r.observe(document.body,{childList:!0,subtree:!0}),a(),()=>{e?.disconnect(),r?.disconnect()}}),[]),e}const cN=(e,t,n)=>{const[r,o]=p(null),[a,i]=p(!1),[l,d]=p(null),u=c(null);return s((()=>{if(!e)return()=>{};let r=!0;i(!0);return u.current&&clearTimeout(u.current),u.current=setTimeout((()=>{(async()=>{try{const n=await fetch(e,t);if(!n.ok)throw new Error(`Error: ${n.statusText}`);const a=await n.json();r&&(o(a),i(!1))}catch(e){r&&(d(e),i(!1))}})()}),n||0),()=>{r=!1,u.current&&clearTimeout(u.current)}}),[e,t,n]),{data:r,loading:a,error:l}},dN="-",uN=(e,t="dd MMM yyyy")=>{if(""===e||null==e)return dN;const n=hT(e);return zO(n)?MD(n,t):dN},pN=e=>""===e||null==e?dN:e.toLocaleString(),fN=e=>""===e||null==e?dN:e,mN={style:"currency",currency:"GBP",minimumFractionDigits:0,maximumFractionDigits:0},hN=(e,t="en-GB",n=mN)=>{let r=e;if(""===r||null==r)return dN;"string"==typeof e&&(r=Number(e));return new Intl.NumberFormat(t,{...mN,...n}).format(r)};export{bv as Accordion,yv as AccordionDetails,xv as AccordionGroup,hC as AccordionLegacy,wv as AccordionSummary,gC as Alert,QC as AppBar,ZC as Autocomplete,nO as AutocompleteSelectMultiple,rO as Avatar,oO as Badge,tm as Box,sO as Breadcrumb,CO as Button,OO as Card,zm as CardActions,Bm as CardContent,Wm as CardCover,Km as CardOverflow,DO as Checkbox,_O as Chip,EO as ChipIcon,RO as Container,YI as DatePicker,QI as DateTimeInput,ZI as Divider,$C as Drawer,wC as Dropdown,eE as FormControl,tE as FormLabel,iE as FullPageErrorFallback,lE as Grid,Tw as Heading,dC as Icon,hp as IconButton,GI as Input,fE as Layout,eO as List,Yh as ListDivider,Ld as ListItem,vu as ListItemButton,Uh as ListItemContent,Zh as ListItemDecorator,Xp as ListSubheader,pO as LoadingSpinner,BC as Logo,VC as LogoMini,FC as Menu,dg as MenuButton,AC as MenuHeading,mE as MenuItem,bE as ProgressBar,yE as ProgressCircle,wE as RadioButton,Pg as RadioGroup,CE as ReadMore,DE as RelativeTime,_E as Slider,zE as StatusIcon,AE as Switch,jR as Table,UR as Tabs,tN as TextBlock,iv as TextField,JR as Textarea,rE as ThemeProvider,iN as ToastMessages,PO as Tooltip,sE as Typography,hN as formatCurrency,uN as formatDate,pN as formatNumber,fN as formatText,cN as useFetch,zR as useLocalStorage,sN as useSentryFeedbackOpen,lN as useToggle};
|
|
1248
1248
|
//# sourceMappingURL=index.js.map
|