@6thbridge/hexa 0.0.0-pr50-60 → 0.0.0-pr51-61
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.mts +86 -1
- package/dist/index.d.ts +86 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/output.css +164 -0
- package/package.json +7 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
|
|
|
15
15
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
16
16
|
import * as zustand from 'zustand';
|
|
17
17
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
18
|
+
import { Extension } from '@tiptap/react';
|
|
18
19
|
import dayjs from 'dayjs';
|
|
19
20
|
import { ClassValue } from 'clsx';
|
|
20
21
|
|
|
@@ -662,6 +663,90 @@ type TabsProps = {
|
|
|
662
663
|
};
|
|
663
664
|
declare function Tabs({ tabs, defaultValue, onChange }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
664
665
|
|
|
666
|
+
type EditorControl = "bold" | "italic" | "underline" | "strike" | "heading1" | "bulletList" | "orderedList" | "blockquote" | "textStyle" | "link";
|
|
667
|
+
|
|
668
|
+
type RichTextEditorProps = {
|
|
669
|
+
label?: string;
|
|
670
|
+
helpText?: string;
|
|
671
|
+
error?: string;
|
|
672
|
+
value?: string;
|
|
673
|
+
onChange?: (html: string) => void;
|
|
674
|
+
optional?: boolean;
|
|
675
|
+
isRequired?: boolean;
|
|
676
|
+
extensions?: Extension[];
|
|
677
|
+
editorClassName?: string;
|
|
678
|
+
wrapperClassName?: string;
|
|
679
|
+
controls?: EditorControl[];
|
|
680
|
+
extraMenuNodes?: React.ReactNode;
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* @component RichTextEditor
|
|
684
|
+
* @description
|
|
685
|
+
* The `RichTextEditor` component is a customizable rich text input built on top of Tiptap and styled with Tailwind CSS.
|
|
686
|
+
* It provides a toolbar for formatting text (bold, italic, underline, strikethrough, headings, lists, blockquote, links).
|
|
687
|
+
*
|
|
688
|
+
* ## Props
|
|
689
|
+
* - `label?: string` - Label for the editor.
|
|
690
|
+
* - `helpText?: string` - Optional help text displayed below the editor.
|
|
691
|
+
* - `error?: string` - Error message displayed below the editor.
|
|
692
|
+
* - `value?: string` - The HTML content of the editor.
|
|
693
|
+
* - `onChange?: (html: string) => void` - Callback fired when the content changes.
|
|
694
|
+
* - `optional?: boolean` - If true, displays "Optional" next to the label.
|
|
695
|
+
* - `isRequired?: boolean` - If true, displays a red asterisk next to the label.
|
|
696
|
+
* - `extensions?: Extension[]` - Additional Tiptap extensions to include.
|
|
697
|
+
* - `editorClassName?: string` - Custom class for the editor content area.
|
|
698
|
+
* - `wrapperClassName?: string` - Custom class for the editor wrapper.
|
|
699
|
+
* - `controls?: EditorControl[]` - Array of controls to show in the toolbar.
|
|
700
|
+
* - `extraMenuNodes?: React.ReactNode` - Extra nodes to render in the toolbar.
|
|
701
|
+
*
|
|
702
|
+
* ## Usage
|
|
703
|
+
*
|
|
704
|
+
* ```tsx
|
|
705
|
+
* import React, { useState } from "react";
|
|
706
|
+
* import { RichTextEditor } from "@6thbridge/hexa";
|
|
707
|
+
*
|
|
708
|
+
* export const RichTextEditorDemo = () => {
|
|
709
|
+
* const [value, setValue] = useState("<p>Hello <strong>world</strong>!</p>");
|
|
710
|
+
*
|
|
711
|
+
* return (
|
|
712
|
+
* <div className="max-w-xl mx-auto mt-8">
|
|
713
|
+
* <RichTextEditor
|
|
714
|
+
* label="Description"
|
|
715
|
+
* helpText="You can format your text using the toolbar above."
|
|
716
|
+
* value={value}
|
|
717
|
+
* onChange={setValue}
|
|
718
|
+
* optional
|
|
719
|
+
* isRequired
|
|
720
|
+
* // You can customize controls, add extensions, etc.
|
|
721
|
+
* // controls={["textStyle", "bold", "italic", "underline", "strike", "link", "bulletList", "orderedList", "blockquote"]}
|
|
722
|
+
* />
|
|
723
|
+
* <div className="mt-6">
|
|
724
|
+
* <h2 className="text-lg font-semibold mb-2">Editor Output (HTML):</h2>
|
|
725
|
+
* <pre className="bg-gray-100 p-4 rounded text-xs overflow-x-auto">{value}</pre>
|
|
726
|
+
* </div>
|
|
727
|
+
* </div>
|
|
728
|
+
* );
|
|
729
|
+
* };
|
|
730
|
+
* ```
|
|
731
|
+
*
|
|
732
|
+
* ## Output
|
|
733
|
+
*
|
|
734
|
+
* The editor renders a toolbar with formatting buttons (bold, italic, underline, strikethrough, headings, bullet list, ordered list, blockquote, link).
|
|
735
|
+
* The content area allows rich text editing. The output is HTML, which is returned via the `onChange` callback and can be displayed or stored as needed.
|
|
736
|
+
*
|
|
737
|
+
* Example output:
|
|
738
|
+
*
|
|
739
|
+
* ```html
|
|
740
|
+
* <p>This is <strong>bold</strong>, <em>italic</em>, <u>underlined</u>, <s>strikethrough</s>, and a <blockquote>blockquote</blockquote>.</p>
|
|
741
|
+
* <ul>
|
|
742
|
+
* <li>Bullet item 1</li>
|
|
743
|
+
* <li>Bullet item 2</li>
|
|
744
|
+
* </ul>
|
|
745
|
+
* <a href="https://example.com">A link</a>
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
748
|
+
declare const RichTextEditor: ({ label, helpText, error, value, onChange, optional, isRequired, extensions, editorClassName, wrapperClassName, controls, extraMenuNodes, }: RichTextEditorProps) => react_jsx_runtime.JSX.Element | null;
|
|
749
|
+
|
|
665
750
|
declare const CurrencySymbolMap: Record<string, string>;
|
|
666
751
|
interface FormatCurrencyOptions {
|
|
667
752
|
convertToMajorCurrency?: boolean;
|
|
@@ -683,4 +768,4 @@ declare class DateAction {
|
|
|
683
768
|
|
|
684
769
|
declare function cn(...inputs: ClassValue[]): string;
|
|
685
770
|
|
|
686
|
-
export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
|
|
771
|
+
export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, Status, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
|
|
|
15
15
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
16
16
|
import * as zustand from 'zustand';
|
|
17
17
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
18
|
+
import { Extension } from '@tiptap/react';
|
|
18
19
|
import dayjs from 'dayjs';
|
|
19
20
|
import { ClassValue } from 'clsx';
|
|
20
21
|
|
|
@@ -662,6 +663,90 @@ type TabsProps = {
|
|
|
662
663
|
};
|
|
663
664
|
declare function Tabs({ tabs, defaultValue, onChange }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
664
665
|
|
|
666
|
+
type EditorControl = "bold" | "italic" | "underline" | "strike" | "heading1" | "bulletList" | "orderedList" | "blockquote" | "textStyle" | "link";
|
|
667
|
+
|
|
668
|
+
type RichTextEditorProps = {
|
|
669
|
+
label?: string;
|
|
670
|
+
helpText?: string;
|
|
671
|
+
error?: string;
|
|
672
|
+
value?: string;
|
|
673
|
+
onChange?: (html: string) => void;
|
|
674
|
+
optional?: boolean;
|
|
675
|
+
isRequired?: boolean;
|
|
676
|
+
extensions?: Extension[];
|
|
677
|
+
editorClassName?: string;
|
|
678
|
+
wrapperClassName?: string;
|
|
679
|
+
controls?: EditorControl[];
|
|
680
|
+
extraMenuNodes?: React.ReactNode;
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* @component RichTextEditor
|
|
684
|
+
* @description
|
|
685
|
+
* The `RichTextEditor` component is a customizable rich text input built on top of Tiptap and styled with Tailwind CSS.
|
|
686
|
+
* It provides a toolbar for formatting text (bold, italic, underline, strikethrough, headings, lists, blockquote, links).
|
|
687
|
+
*
|
|
688
|
+
* ## Props
|
|
689
|
+
* - `label?: string` - Label for the editor.
|
|
690
|
+
* - `helpText?: string` - Optional help text displayed below the editor.
|
|
691
|
+
* - `error?: string` - Error message displayed below the editor.
|
|
692
|
+
* - `value?: string` - The HTML content of the editor.
|
|
693
|
+
* - `onChange?: (html: string) => void` - Callback fired when the content changes.
|
|
694
|
+
* - `optional?: boolean` - If true, displays "Optional" next to the label.
|
|
695
|
+
* - `isRequired?: boolean` - If true, displays a red asterisk next to the label.
|
|
696
|
+
* - `extensions?: Extension[]` - Additional Tiptap extensions to include.
|
|
697
|
+
* - `editorClassName?: string` - Custom class for the editor content area.
|
|
698
|
+
* - `wrapperClassName?: string` - Custom class for the editor wrapper.
|
|
699
|
+
* - `controls?: EditorControl[]` - Array of controls to show in the toolbar.
|
|
700
|
+
* - `extraMenuNodes?: React.ReactNode` - Extra nodes to render in the toolbar.
|
|
701
|
+
*
|
|
702
|
+
* ## Usage
|
|
703
|
+
*
|
|
704
|
+
* ```tsx
|
|
705
|
+
* import React, { useState } from "react";
|
|
706
|
+
* import { RichTextEditor } from "@6thbridge/hexa";
|
|
707
|
+
*
|
|
708
|
+
* export const RichTextEditorDemo = () => {
|
|
709
|
+
* const [value, setValue] = useState("<p>Hello <strong>world</strong>!</p>");
|
|
710
|
+
*
|
|
711
|
+
* return (
|
|
712
|
+
* <div className="max-w-xl mx-auto mt-8">
|
|
713
|
+
* <RichTextEditor
|
|
714
|
+
* label="Description"
|
|
715
|
+
* helpText="You can format your text using the toolbar above."
|
|
716
|
+
* value={value}
|
|
717
|
+
* onChange={setValue}
|
|
718
|
+
* optional
|
|
719
|
+
* isRequired
|
|
720
|
+
* // You can customize controls, add extensions, etc.
|
|
721
|
+
* // controls={["textStyle", "bold", "italic", "underline", "strike", "link", "bulletList", "orderedList", "blockquote"]}
|
|
722
|
+
* />
|
|
723
|
+
* <div className="mt-6">
|
|
724
|
+
* <h2 className="text-lg font-semibold mb-2">Editor Output (HTML):</h2>
|
|
725
|
+
* <pre className="bg-gray-100 p-4 rounded text-xs overflow-x-auto">{value}</pre>
|
|
726
|
+
* </div>
|
|
727
|
+
* </div>
|
|
728
|
+
* );
|
|
729
|
+
* };
|
|
730
|
+
* ```
|
|
731
|
+
*
|
|
732
|
+
* ## Output
|
|
733
|
+
*
|
|
734
|
+
* The editor renders a toolbar with formatting buttons (bold, italic, underline, strikethrough, headings, bullet list, ordered list, blockquote, link).
|
|
735
|
+
* The content area allows rich text editing. The output is HTML, which is returned via the `onChange` callback and can be displayed or stored as needed.
|
|
736
|
+
*
|
|
737
|
+
* Example output:
|
|
738
|
+
*
|
|
739
|
+
* ```html
|
|
740
|
+
* <p>This is <strong>bold</strong>, <em>italic</em>, <u>underlined</u>, <s>strikethrough</s>, and a <blockquote>blockquote</blockquote>.</p>
|
|
741
|
+
* <ul>
|
|
742
|
+
* <li>Bullet item 1</li>
|
|
743
|
+
* <li>Bullet item 2</li>
|
|
744
|
+
* </ul>
|
|
745
|
+
* <a href="https://example.com">A link</a>
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
748
|
+
declare const RichTextEditor: ({ label, helpText, error, value, onChange, optional, isRequired, extensions, editorClassName, wrapperClassName, controls, extraMenuNodes, }: RichTextEditorProps) => react_jsx_runtime.JSX.Element | null;
|
|
749
|
+
|
|
665
750
|
declare const CurrencySymbolMap: Record<string, string>;
|
|
666
751
|
interface FormatCurrencyOptions {
|
|
667
752
|
convertToMajorCurrency?: boolean;
|
|
@@ -683,4 +768,4 @@ declare class DateAction {
|
|
|
683
768
|
|
|
684
769
|
declare function cn(...inputs: ClassValue[]): string;
|
|
685
770
|
|
|
686
|
-
export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
|
|
771
|
+
export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, Status, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
|