xertica-ui 1.3.9 → 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/components/ui/alert.tsx
CHANGED
|
@@ -32,20 +32,27 @@ const alertIcons = {
|
|
|
32
32
|
|
|
33
33
|
type AlertVariantType = keyof typeof alertIcons;
|
|
34
34
|
|
|
35
|
+
export interface AlertProps
|
|
36
|
+
extends React.ComponentProps<"div">,
|
|
37
|
+
VariantProps<typeof alertVariants> {
|
|
38
|
+
icon?: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
function Alert({
|
|
36
42
|
className,
|
|
37
43
|
variant,
|
|
44
|
+
icon,
|
|
38
45
|
children,
|
|
39
46
|
...props
|
|
40
|
-
}:
|
|
47
|
+
}: AlertProps) {
|
|
41
48
|
// Determinar a variante válida com fallback seguro
|
|
42
|
-
const alertVariant: AlertVariantType =
|
|
43
|
-
variant && variant in alertIcons
|
|
44
|
-
? (variant as AlertVariantType)
|
|
49
|
+
const alertVariant: AlertVariantType =
|
|
50
|
+
variant && variant in alertIcons
|
|
51
|
+
? (variant as AlertVariantType)
|
|
45
52
|
: "default";
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
53
|
+
|
|
54
|
+
const DefaultIcon = alertIcons[alertVariant];
|
|
55
|
+
|
|
49
56
|
return (
|
|
50
57
|
<div
|
|
51
58
|
data-slot="alert"
|
|
@@ -53,7 +60,7 @@ function Alert({
|
|
|
53
60
|
className={cn(alertVariants({ variant }), className)}
|
|
54
61
|
{...props}
|
|
55
62
|
>
|
|
56
|
-
<
|
|
63
|
+
{icon !== undefined ? icon : <DefaultIcon className="flex-shrink-0" />}
|
|
57
64
|
<div className="flex-1">{children}</div>
|
|
58
65
|
</div>
|
|
59
66
|
);
|
package/components/ui/index.ts
CHANGED
|
@@ -226,6 +226,7 @@ export { RouteMap } from "./route-map";
|
|
|
226
226
|
export type { MapProps } from "./map";
|
|
227
227
|
export type { RouteMapProps } from "./route-map";
|
|
228
228
|
export type { MapLayerType, MapLayersConfig } from "./map-layers";
|
|
229
|
+
export { GoogleMapsLoaderProvider, useGoogleMapsLoader } from "./google-maps-loader";
|
|
229
230
|
|
|
230
231
|
// Xertica Custom Components
|
|
231
232
|
export { XerticaAssistant } from "./xertica-assistant";
|
|
@@ -20,9 +20,9 @@ const BrandColorsContext = createContext<BrandColorsContextType | undefined>(und
|
|
|
20
20
|
|
|
21
21
|
export const BrandColorsProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
22
22
|
const [currentTheme, setCurrentTheme] = useState<string>(() => {
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
return
|
|
23
|
+
// Força o tema original / padrão do Xertica UI
|
|
24
|
+
// Ignorando o localStorage para evitar ficar preso em temas antigos sem UI para trocar
|
|
25
|
+
return 'xertica-original';
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const [radius, setRadius] = useState<number>(0.5);
|
|
@@ -175,8 +175,8 @@ export const BrandColorsProvider: React.FC<{ children: React.ReactNode }> = ({ c
|
|
|
175
175
|
`linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)`
|
|
176
176
|
);
|
|
177
177
|
|
|
178
|
-
//
|
|
179
|
-
localStorage.setItem('xertica-theme-preference', currentTheme);
|
|
178
|
+
// Removido o salvamento de preferência no localStorage para garantir que o tema padrão seja forçado
|
|
179
|
+
// localStorage.setItem('xertica-theme-preference', currentTheme);
|
|
180
180
|
}, [colors, currentTheme, radius]);
|
|
181
181
|
|
|
182
182
|
// Aplicar cores quando elas mudarem
|
|
@@ -3,7 +3,10 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "error" | "success" | "warning" | "info" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
|
|
6
|
+
export interface AlertProps extends React.ComponentProps<"div">, VariantProps<typeof alertVariants> {
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function Alert({ className, variant, icon, children, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -73,6 +73,7 @@ export { RouteMap } from "./route-map";
|
|
|
73
73
|
export type { MapProps } from "./map";
|
|
74
74
|
export type { RouteMapProps } from "./route-map";
|
|
75
75
|
export type { MapLayerType, MapLayersConfig } from "./map-layers";
|
|
76
|
+
export { GoogleMapsLoaderProvider, useGoogleMapsLoader } from "./google-maps-loader";
|
|
76
77
|
export { XerticaAssistant } from "./xertica-assistant";
|
|
77
78
|
export type { MessageType, AttachmentType } from "./xertica-assistant";
|
|
78
79
|
export { PageHeader, PageHeaderDescription, PageHeaderHeading } from "./page-header";
|
package/dist/index.es.js
CHANGED
|
@@ -47804,8 +47804,7 @@ const colorThemes = [
|
|
|
47804
47804
|
const BrandColorsContext = createContext(void 0);
|
|
47805
47805
|
const BrandColorsProvider = ({ children }) => {
|
|
47806
47806
|
const [currentTheme, setCurrentTheme] = useState(() => {
|
|
47807
|
-
|
|
47808
|
-
return saved || "xertica-original";
|
|
47807
|
+
return "xertica-original";
|
|
47809
47808
|
});
|
|
47810
47809
|
const [radius, setRadius] = useState(0.5);
|
|
47811
47810
|
const [colors, setColors] = useState(() => {
|
|
@@ -47896,7 +47895,6 @@ const BrandColorsProvider = ({ children }) => {
|
|
|
47896
47895
|
"--gradient-diagonal",
|
|
47897
47896
|
`linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)`
|
|
47898
47897
|
);
|
|
47899
|
-
localStorage.setItem("xertica-theme-preference", currentTheme);
|
|
47900
47898
|
}, [colors, currentTheme, radius]);
|
|
47901
47899
|
useEffect(() => {
|
|
47902
47900
|
applyColors();
|
|
@@ -51495,11 +51493,12 @@ const alertIcons = {
|
|
|
51495
51493
|
function Alert({
|
|
51496
51494
|
className,
|
|
51497
51495
|
variant,
|
|
51496
|
+
icon,
|
|
51498
51497
|
children,
|
|
51499
51498
|
...props
|
|
51500
51499
|
}) {
|
|
51501
51500
|
const alertVariant = variant && variant in alertIcons ? variant : "default";
|
|
51502
|
-
const
|
|
51501
|
+
const DefaultIcon = alertIcons[alertVariant];
|
|
51503
51502
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
51504
51503
|
"div",
|
|
51505
51504
|
{
|
|
@@ -51508,7 +51507,7 @@ function Alert({
|
|
|
51508
51507
|
className: cn(alertVariants({ variant }), className),
|
|
51509
51508
|
...props,
|
|
51510
51509
|
children: [
|
|
51511
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51510
|
+
icon !== void 0 ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultIcon, { className: "flex-shrink-0" }),
|
|
51512
51511
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children })
|
|
51513
51512
|
]
|
|
51514
51513
|
}
|
|
@@ -98948,6 +98947,7 @@ export {
|
|
|
98948
98947
|
FormLabel,
|
|
98949
98948
|
FormMessage,
|
|
98950
98949
|
FormattedDocument,
|
|
98950
|
+
GoogleMapsLoaderProvider,
|
|
98951
98951
|
Header,
|
|
98952
98952
|
HoverCard,
|
|
98953
98953
|
HoverCardContent,
|
|
@@ -99111,6 +99111,7 @@ export {
|
|
|
99111
99111
|
useAssistente,
|
|
99112
99112
|
useBrandColors,
|
|
99113
99113
|
useFormField,
|
|
99114
|
+
useGoogleMapsLoader,
|
|
99114
99115
|
useIsMobile,
|
|
99115
99116
|
useLanguage,
|
|
99116
99117
|
useLayout,
|
package/dist/index.umd.js
CHANGED
|
@@ -47823,8 +47823,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
47823
47823
|
const BrandColorsContext = React.createContext(void 0);
|
|
47824
47824
|
const BrandColorsProvider = ({ children }) => {
|
|
47825
47825
|
const [currentTheme, setCurrentTheme] = React.useState(() => {
|
|
47826
|
-
|
|
47827
|
-
return saved || "xertica-original";
|
|
47826
|
+
return "xertica-original";
|
|
47828
47827
|
});
|
|
47829
47828
|
const [radius, setRadius] = React.useState(0.5);
|
|
47830
47829
|
const [colors, setColors] = React.useState(() => {
|
|
@@ -47915,7 +47914,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
47915
47914
|
"--gradient-diagonal",
|
|
47916
47915
|
`linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)`
|
|
47917
47916
|
);
|
|
47918
|
-
localStorage.setItem("xertica-theme-preference", currentTheme);
|
|
47919
47917
|
}, [colors, currentTheme, radius]);
|
|
47920
47918
|
React.useEffect(() => {
|
|
47921
47919
|
applyColors();
|
|
@@ -51514,11 +51512,12 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
51514
51512
|
function Alert({
|
|
51515
51513
|
className,
|
|
51516
51514
|
variant,
|
|
51515
|
+
icon,
|
|
51517
51516
|
children,
|
|
51518
51517
|
...props
|
|
51519
51518
|
}) {
|
|
51520
51519
|
const alertVariant = variant && variant in alertIcons ? variant : "default";
|
|
51521
|
-
const
|
|
51520
|
+
const DefaultIcon = alertIcons[alertVariant];
|
|
51522
51521
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
51523
51522
|
"div",
|
|
51524
51523
|
{
|
|
@@ -51527,7 +51526,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
51527
51526
|
className: cn(alertVariants({ variant }), className),
|
|
51528
51527
|
...props,
|
|
51529
51528
|
children: [
|
|
51530
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51529
|
+
icon !== void 0 ? icon : /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultIcon, { className: "flex-shrink-0" }),
|
|
51531
51530
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children })
|
|
51532
51531
|
]
|
|
51533
51532
|
}
|
|
@@ -98966,6 +98965,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
98966
98965
|
exports2.FormLabel = FormLabel;
|
|
98967
98966
|
exports2.FormMessage = FormMessage;
|
|
98968
98967
|
exports2.FormattedDocument = FormattedDocument;
|
|
98968
|
+
exports2.GoogleMapsLoaderProvider = GoogleMapsLoaderProvider;
|
|
98969
98969
|
exports2.Header = Header;
|
|
98970
98970
|
exports2.HoverCard = HoverCard;
|
|
98971
98971
|
exports2.HoverCardContent = HoverCardContent;
|
|
@@ -99129,6 +99129,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert-
|
|
|
99129
99129
|
exports2.useAssistente = useAssistente;
|
|
99130
99130
|
exports2.useBrandColors = useBrandColors;
|
|
99131
99131
|
exports2.useFormField = useFormField;
|
|
99132
|
+
exports2.useGoogleMapsLoader = useGoogleMapsLoader;
|
|
99132
99133
|
exports2.useIsMobile = useIsMobile;
|
|
99133
99134
|
exports2.useLanguage = useLanguage;
|
|
99134
99135
|
exports2.useLayout = useLayout;
|