@fuf-stack/megapixels 0.11.36 → 0.13.0

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.
Files changed (34) hide show
  1. package/dist/Filter/index.cjs +1 -1
  2. package/dist/Filter/index.d.cts +1 -1
  3. package/dist/Filter/index.d.ts +1 -1
  4. package/dist/Filter/index.js +1 -1
  5. package/dist/{Filter-DHNzbevz.js → Filter-BKfVjFPo.js} +8 -8
  6. package/dist/{Filter-DHNzbevz.js.map → Filter-BKfVjFPo.js.map} +1 -1
  7. package/dist/{Filter-B_YqTFA5.cjs → Filter-Cw7qoiiE.cjs} +8 -8
  8. package/dist/{Filter-B_YqTFA5.cjs.map → Filter-Cw7qoiiE.cjs.map} +1 -1
  9. package/dist/Notification/index.cjs +1 -1
  10. package/dist/Notification/index.d.cts +1 -1
  11. package/dist/Notification/index.d.ts +1 -1
  12. package/dist/Notification/index.js +1 -1
  13. package/dist/{Notification-ClLRWj0j.cjs → Notification-Bg3_1P1x.cjs} +45 -12
  14. package/dist/Notification-Bg3_1P1x.cjs.map +1 -0
  15. package/dist/{Notification-5tyFF-87.js → Notification-Bgw2MtBQ.js} +45 -12
  16. package/dist/Notification-Bgw2MtBQ.js.map +1 -0
  17. package/dist/{index-BkliAQ5x.d.cts → index-CgoXcO8f.d.cts} +2 -2
  18. package/dist/{index-BkliAQ5x.d.cts.map → index-CgoXcO8f.d.cts.map} +1 -1
  19. package/dist/{index-DNAyXW3U.d.ts → index-E2k5kJ14.d.ts} +2 -2
  20. package/dist/{index-DNAyXW3U.d.ts.map → index-E2k5kJ14.d.ts.map} +1 -1
  21. package/dist/{index-DRyBPfQT.d.cts → index-oeUH2qWd.d.cts} +16 -10
  22. package/dist/index-oeUH2qWd.d.cts.map +1 -0
  23. package/dist/{index-DRyBPfQT.d.ts → index-oeUH2qWd.d.ts} +16 -10
  24. package/dist/index-oeUH2qWd.d.ts.map +1 -0
  25. package/dist/index.cjs +2 -2
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +2 -2
  29. package/package.json +10 -11
  30. package/LICENSE +0 -21
  31. package/dist/Notification-5tyFF-87.js.map +0 -1
  32. package/dist/Notification-ClLRWj0j.cjs.map +0 -1
  33. package/dist/index-DRyBPfQT.d.cts.map +0 -1
  34. package/dist/index-DRyBPfQT.d.ts.map +0 -1
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Fröhlich und Frei GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notification-5tyFF-87.js","names":[],"sources":["../src/Notification/notification.tsx","../src/Notification/NotificationHost.tsx","../src/Notification/index.ts"],"sourcesContent":["import type { ModalStoreApi } from '@fuf-stack/pixels/Modal';\nimport type { ToastOptions } from '@fuf-stack/pixels/Toast';\nimport type { ReactNode } from 'react';\n\nimport { modal } from '@fuf-stack/pixels/Modal';\nimport { toast } from '@fuf-stack/pixels/Toast';\n\n/**\n * Props passed to function-based render props on a notification (e.g.\n * `endContent`), exposing helpers usable while rendering.\n */\nexport interface NotificationRenderProps {\n /** Imperative modal API for opening/closing a modal from a notification. */\n modal: ModalStoreApi;\n}\n\n/** Options accepted by every `notification.<variant>()` call */\nexport interface NotificationOptions extends Omit<ToastOptions, 'endContent'> {\n /**\n * The notification's end content. Either a node rendered directly, or a\n * render function that receives the {@link NotificationRenderProps} (incl. a\n * `modal` API to open a modal) and returns the node to render.\n */\n endContent?: ReactNode | ((props: NotificationRenderProps) => ReactNode);\n}\n\n// Render props passed to function-based options (e.g. `endContent`).\nconst renderProps: NotificationRenderProps = { modal };\n\n/**\n * Maps `NotificationOptions` to `ToastOptions` by resolving `endContent`:\n * a render function receives the render props and its returned node is used.\n */\nconst resolveOptions = (\n options?: NotificationOptions,\n): ToastOptions | undefined => {\n if (!options) {\n return undefined;\n }\n // Pull `endContent` out so the remaining options pass through unchanged.\n const { endContent, ...toastOptions } = options;\n\n return {\n ...toastOptions,\n // `ToastOptions.endContent` only accepts a node, so resolve the\n // render-function form down to one (a plain node passes through as-is).\n endContent:\n typeof endContent === 'function' ? endContent(renderProps) : endContent,\n };\n};\n\n/**\n * Imperative API for showing notifications: `default` / `info` / `warn` /\n * `success` / `error` show a notification (each returns an id), and `close`\n * dismisses one by id.\n *\n * Besides a plain node, `endContent` may be a render function that receives\n * the {@link NotificationRenderProps} — including a `modal` API — and returns\n * the node to render, e.g. to open a modal showing details that do not fit\n * into the notification itself.\n *\n * Requires a `<NotificationHost />` to be mounted in the React tree.\n *\n * @example\n * ```tsx\n * notification.error('A request failed.', {\n * title: 'Request failed',\n * endContent: ({ modal }) => (\n * <Button onClick={() => modal.open({ content: details })}>More</Button>\n * ),\n * });\n * ```\n */\nconst notification = {\n /**\n * Show a default notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n default: (message: ReactNode, options?: NotificationOptions) => {\n return toast.default(message, resolveOptions(options));\n },\n /**\n * Show an info notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n info: (message: ReactNode, options?: NotificationOptions) => {\n return toast.info(message, resolveOptions(options));\n },\n /**\n * Show a warning notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n warn: (message: ReactNode, options?: NotificationOptions) => {\n return toast.warn(message, resolveOptions(options));\n },\n /**\n * Show a success notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n success: (message: ReactNode, options?: NotificationOptions) => {\n return toast.success(message, resolveOptions(options));\n },\n /**\n * Show an error notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n error: (message: ReactNode, options?: NotificationOptions) => {\n return toast.error(message, resolveOptions(options));\n },\n /** Close a notification by its id */\n close: (id: string | number) => {\n toast.close(id);\n },\n};\n\nexport default notification;\n","import type { CSSProperties } from 'react';\n\nimport { ModalHost } from '@fuf-stack/pixels/Modal';\nimport { Toaster } from '@fuf-stack/pixels/Toast';\n\nexport interface NotificationHostProps {\n /**\n * Width applied to all toasts. A number is treated as pixels; a string is\n * used verbatim (e.g. `'600px'`, `'40rem'`). Sets Sonner's `--width` CSS\n * variable on the Toaster.\n */\n width?: number | string;\n}\n\n/**\n * Mounts the Toaster and ModalHost.\n *\n * Use once at the top level of your app:\n *\n * ```tsx\n * <NotificationHost />\n * ```\n */\nconst NotificationHost = ({ width = 600 }: NotificationHostProps) => {\n // Sonner defaults to z-index 999999999, which would render toasts above the\n // HeroUI modal (z-50). Lower it so modals opened from a toast's \"More\"\n // button stay on top. `--width` is passed inline because Sonner sets its\n // default `--width` inline on the same element, which beats class-based\n // overrides.\n const toasterStyle = {\n zIndex: 40,\n ...(width != null && {\n '--width': typeof width === 'number' ? `${width}px` : width,\n }),\n } as CSSProperties;\n return (\n <>\n <Toaster style={toasterStyle} />\n <ModalHost />\n </>\n );\n};\n\nexport default NotificationHost;\n","import notification from './notification';\nimport NotificationHost from './NotificationHost';\n\nexport type {\n NotificationOptions,\n NotificationRenderProps,\n} from './notification';\nexport type { NotificationHostProps } from './NotificationHost';\n\nexport { NotificationHost, notification };\nexport default notification;\n"],"mappings":";;;;AA2BA,MAAM,cAAuC,EAAE,MAAM;;;;;AAMrD,MAAM,kBACJ,YAC6B;CAC7B,IAAI,CAAC,SACH;CAGF,MAAM,EAAE,YAAY,GAAG,iBAAiB;CAExC,OAAO;EACL,GAAG;EAGH,YACE,OAAO,eAAe,aAAa,WAAW,WAAW,IAAI;CACjE;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,eAAe;;;;;CAKnB,UAAU,SAAoB,YAAkC;EAC9D,OAAO,MAAM,QAAQ,SAAS,eAAe,OAAO,CAAC;CACvD;;;;;CAKA,OAAO,SAAoB,YAAkC;EAC3D,OAAO,MAAM,KAAK,SAAS,eAAe,OAAO,CAAC;CACpD;;;;;CAKA,OAAO,SAAoB,YAAkC;EAC3D,OAAO,MAAM,KAAK,SAAS,eAAe,OAAO,CAAC;CACpD;;;;;CAKA,UAAU,SAAoB,YAAkC;EAC9D,OAAO,MAAM,QAAQ,SAAS,eAAe,OAAO,CAAC;CACvD;;;;;CAKA,QAAQ,SAAoB,YAAkC;EAC5D,OAAO,MAAM,MAAM,SAAS,eAAe,OAAO,CAAC;CACrD;;CAEA,QAAQ,OAAwB;EAC9B,MAAM,MAAM,EAAE;CAChB;AACF;;;;;;;;;;;;AC1FA,MAAM,oBAAoB,EAAE,QAAQ,UAAiC;CAYnE,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,SAAD,EAAS,OAAO;EAPlB,QAAQ;EACR,GAAI,SAAS,QAAQ,EACnB,WAAW,OAAO,UAAU,WAAW,GAAG,MAAM,MAAM,MACxD;CAI6B,EAAI,CAAA,GAC/B,oBAAC,WAAD,CAAY,CAAA,CACZ,EAAA,CAAA;AAEN;;;AC/BA,IAAA,uBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Notification-ClLRWj0j.cjs","names":["toast","Toaster","ModalHost"],"sources":["../src/Notification/notification.tsx","../src/Notification/NotificationHost.tsx","../src/Notification/index.ts"],"sourcesContent":["import type { ModalStoreApi } from '@fuf-stack/pixels/Modal';\nimport type { ToastOptions } from '@fuf-stack/pixels/Toast';\nimport type { ReactNode } from 'react';\n\nimport { modal } from '@fuf-stack/pixels/Modal';\nimport { toast } from '@fuf-stack/pixels/Toast';\n\n/**\n * Props passed to function-based render props on a notification (e.g.\n * `endContent`), exposing helpers usable while rendering.\n */\nexport interface NotificationRenderProps {\n /** Imperative modal API for opening/closing a modal from a notification. */\n modal: ModalStoreApi;\n}\n\n/** Options accepted by every `notification.<variant>()` call */\nexport interface NotificationOptions extends Omit<ToastOptions, 'endContent'> {\n /**\n * The notification's end content. Either a node rendered directly, or a\n * render function that receives the {@link NotificationRenderProps} (incl. a\n * `modal` API to open a modal) and returns the node to render.\n */\n endContent?: ReactNode | ((props: NotificationRenderProps) => ReactNode);\n}\n\n// Render props passed to function-based options (e.g. `endContent`).\nconst renderProps: NotificationRenderProps = { modal };\n\n/**\n * Maps `NotificationOptions` to `ToastOptions` by resolving `endContent`:\n * a render function receives the render props and its returned node is used.\n */\nconst resolveOptions = (\n options?: NotificationOptions,\n): ToastOptions | undefined => {\n if (!options) {\n return undefined;\n }\n // Pull `endContent` out so the remaining options pass through unchanged.\n const { endContent, ...toastOptions } = options;\n\n return {\n ...toastOptions,\n // `ToastOptions.endContent` only accepts a node, so resolve the\n // render-function form down to one (a plain node passes through as-is).\n endContent:\n typeof endContent === 'function' ? endContent(renderProps) : endContent,\n };\n};\n\n/**\n * Imperative API for showing notifications: `default` / `info` / `warn` /\n * `success` / `error` show a notification (each returns an id), and `close`\n * dismisses one by id.\n *\n * Besides a plain node, `endContent` may be a render function that receives\n * the {@link NotificationRenderProps} — including a `modal` API — and returns\n * the node to render, e.g. to open a modal showing details that do not fit\n * into the notification itself.\n *\n * Requires a `<NotificationHost />` to be mounted in the React tree.\n *\n * @example\n * ```tsx\n * notification.error('A request failed.', {\n * title: 'Request failed',\n * endContent: ({ modal }) => (\n * <Button onClick={() => modal.open({ content: details })}>More</Button>\n * ),\n * });\n * ```\n */\nconst notification = {\n /**\n * Show a default notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n default: (message: ReactNode, options?: NotificationOptions) => {\n return toast.default(message, resolveOptions(options));\n },\n /**\n * Show an info notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n info: (message: ReactNode, options?: NotificationOptions) => {\n return toast.info(message, resolveOptions(options));\n },\n /**\n * Show a warning notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n warn: (message: ReactNode, options?: NotificationOptions) => {\n return toast.warn(message, resolveOptions(options));\n },\n /**\n * Show a success notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n success: (message: ReactNode, options?: NotificationOptions) => {\n return toast.success(message, resolveOptions(options));\n },\n /**\n * Show an error notification.\n * @returns The toast id which can be passed to `notification.close()`\n */\n error: (message: ReactNode, options?: NotificationOptions) => {\n return toast.error(message, resolveOptions(options));\n },\n /** Close a notification by its id */\n close: (id: string | number) => {\n toast.close(id);\n },\n};\n\nexport default notification;\n","import type { CSSProperties } from 'react';\n\nimport { ModalHost } from '@fuf-stack/pixels/Modal';\nimport { Toaster } from '@fuf-stack/pixels/Toast';\n\nexport interface NotificationHostProps {\n /**\n * Width applied to all toasts. A number is treated as pixels; a string is\n * used verbatim (e.g. `'600px'`, `'40rem'`). Sets Sonner's `--width` CSS\n * variable on the Toaster.\n */\n width?: number | string;\n}\n\n/**\n * Mounts the Toaster and ModalHost.\n *\n * Use once at the top level of your app:\n *\n * ```tsx\n * <NotificationHost />\n * ```\n */\nconst NotificationHost = ({ width = 600 }: NotificationHostProps) => {\n // Sonner defaults to z-index 999999999, which would render toasts above the\n // HeroUI modal (z-50). Lower it so modals opened from a toast's \"More\"\n // button stay on top. `--width` is passed inline because Sonner sets its\n // default `--width` inline on the same element, which beats class-based\n // overrides.\n const toasterStyle = {\n zIndex: 40,\n ...(width != null && {\n '--width': typeof width === 'number' ? `${width}px` : width,\n }),\n } as CSSProperties;\n return (\n <>\n <Toaster style={toasterStyle} />\n <ModalHost />\n </>\n );\n};\n\nexport default NotificationHost;\n","import notification from './notification';\nimport NotificationHost from './NotificationHost';\n\nexport type {\n NotificationOptions,\n NotificationRenderProps,\n} from './notification';\nexport type { NotificationHostProps } from './NotificationHost';\n\nexport { NotificationHost, notification };\nexport default notification;\n"],"mappings":";;;;AA2BA,MAAM,cAAuC,EAAE,OAAA,wBAAA,MAAM;;;;;AAMrD,MAAM,kBACJ,YAC6B;CAC7B,IAAI,CAAC,SACH;CAGF,MAAM,EAAE,YAAY,GAAG,iBAAiB;CAExC,OAAO;EACL,GAAG;EAGH,YACE,OAAO,eAAe,aAAa,WAAW,WAAW,IAAI;CACjE;AACF;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,eAAe;;;;;CAKnB,UAAU,SAAoB,YAAkC;EAC9D,OAAOA,wBAAAA,MAAM,QAAQ,SAAS,eAAe,OAAO,CAAC;CACvD;;;;;CAKA,OAAO,SAAoB,YAAkC;EAC3D,OAAOA,wBAAAA,MAAM,KAAK,SAAS,eAAe,OAAO,CAAC;CACpD;;;;;CAKA,OAAO,SAAoB,YAAkC;EAC3D,OAAOA,wBAAAA,MAAM,KAAK,SAAS,eAAe,OAAO,CAAC;CACpD;;;;;CAKA,UAAU,SAAoB,YAAkC;EAC9D,OAAOA,wBAAAA,MAAM,QAAQ,SAAS,eAAe,OAAO,CAAC;CACvD;;;;;CAKA,QAAQ,SAAoB,YAAkC;EAC5D,OAAOA,wBAAAA,MAAM,MAAM,SAAS,eAAe,OAAO,CAAC;CACrD;;CAEA,QAAQ,OAAwB;EAC9B,wBAAA,MAAM,MAAM,EAAE;CAChB;AACF;;;;;;;;;;;;AC1FA,MAAM,oBAAoB,EAAE,QAAQ,UAAiC;CAYnE,OACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,SAAD,EAAS,OAAO;EAPlB,QAAQ;EACR,GAAI,SAAS,QAAQ,EACnB,WAAW,OAAO,UAAU,WAAW,GAAG,MAAM,MAAM,MACxD;CAI6B,EAAI,CAAA,GAC/B,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,WAAD,CAAY,CAAA,CACZ,EAAA,CAAA;AAEN;;;AC/BA,IAAA,uBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DRyBPfQT.d.cts","names":[],"sources":["../src/Notification/notification.tsx","../src/Notification/NotificationHost.tsx"],"mappings":";;;;;;;AAWA;;UAAiB,uBAAA;EAEf;EAAA,KAAA,EAAO,aAAa;AAAA;;UAIL,mBAAA,SAA4B,IAAA,CAAK,YAAA;EAAA;;;;;EAMhD,UAAA,GAAa,SAAA,KAAc,KAAA,EAAO,uBAAA,KAA4B,SAAA;AAAA;;;;;;;;;AAAS;AACxE;;;;;;;;;;;;;cAiDK,YAAA;EAiCqD;;;;qBA5BtC,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;kBAOZ,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;kBAOT,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;qBAON,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;mBAOX,SAAA,EAAS,OAAA,GAAY,mBAAA,UAAZ;;;;;UCrGX,qBAAA;;;;;ADMjB;ECAE,KAAK;AAAA;;ADEe;AAItB;;;;;;;cCMM,gBAAA;EAAoB;AAAA,GAAiB,qBAAqB,iCAAA,GAAA,CAAA,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DRyBPfQT.d.ts","names":[],"sources":["../src/Notification/notification.tsx","../src/Notification/NotificationHost.tsx"],"mappings":";;;;;;;AAWA;;UAAiB,uBAAA;EAEf;EAAA,KAAA,EAAO,aAAa;AAAA;;UAIL,mBAAA,SAA4B,IAAA,CAAK,YAAA;EAAA;;;;;EAMhD,UAAA,GAAa,SAAA,KAAc,KAAA,EAAO,uBAAA,KAA4B,SAAA;AAAA;;;;;;;;;AAAS;AACxE;;;;;;;;;;;;;cAiDK,YAAA;EAiCqD;;;;qBA5BtC,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;kBAOZ,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;kBAOT,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;qBAON,SAAA,EAAS,OAAA,GAAY,mBAAA;EAAZ;;;;mBAOX,SAAA,EAAS,OAAA,GAAY,mBAAA,UAAZ;;;;;UCrGX,qBAAA;;;;;ADMjB;ECAE,KAAK;AAAA;;ADEe;AAItB;;;;;;;cCMM,gBAAA;EAAoB;AAAA,GAAiB,qBAAqB,iCAAA,GAAA,CAAA,OAAA"}