xertica-ui 2.1.2 → 2.1.4
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/CHANGELOG.md +46 -0
- package/README.md +1 -1
- package/bin/cli.ts +1 -1
- package/bin/generate-tokens.ts +13 -7
- package/components/assistant/xertica-assistant/index.ts +2 -0
- package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +97 -0
- package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +104 -0
- package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -0
- package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +86 -0
- package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +77 -0
- package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +573 -0
- package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +65 -0
- package/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.tsx +41 -0
- package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +98 -0
- package/components/assistant/xertica-assistant/parts/index.ts +16 -0
- package/components/assistant/xertica-assistant/types.ts +139 -0
- package/components/assistant/xertica-assistant/use-assistant.ts +559 -0
- package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
- package/components/assistant/xertica-assistant/xertica-assistant.tsx +198 -1460
- package/components/brand/theme-toggle/ThemeToggle.tsx +8 -27
- package/components/hooks/index.ts +3 -0
- package/components/hooks/use-layout-shortcuts.ts +46 -0
- package/components/layout/sidebar/index.ts +2 -0
- package/components/layout/sidebar/sidebar.stories.tsx +160 -8
- package/components/layout/sidebar/sidebar.tsx +606 -497
- package/components/layout/sidebar/use-sidebar.ts +104 -0
- package/components/media/audio-player/AudioPlayer.tsx +131 -206
- package/components/media/audio-player/use-audio-player.ts +298 -0
- package/components/pages/home-page/HomePage.tsx +1 -1
- package/components/pages/template-content/TemplateContent.tsx +5 -5
- package/components/pages/template-page/TemplatePage.tsx +5 -5
- package/components/shared/CustomTooltipContent.tsx +52 -0
- package/components/shared/layout-constants.ts +1 -1
- package/components/ui/chart/chart.stories.tsx +966 -7
- package/components/ui/chart/chart.tsx +918 -45
- package/components/ui/file-upload/file-upload.stories.tsx +100 -0
- package/components/ui/file-upload/file-upload.tsx +14 -74
- package/components/ui/file-upload/index.ts +1 -0
- package/components/ui/file-upload/use-file-upload.ts +181 -0
- package/components/ui/pagination/index.ts +2 -0
- package/components/ui/pagination/pagination.stories.tsx +94 -0
- package/components/ui/pagination/use-pagination.ts +194 -0
- package/components/ui/rich-text-editor/index.ts +2 -0
- package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
- package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
- package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
- package/components/ui/stepper/index.ts +3 -1
- package/components/ui/stepper/stepper.stories.tsx +116 -0
- package/components/ui/stepper/stepper.tsx +4 -4
- package/components/ui/stepper/use-stepper.ts +137 -0
- package/components/ui/tree-view/index.ts +4 -1
- package/components/ui/tree-view/tree-view.stories.tsx +110 -4
- package/components/ui/tree-view/tree-view.tsx +17 -125
- package/components/ui/tree-view/use-tree-view.ts +229 -0
- package/contexts/AssistenteContext.tsx +17 -54
- package/contexts/BrandColorsContext.tsx +6 -17
- package/contexts/LayoutContext.tsx +5 -31
- package/dist/AssistantChart-BAudAfne.cjs +3591 -0
- package/dist/AssistantChart-BP8upjMk.js +3565 -0
- package/dist/AudioPlayer-1ypwE2Wh.cjs +936 -0
- package/dist/AudioPlayer-DuKXrCfy.js +937 -0
- package/dist/CustomTooltipContent-DHjkY0ww.js +40 -0
- package/dist/CustomTooltipContent-c_K-DWRr.cjs +56 -0
- package/dist/LanguageContext-BwhwC3G2.js +657 -0
- package/dist/LanguageContext-DvUt5jBg.cjs +656 -0
- package/dist/LayoutContext-BDmcZfMH.cjs +84 -0
- package/dist/LayoutContext-dbQvdC4O.js +85 -0
- package/dist/ThemeContext-RTy1m2Uq.js +82 -0
- package/dist/ThemeContext-bSzuOit2.cjs +81 -0
- package/dist/VerifyEmailPage-C_ihbcth.js +2828 -0
- package/dist/VerifyEmailPage-Dt7zgA4w.cjs +2827 -0
- package/dist/XerticaProvider-CW9hpCdF.cjs +39 -0
- package/dist/XerticaProvider-siSt9uG2.js +40 -0
- package/dist/XerticaXLogo-D8jf0SNv.cjs +214 -0
- package/dist/XerticaXLogo-fAJMy3H4.js +215 -0
- package/dist/assistant.cjs.js +2 -1
- package/dist/assistant.es.js +3 -2
- package/dist/brand.cjs.js +2 -2
- package/dist/brand.es.js +2 -2
- package/dist/cli.js +14 -8
- package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +19 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +11 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +29 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +13 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +4 -0
- package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +17 -0
- package/dist/components/assistant/xertica-assistant/parts/index.d.ts +16 -0
- package/dist/components/assistant/xertica-assistant/types.d.ts +106 -0
- package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +125 -0
- package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +8 -97
- package/dist/components/hooks/index.d.ts +3 -0
- package/dist/components/hooks/use-layout-shortcuts.d.ts +22 -0
- package/dist/components/layout/sidebar/index.d.ts +2 -0
- package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
- package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
- package/dist/components/media/audio-player/AudioPlayer.d.ts +4 -1
- package/dist/components/media/audio-player/use-audio-player.d.ts +72 -0
- package/dist/components/shared/CustomTooltipContent.d.ts +20 -0
- package/dist/components/shared/layout-constants.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/chart/chart.d.ts +162 -5
- package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
- package/dist/components/ui/file-upload/index.d.ts +1 -0
- package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
- package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
- package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
- package/dist/components/ui/stepper/index.d.ts +3 -1
- package/dist/components/ui/stepper/stepper.d.ts +2 -2
- package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
- package/dist/components/ui/tree-view/index.d.ts +4 -1
- package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
- package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -0
- package/dist/contexts/AssistenteContext.d.ts +10 -49
- package/dist/hooks.cjs.js +30 -10
- package/dist/hooks.es.js +25 -4
- package/dist/index.cjs.js +20 -9
- package/dist/index.es.js +38 -27
- package/dist/layout.cjs.js +82 -1
- package/dist/layout.es.js +83 -2
- package/dist/media.cjs.js +1 -1
- package/dist/media.es.js +1 -1
- package/dist/pages.cjs.js +1 -1
- package/dist/pages.es.js +1 -1
- package/dist/rich-text-editor-BmsjY03B.js +2949 -0
- package/dist/rich-text-editor-GS2kpTAK.cjs +2966 -0
- package/dist/sidebar-CVUGHOS_.cjs +756 -0
- package/dist/sidebar-CmvwjnVb.js +757 -0
- package/dist/ui.cjs.js +12 -2
- package/dist/ui.es.js +24 -14
- package/dist/use-audio-player-Bkh23vQ3.js +177 -0
- package/dist/use-audio-player-Dn1NR9xN.cjs +176 -0
- package/dist/utils/color-utils.d.ts +51 -0
- package/dist/xertica-assistant-BMqdyRVi.js +2082 -0
- package/dist/xertica-assistant-Bj3vBCq_.cjs +2081 -0
- package/dist/xertica-ui.css +1 -1
- package/docs/ai-usage.md +28 -10
- package/docs/architecture-improvements.md +463 -0
- package/docs/architecture.md +77 -1
- package/docs/components/assistant-chart.md +1 -1
- package/docs/components/assistant.md +159 -0
- package/docs/components/audio-player.md +46 -0
- package/docs/components/branding.md +251 -0
- package/docs/components/chart.md +354 -39
- package/docs/components/code-block.md +108 -0
- package/docs/components/file-upload.md +119 -2
- package/docs/components/formatted-document.md +113 -0
- package/docs/components/hooks.md +430 -0
- package/docs/components/image-with-fallback.md +106 -0
- package/docs/components/map-layers.md +140 -0
- package/docs/components/modern-chat-input.md +163 -0
- package/docs/components/pages.md +351 -0
- package/docs/components/pagination.md +187 -0
- package/docs/components/rich-text-editor.md +164 -0
- package/docs/components/sidebar.md +153 -4
- package/docs/components/stepper.md +157 -12
- package/docs/components/tree-view.md +164 -6
- package/docs/doc-audit.md +223 -0
- package/docs/getting-started.md +155 -1
- package/docs/guidelines.md +14 -8
- package/docs/layout.md +2 -2
- package/docs/llms.md +29 -9
- package/docs/patterns/detail-page.md +276 -0
- package/docs/patterns/settings.md +346 -0
- package/docs/patterns/wizard.md +217 -0
- package/guidelines/Guidelines.md +5 -3
- package/llms.txt +1 -1
- package/package.json +10 -10
- package/styles/xertica/tokens.css +41 -12
- package/templates/CLAUDE.md +16 -6
- package/templates/guidelines/Guidelines.md +16 -4
- package/templates/package.json +3 -3
- package/templates/src/styles/xertica/tokens.css +39 -10
- package/utils/color-utils.ts +72 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface UseStepperProps {
|
|
2
|
+
/** Total number of steps. */
|
|
3
|
+
totalSteps: number;
|
|
4
|
+
/** Initial active step (1-indexed). @default 1 */
|
|
5
|
+
initialStep?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Controlled current step (1-indexed).
|
|
8
|
+
* When provided, step state is managed externally via `onStepChange`.
|
|
9
|
+
*/
|
|
10
|
+
step?: number;
|
|
11
|
+
/** Called whenever the active step changes. */
|
|
12
|
+
onStepChange?: (step: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Optional async guard called before advancing to the next step.
|
|
15
|
+
* Return `true` to allow the transition, `false` to block it.
|
|
16
|
+
* Useful for running form validation before moving forward.
|
|
17
|
+
*/
|
|
18
|
+
onBeforeNext?: (currentStep: number) => boolean | Promise<boolean>;
|
|
19
|
+
}
|
|
20
|
+
export interface UseStepperReturn {
|
|
21
|
+
/** The currently active step (1-indexed). */
|
|
22
|
+
currentStep: number;
|
|
23
|
+
/** Total number of steps. */
|
|
24
|
+
totalSteps: number;
|
|
25
|
+
/** Whether the current step is the first step. */
|
|
26
|
+
isFirstStep: boolean;
|
|
27
|
+
/** Whether the current step is the last step. */
|
|
28
|
+
isLastStep: boolean;
|
|
29
|
+
/** Whether navigation to the previous step is possible. */
|
|
30
|
+
canGoPrev: boolean;
|
|
31
|
+
/** Whether navigation to the next step is possible. */
|
|
32
|
+
canGoNext: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Advance to the next step.
|
|
35
|
+
* If `onBeforeNext` is provided, it is awaited first; the step only
|
|
36
|
+
* advances when the guard returns `true`.
|
|
37
|
+
*/
|
|
38
|
+
next: () => Promise<void>;
|
|
39
|
+
/** Go back to the previous step (no-op if already on step 1). */
|
|
40
|
+
prev: () => void;
|
|
41
|
+
/** Jump directly to a specific step (1-indexed, clamped to valid range). */
|
|
42
|
+
goTo: (step: number) => void;
|
|
43
|
+
/** Jump to the first step. */
|
|
44
|
+
reset: () => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Headless hook for multi-step wizard / stepper logic.
|
|
48
|
+
*
|
|
49
|
+
* @description
|
|
50
|
+
* Manages the active step state, navigation guards, and derived flags for
|
|
51
|
+
* multi-step flows. Supports both controlled and uncontrolled modes.
|
|
52
|
+
* Pair with the `<Stepper>` / `<Step>` visual components or any custom UI.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const { currentStep, totalSteps, next, prev, isFirstStep, isLastStep } =
|
|
57
|
+
* useStepper({ totalSteps: 3, onBeforeNext: () => form.trigger() });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function useStepper({ totalSteps, initialStep, step: controlledStep, onStepChange, onBeforeNext, }: UseStepperProps): UseStepperReturn;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
children?: TreeNode[];
|
|
7
|
-
}
|
|
2
|
+
import { type TreeNode } from "./use-tree-view";
|
|
8
3
|
interface TreeViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
4
|
data: TreeNode[];
|
|
10
5
|
/** Called when a node is clicked or activated via keyboard. */
|
|
@@ -24,6 +19,8 @@ interface TreeViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
24
19
|
* and collapsed independently. Supports custom icons per node, controlled
|
|
25
20
|
* selection, and full WAI-ARIA keyboard navigation.
|
|
26
21
|
*
|
|
22
|
+
* Headless logic is available via `useTreeView` for custom tree UIs.
|
|
23
|
+
*
|
|
27
24
|
* @ai-rules
|
|
28
25
|
* 1. Each `TreeNode` must have a unique `id`.
|
|
29
26
|
* 2. Leaf nodes (no `children`) do not render expand arrows.
|
|
@@ -34,3 +31,4 @@ interface TreeViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
34
31
|
declare const TreeView: React.ForwardRefExoticComponent<TreeViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
32
|
export { TreeView };
|
|
36
33
|
export type { TreeViewProps };
|
|
34
|
+
export type { TreeNode } from './use-tree-view';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface TreeNode {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
children?: TreeNode[];
|
|
6
|
+
}
|
|
7
|
+
export interface UseTreeViewProps {
|
|
8
|
+
/** The tree data to manage. */
|
|
9
|
+
data: TreeNode[];
|
|
10
|
+
/** Node IDs that are expanded by default (uncontrolled). */
|
|
11
|
+
defaultExpanded?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Controlled selected node ID.
|
|
14
|
+
* When provided, selection state is managed externally.
|
|
15
|
+
*/
|
|
16
|
+
selectedNodeId?: string;
|
|
17
|
+
/** Called when a node is clicked or activated via keyboard. */
|
|
18
|
+
onNodeClick?: (node: TreeNode) => void;
|
|
19
|
+
/** Called when a node becomes the selected item. */
|
|
20
|
+
onNodeSelect?: (node: TreeNode) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface UseTreeViewReturn {
|
|
23
|
+
/** Set of currently expanded node IDs. */
|
|
24
|
+
expanded: Set<string>;
|
|
25
|
+
/** The currently selected node ID (controlled or internal). */
|
|
26
|
+
effectiveSelectedId: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Map of node ID → button element.
|
|
29
|
+
* Attach via the `setRef` helper returned by `getNodeRef`.
|
|
30
|
+
*/
|
|
31
|
+
nodeRefs: React.MutableRefObject<Map<string, HTMLButtonElement>>;
|
|
32
|
+
/** Returns a ref-setter callback for a given node ID. */
|
|
33
|
+
getNodeRef: (nodeId: string) => (el: HTMLButtonElement | null) => void;
|
|
34
|
+
/** Toggle the expanded state of a node. */
|
|
35
|
+
toggleExpand: (nodeId: string) => void;
|
|
36
|
+
/** Select a node (updates internal state if uncontrolled, fires callbacks). */
|
|
37
|
+
handleSelect: (node: TreeNode) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Full WAI-ARIA keyboard handler.
|
|
40
|
+
* Attach to `onKeyDown` of each tree-item button.
|
|
41
|
+
*/
|
|
42
|
+
handleKeyDown: (e: React.KeyboardEvent, node: TreeNode) => void;
|
|
43
|
+
/** Returns the ordered list of all currently visible nodes (respects expand state). */
|
|
44
|
+
getVisibleNodes: () => TreeNode[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Headless hook for hierarchical tree-view logic.
|
|
48
|
+
*
|
|
49
|
+
* @description
|
|
50
|
+
* Manages expand/collapse state, selection (controlled or uncontrolled),
|
|
51
|
+
* WAI-ARIA keyboard navigation (Arrow keys, Home, End, Enter/Space),
|
|
52
|
+
* and focus management via node refs. Pair with any custom tree UI.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const { expanded, effectiveSelectedId, toggleExpand, handleSelect, handleKeyDown, getNodeRef } =
|
|
57
|
+
* useTreeView({ data, onNodeSelect });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function useTreeView({ data, defaultExpanded, selectedNodeId, onNodeClick, onNodeSelect, }: UseTreeViewProps): UseTreeViewReturn;
|
|
@@ -1,38 +1,19 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { Message, SearchResult, SearchSource, SearchCommand, MockResponse } from '../components/assistant/xertica-assistant/types';
|
|
3
|
+
export type { Message, SearchResult, SearchSource, SearchCommand, MockResponse };
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `Suggestion` from `xertica-assistant/types` instead.
|
|
6
|
+
* Kept for backward compatibility with existing consumers.
|
|
7
|
+
*/
|
|
2
8
|
export interface Sugestao {
|
|
3
9
|
id: string;
|
|
4
10
|
texto: string;
|
|
5
11
|
icon?: ReactNode;
|
|
6
12
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
timestamp: Date;
|
|
12
|
-
isFavorite?: boolean;
|
|
13
|
-
chartData?: any[];
|
|
14
|
-
chartConfig?: any;
|
|
15
|
-
attachmentType?: 'image' | 'video' | 'audio' | 'file' | 'document' | 'podcast' | 'search';
|
|
16
|
-
attachmentName?: string;
|
|
17
|
-
documentContent?: string;
|
|
18
|
-
documentTitle?: string;
|
|
19
|
-
tableData?: {
|
|
20
|
-
caption?: string;
|
|
21
|
-
headers: string[];
|
|
22
|
-
rows: (string | ReactNode)[][];
|
|
23
|
-
};
|
|
24
|
-
audioUrl?: string;
|
|
25
|
-
searchResults?: SearchResult[];
|
|
26
|
-
searchSources?: SearchSource[];
|
|
27
|
-
searchCommands?: SearchCommand[];
|
|
28
|
-
evaluation?: 'like' | 'dislike';
|
|
29
|
-
evaluationReason?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface MockResponse {
|
|
32
|
-
trigger: string | RegExp;
|
|
33
|
-
response: string | Partial<Message>;
|
|
34
|
-
delay?: number;
|
|
35
|
-
}
|
|
13
|
+
/**
|
|
14
|
+
* A saved conversation in the AssistenteContext (Portuguese naming convention).
|
|
15
|
+
* Note: `Conversation` in `xertica-assistant/types` uses English naming.
|
|
16
|
+
*/
|
|
36
17
|
export interface Conversa {
|
|
37
18
|
id: string;
|
|
38
19
|
titulo: string;
|
|
@@ -41,25 +22,6 @@ export interface Conversa {
|
|
|
41
22
|
timestamp: string;
|
|
42
23
|
favorita?: boolean;
|
|
43
24
|
}
|
|
44
|
-
export interface SearchResult {
|
|
45
|
-
id: string;
|
|
46
|
-
title: string;
|
|
47
|
-
description: string;
|
|
48
|
-
type: 'document' | 'file' | 'project' | 'conversation' | 'contact';
|
|
49
|
-
path: string;
|
|
50
|
-
relevance: number;
|
|
51
|
-
lastModified?: string;
|
|
52
|
-
}
|
|
53
|
-
export interface SearchSource {
|
|
54
|
-
name: string;
|
|
55
|
-
count: number;
|
|
56
|
-
}
|
|
57
|
-
export interface SearchCommand {
|
|
58
|
-
id: string;
|
|
59
|
-
icon: string;
|
|
60
|
-
label: string;
|
|
61
|
-
description: string;
|
|
62
|
-
}
|
|
63
25
|
interface AssistenteContextType {
|
|
64
26
|
historico: Message[];
|
|
65
27
|
conversaAtual: string;
|
|
@@ -87,4 +49,3 @@ export declare function AssistenteProvider({ children }: {
|
|
|
87
49
|
children: ReactNode;
|
|
88
50
|
}): import("react/jsx-runtime").JSX.Element;
|
|
89
51
|
export declare function useAssistente(): AssistenteContextType;
|
|
90
|
-
export {};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1,20 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const LayoutContext = require("./LayoutContext-
|
|
4
|
-
const ThemeContext = require("./ThemeContext-
|
|
3
|
+
const LayoutContext = require("./LayoutContext-BDmcZfMH.cjs");
|
|
4
|
+
const ThemeContext = require("./ThemeContext-bSzuOit2.cjs");
|
|
5
|
+
const LanguageContext = require("./LanguageContext-DvUt5jBg.cjs");
|
|
5
6
|
const useMobile = require("./use-mobile-Dlf74ufz.cjs");
|
|
7
|
+
const React = require("react");
|
|
8
|
+
const useAudioPlayer = require("./use-audio-player-Dn1NR9xN.cjs");
|
|
9
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
10
|
+
function useLayoutShortcuts() {
|
|
11
|
+
const { toggleSidebar } = LayoutContext.useLayout();
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
if (typeof window === "undefined") return;
|
|
14
|
+
const handleKeyDown = (event) => {
|
|
15
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
toggleSidebar();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
21
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
22
|
+
}, [toggleSidebar]);
|
|
23
|
+
}
|
|
6
24
|
exports.LayoutProvider = LayoutContext.LayoutProvider;
|
|
7
25
|
exports.useLayout = LayoutContext.useLayout;
|
|
8
26
|
exports.useOptionalLayout = LayoutContext.useOptionalLayout;
|
|
9
|
-
exports.ApiKeyProvider = ThemeContext.ApiKeyProvider;
|
|
10
|
-
exports.AssistenteProvider = ThemeContext.AssistenteProvider;
|
|
11
|
-
exports.BrandColorsProvider = ThemeContext.BrandColorsProvider;
|
|
12
|
-
exports.LanguageProvider = ThemeContext.LanguageProvider;
|
|
13
27
|
exports.ThemeProvider = ThemeContext.ThemeProvider;
|
|
14
|
-
exports.useApiKey = ThemeContext.useApiKey;
|
|
15
|
-
exports.useAssistente = ThemeContext.useAssistente;
|
|
16
|
-
exports.useBrandColors = ThemeContext.useBrandColors;
|
|
17
|
-
exports.useLanguage = ThemeContext.useLanguage;
|
|
18
28
|
exports.useTheme = ThemeContext.useTheme;
|
|
29
|
+
exports.ApiKeyProvider = LanguageContext.ApiKeyProvider;
|
|
30
|
+
exports.AssistenteProvider = LanguageContext.AssistenteProvider;
|
|
31
|
+
exports.BrandColorsProvider = LanguageContext.BrandColorsProvider;
|
|
32
|
+
exports.LanguageProvider = LanguageContext.LanguageProvider;
|
|
33
|
+
exports.useApiKey = LanguageContext.useApiKey;
|
|
34
|
+
exports.useAssistente = LanguageContext.useAssistente;
|
|
35
|
+
exports.useBrandColors = LanguageContext.useBrandColors;
|
|
36
|
+
exports.useLanguage = LanguageContext.useLanguage;
|
|
19
37
|
exports.useIsMobile = useMobile.useIsMobile;
|
|
20
38
|
exports.useMobile = useMobile.useMobile;
|
|
39
|
+
exports.useAudioPlayer = useAudioPlayer.useAudioPlayer;
|
|
40
|
+
exports.useLayoutShortcuts = useLayoutShortcuts;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { u as useLayout } from "./LayoutContext-dbQvdC4O.js";
|
|
2
|
+
import { L, a } from "./LayoutContext-dbQvdC4O.js";
|
|
3
|
+
import { T, u } from "./ThemeContext-RTy1m2Uq.js";
|
|
4
|
+
import { A, a as a2, B, L as L2, u as u2, b, c, d } from "./LanguageContext-BwhwC3G2.js";
|
|
3
5
|
import { u as u3, a as a3 } from "./use-mobile-CNwiBNxu.js";
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { u as u4 } from "./use-audio-player-Bkh23vQ3.js";
|
|
8
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
9
|
+
function useLayoutShortcuts() {
|
|
10
|
+
const { toggleSidebar } = useLayout();
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (typeof window === "undefined") return;
|
|
13
|
+
const handleKeyDown = (event) => {
|
|
14
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
toggleSidebar();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
20
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
21
|
+
}, [toggleSidebar]);
|
|
22
|
+
}
|
|
4
23
|
export {
|
|
5
24
|
A as ApiKeyProvider,
|
|
6
25
|
a2 as AssistenteProvider,
|
|
@@ -10,11 +29,13 @@ export {
|
|
|
10
29
|
T as ThemeProvider,
|
|
11
30
|
u2 as useApiKey,
|
|
12
31
|
b as useAssistente,
|
|
32
|
+
u4 as useAudioPlayer,
|
|
13
33
|
c as useBrandColors,
|
|
14
34
|
u3 as useIsMobile,
|
|
15
35
|
d as useLanguage,
|
|
16
|
-
|
|
36
|
+
useLayout,
|
|
37
|
+
useLayoutShortcuts,
|
|
17
38
|
a3 as useMobile,
|
|
18
39
|
a as useOptionalLayout,
|
|
19
|
-
|
|
40
|
+
u as useTheme
|
|
20
41
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const xerticaAssistant = require("./xertica-assistant-
|
|
4
|
-
const XerticaProvider = require("./XerticaProvider-
|
|
5
|
-
const VerifyEmailPage = require("./VerifyEmailPage-
|
|
3
|
+
const xerticaAssistant = require("./xertica-assistant-Bj3vBCq_.cjs");
|
|
4
|
+
const XerticaProvider = require("./XerticaProvider-CW9hpCdF.cjs");
|
|
5
|
+
const VerifyEmailPage = require("./VerifyEmailPage-Dt7zgA4w.cjs");
|
|
6
6
|
const button = require("./button-0CXwCRTm.cjs");
|
|
7
7
|
const card = require("./card-DJTsYhLL.cjs");
|
|
8
8
|
const alertDialog = require("./alert-dialog-yckpaOpy.cjs");
|
|
9
|
-
const AssistantChart = require("./AssistantChart-
|
|
9
|
+
const AssistantChart = require("./AssistantChart-BAudAfne.cjs");
|
|
10
10
|
const breadcrumb = require("./breadcrumb-DnDlQFg2.cjs");
|
|
11
11
|
const input = require("./input-CPl84zAx.cjs");
|
|
12
|
-
const richTextEditor = require("./rich-text-editor-
|
|
12
|
+
const richTextEditor = require("./rich-text-editor-GS2kpTAK.cjs");
|
|
13
13
|
const slider = require("./slider-CPmwzm_3.cjs");
|
|
14
14
|
const select = require("./select-DT7Zjn42.cjs");
|
|
15
15
|
const tooltip = require("./tooltip-CNtsL5cB.cjs");
|
|
@@ -21,11 +21,12 @@ const googleMapsLoader = require("./google-maps-loader-BqsYL48U.cjs");
|
|
|
21
21
|
const useMobile = require("./use-mobile-Dlf74ufz.cjs");
|
|
22
22
|
const FeatureCard = require("./FeatureCard-CkPd2psQ.cjs");
|
|
23
23
|
const CodeBlock = require("./CodeBlock-POVYONvC.cjs");
|
|
24
|
-
const XerticaXLogo = require("./XerticaXLogo-
|
|
24
|
+
const XerticaXLogo = require("./XerticaXLogo-D8jf0SNv.cjs");
|
|
25
25
|
const XerticaOrbe = require("./XerticaOrbe-FWGjBj0U.cjs");
|
|
26
|
-
const sidebar = require("./sidebar-
|
|
27
|
-
|
|
28
|
-
const
|
|
26
|
+
const sidebar = require("./sidebar-CVUGHOS_.cjs");
|
|
27
|
+
require("react");
|
|
28
|
+
const LayoutContext = require("./LayoutContext-BDmcZfMH.cjs");
|
|
29
|
+
const AudioPlayer = require("./AudioPlayer-1ypwE2Wh.cjs");
|
|
29
30
|
exports.FormattedDocument = xerticaAssistant.FormattedDocument;
|
|
30
31
|
exports.MarkdownMessage = xerticaAssistant.MarkdownMessage;
|
|
31
32
|
exports.ModernChatInput = xerticaAssistant.ModernChatInput;
|
|
@@ -209,8 +210,12 @@ exports.ToggleGroupItem = AssistantChart.ToggleGroupItem;
|
|
|
209
210
|
exports.TreeView = AssistantChart.TreeView;
|
|
210
211
|
exports.navigationMenuTriggerStyle = AssistantChart.navigationMenuTriggerStyle;
|
|
211
212
|
exports.toggleVariants = AssistantChart.toggleVariants;
|
|
213
|
+
exports.useFileUpload = AssistantChart.useFileUpload;
|
|
212
214
|
exports.useFormField = AssistantChart.useFormField;
|
|
215
|
+
exports.usePagination = AssistantChart.usePagination;
|
|
213
216
|
exports.useStepper = AssistantChart.useStepper;
|
|
217
|
+
exports.useStepperContext = AssistantChart.useStepperContext;
|
|
218
|
+
exports.useTreeView = AssistantChart.useTreeView;
|
|
214
219
|
exports.Breadcrumb = breadcrumb.Breadcrumb;
|
|
215
220
|
exports.BreadcrumbEllipsis = breadcrumb.BreadcrumbEllipsis;
|
|
216
221
|
exports.BreadcrumbItem = breadcrumb.BreadcrumbItem;
|
|
@@ -256,10 +261,15 @@ exports.EmptyDescription = richTextEditor.EmptyDescription;
|
|
|
256
261
|
exports.EmptyIcon = richTextEditor.EmptyIcon;
|
|
257
262
|
exports.EmptyImage = richTextEditor.EmptyImage;
|
|
258
263
|
exports.EmptyTitle = richTextEditor.EmptyTitle;
|
|
264
|
+
exports.GaugeChart = richTextEditor.GaugeChart;
|
|
259
265
|
exports.HorizontalBarChart = richTextEditor.HorizontalBarChart;
|
|
260
266
|
exports.InteractiveTimeSeriesChart = richTextEditor.InteractiveTimeSeriesChart;
|
|
267
|
+
exports.PieMetricChart = richTextEditor.PieMetricChart;
|
|
268
|
+
exports.RadarMetricChart = richTextEditor.RadarMetricChart;
|
|
269
|
+
exports.RadialBarMetricChart = richTextEditor.RadialBarMetricChart;
|
|
261
270
|
exports.RichTextEditor = richTextEditor.RichTextEditor;
|
|
262
271
|
exports.Skeleton = richTextEditor.Skeleton;
|
|
272
|
+
exports.SparklineChart = richTextEditor.SparklineChart;
|
|
263
273
|
exports.Table = richTextEditor.Table;
|
|
264
274
|
exports.TableBody = richTextEditor.TableBody;
|
|
265
275
|
exports.TableCaption = richTextEditor.TableCaption;
|
|
@@ -270,6 +280,7 @@ exports.TableHeader = richTextEditor.TableHeader;
|
|
|
270
280
|
exports.TableRow = richTextEditor.TableRow;
|
|
271
281
|
exports.Textarea = richTextEditor.Textarea;
|
|
272
282
|
exports.useChart = richTextEditor.useChart;
|
|
283
|
+
exports.useRichTextEditor = richTextEditor.useRichTextEditor;
|
|
273
284
|
exports.Slider = slider.Slider;
|
|
274
285
|
exports.Select = select.Select;
|
|
275
286
|
exports.SelectContent = select.SelectContent;
|
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { F, M, a, X, g, g as g2 } from "./xertica-assistant-
|
|
2
|
-
import { X as X2 } from "./XerticaProvider-
|
|
3
|
-
import { F as F2, H, a as a2, L, R, T, b, V } from "./VerifyEmailPage-
|
|
1
|
+
import { F, M, a, X, g, g as g2 } from "./xertica-assistant-BMqdyRVi.js";
|
|
2
|
+
import { X as X2 } from "./XerticaProvider-siSt9uG2.js";
|
|
3
|
+
import { F as F2, H, a as a2, L, R, T, b, V } from "./VerifyEmailPage-C_ihbcth.js";
|
|
4
4
|
import { B, b as b2, c } from "./button-qkz7Icqf.js";
|
|
5
5
|
import { C, a as a3, b as b3, c as c2, d, e, f } from "./card-fi8zAN-I.js";
|
|
6
6
|
import { A, a as a4, b as b4, c as c3, d as d2, e as e2, f as f2, g as g3, h, i, j, C as C2, I, L as L2, M as M2, P, k, l, R as R2, m, S, n, T as T2, o, p, q, u } from "./alert-dialog-iDe5VE5o.js";
|
|
7
|
-
import { A as A2, a as a5, b as b5, c as c4, d as d3, e as e3, C as C3, f as f3, g as g4, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, q as q2, r, s, t, u as u2, v, w, x, y, z, B as B2, D, E, F as F3, G, H as H2, I as I2, J, K, L as L3, M as M3, N, O, P as P2, Q, R as R3, S as S2, T as T3, U, V as V2, W, X as X3, Y, Z, _, $, a0, a1, a2 as a22, a3 as a32, a4 as a42, a5 as a52, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2 as b22, b3 as b32, b4 as b42, b5 as b52, b6, b7, b8, b9, ba, bb, bc, bd, be } from "./AssistantChart-
|
|
7
|
+
import { A as A2, a as a5, b as b5, c as c4, d as d3, e as e3, C as C3, f as f3, g as g4, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, q as q2, r, s, t, u as u2, v, w, x, y, z, B as B2, D, E, F as F3, G, H as H2, I as I2, J, K, L as L3, M as M3, N, O, P as P2, Q, R as R3, S as S2, T as T3, U, V as V2, W, X as X3, Y, Z, _, $, a0, a1, a2 as a22, a3 as a32, a4 as a42, a5 as a52, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2 as b22, b3 as b32, b4 as b42, b5 as b52, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi } from "./AssistantChart-BP8upjMk.js";
|
|
8
8
|
import { B as B3, a as a10, b as b10, c as c5, d as d4, e as e4, f as f4 } from "./breadcrumb-CVzzzqfo.js";
|
|
9
9
|
import { I as I3, P as P3, a as a11, b as b11, c as c6, S as S3, d as d5 } from "./input-D-6IsAca.js";
|
|
10
|
-
import { A as A3, a as a12, b as b12, C as C4, c as c7, d as d6, e as e5, f as f5, g as g5, h as h3, i as i3, D as D2, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q3, r as r2, s as s2, t as t2, u as u3, v as v2, E as E2, w as w2, x as x2, y as y2, z as z2, B as B4,
|
|
10
|
+
import { A as A3, a as a12, b as b12, C as C4, c as c7, d as d6, e as e5, f as f5, g as g5, h as h3, i as i3, D as D2, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q3, r as r2, s as s2, t as t2, u as u3, v as v2, E as E2, w as w2, x as x2, y as y2, z as z2, B as B4, G as G2, H as H3, I as I4, P as P4, R as R4, F as F4, J as J2, S as S4, K as K2, T as T4, L as L4, M as M4, N as N2, O as O2, Q as Q2, U as U2, V as V3, W as W2, X as X4, Y as Y2 } from "./rich-text-editor-BmsjY03B.js";
|
|
11
11
|
import { S as S5 } from "./slider-C0JKA9k3.js";
|
|
12
12
|
import { S as S6, a as a13, b as b13, c as c8, d as d7, e as e6, f as f6, g as g6, h as h4, i as i4 } from "./select-En8DkoaQ.js";
|
|
13
13
|
import { T as T5, a as a14, b as b14, c as c9 } from "./tooltip-CTyZCD8h.js";
|
|
@@ -17,13 +17,14 @@ import { T as T6 } from "./sonner-g9RIfi35.js";
|
|
|
17
17
|
import { A as A4, a as a16, b as b17 } from "./avatar-DSBfJMRJ.js";
|
|
18
18
|
import { G as G3, a as a17, b as b18, c as c11, r as r3, u as u4 } from "./google-maps-loader-t2IlYBzw.js";
|
|
19
19
|
import { u as u5, a as a18 } from "./use-mobile-CNwiBNxu.js";
|
|
20
|
-
import { A as A5, F as F5, N as N3, P as P6, a as a19, Q as
|
|
20
|
+
import { A as A5, F as F5, N as N3, P as P6, a as a19, Q as Q3 } from "./FeatureCard-Bcb3Zi54.js";
|
|
21
21
|
import { C as C5 } from "./CodeBlock-DuxdtN-l.js";
|
|
22
|
-
import { L as L5, T as T7, X as
|
|
23
|
-
import { X as
|
|
24
|
-
import { H as H4, S as S7 } from "./sidebar-
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
22
|
+
import { L as L5, T as T7, X as X5, a as a20 } from "./XerticaXLogo-fAJMy3H4.js";
|
|
23
|
+
import { X as X6 } from "./XerticaOrbe-BGIB1CTK.js";
|
|
24
|
+
import { H as H4, S as S7 } from "./sidebar-CmvwjnVb.js";
|
|
25
|
+
import "react";
|
|
26
|
+
import { L as L6, u as u6, a as a21 } from "./LayoutContext-dbQvdC4O.js";
|
|
27
|
+
import { A as A6, F as F6, V as V4 } from "./AudioPlayer-DuKXrCfy.js";
|
|
27
28
|
export {
|
|
28
29
|
A2 as Accordion,
|
|
29
30
|
a5 as AccordionContent,
|
|
@@ -170,6 +171,7 @@ export {
|
|
|
170
171
|
F as FormattedDocument,
|
|
171
172
|
G3 as GOOGLE_MAPS_ID,
|
|
172
173
|
a17 as GOOGLE_MAPS_LIBRARIES,
|
|
174
|
+
G2 as GaugeChart,
|
|
173
175
|
b18 as GoogleMapsLoaderProvider,
|
|
174
176
|
c11 as GoogleMapsProvider,
|
|
175
177
|
H4 as Header,
|
|
@@ -229,6 +231,7 @@ export {
|
|
|
229
231
|
aF as PaginationLink,
|
|
230
232
|
aG as PaginationNext,
|
|
231
233
|
aH as PaginationPrevious,
|
|
234
|
+
P4 as PieMetricChart,
|
|
232
235
|
P3 as Popover,
|
|
233
236
|
a11 as PopoverAnchor,
|
|
234
237
|
b11 as PopoverContent,
|
|
@@ -236,7 +239,9 @@ export {
|
|
|
236
239
|
P6 as ProfileCard,
|
|
237
240
|
P5 as Progress,
|
|
238
241
|
a19 as ProjectCard,
|
|
239
|
-
|
|
242
|
+
Q3 as QuickActionCard,
|
|
243
|
+
R4 as RadarMetricChart,
|
|
244
|
+
F4 as RadialBarMetricChart,
|
|
240
245
|
R2 as RadioGroup,
|
|
241
246
|
m as RadioGroupItem,
|
|
242
247
|
aI as Rating,
|
|
@@ -244,7 +249,7 @@ export {
|
|
|
244
249
|
aJ as ResizableHandle,
|
|
245
250
|
aK as ResizablePanel,
|
|
246
251
|
aL as ResizablePanelGroup,
|
|
247
|
-
|
|
252
|
+
J2 as RichTextEditor,
|
|
248
253
|
aM as RouteMap,
|
|
249
254
|
S3 as ScrollArea,
|
|
250
255
|
d5 as ScrollBar,
|
|
@@ -274,25 +279,26 @@ export {
|
|
|
274
279
|
aY as SimpleMap,
|
|
275
280
|
S4 as Skeleton,
|
|
276
281
|
S5 as Slider,
|
|
282
|
+
K2 as SparklineChart,
|
|
277
283
|
aZ as StatsCard,
|
|
278
284
|
a_ as Step,
|
|
279
285
|
a$ as Stepper,
|
|
280
286
|
n as Switch,
|
|
281
287
|
T4 as Table,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
L4 as TableBody,
|
|
289
|
+
M4 as TableCaption,
|
|
290
|
+
N2 as TableCell,
|
|
291
|
+
O2 as TableFooter,
|
|
292
|
+
Q2 as TableHead,
|
|
293
|
+
U2 as TableHeader,
|
|
294
|
+
V3 as TableRow,
|
|
289
295
|
T2 as Tabs,
|
|
290
296
|
o as TabsContent,
|
|
291
297
|
p as TabsList,
|
|
292
298
|
q as TabsTrigger,
|
|
293
299
|
T as TemplateContent,
|
|
294
300
|
b as TemplatePage,
|
|
295
|
-
|
|
301
|
+
W2 as Textarea,
|
|
296
302
|
T7 as ThemeToggle,
|
|
297
303
|
b0 as Timeline,
|
|
298
304
|
b1 as TimelineContent,
|
|
@@ -311,10 +317,10 @@ export {
|
|
|
311
317
|
c9 as TooltipTrigger,
|
|
312
318
|
ba as TreeView,
|
|
313
319
|
V as VerifyEmailPage,
|
|
314
|
-
|
|
320
|
+
V4 as VideoPlayer,
|
|
315
321
|
X as XerticaAssistant,
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
X5 as XerticaLogo,
|
|
323
|
+
X6 as XerticaOrbe,
|
|
318
324
|
X2 as XerticaProvider,
|
|
319
325
|
a20 as XerticaXLogo,
|
|
320
326
|
b16 as badgeVariants,
|
|
@@ -325,13 +331,18 @@ export {
|
|
|
325
331
|
bb as navigationMenuTriggerStyle,
|
|
326
332
|
r3 as reloadGoogleMaps,
|
|
327
333
|
bc as toggleVariants,
|
|
328
|
-
|
|
329
|
-
bd as
|
|
334
|
+
X4 as useChart,
|
|
335
|
+
bd as useFileUpload,
|
|
336
|
+
be as useFormField,
|
|
330
337
|
u4 as useGoogleMapsLoader,
|
|
331
338
|
u5 as useIsMobile,
|
|
332
339
|
u6 as useLayout,
|
|
333
340
|
u as useMapLayers,
|
|
334
341
|
a18 as useMobile,
|
|
335
342
|
a21 as useOptionalLayout,
|
|
336
|
-
|
|
343
|
+
bf as usePagination,
|
|
344
|
+
Y2 as useRichTextEditor,
|
|
345
|
+
bg as useStepper,
|
|
346
|
+
bh as useStepperContext,
|
|
347
|
+
bi as useTreeView
|
|
337
348
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const sidebar = require("./sidebar-
|
|
3
|
+
const sidebar = require("./sidebar-CVUGHOS_.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const useMobile = require("./use-mobile-Dlf74ufz.cjs");
|
|
6
|
+
function useSidebar({
|
|
7
|
+
defaultExpanded = true,
|
|
8
|
+
expanded: controlledExpanded,
|
|
9
|
+
onExpandedChange,
|
|
10
|
+
navigationGroups = []
|
|
11
|
+
} = {}) {
|
|
12
|
+
const [localExpanded, setLocalExpanded] = React.useState(defaultExpanded);
|
|
13
|
+
const isControlled = controlledExpanded !== void 0;
|
|
14
|
+
const expanded = isControlled ? controlledExpanded : localExpanded;
|
|
15
|
+
const isMobileViewport = useMobile.useIsMobile();
|
|
16
|
+
const [hasOverflow, setHasOverflow] = React.useState(false);
|
|
17
|
+
const [visibleItems, setVisibleItems] = React.useState([]);
|
|
18
|
+
const [overflowItems, setOverflowItems] = React.useState([]);
|
|
19
|
+
const [openSubmenu, setOpenSubmenu] = React.useState(null);
|
|
20
|
+
const [isFilterOpen, setIsFilterOpen] = React.useState(false);
|
|
21
|
+
const navRef = React.useRef(null);
|
|
22
|
+
const setExpanded = React.useCallback(
|
|
23
|
+
(value) => {
|
|
24
|
+
const newValue = typeof value === "function" ? value(expanded) : value;
|
|
25
|
+
if (!isControlled) {
|
|
26
|
+
setLocalExpanded(newValue);
|
|
27
|
+
}
|
|
28
|
+
onExpandedChange == null ? void 0 : onExpandedChange(newValue);
|
|
29
|
+
},
|
|
30
|
+
[expanded, isControlled, onExpandedChange]
|
|
31
|
+
);
|
|
32
|
+
const toggleExpanded = React.useCallback(() => {
|
|
33
|
+
setExpanded((prev) => !prev);
|
|
34
|
+
}, [setExpanded]);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
const checkOverflow = () => {
|
|
37
|
+
if (!navRef.current || navigationGroups.length === 0) return;
|
|
38
|
+
const containerHeight = navRef.current.clientHeight;
|
|
39
|
+
let currentHeight = 0;
|
|
40
|
+
let visibleCount = 0;
|
|
41
|
+
const itemHeight = 40;
|
|
42
|
+
const groupHeaderHeight = 32;
|
|
43
|
+
const padding = 32;
|
|
44
|
+
currentHeight += padding;
|
|
45
|
+
for (let i = 0; i < navigationGroups.length; i++) {
|
|
46
|
+
const group = navigationGroups[i];
|
|
47
|
+
if (group.label) currentHeight += groupHeaderHeight;
|
|
48
|
+
currentHeight += group.items.length * itemHeight;
|
|
49
|
+
if (currentHeight > containerHeight) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
visibleCount++;
|
|
53
|
+
}
|
|
54
|
+
if (visibleCount < navigationGroups.length) {
|
|
55
|
+
setHasOverflow(true);
|
|
56
|
+
setVisibleItems(navigationGroups.slice(0, visibleCount));
|
|
57
|
+
setOverflowItems(navigationGroups.slice(visibleCount));
|
|
58
|
+
} else {
|
|
59
|
+
setHasOverflow(false);
|
|
60
|
+
setVisibleItems(navigationGroups);
|
|
61
|
+
setOverflowItems([]);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
checkOverflow();
|
|
65
|
+
window.addEventListener("resize", checkOverflow);
|
|
66
|
+
return () => window.removeEventListener("resize", checkOverflow);
|
|
67
|
+
}, [navigationGroups, expanded]);
|
|
68
|
+
return {
|
|
69
|
+
expanded,
|
|
70
|
+
setExpanded,
|
|
71
|
+
toggleExpanded,
|
|
72
|
+
isMobileViewport,
|
|
73
|
+
hasOverflow,
|
|
74
|
+
visibleItems,
|
|
75
|
+
overflowItems,
|
|
76
|
+
openSubmenu,
|
|
77
|
+
setOpenSubmenu,
|
|
78
|
+
isFilterOpen,
|
|
79
|
+
setIsFilterOpen,
|
|
80
|
+
navRef,
|
|
81
|
+
navigationGroups
|
|
82
|
+
};
|
|
83
|
+
}
|
|
4
84
|
exports.Header = sidebar.Header;
|
|
5
85
|
exports.Sidebar = sidebar.Sidebar;
|
|
86
|
+
exports.useSidebar = useSidebar;
|