@krosoft/react 0.0.15 → 0.0.16

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.
@@ -66,15 +66,15 @@ const W = (e) => {
66
66
  if (t.startsWith("aria-") || t === "role" || t === "title")
67
67
  return !0;
68
68
  return !1;
69
- }, j = y({}), $ = () => N(j), E = h(
69
+ }, j = y({}), $ = () => N(j), z = h(
70
70
  ({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: o, className: n = "", children: s, iconNode: f, ...d }, C) => {
71
71
  const {
72
72
  size: c = 24,
73
73
  strokeWidth: u = 2,
74
- absoluteStrokeWidth: w = !1,
75
- color: b = "currentColor",
74
+ absoluteStrokeWidth: b = !1,
75
+ color: w = "currentColor",
76
76
  className: k = ""
77
- } = $() ?? {}, g = o ?? w ? Number(r ?? u) * 24 / Number(t ?? c) : r ?? u;
77
+ } = $() ?? {}, g = o ?? b ? Number(r ?? u) * 24 / Number(t ?? c) : r ?? u;
78
78
  return l(
79
79
  "svg",
80
80
  {
@@ -82,7 +82,7 @@ const W = (e) => {
82
82
  ...i,
83
83
  width: t ?? c ?? i.width,
84
84
  height: t ?? c ?? i.height,
85
- stroke: e ?? b,
85
+ stroke: e ?? w,
86
86
  strokeWidth: g,
87
87
  className: x("lucide", k, n),
88
88
  ...!s && !W(d) && { "aria-hidden": "true" },
@@ -101,9 +101,9 @@ const W = (e) => {
101
101
  * This source code is licensed under the ISC license.
102
102
  * See the LICENSE file in the root directory of this source tree.
103
103
  */
104
- const U = (e, t) => {
104
+ const E = (e, t) => {
105
105
  const r = h(
106
- ({ className: o, ...n }, s) => l(E, {
106
+ ({ className: o, ...n }, s) => l(z, {
107
107
  ref: s,
108
108
  iconNode: t,
109
109
  className: x(
@@ -122,9 +122,9 @@ const U = (e, t) => {
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const _ = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], z = U("loader-circle", _), Z = ({ message: e }) => /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
126
- /* @__PURE__ */ a(z, { className: "w-8 h-8 animate-spin mb-4 text-primary" }),
127
- e ? /* @__PURE__ */ a("p", { className: "font-mono uppercase tracking-widest text-xs", children: e }) : null
125
+ const U = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = E("loader-circle", U), Z = ({ message: e }) => /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
126
+ /* @__PURE__ */ a(_, { className: "size-8 animate-spin mb-4 text-primary" }),
127
+ e ? /* @__PURE__ */ a("p", { className: "font-semibold text-sm", children: e }) : null
128
128
  ] });
129
129
  export {
130
130
  P as E,
@@ -1,4 +1,4 @@
1
- import { E as t, L as o } from "../../LoadingState-DC6s7pmB.js";
1
+ import { E as t, L as o } from "../../LoadingState-CEoOCk2t.js";
2
2
  export {
3
3
  t as ErrorState,
4
4
  o as LoadingState
@@ -1,4 +1,4 @@
1
- import { E as t, L as o } from "../../../LoadingState-DC6s7pmB.js";
1
+ import { E as t, L as o } from "../../../LoadingState-CEoOCk2t.js";
2
2
  export {
3
3
  t as ErrorState,
4
4
  o as LoadingState
@@ -1,4 +1,4 @@
1
- import { E as t, L as e } from "../LoadingState-DC6s7pmB.js";
1
+ import { E as t, L as e } from "../LoadingState-CEoOCk2t.js";
2
2
  import { A as o, a as i, b as l, B as A, c as d } from "../badge-DUEyCWfa.js";
3
3
  export {
4
4
  o as Alert,
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import * as ToastPrimitives from "@radix-ui/react-toast";
3
+ import { type VariantProps } from "class-variance-authority";
4
+ declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
5
+ declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
6
+ declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
7
+ variant?: "default" | "destructive" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
9
+ declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
+ declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
14
+ type ToastActionElement = React.ReactElement<typeof ToastAction>;
15
+ export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
16
+ //# sourceMappingURL=toast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa,8CAA2B,CAAC;AAE/C,QAAA,MAAM,aAAa,kKAYjB,CAAC;AAmBH,QAAA,MAAM,KAAK;;qHAYT,CAAC;AAGH,QAAA,MAAM,WAAW,kKAYf,CAAC;AAGH,QAAA,MAAM,UAAU,iKAcd,CAAC;AAGH,QAAA,MAAM,UAAU,2JASd,CAAC;AAGH,QAAA,MAAM,gBAAgB,iKASpB,CAAC;AAGH,KAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAC;AAE/D,KAAK,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,GACZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function useMobile(): boolean;
2
+ //# sourceMappingURL=useMobile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useMobile.tsx"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,YAcxB"}
@@ -0,0 +1,5 @@
1
+ export declare const useNotifications: () => {
2
+ showSuccess: (title: string, description?: string | undefined) => void;
3
+ showError: (title: string, description?: string | undefined, error?: Error | null) => void;
4
+ };
5
+ //# sourceMappingURL=useNotifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useNotifications.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB;yBAGC,MAAM,gBAAgB,MAAM,GAAG,SAAS;uBAQ3D,MAAM,gBACC,MAAM,GAAG,SAAS,UACxB,KAAK,GAAG,IAAI;CAcvB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+ import type { ToastActionElement, ToastProps } from "../../components/ui/toast";
3
+ type ToasterToast = ToastProps & {
4
+ id: string;
5
+ title?: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ action?: ToastActionElement;
8
+ };
9
+ declare const actionTypes: {
10
+ readonly ADD_TOAST: "ADD_TOAST";
11
+ readonly UPDATE_TOAST: "UPDATE_TOAST";
12
+ readonly DISMISS_TOAST: "DISMISS_TOAST";
13
+ readonly REMOVE_TOAST: "REMOVE_TOAST";
14
+ };
15
+ type ActionType = typeof actionTypes;
16
+ type Action = {
17
+ type: ActionType["ADD_TOAST"];
18
+ toast: ToasterToast;
19
+ } | {
20
+ type: ActionType["UPDATE_TOAST"];
21
+ toast: Partial<ToasterToast>;
22
+ } | {
23
+ type: ActionType["DISMISS_TOAST"];
24
+ toastId?: ToasterToast["id"];
25
+ } | {
26
+ type: ActionType["REMOVE_TOAST"];
27
+ toastId?: ToasterToast["id"];
28
+ };
29
+ interface State {
30
+ toasts: ToasterToast[];
31
+ }
32
+ export declare const reducer: (state: State, action: Action) => State;
33
+ type Toast = Omit<ToasterToast, "id">;
34
+ declare function toast({ ...props }: Toast): {
35
+ id: string;
36
+ dismiss: () => void;
37
+ update: (props: ToasterToast) => void;
38
+ };
39
+ declare function useToast(): {
40
+ toast: typeof toast;
41
+ dismiss: (toastId?: string) => void;
42
+ toasts: ToasterToast[];
43
+ };
44
+ export { useToast, toast };
45
+ //# sourceMappingURL=useToast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useToast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKhF,KAAK,YAAY,GAAG,UAAU,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,QAAA,MAAM,WAAW;;;;;CAKP,CAAC;AASX,KAAK,UAAU,GAAG,OAAO,WAAW,CAAC;AAErC,KAAK,MAAM,GACP;IACE,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;CACrB,GACD;IACE,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACjC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC;AAEN,UAAU,KAAK;IACb,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAoBD,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,EAAE,QAAQ,MAAM,KAAG,KAmDtD,CAAC;AAaF,KAAK,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAEtC,iBAAS,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK;;;oBAGT,YAAY;EAwBpC;AAED,iBAAS,QAAQ;;wBAgBO,MAAM;YApIpB,YAAY,EAAE;EAsIvB;AAED,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -32,6 +32,7 @@
32
32
  "react": ">=18.3.1"
33
33
  },
34
34
  "dependencies": {
35
+ "@radix-ui/react-toast": "^1.2.15",
35
36
  "class-variance-authority": "^0.7.1",
36
37
  "clsx": "^2.1.1",
37
38
  "lucide-react": "^1.7.0",