@fuf-stack/pixels 0.3.1 → 0.3.2
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/dist/Modal/index.cjs +4 -2
- package/dist/Modal/index.d.cts +2 -2
- package/dist/Modal/index.d.ts +2 -2
- package/dist/Modal/index.js +5 -3
- package/dist/{Modal-CSxNe0bS.d.cts → Modal-DWZB1uTb.d.cts} +3 -3
- package/dist/{Modal-CSxNe0bS.d.ts → Modal-DWZB1uTb.d.ts} +3 -3
- package/dist/Tooltip/index.cjs +6 -2
- package/dist/Tooltip/index.d.cts +3 -3
- package/dist/Tooltip/index.d.ts +3 -3
- package/dist/Tooltip/index.js +7 -3
- package/dist/{Tooltip-D0yEMBnv.d.cts → Tooltip-D4znH2L3.d.cts} +4 -4
- package/dist/{Tooltip-D0yEMBnv.d.ts → Tooltip-D4znH2L3.d.ts} +4 -4
- package/dist/{chunk-STEC6TAQ.cjs → chunk-BPJAPVB5.cjs} +4 -2
- package/dist/chunk-BPJAPVB5.cjs.map +1 -0
- package/dist/{chunk-MBQA3LPM.js → chunk-CTP2PZYD.js} +3 -1
- package/dist/{chunk-MBQA3LPM.js.map → chunk-CTP2PZYD.js.map} +1 -1
- package/dist/{chunk-JD3BEOSK.cjs → chunk-J6F42VLA.cjs} +10 -2
- package/dist/chunk-J6F42VLA.cjs.map +1 -0
- package/dist/{chunk-J47IOXCU.js → chunk-VISKY2B2.js} +10 -2
- package/dist/chunk-VISKY2B2.js.map +1 -0
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-J47IOXCU.js.map +0 -1
- package/dist/chunk-JD3BEOSK.cjs.map +0 -1
- package/dist/chunk-STEC6TAQ.cjs.map +0 -1
package/dist/Modal/index.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var _chunkSTEC6TAQcjs = require('../chunk-STEC6TAQ.cjs');
|
|
5
4
|
|
|
5
|
+
var _chunkBPJAPVB5cjs = require('../chunk-BPJAPVB5.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.Modal = _chunkBPJAPVB5cjs.Modal_default; exports.default = _chunkBPJAPVB5cjs.Modal_default2; exports.modalSizeOptions = _chunkBPJAPVB5cjs.modalSizeOptions;
|
|
9
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Modal/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Modal } from '../Modal-
|
|
2
|
-
export { a as ModalProps } from '../Modal-
|
|
1
|
+
import { M as Modal } from '../Modal-DWZB1uTb.cjs';
|
|
2
|
+
export { a as ModalProps, m as modalSizeOptions } from '../Modal-DWZB1uTb.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
package/dist/Modal/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Modal } from '../Modal-
|
|
2
|
-
export { a as ModalProps } from '../Modal-
|
|
1
|
+
import { M as Modal } from '../Modal-DWZB1uTb.js';
|
|
2
|
+
export { a as ModalProps, m as modalSizeOptions } from '../Modal-DWZB1uTb.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal_default,
|
|
3
|
-
Modal_default2
|
|
4
|
-
|
|
3
|
+
Modal_default2,
|
|
4
|
+
modalSizeOptions
|
|
5
|
+
} from "../chunk-CTP2PZYD.js";
|
|
5
6
|
export {
|
|
6
7
|
Modal_default as Modal,
|
|
7
|
-
Modal_default2 as default
|
|
8
|
+
Modal_default2 as default,
|
|
9
|
+
modalSizeOptions
|
|
8
10
|
};
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
type ModalSize = (typeof
|
|
4
|
+
declare const modalSizeOptions: readonly ["sm", "md", "lg"];
|
|
5
|
+
type ModalSize = (typeof modalSizeOptions)[number];
|
|
6
6
|
interface ModalProps {
|
|
7
7
|
/** child components */
|
|
8
8
|
children?: ReactNode;
|
|
@@ -26,4 +26,4 @@ interface ModalProps {
|
|
|
26
26
|
*/
|
|
27
27
|
declare const Modal: ({ children, className, footer, isOpen, onClose, size, testId, title, }: ModalProps) => react_jsx_runtime.JSX.Element;
|
|
28
28
|
|
|
29
|
-
export { Modal as M, type ModalProps as a };
|
|
29
|
+
export { Modal as M, type ModalProps as a, modalSizeOptions as m };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
type ModalSize = (typeof
|
|
4
|
+
declare const modalSizeOptions: readonly ["sm", "md", "lg"];
|
|
5
|
+
type ModalSize = (typeof modalSizeOptions)[number];
|
|
6
6
|
interface ModalProps {
|
|
7
7
|
/** child components */
|
|
8
8
|
children?: ReactNode;
|
|
@@ -26,4 +26,4 @@ interface ModalProps {
|
|
|
26
26
|
*/
|
|
27
27
|
declare const Modal: ({ children, className, footer, isOpen, onClose, size, testId, title, }: ModalProps) => react_jsx_runtime.JSX.Element;
|
|
28
28
|
|
|
29
|
-
export { Modal as M, type ModalProps as a };
|
|
29
|
+
export { Modal as M, type ModalProps as a, modalSizeOptions as m };
|
package/dist/Tooltip/index.cjs
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkJD3BEOSKcjs = require('../chunk-JD3BEOSK.cjs');
|
|
4
3
|
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
var _chunkJ6F42VLAcjs = require('../chunk-J6F42VLA.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.Tooltip = _chunkJ6F42VLAcjs.Tooltip_default; exports.default = _chunkJ6F42VLAcjs.Tooltip_default2; exports.tooltipPlacementOptions = _chunkJ6F42VLAcjs.tooltipPlacementOptions;
|
|
7
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Tooltip/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Tooltip } from '../Tooltip-
|
|
2
|
-
export { a as TooltipProps } from '../Tooltip-
|
|
1
|
+
import { T as Tooltip } from '../Tooltip-D4znH2L3.cjs';
|
|
2
|
+
export { a as TooltipProps, t as tooltipPlacementOptions } from '../Tooltip-D4znH2L3.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
export { Tooltip as default };
|
|
8
|
+
export { Tooltip, Tooltip as default };
|
package/dist/Tooltip/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Tooltip } from '../Tooltip-
|
|
2
|
-
export { a as TooltipProps } from '../Tooltip-
|
|
1
|
+
import { T as Tooltip } from '../Tooltip-D4znH2L3.js';
|
|
2
|
+
export { a as TooltipProps, t as tooltipPlacementOptions } from '../Tooltip-D4znH2L3.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
export { Tooltip as default };
|
|
8
|
+
export { Tooltip, Tooltip as default };
|
package/dist/Tooltip/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Tooltip_default
|
|
3
|
-
|
|
2
|
+
Tooltip_default,
|
|
3
|
+
Tooltip_default2,
|
|
4
|
+
tooltipPlacementOptions
|
|
5
|
+
} from "../chunk-VISKY2B2.js";
|
|
4
6
|
export {
|
|
5
|
-
Tooltip_default as
|
|
7
|
+
Tooltip_default as Tooltip,
|
|
8
|
+
Tooltip_default2 as default,
|
|
9
|
+
tooltipPlacementOptions
|
|
6
10
|
};
|
|
7
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
type
|
|
4
|
+
declare const tooltipPlacementOptions: readonly ["top", "bottom", "left", "right"];
|
|
5
|
+
type TooltipPlacement = (typeof tooltipPlacementOptions)[number];
|
|
6
6
|
interface TooltipProps {
|
|
7
7
|
/** trigger child components */
|
|
8
8
|
children: ReactNode;
|
|
@@ -17,11 +17,11 @@ interface TooltipProps {
|
|
|
17
17
|
/** handler that is called when the overlay's open state changes */
|
|
18
18
|
onOpenChange?: (isOpen: boolean) => void;
|
|
19
19
|
/** placement if the tooltip */
|
|
20
|
-
placement?:
|
|
20
|
+
placement?: TooltipPlacement;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)
|
|
24
24
|
*/
|
|
25
25
|
declare const Tooltip: ({ children, className, content, placement, defaultOpen, onOpenChange, containerPadding, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
26
26
|
|
|
27
|
-
export { Tooltip as T, type TooltipProps as a };
|
|
27
|
+
export { Tooltip as T, type TooltipProps as a, tooltipPlacementOptions as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
5
|
-
type
|
|
4
|
+
declare const tooltipPlacementOptions: readonly ["top", "bottom", "left", "right"];
|
|
5
|
+
type TooltipPlacement = (typeof tooltipPlacementOptions)[number];
|
|
6
6
|
interface TooltipProps {
|
|
7
7
|
/** trigger child components */
|
|
8
8
|
children: ReactNode;
|
|
@@ -17,11 +17,11 @@ interface TooltipProps {
|
|
|
17
17
|
/** handler that is called when the overlay's open state changes */
|
|
18
18
|
onOpenChange?: (isOpen: boolean) => void;
|
|
19
19
|
/** placement if the tooltip */
|
|
20
|
-
placement?:
|
|
20
|
+
placement?: TooltipPlacement;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)
|
|
24
24
|
*/
|
|
25
25
|
declare const Tooltip: ({ children, className, content, placement, defaultOpen, onOpenChange, containerPadding, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
26
26
|
|
|
27
|
-
export { Tooltip as T, type TooltipProps as a };
|
|
27
|
+
export { Tooltip as T, type TooltipProps as a, tooltipPlacementOptions as t };
|
|
@@ -10,6 +10,7 @@ var _classnames = require('classnames'); var _classnames2 = _interopRequireDefau
|
|
|
10
10
|
var _debug = require('debug'); var _debug2 = _interopRequireDefault(_debug);
|
|
11
11
|
var _jsxruntime = require('react/jsx-runtime');
|
|
12
12
|
var debug = _debug2.default.call(void 0, "component:Modal");
|
|
13
|
+
var modalSizeOptions = ["sm", "md", "lg"];
|
|
13
14
|
var Modal = ({
|
|
14
15
|
children = null,
|
|
15
16
|
className = void 0,
|
|
@@ -56,5 +57,6 @@ var Modal_default2 = Modal_default;
|
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
exports.modalSizeOptions = modalSizeOptions; exports.Modal_default = Modal_default; exports.Modal_default2 = Modal_default2;
|
|
62
|
+
//# sourceMappingURL=chunk-BPJAPVB5.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Modal/Modal.tsx","../src/Modal/index.ts"],"names":["Modal_default"],"mappings":";AAEA;AAAA,EACE,SAAS;AAAA,EACT,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AAAA,OACV;AACP,OAAO,QAAQ;AACf,OAAO,iBAAiB;AA8DZ,mBACY,KADZ;AA5DZ,IAAM,QAAQ,YAAY,iBAAiB;AAEpC,IAAM,mBAAmB,CAAC,MAAM,MAAM,IAAI;AAyBjD,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,MAAkB;AAChB,QAAM,SAAS,EAAE,KAAK,CAAC;AACvB,SACE,oBAAC,SAAI,WAAW,GAAG,SAAS,GAAG,eAAa,QAC1C;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,YAAY;AAAA,QACV,MAAM;AAAA,UACJ;AAAA,YACE,cAAc,SAAS;AAAA,YACvB,UAAU,SAAS;AAAA,YACnB,UAAU,SAAS;AAAA,UACrB;AAAA;AAAA,UAEA;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAe;AAAA,MACf,MAAK;AAAA,MAEL,8BAAC,oBAAiB,eAAa,SAAS,GAAG,MAAM,WAAW,SACzD,gBACC,iCACG;AAAA,iBAAS,oBAAC,mBAAiB,iBAAM;AAAA,QAClC,oBAAC,iBAAc,WAAU,oBACtB,UACH;AAAA,QACC,UAAU,oBAAC,mBAAiB,kBAAO;AAAA,SACtC,GAEJ;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,gBAAQ;;;AChFf,IAAOA,iBAAQ","sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const modalSizeOptions = ['sm', 'md', 'lg'] as const;\ntype ModalSize = (typeof modalSizeOptions)[number];\n\nexport interface ModalProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n footer?: ReactNode;\n /** open state (controlled) */\n isOpen: boolean;\n /** close event handler */\n onClose: () => void;\n /** modal size */\n size?: ModalSize;\n /** e2e test id */\n testId?: string;\n /** modal header */\n title?: ReactNode;\n}\n\n/**\n * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)\n */\nconst Modal = ({\n children = null,\n className = undefined,\n footer = undefined,\n isOpen,\n onClose,\n size = 'md',\n testId = undefined,\n title = undefined,\n}: ModalProps) => {\n debug('Modal', { size });\n return (\n <div className={cn(className)} data-testid={testId}>\n <NextModal\n backdrop=\"opaque\"\n classNames={{\n base: cn(\n {\n 'lg:w-11/12': size === 'lg',\n 'w-2/12': size === 'sm',\n 'w-6/12': size === 'md',\n },\n // overwrite !rounded-none from nextui\n '!rounded-lg',\n ),\n }}\n isOpen={isOpen}\n onClose={onClose}\n scrollBehavior=\"inside\"\n size=\"full\"\n >\n <NextModalContent data-testid={testId ? `${testId}_modal` : 'modal'}>\n {() => (\n <>\n {title && <NextModalHeader>{title}</NextModalHeader>}\n <NextModalBody className=\"bg-ex-background\">\n {children}\n </NextModalBody>\n {footer && <NextModalFooter>{footer}</NextModalFooter>}\n </>\n )}\n </NextModalContent>\n </NextModal>\n </div>\n );\n};\n\nexport default Modal;\n","import Modal, { modalSizeOptions } from './Modal';\n\nexport type { ModalProps } from './Modal';\n\nexport { Modal, modalSizeOptions };\n\nexport default Modal;\n"]}
|
|
@@ -10,6 +10,7 @@ import cn from "classnames";
|
|
|
10
10
|
import createDebug from "debug";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
var debug = createDebug("component:Modal");
|
|
13
|
+
var modalSizeOptions = ["sm", "md", "lg"];
|
|
13
14
|
var Modal = ({
|
|
14
15
|
children = null,
|
|
15
16
|
className = void 0,
|
|
@@ -54,7 +55,8 @@ var Modal_default = Modal;
|
|
|
54
55
|
var Modal_default2 = Modal_default;
|
|
55
56
|
|
|
56
57
|
export {
|
|
58
|
+
modalSizeOptions,
|
|
57
59
|
Modal_default,
|
|
58
60
|
Modal_default2
|
|
59
61
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-CTP2PZYD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Modal/Modal.tsx","../src/Modal/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const
|
|
1
|
+
{"version":3,"sources":["../src/Modal/Modal.tsx","../src/Modal/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const modalSizeOptions = ['sm', 'md', 'lg'] as const;\ntype ModalSize = (typeof modalSizeOptions)[number];\n\nexport interface ModalProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n footer?: ReactNode;\n /** open state (controlled) */\n isOpen: boolean;\n /** close event handler */\n onClose: () => void;\n /** modal size */\n size?: ModalSize;\n /** e2e test id */\n testId?: string;\n /** modal header */\n title?: ReactNode;\n}\n\n/**\n * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)\n */\nconst Modal = ({\n children = null,\n className = undefined,\n footer = undefined,\n isOpen,\n onClose,\n size = 'md',\n testId = undefined,\n title = undefined,\n}: ModalProps) => {\n debug('Modal', { size });\n return (\n <div className={cn(className)} data-testid={testId}>\n <NextModal\n backdrop=\"opaque\"\n classNames={{\n base: cn(\n {\n 'lg:w-11/12': size === 'lg',\n 'w-2/12': size === 'sm',\n 'w-6/12': size === 'md',\n },\n // overwrite !rounded-none from nextui\n '!rounded-lg',\n ),\n }}\n isOpen={isOpen}\n onClose={onClose}\n scrollBehavior=\"inside\"\n size=\"full\"\n >\n <NextModalContent data-testid={testId ? `${testId}_modal` : 'modal'}>\n {() => (\n <>\n {title && <NextModalHeader>{title}</NextModalHeader>}\n <NextModalBody className=\"bg-ex-background\">\n {children}\n </NextModalBody>\n {footer && <NextModalFooter>{footer}</NextModalFooter>}\n </>\n )}\n </NextModalContent>\n </NextModal>\n </div>\n );\n};\n\nexport default Modal;\n","import Modal, { modalSizeOptions } from './Modal';\n\nexport type { ModalProps } from './Modal';\n\nexport { Modal, modalSizeOptions };\n\nexport default Modal;\n"],"mappings":";AAEA;AAAA,EACE,SAAS;AAAA,EACT,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AAAA,OACV;AACP,OAAO,QAAQ;AACf,OAAO,iBAAiB;AA8DZ,mBACY,KADZ;AA5DZ,IAAM,QAAQ,YAAY,iBAAiB;AAEpC,IAAM,mBAAmB,CAAC,MAAM,MAAM,IAAI;AAyBjD,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,MAAkB;AAChB,QAAM,SAAS,EAAE,KAAK,CAAC;AACvB,SACE,oBAAC,SAAI,WAAW,GAAG,SAAS,GAAG,eAAa,QAC1C;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,YAAY;AAAA,QACV,MAAM;AAAA,UACJ;AAAA,YACE,cAAc,SAAS;AAAA,YACvB,UAAU,SAAS;AAAA,YACnB,UAAU,SAAS;AAAA,UACrB;AAAA;AAAA,UAEA;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAe;AAAA,MACf,MAAK;AAAA,MAEL,8BAAC,oBAAiB,eAAa,SAAS,GAAG,MAAM,WAAW,SACzD,gBACC,iCACG;AAAA,iBAAS,oBAAC,mBAAiB,iBAAM;AAAA,QAClC,oBAAC,iBAAc,WAAU,oBACtB,UACH;AAAA,QACC,UAAU,oBAAC,mBAAiB,kBAAO;AAAA,SACtC,GAEJ;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,gBAAQ;;;AChFf,IAAOA,iBAAQ;","names":["Modal_default"]}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
var _tooltip = require('@nextui-org/tooltip');
|
|
3
3
|
var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames);
|
|
4
4
|
var _jsxruntime = require('react/jsx-runtime');
|
|
5
|
+
var tooltipPlacementOptions = [
|
|
6
|
+
"top",
|
|
7
|
+
"bottom",
|
|
8
|
+
"left",
|
|
9
|
+
"right"
|
|
10
|
+
];
|
|
5
11
|
var Tooltip = ({
|
|
6
12
|
children,
|
|
7
13
|
className = void 0,
|
|
@@ -31,5 +37,7 @@ var Tooltip_default2 = Tooltip_default;
|
|
|
31
37
|
|
|
32
38
|
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.tooltipPlacementOptions = tooltipPlacementOptions; exports.Tooltip_default = Tooltip_default; exports.Tooltip_default2 = Tooltip_default2;
|
|
43
|
+
//# sourceMappingURL=chunk-J6F42VLA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Tooltip/Tooltip.tsx","../src/Tooltip/index.ts"],"names":["Tooltip_default"],"mappings":";AAEA,SAAS,WAAW,mBAAmB;AACvC,OAAO,QAAQ;AAiDX;AA/CG,IAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuBA,IAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AACrB,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAU;AAAA,IACV,WAAS;AAAA,IAET,8BAAC,UAAK,WAAU,kBAAkB,UAAS;AAAA;AAC7C;AAGF,IAAO,kBAAQ;;;AClDf,IAAOA,mBAAQ","sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Tooltip as NextTooltip } from '@nextui-org/tooltip';\nimport cn from 'classnames';\n\nexport const tooltipPlacementOptions = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n] as const;\nexport type TooltipPlacement = (typeof tooltipPlacementOptions)[number];\n\nexport interface TooltipProps {\n /** trigger child components */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** placement padding in px */\n containerPadding?: number;\n /** content displayed in the tooltip */\n content: ReactNode;\n /** open overlay initially when uncontrolled */\n defaultOpen?: boolean;\n /** handler that is called when the overlay's open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n /** placement if the tooltip */\n placement?: TooltipPlacement;\n}\n\n/**\n * Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)\n */\nconst Tooltip = ({\n children,\n className = undefined,\n content,\n placement = 'top',\n defaultOpen = false,\n onOpenChange = undefined,\n containerPadding = 0,\n}: TooltipProps) => (\n <NextTooltip\n className={cn(className)}\n containerPadding={containerPadding}\n content={content}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement={placement}\n shouldFlip\n showArrow\n >\n <span className=\"cursor-pointer\">{children}</span>\n </NextTooltip>\n);\n\nexport default Tooltip;\n","import Tooltip, { tooltipPlacementOptions } from './Tooltip';\n\nexport type { TooltipProps } from './Tooltip';\n\nexport { Tooltip, tooltipPlacementOptions };\n\nexport default Tooltip;\n"]}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
import { Tooltip as NextTooltip } from "@nextui-org/tooltip";
|
|
3
3
|
import cn from "classnames";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var tooltipPlacementOptions = [
|
|
6
|
+
"top",
|
|
7
|
+
"bottom",
|
|
8
|
+
"left",
|
|
9
|
+
"right"
|
|
10
|
+
];
|
|
5
11
|
var Tooltip = ({
|
|
6
12
|
children,
|
|
7
13
|
className = void 0,
|
|
@@ -30,6 +36,8 @@ var Tooltip_default = Tooltip;
|
|
|
30
36
|
var Tooltip_default2 = Tooltip_default;
|
|
31
37
|
|
|
32
38
|
export {
|
|
33
|
-
|
|
39
|
+
tooltipPlacementOptions,
|
|
40
|
+
Tooltip_default,
|
|
41
|
+
Tooltip_default2
|
|
34
42
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-VISKY2B2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Tooltip/Tooltip.tsx","../src/Tooltip/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Tooltip as NextTooltip } from '@nextui-org/tooltip';\nimport cn from 'classnames';\n\nexport const tooltipPlacementOptions = [\n 'top',\n 'bottom',\n 'left',\n 'right',\n] as const;\nexport type TooltipPlacement = (typeof tooltipPlacementOptions)[number];\n\nexport interface TooltipProps {\n /** trigger child components */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** placement padding in px */\n containerPadding?: number;\n /** content displayed in the tooltip */\n content: ReactNode;\n /** open overlay initially when uncontrolled */\n defaultOpen?: boolean;\n /** handler that is called when the overlay's open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n /** placement if the tooltip */\n placement?: TooltipPlacement;\n}\n\n/**\n * Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)\n */\nconst Tooltip = ({\n children,\n className = undefined,\n content,\n placement = 'top',\n defaultOpen = false,\n onOpenChange = undefined,\n containerPadding = 0,\n}: TooltipProps) => (\n <NextTooltip\n className={cn(className)}\n containerPadding={containerPadding}\n content={content}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement={placement}\n shouldFlip\n showArrow\n >\n <span className=\"cursor-pointer\">{children}</span>\n </NextTooltip>\n);\n\nexport default Tooltip;\n","import Tooltip, { tooltipPlacementOptions } from './Tooltip';\n\nexport type { TooltipProps } from './Tooltip';\n\nexport { Tooltip, tooltipPlacementOptions };\n\nexport default Tooltip;\n"],"mappings":";AAEA,SAAS,WAAW,mBAAmB;AACvC,OAAO,QAAQ;AAiDX;AA/CG,IAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuBA,IAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AACrB,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAU;AAAA,IACV,WAAS;AAAA,IAET,8BAAC,UAAK,WAAU,kBAAkB,UAAS;AAAA;AAC7C;AAGF,IAAO,kBAAQ;;;AClDf,IAAOA,mBAAQ;","names":["Tooltip_default"]}
|
package/dist/index.cjs
CHANGED
|
@@ -15,11 +15,15 @@ var _chunkBMKGS5PKcjs = require('./chunk-BMKGS5PK.cjs');
|
|
|
15
15
|
var _chunkL5OZDDU7cjs = require('./chunk-L5OZDDU7.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkBPJAPVB5cjs = require('./chunk-BPJAPVB5.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
var _chunkYUOFNPJOcjs = require('./chunk-YUOFNPJO.cjs');
|
|
22
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunkJ6F42VLAcjs = require('./chunk-J6F42VLA.cjs');
|
|
23
27
|
|
|
24
28
|
// src/hooks/useDebounce.ts
|
|
25
29
|
var _react = require('react');
|
|
@@ -98,5 +102,8 @@ var useLocalStorage_default = useLocalStorage;
|
|
|
98
102
|
|
|
99
103
|
|
|
100
104
|
|
|
101
|
-
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
exports.Button = _chunkI76NWOB3cjs.Button_default; exports.Card = _chunkWTKZJFQVcjs.Card_default; exports.Json = _chunkPI7CBPUScjs.Json_default; exports.Label = _chunkBMKGS5PKcjs.Label_default; exports.Menu = _chunkL5OZDDU7cjs.Menu_default; exports.Modal = _chunkBPJAPVB5cjs.Modal_default; exports.Popover = _chunkYUOFNPJOcjs.Popover_default; exports.Tooltip = _chunkJ6F42VLAcjs.Tooltip_default; exports.modalSizeOptions = _chunkBPJAPVB5cjs.modalSizeOptions; exports.tooltipPlacementOptions = _chunkJ6F42VLAcjs.tooltipPlacementOptions; exports.useDebounce = useDebounce_default; exports.useLocalStorage = useLocalStorage_default;
|
|
102
109
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"names":["useEffect","useState"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"names":["useEffect","useState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,gBAAgB;AAEpC,IAAO,sBAAQ,CAAQ,OAAc,UAAkB;AAErD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACnBA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;AAEpC,IAAM,kBAAkB,CACtB,KACA,iBACqC;AAGrC,QAAM,YAAY,MAAM;AAEtB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AACF,YAAM,OAAO,OAAO,aAAa,QAAQ,GAAG;AAC5C,aAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AAAA,IACnC,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AAIA,QAAM,CAAC,aAAa,cAAc,IAAIA,UAAY,SAAS;AAI3D,QAAM,WAAwC,CAAC,UAAU;AAEvD,QAAI,OAAO,WAAW,aAAa;AACjC,cAAQ;AAAA,QACN,wCAAmC,GAAG;AAAA,MACxC;AAAA,IACF;AAEA,QAAI;AAEF,YAAM,WAAW,iBAAiB,WAAW,MAAM,WAAW,IAAI;AAGlE,aAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;AAGzD,qBAAe,QAAQ;AAGvB,aAAO,cAAc,IAAI,MAAM,eAAe,CAAC;AAAA,IACjD,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAAA,IAChE;AAAA,EACF;AAEA,EAAAD,WAAU,MAAM;AACd,mBAAe,UAAU,CAAC;AAAA,EAE5B,GAAG,CAAC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,UAAM,sBAAsB,MAAM;AAChC,qBAAe,UAAU,CAAC;AAAA,IAC5B;AAGA,WAAO,iBAAiB,WAAW,mBAAmB;AAGtD,WAAO,iBAAiB,iBAAiB,mBAAmB;AAE5D,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,mBAAmB;AACzD,aAAO,oBAAoB,iBAAiB,mBAAmB;AAAA,IACjE;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,aAAa,QAAQ;AAC/B;AAEA,IAAO,0BAAQ","sourcesContent":["import { useEffect, useState } from 'react';\n\nexport default <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","import type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nconst useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -4,9 +4,9 @@ export { C as Card, a as CardProps } from './Card-Cl_I4L8G.cjs';
|
|
|
4
4
|
export { J as Json, a as JsonProps } from './Json-ClGDcbcp.cjs';
|
|
5
5
|
export { L as Label, a as LabelProps } from './Label-DzZDW95M.cjs';
|
|
6
6
|
export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Menu-CG5mVVnv.cjs';
|
|
7
|
-
export { M as Modal, a as ModalProps } from './Modal-
|
|
7
|
+
export { M as Modal, a as ModalProps, m as modalSizeOptions } from './Modal-DWZB1uTb.cjs';
|
|
8
8
|
export { _ as Popover, P as PopoverProps } from './Popover-DbTTk7_N.cjs';
|
|
9
|
-
export { a as TooltipProps } from './Tooltip-
|
|
9
|
+
export { T as Tooltip, a as TooltipProps, t as tooltipPlacementOptions } from './Tooltip-D4znH2L3.cjs';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import '@nextui-org/button';
|
|
12
12
|
import 'tailwind-variants/dist/config.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ export { C as Card, a as CardProps } from './Card-Cl_I4L8G.js';
|
|
|
4
4
|
export { J as Json, a as JsonProps } from './Json-ClGDcbcp.js';
|
|
5
5
|
export { L as Label, a as LabelProps } from './Label-DzZDW95M.js';
|
|
6
6
|
export { M as Menu, b as MenuItem, a as MenuProps, c as MenuSection } from './Menu-CG5mVVnv.js';
|
|
7
|
-
export { M as Modal, a as ModalProps } from './Modal-
|
|
7
|
+
export { M as Modal, a as ModalProps, m as modalSizeOptions } from './Modal-DWZB1uTb.js';
|
|
8
8
|
export { _ as Popover, P as PopoverProps } from './Popover-DbTTk7_N.js';
|
|
9
|
-
export { a as TooltipProps } from './Tooltip-
|
|
9
|
+
export { T as Tooltip, a as TooltipProps, t as tooltipPlacementOptions } from './Tooltip-D4znH2L3.js';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
11
|
import '@nextui-org/button';
|
|
12
12
|
import 'tailwind-variants/dist/config.js';
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,16 @@ import {
|
|
|
14
14
|
Menu_default
|
|
15
15
|
} from "./chunk-VZW4TVTX.js";
|
|
16
16
|
import {
|
|
17
|
-
Modal_default
|
|
18
|
-
|
|
17
|
+
Modal_default,
|
|
18
|
+
modalSizeOptions
|
|
19
|
+
} from "./chunk-CTP2PZYD.js";
|
|
19
20
|
import {
|
|
20
21
|
Popover_default
|
|
21
22
|
} from "./chunk-V2C3KFMP.js";
|
|
22
|
-
import
|
|
23
|
+
import {
|
|
24
|
+
Tooltip_default,
|
|
25
|
+
tooltipPlacementOptions
|
|
26
|
+
} from "./chunk-VISKY2B2.js";
|
|
23
27
|
|
|
24
28
|
// src/hooks/useDebounce.ts
|
|
25
29
|
import { useEffect, useState } from "react";
|
|
@@ -96,6 +100,9 @@ export {
|
|
|
96
100
|
Menu_default as Menu,
|
|
97
101
|
Modal_default as Modal,
|
|
98
102
|
Popover_default as Popover,
|
|
103
|
+
Tooltip_default as Tooltip,
|
|
104
|
+
modalSizeOptions,
|
|
105
|
+
tooltipPlacementOptions,
|
|
99
106
|
useDebounce_default as useDebounce,
|
|
100
107
|
useLocalStorage_default as useLocalStorage
|
|
101
108
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport default <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","import type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nconst useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useDebounce.ts","../src/hooks/useLocalStorage.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport default <Value>(value: Value, delay: number) => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState(value);\n useEffect(\n () => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n },\n [value, delay], // Only re-call effect if value or delay changes\n );\n return debouncedValue;\n};\n","import type { Dispatch, SetStateAction } from 'react';\n\nimport { useEffect, useState } from 'react';\n\nconst useLocalStorage = <T>(\n key: string,\n initialValue: T | (() => T),\n): [T, Dispatch<SetStateAction<T>>] => {\n // Get from local storage then\n // parse stored json or return initialValue\n const readValue = () => {\n // Prevent build error \"window is undefined\" but keep keep working\n if (typeof window === 'undefined') {\n return initialValue;\n }\n\n try {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n console.warn(`Error reading localStorage key “${key}”:`, error);\n return initialValue;\n }\n };\n\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState<T>(readValue);\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue: Dispatch<SetStateAction<T>> = (value) => {\n // Prevent build error \"window is undefined\" but keeps working\n if (typeof window === 'undefined') {\n console.warn(\n `Tried setting localStorage key “${key}” even though environment is not a client`,\n );\n }\n\n try {\n // Allow value to be a function so we have the same API as useState\n const newValue = value instanceof Function ? value(storedValue) : value;\n\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(newValue));\n\n // Save state\n setStoredValue(newValue);\n\n // We dispatch a custom event so every useLocalStorage hook are notified\n window.dispatchEvent(new Event('local-storage'));\n } catch (error) {\n console.warn(`Error setting localStorage key “${key}”:`, error);\n }\n };\n\n useEffect(() => {\n setStoredValue(readValue());\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const handleStorageChange = () => {\n setStoredValue(readValue());\n };\n\n // this only works for other documents, not the current one\n window.addEventListener('storage', handleStorageChange);\n\n // this is a custom event, triggered in writeValueToLocalStorage\n window.addEventListener('local-storage', handleStorageChange);\n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n window.removeEventListener('local-storage', handleStorageChange);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return [storedValue, setValue];\n};\n\nexport default useLocalStorage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,gBAAgB;AAEpC,IAAO,sBAAQ,CAAQ,OAAc,UAAkB;AAErD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D;AAAA,IACE,MAAM;AAEJ,YAAM,UAAU,WAAW,MAAM;AAC/B,0BAAkB,KAAK;AAAA,MACzB,GAAG,KAAK;AAIR,aAAO,MAAM;AACX,qBAAa,OAAO;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,OAAO,KAAK;AAAA;AAAA,EACf;AACA,SAAO;AACT;;;ACnBA,SAAS,aAAAA,YAAW,YAAAC,iBAAgB;AAEpC,IAAM,kBAAkB,CACtB,KACA,iBACqC;AAGrC,QAAM,YAAY,MAAM;AAEtB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AACF,YAAM,OAAO,OAAO,aAAa,QAAQ,GAAG;AAC5C,aAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AAAA,IACnC,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAC9D,aAAO;AAAA,IACT;AAAA,EACF;AAIA,QAAM,CAAC,aAAa,cAAc,IAAIA,UAAY,SAAS;AAI3D,QAAM,WAAwC,CAAC,UAAU;AAEvD,QAAI,OAAO,WAAW,aAAa;AACjC,cAAQ;AAAA,QACN,wCAAmC,GAAG;AAAA,MACxC;AAAA,IACF;AAEA,QAAI;AAEF,YAAM,WAAW,iBAAiB,WAAW,MAAM,WAAW,IAAI;AAGlE,aAAO,aAAa,QAAQ,KAAK,KAAK,UAAU,QAAQ,CAAC;AAGzD,qBAAe,QAAQ;AAGvB,aAAO,cAAc,IAAI,MAAM,eAAe,CAAC;AAAA,IACjD,SAAS,OAAO;AACd,cAAQ,KAAK,wCAAmC,GAAG,WAAM,KAAK;AAAA,IAChE;AAAA,EACF;AAEA,EAAAD,WAAU,MAAM;AACd,mBAAe,UAAU,CAAC;AAAA,EAE5B,GAAG,CAAC,CAAC;AAEL,EAAAA,WAAU,MAAM;AACd,UAAM,sBAAsB,MAAM;AAChC,qBAAe,UAAU,CAAC;AAAA,IAC5B;AAGA,WAAO,iBAAiB,WAAW,mBAAmB;AAGtD,WAAO,iBAAiB,iBAAiB,mBAAmB;AAE5D,WAAO,MAAM;AACX,aAAO,oBAAoB,WAAW,mBAAmB;AACzD,aAAO,oBAAoB,iBAAiB,mBAAmB;AAAA,IACjE;AAAA,EAEF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,aAAa,QAAQ;AAC/B;AAEA,IAAO,0BAAQ;","names":["useEffect","useState"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fuf-stack/pixels",
|
|
3
3
|
"description": "fuf react component library",
|
|
4
4
|
"author": "Hannes Tiede",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"module": "./dist/index.cjs",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"@types/react": "18.2.69",
|
|
100
100
|
"@types/react-dom": "18.2.22",
|
|
101
101
|
"@repo/storybook-config": "0.0.1",
|
|
102
|
-
"@repo/tailwind-config": "0.0.1",
|
|
103
102
|
"@repo/tsup-config": "0.0.1",
|
|
103
|
+
"@repo/tailwind-config": "0.0.1",
|
|
104
104
|
"@repo/vite-config": "0.0.1"
|
|
105
105
|
},
|
|
106
106
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Tooltip/Tooltip.tsx","../src/Tooltip/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Tooltip as NextTooltip } from '@nextui-org/tooltip';\nimport cn from 'classnames';\n\nexport const PlacementOptions = ['top', 'bottom', 'left', 'right'] as const;\nexport type Placement = (typeof PlacementOptions)[number];\n\nexport interface TooltipProps {\n /** trigger child components */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** placement padding in px */\n containerPadding?: number;\n /** content displayed in the tooltip */\n content: ReactNode;\n /** open overlay initially when uncontrolled */\n defaultOpen?: boolean;\n /** handler that is called when the overlay's open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n /** placement if the tooltip */\n placement?: Placement;\n}\n\n/**\n * Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)\n */\nconst Tooltip = ({\n children,\n className = undefined,\n content,\n placement = 'top',\n defaultOpen = false,\n onOpenChange = undefined,\n containerPadding = 0,\n}: TooltipProps) => (\n <NextTooltip\n className={cn(className)}\n containerPadding={containerPadding}\n content={content}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement={placement}\n shouldFlip\n showArrow\n >\n <span className=\"cursor-pointer\">{children}</span>\n </NextTooltip>\n);\n\nexport default Tooltip;\n","import type { TooltipProps } from './Tooltip';\n\nimport Tooltip from './Tooltip';\n\nexport type { TooltipProps };\nexport default Tooltip;\n"],"mappings":";AAEA,SAAS,WAAW,mBAAmB;AACvC,OAAO,QAAQ;AA4CX;AAnBJ,IAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AACrB,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAU;AAAA,IACV,WAAS;AAAA,IAET,8BAAC,UAAK,WAAU,kBAAkB,UAAS;AAAA;AAC7C;AAGF,IAAO,kBAAQ;;;AC9Cf,IAAOA,mBAAQ;","names":["Tooltip_default"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Tooltip/Tooltip.tsx","../src/Tooltip/index.ts"],"names":["Tooltip_default"],"mappings":";AAEA,SAAS,WAAW,mBAAmB;AACvC,OAAO,QAAQ;AA4CX;AAnBJ,IAAM,UAAU,CAAC;AAAA,EACf;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AACrB,MACE;AAAA,EAAC;AAAA;AAAA,IACC,WAAW,GAAG,SAAS;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAU;AAAA,IACV,WAAS;AAAA,IAET,8BAAC,UAAK,WAAU,kBAAkB,UAAS;AAAA;AAC7C;AAGF,IAAO,kBAAQ;;;AC9Cf,IAAOA,mBAAQ","sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Tooltip as NextTooltip } from '@nextui-org/tooltip';\nimport cn from 'classnames';\n\nexport const PlacementOptions = ['top', 'bottom', 'left', 'right'] as const;\nexport type Placement = (typeof PlacementOptions)[number];\n\nexport interface TooltipProps {\n /** trigger child components */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** placement padding in px */\n containerPadding?: number;\n /** content displayed in the tooltip */\n content: ReactNode;\n /** open overlay initially when uncontrolled */\n defaultOpen?: boolean;\n /** handler that is called when the overlay's open state changes */\n onOpenChange?: (isOpen: boolean) => void;\n /** placement if the tooltip */\n placement?: Placement;\n}\n\n/**\n * Tooltip component based on [NextUI Tooltip](https://nextui.org/docs/components/tooltip)\n */\nconst Tooltip = ({\n children,\n className = undefined,\n content,\n placement = 'top',\n defaultOpen = false,\n onOpenChange = undefined,\n containerPadding = 0,\n}: TooltipProps) => (\n <NextTooltip\n className={cn(className)}\n containerPadding={containerPadding}\n content={content}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n placement={placement}\n shouldFlip\n showArrow\n >\n <span className=\"cursor-pointer\">{children}</span>\n </NextTooltip>\n);\n\nexport default Tooltip;\n","import type { TooltipProps } from './Tooltip';\n\nimport Tooltip from './Tooltip';\n\nexport type { TooltipProps };\nexport default Tooltip;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Modal/Modal.tsx","../src/Modal/index.ts"],"names":["Modal_default"],"mappings":";AAEA;AAAA,EACE,SAAS;AAAA,EACT,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AAAA,OACV;AACP,OAAO,QAAQ;AACf,OAAO,iBAAiB;AA8DZ,mBACY,KADZ;AA5DZ,IAAM,QAAQ,YAAY,iBAAiB;AA2B3C,IAAM,QAAQ,CAAC;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AACV,MAAkB;AAChB,QAAM,SAAS,EAAE,KAAK,CAAC;AACvB,SACE,oBAAC,SAAI,WAAW,GAAG,SAAS,GAAG,eAAa,QAC1C;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,YAAY;AAAA,QACV,MAAM;AAAA,UACJ;AAAA,YACE,cAAc,SAAS;AAAA,YACvB,UAAU,SAAS;AAAA,YACnB,UAAU,SAAS;AAAA,UACrB;AAAA;AAAA,UAEA;AAAA,QACF;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA,gBAAe;AAAA,MACf,MAAK;AAAA,MAEL,8BAAC,oBAAiB,eAAa,SAAS,GAAG,MAAM,WAAW,SACzD,gBACC,iCACG;AAAA,iBAAS,oBAAC,mBAAiB,iBAAM;AAAA,QAClC,oBAAC,iBAAc,WAAU,oBACtB,UACH;AAAA,QACC,UAAU,oBAAC,mBAAiB,kBAAO;AAAA,SACtC,GAEJ;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,gBAAQ;;;AChFf,IAAOA,iBAAQ","sourcesContent":["import type { ReactNode } from 'react';\n\nimport {\n Modal as NextModal,\n ModalBody as NextModalBody,\n ModalContent as NextModalContent,\n ModalFooter as NextModalFooter,\n ModalHeader as NextModalHeader,\n} from '@nextui-org/modal';\nimport cn from 'classnames';\nimport createDebug from 'debug';\n\nconst debug = createDebug('component:Modal');\n\nexport const ModalSizeOptions = ['sm', 'md', 'lg'] as const;\ntype ModalSize = (typeof ModalSizeOptions)[number];\n\nexport interface ModalProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string | string[];\n /** HTML data-testid attribute used in e2e tests */\n footer?: ReactNode;\n /** open state (controlled) */\n isOpen: boolean;\n /** close event handler */\n onClose: () => void;\n /** modal size */\n size?: ModalSize;\n /** e2e test id */\n testId?: string;\n /** modal header */\n title?: ReactNode;\n}\n\n/**\n * Modal component based on [NextUI Modal](https://nextui.org/docs/components/modal)\n */\nconst Modal = ({\n children = null,\n className = undefined,\n footer = undefined,\n isOpen,\n onClose,\n size = 'md',\n testId = undefined,\n title = undefined,\n}: ModalProps) => {\n debug('Modal', { size });\n return (\n <div className={cn(className)} data-testid={testId}>\n <NextModal\n backdrop=\"opaque\"\n classNames={{\n base: cn(\n {\n 'lg:w-11/12': size === 'lg',\n 'w-2/12': size === 'sm',\n 'w-6/12': size === 'md',\n },\n // overwrite !rounded-none from nextui\n '!rounded-lg',\n ),\n }}\n isOpen={isOpen}\n onClose={onClose}\n scrollBehavior=\"inside\"\n size=\"full\"\n >\n <NextModalContent data-testid={testId ? `${testId}_modal` : 'modal'}>\n {() => (\n <>\n {title && <NextModalHeader>{title}</NextModalHeader>}\n <NextModalBody className=\"bg-ex-background\">\n {children}\n </NextModalBody>\n {footer && <NextModalFooter>{footer}</NextModalFooter>}\n </>\n )}\n </NextModalContent>\n </NextModal>\n </div>\n );\n};\n\nexport default Modal;\n","import Modal from './Modal';\n\nexport type { ModalProps } from './Modal';\n\nexport { Modal };\n\nexport default Modal;\n"]}
|