@orbit_ui_toolkit/orbitui-kit 0.1.29 → 0.1.31

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.
Files changed (23) hide show
  1. package/dist/components/CoverflowCarousel/CoverflowCarousel.d.ts +18 -0
  2. package/dist/components/CoverflowCarousel/CoverflowCarousel.stories.d.ts +7 -0
  3. package/dist/components/CoverflowCarousel/index.d.ts +1 -0
  4. package/dist/components/DocumentManagement/CreateTemplate.d.ts +9 -0
  5. package/dist/components/DocumentManagement/CreateTemplate.stories.d.ts +9 -0
  6. package/dist/components/DocumentManagement/GeneratedDocument.d.ts +19 -0
  7. package/dist/components/DocumentManagement/GeneratedDocument.stories.d.ts +8 -0
  8. package/dist/components/DocumentManagement/components/Blocks.d.ts +29 -0
  9. package/dist/components/DocumentManagement/components/BodyBlock.d.ts +7 -0
  10. package/dist/components/DocumentManagement/components/PreviewPanel.d.ts +3 -0
  11. package/dist/components/DocumentManagement/components/PropertiesPanel.d.ts +2 -0
  12. package/dist/components/DocumentManagement/components/SidebarFields.d.ts +3 -0
  13. package/dist/components/DocumentManagement/components/TemplateCanvas.d.ts +3 -0
  14. package/dist/components/DocumentManagement/components/TemplateEditorPage.d.ts +2 -0
  15. package/dist/components/DocumentManagement/components/Toolbar.d.ts +2 -0
  16. package/dist/components/DocumentManagement/context.d.ts +56 -0
  17. package/dist/components/DocumentManagement/index.d.ts +6 -0
  18. package/dist/components/DocumentManagement/types.d.ts +103 -0
  19. package/dist/components/DocumentManagement/utils.d.ts +13 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/orbitui.cjs.js +377 -101
  22. package/dist/orbitui.es.js +25137 -13262
  23. package/package.json +6 -1
@@ -0,0 +1,18 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ export interface CoverflowCarouselProps {
3
+ /** Array of React elements to render as carousel items */
4
+ items: ReactNode[];
5
+ /** Initial active slide index */
6
+ initialIndex?: number;
7
+ /** Callback fired when the active index changes */
8
+ onIndexChange?: (index: number) => void;
9
+ /** Additional CSS classes for the container */
10
+ className?: string;
11
+ /** Height of the carousel container (e.g. "h-[400px]", "h-96") */
12
+ heightClass?: string;
13
+ /** Whether to auto-play the carousel */
14
+ autoPlay?: boolean;
15
+ /** Interval in milliseconds for auto-play */
16
+ autoPlayInterval?: number;
17
+ }
18
+ export declare const CoverflowCarousel: React.FC<CoverflowCarouselProps>;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { CoverflowCarousel } from './CoverflowCarousel';
3
+ declare const meta: Meta<typeof CoverflowCarousel>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CoverflowCarousel>;
6
+ export declare const Default: Story;
7
+ export declare const AutoPlay: Story;
@@ -0,0 +1 @@
1
+ export * from './CoverflowCarousel';
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { Template } from './types';
3
+ interface CreateTemplateProps {
4
+ initialTemplate?: Partial<Template>;
5
+ onSave?: (template: Template) => void;
6
+ onAutosave?: (template: Template) => void;
7
+ }
8
+ export declare const CreateTemplate: React.FC<CreateTemplateProps>;
9
+ export default CreateTemplate;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { CreateTemplate } from './CreateTemplate';
3
+ declare const meta: Meta<typeof CreateTemplate>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CreateTemplate>;
6
+ export declare const EmptyCanvasEditor: Story;
7
+ export declare const PreloadedOfferLetter: Story;
8
+ export declare const PreloadedCompensationHike: Story;
9
+ export declare const SaveLoggerDemo: Story;
@@ -0,0 +1,19 @@
1
+ import { Template } from './types';
2
+ export interface GeneratedDocumentRef {
3
+ /** Prints the document beautifully and displays the browser save dialogue for saving as a vector PDF */
4
+ print: () => void;
5
+ /** Copies a stripped, formatted text-only representation of the document to the clipboard */
6
+ copyText: () => Promise<void>;
7
+ }
8
+ export interface GeneratedDocumentProps {
9
+ /** The document template configuration containing layout, options, titles and HTML structure */
10
+ template: Template;
11
+ /** Key-value pairs for variables/placeholders present in the template (e.g. { employeeName: 'John Doe' }) */
12
+ data: Record<string, string>;
13
+ /** Optional custom CSS classes for the outer container */
14
+ className?: string;
15
+ /** Optional custom filename for printing/saving */
16
+ pdfTitle?: string;
17
+ }
18
+ export declare const GeneratedDocument: import('react').ForwardRefExoticComponent<GeneratedDocumentProps & import('react').RefAttributes<GeneratedDocumentRef>>;
19
+ export default GeneratedDocument;
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { GeneratedDocument } from './GeneratedDocument';
3
+ declare const meta: Meta<typeof GeneratedDocument>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof GeneratedDocument>;
6
+ export declare const EmployeeOfferLetter: Story;
7
+ export declare const CompensationAppraisal: Story;
8
+ export declare const MinimalWithoutActions: Story;
@@ -0,0 +1,29 @@
1
+ import { default as React } from 'react';
2
+ import { Block, TitleBlockData, ParagraphBlockData, DividerBlockData, TableBlockData, SignatureBlockData, FooterBlockData, HeaderBlockData } from '../types';
3
+ interface BlockWrapperProps {
4
+ block: Block;
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const BlockWrapper: React.FC<BlockWrapperProps>;
8
+ export declare const HeaderBlock: React.FC<{
9
+ data: HeaderBlockData;
10
+ }>;
11
+ export declare const TitleBlock: React.FC<{
12
+ data: TitleBlockData;
13
+ }>;
14
+ export declare const ParagraphBlock: React.FC<{
15
+ data: ParagraphBlockData;
16
+ }>;
17
+ export declare const DividerBlock: React.FC<{
18
+ data: DividerBlockData;
19
+ }>;
20
+ export declare const SignatureBlock: React.FC<{
21
+ data: SignatureBlockData;
22
+ }>;
23
+ export declare const TableBlock: React.FC<{
24
+ data: TableBlockData;
25
+ }>;
26
+ export declare const FooterBlock: React.FC<{
27
+ data: FooterBlockData;
28
+ }>;
29
+ export {};
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { BodyBlockData } from '../types';
3
+ interface BodyBlockProps {
4
+ data: BodyBlockData;
5
+ }
6
+ export declare const BodyBlock: React.FC<BodyBlockProps>;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const PreviewPanel: React.FC;
3
+ export default PreviewPanel;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const PropertiesPanel: React.FC;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const SidebarFields: React.FC;
3
+ export default SidebarFields;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const TemplateCanvas: React.FC;
3
+ export default TemplateCanvas;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const TemplateEditorPage: React.FC;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const Toolbar: React.FC;
@@ -0,0 +1,56 @@
1
+ import { default as React } from 'react';
2
+ import { Block, BlockType, Template, CustomVariable, HeaderOptions, FooterOptions, SignatureOptions } from './types';
3
+ export interface TemplateEditorContextType {
4
+ templateName: string;
5
+ templateCategory: string;
6
+ blocks: Block[];
7
+ selectedBlockId: string | null;
8
+ activeTab: 'edit' | 'preview';
9
+ autosave: boolean;
10
+ canUndo: boolean;
11
+ canRedo: boolean;
12
+ placeholders: string[];
13
+ customVariables: CustomVariable[];
14
+ headerOptions: HeaderOptions;
15
+ footerOptions: FooterOptions;
16
+ signatureOptions: SignatureOptions;
17
+ contentHtml: string;
18
+ contentDelta: string;
19
+ letterTitle: string;
20
+ toAddress: string;
21
+ reLine: string;
22
+ subjectLine: string;
23
+ setTemplateName: (name: string) => void;
24
+ setTemplateCategory: (category: string) => void;
25
+ addBlock: (type: BlockType) => void;
26
+ updateBlock: (id: string, data: Partial<Block>) => void;
27
+ removeBlock: (id: string) => void;
28
+ moveBlock: (id: string, direction: 'up' | 'down') => void;
29
+ selectBlock: (id: string | null) => void;
30
+ setActiveTab: (tab: 'edit' | 'preview') => void;
31
+ toggleAutosave: () => void;
32
+ undo: () => void;
33
+ redo: () => void;
34
+ loadDemo: (type: 'offer' | 'hike' | 'promotion' | 'experience') => void;
35
+ saveTemplate: () => void;
36
+ clearCanvas: () => void;
37
+ addCustomVariable: (variable: CustomVariable) => void;
38
+ removeCustomVariable: (key: string) => void;
39
+ setHeaderOptions: (opts: HeaderOptions) => void;
40
+ setFooterOptions: (opts: FooterOptions) => void;
41
+ setSignatureOptions: (opts: SignatureOptions) => void;
42
+ setContentDelta: (delta: string) => void;
43
+ setContentHtml: (html: string) => void;
44
+ setLetterTitle: (title: string) => void;
45
+ setToAddress: (address: string) => void;
46
+ setReLine: (re: string) => void;
47
+ setSubjectLine: (sub: string) => void;
48
+ }
49
+ export declare const TemplateEditorProvider: React.FC<{
50
+ children: React.ReactNode;
51
+ initialTemplate?: Partial<Template>;
52
+ presets?: Record<string, any>;
53
+ onSave?: (template: Template) => void;
54
+ onAutosave?: (template: Template) => void;
55
+ }>;
56
+ export declare const useTemplateEditor: () => TemplateEditorContextType;
@@ -0,0 +1,6 @@
1
+ export { CreateTemplate } from './CreateTemplate';
2
+ export { TemplateEditorProvider, useTemplateEditor } from './context';
3
+ export { GeneratedDocument } from './GeneratedDocument';
4
+ export type { GeneratedDocumentProps, GeneratedDocumentRef } from './GeneratedDocument';
5
+ export * from './types';
6
+ export { compileBlockHTML, replacePlaceholders, getPlaceholderLabel } from './utils';
@@ -0,0 +1,103 @@
1
+ export type BlockType = 'header' | 'body' | 'footer' | 'title' | 'paragraph' | 'divider' | 'signature' | 'table';
2
+ export interface BaseBlock {
3
+ id: string;
4
+ type: BlockType;
5
+ }
6
+ export interface HeaderBlockData extends BaseBlock {
7
+ type: 'header';
8
+ logoUrl?: string;
9
+ companyName: string;
10
+ address: string;
11
+ title: string;
12
+ dateField: string;
13
+ }
14
+ export interface BodyBlockData extends BaseBlock {
15
+ type: 'body';
16
+ content: string;
17
+ }
18
+ export interface FooterBlockData extends BaseBlock {
19
+ type: 'footer';
20
+ signatureText?: string;
21
+ hrName: string;
22
+ footerNotes?: string;
23
+ contactInfo?: string;
24
+ }
25
+ export interface TitleBlockData extends BaseBlock {
26
+ type: 'title';
27
+ text: string;
28
+ align: 'left' | 'center' | 'right';
29
+ level: 1 | 2 | 3;
30
+ }
31
+ export interface ParagraphBlockData extends BaseBlock {
32
+ type: 'paragraph';
33
+ text: string;
34
+ }
35
+ export interface DividerBlockData extends BaseBlock {
36
+ type: 'divider';
37
+ style: 'solid' | 'dashed' | 'dotted';
38
+ color: string;
39
+ thickness: number;
40
+ }
41
+ export interface SignatureBlockData extends BaseBlock {
42
+ type: 'signature';
43
+ title: string;
44
+ signerName: string;
45
+ signatureStyle: 'handwritten' | 'classic' | 'typed';
46
+ }
47
+ export interface TableBlockData extends BaseBlock {
48
+ type: 'table';
49
+ headers: string[];
50
+ rows: string[][];
51
+ }
52
+ export type Block = HeaderBlockData | BodyBlockData | FooterBlockData | TitleBlockData | ParagraphBlockData | DividerBlockData | SignatureBlockData | TableBlockData;
53
+ export interface Template {
54
+ id: string;
55
+ name: string;
56
+ category: string;
57
+ headerOptions: HeaderOptions;
58
+ footerOptions: FooterOptions;
59
+ signatureOptions: SignatureOptions;
60
+ letterTitle: string;
61
+ toAddress: string;
62
+ reLine: string;
63
+ subjectLine: string;
64
+ contentHtml: string;
65
+ contentDelta: string;
66
+ placeholders: string[];
67
+ customVariables?: CustomVariable[];
68
+ createdAt: string;
69
+ updatedAt?: string;
70
+ blocks?: any[];
71
+ }
72
+ export interface HeaderOptions {
73
+ companyName: string;
74
+ subheading: string;
75
+ logoUrl?: string;
76
+ address: string;
77
+ phone: string;
78
+ website: string;
79
+ includeSeal: boolean;
80
+ includeContactInfo: boolean;
81
+ includeDate: boolean;
82
+ }
83
+ export interface FooterOptions {
84
+ includeFooter: boolean;
85
+ includeDocumentName: boolean;
86
+ includeVersionNumber: boolean;
87
+ includePageNumber: boolean;
88
+ documentName?: string;
89
+ version?: string;
90
+ }
91
+ export interface SignatureOptions {
92
+ includeSignature: boolean;
93
+ signerName: string;
94
+ title: string;
95
+ signatureStyle: 'handwritten' | 'classic' | 'typed';
96
+ }
97
+ export type VariableType = 'text' | 'number' | 'date' | 'dropdown';
98
+ export interface CustomVariable {
99
+ key: string;
100
+ label: string;
101
+ type: VariableType;
102
+ options?: string[];
103
+ }
@@ -0,0 +1,13 @@
1
+ import { Block, BlockType } from './types';
2
+ export declare const generateId: () => string;
3
+ export declare const extractPlaceholders: (blocks: Block[]) => string[];
4
+ export declare const getPlaceholderLabel: (placeholder: string) => string;
5
+ export declare const getDefaultBlockData: (type: BlockType) => Block;
6
+ export declare const replacePlaceholders: (text: string, values: Record<string, string>, highlight?: boolean) => string;
7
+ export declare const compileBlockHTML: (block: Block, placeholderValues?: Record<string, string>) => string;
8
+ export declare const DEMO_TEMPLATES: Record<string, {
9
+ name: string;
10
+ category: string;
11
+ version?: string;
12
+ blocks: Block[];
13
+ }>;
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from './components/AppLayout/AppLayout';
14
14
  export * from './components/SocialLayout/SocialLayout';
15
15
  export * from './components/InboxLayout/InboxLayout';
16
16
  export * from './components/Avatar/Avatar';
17
+ export * from './components/Image/Image';
17
18
  export * from './components/Chat';
18
19
  export * from './components/Stack';
19
20
  export * from './components/Dialog/BaseDialog';
@@ -43,3 +44,4 @@ export * from './components/charts/HeatMap/OrbitHeatMap';
43
44
  export * from './components/charts/ComposedChart/OrbitComposedChart';
44
45
  export * from './components/charts/AnalyticsCard/OrbitAnalyticsCard';
45
46
  export * from './components/SeatLayout';
47
+ export * from './components/DocumentManagement';