@tryghost/shade 0.1.0-alpha.48 → 0.1.0-alpha.49
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/es/app.js +2 -1
- package/es/components/ui/alert-dialog.js +22 -10
- package/es/components/ui/alert-dialog.js.map +1 -1
- package/es/components/ui/context-menu.js +15 -8
- package/es/components/ui/context-menu.js.map +1 -1
- package/es/components/ui/dialog.js +39 -23
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/dropdown-menu.js +17 -10
- package/es/components/ui/dropdown-menu.js.map +1 -1
- package/es/components/ui/hover-card.js +12 -8
- package/es/components/ui/hover-card.js.map +1 -1
- package/es/components/ui/popover.js +13 -9
- package/es/components/ui/popover.js.map +1 -1
- package/es/components/ui/select.js +22 -17
- package/es/components/ui/select.js.map +1 -1
- package/es/components/ui/sheet.js +29 -18
- package/es/components/ui/sheet.js.map +1 -1
- package/es/components/ui/tooltip.js +79 -31
- package/es/components/ui/tooltip.js.map +1 -1
- package/es/components.js +1 -1
- package/es/index.js +1 -1
- package/es/lib/app-overlay.js +151 -0
- package/es/lib/app-overlay.js.map +1 -0
- package/es/shade-app.js +6 -2
- package/es/shade-app.js.map +1 -1
- package/package.json +1 -1
- package/types/app.d.ts +2 -0
- package/types/app.d.ts.map +1 -1
- package/types/components/ui/alert-dialog.d.ts +1 -1
- package/types/components/ui/alert-dialog.d.ts.map +1 -1
- package/types/components/ui/context-menu.d.ts +1 -1
- package/types/components/ui/context-menu.d.ts.map +1 -1
- package/types/components/ui/dialog.d.ts +1 -1
- package/types/components/ui/dialog.d.ts.map +1 -1
- package/types/components/ui/dropdown-menu.d.ts +1 -1
- package/types/components/ui/dropdown-menu.d.ts.map +1 -1
- package/types/components/ui/hover-card.d.ts.map +1 -1
- package/types/components/ui/popover.d.ts.map +1 -1
- package/types/components/ui/select.d.ts.map +1 -1
- package/types/components/ui/sheet.d.ts +1 -1
- package/types/components/ui/sheet.d.ts.map +1 -1
- package/types/components/ui/tooltip.d.ts.map +1 -1
- package/types/lib/app-overlay.d.ts +58 -0
- package/types/lib/app-overlay.d.ts.map +1 -0
- package/types/shade-app.d.ts +3 -0
- package/types/shade-app.d.ts.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-overlay.js","names":[],"sources":["../../src/lib/app-overlay.tsx"],"sourcesContent":["import * as React from 'react';\nimport { hasSafeArea } from '@/lib/safe-area';\n\nexport type AppOverlayTint = 'dialog' | 'sheet';\n\nconst OVERLAY_TINTS: Record<AppOverlayTint, string> = {\n dialog: 'bg-black/30 dark:bg-black/60',\n sheet: 'bg-black/10',\n};\n\n/** A modal's tint classes. Admin draws the same tint behind an app's dialogs and sheets. */\nexport const overlayTint = (tint: AppOverlayTint) => OVERLAY_TINTS[tint];\n\n/**\n * Centres a dialog on the window, moved only as far as it must to stay inside the safe area.\n * One wider than the safe area is centred on it instead.\n */\nexport const SAFE_AREA_DIALOG_X =\n 'w-[calc(100%_-_var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))] translate-x-[calc(-50%_+_clamp(min(var(--ghost-safe-area-inset-left,0px)_-_50vw_+_50%,(var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))/2),0px,max(50vw_-_var(--ghost-safe-area-inset-right,0px)_-_50%,(var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))/2)))]';\n\nexport const SAFE_AREA_DIALOG_HEIGHT =\n 'max-h-[calc(100dvh_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px)_-_1rem)] overflow-y-auto';\n\n/** A dialog or sheet's hold on the overlay, from when it mounts until it unmounts. */\nexport interface AppOverlayHold {\n /** True once the dialog opens, false as soon as it starts to close. */\n setOpen(open: boolean): void;\n /** Called after the dialog's closing animation, once it has unmounted. */\n release(): void;\n}\n\n/**\n * Where an app's dialogs and sheets render, so they cover all of Admin rather than only the\n * app's frame. Pass the app SDK's `ghost.overlay` to `ShadeApp` as `overlay`.\n */\nexport interface AppOverlay {\n /** The element to render into, or undefined to render in the page. */\n container(): HTMLElement | undefined;\n /** Called with the dialog's content element as it mounts. */\n hold(tint: AppOverlayTint, element: HTMLElement): AppOverlayHold;\n}\n\nexport const AppOverlayContext = React.createContext<AppOverlay | undefined>(undefined);\n\n/** Content portalled from a hosted dialog renders in the overlay too, above the dialog. */\nconst PortalContainerContext = React.createContext<HTMLElement | undefined>(undefined);\n\nconst ModalStateContext = React.createContext<{ open: boolean; modal: boolean } | undefined>(\n undefined,\n);\n\ninterface OpenProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n modal?: boolean;\n}\n\n/**\n * Wraps a Radix dialog `Root`'s props so its content re-renders when it opens, even from its own\n * trigger, and can then decide whether to render in the overlay. Radix re-renders only its\n * portal, and doesn't expose `modal` to the content.\n */\nexport function useModalOpen<P extends OpenProps>(\n props: P,\n): [P, (children: React.ReactNode) => React.ReactNode] {\n const { open, defaultOpen, onOpenChange, modal = true } = props;\n const [uncontrolled, setUncontrolled] = React.useState(defaultOpen ?? false);\n const isOpen = open ?? uncontrolled;\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolled(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n const state = React.useMemo(() => ({ open: isOpen, modal }), [isOpen, modal]);\n const provide = React.useCallback(\n (children: React.ReactNode) => (\n <ModalStateContext.Provider value={state}>{children}</ModalStateContext.Provider>\n ),\n [state],\n );\n return [{ ...props, onOpenChange: handleOpenChange }, provide];\n}\n\n/** The container for a Radix `Portal`: the overlay inside a hosted dialog, else the default. */\nexport const usePortalContainer = () => React.useContext(PortalContainerContext);\n\nfunction setRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n}\n\n/**\n * Transparent so Admin's tint shows through, but still there so a press beside the dialog closes\n * it. A style rather than a class, to override the overlay's colour in either theme.\n */\nconst HOSTED_OVERLAY_STYLE: React.CSSProperties = { background: 'transparent' };\n\ninterface Placement {\n open: boolean | undefined;\n container: HTMLElement | undefined;\n}\n\ninterface HostedModal<T extends HTMLElement> {\n /** The overlay when the dialog renders there, or a non-modal one opens from a dialog there. */\n container: HTMLElement | undefined;\n inApp: boolean;\n modal: boolean;\n overlayStyle: React.CSSProperties | undefined;\n ref: React.RefCallback<T>;\n wrap: (children: React.ReactNode) => React.ReactNode;\n}\n\n/**\n * Renders a dialog, alert dialog or sheet in the app's overlay when there is one, holding the\n * overlay while its content is mounted.\n */\nexport function useHostedModal<T extends HTMLElement>(\n tint: AppOverlayTint,\n forwardedRef: React.Ref<T>,\n): HostedModal<T> {\n const overlay = React.useContext(AppOverlayContext);\n const inherited = usePortalContainer();\n const state = React.useContext(ModalStateContext);\n const open = state?.open;\n const modal = state?.modal ?? true;\n // Decided as the dialog opens and kept while it closes: moving it would remount the content.\n // Outside Shade's dialog roots `open` is undefined, so it decides on each render.\n const place = () => (modal ? overlay?.container() : undefined);\n const [placed, setPlaced] = React.useState<Placement>(() => ({\n open,\n container: open === false ? undefined : place(),\n }));\n let placement = placed;\n if (open === undefined) {\n placement = { ...placed, container: place() };\n } else if (open !== placed.open) {\n placement = open && !placed.open ? { open, container: place() } : { ...placed, open };\n setPlaced(placement);\n }\n const { container } = placement;\n const hosted = modal && container !== undefined;\n\n // The ref must stay stable: a new one makes React reattach the content, releasing the hold.\n // The insertion effect stores this render's decision before React attaches the content.\n const latest = React.useRef({ overlay, hosted, tint });\n React.useInsertionEffect(() => {\n latest.current = { overlay, hosted, tint };\n });\n // Hands the element over when the caller's ref changes, as React would.\n const content = React.useRef<T | null>(null);\n const attached = React.useRef(forwardedRef);\n React.useLayoutEffect(() => {\n if (attached.current !== forwardedRef) {\n if (content.current) {\n setRef(attached.current, null);\n setRef(forwardedRef, content.current);\n }\n attached.current = forwardedRef;\n }\n }, [forwardedRef]);\n const cleanup = React.useRef<() => void>(undefined);\n const ref = React.useCallback((element: T | null) => {\n const current = latest.current;\n content.current = element;\n setRef(attached.current, element);\n cleanup.current?.();\n cleanup.current = undefined;\n if (!element || !current.overlay || !current.hosted) {\n return;\n }\n const hold = current.overlay.hold(current.tint, element);\n const sync = () => hold.setOpen(element.getAttribute('data-state') === 'open');\n sync();\n // The element lives in the overlay's document, so use that window's constructor.\n const Observer = element.ownerDocument.defaultView?.MutationObserver ?? MutationObserver;\n const observer = new Observer(sync);\n observer.observe(element, { attributes: true, attributeFilter: ['data-state'] });\n cleanup.current = () => {\n observer.disconnect();\n hold.release();\n };\n }, []);\n\n const wrap = React.useCallback(\n (children: React.ReactNode) =>\n hosted ? (\n <PortalContainerContext.Provider value={container}>\n {children}\n </PortalContainerContext.Provider>\n ) : (\n children\n ),\n [hosted, container],\n );\n\n const portal = modal ? container : inherited;\n return {\n container: portal,\n inApp: hasSafeArea(portal),\n modal,\n overlayStyle: hosted ? HOSTED_OVERLAY_STYLE : undefined,\n ref,\n wrap,\n };\n}\n"],"mappings":"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"}
|
package/es/shade-app.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "./lib/ds-utils.js";
|
|
2
2
|
import { useHasSafeArea, useSafeAreaSlide } from "./lib/safe-area.js";
|
|
3
|
+
import { AppOverlayContext } from "./lib/app-overlay.js";
|
|
3
4
|
import ShadeProvider from "./providers/shade-provider.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import clsx$1 from "clsx";
|
|
@@ -12,7 +13,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
13
|
*/
|
|
13
14
|
var SHADE_APP_NAMESPACES = "shade shade-admin shade-activitypub";
|
|
14
15
|
var SAFE_AREA_PADDING = cn("pt-[var(--ghost-safe-area-inset-top,0px)] pr-[var(--ghost-safe-area-inset-right,0px)]", "pb-[var(--ghost-safe-area-inset-bottom,0px)] pl-[var(--ghost-safe-area-inset-left,0px)]");
|
|
15
|
-
var ShadeApp = ({ darkMode, controlShape, admin7Design = true, admin7Mobile = false, className, children, ...props }) => {
|
|
16
|
+
var ShadeApp = ({ darkMode, controlShape, admin7Design = true, admin7Mobile = false, overlay, className, children, ...props }) => {
|
|
16
17
|
const root = React.useRef(null);
|
|
17
18
|
const inApp = useHasSafeArea();
|
|
18
19
|
useSafeAreaSlide(root);
|
|
@@ -28,7 +29,10 @@ var ShadeApp = ({ darkMode, controlShape, admin7Design = true, admin7Mobile = fa
|
|
|
28
29
|
admin7Mobile,
|
|
29
30
|
controlShape,
|
|
30
31
|
darkMode,
|
|
31
|
-
children
|
|
32
|
+
children: /* @__PURE__ */ jsx(AppOverlayContext.Provider, {
|
|
33
|
+
value: overlay,
|
|
34
|
+
children
|
|
35
|
+
})
|
|
32
36
|
})
|
|
33
37
|
});
|
|
34
38
|
};
|
package/es/shade-app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shade-app.js","names":[],"sources":["../src/shade-app.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\nimport ShadeProvider from '@/providers/shade-provider';\nimport type { ControlShape } from '@/providers/shade-context';\nimport { useHasSafeArea, useSafeAreaSlide } from '@/lib/safe-area';\nimport { cn } from '@/lib/utils';\n\n/**\n * The className is used to scope the styles of the app to the app's namespace.\n * Some components in radixUI/ShadCN need to be wrapped in a div with the className\n * in order to work correctly.\n */\nexport const SHADE_APP_NAMESPACES = 'shade shade-admin shade-activitypub';\n\nconst SAFE_AREA_PADDING = cn(\n 'pt-[var(--ghost-safe-area-inset-top,0px)] pr-[var(--ghost-safe-area-inset-right,0px)]',\n 'pb-[var(--ghost-safe-area-inset-bottom,0px)] pl-[var(--ghost-safe-area-inset-left,0px)]',\n);\n\nexport interface ShadeAppProps extends React.HTMLProps<HTMLDivElement> {\n darkMode: boolean;\n controlShape?: ControlShape;\n /**\n * Admin's `admin7Design` Labs flag. Admin passes the flag's value; isolated Shade\n * previews and standalone apps default to the Admin 7 design. Removed with the flag.\n */\n admin7Design?: boolean;\n /** Temporary Admin mobile-hardening flag. Standalone surfaces stay off by default. */\n admin7Mobile?: boolean;\n}\n\nconst ShadeApp: React.FC<ShadeAppProps> = ({\n darkMode,\n controlShape,\n admin7Design = true,\n admin7Mobile = false,\n className,\n children,\n ...props\n}) => {\n const root = React.useRef<HTMLDivElement>(null);\n const inApp = useHasSafeArea();\n useSafeAreaSlide(root);\n // Last, so a className's own padding wins.\n const appClassName = cn('shade', SAFE_AREA_PADDING, className);\n\n return (\n <div\n ref={root}\n className={inApp ? appClassName : clsx('shade', className)}\n {...props}\n data-admin7-design={admin7Design}\n data-admin7-mobile={admin7Mobile}\n >\n <ShadeProvider\n admin7Design={admin7Design}\n admin7Mobile={admin7Mobile}\n controlShape={controlShape}\n darkMode={darkMode}\n >\n {children}
|
|
1
|
+
{"version":3,"file":"shade-app.js","names":[],"sources":["../src/shade-app.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\nimport { type AppOverlay, AppOverlayContext } from '@/lib/app-overlay';\nimport ShadeProvider from '@/providers/shade-provider';\nimport type { ControlShape } from '@/providers/shade-context';\nimport { useHasSafeArea, useSafeAreaSlide } from '@/lib/safe-area';\nimport { cn } from '@/lib/utils';\n\n/**\n * The className is used to scope the styles of the app to the app's namespace.\n * Some components in radixUI/ShadCN need to be wrapped in a div with the className\n * in order to work correctly.\n */\nexport const SHADE_APP_NAMESPACES = 'shade shade-admin shade-activitypub';\n\nconst SAFE_AREA_PADDING = cn(\n 'pt-[var(--ghost-safe-area-inset-top,0px)] pr-[var(--ghost-safe-area-inset-right,0px)]',\n 'pb-[var(--ghost-safe-area-inset-bottom,0px)] pl-[var(--ghost-safe-area-inset-left,0px)]',\n);\n\nexport interface ShadeAppProps extends React.HTMLProps<HTMLDivElement> {\n darkMode: boolean;\n controlShape?: ControlShape;\n /**\n * Admin's `admin7Design` Labs flag. Admin passes the flag's value; isolated Shade\n * previews and standalone apps default to the Admin 7 design. Removed with the flag.\n */\n admin7Design?: boolean;\n /** Temporary Admin mobile-hardening flag. Standalone surfaces stay off by default. */\n admin7Mobile?: boolean;\n /** In a Ghost app, where dialogs and sheets render. Pass the app SDK's `ghost.overlay`. */\n overlay?: AppOverlay;\n}\n\nconst ShadeApp: React.FC<ShadeAppProps> = ({\n darkMode,\n controlShape,\n admin7Design = true,\n admin7Mobile = false,\n overlay,\n className,\n children,\n ...props\n}) => {\n const root = React.useRef<HTMLDivElement>(null);\n const inApp = useHasSafeArea();\n useSafeAreaSlide(root);\n // Last, so a className's own padding wins.\n const appClassName = cn('shade', SAFE_AREA_PADDING, className);\n\n return (\n <div\n ref={root}\n className={inApp ? appClassName : clsx('shade', className)}\n {...props}\n data-admin7-design={admin7Design}\n data-admin7-mobile={admin7Mobile}\n >\n <ShadeProvider\n admin7Design={admin7Design}\n admin7Mobile={admin7Mobile}\n controlShape={controlShape}\n darkMode={darkMode}\n >\n <AppOverlayContext.Provider value={overlay}>{children}</AppOverlayContext.Provider>\n </ShadeProvider>\n </div>\n );\n};\n\nexport default ShadeApp;\n"],"mappings":";;;;;;;;;;;;;AAaA,IAAa,uBAAuB;AAEpC,IAAM,oBAAoB,GACxB,yFACA,yFACF;AAgBA,IAAM,YAAqC,EACzC,UACA,cACA,eAAe,MACf,eAAe,OACf,SACA,WACA,UACA,GAAG,YACC;CACJ,MAAM,OAAO,MAAM,OAAuB,IAAI;CAC9C,MAAM,QAAQ,eAAe;CAC7B,iBAAiB,IAAI;CAErB,MAAM,eAAe,GAAG,SAAS,mBAAmB,SAAS;CAE7D,OACE,oBAAC,OAAD;EACE,KAAK;EACL,WAAW,QAAQ,eAAe,OAAK,SAAS,SAAS;EACzD,GAAI;EACJ,sBAAoB;EACpB,sBAAoB;YAEpB,oBAAC,eAAD;GACgB;GACA;GACA;GACJ;aAEV,oBAAC,kBAAkB,UAAnB;IAA4B,OAAO;IAAU;GAAqC,CAAA;EACrE,CAAA;CACZ,CAAA;AAET"}
|
package/package.json
CHANGED
package/types/app.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export type { ShadeAppProps } from './shade-app.js';
|
|
|
3
3
|
export { ShadeScope } from './shade-scope.js';
|
|
4
4
|
export { useFocusContext, useShade } from './providers/shade-context.js';
|
|
5
5
|
export type { ControlShape } from './providers/shade-context.js';
|
|
6
|
+
export { overlayTint } from './lib/app-overlay.js';
|
|
7
|
+
export type { AppOverlay, AppOverlayHold, AppOverlayTint } from './lib/app-overlay.js';
|
|
6
8
|
//# sourceMappingURL=app.d.ts.map
|
package/types/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
3
|
import type { ButtonProps } from './button.js';
|
|
4
|
-
declare const AlertDialog: React.
|
|
4
|
+
declare const AlertDialog: (props: React.ComponentProps<typeof AlertDialogPrimitive.Root>) => React.ReactNode;
|
|
5
5
|
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
7
7
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAUrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,WAAW,UAAW,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,oBAGjF,CAAC;AAEF,QAAA,MAAM,kBAAkB,wHAA+B,CAAC;AAExD,QAAA,MAAM,iBAAiB,uDAA8B,CAAC;AAGtD,QAAA,MAAM,kBAAkB,wKAatB,CAAC;AASH,QAAA,MAAM,kBAAkB;uBAHH,MAAM;wCAoCzB,CAAC;mCAGwB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;mCAK7D,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;AAQxF,QAAA,MAAM,gBAAgB,8KASpB,CAAC;AAGH,QAAA,MAAM,sBAAsB,wLAK1B,CAAC;AAGH,QAAA,MAAM,iBAAiB,4MAcrB,CAAC;AAGH,QAAA,MAAM,iBAAiB,6KAkBrB,CAAC;AAGH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
|
3
3
|
declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
|
4
4
|
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
5
|
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare const ContextMenuPortal: React.
|
|
6
|
+
declare const ContextMenuPortal: (props: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) => React.JSX.Element;
|
|
7
7
|
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
|
8
8
|
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAQrE,QAAA,MAAM,WAAW,iDAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,sHAA+B,CAAC;AAExD,QAAA,MAAM,gBAAgB,mHAA6B,CAAC;AAEpD,QAAA,MAAM,iBAAiB,UAAW,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,sBAEzF,CAAC;AAEF,QAAA,MAAM,cAAc,oDAA2B,CAAC;AAEhD,QAAA,MAAM,qBAAqB,wHAAkC,CAAC;AAE9D,QAAA,MAAM,qBAAqB;YAGf,OAAO;wCAejB,CAAC;AAGH,QAAA,MAAM,qBAAqB,2KAgBzB,CAAC;AAGH,QAAA,MAAM,kBAAkB,wKAmBtB,CAAC;AAGH,QAAA,MAAM,eAAe;YAGT,OAAO;cACL,SAAS,GAAG,aAAa;wCAcrC,CAAC;AAGH,QAAA,MAAM,uBAAuB,6KAoB3B,CAAC;AAGH,QAAA,MAAM,oBAAoB,0KAmBxB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAQjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,0KASxB,CAAC;qCAG0B,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;;;AAK3F,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
declare const Dialog: (
|
|
3
|
+
declare const Dialog: (props: React.ComponentProps<typeof DialogPrimitive.Root>) => React.ReactNode;
|
|
4
4
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
6
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAY1D,QAAA,MAAM,MAAM,UAAW,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,oBAGvE,CAAC;AAEF,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,8JAcjB,CAAC;AA6BH,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CACxE,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,2FAiFjB,CAAC;8BAGmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;8BAK7D,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;AAWnF,QAAA,MAAM,WAAW,oKAYf,CAAC;AAGH,QAAA,MAAM,iBAAiB,8KASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -3,7 +3,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
3
3
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
4
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
declare const DropdownMenuPortal: React.
|
|
6
|
+
declare const DropdownMenuPortal: (props: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) => React.JSX.Element;
|
|
7
7
|
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
8
|
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAQvE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAEhD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAE1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AAEtD,QAAA,MAAM,kBAAkB,UAAW,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,sBAE3F,CAAC;AAEF,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAElD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAEhE,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAC;AAGH,QAAA,MAAM,sBAAsB,6KAiB1B,CAAC;AAGH,QAAA,MAAM,mBAAmB,0KAqBvB,CAAC;AAGH,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAC;AAGH,QAAA,MAAM,wBAAwB,+KAoB5B,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KAmBzB,CAAC;AAGH,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAQjB,CAAC;AAGH,QAAA,MAAM,qBAAqB,4KASzB,CAAC;sCAG2B,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;;;AAK5F,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAOjE,QAAA,MAAM,SAAS,6CAA0B,CAAC;AAE1C,QAAA,MAAM,gBAAgB,oHAA6B,CAAC;AAEpD,QAAA,MAAM,gBAAgB,oKAmBpB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAO5D,QAAA,MAAM,OAAO,yCAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,QAAA,MAAM,aAAa,4GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,8GAAyB,CAAC;AAE5C,QAAA,MAAM,cAAc,gKA0BnB,CAAC;AAGF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAOxE,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,MAAM,WAAW,kBACf,SACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EAC9D,YAAY,CAAC,OAAO,qBAAqB,CAAC;IAC5C,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,aAAa,8FAgClB,CAAC;AAGF,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JAkDlB,CAAC;AAGF,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
-
declare const Sheet: React.
|
|
4
|
+
declare const Sheet: (props: React.ComponentProps<typeof SheetPrimitive.Root>) => React.ReactNode;
|
|
5
5
|
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sheet.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOlE,QAAA,MAAM,KAAK,UAAW,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,oBAGrE,CAAC;AAEF,QAAA,MAAM,YAAY,6GAAyB,CAAC;AAE5C,QAAA,MAAM,UAAU,2GAAuB,CAAC;AAExC,QAAA,MAAM,WAAW,4CAAwB,CAAC;AAE1C,QAAA,MAAM,YAAY,6JAahB,CAAC;AAKH,QAAA,MAAM,aAAa;;8EAiBlB,CAAC;AAEF,UAAU,iBACR,SACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,EAC7D,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,QAAA,MAAM,YAAY,0FAiDhB,CAAC;6BAGkB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;6BAK7D,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;AAQlF,QAAA,MAAM,UAAU,mKAYd,CAAC;AAGH,QAAA,MAAM,gBAAgB,6KASpB,CAAC;AAGH,OAAO,EACL,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAgB5D;;;;GAIG;AACH,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,qBAsDxD;AAED,iBAAS,OAAO,CAAC,EACf,IAAI,EAAE,cAAc,EACpB,WAAmB,EACnB,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAoCpD;AAED,QAAA,MAAM,cAAc,sKAwDlB,CAAC;AAGH,QAAA,MAAM,sBAAsB;;8EAW3B,CAAC;AAEF,MAAM,WAAW,mBACf,SACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,EAC/D,YAAY,CAAC,OAAO,sBAAsB,CAAC;CAAG;AAElD,QAAA,MAAM,cAAc,4FAqBlB,CAAC;AAGH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type AppOverlayTint = 'dialog' | 'sheet';
|
|
3
|
+
/** A modal's tint classes. Admin draws the same tint behind an app's dialogs and sheets. */
|
|
4
|
+
export declare const overlayTint: (tint: AppOverlayTint) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Centres a dialog on the window, moved only as far as it must to stay inside the safe area.
|
|
7
|
+
* One wider than the safe area is centred on it instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SAFE_AREA_DIALOG_X = "w-[calc(100%_-_var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))] translate-x-[calc(-50%_+_clamp(min(var(--ghost-safe-area-inset-left,0px)_-_50vw_+_50%,(var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))/2),0px,max(50vw_-_var(--ghost-safe-area-inset-right,0px)_-_50%,(var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px))/2)))]";
|
|
10
|
+
export declare const SAFE_AREA_DIALOG_HEIGHT = "max-h-[calc(100dvh_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px)_-_1rem)] overflow-y-auto";
|
|
11
|
+
/** A dialog or sheet's hold on the overlay, from when it mounts until it unmounts. */
|
|
12
|
+
export interface AppOverlayHold {
|
|
13
|
+
/** True once the dialog opens, false as soon as it starts to close. */
|
|
14
|
+
setOpen(open: boolean): void;
|
|
15
|
+
/** Called after the dialog's closing animation, once it has unmounted. */
|
|
16
|
+
release(): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Where an app's dialogs and sheets render, so they cover all of Admin rather than only the
|
|
20
|
+
* app's frame. Pass the app SDK's `ghost.overlay` to `ShadeApp` as `overlay`.
|
|
21
|
+
*/
|
|
22
|
+
export interface AppOverlay {
|
|
23
|
+
/** The element to render into, or undefined to render in the page. */
|
|
24
|
+
container(): HTMLElement | undefined;
|
|
25
|
+
/** Called with the dialog's content element as it mounts. */
|
|
26
|
+
hold(tint: AppOverlayTint, element: HTMLElement): AppOverlayHold;
|
|
27
|
+
}
|
|
28
|
+
export declare const AppOverlayContext: React.Context<AppOverlay | undefined>;
|
|
29
|
+
interface OpenProps {
|
|
30
|
+
open?: boolean;
|
|
31
|
+
defaultOpen?: boolean;
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
modal?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Wraps a Radix dialog `Root`'s props so its content re-renders when it opens, even from its own
|
|
37
|
+
* trigger, and can then decide whether to render in the overlay. Radix re-renders only its
|
|
38
|
+
* portal, and doesn't expose `modal` to the content.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useModalOpen<P extends OpenProps>(props: P): [P, (children: React.ReactNode) => React.ReactNode];
|
|
41
|
+
/** The container for a Radix `Portal`: the overlay inside a hosted dialog, else the default. */
|
|
42
|
+
export declare const usePortalContainer: () => HTMLElement | undefined;
|
|
43
|
+
interface HostedModal<T extends HTMLElement> {
|
|
44
|
+
/** The overlay when the dialog renders there, or a non-modal one opens from a dialog there. */
|
|
45
|
+
container: HTMLElement | undefined;
|
|
46
|
+
inApp: boolean;
|
|
47
|
+
modal: boolean;
|
|
48
|
+
overlayStyle: React.CSSProperties | undefined;
|
|
49
|
+
ref: React.RefCallback<T>;
|
|
50
|
+
wrap: (children: React.ReactNode) => React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Renders a dialog, alert dialog or sheet in the app's overlay when there is one, holding the
|
|
54
|
+
* overlay while its content is mounted.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useHostedModal<T extends HTMLElement>(tint: AppOverlayTint, forwardedRef: React.Ref<T>): HostedModal<T>;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=app-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-overlay.d.ts","sourceRoot":"","sources":["../../src/lib/app-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAOhD,4FAA4F;AAC5F,eAAO,MAAM,WAAW,SAAU,cAAc,WAAwB,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,iaACiY,CAAC;AAEja,eAAO,MAAM,uBAAuB,iIAC4F,CAAC;AAEjI,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,0EAA0E;IAC1E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,SAAS,IAAI,WAAW,GAAG,SAAS,CAAC;IACrC,6DAA6D;IAC7D,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,GAAG,cAAc,CAAC;CAClE;AAED,eAAO,MAAM,iBAAiB,uCAAyD,CAAC;AASxF,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAC9C,KAAK,EAAE,CAAC,GACP,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC,CAmBrD;AAED,gGAAgG;AAChG,eAAO,MAAM,kBAAkB,+BAAiD,CAAC;AAqBjF,UAAU,WAAW,CAAC,CAAC,SAAS,WAAW;IACzC,+FAA+F;IAC/F,SAAS,EAAE,WAAW,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC;IAC9C,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;CACtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,WAAW,EAClD,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GACzB,WAAW,CAAC,CAAC,CAAC,CAqFhB"}
|
package/types/shade-app.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type AppOverlay } from './lib/app-overlay.js';
|
|
2
3
|
import type { ControlShape } from './providers/shade-context.js';
|
|
3
4
|
/**
|
|
4
5
|
* The className is used to scope the styles of the app to the app's namespace.
|
|
@@ -16,6 +17,8 @@ export interface ShadeAppProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
16
17
|
admin7Design?: boolean;
|
|
17
18
|
/** Temporary Admin mobile-hardening flag. Standalone surfaces stay off by default. */
|
|
18
19
|
admin7Mobile?: boolean;
|
|
20
|
+
/** In a Ghost app, where dialogs and sheets render. Pass the app SDK's `ghost.overlay`. */
|
|
21
|
+
overlay?: AppOverlay;
|
|
19
22
|
}
|
|
20
23
|
declare const ShadeApp: React.FC<ShadeAppProps>;
|
|
21
24
|
export default ShadeApp;
|
package/types/shade-app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shade-app.d.ts","sourceRoot":"","sources":["../src/shade-app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"shade-app.d.ts","sourceRoot":"","sources":["../src/shade-app.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,mBAAmB,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAO1E,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sFAAsF;IACtF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkCrC,CAAC;eAEa,QAAQ"}
|