@keboola/design 13.0.2 → 13.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keboola/design",
3
- "version": "13.0.2",
3
+ "version": "13.1.0",
4
4
  "description": "Keboola UI platform design system — shadcn-aligned React primitives, Keboola-branded blocks, and the form bindings built on TanStack Form.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,49 +0,0 @@
1
- import { toast as toast$1 } from "./toast-CyXEdaCZ.js";
2
- import { useEffect } from "react";
3
- import { jsx } from "react/jsx-runtime";
4
- import { Toaster } from "sonner";
5
- //#region src/components/Toast/useNotification.tsx
6
- /**
7
- * Declarative notification component built on top of sonner/toast.
8
- *
9
- * Use `Notification` for persistent, system-driven messages that require user acknowledgment
10
- * (e.g., trial expiration warnings, upgrade prompts, billing alerts).
11
- * The notification stays visible until the user dismisses it or the component unmounts.
12
- *
13
- * Use `toast()` for transient feedback after a user action
14
- * (e.g., "Saved", "Copied", "Deleted") that auto-dismisses after a few seconds.
15
- */
16
- const useNotification = ({ enabled = true, ...toastOptions }) => {
17
- useEffect(() => {
18
- if (!enabled) return;
19
- let toastId;
20
- const frameId = requestAnimationFrame(() => {
21
- toastId = toast$1({
22
- ...toastOptions,
23
- duration: toastOptions.duration ?? Infinity
24
- });
25
- });
26
- return () => {
27
- cancelAnimationFrame(frameId);
28
- toast$1.dismiss(toastId);
29
- };
30
- }, [enabled]);
31
- };
32
- //#endregion
33
- //#region src/components/Toast/Toaster.tsx
34
- const DEFAULT_STYLES = { "--width": "512px" };
35
- const stopPropagation = (event) => event.stopPropagation();
36
- const Toaster$1 = ({ gap = 12, visibleToasts = 5, ...props }) => /* @__PURE__ */ jsx("div", {
37
- onPointerDown: stopPropagation,
38
- children: /* @__PURE__ */ jsx(Toaster, {
39
- ...props,
40
- gap,
41
- visibleToasts,
42
- className: "tw:pointer-events-auto tw:flex tw:w-full tw:max-w-lg tw:justify-center",
43
- style: DEFAULT_STYLES
44
- })
45
- });
46
- //#endregion
47
- export { Toaster$1 as Toaster, useNotification };
48
-
49
- //# sourceMappingURL=Toast-PfQf3vj-.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Toast-PfQf3vj-.js","names":["toast","Toaster","SonnerToaster"],"sources":["../src/components/Toast/useNotification.tsx","../src/components/Toast/Toaster.tsx"],"sourcesContent":["import { useEffect } from 'react';\n\nimport { toast } from './toast';\n\ntype Props = {\n enabled?: boolean;\n} & Parameters<typeof toast>[0];\n\n/**\n * Declarative notification component built on top of sonner/toast.\n *\n * Use `Notification` for persistent, system-driven messages that require user acknowledgment\n * (e.g., trial expiration warnings, upgrade prompts, billing alerts).\n * The notification stays visible until the user dismisses it or the component unmounts.\n *\n * Use `toast()` for transient feedback after a user action\n * (e.g., \"Saved\", \"Copied\", \"Deleted\") that auto-dismisses after a few seconds.\n */\nexport const useNotification = ({ enabled = true, ...toastOptions }: Props) => {\n useEffect(() => {\n if (!enabled) return;\n let toastId: string | number | undefined;\n const frameId = requestAnimationFrame(() => {\n toastId = toast({ ...toastOptions, duration: toastOptions.duration ?? Infinity });\n });\n\n return () => {\n cancelAnimationFrame(frameId);\n toast.dismiss(toastId);\n };\n // oxlint-disable-next-line react/exhaustive-deps -- we only want to trigger this effect when enabled changes, not when other toast options change\n }, [enabled]);\n};\n","import type { ComponentProps, PointerEvent } from 'react';\nimport { Toaster as SonnerToaster } from 'sonner';\n\ntype ToasterProps = ComponentProps<typeof SonnerToaster>;\n\nconst DEFAULT_STYLES = {\n '--width': '512px', // match max-w-lg\n} as React.CSSProperties;\n\nconst stopPropagation = (event: PointerEvent) => event.stopPropagation();\n\nexport const Toaster = ({ gap = 12, visibleToasts = 5, ...props }: ToasterProps) => (\n // Wrapper prevents toast clicks from reaching Radix Dialog's DismissableLayer,\n // which would otherwise close the modal on any \"outside\" pointer event.\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions\n <div onPointerDown={stopPropagation}>\n <SonnerToaster\n {...props}\n gap={gap}\n visibleToasts={visibleToasts}\n className=\"tw:pointer-events-auto tw:flex tw:w-full tw:max-w-lg tw:justify-center\"\n style={DEFAULT_STYLES}\n />\n </div>\n);\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAa,mBAAmB,EAAE,UAAU,MAAM,GAAG,mBAA0B;CAC7E,gBAAgB;EACd,IAAI,CAAC,SAAS;EACd,IAAI;EACJ,MAAM,UAAU,4BAA4B;GAC1C,UAAUA,QAAM;IAAE,GAAG;IAAc,UAAU,aAAa,YAAY;GAAS,CAAC;EAClF,CAAC;EAED,aAAa;GACX,qBAAqB,OAAO;GAC5B,QAAM,QAAQ,OAAO;EACvB;CAEF,GAAG,CAAC,OAAO,CAAC;AACd;;;AC3BA,MAAM,iBAAiB,EACrB,WAAW,QACb;AAEA,MAAM,mBAAmB,UAAwB,MAAM,gBAAgB;AAEvE,MAAaC,aAAW,EAAE,MAAM,IAAI,gBAAgB,GAAG,GAAG,YAIxD,oBAAC,OAAD;CAAK,eAAe;CAClB,UAAA,oBAACC,SAAD;EACE,GAAI;EACC;EACU;EACf,WAAU;EACV,OAAO;CACR,CAAA;AACE,CAAA"}