@cerberus-design/react 0.18.3 → 0.18.4
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 +87 -25
- package/build/legacy/components/FileStatus.cjs +34 -26
- package/build/legacy/components/FileStatus.cjs.map +1 -1
- package/build/legacy/components/Text.cjs +17 -23
- package/build/legacy/components/Text.cjs.map +1 -1
- package/build/legacy/components/checkbox/checkbox.cjs +17 -23
- package/build/legacy/components/checkbox/checkbox.cjs.map +1 -1
- package/build/legacy/components/checkbox/index.cjs +17 -23
- package/build/legacy/components/checkbox/index.cjs.map +1 -1
- package/build/legacy/components/cta-dialog/index.cjs +44 -35
- package/build/legacy/components/cta-dialog/index.cjs.map +1 -1
- package/build/legacy/components/cta-dialog/provider.cjs +44 -35
- package/build/legacy/components/cta-dialog/provider.cjs.map +1 -1
- package/build/legacy/components/date-picker/date-picker.cjs.map +1 -1
- package/build/legacy/components/date-picker/day-view.d.cts +1 -1
- package/build/legacy/components/date-picker/index.cjs +29 -21
- package/build/legacy/components/date-picker/index.cjs.map +1 -1
- package/build/legacy/components/date-picker/index.d.cts +6 -0
- package/build/legacy/components/date-picker/input.cjs +2 -2
- package/build/legacy/components/date-picker/input.cjs.map +1 -1
- package/build/legacy/components/date-picker/range-input.cjs +2 -9
- package/build/legacy/components/date-picker/range-input.cjs.map +1 -1
- package/build/legacy/components/deprecated/Label.cjs.map +1 -1
- package/build/legacy/components/dialog/close-icon-trigger.cjs.map +1 -1
- package/build/legacy/components/dialog/dialog.cjs +2 -2
- package/build/legacy/components/dialog/dialog.cjs.map +1 -1
- package/build/legacy/components/dialog/index.cjs +2 -2
- package/build/legacy/components/dialog/index.cjs.map +1 -1
- package/build/legacy/components/dialog/index.d.cts +1 -0
- package/build/legacy/components/dialog/parts.cjs +2 -2
- package/build/legacy/components/dialog/parts.cjs.map +1 -1
- package/build/legacy/components/dialog/primitives.cjs +2 -2
- package/build/legacy/components/dialog/primitives.cjs.map +1 -1
- package/build/legacy/components/field/field.cjs +15 -9
- package/build/legacy/components/field/field.cjs.map +1 -1
- package/build/legacy/components/field/helper-text.cjs +53 -0
- package/build/legacy/components/field/helper-text.cjs.map +1 -0
- package/build/legacy/components/field/helper-text.d.cts +1 -0
- package/build/legacy/components/field/index.cjs +15 -9
- package/build/legacy/components/field/index.cjs.map +1 -1
- package/build/legacy/components/field/parts.cjs +0 -1
- package/build/legacy/components/field/parts.cjs.map +1 -1
- package/build/legacy/components/field/primitives.cjs +0 -1
- package/build/legacy/components/field/primitives.cjs.map +1 -1
- package/build/legacy/context/confirm-modal.cjs +85 -58
- package/build/legacy/context/confirm-modal.cjs.map +1 -1
- package/build/legacy/context/field.cjs.map +1 -1
- package/build/legacy/context/prompt-modal.cjs +120 -118
- package/build/legacy/context/prompt-modal.cjs.map +1 -1
- package/build/legacy/index.cjs +767 -715
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +11 -0
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +1 -0
- package/build/modern/_tsup-dts-rollup.d.ts +87 -25
- package/build/modern/chunk-2U2JYN3D.js +15 -0
- package/build/modern/chunk-2U2JYN3D.js.map +1 -0
- package/build/modern/chunk-ADI4DOEW.js +17 -0
- package/build/modern/chunk-ADI4DOEW.js.map +1 -0
- package/build/modern/{chunk-GBCF6DOS.js → chunk-AN65HXHS.js} +2 -2
- package/build/modern/{chunk-Z2KBUTCO.js → chunk-BMDNCJUB.js} +2 -2
- package/build/modern/chunk-BMDNCJUB.js.map +1 -0
- package/build/modern/{chunk-F3XFJHGR.js → chunk-D7PY357P.js} +2 -2
- package/build/modern/{chunk-ILROS7ST.js → chunk-DVCTN3GN.js} +2 -2
- package/build/modern/{chunk-NP73HOHI.js → chunk-GJBUGESH.js} +3 -3
- package/build/modern/{chunk-NP73HOHI.js.map → chunk-GJBUGESH.js.map} +1 -1
- package/build/modern/{chunk-KABRV6TB.js → chunk-JXWNDJJW.js} +3 -3
- package/build/modern/{chunk-SSR3CWJZ.js → chunk-LUGOJGMO.js} +4 -4
- package/build/modern/chunk-LUGOJGMO.js.map +1 -0
- package/build/modern/{chunk-3IT3V3YA.js → chunk-M3TZCQ7J.js} +4 -4
- package/build/modern/{chunk-WEL43I6Y.js → chunk-OK3VJFQL.js} +1 -2
- package/build/modern/{chunk-WEL43I6Y.js.map → chunk-OK3VJFQL.js.map} +1 -1
- package/build/modern/{chunk-ADZRQNW3.js → chunk-P7FPAUWN.js} +3 -9
- package/build/modern/chunk-P7FPAUWN.js.map +1 -0
- package/build/modern/{chunk-OY7BOKWW.js → chunk-QBA6KLL7.js} +2 -2
- package/build/modern/chunk-RMSM3XPV.js +218 -0
- package/build/modern/chunk-RMSM3XPV.js.map +1 -0
- package/build/modern/{chunk-LEBDLXJE.js → chunk-RTLS6K4E.js} +9 -6
- package/build/modern/chunk-RTLS6K4E.js.map +1 -0
- package/build/modern/{chunk-A5UXCB4L.js → chunk-SHBKM6EW.js} +43 -34
- package/build/modern/chunk-SHBKM6EW.js.map +1 -0
- package/build/modern/{chunk-CEJIKL6N.js → chunk-T44C3KQO.js} +1 -1
- package/build/modern/chunk-T44C3KQO.js.map +1 -0
- package/build/modern/{chunk-V6EAWUCQ.js → chunk-TRT6OCHJ.js} +2 -2
- package/build/modern/chunk-WSOITM7D.js +182 -0
- package/build/modern/chunk-WSOITM7D.js.map +1 -0
- package/build/modern/chunk-ZPHPCKAG.js +41 -0
- package/build/modern/chunk-ZPHPCKAG.js.map +1 -0
- package/build/modern/components/FileStatus.js +5 -4
- package/build/modern/components/Text.js +1 -1
- package/build/modern/components/admonition/admonition.js +2 -2
- package/build/modern/components/admonition/index.js +2 -2
- package/build/modern/components/checkbox/checkbox.js +2 -2
- package/build/modern/components/checkbox/index.js +2 -2
- package/build/modern/components/cta-dialog/index.js +5 -5
- package/build/modern/components/cta-dialog/provider.js +5 -5
- package/build/modern/components/date-picker/date-picker.js +1 -1
- package/build/modern/components/date-picker/day-view.d.ts +1 -1
- package/build/modern/components/date-picker/index.d.ts +6 -0
- package/build/modern/components/date-picker/index.js +16 -5
- package/build/modern/components/date-picker/input.js +1 -1
- package/build/modern/components/date-picker/range-input.js +1 -2
- package/build/modern/components/deprecated/Label.js +5 -4
- package/build/modern/components/dialog/close-icon-trigger.js +2 -2
- package/build/modern/components/dialog/dialog.js +2 -2
- package/build/modern/components/dialog/index.d.ts +1 -0
- package/build/modern/components/dialog/index.js +4 -4
- package/build/modern/components/dialog/parts.js +2 -2
- package/build/modern/components/dialog/primitives.js +1 -1
- package/build/modern/components/field/field.js +3 -2
- package/build/modern/components/field/helper-text.d.ts +1 -0
- package/build/modern/components/field/helper-text.js +11 -0
- package/build/modern/components/field/index.js +4 -3
- package/build/modern/components/field/parts.js +2 -2
- package/build/modern/components/field/primitives.js +1 -1
- package/build/modern/components/notifications/index.js +1 -1
- package/build/modern/context/confirm-modal.js +5 -5
- package/build/modern/context/field.js +1 -1
- package/build/modern/context/prompt-modal.js +10 -9
- package/build/modern/index.d.ts +11 -0
- package/build/modern/index.js +52 -40
- package/build/modern/index.js.map +1 -1
- package/build/modern/types.d.ts +1 -0
- package/package.json +10 -9
- package/src/components/Text.tsx +20 -23
- package/src/components/cta-dialog/provider.tsx +6 -1
- package/src/components/date-picker/date-picker.tsx +8 -5
- package/src/components/date-picker/index.ts +10 -0
- package/src/components/date-picker/input.tsx +1 -1
- package/src/components/date-picker/range-input.tsx +9 -24
- package/src/components/dialog/dialog.tsx +4 -2
- package/src/components/dialog/index.ts +4 -0
- package/src/components/dialog/primitives.tsx +7 -4
- package/src/components/field/field.tsx +11 -9
- package/src/components/field/helper-text.tsx +20 -0
- package/src/components/field/primitives.tsx +0 -3
- package/src/context/confirm-modal.tsx +52 -30
- package/src/context/prompt-modal.tsx +36 -31
- package/src/types.ts +21 -0
- package/build/modern/chunk-A5UXCB4L.js.map +0 -1
- package/build/modern/chunk-ADZRQNW3.js.map +0 -1
- package/build/modern/chunk-CEJIKL6N.js.map +0 -1
- package/build/modern/chunk-DHKSNGQX.js +0 -156
- package/build/modern/chunk-DHKSNGQX.js.map +0 -1
- package/build/modern/chunk-L64HQGLQ.js +0 -47
- package/build/modern/chunk-L64HQGLQ.js.map +0 -1
- package/build/modern/chunk-LEBDLXJE.js.map +0 -1
- package/build/modern/chunk-P7DWMM56.js +0 -210
- package/build/modern/chunk-P7DWMM56.js.map +0 -1
- package/build/modern/chunk-SSR3CWJZ.js.map +0 -1
- package/build/modern/chunk-U3ISYEUF.js +0 -1
- package/build/modern/chunk-Z2KBUTCO.js.map +0 -1
- /package/build/modern/{chunk-GBCF6DOS.js.map → chunk-AN65HXHS.js.map} +0 -0
- /package/build/modern/{chunk-F3XFJHGR.js.map → chunk-D7PY357P.js.map} +0 -0
- /package/build/modern/{chunk-ILROS7ST.js.map → chunk-DVCTN3GN.js.map} +0 -0
- /package/build/modern/{chunk-KABRV6TB.js.map → chunk-JXWNDJJW.js.map} +0 -0
- /package/build/modern/{chunk-3IT3V3YA.js.map → chunk-M3TZCQ7J.js.map} +0 -0
- /package/build/modern/{chunk-OY7BOKWW.js.map → chunk-QBA6KLL7.js.map} +0 -0
- /package/build/modern/{chunk-V6EAWUCQ.js.map → chunk-TRT6OCHJ.js.map} +0 -0
- /package/build/modern/{chunk-U3ISYEUF.js.map → components/field/helper-text.js.map} +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// src/components/Text.tsx
|
|
2
|
-
import {
|
|
3
|
-
Em,
|
|
4
|
-
H1,
|
|
5
|
-
H2,
|
|
6
|
-
H3,
|
|
7
|
-
H4,
|
|
8
|
-
H5,
|
|
9
|
-
H6,
|
|
10
|
-
P,
|
|
11
|
-
Small,
|
|
12
|
-
Span,
|
|
13
|
-
Strong
|
|
14
|
-
} from "styled-system/jsx";
|
|
15
|
-
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
function Text(props) {
|
|
17
|
-
const { as = "p", ...pandaJSXProps } = props;
|
|
18
|
-
switch (as) {
|
|
19
|
-
case "h1":
|
|
20
|
-
return /* @__PURE__ */ jsx(H1, { ...pandaJSXProps });
|
|
21
|
-
case "h2":
|
|
22
|
-
return /* @__PURE__ */ jsx(H2, { ...pandaJSXProps });
|
|
23
|
-
case "h3":
|
|
24
|
-
return /* @__PURE__ */ jsx(H3, { ...pandaJSXProps });
|
|
25
|
-
case "h4":
|
|
26
|
-
return /* @__PURE__ */ jsx(H4, { ...pandaJSXProps });
|
|
27
|
-
case "h5":
|
|
28
|
-
return /* @__PURE__ */ jsx(H5, { ...pandaJSXProps });
|
|
29
|
-
case "h6":
|
|
30
|
-
return /* @__PURE__ */ jsx(H6, { ...pandaJSXProps });
|
|
31
|
-
case "strong":
|
|
32
|
-
return /* @__PURE__ */ jsx(Strong, { ...pandaJSXProps });
|
|
33
|
-
case "em":
|
|
34
|
-
return /* @__PURE__ */ jsx(Em, { ...pandaJSXProps });
|
|
35
|
-
case "small":
|
|
36
|
-
return /* @__PURE__ */ jsx(Small, { ...pandaJSXProps });
|
|
37
|
-
case "span":
|
|
38
|
-
return /* @__PURE__ */ jsx(Span, { ...pandaJSXProps });
|
|
39
|
-
default:
|
|
40
|
-
return /* @__PURE__ */ jsx(P, { ...pandaJSXProps });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export {
|
|
45
|
-
Text
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=chunk-L64HQGLQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/Text.tsx"],"sourcesContent":["import {\n Em,\n H1,\n H2,\n H3,\n H4,\n H5,\n H6,\n P,\n Small,\n Span,\n Strong,\n type PProps,\n} from 'styled-system/jsx'\n\n/**\n * This module exports a component for rendering text utilizing the styled-system JSX utility.\n * @module @cerberus/react/Text\n */\n\nexport type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\nexport type TextElements = 'p' | 'strong' | 'em' | 'small' | 'span'\n\n// For some reason we have to use the HTMLParagraphElement type here\n// or else TS will fail for non-style props like 'id' or 'className'\nexport interface TextProps extends PProps {\n /**\n * The element to render as. Defaults to 'p'.\n */\n as?: TextElements | Headings\n}\n\n/**\n * A component for rendering text utilizing the styled-system JSX utility.\n * @definition [Text docs](https://cerberus.digitalu.design/react/text)\n * @example\n * ```tsx\n * <Text as=\"h1\" color=\"page.text.100\" textStyle={{\n * base: 'heading-md',\n * md: 'heading-lg',\n * }}>\n * Hello, world!\n * </Text>\n */\nexport function Text(props: TextProps) {\n const { as = 'p', ...pandaJSXProps } = props\n switch (as) {\n case 'h1':\n return <H1 {...pandaJSXProps} />\n case 'h2':\n return <H2 {...pandaJSXProps} />\n case 'h3':\n return <H3 {...pandaJSXProps} />\n case 'h4':\n return <H4 {...pandaJSXProps} />\n case 'h5':\n return <H5 {...pandaJSXProps} />\n case 'h6':\n return <H6 {...pandaJSXProps} />\n case 'strong':\n return <Strong {...pandaJSXProps} />\n case 'em':\n return <Em {...pandaJSXProps} />\n case 'small':\n return <Small {...pandaJSXProps} />\n case 'span':\n return <Span {...pandaJSXProps} />\n default:\n return <P {...pandaJSXProps} />\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAmCM;AAJN,SAAS,KAAK,OAAkB;AACrC,QAAM,EAAE,KAAK,KAAK,GAAG,cAAc,IAAI;AACvC,UAAQ,IAAI;AAAA,IACV,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,UAAQ,GAAG,eAAe;AAAA,IACpC,KAAK;AACH,aAAO,oBAAC,MAAI,GAAG,eAAe;AAAA,IAChC,KAAK;AACH,aAAO,oBAAC,SAAO,GAAG,eAAe;AAAA,IACnC,KAAK;AACH,aAAO,oBAAC,QAAM,GAAG,eAAe;AAAA,IAClC;AACE,aAAO,oBAAC,KAAG,GAAG,eAAe;AAAA,EACjC;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/field/field.tsx"],"sourcesContent":["import { type FieldRootProps } from '@ark-ui/react/field'\nimport { splitProps } from '../../utils/index'\nimport {\n FieldErrorText,\n FieldHelperText,\n FieldLabel,\n FieldRoot,\n} from './primitives'\nimport { HStack } from 'styled-system/jsx'\nimport { Show } from '../Show'\n\nexport interface FieldProps extends FieldRootProps {\n /**\n * The label of the field.\n */\n label?: string\n /**\n * The helper text of the field.\n */\n helperText?: string\n /**\n * A helper text positioned at the end of the field. Good for Textarea fields.\n */\n secondaryHelperText?: string\n /**\n * The error text of the field. Shown when the field is invalid.\n */\n errorText?: string\n}\n\n/**\n * The Field component is the context provider for all FieldParts and displays\n * the label, helperText, and ErrorText.\n * @description [Field Docs](https://cerberus.digitalu.design/react/field)\n * @example\n * ```tsx\n * <Field\n * ids={{\n * control: 'firstName',\n * }}\n * label=\"Label\"\n * helperText=\"This is what people will see on your profile.\"\n * errorText=\"A first name is required to create an account.\"\n * required\n * >\n * <Input name=\"firstName\" type=\"text\" />\n * </Field>\n * ```\n */\nexport function Field(props: FieldProps) {\n const [statusProps, fieldProps, rootProps] = splitProps(\n props,\n ['disabled', 'required', 'readOnly', 'invalid'],\n ['label', 'helperText', 'secondaryHelperText', 'errorText', 'children'],\n )\n\n return (\n <FieldRoot {...statusProps} {...rootProps}>\n <Show when={fieldProps.label}>\n <FieldLabel>{fieldProps.label}</FieldLabel>\n </Show>\n\n {fieldProps.children}\n\n <Show when={fieldProps.helperText && !statusProps.invalid}>\n <HStack justifyContent=\"space-between\" w=\"full\">\n <FieldHelperText>{fieldProps.helperText}</FieldHelperText>\n <Show when={fieldProps.secondaryHelperText}>\n <FieldHelperText>{fieldProps.secondaryHelperText}</FieldHelperText>\n </Show>\n </HStack>\n </Show>\n\n <FieldErrorText>{fieldProps.errorText}</FieldErrorText>\n </FieldRoot>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAQA,SAAS,cAAc;AAmDf,cAMA,YANA;AAVD,SAAS,MAAM,OAAmB;AACvC,QAAM,CAAC,aAAa,YAAY,SAAS,IAAI;AAAA,IAC3C;AAAA,IACA,CAAC,YAAY,YAAY,YAAY,SAAS;AAAA,IAC9C,CAAC,SAAS,cAAc,uBAAuB,aAAa,UAAU;AAAA,EACxE;AAEA,SACE,qBAAC,aAAW,GAAG,aAAc,GAAG,WAC9B;AAAA,wBAAC,QAAK,MAAM,WAAW,OACrB,8BAAC,cAAY,qBAAW,OAAM,GAChC;AAAA,IAEC,WAAW;AAAA,IAEZ,oBAAC,QAAK,MAAM,WAAW,cAAc,CAAC,YAAY,SAChD,+BAAC,UAAO,gBAAe,iBAAgB,GAAE,QACvC;AAAA,0BAAC,mBAAiB,qBAAW,YAAW;AAAA,MACxC,oBAAC,QAAK,MAAM,WAAW,qBACrB,8BAAC,mBAAiB,qBAAW,qBAAoB,GACnD;AAAA,OACF,GACF;AAAA,IAEA,oBAAC,kBAAgB,qBAAW,WAAU;AAAA,KACxC;AAEJ;","names":[]}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dialog
|
|
3
|
-
} from "./chunk-Z2KBUTCO.js";
|
|
4
|
-
import {
|
|
5
|
-
DialogDescription,
|
|
6
|
-
DialogHeading,
|
|
7
|
-
DialogProvider
|
|
8
|
-
} from "./chunk-SSR3CWJZ.js";
|
|
9
|
-
import {
|
|
10
|
-
Button
|
|
11
|
-
} from "./chunk-GB7W3YNU.js";
|
|
12
|
-
import {
|
|
13
|
-
Text
|
|
14
|
-
} from "./chunk-L64HQGLQ.js";
|
|
15
|
-
import {
|
|
16
|
-
FieldLabel,
|
|
17
|
-
FieldRoot,
|
|
18
|
-
Input
|
|
19
|
-
} from "./chunk-WEL43I6Y.js";
|
|
20
|
-
import {
|
|
21
|
-
Avatar
|
|
22
|
-
} from "./chunk-CF4TCMJI.js";
|
|
23
|
-
import {
|
|
24
|
-
useCerberusContext
|
|
25
|
-
} from "./chunk-GITT5645.js";
|
|
26
|
-
import {
|
|
27
|
-
Show
|
|
28
|
-
} from "./chunk-VEAC4I3F.js";
|
|
29
|
-
|
|
30
|
-
// src/context/prompt-modal.tsx
|
|
31
|
-
import {
|
|
32
|
-
createContext,
|
|
33
|
-
useCallback,
|
|
34
|
-
useContext,
|
|
35
|
-
useMemo,
|
|
36
|
-
useRef,
|
|
37
|
-
useState
|
|
38
|
-
} from "react";
|
|
39
|
-
import { DialogCloseTrigger } from "@ark-ui/react/dialog";
|
|
40
|
-
import { HStack, VStack } from "styled-system/jsx";
|
|
41
|
-
import { css } from "styled-system/css";
|
|
42
|
-
import { hstack } from "styled-system/patterns";
|
|
43
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
44
|
-
var PromptModalContext = createContext(null);
|
|
45
|
-
function PromptModal(props) {
|
|
46
|
-
const resolveRef = useRef(null);
|
|
47
|
-
const [open, setOpen] = useState(false);
|
|
48
|
-
const [content, setContent] = useState(null);
|
|
49
|
-
const [inputValue, setInputValue] = useState("");
|
|
50
|
-
const { icons } = useCerberusContext();
|
|
51
|
-
const { promptModal: PromptIcon } = icons;
|
|
52
|
-
const isValid = useMemo(
|
|
53
|
-
() => inputValue === content?.key,
|
|
54
|
-
[inputValue, content]
|
|
55
|
-
);
|
|
56
|
-
const palette = useMemo(
|
|
57
|
-
() => content?.kind === "destructive" ? "danger" : "action",
|
|
58
|
-
[content]
|
|
59
|
-
);
|
|
60
|
-
const handleChange = useCallback(
|
|
61
|
-
(e) => {
|
|
62
|
-
setInputValue(e.currentTarget.value);
|
|
63
|
-
},
|
|
64
|
-
[content]
|
|
65
|
-
);
|
|
66
|
-
const handleChoice = useCallback(
|
|
67
|
-
(e) => {
|
|
68
|
-
const target = e.currentTarget;
|
|
69
|
-
if (target.value === "true") {
|
|
70
|
-
resolveRef.current?.(inputValue);
|
|
71
|
-
}
|
|
72
|
-
setOpen(false);
|
|
73
|
-
},
|
|
74
|
-
[inputValue, setOpen]
|
|
75
|
-
);
|
|
76
|
-
const handleShow = useCallback(
|
|
77
|
-
(options) => {
|
|
78
|
-
return new Promise((resolve) => {
|
|
79
|
-
setContent({ ...options, kind: options.kind || "non-destructive" });
|
|
80
|
-
setOpen(true);
|
|
81
|
-
resolveRef.current = resolve;
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
[setOpen]
|
|
85
|
-
);
|
|
86
|
-
const value = useMemo(
|
|
87
|
-
() => ({
|
|
88
|
-
show: handleShow
|
|
89
|
-
}),
|
|
90
|
-
[handleShow]
|
|
91
|
-
);
|
|
92
|
-
return /* @__PURE__ */ jsxs(PromptModalContext.Provider, { value, children: [
|
|
93
|
-
props.children,
|
|
94
|
-
/* @__PURE__ */ jsx(DialogProvider, { open, onOpenChange: (e) => setOpen(e.open), children: /* @__PURE__ */ jsx(Dialog, { size: "sm", children: /* @__PURE__ */ jsxs(VStack, { gap: "xl", w: "full", children: [
|
|
95
|
-
/* @__PURE__ */ jsxs(VStack, { alignItems: "flex-start", gap: "md", w: "full", children: [
|
|
96
|
-
/* @__PURE__ */ jsx(
|
|
97
|
-
HStack,
|
|
98
|
-
{
|
|
99
|
-
alignSelf: "center",
|
|
100
|
-
justify: "center",
|
|
101
|
-
paddingBlockEnd: "md",
|
|
102
|
-
w: "full",
|
|
103
|
-
children: /* @__PURE__ */ jsx(
|
|
104
|
-
Show,
|
|
105
|
-
{
|
|
106
|
-
when: palette === "danger",
|
|
107
|
-
fallback: /* @__PURE__ */ jsx(
|
|
108
|
-
Avatar,
|
|
109
|
-
{
|
|
110
|
-
gradient: "charon-light",
|
|
111
|
-
fallback: /* @__PURE__ */ jsx(PromptIcon, { size: 24 })
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
children: /* @__PURE__ */ jsx(
|
|
115
|
-
Avatar,
|
|
116
|
-
{
|
|
117
|
-
gradient: "hades-dark",
|
|
118
|
-
fallback: /* @__PURE__ */ jsx(PromptIcon, { size: 24 })
|
|
119
|
-
}
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
),
|
|
125
|
-
/* @__PURE__ */ jsx(DialogHeading, { children: content?.heading }),
|
|
126
|
-
/* @__PURE__ */ jsx(DialogDescription, { children: content?.description })
|
|
127
|
-
] }),
|
|
128
|
-
/* @__PURE__ */ jsx(
|
|
129
|
-
VStack,
|
|
130
|
-
{
|
|
131
|
-
alignItems: "flex-start",
|
|
132
|
-
marginBlockStart: "md",
|
|
133
|
-
marginBlockEnd: "lg",
|
|
134
|
-
w: "full",
|
|
135
|
-
children: /* @__PURE__ */ jsxs(
|
|
136
|
-
FieldRoot,
|
|
137
|
-
{
|
|
138
|
-
ids: {
|
|
139
|
-
control: "confirm"
|
|
140
|
-
},
|
|
141
|
-
invalid: !isValid,
|
|
142
|
-
children: [
|
|
143
|
-
/* @__PURE__ */ jsxs(
|
|
144
|
-
FieldLabel,
|
|
145
|
-
{
|
|
146
|
-
className: hstack({
|
|
147
|
-
gap: "xs",
|
|
148
|
-
justify: "flex-start !important",
|
|
149
|
-
marginBlockEnd: "xs",
|
|
150
|
-
textStyle: "label-md"
|
|
151
|
-
}),
|
|
152
|
-
children: [
|
|
153
|
-
"Type",
|
|
154
|
-
/* @__PURE__ */ jsx(Text, { as: "strong", textTransform: "uppercase", children: content?.key }),
|
|
155
|
-
"to confirm"
|
|
156
|
-
]
|
|
157
|
-
}
|
|
158
|
-
),
|
|
159
|
-
/* @__PURE__ */ jsx(Input, { name: "confirm", onChange: handleChange, type: "text" })
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "md", justify: "stretch", w: "full", children: [
|
|
166
|
-
/* @__PURE__ */ jsx(
|
|
167
|
-
Button,
|
|
168
|
-
{
|
|
169
|
-
autoFocus: true,
|
|
170
|
-
className: css({
|
|
171
|
-
w: "1/2"
|
|
172
|
-
}),
|
|
173
|
-
disabled: !isValid,
|
|
174
|
-
name: "confirm",
|
|
175
|
-
onClick: handleChoice,
|
|
176
|
-
palette,
|
|
177
|
-
value: "true",
|
|
178
|
-
children: content?.actionText
|
|
179
|
-
}
|
|
180
|
-
),
|
|
181
|
-
/* @__PURE__ */ jsx(DialogCloseTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
182
|
-
Button,
|
|
183
|
-
{
|
|
184
|
-
className: css({
|
|
185
|
-
w: "1/2"
|
|
186
|
-
}),
|
|
187
|
-
name: "cancel",
|
|
188
|
-
onClick: handleChoice,
|
|
189
|
-
usage: "outlined",
|
|
190
|
-
value: "false",
|
|
191
|
-
children: content?.cancelText
|
|
192
|
-
}
|
|
193
|
-
) })
|
|
194
|
-
] })
|
|
195
|
-
] }) }) })
|
|
196
|
-
] });
|
|
197
|
-
}
|
|
198
|
-
function usePromptModal() {
|
|
199
|
-
const context = useContext(PromptModalContext);
|
|
200
|
-
if (context === null) {
|
|
201
|
-
throw new Error("usePromptModal must be used within a PromptModal Provider");
|
|
202
|
-
}
|
|
203
|
-
return context;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export {
|
|
207
|
-
PromptModal,
|
|
208
|
-
usePromptModal
|
|
209
|
-
};
|
|
210
|
-
//# sourceMappingURL=chunk-P7DWMM56.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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/dialog'\nimport { HStack, VStack } from 'styled-system/jsx'\nimport { css } from 'styled-system/css'\nimport { hstack } from '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/avatar'\nimport { Text } from '../components/Text'\nimport {\n Dialog,\n DialogDescription,\n DialogHeading,\n DialogProvider,\n} from '../components/dialog'\nimport { useCerberusContext } from './cerberus'\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 gradient=\"charon-light\"\n fallback={<PromptIcon size={24} />}\n />\n }\n >\n <Avatar\n gradient=\"hades-dark\"\n fallback={<PromptIcon size={24} />}\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;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;AAAA,sBAEC,oBAAC,QAAK,IAAG,UAAS,eAAc,aAC7B,mBAAS,KACZ;AAAA,sBAAO;AAAA;AAAA;AAAA,gBAET;AAAA,gBACA,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/dialog/primitives.tsx"],"sourcesContent":["import {\n Dialog,\n type DialogBackdropProps,\n type DialogContentProps,\n type DialogDescriptionProps,\n type DialogPositionerProps,\n type DialogRootProps,\n type DialogTitleProps,\n type DialogTriggerProps,\n} from '@ark-ui/react/dialog'\nimport { cx } from 'styled-system/css'\nimport { dialog, type DialogVariantProps } from 'styled-system/recipes'\n\n/**\n * This module contains the primitives of the Dialog component.\n * @module 'dialog/primitives'\n */\n\n/**\n * The provider that controls the dialog components.\n */\nexport function DialogRoot(props: DialogRootProps) {\n return <Dialog.Root {...props} />\n}\n\n/**\n * The trigger that opens the dialog.\n */\nexport function DialogTrigger(props: DialogTriggerProps) {\n const styles = dialog()\n return (\n <Dialog.Trigger\n {...props}\n className={cx(styles.trigger, props.className)}\n />\n )\n}\n\n/**\n * The overlay of the dialog.\n */\nexport function DialogBackdrop(props: DialogBackdropProps) {\n const styles = dialog()\n return (\n <Dialog.Backdrop\n {...props}\n className={cx(styles.backdrop, props.className)}\n />\n )\n}\n\n/**\n * The container that positions the dialog.\n */\nexport function DialogPositioner(props: DialogPositionerProps) {\n const styles = dialog()\n return (\n <Dialog.Positioner\n {...props}\n className={cx(styles.positioner, props.className)}\n />\n )\n}\n\n/**\n * The visible content of the dialog.\n */\nexport function DialogContent(props: DialogContentProps & DialogVariantProps) {\n const { size, ...contentProps } = props\n const styles = dialog({ size })\n return (\n <Dialog.Content\n {...contentProps}\n className={cx(styles.content, contentProps.className)}\n />\n )\n}\n\n/**\n * The heading of the dialog.\n */\nexport function DialogHeading(props: DialogTitleProps) {\n const styles = dialog()\n return (\n <Dialog.Title {...props} className={cx(styles.title, props.className)} />\n )\n}\n\n/**\n * The description of the dialog.\n */\nexport function DialogDescription(props: DialogDescriptionProps) {\n const styles = dialog()\n return (\n <Dialog.Description\n {...props}\n className={cx(styles.description, props.className)}\n />\n )\n}\n\n/**\n * The trigger that closes the dialog.\n */\nexport function DialogCloseTrigger(props: DialogTriggerProps) {\n return <Dialog.CloseTrigger {...props} />\n}\n\n/**\n * The provider that controls the dialog components. This is a named export of\n * the DialogRoot primitive.\n */\nexport const DialogProvider = DialogRoot\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAQK;AACP,SAAS,UAAU;AACnB,SAAS,cAAuC;AAWvC;AADF,SAAS,WAAW,OAAwB;AACjD,SAAO,oBAAC,OAAO,MAAP,EAAa,GAAG,OAAO;AACjC;AAKO,SAAS,cAAc,OA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@@
|
|
|
1
|
-
//# sourceMappingURL=chunk-U3ISYEUF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import type { DialogContentProps } from '@ark-ui/react/dialog'\nimport type { DialogVariantProps } from 'styled-system/recipes'\nimport { Portal } from '../Portal'\nimport { DialogBackdrop, DialogContent, DialogPositioner } from './primitives'\n\n/**\n * This module contains and abstraction of the Dialog primitives.\n * @module 'dialog'\n */\n\nexport interface DialogProps\n extends Omit<DialogContentProps, 'size'>,\n DialogVariantProps {}\n\n/**\n * An abstraction of the Dialog primitives that controls the content of the\n * dialog. Must be used within the `DialogProvider` component.\n * @definition [Dialog docs](https://cerberus.digitalu.design/react/dialog)\n * @definition [Ark Dialog docs](https://ark-ui.com/react/docs/components/dialog)\n * @example\n * ```tsx\n * <DialogProvider>\n * <DialogTrigger asChild>\n * <Button>Open Dialog</Button>\n * </DialogTrigger>\n * <Dialog>\n * <Text>Dialog Content</Text>\n * </Dialog>\n * </DialogProvider>\n * ```\n */\nexport function Dialog(props: DialogProps) {\n return (\n <Portal>\n <DialogBackdrop />\n <DialogPositioner>\n <DialogContent {...props} />\n </DialogPositioner>\n </Portal>\n )\n}\n"],"mappings":";;;;;;;;;;AAiCI,SACE,KADF;AAFG,SAAS,OAAO,OAAoB;AACzC,SACE,qBAAC,UACC;AAAA,wBAAC,kBAAe;AAAA,IAChB,oBAAC,oBACC,8BAAC,iBAAe,GAAG,OAAO,GAC5B;AAAA,KACF;AAEJ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|