@nayhoo/ui 0.15.0 → 0.16.1

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.
@@ -0,0 +1,129 @@
1
+ import {
2
+ dialogContentRecipe,
3
+ dialogDescription,
4
+ dialogFooter,
5
+ dialogHeader,
6
+ dialogOverlayRecipe,
7
+ dialogTitle
8
+ } from "../chunk-Z6RQ453R.mjs";
9
+ import "../chunk-KH7OG63I.mjs";
10
+ import "../chunk-C4NLMHMQ.mjs";
11
+ import "../chunk-DXKT5AFF.mjs";
12
+ import "../chunk-Y6BNWBLR.mjs";
13
+ import "../chunk-O62XWWJU.mjs";
14
+ import "../chunk-NOIOHUNH.mjs";
15
+ import "../chunk-JGZLOTH3.mjs";
16
+ import "../chunk-HGLO5LDS.mjs";
17
+ import "../chunk-P3OUEGR4.mjs";
18
+ import "../chunk-5WJ4KGIE.mjs";
19
+ import "../chunk-WUVNL3DI.mjs";
20
+ import {
21
+ Flex
22
+ } from "../chunk-M7HASIMW.mjs";
23
+ import "../chunk-S6KKPOPH.mjs";
24
+ import "../chunk-AXOHCT5Q.mjs";
25
+ import "../chunk-KE7EIF6L.mjs";
26
+ import "../chunk-JZBPCPSP.mjs";
27
+ import "../chunk-HNVVD3WS.mjs";
28
+ import "../chunk-DOHVBMXO.mjs";
29
+ import "../chunk-P2VEMZGS.mjs";
30
+ import "../chunk-EXKRRQYL.mjs";
31
+ import {
32
+ theme
33
+ } from "../chunk-N535ABFC.mjs";
34
+ import "../chunk-GHCXVMQR.mjs";
35
+ import {
36
+ Box
37
+ } from "../chunk-LSB5JVS2.mjs";
38
+ import "../chunk-OI24WXH6.mjs";
39
+ import "../chunk-4A7WL3BM.mjs";
40
+ import "../chunk-47YGQSLM.mjs";
41
+ import "../chunk-6RSPMV3B.mjs";
42
+ import "../chunk-IFN22XIN.mjs";
43
+ import "../chunk-5ZOT2LOO.mjs";
44
+ import "../chunk-PUW3KNR3.mjs";
45
+ import {
46
+ extractVariantsFromProps
47
+ } from "../chunk-UPZYS6TE.mjs";
48
+ import {
49
+ mergeClasses
50
+ } from "../chunk-7EGQM3ZL.mjs";
51
+
52
+ // src/components/dialog.tsx
53
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
54
+ import { jsx, jsxs } from "react/jsx-runtime";
55
+ var Dialog = DialogPrimitive.Root;
56
+ var DialogClose = DialogPrimitive.Close;
57
+ var DialogContent = ({
58
+ children,
59
+ components,
60
+ disableOverlayBlur = false,
61
+ ...props
62
+ }) => {
63
+ const dialogOverlay = dialogOverlayRecipe({ disableOverlayBlur });
64
+ const [variants, rest] = extractVariantsFromProps(
65
+ props,
66
+ ...dialogContentRecipe.variants()
67
+ );
68
+ const dialogContent = dialogContentRecipe(variants);
69
+ return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
70
+ /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: dialogOverlay }),
71
+ /* @__PURE__ */ jsxs(
72
+ DialogPrimitive.Content,
73
+ {
74
+ ...rest,
75
+ className: mergeClasses(dialogContent, rest.className),
76
+ children: [
77
+ components?.Header,
78
+ /* @__PURE__ */ jsx(Box, { style: { padding: theme.space[5] }, children }),
79
+ components?.Footer
80
+ ]
81
+ }
82
+ )
83
+ ] });
84
+ };
85
+ var DialogDescription = ({ ...props }) => {
86
+ return /* @__PURE__ */ jsx(
87
+ DialogPrimitive.Description,
88
+ {
89
+ ...props,
90
+ className: mergeClasses(dialogDescription, props.className)
91
+ }
92
+ );
93
+ };
94
+ var DialogFooter = ({ children }) => {
95
+ return /* @__PURE__ */ jsx(
96
+ Flex,
97
+ {
98
+ className: dialogFooter,
99
+ direction: { initial: "column", sm: "row" },
100
+ gap: "2",
101
+ justify: "end",
102
+ children
103
+ }
104
+ );
105
+ };
106
+ var DialogHeader = ({ children }) => {
107
+ return /* @__PURE__ */ jsx(Flex, { className: dialogHeader, children });
108
+ };
109
+ var DialogTitle = ({ ...props }) => {
110
+ return /* @__PURE__ */ jsx(
111
+ DialogPrimitive.Title,
112
+ {
113
+ ...props,
114
+ className: mergeClasses(dialogTitle, props.className)
115
+ }
116
+ );
117
+ };
118
+ var DialogTrigger = DialogPrimitive.Trigger;
119
+ export {
120
+ Dialog,
121
+ DialogClose,
122
+ DialogContent,
123
+ DialogDescription,
124
+ DialogFooter,
125
+ DialogHeader,
126
+ DialogTitle,
127
+ DialogTrigger
128
+ };
129
+ //# sourceMappingURL=dialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import { Box } from \"@/components/box\";\nimport { Flex } from \"@/components/flex\";\nimport { theme } from \"@/theme\";\nimport {\n DialogContentVariants,\n dialogContentRecipe,\n dialogOverlayRecipe,\n} from \"@/theme/recipes/dialog.css\";\nimport {\n dialogDescription,\n dialogFooter,\n dialogHeader,\n dialogTitle,\n} from \"@/theme/styles/dialog.css\";\nimport { extractVariantsFromProps, mergeClasses } from \"@/utils\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\n\nexport type DialogProps = DialogPrimitive.DialogProps;\n\n/**\n * @see https://github.com/nayhoo/ui/blob/main/apps/react-cosmos/src/dialog.fixture.tsx\n */\nexport const Dialog = DialogPrimitive.Root;\n\nexport type DialogCloseProps = DialogPrimitive.DialogCloseProps;\n\nexport const DialogClose = DialogPrimitive.Close;\n\nexport type DialogContentProps = DialogPrimitive.DialogContentProps &\n DialogContentVariants & {\n components?: { Footer?: React.ReactNode; Header?: React.ReactNode };\n disableOverlayBlur?: boolean;\n };\n\nexport const DialogContent = ({\n children,\n components,\n disableOverlayBlur = false,\n ...props\n}: DialogContentProps) => {\n const dialogOverlay = dialogOverlayRecipe({ disableOverlayBlur });\n const [variants, rest] = extractVariantsFromProps(\n props,\n ...dialogContentRecipe.variants(),\n );\n const dialogContent = dialogContentRecipe(variants);\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay className={dialogOverlay} />\n <DialogPrimitive.Content\n {...rest}\n className={mergeClasses(dialogContent, rest.className)}\n >\n {components?.Header}\n\n <Box style={{ padding: theme.space[5] }}>{children}</Box>\n\n {components?.Footer}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n};\n\nexport type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;\n\nexport const DialogDescription = ({ ...props }: DialogDescriptionProps) => {\n return (\n <DialogPrimitive.Description\n {...props}\n className={mergeClasses(dialogDescription, props.className)}\n />\n );\n};\n\nexport type DialogFooterProps = { children: React.ReactNode };\n\nexport const DialogFooter = ({ children }: DialogFooterProps) => {\n return (\n <Flex\n className={dialogFooter}\n direction={{ initial: \"column\", sm: \"row\" }}\n gap=\"2\"\n justify=\"end\"\n >\n {children}\n </Flex>\n );\n};\n\nexport type DialogHeaderProps = { children: React.ReactNode };\n\nexport const DialogHeader = ({ children }: DialogHeaderProps) => {\n return <Flex className={dialogHeader}>{children}</Flex>;\n};\n\nexport type DialogTitleProps = DialogPrimitive.DialogTitleProps;\n\nexport const DialogTitle = ({ ...props }: DialogTitleProps) => {\n return (\n <DialogPrimitive.Title\n {...props}\n className={mergeClasses(dialogTitle, props.className)}\n />\n );\n};\n\nexport type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;\n\nexport const DialogTrigger = DialogPrimitive.Trigger;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,YAAY,qBAAqB;AAkC3B,cACA,YADA;AA3BC,IAAM,SAAyB;AAI/B,IAAM,cAA8B;AAQpC,IAAM,gBAAgB,CAAC;AAAA,EAC5B;AAAA,EACA;AAAA,EACA,qBAAqB;AAAA,EACrB,GAAG;AACL,MAA0B;AACxB,QAAM,gBAAgB,oBAAoB,EAAE,mBAAmB,CAAC;AAChE,QAAM,CAAC,UAAU,IAAI,IAAI;AAAA,IACvB;AAAA,IACA,GAAG,oBAAoB,SAAS;AAAA,EAClC;AACA,QAAM,gBAAgB,oBAAoB,QAAQ;AAElD,SACE,qBAAiB,wBAAhB,EACC;AAAA,wBAAiB,yBAAhB,EAAwB,WAAW,eAAe;AAAA,IACnD;AAAA,MAAiB;AAAA,MAAhB;AAAA,QACE,GAAG;AAAA,QACJ,WAAW,aAAa,eAAe,KAAK,SAAS;AAAA,QAEpD;AAAA,sBAAY;AAAA,UAEb,oBAAC,OAAI,OAAO,EAAE,SAAS,MAAM,MAAM,CAAC,EAAE,GAAI,UAAS;AAAA,UAElD,YAAY;AAAA;AAAA;AAAA,IACf;AAAA,KACF;AAEJ;AAIO,IAAM,oBAAoB,CAAC,EAAE,GAAG,MAAM,MAA8B;AACzE,SACE;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,aAAa,mBAAmB,MAAM,SAAS;AAAA;AAAA,EAC5D;AAEJ;AAIO,IAAM,eAAe,CAAC,EAAE,SAAS,MAAyB;AAC/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,WAAW,EAAE,SAAS,UAAU,IAAI,MAAM;AAAA,MAC1C,KAAI;AAAA,MACJ,SAAQ;AAAA,MAEP;AAAA;AAAA,EACH;AAEJ;AAIO,IAAM,eAAe,CAAC,EAAE,SAAS,MAAyB;AAC/D,SAAO,oBAAC,QAAK,WAAW,cAAe,UAAS;AAClD;AAIO,IAAM,cAAc,CAAC,EAAE,GAAG,MAAM,MAAwB;AAC7D,SACE;AAAA,IAAiB;AAAA,IAAhB;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,aAAa,aAAa,MAAM,SAAS;AAAA;AAAA,EACtD;AAEJ;AAIO,IAAM,gBAAgC;","names":[]}
@@ -0,0 +1,35 @@
1
+ import * as _vanilla_extract_recipes from '@vanilla-extract/recipes';
2
+ import { RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ declare const dialogContentRecipe: _vanilla_extract_recipes.RuntimeFn<{
5
+ fullWidth: {
6
+ true: {
7
+ width: "100%";
8
+ };
9
+ };
10
+ size: {
11
+ "1": {
12
+ maxWidth: "430px";
13
+ };
14
+ "2": {
15
+ maxWidth: "715px";
16
+ };
17
+ "3": {
18
+ maxWidth: "1145px";
19
+ };
20
+ "4": {
21
+ maxWidth: "none";
22
+ };
23
+ };
24
+ }>;
25
+ type DialogContentVariants = RecipeVariants<typeof dialogContentRecipe>;
26
+ declare const dialogOverlayRecipe: _vanilla_extract_recipes.RuntimeFn<{
27
+ disableOverlayBlur: {
28
+ true: {
29
+ backdropFilter: "blur(0px)";
30
+ };
31
+ };
32
+ }>;
33
+ type DialogOverlayVariants = RecipeVariants<typeof dialogOverlayRecipe>;
34
+
35
+ export { type DialogContentVariants as D, dialogOverlayRecipe as a, type DialogOverlayVariants as b, dialogContentRecipe as d };
@@ -0,0 +1,35 @@
1
+ import * as _vanilla_extract_recipes from '@vanilla-extract/recipes';
2
+ import { RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ declare const dialogContentRecipe: _vanilla_extract_recipes.RuntimeFn<{
5
+ fullWidth: {
6
+ true: {
7
+ width: "100%";
8
+ };
9
+ };
10
+ size: {
11
+ "1": {
12
+ maxWidth: "430px";
13
+ };
14
+ "2": {
15
+ maxWidth: "715px";
16
+ };
17
+ "3": {
18
+ maxWidth: "1145px";
19
+ };
20
+ "4": {
21
+ maxWidth: "none";
22
+ };
23
+ };
24
+ }>;
25
+ type DialogContentVariants = RecipeVariants<typeof dialogContentRecipe>;
26
+ declare const dialogOverlayRecipe: _vanilla_extract_recipes.RuntimeFn<{
27
+ disableOverlayBlur: {
28
+ true: {
29
+ backdropFilter: "blur(0px)";
30
+ };
31
+ };
32
+ }>;
33
+ type DialogOverlayVariants = RecipeVariants<typeof dialogOverlayRecipe>;
34
+
35
+ export { type DialogContentVariants as D, dialogOverlayRecipe as a, type DialogOverlayVariants as b, dialogContentRecipe as d };