@scbt-ecom/ui 0.107.0 → 0.108.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.
Files changed (62) hide show
  1. package/dist/lib/shared/ui/dropdownList/DropdownList.js +1 -1
  2. package/dist/lib/shared/ui/dropdownList/DropdownList.js.map +1 -1
  3. package/dist/lib/shared/ui/formElements/controlled/editor/model/config.js +1 -1
  4. package/dist/lib/shared/ui/formElements/controlled/editor/model/config.js.map +1 -1
  5. package/dist/lib/shared/ui/formElements/controlled/editor/model/extensions.js +2 -0
  6. package/dist/lib/shared/ui/formElements/controlled/editor/model/extensions.js.map +1 -0
  7. package/dist/lib/shared/ui/formElements/controlled/editor/model/helper.js +1 -1
  8. package/dist/lib/shared/ui/formElements/controlled/editor/model/helper.js.map +1 -1
  9. package/dist/lib/shared/ui/formElements/controlled/editor/model/index.js +2 -0
  10. package/dist/lib/shared/ui/formElements/controlled/editor/model/index.js.map +1 -0
  11. package/dist/lib/shared/ui/formElements/controlled/editor/ui/Editor.js +1 -1
  12. package/dist/lib/shared/ui/formElements/controlled/editor/ui/Editor.js.map +1 -1
  13. package/dist/lib/shared/ui/formElements/controlled/editor/ui/Toolbar.js +1 -1
  14. package/dist/lib/shared/ui/formElements/controlled/editor/ui/Toolbar.js.map +1 -1
  15. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetColor.js +1 -1
  16. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetColor.js.map +1 -1
  17. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetCoreCommands.js +1 -1
  18. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetCoreCommands.js.map +1 -1
  19. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetFontSize.js +2 -0
  20. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetFontSize.js.map +1 -0
  21. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetHeadings.js +1 -1
  22. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/SetHeadings.js.map +1 -1
  23. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/index.js +1 -1
  24. package/dist/lib/shared/ui/formElements/controlled/editor/ui/commands/setCustomLink.js.map +1 -1
  25. package/dist/lib/shared/ui/formElements/uncontrolled/combobox/combobox.js.map +1 -1
  26. package/dist/lib/shared/ui/icon/allowedIcons.js +1 -1
  27. package/dist/lib/shared/ui/icon/allowedIcons.js.map +1 -1
  28. package/dist/lib/shared/ui/icon/iconsMap.js +1 -1
  29. package/dist/lib/shared/ui/icon/iconsMap.js.map +1 -1
  30. package/dist/lib/shared/ui/table/Table.js +1 -1
  31. package/dist/lib/shared/ui/table/Table.js.map +1 -1
  32. package/dist/lib/widgets/model/helpers.js +2 -2
  33. package/dist/lib/widgets/model/helpers.js.map +1 -1
  34. package/dist/lib/widgets/table/Table.js +1 -1
  35. package/dist/lib/widgets/table/Table.js.map +1 -1
  36. package/dist/lib/widgets/table/model/index.js +2 -0
  37. package/dist/lib/widgets/table/model/index.js.map +1 -0
  38. package/dist/lib/widgets/table/model/types.js +2 -0
  39. package/dist/lib/widgets/table/model/types.js.map +1 -0
  40. package/dist/lib/widgets/table/model/utils.js +2 -0
  41. package/dist/lib/widgets/table/model/utils.js.map +1 -0
  42. package/dist/static/editor/fonts.svg.js +2 -0
  43. package/dist/static/editor/fonts.svg.js.map +1 -0
  44. package/dist/static/static/editor/fonts.svg +1 -0
  45. package/dist/stats.html +1 -1
  46. package/dist/types/lib/shared/ui/formElements/controlled/editor/model/config.d.ts +1 -1
  47. package/dist/types/lib/shared/ui/formElements/controlled/editor/model/extensions.d.ts +10 -0
  48. package/dist/types/lib/shared/ui/formElements/controlled/editor/model/helper.d.ts +6 -2
  49. package/dist/types/lib/shared/ui/formElements/controlled/editor/model/index.d.ts +4 -0
  50. package/dist/types/lib/shared/ui/formElements/controlled/editor/model/types.d.ts +1 -5
  51. package/dist/types/lib/shared/ui/formElements/controlled/editor/ui/Editor.d.ts +0 -3
  52. package/dist/types/lib/shared/ui/formElements/controlled/editor/ui/commands/SetFontSize.d.ts +5 -0
  53. package/dist/types/lib/shared/ui/formElements/controlled/editor/ui/commands/index.d.ts +1 -0
  54. package/dist/types/lib/shared/ui/icon/allowedIcons.d.ts +2 -2
  55. package/dist/types/lib/shared/ui/icon/iconsMap.d.ts +6 -0
  56. package/dist/types/lib/shared/ui/table/Table.d.ts +1 -1
  57. package/dist/types/lib/widgets/table/Table.d.ts +2 -21
  58. package/dist/types/lib/widgets/table/index.d.ts +1 -0
  59. package/dist/types/lib/widgets/table/model/index.d.ts +2 -0
  60. package/dist/types/lib/widgets/table/model/types.d.ts +35 -0
  61. package/dist/types/lib/widgets/table/model/utils.d.ts +8 -0
  62. package/package.json +6 -6
@@ -1 +1 @@
1
- export declare const editorConfig: (import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-underline').UnderlineOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-color').ColorOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any>)[];
1
+ export declare const editorConfig: (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Mark<import('@tiptap/extension-underline').UnderlineOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any>)[];
@@ -0,0 +1,10 @@
1
+ import { Extension } from '@tiptap/core';
2
+ declare module '@tiptap/core' {
3
+ interface Commands<ReturnType> {
4
+ fontSize: {
5
+ setFontSize: (size: string) => ReturnType;
6
+ unsetFontSize: () => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export declare const FontSizeExtension: Extension<any, any>;
@@ -1,7 +1,11 @@
1
1
  import { Editor } from '@tiptap/react';
2
- import { ColorOption, HeadingOptions } from './types';
3
- export declare const headingsOptions: HeadingOptions[];
2
+ import { ColorOption, HeadingLevel } from './types';
3
+ export declare const headingsOptions: HeadingLevel[];
4
4
  export declare const editorHeadingClasses: Record<number, string>;
5
+ export declare const fontSizesOptions: {
6
+ label: string;
7
+ value: string;
8
+ }[];
5
9
  export declare const editorAllowedColors: ColorOption[];
6
10
  export declare const renderEditorPanel: (editor: Editor) => ({
7
11
  label: string;
@@ -0,0 +1,4 @@
1
+ export * from './extensions';
2
+ export type * from './types';
3
+ export * from './config';
4
+ export * from './helper';
@@ -1,6 +1,2 @@
1
- export type THeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
2
- export interface HeadingOptions {
3
- shortcuts: string[];
4
- level: THeadingLevel;
5
- }
1
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
2
  export type ColorOption = `#${string}`;
@@ -11,9 +11,6 @@ interface EditorProps extends Partial<UseEditorOptions> {
11
11
  error?: FieldError;
12
12
  classes?: EditorControlClasses;
13
13
  externalHandlers?: ExternalHandlers;
14
- /**
15
- * Заголовок
16
- */
17
14
  label?: string;
18
15
  helperText?: string | ReactElement;
19
16
  /**
@@ -0,0 +1,5 @@
1
+ import { Editor } from '@tiptap/react';
2
+ export interface SetFontSizeProps {
3
+ editor: Editor;
4
+ }
5
+ export declare const SetFontSize: ({ editor }: SetFontSizeProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,3 +2,4 @@ export { SetCoreCommands } from './SetCoreCommands';
2
2
  export { SetHeadings } from './SetHeadings';
3
3
  export { SetColor } from './SetColor';
4
4
  export { SetCustomLink } from './setCustomLink';
5
+ export { SetFontSize } from './SetFontSize';
@@ -4,7 +4,7 @@ export declare const allowedIcons: {
4
4
  readonly arrows: readonly ["arrows/arrowCircle", "arrows/arrowDownRight", "arrows/arrowLink", "arrows/arrowRight", "arrows/arrowRotate", "arrows/arrowScroll"];
5
5
  readonly brandLogos: readonly ["brandLogos/logoBlack", "brandLogos/logoBusiness", "brandLogos/logoGray", "brandLogos/logoInsurance", "brandLogos/logoMain", "brandLogos/logoWhite"];
6
6
  readonly communication: readonly ["communication/phone"];
7
- readonly editor: readonly ["editor/bold", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo"];
7
+ readonly editor: readonly ["editor/bold", "editor/fonts", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo"];
8
8
  readonly files: readonly ["files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload"];
9
9
  readonly general: readonly ["general/calendar", "general/check", "general/close", "general/edit", "general/heart", "general/hiddenEye", "general/loginFilled", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye"];
10
10
  readonly info: readonly ["info/helpCircle", "info/warningCircle"];
@@ -13,5 +13,5 @@ export declare const allowedIcons: {
13
13
  readonly social: readonly ["social/classmates", "social/telegram", "social/vk"];
14
14
  readonly status: readonly ["status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"];
15
15
  };
16
- readonly flatten: readonly ["arrows/arrowCircle", "arrows/arrowDownRight", "arrows/arrowLink", "arrows/arrowRight", "arrows/arrowRotate", "arrows/arrowScroll", "brandLogos/logoBlack", "brandLogos/logoBusiness", "brandLogos/logoGray", "brandLogos/logoInsurance", "brandLogos/logoMain", "brandLogos/logoWhite", "communication/phone", "editor/bold", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo", "files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload", "general/calendar", "general/check", "general/close", "general/edit", "general/heart", "general/hiddenEye", "general/loginFilled", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye", "info/helpCircle", "info/warningCircle", "logos/beeline", "logos/megafon", "logos/mts", "media/desktop", "media/mobile", "social/classmates", "social/telegram", "social/vk", "status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"];
16
+ readonly flatten: readonly ["arrows/arrowCircle", "arrows/arrowDownRight", "arrows/arrowLink", "arrows/arrowRight", "arrows/arrowRotate", "arrows/arrowScroll", "brandLogos/logoBlack", "brandLogos/logoBusiness", "brandLogos/logoGray", "brandLogos/logoInsurance", "brandLogos/logoMain", "brandLogos/logoWhite", "communication/phone", "editor/bold", "editor/fonts", "editor/heading", "editor/italic", "editor/link", "editor/list", "editor/palette", "editor/redo", "editor/removeFormatting", "editor/space", "editor/strikethrough", "editor/typography", "editor/underline", "editor/undo", "files/border", "files/borderError", "files/documentFilled", "files/documentOutline", "files/upload", "general/calendar", "general/check", "general/close", "general/edit", "general/heart", "general/hiddenEye", "general/loginFilled", "general/menu", "general/plus", "general/reorder", "general/search", "general/shield", "general/showEye", "info/helpCircle", "info/warningCircle", "logos/beeline", "logos/megafon", "logos/mts", "media/desktop", "media/mobile", "social/classmates", "social/telegram", "social/vk", "status/badSmile", "status/iconMark", "status/iconRetry", "status/iconUser", "status/succesCircle"];
17
17
  };
@@ -83,6 +83,12 @@ export declare const iconsMap: {
83
83
  desc?: string;
84
84
  descId?: string;
85
85
  }>;
86
+ 'editor/fonts': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
87
+ title?: string;
88
+ titleId?: string;
89
+ desc?: string;
90
+ descId?: string;
91
+ }>;
86
92
  'editor/heading': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
87
93
  title?: string;
88
94
  titleId?: string;
@@ -1,2 +1,2 @@
1
1
  import { DataTableProps } from './model';
2
- export declare const DataTable: <TData extends {}>({ columns, data, enableHeaders, mode, classes, pagination, empty, pageSize }: DataTableProps<TData>) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const DataTable: <TData extends {}>({ columns, data, enableHeaders, mode, classes, pagination, empty, horizontal, pageSize }: DataTableProps<TData>) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,2 @@
1
- import { ReactElement } from 'react';
2
- import { DataTableProps } from '../../shared/ui/table/model';
3
- import { DataTableClasses } from '../../../shared/ui/table/model/types';
4
- export type TableClasses = {
5
- root?: string;
6
- container?: string;
7
- textContainer?: string;
8
- title?: string;
9
- subtitle?: string;
10
- tableContainer?: string;
11
- helperText?: string;
12
- tableClasses?: DataTableClasses;
13
- };
14
- export interface TableProps<TData extends {}> extends Omit<DataTableProps<TData>, 'classes'> {
15
- title: ReactElement | string;
16
- subtitle: ReactElement | string;
17
- helperText: ReactElement | string;
18
- horizontal?: boolean;
19
- classes?: TableClasses;
20
- }
21
- export declare const Table: <TData extends {}>(props: TableProps<TData>) => import("react/jsx-runtime").JSX.Element;
1
+ import { TableProps } from './model';
2
+ export declare const Table: <Key extends string, TData extends Record<Key, unknown>>(props: TableProps<Key, TData>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
1
  export { Table } from './Table';
2
+ export type { TableProps } from './model';
@@ -0,0 +1,2 @@
1
+ export type { TableProps } from './types';
2
+ export { getHeaderAccessors, isHorizontalTable } from './utils';
@@ -0,0 +1,35 @@
1
+ import { BuiltInSortingFn } from '@tanstack/react-table';
2
+ export type ColumnDefinition<Key extends string> = {
3
+ title: Key;
4
+ visibleTitle?: string;
5
+ enableSorting: boolean;
6
+ sortingFn: BuiltInSortingFn;
7
+ };
8
+ type OrientationEnabled = {
9
+ type: 'true';
10
+ };
11
+ type OrientationDisabled = {
12
+ type: 'false';
13
+ };
14
+ type OrientationCondition = {
15
+ type: 'condition';
16
+ condition: '<' | '<=' | '===' | '!==' | '>' | '>=';
17
+ operand: {
18
+ left: string;
19
+ right: string;
20
+ };
21
+ };
22
+ export type OrientationOptions = OrientationEnabled | OrientationDisabled | OrientationCondition;
23
+ export interface TableProps<Key extends string, TData extends Record<Key, unknown>> {
24
+ title: string;
25
+ subtitle: string;
26
+ columns: ColumnDefinition<Key>[];
27
+ data: TData[];
28
+ enableHeaders: boolean;
29
+ helperText?: string;
30
+ horizontal: OrientationOptions;
31
+ mode: 'solid' | 'odd';
32
+ pagination: boolean;
33
+ pageSize?: number;
34
+ }
35
+ export {};
@@ -0,0 +1,8 @@
1
+ import { HeaderContext, SortingFnOption } from '@tanstack/react-table';
2
+ import { ColumnDefinition, OrientationOptions } from './types';
3
+ export declare const getHeaderAccessors: <Key extends string, TData extends Record<Key, unknown>>(columns: ColumnDefinition<Key>[]) => {
4
+ accessors: Record<keyof TData, (key: keyof TData, headerContext: HeaderContext<TData, TData[keyof TData]>) => React.ReactNode>;
5
+ sortingColumns: Key[];
6
+ sortingFn: Partial<Record<keyof TData, SortingFnOption<TData>>>;
7
+ };
8
+ export declare const isHorizontalTable: (orientation: OrientationOptions) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scbt-ecom/ui",
3
- "version": "0.107.0",
3
+ "version": "0.108.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -88,6 +88,7 @@
88
88
  "esbuild": "0.24.0"
89
89
  },
90
90
  "dependencies": {
91
+ "@hookform/resolvers": "^3.9.0",
91
92
  "@headlessui/react": "^2.1.2",
92
93
  "@radix-ui/react-checkbox": "^1.1.1",
93
94
  "@radix-ui/react-popover": "^1.1.1",
@@ -121,14 +122,13 @@
121
122
  "react-hook-form": "^7.53.1",
122
123
  "react-hot-toast": "^2.4.1",
123
124
  "react-number-format": "^5.4.0",
124
- "uuid": "^11.1.0",
125
- "vite-plugin-svgr": "^4.3.0",
126
- "@hookform/resolvers": "^3.9.0",
127
125
  "tailwind-merge": "2.4.0",
128
126
  "tailwindcss": "^3.4.7",
129
127
  "tailwindcss-animate": "^1.0.7",
130
- "zod": "^3.23.8",
131
- "use-mask-input": "^3.4.2"
128
+ "use-mask-input": "^3.4.2",
129
+ "uuid": "^11.1.0",
130
+ "vite-plugin-svgr": "^4.3.0",
131
+ "zod": "^3.23.8"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@eslint/compat": "^1.2.1",