@cerberus-design/react 0.16.0-next-22894bb → 0.16.0-next-1e5283a
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/build/legacy/_tsup-dts-rollup.d.cts +108 -90
- package/build/legacy/components/cta-dialog/index.cjs +91 -65
- package/build/legacy/components/cta-dialog/index.cjs.map +1 -1
- package/build/legacy/components/cta-dialog/provider.cjs +91 -65
- package/build/legacy/components/cta-dialog/provider.cjs.map +1 -1
- package/build/legacy/components/{Dialog.client.cjs → dialog/close-icon-trigger.cjs} +36 -28
- package/build/legacy/components/dialog/close-icon-trigger.cjs.map +1 -0
- package/build/legacy/components/dialog/dialog.cjs +80 -0
- package/build/legacy/components/dialog/dialog.cjs.map +1 -0
- package/build/legacy/components/dialog/index.cjs +208 -0
- package/build/legacy/components/dialog/index.cjs.map +1 -0
- package/build/legacy/components/dialog/parts.cjs +109 -0
- package/build/legacy/components/dialog/parts.cjs.map +1 -0
- package/build/legacy/components/dialog/primitives.cjs +112 -0
- package/build/legacy/components/dialog/primitives.cjs.map +1 -0
- package/build/legacy/context/confirm-modal.cjs +78 -49
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/notification-center.cjs +3 -9
- package/build/legacy/context/notification-center.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +84 -58
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +489 -437
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +108 -90
- package/build/modern/{chunk-QEM3M4N3.js → chunk-4WKM2MJC.js} +9 -7
- package/build/modern/chunk-4WKM2MJC.js.map +1 -0
- package/build/modern/{chunk-H5WNUPGH.js → chunk-6DAOKE6Z.js} +1 -1
- package/build/modern/{chunk-H5WNUPGH.js.map → chunk-6DAOKE6Z.js.map} +1 -1
- package/build/modern/chunk-C45HS2C4.js +22 -0
- package/build/modern/chunk-C45HS2C4.js.map +1 -0
- package/build/modern/{chunk-ZFFW5ELD.js → chunk-CF3EHG42.js} +4 -4
- package/build/modern/chunk-D7UIWAFO.js +84 -0
- package/build/modern/chunk-D7UIWAFO.js.map +1 -0
- package/build/modern/chunk-DJOYRUNT.js +1 -0
- package/build/modern/chunk-FCSO6N2Y.js +27 -0
- package/build/modern/chunk-FCSO6N2Y.js.map +1 -0
- package/build/modern/{chunk-H54FR7IP.js → chunk-MTZDZXZM.js} +8 -6
- package/build/modern/{chunk-H54FR7IP.js.map → chunk-MTZDZXZM.js.map} +1 -1
- package/build/modern/{chunk-6BN3XKQF.js → chunk-NZKE7C53.js} +8 -8
- package/build/modern/chunk-NZKE7C53.js.map +1 -0
- package/build/modern/{chunk-O542MPR7.js → chunk-OOUNB643.js} +8 -6
- package/build/modern/{chunk-O542MPR7.js.map → chunk-OOUNB643.js.map} +1 -1
- package/build/modern/components/FileStatus.js +2 -2
- package/build/modern/components/cta-dialog/index.js +8 -5
- package/build/modern/components/cta-dialog/provider.js +7 -4
- package/build/modern/components/dialog/close-icon-trigger.js +11 -0
- package/build/modern/components/dialog/dialog.js +9 -0
- package/build/modern/components/dialog/dialog.js.map +1 -0
- package/build/modern/components/dialog/index.js +39 -0
- package/build/modern/components/dialog/index.js.map +1 -0
- package/build/modern/components/dialog/parts.js +8 -0
- package/build/modern/components/dialog/parts.js.map +1 -0
- package/build/modern/components/{Dialog.js → dialog/primitives.js} +4 -5
- package/build/modern/components/dialog/primitives.js.map +1 -0
- package/build/modern/components/select/index.js +4 -4
- package/build/modern/context/confirm-modal.js +7 -2
- package/build/modern/context/notification-center.js +1 -1
- package/build/modern/context/prompt-modal.js +7 -2
- package/build/modern/index.js +56 -47
- package/build/modern/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/cta-dialog/provider.tsx +2 -2
- package/src/components/{Dialog.client.tsx → dialog/close-icon-trigger.tsx} +11 -13
- package/src/components/dialog/dialog.tsx +41 -0
- package/src/components/dialog/index.ts +4 -0
- package/src/components/dialog/parts.ts +71 -0
- package/src/components/dialog/primitives.tsx +116 -0
- package/src/context/confirm-modal.tsx +1 -1
- package/src/context/notification-center.tsx +3 -3
- package/src/context/prompt-modal.tsx +1 -1
- package/src/index.ts +1 -2
- package/build/legacy/components/Dialog.cjs +0 -86
- package/build/legacy/components/Dialog.cjs.map +0 -1
- package/build/legacy/components/Dialog.client.cjs.map +0 -1
- package/build/modern/chunk-6BN3XKQF.js.map +0 -1
- package/build/modern/chunk-QEM3M4N3.js.map +0 -1
- package/build/modern/chunk-TFL56AYR.js +0 -56
- package/build/modern/chunk-TFL56AYR.js.map +0 -1
- package/build/modern/components/Dialog.client.js +0 -10
- package/src/components/Dialog.tsx +0 -165
- /package/build/modern/{chunk-ZFFW5ELD.js.map → chunk-CF3EHG42.js.map} +0 -0
- /package/build/modern/{components/Dialog.client.js.map → chunk-DJOYRUNT.js.map} +0 -0
- /package/build/modern/components/{Dialog.js.map → dialog/close-icon-trigger.js.map} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IconButton
|
|
3
3
|
} from "./chunk-APD6IX5R.js";
|
|
4
|
+
import {
|
|
5
|
+
DialogCloseTrigger
|
|
6
|
+
} from "./chunk-D7UIWAFO.js";
|
|
4
7
|
import {
|
|
5
8
|
useCerberusContext
|
|
6
9
|
} from "./chunk-GITT5645.js";
|
|
7
10
|
|
|
8
|
-
// src/components/
|
|
9
|
-
import {
|
|
10
|
-
Dialog as ArkDialog
|
|
11
|
-
} from "@ark-ui/react";
|
|
11
|
+
// src/components/dialog/close-icon-trigger.tsx
|
|
12
12
|
import { dialog } from "@cerberus/styled-system/recipes";
|
|
13
13
|
import { cx } from "@cerberus/styled-system/css";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
function DialogCloseIconTrigger(props) {
|
|
16
|
+
const styles = dialog();
|
|
16
17
|
const { icons } = useCerberusContext();
|
|
17
18
|
const { close: CloseIcon } = icons;
|
|
18
|
-
const styles = dialog();
|
|
19
19
|
return /* @__PURE__ */ jsx(
|
|
20
|
-
|
|
20
|
+
DialogCloseTrigger,
|
|
21
21
|
{
|
|
22
22
|
...props,
|
|
23
|
-
className: cx(
|
|
23
|
+
className: cx(styles.closeTrigger, props.className),
|
|
24
24
|
asChild: true,
|
|
25
25
|
children: /* @__PURE__ */ jsx(
|
|
26
26
|
IconButton,
|
|
@@ -39,4 +39,4 @@ function DialogCloseIconTrigger(props) {
|
|
|
39
39
|
export {
|
|
40
40
|
DialogCloseIconTrigger
|
|
41
41
|
};
|
|
42
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
//# sourceMappingURL=chunk-NZKE7C53.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/dialog/close-icon-trigger.tsx"],"sourcesContent":["'use client'\n\nimport { type DialogCloseTriggerProps } from '@ark-ui/react/dialog'\nimport { useCerberusContext } from '../../context/cerberus'\nimport { IconButton } from '../IconButton'\nimport { DialogCloseTrigger } from './primitives'\nimport { dialog } from '@cerberus/styled-system/recipes'\nimport { cx } from '@cerberus/styled-system/css'\n\n/**\n * This module contains the close trigger for the dialog.\n * @module react/dialog\n */\n\nexport function DialogCloseIconTrigger(props: DialogCloseTriggerProps) {\n const styles = dialog()\n\n const { icons } = useCerberusContext()\n const { close: CloseIcon } = icons\n\n return (\n <DialogCloseTrigger\n {...props}\n className={cx(styles.closeTrigger, props.className)}\n asChild\n >\n <IconButton\n ariaLabel=\"Close dialog\"\n palette=\"action\"\n size=\"lg\"\n usage=\"ghost\"\n >\n <CloseIcon />\n </IconButton>\n </DialogCloseTrigger>\n )\n}\n"],"mappings":";;;;;;;;;;;AAMA,SAAS,cAAc;AACvB,SAAS,UAAU;AAyBX;AAlBD,SAAS,uBAAuB,OAAgC;AACrE,QAAM,SAAS,OAAO;AAEtB,QAAM,EAAE,MAAM,IAAI,mBAAmB;AACrC,QAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,GAAG,OAAO,cAAc,MAAM,SAAS;AAAA,MAClD,SAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,OAAM;AAAA,UAEN,8BAAC,aAAU;AAAA;AAAA,MACb;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -2,14 +2,16 @@ import {
|
|
|
2
2
|
Text
|
|
3
3
|
} from "./chunk-RU5LOXWI.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Avatar
|
|
6
|
+
} from "./chunk-SXLPDPOZ.js";
|
|
7
|
+
import {
|
|
8
|
+
Dialog
|
|
9
|
+
} from "./chunk-C45HS2C4.js";
|
|
10
|
+
import {
|
|
6
11
|
DialogDescription,
|
|
7
12
|
DialogHeading,
|
|
8
13
|
DialogProvider
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
Avatar
|
|
12
|
-
} from "./chunk-SXLPDPOZ.js";
|
|
14
|
+
} from "./chunk-D7UIWAFO.js";
|
|
13
15
|
import {
|
|
14
16
|
FieldLabel,
|
|
15
17
|
FieldRoot,
|
|
@@ -209,4 +211,4 @@ export {
|
|
|
209
211
|
PromptModal,
|
|
210
212
|
usePromptModal
|
|
211
213
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
214
|
+
//# sourceMappingURL=chunk-OOUNB643.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/prompt-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type MouseEvent,\n type PropsWithChildren,\n} from 'react'\nimport { DialogCloseTrigger } from '@ark-ui/react'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { css } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { FieldLabel, FieldRoot, Input } from '../components/field/index'\nimport { Button } from '../components/button/button'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/Avatar'\nimport { Text } from '../components/Text'\nimport { useCerberusContext } from './cerberus'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/Dialog'\n\n/**\n * This module provides a context and hook for the prompt modal.\n * @module PromptModal\n */\n\nexport interface ShowPromptModalOptions {\n /**\n * The kind of prompt modal to show.\n * @default 'non-destructive'\n */\n kind?: 'destructive' | 'non-destructive'\n /**\n * The heading of the prompt modal.\n */\n heading: string\n /**\n * The description of the prompt modal.\n */\n description?: string\n /**\n * The key to confirm the action.\n */\n key: string\n /**\n * The text for the action button.\n */\n actionText: string\n /**\n * The text for the cancel button.\n */\n cancelText: string\n}\nexport type PromptShowResult =\n | ((value: string | PromiseLike<string>) => void)\n | null\n\nexport interface PromptModalValue {\n /**\n * The method to trigger the prompt modal.\n * @returns the value of the key if the action is confirmed.\n * @example\n * ```tsx\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n */\n show: (options: ShowPromptModalOptions) => Promise<string>\n}\n\nconst PromptModalContext = createContext<PromptModalValue | null>(null)\n\nexport type PromptModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a prompt modal to the app.\n * @see https://cerberus.digitalu.design/react/prompt-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <PromptModal>\n * <SomeFeatureSection />\n * </PromptModal>\n *\n * // Use the hook to show the prompt modal.\n * const prompt = usePromptModal()\n *\n * const handleClick = useCallback(async () => {\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n * // do something with accepted\n * }, [prompt])\n * ```\n */\nexport function PromptModal(\n props: PropsWithChildren<PromptModalProviderProps>,\n) {\n const resolveRef = useRef<PromptShowResult>(null)\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowPromptModalOptions | null>(null)\n const [inputValue, setInputValue] = useState<string>('')\n\n const { icons } = useCerberusContext()\n const { promptModal: PromptIcon } = icons\n\n const isValid = useMemo(\n () => inputValue === content?.key,\n [inputValue, content],\n )\n\n const palette = useMemo(\n () => (content?.kind === 'destructive' ? 'danger' : 'action'),\n [content],\n )\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setInputValue(e.currentTarget.value)\n },\n [content],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(inputValue)\n }\n setOpen(false)\n },\n [inputValue, setOpen],\n )\n\n const handleShow = useCallback(\n (options: ShowPromptModalOptions) => {\n return new Promise<string>((resolve) => {\n setContent({ ...options, kind: options.kind || 'non-destructive' })\n setOpen(true)\n resolveRef.current = resolve\n })\n },\n [setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <PromptModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <HStack\n alignSelf=\"center\"\n justify=\"center\"\n paddingBlockEnd=\"md\"\n w=\"full\"\n >\n <Show\n when={palette === 'danger'}\n fallback={\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n }\n >\n <Avatar\n ariaLabel=\"\"\n gradient=\"hades-dark\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n </Show>\n </HStack>\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n\n <VStack\n alignItems=\"flex-start\"\n marginBlockStart=\"md\"\n marginBlockEnd=\"lg\"\n w=\"full\"\n >\n <FieldRoot\n ids={{\n control: 'confirm',\n }}\n invalid={!isValid}\n >\n <FieldLabel\n className={hstack({\n gap: 'xs',\n justify: 'flex-start !important',\n marginBlockEnd: 'xs',\n textStyle: 'label-md',\n })}\n >\n Type\n <Text as=\"strong\" textTransform=\"uppercase\">\n {content?.key}\n </Text>\n to confirm\n </FieldLabel>\n <Input name=\"confirm\" onChange={handleChange} type=\"text\" />\n </FieldRoot>\n </VStack>\n\n <HStack gap=\"md\" justify=\"stretch\" w=\"full\">\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n disabled={!isValid}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n\n <DialogCloseTrigger asChild>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </DialogCloseTrigger>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </PromptModalContext.Provider>\n )\n}\n\n/**\n * Used to retrieve the context of the PromptModal provider.\n */\nexport function usePromptModal(): PromptModalValue {\n const context = useContext(PromptModalContext)\n if (context === null) {\n throw new Error('usePromptModal must be used within a PromptModal Provider')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,0BAA0B;AACnC,SAAS,QAAQ,cAAc;AAC/B,SAAS,WAAW;AACpB,SAAS,cAAc;AAoKX,SAagB,KAbhB;AA/FZ,IAAM,qBAAqB,cAAuC,IAAI;AA+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A,oBAAC,SAAM,MAAK,WAAU,UAAU,cAAc,MAAK,QAAO;AAAA;AAAA;AAAA,UAC5D;AAAA;AAAA,MACF;AAAA,MAEA,qBAAC,UAAO,KAAI,MAAK,SAAQ,WAAU,GAAE,QACnC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAS;AAAA,YACT,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,UAAU,CAAC;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA,YACT;AAAA,YACA,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ;AAAA,QAEA,oBAAC,sBAAmB,SAAO,MACzB;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,MAAK;AAAA,YACL,SAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ,GACF;AAAA,SACF;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAKO,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/context/prompt-modal.tsx"],"sourcesContent":["'use client'\n\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type MouseEvent,\n type PropsWithChildren,\n} from 'react'\nimport { DialogCloseTrigger } from '@ark-ui/react'\nimport { HStack, VStack } from '@cerberus/styled-system/jsx'\nimport { css } from '@cerberus/styled-system/css'\nimport { hstack } from '@cerberus/styled-system/patterns'\nimport { FieldLabel, FieldRoot, Input } from '../components/field/index'\nimport { Button } from '../components/button/button'\nimport { Show } from '../components/Show'\nimport { Avatar } from '../components/Avatar'\nimport { Text } from '../components/Text'\nimport { useCerberusContext } from './cerberus'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/dialog'\n\n/**\n * This module provides a context and hook for the prompt modal.\n * @module PromptModal\n */\n\nexport interface ShowPromptModalOptions {\n /**\n * The kind of prompt modal to show.\n * @default 'non-destructive'\n */\n kind?: 'destructive' | 'non-destructive'\n /**\n * The heading of the prompt modal.\n */\n heading: string\n /**\n * The description of the prompt modal.\n */\n description?: string\n /**\n * The key to confirm the action.\n */\n key: string\n /**\n * The text for the action button.\n */\n actionText: string\n /**\n * The text for the cancel button.\n */\n cancelText: string\n}\nexport type PromptShowResult =\n | ((value: string | PromiseLike<string>) => void)\n | null\n\nexport interface PromptModalValue {\n /**\n * The method to trigger the prompt modal.\n * @returns the value of the key if the action is confirmed.\n * @example\n * ```tsx\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n */\n show: (options: ShowPromptModalOptions) => Promise<string>\n}\n\nconst PromptModalContext = createContext<PromptModalValue | null>(null)\n\nexport type PromptModalProviderProps = PropsWithChildren<unknown>\n\n/**\n * Provides a prompt modal to the app.\n * @see https://cerberus.digitalu.design/react/prompt-modal\n * @example\n * ```tsx\n * // Wrap the Provider around the root of the feature.\n * <PromptModal>\n * <SomeFeatureSection />\n * </PromptModal>\n *\n * // Use the hook to show the prompt modal.\n * const prompt = usePromptModal()\n *\n * const handleClick = useCallback(async () => {\n * const accepted = await prompt.show({\n * kind: 'destructive',\n * heading: 'Delete channel?',\n * description:\n * 'This will permanently delete a channel on your account. There is no going back.',\n * key: CHANNEL_NAME,\n * actionText: 'Yes, delete channel',\n * cancelText: 'No, cancel',\n * })\n * // do something with accepted\n * }, [prompt])\n * ```\n */\nexport function PromptModal(\n props: PropsWithChildren<PromptModalProviderProps>,\n) {\n const resolveRef = useRef<PromptShowResult>(null)\n const [open, setOpen] = useState<boolean>(false)\n const [content, setContent] = useState<ShowPromptModalOptions | null>(null)\n const [inputValue, setInputValue] = useState<string>('')\n\n const { icons } = useCerberusContext()\n const { promptModal: PromptIcon } = icons\n\n const isValid = useMemo(\n () => inputValue === content?.key,\n [inputValue, content],\n )\n\n const palette = useMemo(\n () => (content?.kind === 'destructive' ? 'danger' : 'action'),\n [content],\n )\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setInputValue(e.currentTarget.value)\n },\n [content],\n )\n\n const handleChoice = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n const target = e.currentTarget as HTMLButtonElement\n if (target.value === 'true') {\n resolveRef.current?.(inputValue)\n }\n setOpen(false)\n },\n [inputValue, setOpen],\n )\n\n const handleShow = useCallback(\n (options: ShowPromptModalOptions) => {\n return new Promise<string>((resolve) => {\n setContent({ ...options, kind: options.kind || 'non-destructive' })\n setOpen(true)\n resolveRef.current = resolve\n })\n },\n [setOpen],\n )\n\n const value = useMemo(\n () => ({\n show: handleShow,\n }),\n [handleShow],\n )\n\n return (\n <PromptModalContext.Provider value={value}>\n {props.children}\n\n <DialogProvider open={open} onOpenChange={(e) => setOpen(e.open)}>\n <Dialog size=\"sm\">\n <VStack gap=\"xl\" w=\"full\">\n <VStack alignItems=\"flex-start\" gap=\"md\" w=\"full\">\n <HStack\n alignSelf=\"center\"\n justify=\"center\"\n paddingBlockEnd=\"md\"\n w=\"full\"\n >\n <Show\n when={palette === 'danger'}\n fallback={\n <Avatar\n ariaLabel=\"\"\n gradient=\"charon-light\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n }\n >\n <Avatar\n ariaLabel=\"\"\n gradient=\"hades-dark\"\n icon={<PromptIcon size={24} />}\n src=\"\"\n />\n </Show>\n </HStack>\n <DialogHeading>{content?.heading}</DialogHeading>\n <DialogDescription>{content?.description}</DialogDescription>\n </VStack>\n\n <VStack\n alignItems=\"flex-start\"\n marginBlockStart=\"md\"\n marginBlockEnd=\"lg\"\n w=\"full\"\n >\n <FieldRoot\n ids={{\n control: 'confirm',\n }}\n invalid={!isValid}\n >\n <FieldLabel\n className={hstack({\n gap: 'xs',\n justify: 'flex-start !important',\n marginBlockEnd: 'xs',\n textStyle: 'label-md',\n })}\n >\n Type\n <Text as=\"strong\" textTransform=\"uppercase\">\n {content?.key}\n </Text>\n to confirm\n </FieldLabel>\n <Input name=\"confirm\" onChange={handleChange} type=\"text\" />\n </FieldRoot>\n </VStack>\n\n <HStack gap=\"md\" justify=\"stretch\" w=\"full\">\n <Button\n autoFocus\n className={css({\n w: '1/2',\n })}\n disabled={!isValid}\n name=\"confirm\"\n onClick={handleChoice}\n palette={palette}\n value=\"true\"\n >\n {content?.actionText}\n </Button>\n\n <DialogCloseTrigger asChild>\n <Button\n className={css({\n w: '1/2',\n })}\n name=\"cancel\"\n onClick={handleChoice}\n usage=\"outlined\"\n value=\"false\"\n >\n {content?.cancelText}\n </Button>\n </DialogCloseTrigger>\n </HStack>\n </VStack>\n </Dialog>\n </DialogProvider>\n </PromptModalContext.Provider>\n )\n}\n\n/**\n * Used to retrieve the context of the PromptModal provider.\n */\nexport function usePromptModal(): PromptModalValue {\n const context = useContext(PromptModalContext)\n if (context === null) {\n throw new Error('usePromptModal must be used within a PromptModal Provider')\n }\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AACP,SAAS,0BAA0B;AACnC,SAAS,QAAQ,cAAc;AAC/B,SAAS,WAAW;AACpB,SAAS,cAAc;AAoKX,SAagB,KAbhB;AA/FZ,IAAM,qBAAqB,cAAuC,IAAI;AA+B/D,SAAS,YACd,OACA;AACA,QAAM,aAAa,OAAyB,IAAI;AAChD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAkB,KAAK;AAC/C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAwC,IAAI;AA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nC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAS;AAAA,YACT,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,UAAU,CAAC;AAAA,YACX,MAAK;AAAA,YACL,SAAS;AAAA,YACT;AAAA,YACA,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ;AAAA,QAEA,oBAAC,sBAAmB,SAAO,MACzB;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,IAAI;AAAA,cACb,GAAG;AAAA,YACL,CAAC;AAAA,YACD,MAAK;AAAA,YACL,SAAS;AAAA,YACT,OAAM;AAAA,YACN,OAAM;AAAA,YAEL,mBAAS;AAAA;AAAA,QACZ,GACF;AAAA,SACF;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAKO,SAAS,iBAAmC;AACjD,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAO;AACT;","names":[]}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
FileStatus,
|
|
4
4
|
processStatus
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-CF3EHG42.js";
|
|
6
6
|
import "../chunk-WZJ5UQNM.js";
|
|
7
|
-
import "../chunk-APD6IX5R.js";
|
|
8
7
|
import "../chunk-SXLPDPOZ.js";
|
|
8
|
+
import "../chunk-APD6IX5R.js";
|
|
9
9
|
import "../chunk-TYPULJMJ.js";
|
|
10
10
|
import "../chunk-FBS7AX76.js";
|
|
11
11
|
import "../chunk-6I2FW4WI.js";
|
|
@@ -2,18 +2,21 @@ import "../../chunk-IKDXADLX.js";
|
|
|
2
2
|
import {
|
|
3
3
|
CTAModal,
|
|
4
4
|
useCTAModal
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-4WKM2MJC.js";
|
|
6
6
|
import "../../chunk-4LSTU6WU.js";
|
|
7
7
|
import "../../chunk-MVO2GNUA.js";
|
|
8
8
|
import "../../chunk-DXOKSZVQ.js";
|
|
9
|
-
import "../../chunk-6BN3XKQF.js";
|
|
10
|
-
import "../../chunk-APD6IX5R.js";
|
|
11
|
-
import "../../chunk-TFL56AYR.js";
|
|
12
9
|
import "../../chunk-SXLPDPOZ.js";
|
|
13
|
-
import "../../chunk-IQJDVFPP.js";
|
|
14
10
|
import {
|
|
15
11
|
createCTAModalActions
|
|
16
12
|
} from "../../chunk-PLHYOCY3.js";
|
|
13
|
+
import "../../chunk-DJOYRUNT.js";
|
|
14
|
+
import "../../chunk-NZKE7C53.js";
|
|
15
|
+
import "../../chunk-C45HS2C4.js";
|
|
16
|
+
import "../../chunk-APD6IX5R.js";
|
|
17
|
+
import "../../chunk-IQJDVFPP.js";
|
|
18
|
+
import "../../chunk-FCSO6N2Y.js";
|
|
19
|
+
import "../../chunk-D7UIWAFO.js";
|
|
17
20
|
import "../../chunk-GITT5645.js";
|
|
18
21
|
import "../../chunk-6KZVE4HC.js";
|
|
19
22
|
import "../../chunk-7SYJFI5E.js";
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CTAModal,
|
|
4
4
|
useCTAModal
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-4WKM2MJC.js";
|
|
6
6
|
import "../../chunk-4LSTU6WU.js";
|
|
7
7
|
import "../../chunk-MVO2GNUA.js";
|
|
8
8
|
import "../../chunk-DXOKSZVQ.js";
|
|
9
|
-
import "../../chunk-6BN3XKQF.js";
|
|
10
|
-
import "../../chunk-APD6IX5R.js";
|
|
11
|
-
import "../../chunk-TFL56AYR.js";
|
|
12
9
|
import "../../chunk-SXLPDPOZ.js";
|
|
10
|
+
import "../../chunk-DJOYRUNT.js";
|
|
11
|
+
import "../../chunk-NZKE7C53.js";
|
|
12
|
+
import "../../chunk-C45HS2C4.js";
|
|
13
|
+
import "../../chunk-APD6IX5R.js";
|
|
13
14
|
import "../../chunk-IQJDVFPP.js";
|
|
15
|
+
import "../../chunk-FCSO6N2Y.js";
|
|
16
|
+
import "../../chunk-D7UIWAFO.js";
|
|
14
17
|
import "../../chunk-GITT5645.js";
|
|
15
18
|
import "../../chunk-6KZVE4HC.js";
|
|
16
19
|
import "../../chunk-7SYJFI5E.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
DialogCloseIconTrigger
|
|
4
|
+
} from "../../chunk-NZKE7C53.js";
|
|
5
|
+
import "../../chunk-APD6IX5R.js";
|
|
6
|
+
import "../../chunk-D7UIWAFO.js";
|
|
7
|
+
import "../../chunk-GITT5645.js";
|
|
8
|
+
export {
|
|
9
|
+
DialogCloseIconTrigger
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=close-icon-trigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "../../chunk-DJOYRUNT.js";
|
|
2
|
+
import {
|
|
3
|
+
DialogCloseIconTrigger
|
|
4
|
+
} from "../../chunk-NZKE7C53.js";
|
|
5
|
+
import {
|
|
6
|
+
Dialog
|
|
7
|
+
} from "../../chunk-C45HS2C4.js";
|
|
8
|
+
import "../../chunk-APD6IX5R.js";
|
|
9
|
+
import "../../chunk-IQJDVFPP.js";
|
|
10
|
+
import {
|
|
11
|
+
DialogParts
|
|
12
|
+
} from "../../chunk-FCSO6N2Y.js";
|
|
13
|
+
import {
|
|
14
|
+
DialogBackdrop,
|
|
15
|
+
DialogCloseTrigger,
|
|
16
|
+
DialogContent,
|
|
17
|
+
DialogDescription,
|
|
18
|
+
DialogHeading,
|
|
19
|
+
DialogPositioner,
|
|
20
|
+
DialogProvider,
|
|
21
|
+
DialogRoot,
|
|
22
|
+
DialogTrigger
|
|
23
|
+
} from "../../chunk-D7UIWAFO.js";
|
|
24
|
+
import "../../chunk-GITT5645.js";
|
|
25
|
+
export {
|
|
26
|
+
Dialog,
|
|
27
|
+
DialogBackdrop,
|
|
28
|
+
DialogCloseIconTrigger,
|
|
29
|
+
DialogCloseTrigger,
|
|
30
|
+
DialogContent,
|
|
31
|
+
DialogDescription,
|
|
32
|
+
DialogHeading,
|
|
33
|
+
DialogParts,
|
|
34
|
+
DialogPositioner,
|
|
35
|
+
DialogProvider,
|
|
36
|
+
DialogRoot,
|
|
37
|
+
DialogTrigger
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Dialog,
|
|
3
2
|
DialogBackdrop,
|
|
4
3
|
DialogCloseTrigger,
|
|
5
4
|
DialogContent,
|
|
@@ -7,11 +6,10 @@ import {
|
|
|
7
6
|
DialogHeading,
|
|
8
7
|
DialogPositioner,
|
|
9
8
|
DialogProvider,
|
|
9
|
+
DialogRoot,
|
|
10
10
|
DialogTrigger
|
|
11
|
-
} from "
|
|
12
|
-
import "../chunk-IQJDVFPP.js";
|
|
11
|
+
} from "../../chunk-D7UIWAFO.js";
|
|
13
12
|
export {
|
|
14
|
-
Dialog,
|
|
15
13
|
DialogBackdrop,
|
|
16
14
|
DialogCloseTrigger,
|
|
17
15
|
DialogContent,
|
|
@@ -19,6 +17,7 @@ export {
|
|
|
19
17
|
DialogHeading,
|
|
20
18
|
DialogPositioner,
|
|
21
19
|
DialogProvider,
|
|
20
|
+
DialogRoot,
|
|
22
21
|
DialogTrigger
|
|
23
22
|
};
|
|
24
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../../chunk-2LF3HPNA.js";
|
|
2
|
-
import {
|
|
3
|
-
OptionGroup,
|
|
4
|
-
OptionGroupLabel
|
|
5
|
-
} from "../../chunk-IASVL7CW.js";
|
|
6
2
|
import {
|
|
7
3
|
Option,
|
|
8
4
|
Select
|
|
9
5
|
} from "../../chunk-6ICNCCPD.js";
|
|
6
|
+
import {
|
|
7
|
+
OptionGroup,
|
|
8
|
+
OptionGroupLabel
|
|
9
|
+
} from "../../chunk-IASVL7CW.js";
|
|
10
10
|
import {
|
|
11
11
|
SelectParts
|
|
12
12
|
} from "../../chunk-XTNGF4D6.js";
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfirmModal,
|
|
4
4
|
useConfirmModal
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-TFL56AYR.js";
|
|
5
|
+
} from "../chunk-MTZDZXZM.js";
|
|
7
6
|
import "../chunk-SXLPDPOZ.js";
|
|
7
|
+
import "../chunk-DJOYRUNT.js";
|
|
8
|
+
import "../chunk-NZKE7C53.js";
|
|
9
|
+
import "../chunk-C45HS2C4.js";
|
|
10
|
+
import "../chunk-APD6IX5R.js";
|
|
8
11
|
import "../chunk-IQJDVFPP.js";
|
|
12
|
+
import "../chunk-FCSO6N2Y.js";
|
|
13
|
+
import "../chunk-D7UIWAFO.js";
|
|
9
14
|
import "../chunk-GITT5645.js";
|
|
10
15
|
import "../chunk-6KZVE4HC.js";
|
|
11
16
|
import "../chunk-7SYJFI5E.js";
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PromptModal,
|
|
4
4
|
usePromptModal
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-OOUNB643.js";
|
|
6
6
|
import "../chunk-RU5LOXWI.js";
|
|
7
|
-
import "../chunk-TFL56AYR.js";
|
|
8
7
|
import "../chunk-SXLPDPOZ.js";
|
|
8
|
+
import "../chunk-DJOYRUNT.js";
|
|
9
|
+
import "../chunk-NZKE7C53.js";
|
|
10
|
+
import "../chunk-C45HS2C4.js";
|
|
11
|
+
import "../chunk-APD6IX5R.js";
|
|
9
12
|
import "../chunk-IQJDVFPP.js";
|
|
13
|
+
import "../chunk-FCSO6N2Y.js";
|
|
14
|
+
import "../chunk-D7UIWAFO.js";
|
|
10
15
|
import "../chunk-TYPULJMJ.js";
|
|
11
16
|
import "../chunk-FBS7AX76.js";
|
|
12
17
|
import "../chunk-6I2FW4WI.js";
|
package/build/modern/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
ConfirmModal,
|
|
34
34
|
useConfirmModal
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-MTZDZXZM.js";
|
|
36
36
|
import {
|
|
37
37
|
NavMenu,
|
|
38
38
|
useNavMenuContext
|
|
@@ -40,11 +40,11 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
NotificationCenter,
|
|
42
42
|
useNotificationCenter
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-6DAOKE6Z.js";
|
|
44
44
|
import {
|
|
45
45
|
PromptModal,
|
|
46
46
|
usePromptModal
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-OOUNB643.js";
|
|
48
48
|
import {
|
|
49
49
|
ThemeProvider,
|
|
50
50
|
useThemeContext
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
import {
|
|
97
97
|
FileStatus,
|
|
98
98
|
processStatus
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-CF3EHG42.js";
|
|
100
100
|
import {
|
|
101
101
|
ProgressBar
|
|
102
102
|
} from "./chunk-WZJ5UQNM.js";
|
|
@@ -121,6 +121,12 @@ import {
|
|
|
121
121
|
import {
|
|
122
122
|
NotificationDescription
|
|
123
123
|
} from "./chunk-UXY3KCC3.js";
|
|
124
|
+
import {
|
|
125
|
+
Admonition,
|
|
126
|
+
AdmonitionDescription,
|
|
127
|
+
AdmonitionHeading
|
|
128
|
+
} from "./chunk-DXBZ3HMY.js";
|
|
129
|
+
import "./chunk-2HOUQ2DX.js";
|
|
124
130
|
import {
|
|
125
131
|
CircularProgress
|
|
126
132
|
} from "./chunk-6QHOKCV3.js";
|
|
@@ -149,6 +155,14 @@ import {
|
|
|
149
155
|
import {
|
|
150
156
|
Droppable
|
|
151
157
|
} from "./chunk-TKI2CKHH.js";
|
|
158
|
+
import "./chunk-V4YYGGMH.js";
|
|
159
|
+
import {
|
|
160
|
+
ToggleParts
|
|
161
|
+
} from "./chunk-2CVGNLIM.js";
|
|
162
|
+
import {
|
|
163
|
+
ToggleIndicator,
|
|
164
|
+
ToggleRoot
|
|
165
|
+
} from "./chunk-CIMY2U22.js";
|
|
152
166
|
import "./chunk-V3M3ZOQI.js";
|
|
153
167
|
import {
|
|
154
168
|
AccordionItemGroup
|
|
@@ -162,12 +176,19 @@ import {
|
|
|
162
176
|
AccordionItemContent,
|
|
163
177
|
AccordionItemTrigger
|
|
164
178
|
} from "./chunk-AZRFYQO7.js";
|
|
179
|
+
import "./chunk-IDTAB2UJ.js";
|
|
165
180
|
import {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
181
|
+
Fieldset
|
|
182
|
+
} from "./chunk-AO3GB72J.js";
|
|
183
|
+
import {
|
|
184
|
+
FieldsetParts
|
|
185
|
+
} from "./chunk-7TQRTBUP.js";
|
|
186
|
+
import {
|
|
187
|
+
FieldsetErrorText,
|
|
188
|
+
FieldsetHelperText,
|
|
189
|
+
FieldsetLegend,
|
|
190
|
+
FieldsetRoot
|
|
191
|
+
} from "./chunk-Z3FDG263.js";
|
|
171
192
|
import "./chunk-OGYMMATX.js";
|
|
172
193
|
import {
|
|
173
194
|
Radio
|
|
@@ -202,14 +223,14 @@ import {
|
|
|
202
223
|
RatingRoot
|
|
203
224
|
} from "./chunk-W47QEZD5.js";
|
|
204
225
|
import "./chunk-2LF3HPNA.js";
|
|
205
|
-
import {
|
|
206
|
-
OptionGroup,
|
|
207
|
-
OptionGroupLabel
|
|
208
|
-
} from "./chunk-IASVL7CW.js";
|
|
209
226
|
import {
|
|
210
227
|
Option,
|
|
211
228
|
Select
|
|
212
229
|
} from "./chunk-6ICNCCPD.js";
|
|
230
|
+
import {
|
|
231
|
+
OptionGroup,
|
|
232
|
+
OptionGroupLabel
|
|
233
|
+
} from "./chunk-IASVL7CW.js";
|
|
213
234
|
import {
|
|
214
235
|
SelectParts
|
|
215
236
|
} from "./chunk-XTNGF4D6.js";
|
|
@@ -246,14 +267,6 @@ import {
|
|
|
246
267
|
SwitchRoot,
|
|
247
268
|
SwitchThumb
|
|
248
269
|
} from "./chunk-LZWNHXRP.js";
|
|
249
|
-
import "./chunk-V4YYGGMH.js";
|
|
250
|
-
import {
|
|
251
|
-
ToggleParts
|
|
252
|
-
} from "./chunk-2CVGNLIM.js";
|
|
253
|
-
import {
|
|
254
|
-
ToggleIndicator,
|
|
255
|
-
ToggleRoot
|
|
256
|
-
} from "./chunk-CIMY2U22.js";
|
|
257
270
|
import "./chunk-TIJAFPHQ.js";
|
|
258
271
|
import {
|
|
259
272
|
Checkbox
|
|
@@ -277,20 +290,35 @@ import "./chunk-IKDXADLX.js";
|
|
|
277
290
|
import {
|
|
278
291
|
CTAModal,
|
|
279
292
|
useCTAModal
|
|
280
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-4WKM2MJC.js";
|
|
281
294
|
import "./chunk-4LSTU6WU.js";
|
|
282
295
|
import "./chunk-MVO2GNUA.js";
|
|
283
296
|
import {
|
|
284
297
|
For
|
|
285
298
|
} from "./chunk-DXOKSZVQ.js";
|
|
299
|
+
import {
|
|
300
|
+
Avatar
|
|
301
|
+
} from "./chunk-SXLPDPOZ.js";
|
|
302
|
+
import {
|
|
303
|
+
createCTAModalActions
|
|
304
|
+
} from "./chunk-PLHYOCY3.js";
|
|
305
|
+
import "./chunk-DJOYRUNT.js";
|
|
286
306
|
import {
|
|
287
307
|
DialogCloseIconTrigger
|
|
288
|
-
} from "./chunk-
|
|
308
|
+
} from "./chunk-NZKE7C53.js";
|
|
309
|
+
import {
|
|
310
|
+
Dialog
|
|
311
|
+
} from "./chunk-C45HS2C4.js";
|
|
289
312
|
import {
|
|
290
313
|
IconButton
|
|
291
314
|
} from "./chunk-APD6IX5R.js";
|
|
292
315
|
import {
|
|
293
|
-
|
|
316
|
+
Portal
|
|
317
|
+
} from "./chunk-IQJDVFPP.js";
|
|
318
|
+
import {
|
|
319
|
+
DialogParts
|
|
320
|
+
} from "./chunk-FCSO6N2Y.js";
|
|
321
|
+
import {
|
|
294
322
|
DialogBackdrop,
|
|
295
323
|
DialogCloseTrigger,
|
|
296
324
|
DialogContent,
|
|
@@ -298,17 +326,9 @@ import {
|
|
|
298
326
|
DialogHeading,
|
|
299
327
|
DialogPositioner,
|
|
300
328
|
DialogProvider,
|
|
329
|
+
DialogRoot,
|
|
301
330
|
DialogTrigger
|
|
302
|
-
} from "./chunk-
|
|
303
|
-
import {
|
|
304
|
-
Avatar
|
|
305
|
-
} from "./chunk-SXLPDPOZ.js";
|
|
306
|
-
import {
|
|
307
|
-
Portal
|
|
308
|
-
} from "./chunk-IQJDVFPP.js";
|
|
309
|
-
import {
|
|
310
|
-
createCTAModalActions
|
|
311
|
-
} from "./chunk-PLHYOCY3.js";
|
|
331
|
+
} from "./chunk-D7UIWAFO.js";
|
|
312
332
|
import "./chunk-TYPULJMJ.js";
|
|
313
333
|
import {
|
|
314
334
|
Field
|
|
@@ -337,19 +357,6 @@ import {
|
|
|
337
357
|
CerberusProvider,
|
|
338
358
|
useCerberusContext
|
|
339
359
|
} from "./chunk-GITT5645.js";
|
|
340
|
-
import "./chunk-IDTAB2UJ.js";
|
|
341
|
-
import {
|
|
342
|
-
Fieldset
|
|
343
|
-
} from "./chunk-AO3GB72J.js";
|
|
344
|
-
import {
|
|
345
|
-
FieldsetParts
|
|
346
|
-
} from "./chunk-7TQRTBUP.js";
|
|
347
|
-
import {
|
|
348
|
-
FieldsetErrorText,
|
|
349
|
-
FieldsetHelperText,
|
|
350
|
-
FieldsetLegend,
|
|
351
|
-
FieldsetRoot
|
|
352
|
-
} from "./chunk-Z3FDG263.js";
|
|
353
360
|
import {
|
|
354
361
|
useModal
|
|
355
362
|
} from "./chunk-KGQG5JGW.js";
|
|
@@ -463,8 +470,10 @@ export {
|
|
|
463
470
|
DialogContent,
|
|
464
471
|
DialogDescription,
|
|
465
472
|
DialogHeading,
|
|
473
|
+
DialogParts,
|
|
466
474
|
DialogPositioner,
|
|
467
475
|
DialogProvider,
|
|
476
|
+
DialogRoot,
|
|
468
477
|
DialogTrigger,
|
|
469
478
|
Droppable,
|
|
470
479
|
FeatureFlag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// deprecated\n\nexport * from './components/deprecated/FieldMessage'\nexport * from './components/deprecated/FieldsetLabel'\nexport * from './components/deprecated/Label'\nexport * from './components/deprecated/Modal'\nexport * from './components/deprecated/ModalHeader'\nexport * from './components/deprecated/ModalHeading'\nexport * from './components/deprecated/ModalDescription'\nexport * from './components/deprecated/NavMenuTrigger'\nexport * from './components/deprecated/NavMenuList'\nexport * from './components/deprecated/NavMenuLink'\nexport * from './hooks/useDate'\nexport * from './hooks/useModal'\nexport * from './hooks/useToggle'\n\n// components\n\nexport * from './components/Accordion'\nexport * from './components/Accordion.client'\nexport * from './components/AccordionItemGroup'\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/button/index'\nexport * from './components/checkbox/index'\nexport * from './components/CircularProgress'\nexport * from './components/cta-dialog/index'\nexport * from './components/DatePicker.client'\nexport * from './components/DatePicker.server'\nexport * from './components/
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/**\n * This module is the entry point for the Cerberus React package.\n * @module\n */\n\n// deprecated\n\nexport * from './components/deprecated/FieldMessage'\nexport * from './components/deprecated/FieldsetLabel'\nexport * from './components/deprecated/Label'\nexport * from './components/deprecated/Modal'\nexport * from './components/deprecated/ModalHeader'\nexport * from './components/deprecated/ModalHeading'\nexport * from './components/deprecated/ModalDescription'\nexport * from './components/deprecated/NavMenuTrigger'\nexport * from './components/deprecated/NavMenuList'\nexport * from './components/deprecated/NavMenuLink'\nexport * from './hooks/useDate'\nexport * from './hooks/useModal'\nexport * from './hooks/useToggle'\n\n// components\n\nexport * from './components/Accordion'\nexport * from './components/Accordion.client'\nexport * from './components/AccordionItemGroup'\nexport * from './components/Admonition'\nexport * from './components/Avatar'\nexport * from './components/button/index'\nexport * from './components/checkbox/index'\nexport * from './components/CircularProgress'\nexport * from './components/cta-dialog/index'\nexport * from './components/DatePicker.client'\nexport * from './components/DatePicker.server'\nexport * from './components/dialog/index'\nexport * from './components/Droppable'\nexport * from './components/FeatureFlag'\nexport * from './components/field/index'\nexport * from './components/fieldset/index'\nexport * from './components/FileStatus'\nexport * from './components/FileUploader'\nexport * from './components/for'\nexport * from './components/IconButton'\nexport * from './components/Legend'\nexport * from './components/Menu'\nexport * from './components/Notification'\nexport * from './components/NotificationHeading'\nexport * from './components/NotificationDescription'\nexport * from './components/Portal'\nexport * from './components/ProgressBar'\nexport * from './components/radio/index'\nexport * from './components/rating/index'\nexport * from './components/select/index'\nexport * from './components/Show'\nexport * from './components/Spinner'\nexport * from './components/switch/index'\nexport * from './components/Tabs.client'\nexport * from './components/Table'\nexport * from './components/Thead'\nexport * from './components/Th'\nexport * from './components/Td'\nexport * from './components/Tbody'\nexport * from './components/Tag'\nexport * from './components/Text'\nexport * from './components/toggle/index'\nexport * from './components/Tooltip'\n\n// context\n\nexport * from './context/cerberus'\nexport * from './context/confirm-modal'\nexport * from './context/feature-flags'\nexport * from './context/navMenu'\nexport * from './context/notification-center'\nexport * from './context/prompt-modal'\nexport * from './context/tabs'\nexport * from './context/theme'\n\n// hooks\n\nexport * from './hooks/useTheme'\nexport * from './hooks/useRootColors'\n\n// aria-helpers\n\nexport * from './aria-helpers/nav-menu.aria'\nexport * from './aria-helpers/trap-focus.aria'\n\n// utils\n\nexport * from './config/index'\nexport * from './utils/index'\n\n// shared types\n\nexport * from './types'\n\n// 3rd party\n\nexport * from '@dnd-kit/core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerberus-design/react",
|
|
3
|
-
"version": "0.16.0-next-
|
|
3
|
+
"version": "0.16.0-next-1e5283a",
|
|
4
4
|
"description": "The Cerberus Design React component library.",
|
|
5
5
|
"browserslist": "> 0.25%, not dead",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-dom": "^18",
|
|
27
27
|
"tsup": "^8.1.0",
|
|
28
28
|
"@cerberus-design/configs": "0.0.0",
|
|
29
|
-
"@cerberus/styled-system": "npm:@cerberus-design/styled-system@0.16.0-next-
|
|
29
|
+
"@cerberus/styled-system": "npm:@cerberus-design/styled-system@0.16.0-next-1e5283a"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
DialogDescription,
|
|
20
20
|
DialogHeading,
|
|
21
21
|
DialogProvider,
|
|
22
|
-
} from '../
|
|
23
|
-
import { DialogCloseIconTrigger } from '../
|
|
22
|
+
} from '../dialog'
|
|
23
|
+
import { DialogCloseIconTrigger } from '../dialog/close-icon-trigger'
|
|
24
24
|
import type { CTAButtonAction, CTAModalActionReturn } from './utils'
|
|
25
25
|
import {
|
|
26
26
|
CTAModalContext,
|