@fuf-stack/pixels 0.31.1 → 0.31.3

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.
@@ -1,90 +1,14 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-D4TLDLEX.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- // src/Drawer/Drawer.tsx
4
3
 
5
4
 
6
5
 
7
6
 
8
7
 
9
8
 
10
- var _drawer = require('@nextui-org/drawer');
11
- var _pixelutils = require('@fuf-stack/pixel-utils');
12
- var _jsxruntime = require('react/jsx-runtime');
13
- var drawerVariants = _pixelutils.tv.call(void 0, {
14
- slots: {
15
- wrapper: "",
16
- base: "",
17
- backdrop: "",
18
- header: "",
19
- body: "",
20
- footer: "",
21
- closeButton: ""
22
- }
23
- });
24
- var drawerSizes = [
25
- "xs",
26
- "sm",
27
- "md",
28
- "lg",
29
- "xl",
30
- "2xl",
31
- "3xl",
32
- "4xl",
33
- "5xl",
34
- "full"
35
- ];
36
- var drawerRadii = ["none", "sm", "md", "lg"];
37
- var drawerBackdrops = ["opaque", "transparent", "blur"];
38
- var drawerPlacements = ["left", "right", "top", "bottom"];
39
- var Drawer = ({
40
- backdrop = "opaque",
41
- children = null,
42
- className = void 0,
43
- closeButton = void 0,
44
- footer = void 0,
45
- header = void 0,
46
- hideCloseButton = false,
47
- isOpen = void 0,
48
- isDismissable = true,
49
- onClose = void 0,
50
- onOpenChange = void 0,
51
- placement = "right",
52
- portalContainer = void 0,
53
- radius = "none",
54
- size = "md",
55
- testId = void 0
56
- }) => {
57
- const variants = drawerVariants();
58
- const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
59
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
60
- _drawer.Drawer,
61
- {
62
- backdrop,
63
- classNames,
64
- closeButton,
65
- "data-testid": testId,
66
- hideCloseButton,
67
- isDismissable,
68
- isOpen,
69
- onClose,
70
- onOpenChange,
71
- placement,
72
- portalContainer,
73
- radius,
74
- scrollBehavior: "inside",
75
- size,
76
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _drawer.DrawerContent, { "data-testid": testId ? `drawer_${testId}` : "drawer", children: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
77
- header && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _drawer.DrawerHeader, { children: header }),
78
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _drawer.DrawerBody, { id: "drawer_body", children }),
79
- footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _drawer.DrawerFooter, { children: footer })
80
- ] }) })
81
- }
82
- );
83
- };
84
- var Drawer_default = Drawer;
9
+ var _chunk7ZJ6LE2Pcjs = require('../chunk-7ZJ6LE2P.cjs');
10
+ require('../chunk-D4TLDLEX.cjs');
85
11
 
86
- // src/Drawer/index.ts
87
- var Drawer_default2 = Drawer_default;
88
12
 
89
13
 
90
14
 
@@ -92,5 +16,5 @@ var Drawer_default2 = Drawer_default;
92
16
 
93
17
 
94
18
 
95
- exports.default = Drawer_default2; exports.drawerBackdrops = drawerBackdrops; exports.drawerPlacements = drawerPlacements; exports.drawerRadii = drawerRadii; exports.drawerSizes = drawerSizes; exports.drawerVariants = drawerVariants;
19
+ exports.Drawer = _chunk7ZJ6LE2Pcjs.Drawer_default; exports.default = _chunk7ZJ6LE2Pcjs.Drawer_default2; exports.drawerBackdrops = _chunk7ZJ6LE2Pcjs.drawerBackdrops; exports.drawerPlacements = _chunk7ZJ6LE2Pcjs.drawerPlacements; exports.drawerRadii = _chunk7ZJ6LE2Pcjs.drawerRadii; exports.drawerSizes = _chunk7ZJ6LE2Pcjs.drawerSizes; exports.drawerVariants = _chunk7ZJ6LE2Pcjs.drawerVariants;
96
20
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/Drawer/index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,CAAA;AAAA,EACV,aAAA,EAAe,KAAA,CAAA;AAAA,EACf,UAAA,EAAY,OAAA;AAAA,EACZ,gBAAA,EAAkB,KAAA,CAAA;AAAA,EAClB,OAAA,EAAS,MAAA;AAAA,EACT,KAAA,EAAO,IAAA;AAAA,EACP,OAAA,EAAS,KAAA;AACX,CAAA,EAAA,GAAmB;AAEjB,EAAA,MAAM,SAAA,EAAW,cAAA,CAAe,CAAA;AAChC,EAAA,MAAM,WAAA,EAAa,8CAAA,QAAqB,EAAU,SAAA,EAAW,MAAM,CAAA;AAEnE,EAAA,uBACE,6BAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,QAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA,EAAa,MAAA;AAAA,MACb,eAAA;AAAA,MACA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA,eAAA;AAAA,MACA,MAAA;AAAA,MACA,cAAA,EAAe,QAAA;AAAA,MACf,IAAA;AAAA,MAEA,QAAA,kBAAA,6BAAA,qBAAC,EAAA,EAAkB,aAAA,EAAa,OAAA,EAAS,CAAA,OAAA,EAAU,MAAM,CAAA,EAAA;AAGd,QAAA;AACM,wBAAA;AACN,QAAA;AAG3C,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AAEe;AD3DmF;AACA;AE7DnF;AF+DmF;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/Drawer/index.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DrawerProps as NextDrawerProps } from '@nextui-org/drawer';\nimport type { ReactNode } from 'react';\n\nimport {\n Drawer as NextDrawer,\n DrawerBody as NextDrawerBody,\n DrawerContent as NextDrawerContent,\n DrawerFooter as NextDrawerFooter,\n DrawerHeader as NextDrawerHeader,\n} from '@nextui-org/drawer';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// drawer variants\nexport const drawerVariants = tv({\n slots: {\n wrapper: '',\n base: '',\n backdrop: '',\n header: '',\n body: '',\n footer: '',\n closeButton: '',\n },\n});\n\nexport const drawerSizes = [\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n 'full',\n] as const;\nexport type DrawerSizes = (typeof drawerSizes)[number];\n\nexport const drawerRadii = ['none', 'sm', 'md', 'lg'] as const;\nexport type DrawerRadius = (typeof drawerRadii)[number];\n\nexport const drawerBackdrops = ['opaque', 'transparent', 'blur'] as const;\nexport type DrawerBackdrop = (typeof drawerBackdrops)[number];\n\nexport const drawerPlacements = ['left', 'right', 'top', 'bottom'] as const;\nexport type DrawerPlacement = (typeof drawerPlacements)[number];\n\ntype VariantProps = TVProps<typeof drawerVariants>;\ntype ClassName = TVClassName<typeof drawerVariants>;\n\nexport interface DrawerProps extends VariantProps {\n /** The backdrop style of the Drawer. */\n backdrop?: DrawerBackdrop;\n /** Drawer body content */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Custom close button to display on top right corner. */\n closeButton?: ReactNode;\n /** Footer of the Drawer. */\n footer?: ReactNode;\n /** Header of the Drawer. */\n header?: ReactNode;\n /** Whether to hide the drawer close button. */\n hideCloseButton?: boolean;\n /** Whether the drawer is open by default (controlled). */\n isOpen?: boolean;\n /** Whether the drawer can be closed by clicking on the overlay or pressing the Esc key. */\n isDismissable?: boolean;\n /** Handler that is called when the drawer is closed. */\n onClose?: () => void;\n /** Handler that is called when the drawer's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** The drawer position. */\n placement?: DrawerPlacement | undefined;\n /** The container element in which the overlay portal will be placed */\n portalContainer?: NextDrawerProps['portalContainer'];\n /** The drawer border radius. */\n radius?: DrawerRadius | undefined;\n /** The drawer size. */\n size?: DrawerSizes | undefined;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drawer component based on [NextUI Drawer](https://nextui.org/docs/components/drawer)\n */\nconst Drawer = ({\n backdrop = 'opaque',\n children = null,\n className = undefined,\n closeButton = undefined,\n footer = undefined,\n header = undefined,\n hideCloseButton = false,\n isOpen = undefined,\n isDismissable = true,\n onClose = undefined,\n onOpenChange = undefined,\n placement = 'right',\n portalContainer = undefined,\n radius = 'none',\n size = 'md',\n testId = undefined,\n}: DrawerProps) => {\n // classNames from slots\n const variants = drawerVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <NextDrawer\n backdrop={backdrop}\n classNames={classNames}\n closeButton={closeButton}\n data-testid={testId}\n hideCloseButton={hideCloseButton}\n isDismissable={isDismissable}\n isOpen={isOpen}\n onClose={onClose}\n onOpenChange={onOpenChange}\n placement={placement}\n portalContainer={portalContainer}\n radius={radius}\n scrollBehavior=\"inside\"\n size={size}\n >\n <NextDrawerContent data-testid={testId ? `drawer_${testId}` : 'drawer'}>\n {() => (\n <>\n {header && <NextDrawerHeader>{header}</NextDrawerHeader>}\n <NextDrawerBody id=\"drawer_body\">{children}</NextDrawerBody>\n {footer && <NextDrawerFooter>{footer}</NextDrawerFooter>}\n </>\n )}\n </NextDrawerContent>\n </NextDrawer>\n );\n};\n\nexport default Drawer;\n","import Drawer, {\n drawerBackdrops,\n drawerPlacements,\n drawerRadii,\n drawerSizes,\n drawerVariants,\n} from './Drawer';\n\nexport type {\n DrawerProps,\n DrawerSizes,\n DrawerRadius,\n DrawerBackdrop,\n DrawerPlacement,\n} from './Drawer';\n\nexport {\n drawerBackdrops,\n drawerPlacements,\n drawerRadii,\n drawerSizes,\n drawerVariants,\n};\n\nexport default Drawer;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/Drawer/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wYAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/Drawer/index.cjs"}
@@ -1,142 +1,12 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
3
- import * as tailwind_variants from 'tailwind-variants';
4
- import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
5
- import { DrawerProps as DrawerProps$1 } from '@nextui-org/drawer';
6
- import { ReactNode } from 'react';
1
+ import { D as Drawer } from '../Drawer-DvEDC3UK.cjs';
2
+ export { f as DrawerProps, d as drawerBackdrops, a as drawerPlacements, b as drawerRadii, c as drawerSizes, e as drawerVariants } from '../Drawer-DvEDC3UK.cjs';
3
+ import 'react/jsx-runtime';
4
+ import 'tailwind-variants/dist/config.js';
5
+ import 'tailwind-variants';
6
+ import '@fuf-stack/pixel-utils';
7
+ import '@nextui-org/drawer';
8
+ import 'react';
7
9
 
8
- declare const drawerVariants: tailwind_variants.TVReturnType<{
9
- [key: string]: {
10
- [key: string]: tailwind_variants.ClassValue | {
11
- backdrop?: tailwind_variants.ClassValue;
12
- wrapper?: tailwind_variants.ClassValue;
13
- base?: tailwind_variants.ClassValue;
14
- header?: tailwind_variants.ClassValue;
15
- body?: tailwind_variants.ClassValue;
16
- footer?: tailwind_variants.ClassValue;
17
- closeButton?: tailwind_variants.ClassValue;
18
- };
19
- };
20
- } | {
21
- [x: string]: {
22
- [x: string]: tailwind_variants.ClassValue | {
23
- backdrop?: tailwind_variants.ClassValue;
24
- wrapper?: tailwind_variants.ClassValue;
25
- base?: tailwind_variants.ClassValue;
26
- header?: tailwind_variants.ClassValue;
27
- body?: tailwind_variants.ClassValue;
28
- footer?: tailwind_variants.ClassValue;
29
- closeButton?: tailwind_variants.ClassValue;
30
- };
31
- };
32
- } | {}, {
33
- wrapper: string;
34
- base: string;
35
- backdrop: string;
36
- header: string;
37
- body: string;
38
- footer: string;
39
- closeButton: string;
40
- }, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
41
- [key: string]: {
42
- [key: string]: tailwind_variants.ClassValue | {
43
- backdrop?: tailwind_variants.ClassValue;
44
- wrapper?: tailwind_variants.ClassValue;
45
- base?: tailwind_variants.ClassValue;
46
- header?: tailwind_variants.ClassValue;
47
- body?: tailwind_variants.ClassValue;
48
- footer?: tailwind_variants.ClassValue;
49
- closeButton?: tailwind_variants.ClassValue;
50
- };
51
- };
52
- } | {}>, {
53
- [key: string]: {
54
- [key: string]: tailwind_variants.ClassValue | {
55
- backdrop?: tailwind_variants.ClassValue;
56
- wrapper?: tailwind_variants.ClassValue;
57
- base?: tailwind_variants.ClassValue;
58
- header?: tailwind_variants.ClassValue;
59
- body?: tailwind_variants.ClassValue;
60
- footer?: tailwind_variants.ClassValue;
61
- closeButton?: tailwind_variants.ClassValue;
62
- };
63
- };
64
- } | {}, {
65
- wrapper: string;
66
- base: string;
67
- backdrop: string;
68
- header: string;
69
- body: string;
70
- footer: string;
71
- closeButton: string;
72
- }, tailwind_variants.TVReturnType<unknown, {
73
- wrapper: string;
74
- base: string;
75
- backdrop: string;
76
- header: string;
77
- body: string;
78
- footer: string;
79
- closeButton: string;
80
- }, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
81
- [key: string]: {
82
- [key: string]: tailwind_variants.ClassValue | {
83
- backdrop?: tailwind_variants.ClassValue;
84
- wrapper?: tailwind_variants.ClassValue;
85
- base?: tailwind_variants.ClassValue;
86
- header?: tailwind_variants.ClassValue;
87
- body?: tailwind_variants.ClassValue;
88
- footer?: tailwind_variants.ClassValue;
89
- closeButton?: tailwind_variants.ClassValue;
90
- };
91
- };
92
- } | {}>, unknown, unknown, undefined>>;
93
- declare const drawerSizes: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "full"];
94
- type DrawerSizes = (typeof drawerSizes)[number];
95
- declare const drawerRadii: readonly ["none", "sm", "md", "lg"];
96
- type DrawerRadius = (typeof drawerRadii)[number];
97
- declare const drawerBackdrops: readonly ["opaque", "transparent", "blur"];
98
- type DrawerBackdrop = (typeof drawerBackdrops)[number];
99
- declare const drawerPlacements: readonly ["left", "right", "top", "bottom"];
100
- type DrawerPlacement = (typeof drawerPlacements)[number];
101
- type VariantProps = TVProps<typeof drawerVariants>;
102
- type ClassName = TVClassName<typeof drawerVariants>;
103
- interface DrawerProps extends VariantProps {
104
- /** The backdrop style of the Drawer. */
105
- backdrop?: DrawerBackdrop;
106
- /** Drawer body content */
107
- children?: ReactNode;
108
- /** CSS class name */
109
- className?: ClassName;
110
- /** Custom close button to display on top right corner. */
111
- closeButton?: ReactNode;
112
- /** Footer of the Drawer. */
113
- footer?: ReactNode;
114
- /** Header of the Drawer. */
115
- header?: ReactNode;
116
- /** Whether to hide the drawer close button. */
117
- hideCloseButton?: boolean;
118
- /** Whether the drawer is open by default (controlled). */
119
- isOpen?: boolean;
120
- /** Whether the drawer can be closed by clicking on the overlay or pressing the Esc key. */
121
- isDismissable?: boolean;
122
- /** Handler that is called when the drawer is closed. */
123
- onClose?: () => void;
124
- /** Handler that is called when the drawer's open state changes. */
125
- onOpenChange?: (isOpen: boolean) => void;
126
- /** The drawer position. */
127
- placement?: DrawerPlacement | undefined;
128
- /** The container element in which the overlay portal will be placed */
129
- portalContainer?: DrawerProps$1['portalContainer'];
130
- /** The drawer border radius. */
131
- radius?: DrawerRadius | undefined;
132
- /** The drawer size. */
133
- size?: DrawerSizes | undefined;
134
- /** HTML data-testid attribute used in e2e tests */
135
- testId?: string;
136
- }
137
- /**
138
- * Drawer component based on [NextUI Drawer](https://nextui.org/docs/components/drawer)
139
- */
140
- declare const Drawer: ({ backdrop, children, className, closeButton, footer, header, hideCloseButton, isOpen, isDismissable, onClose, onOpenChange, placement, portalContainer, radius, size, testId, }: DrawerProps) => react_jsx_runtime.JSX.Element;
141
10
 
142
- export { type DrawerBackdrop, type DrawerPlacement, type DrawerProps, type DrawerRadius, type DrawerSizes, Drawer as default, drawerBackdrops, drawerPlacements, drawerRadii, drawerSizes, drawerVariants };
11
+
12
+ export { Drawer, Drawer as default };
@@ -1,142 +1,12 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
3
- import * as tailwind_variants from 'tailwind-variants';
4
- import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
5
- import { DrawerProps as DrawerProps$1 } from '@nextui-org/drawer';
6
- import { ReactNode } from 'react';
1
+ import { D as Drawer } from '../Drawer-DvEDC3UK.js';
2
+ export { f as DrawerProps, d as drawerBackdrops, a as drawerPlacements, b as drawerRadii, c as drawerSizes, e as drawerVariants } from '../Drawer-DvEDC3UK.js';
3
+ import 'react/jsx-runtime';
4
+ import 'tailwind-variants/dist/config.js';
5
+ import 'tailwind-variants';
6
+ import '@fuf-stack/pixel-utils';
7
+ import '@nextui-org/drawer';
8
+ import 'react';
7
9
 
8
- declare const drawerVariants: tailwind_variants.TVReturnType<{
9
- [key: string]: {
10
- [key: string]: tailwind_variants.ClassValue | {
11
- backdrop?: tailwind_variants.ClassValue;
12
- wrapper?: tailwind_variants.ClassValue;
13
- base?: tailwind_variants.ClassValue;
14
- header?: tailwind_variants.ClassValue;
15
- body?: tailwind_variants.ClassValue;
16
- footer?: tailwind_variants.ClassValue;
17
- closeButton?: tailwind_variants.ClassValue;
18
- };
19
- };
20
- } | {
21
- [x: string]: {
22
- [x: string]: tailwind_variants.ClassValue | {
23
- backdrop?: tailwind_variants.ClassValue;
24
- wrapper?: tailwind_variants.ClassValue;
25
- base?: tailwind_variants.ClassValue;
26
- header?: tailwind_variants.ClassValue;
27
- body?: tailwind_variants.ClassValue;
28
- footer?: tailwind_variants.ClassValue;
29
- closeButton?: tailwind_variants.ClassValue;
30
- };
31
- };
32
- } | {}, {
33
- wrapper: string;
34
- base: string;
35
- backdrop: string;
36
- header: string;
37
- body: string;
38
- footer: string;
39
- closeButton: string;
40
- }, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
41
- [key: string]: {
42
- [key: string]: tailwind_variants.ClassValue | {
43
- backdrop?: tailwind_variants.ClassValue;
44
- wrapper?: tailwind_variants.ClassValue;
45
- base?: tailwind_variants.ClassValue;
46
- header?: tailwind_variants.ClassValue;
47
- body?: tailwind_variants.ClassValue;
48
- footer?: tailwind_variants.ClassValue;
49
- closeButton?: tailwind_variants.ClassValue;
50
- };
51
- };
52
- } | {}>, {
53
- [key: string]: {
54
- [key: string]: tailwind_variants.ClassValue | {
55
- backdrop?: tailwind_variants.ClassValue;
56
- wrapper?: tailwind_variants.ClassValue;
57
- base?: tailwind_variants.ClassValue;
58
- header?: tailwind_variants.ClassValue;
59
- body?: tailwind_variants.ClassValue;
60
- footer?: tailwind_variants.ClassValue;
61
- closeButton?: tailwind_variants.ClassValue;
62
- };
63
- };
64
- } | {}, {
65
- wrapper: string;
66
- base: string;
67
- backdrop: string;
68
- header: string;
69
- body: string;
70
- footer: string;
71
- closeButton: string;
72
- }, tailwind_variants.TVReturnType<unknown, {
73
- wrapper: string;
74
- base: string;
75
- backdrop: string;
76
- header: string;
77
- body: string;
78
- footer: string;
79
- closeButton: string;
80
- }, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
81
- [key: string]: {
82
- [key: string]: tailwind_variants.ClassValue | {
83
- backdrop?: tailwind_variants.ClassValue;
84
- wrapper?: tailwind_variants.ClassValue;
85
- base?: tailwind_variants.ClassValue;
86
- header?: tailwind_variants.ClassValue;
87
- body?: tailwind_variants.ClassValue;
88
- footer?: tailwind_variants.ClassValue;
89
- closeButton?: tailwind_variants.ClassValue;
90
- };
91
- };
92
- } | {}>, unknown, unknown, undefined>>;
93
- declare const drawerSizes: readonly ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "full"];
94
- type DrawerSizes = (typeof drawerSizes)[number];
95
- declare const drawerRadii: readonly ["none", "sm", "md", "lg"];
96
- type DrawerRadius = (typeof drawerRadii)[number];
97
- declare const drawerBackdrops: readonly ["opaque", "transparent", "blur"];
98
- type DrawerBackdrop = (typeof drawerBackdrops)[number];
99
- declare const drawerPlacements: readonly ["left", "right", "top", "bottom"];
100
- type DrawerPlacement = (typeof drawerPlacements)[number];
101
- type VariantProps = TVProps<typeof drawerVariants>;
102
- type ClassName = TVClassName<typeof drawerVariants>;
103
- interface DrawerProps extends VariantProps {
104
- /** The backdrop style of the Drawer. */
105
- backdrop?: DrawerBackdrop;
106
- /** Drawer body content */
107
- children?: ReactNode;
108
- /** CSS class name */
109
- className?: ClassName;
110
- /** Custom close button to display on top right corner. */
111
- closeButton?: ReactNode;
112
- /** Footer of the Drawer. */
113
- footer?: ReactNode;
114
- /** Header of the Drawer. */
115
- header?: ReactNode;
116
- /** Whether to hide the drawer close button. */
117
- hideCloseButton?: boolean;
118
- /** Whether the drawer is open by default (controlled). */
119
- isOpen?: boolean;
120
- /** Whether the drawer can be closed by clicking on the overlay or pressing the Esc key. */
121
- isDismissable?: boolean;
122
- /** Handler that is called when the drawer is closed. */
123
- onClose?: () => void;
124
- /** Handler that is called when the drawer's open state changes. */
125
- onOpenChange?: (isOpen: boolean) => void;
126
- /** The drawer position. */
127
- placement?: DrawerPlacement | undefined;
128
- /** The container element in which the overlay portal will be placed */
129
- portalContainer?: DrawerProps$1['portalContainer'];
130
- /** The drawer border radius. */
131
- radius?: DrawerRadius | undefined;
132
- /** The drawer size. */
133
- size?: DrawerSizes | undefined;
134
- /** HTML data-testid attribute used in e2e tests */
135
- testId?: string;
136
- }
137
- /**
138
- * Drawer component based on [NextUI Drawer](https://nextui.org/docs/components/drawer)
139
- */
140
- declare const Drawer: ({ backdrop, children, className, closeButton, footer, header, hideCloseButton, isOpen, isDismissable, onClose, onOpenChange, placement, portalContainer, radius, size, testId, }: DrawerProps) => react_jsx_runtime.JSX.Element;
141
10
 
142
- export { type DrawerBackdrop, type DrawerPlacement, type DrawerProps, type DrawerRadius, type DrawerSizes, Drawer as default, drawerBackdrops, drawerPlacements, drawerRadii, drawerSizes, drawerVariants };
11
+
12
+ export { Drawer, Drawer as default };
@@ -1,91 +1,15 @@
1
- import "../chunk-J7N2552D.js";
2
-
3
- // src/Drawer/Drawer.tsx
4
1
  import {
5
- Drawer as NextDrawer,
6
- DrawerBody as NextDrawerBody,
7
- DrawerContent as NextDrawerContent,
8
- DrawerFooter as NextDrawerFooter,
9
- DrawerHeader as NextDrawerHeader
10
- } from "@nextui-org/drawer";
11
- import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
12
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
- var drawerVariants = tv({
14
- slots: {
15
- wrapper: "",
16
- base: "",
17
- backdrop: "",
18
- header: "",
19
- body: "",
20
- footer: "",
21
- closeButton: ""
22
- }
23
- });
24
- var drawerSizes = [
25
- "xs",
26
- "sm",
27
- "md",
28
- "lg",
29
- "xl",
30
- "2xl",
31
- "3xl",
32
- "4xl",
33
- "5xl",
34
- "full"
35
- ];
36
- var drawerRadii = ["none", "sm", "md", "lg"];
37
- var drawerBackdrops = ["opaque", "transparent", "blur"];
38
- var drawerPlacements = ["left", "right", "top", "bottom"];
39
- var Drawer = ({
40
- backdrop = "opaque",
41
- children = null,
42
- className = void 0,
43
- closeButton = void 0,
44
- footer = void 0,
45
- header = void 0,
46
- hideCloseButton = false,
47
- isOpen = void 0,
48
- isDismissable = true,
49
- onClose = void 0,
50
- onOpenChange = void 0,
51
- placement = "right",
52
- portalContainer = void 0,
53
- radius = "none",
54
- size = "md",
55
- testId = void 0
56
- }) => {
57
- const variants = drawerVariants();
58
- const classNames = variantsToClassNames(variants, className, "base");
59
- return /* @__PURE__ */ jsx(
60
- NextDrawer,
61
- {
62
- backdrop,
63
- classNames,
64
- closeButton,
65
- "data-testid": testId,
66
- hideCloseButton,
67
- isDismissable,
68
- isOpen,
69
- onClose,
70
- onOpenChange,
71
- placement,
72
- portalContainer,
73
- radius,
74
- scrollBehavior: "inside",
75
- size,
76
- children: /* @__PURE__ */ jsx(NextDrawerContent, { "data-testid": testId ? `drawer_${testId}` : "drawer", children: () => /* @__PURE__ */ jsxs(Fragment, { children: [
77
- header && /* @__PURE__ */ jsx(NextDrawerHeader, { children: header }),
78
- /* @__PURE__ */ jsx(NextDrawerBody, { id: "drawer_body", children }),
79
- footer && /* @__PURE__ */ jsx(NextDrawerFooter, { children: footer })
80
- ] }) })
81
- }
82
- );
83
- };
84
- var Drawer_default = Drawer;
85
-
86
- // src/Drawer/index.ts
87
- var Drawer_default2 = Drawer_default;
2
+ Drawer_default,
3
+ Drawer_default2,
4
+ drawerBackdrops,
5
+ drawerPlacements,
6
+ drawerRadii,
7
+ drawerSizes,
8
+ drawerVariants
9
+ } from "../chunk-OQIMB45E.js";
10
+ import "../chunk-J7N2552D.js";
88
11
  export {
12
+ Drawer_default as Drawer,
89
13
  Drawer_default2 as default,
90
14
  drawerBackdrops,
91
15
  drawerPlacements,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Drawer/Drawer.tsx","../../src/Drawer/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { DrawerProps as NextDrawerProps } from '@nextui-org/drawer';\nimport type { ReactNode } from 'react';\n\nimport {\n Drawer as NextDrawer,\n DrawerBody as NextDrawerBody,\n DrawerContent as NextDrawerContent,\n DrawerFooter as NextDrawerFooter,\n DrawerHeader as NextDrawerHeader,\n} from '@nextui-org/drawer';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// drawer variants\nexport const drawerVariants = tv({\n slots: {\n wrapper: '',\n base: '',\n backdrop: '',\n header: '',\n body: '',\n footer: '',\n closeButton: '',\n },\n});\n\nexport const drawerSizes = [\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n '3xl',\n '4xl',\n '5xl',\n 'full',\n] as const;\nexport type DrawerSizes = (typeof drawerSizes)[number];\n\nexport const drawerRadii = ['none', 'sm', 'md', 'lg'] as const;\nexport type DrawerRadius = (typeof drawerRadii)[number];\n\nexport const drawerBackdrops = ['opaque', 'transparent', 'blur'] as const;\nexport type DrawerBackdrop = (typeof drawerBackdrops)[number];\n\nexport const drawerPlacements = ['left', 'right', 'top', 'bottom'] as const;\nexport type DrawerPlacement = (typeof drawerPlacements)[number];\n\ntype VariantProps = TVProps<typeof drawerVariants>;\ntype ClassName = TVClassName<typeof drawerVariants>;\n\nexport interface DrawerProps extends VariantProps {\n /** The backdrop style of the Drawer. */\n backdrop?: DrawerBackdrop;\n /** Drawer body content */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Custom close button to display on top right corner. */\n closeButton?: ReactNode;\n /** Footer of the Drawer. */\n footer?: ReactNode;\n /** Header of the Drawer. */\n header?: ReactNode;\n /** Whether to hide the drawer close button. */\n hideCloseButton?: boolean;\n /** Whether the drawer is open by default (controlled). */\n isOpen?: boolean;\n /** Whether the drawer can be closed by clicking on the overlay or pressing the Esc key. */\n isDismissable?: boolean;\n /** Handler that is called when the drawer is closed. */\n onClose?: () => void;\n /** Handler that is called when the drawer's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n /** The drawer position. */\n placement?: DrawerPlacement | undefined;\n /** The container element in which the overlay portal will be placed */\n portalContainer?: NextDrawerProps['portalContainer'];\n /** The drawer border radius. */\n radius?: DrawerRadius | undefined;\n /** The drawer size. */\n size?: DrawerSizes | undefined;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drawer component based on [NextUI Drawer](https://nextui.org/docs/components/drawer)\n */\nconst Drawer = ({\n backdrop = 'opaque',\n children = null,\n className = undefined,\n closeButton = undefined,\n footer = undefined,\n header = undefined,\n hideCloseButton = false,\n isOpen = undefined,\n isDismissable = true,\n onClose = undefined,\n onOpenChange = undefined,\n placement = 'right',\n portalContainer = undefined,\n radius = 'none',\n size = 'md',\n testId = undefined,\n}: DrawerProps) => {\n // classNames from slots\n const variants = drawerVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <NextDrawer\n backdrop={backdrop}\n classNames={classNames}\n closeButton={closeButton}\n data-testid={testId}\n hideCloseButton={hideCloseButton}\n isDismissable={isDismissable}\n isOpen={isOpen}\n onClose={onClose}\n onOpenChange={onOpenChange}\n placement={placement}\n portalContainer={portalContainer}\n radius={radius}\n scrollBehavior=\"inside\"\n size={size}\n >\n <NextDrawerContent data-testid={testId ? `drawer_${testId}` : 'drawer'}>\n {() => (\n <>\n {header && <NextDrawerHeader>{header}</NextDrawerHeader>}\n <NextDrawerBody id=\"drawer_body\">{children}</NextDrawerBody>\n {footer && <NextDrawerFooter>{footer}</NextDrawerFooter>}\n </>\n )}\n </NextDrawerContent>\n </NextDrawer>\n );\n};\n\nexport default Drawer;\n","import Drawer, {\n drawerBackdrops,\n drawerPlacements,\n drawerRadii,\n drawerSizes,\n drawerVariants,\n} from './Drawer';\n\nexport type {\n DrawerProps,\n DrawerSizes,\n DrawerRadius,\n DrawerBackdrop,\n DrawerPlacement,\n} from './Drawer';\n\nexport {\n drawerBackdrops,\n drawerPlacements,\n drawerRadii,\n drawerSizes,\n drawerVariants,\n};\n\nexport default Drawer;\n"],"mappings":";;;AAIA;AAAA,EACE,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,OACX;AAEP,SAAS,IAAI,4BAA4B;AAwH/B,mBACa,KADb;AArHH,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AACF,CAAC;AAEM,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,IAAM,cAAc,CAAC,QAAQ,MAAM,MAAM,IAAI;AAG7C,IAAM,kBAAkB,CAAC,UAAU,eAAe,MAA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