@oniratec/onira-react-ui 1.3.3 → 1.4.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/dist/index.d.ts CHANGED
@@ -20,6 +20,14 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
20
20
  import { UseFormReturn } from 'react-hook-form';
21
21
  import { z } from 'zod';
22
22
 
23
+ export declare const Alert: React_2.ForwardRefExoticComponent<AlertProps & React_2.RefAttributes<HTMLDivElement>>;
24
+
25
+ export declare interface AlertProps extends React_2.HTMLAttributes<HTMLDivElement> {
26
+ variant?: AlertVariant;
27
+ }
28
+
29
+ export declare type AlertVariant = 'error' | 'warning' | 'info' | 'success';
30
+
23
31
  export declare function AsyncSelect<T>({ value, onValueChange, placeholder, searchPlaceholder, disabled, hasError, minChars, debounceMs, fetcher, getOptionValue, getOptionLabel, emptyLabel, loadingLabel, emptyActionLabel, onEmptyActionClick, contentClassName, triggerClassName, }: Props<T>): JSX.Element;
24
32
 
25
33
  /** =========================
@@ -65,6 +73,32 @@ export declare type AsyncSelectOption = {
65
73
  meta?: unknown;
66
74
  };
67
75
 
76
+ export declare const AuthLayout: React_2.FC<AuthLayoutProps>;
77
+
78
+ export declare interface AuthLayoutLogo {
79
+ src: string;
80
+ alt: string;
81
+ href?: string;
82
+ }
83
+
84
+ export declare interface AuthLayoutProps {
85
+ logo?: AuthLayoutLogo;
86
+ children: React_2.ReactNode;
87
+ footer?: React_2.ReactNode;
88
+ className?: string;
89
+ }
90
+
91
+ export declare const Badge: React_2.ForwardRefExoticComponent<BadgeProps & React_2.RefAttributes<HTMLSpanElement>>;
92
+
93
+ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLSpanElement> {
94
+ variant?: BadgeVariant;
95
+ size?: BadgeSize;
96
+ }
97
+
98
+ export declare type BadgeSize = 'sm' | 'md';
99
+
100
+ export declare type BadgeVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
101
+
68
102
  declare type BaseField<T extends FieldValues> = InputField<T> | TextareaField<T> | SelectField<T> | AsyncSelectField<T> | ToggleField<T> | CheckboxField<T> | DateField<T> | FileUploadField<T> | CustomField<T>;
69
103
 
70
104
  /** =========================
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { clsx } from "clsx";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import * as React from "react";
5
5
  import React__default, { useLayoutEffect, useState, forwardRef, useId as useId$1, useRef, useMemo, useEffect, useCallback, Fragment } from "react";
6
- import { Loader2, Calendar, ChevronLeft, ChevronRight, Check, Circle, EyeOff, EyeIcon, UploadCloud, X as X$1, ChevronDown, ChevronUp, ChevronsUpDown, Eye } from "lucide-react";
6
+ import { Loader2, CheckCircle, Info as Info$1, AlertTriangle, AlertCircle, Calendar, ChevronLeft, ChevronRight, Check, Circle, EyeOff, EyeIcon, UploadCloud, X as X$1, ChevronDown, ChevronUp, ChevronsUpDown, Eye } from "lucide-react";
7
7
  import * as ReactDOM from "react-dom";
8
8
  import ReactDOM__default from "react-dom";
9
9
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
@@ -635,7 +635,44 @@ const Logo = ({
635
635
  ),
636
636
  children: t
637
637
  }
638
- ), CardHeader = ({ children: t, className: e }) => /* @__PURE__ */ jsx("div", { className: cn$1("mb-2", e), children: t }), CardTitle = ({ children: t, className: e }) => /* @__PURE__ */ jsx("h3", { className: cn$1("text-sm font-medium text-[color:var(--text-2)]", e), children: t }), CardContent = ({ children: t, className: e }) => /* @__PURE__ */ jsx("div", { className: cn$1("text-2xl font-semibold text-[color:var(--text-1)]", e), children: t });
638
+ ), CardHeader = ({ children: t, className: e }) => /* @__PURE__ */ jsx("div", { className: cn$1("mb-2", e), children: t }), CardTitle = ({ children: t, className: e }) => /* @__PURE__ */ jsx("h3", { className: cn$1("text-sm font-medium text-[color:var(--text-2)]", e), children: t }), CardContent = ({ children: t, className: e }) => /* @__PURE__ */ jsx("div", { className: cn$1("text-2xl font-semibold text-[color:var(--text-1)]", e), children: t }), ICONS = {
639
+ error: AlertCircle,
640
+ warning: AlertTriangle,
641
+ info: Info$1,
642
+ success: CheckCircle
643
+ }, Alert = React.forwardRef(
644
+ ({ className: t, variant: e = "info", children: r, ...i }, a) => {
645
+ const h = ICONS[e];
646
+ return /* @__PURE__ */ jsxs(
647
+ "div",
648
+ {
649
+ ref: a,
650
+ role: "alert",
651
+ "data-variant": e,
652
+ className: cn$1("oniratec-alert", t),
653
+ ...i,
654
+ children: [
655
+ /* @__PURE__ */ jsx(h, { className: "oniratec-alert__icon", "aria-hidden": "true" }),
656
+ /* @__PURE__ */ jsx("div", { className: "oniratec-alert__content", children: r })
657
+ ]
658
+ }
659
+ );
660
+ }
661
+ );
662
+ Alert.displayName = "Alert";
663
+ const Badge = React.forwardRef(
664
+ ({ className: t, variant: e = "default", size: r = "md", ...i }, a) => /* @__PURE__ */ jsx(
665
+ "span",
666
+ {
667
+ ref: a,
668
+ "data-variant": e,
669
+ "data-size": r,
670
+ className: cn$1("oniratec-badge", t),
671
+ ...i
672
+ }
673
+ )
674
+ );
675
+ Badge.displayName = "Badge";
639
676
  function composeEventHandlers(t, e, { checkForDefaultPrevented: r = !0 } = {}) {
640
677
  return function(a) {
641
678
  if (t?.(a), r === !1 || !a.defaultPrevented)
@@ -17695,6 +17732,23 @@ const Toggle = ({
17695
17732
  }
17696
17733
  ) }));
17697
17734
  TooltipContent.displayName = "TooltipContent";
17735
+ const AuthLayout = ({ logo: t, children: e, footer: r, className: i }) => /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-gradient-to-br from-[--surface-1] via-[--surface-2] to-[--surface-1] px-4 py-12", children: /* @__PURE__ */ jsxs(
17736
+ "div",
17737
+ {
17738
+ className: cn$1(
17739
+ "w-full max-w-sm rounded-xl bg-[--surface-1] p-8",
17740
+ "shadow-[var(--shadow-card-xl)] border border-[--border-1]",
17741
+ "flex flex-col gap-6",
17742
+ i
17743
+ ),
17744
+ children: [
17745
+ t && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: t.href ? /* @__PURE__ */ jsx("a", { href: t.href, className: "focus-visible:outline-none focus-visible:ring-2", children: /* @__PURE__ */ jsx("img", { src: t.src, alt: t.alt, className: "h-10 w-auto" }) }) : /* @__PURE__ */ jsx("img", { src: t.src, alt: t.alt, className: "h-10 w-auto" }) }),
17746
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4", children: e }),
17747
+ r && /* @__PURE__ */ jsx("div", { className: "border-t border-[--border-1] pt-4 text-center text-xs text-[--text-2]", children: r })
17748
+ ]
17749
+ }
17750
+ ) });
17751
+ AuthLayout.displayName = "AuthLayout";
17698
17752
  function normalizeSortState$1(t) {
17699
17753
  return t ? Array.isArray(t) ? t : [t] : [];
17700
17754
  }
@@ -21360,7 +21414,10 @@ function cn(...t) {
21360
21414
  return twMerge(clsx(t));
21361
21415
  }
21362
21416
  export {
21417
+ Alert,
21363
21418
  AsyncSelect,
21419
+ AuthLayout,
21420
+ Badge,
21364
21421
  Box,
21365
21422
  Breadcrumbs,
21366
21423
  Button,