@myunisoft/design-system 1.2.5-rev337 → 1.2.6

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.JSXElementConstructor<any>;
3
+ export default _default;
@@ -0,0 +1,5 @@
1
+ declare const useSizing: (columns?: never[]) => {
2
+ columnsStyle: {};
3
+ totalWidth: number;
4
+ };
5
+ export default useSizing;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ declare const EmptySummary: ({ emptySummaryLabel }: {
2
+ emptySummaryLabel?: string | React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default EmptySummary;
@@ -0,0 +1,8 @@
1
+ import type { RichTreeViewProApiRef, TreeItemProps } from '@mui/x-tree-view-pro';
2
+ import type { TreeviewProps } from './types';
3
+ type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'onItemVisibilityChange'> & {
4
+ apiRef: RichTreeViewProApiRef;
5
+ };
6
+ type CustomTreeItemProps<T extends Record<string, unknown>> = TreeItemProps & TreeItemCallbacks<T>;
7
+ export declare const CustomTreeItem: <T extends Record<string, unknown>>(props: CustomTreeItemProps<T>) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ export declare const useTreeItemMenu: () => {
2
+ containerRef: import("react").RefObject<HTMLDivElement | null>;
3
+ menuAnchorEl: HTMLElement | null;
4
+ menuPosition: {
5
+ top: number;
6
+ left: number;
7
+ } | null;
8
+ handleMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
9
+ handleMenuClose: () => void;
10
+ createMouseMoveHandler: (isHovered: boolean, onHoverChange?: (isHovered: boolean) => void) => (e: React.MouseEvent<HTMLDivElement>) => void;
11
+ createMouseLeaveHandler: (onHoverChange?: (isHovered: boolean) => void) => () => void;
12
+ };
@@ -0,0 +1 @@
1
+ export declare const DragHandleIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { TreeviewProps } from './types';
2
+ declare const Treeview: <T extends Record<string, unknown>>(props: TreeviewProps<T>) => import("react/jsx-runtime").JSX.Element;
3
+ export default Treeview;
@@ -0,0 +1,14 @@
1
+ import type { SxProps, Theme } from '@mui/material';
2
+ type IconContainerSlotProps = {
3
+ ownerState?: unknown;
4
+ children?: React.ReactNode;
5
+ sx?: SxProps<Theme>;
6
+ isDraggable?: boolean;
7
+ isVisible?: boolean;
8
+ [key: string]: unknown;
9
+ };
10
+ export declare const IconContainerSlot: {
11
+ (props: IconContainerSlotProps): import("react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ export {};
@@ -0,0 +1,6 @@
1
+ type LabelInputSlotProps = {
2
+ ownerState?: unknown;
3
+ [key: string]: unknown;
4
+ };
5
+ export declare const LabelInputSlot: import("react").ForwardRefExoticComponent<Omit<LabelInputSlotProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
6
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { SxProps, Theme } from '@mui/material';
2
+ type LabelSlotProps = {
3
+ ownerState?: unknown;
4
+ editable?: unknown;
5
+ children?: React.ReactNode;
6
+ sx?: SxProps<Theme>;
7
+ customIcon?: React.ReactNode;
8
+ hasMenu?: boolean;
9
+ isVisible?: boolean;
10
+ itemId: string;
11
+ menuAnchorEl?: HTMLElement | null;
12
+ onMenuClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
13
+ onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
14
+ [key: string]: unknown;
15
+ };
16
+ export declare const LabelSlot: {
17
+ (props: LabelSlotProps): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ export {};
@@ -0,0 +1,3 @@
1
+ export { IconContainerSlot } from './IconContainerSlot';
2
+ export { LabelInputSlot } from './LabelInputSlot';
3
+ export { LabelSlot } from './LabelSlot';
@@ -0,0 +1,40 @@
1
+ import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
2
+ export type ItemPositionParams = {
3
+ itemId: string;
4
+ oldPosition: {
5
+ parentId: string | null;
6
+ index: number;
7
+ };
8
+ newPosition: {
9
+ parentId: string | null;
10
+ index: number;
11
+ };
12
+ };
13
+ type CustomTreeviewItemProps<T> = {
14
+ hasItemMenu?: (item: T) => boolean;
15
+ getMenuItems?: (item: T, apiRef?: RichTreeViewProApiRef) => React.ReactNode[];
16
+ isSectionItem?: (item: T) => boolean;
17
+ getIconItem?: (item: T) => React.ReactNode;
18
+ isItemEditable?: (item: T) => boolean;
19
+ isVisibleItem?: (item: T) => boolean;
20
+ onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
21
+ };
22
+ export type TreeviewProps<T> = {
23
+ items: readonly T[];
24
+ getItemId?: (item: T) => string;
25
+ getItemLabel?: (item: T) => string;
26
+ getItemChildren?: (item: T) => T[] | undefined;
27
+ isItemReorderable?: (itemId: string) => boolean;
28
+ canMoveItemToNewPosition?: (params: ItemPositionParams) => boolean;
29
+ onItemPositionChange?: (params: ItemPositionParams) => void;
30
+ onItemLabelChange?: (itemId: string, newLabel: string) => void;
31
+ checkboxSelection?: boolean;
32
+ multiSelect?: boolean;
33
+ defaultExpandedItems?: string[];
34
+ } & CustomTreeviewItemProps<T>;
35
+ export type TreeviewItemProps<T> = {
36
+ itemId: string;
37
+ label?: React.ReactNode;
38
+ children?: React.ReactNode;
39
+ } & CustomTreeviewItemProps<T>;
40
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
2
+ import type { ItemPositionParams } from '../Treeview/types';
3
+ import type { DocumentComposerCallbacks, DocumentComposerSummaryItem } from '../types';
4
+ type HookDocumentComposerProps = {
5
+ summary?: DocumentComposerSummaryItem[];
6
+ } & DocumentComposerCallbacks;
7
+ export declare const useDocumentComposer: ({ summary, onSummaryItemVisibilityChange, onSummaryItemDelete }: HookDocumentComposerProps) => {
8
+ summaryItemsMap: Map<string, DocumentComposerSummaryItem>;
9
+ getSummaryItemMenu: (item: DocumentComposerSummaryItem, apiRef?: RichTreeViewProApiRef) => import("react").ReactNode[];
10
+ hasSummaryItemMenu: (_item: DocumentComposerSummaryItem) => boolean;
11
+ getSummaryItemById: (itemId: string) => DocumentComposerSummaryItem | null;
12
+ getSummaryItemIcon: (item: DocumentComposerSummaryItem) => import("react/jsx-runtime").JSX.Element | null;
13
+ isSummaryItemSection: (item: DocumentComposerSummaryItem) => boolean;
14
+ canMoveSummaryItemToNewPosition: (params: ItemPositionParams) => boolean;
15
+ handleOnSummaryItemVisibilityChange: (itemId: string, visible: boolean) => void;
16
+ };
17
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare const TableIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const RenameIcon: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const DeleteIcon: () => import("react/jsx-runtime").JSX.Element;
4
+ export declare const CreateIcon: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const AddIcon: () => import("react/jsx-runtime").JSX.Element;
6
+ export declare const VisibilityOffIcon: () => import("react/jsx-runtime").JSX.Element;
7
+ export declare const VisibilityOnIcon: () => import("react/jsx-runtime").JSX.Element;
8
+ export declare const EmptyAnnexIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentComposerSummaryItem } from './types';
2
+ type DocumentComposerProps = {
3
+ summary?: DocumentComposerSummaryItem[];
4
+ } & DocumentComposerCallbacks & DocumentComposerCustomProps;
5
+ declare const DocumentComposer: ({ summary, onSummaryItemOrderChange, onSummaryItemLabelChange, onSummaryItemDelete, onSummaryItemVisibilityChange, emptySummaryLabel, isLoading }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default DocumentComposer;
@@ -0,0 +1,23 @@
1
+ import type { ItemPositionParams } from './Treeview/types';
2
+ export type DocumentComposerSummaryItem = {
3
+ id: string;
4
+ title: string;
5
+ visible: boolean;
6
+ parentId: string | null;
7
+ sections?: DocumentComposerSummaryItem[] | null;
8
+ };
9
+ export type ItemDisplayOrder = {
10
+ id: string;
11
+ displayOrder: number;
12
+ };
13
+ export type DocumentComposerCustomProps = {
14
+ emptySummaryLabel?: string | React.ReactNode;
15
+ /** Show a loading state that blocks the summary */
16
+ isLoading?: boolean;
17
+ };
18
+ export type DocumentComposerCallbacks = {
19
+ onSummaryItemOrderChange?: (params: ItemPositionParams) => void;
20
+ onSummaryItemLabelChange?: (itemId: string, newLabel: string) => void;
21
+ onSummaryItemDelete?: (itemId: string) => void;
22
+ onSummaryItemVisibilityChange?: (itemId: string, visible: boolean) => void;
23
+ };
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ type ModalVariantIconProps = {
3
+ variant: 'info' | 'warning' | 'error';
4
+ };
5
+ declare const ModalVariantIcon: FC<ModalVariantIconProps>;
6
+ export default ModalVariantIcon;
package/package.json CHANGED
@@ -1,117 +1,117 @@
1
- {
2
- "name": "@myunisoft/design-system",
3
- "version": "1.2.5-rev337",
4
- "description": "Design System of MyUnisoft",
5
- "main": "dist/index.js",
6
- "source": "src/index.ts",
7
- "types": "dist/index.d.ts",
8
- "scripts": {
9
- "start": "cd website && npm start -- --port=3002",
10
- "build": "rm -r dist & node esbuild",
11
- "build-cypress": "rm -r dist & node esbuild-cypress",
12
- "prepublishOnly": "npm run build",
13
- "test": "jest --transformIgnorePatterns \"node_modules/(?!@exceljs)/\" ",
14
- "parcel-build": "node esbuild",
15
- "cypress": "npm run build-cypress && npx cypress open --component --browser chrome",
16
- "cy:run": "npx cypress run --component --browser chrome",
17
- "lint-staged": "biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched --diagnostic-level=warn && biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched --diagnostic-level=error",
18
- "prepare": "husky"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+ssh://git@bitbucket.org/myunibucket/design-system.git"
23
- },
24
- "keywords": [],
25
- "files": [
26
- "dist"
27
- ],
28
- "publishConfig": {
29
- "@myunisoft:registry": "https://registry.npmjs.org/"
30
- },
31
- "author": "MyUnisoft",
32
- "license": "MIT",
33
- "homepage": "https://myunisoft.github.io/design-system/",
34
- "dependencies": {
35
- "@babel/runtime": "7.20.6",
36
- "@emotion/react": "11.14.0",
37
- "@emotion/styled": "11.14.1",
38
- "@mui/material": "7.1.2",
39
- "@mui/utils": "7.3.1",
40
- "@mui/x-data-grid-pro": "7.29.8",
41
- "@testing-library/dom": "10.1.0",
42
- "autosuggest-highlight": "3.3.4",
43
- "classnames": "2.3.2",
44
- "exceljs": "4.4.0",
45
- "i18next": "22.4.6",
46
- "jspdf": "3.0.1",
47
- "jspdf-autotable": "3.5.28",
48
- "localforage": "1.10.0",
49
- "lodash": "4.17.21",
50
- "moment": "2.30.1",
51
- "numeral": "2.0.6",
52
- "pretty-bytes": "6.0.0",
53
- "prop-types": "15.8.1",
54
- "react": "19.1.1",
55
- "react-color": "2.19.3",
56
- "react-dom": "19.1.1",
57
- "react-draft-wysiwyg": "1.15.0",
58
- "react-draggable": "4.4.6",
59
- "react-dropzone": "14.2.3",
60
- "react-input-autosize": "3.0.0",
61
- "react-spinners": "0.13.8",
62
- "react-window": "2.2.3",
63
- "reselect": "4.1.7",
64
- "robot3": "0.3.2",
65
- "sortablejs": "1.15.0",
66
- "svgo": "3.0.2",
67
- "tss-react": "4.9.18"
68
- },
69
- "resolutions": {
70
- "cheerio": "<1.0.0",
71
- "@mui/material": "7.1.2",
72
- "@babel/core": "7.26.0"
73
- },
74
- "devDependencies": {
75
- "@4tw/cypress-drag-drop": "2.3.0",
76
- "@babel/core": "7.26.0",
77
- "@babel/plugin-proposal-class-properties": "7.18.6",
78
- "@babel/plugin-transform-runtime": "7.28.5",
79
- "@babel/preset-env": "7.28.5",
80
- "@babel/preset-react": "7.28.5",
81
- "@babel/preset-typescript": "7.28.5",
82
- "@biomejs/biome": "2.3.5",
83
- "@parcel/transformer-inline-string": "2.8.2",
84
- "@parcel/transformer-sass": "2.8.2",
85
- "@parcel/transformer-svg-react": "2.8.2",
86
- "@testing-library/react": "16.3.0",
87
- "@types/jest": "30.0.0",
88
- "@types/mocha": "10.0.10",
89
- "@types/react": "19.1.0",
90
- "@types/react-dom": "19.1.0",
91
- "babel-jest": "29.3.1",
92
- "babel-loader": "9.1.0",
93
- "cheerio": "<1.0.0",
94
- "css-loader": "6.7.3",
95
- "cypress": "14.5.0",
96
- "esbuild": "0.21.5",
97
- "esbuild-sass-plugin": "2.4.4",
98
- "html-webpack-plugin": "5.5.0",
99
- "husky": "9.1.7",
100
- "jest": "29.3.1",
101
- "jest-canvas-mock": "2.4.0",
102
- "jest-environment-jsdom": "29.3.1",
103
- "parcel": "2.8.2",
104
- "react-test-renderer": "18.3.1",
105
- "sass": "1.57.1",
106
- "sass-loader": "13.2.0",
107
- "style-loader": "3.3.1",
108
- "svg-inline-loader": "0.8.2",
109
- "typescript": "5.5.4",
110
- "webpack": "5.75.0"
111
- },
112
- "peerDependencies": {
113
- "@mui/material": "7.1.2",
114
- "react": "19.1.1",
115
- "react-dom": "19.1.1"
116
- }
117
- }
1
+ {
2
+ "name": "@myunisoft/design-system",
3
+ "version": "1.2.6",
4
+ "description": "Design System of MyUnisoft",
5
+ "main": "dist/index.js",
6
+ "source": "src/index.ts",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "start": "cd website && npm start -- --port=3002",
10
+ "build": "rm -r dist & node esbuild",
11
+ "build-cypress": "rm -r dist & node esbuild-cypress",
12
+ "prepublishOnly": "npm run build",
13
+ "test": "jest --transformIgnorePatterns \"node_modules/(?!@exceljs)/\" ",
14
+ "parcel-build": "node esbuild",
15
+ "cypress": "npm run build-cypress && npx cypress open --component --browser chrome",
16
+ "cy:run": "npx cypress run --component --browser chrome",
17
+ "lint-staged": "biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched --diagnostic-level=warn && biome lint --staged --files-ignore-unknown=true --no-errors-on-unmatched --diagnostic-level=error",
18
+ "prepare": "husky"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+ssh://git@bitbucket.org/myunibucket/design-system.git"
23
+ },
24
+ "keywords": [],
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "publishConfig": {
29
+ "@myunisoft:registry": "https://registry.npmjs.org/"
30
+ },
31
+ "author": "MyUnisoft",
32
+ "license": "MIT",
33
+ "homepage": "https://myunisoft.github.io/design-system/",
34
+ "dependencies": {
35
+ "@babel/runtime": "7.20.6",
36
+ "@emotion/react": "11.14.0",
37
+ "@emotion/styled": "11.14.1",
38
+ "@mui/material": "7.1.2",
39
+ "@mui/utils": "7.3.1",
40
+ "@mui/x-data-grid-pro": "7.29.8",
41
+ "@testing-library/dom": "10.1.0",
42
+ "autosuggest-highlight": "3.3.4",
43
+ "classnames": "2.3.2",
44
+ "exceljs": "4.4.0",
45
+ "i18next": "22.4.6",
46
+ "jspdf": "3.0.1",
47
+ "jspdf-autotable": "3.5.28",
48
+ "localforage": "1.10.0",
49
+ "lodash": "4.17.21",
50
+ "moment": "2.30.1",
51
+ "numeral": "2.0.6",
52
+ "pretty-bytes": "6.0.0",
53
+ "prop-types": "15.8.1",
54
+ "react": "19.1.1",
55
+ "react-color": "2.19.3",
56
+ "react-dom": "19.1.1",
57
+ "react-draft-wysiwyg": "1.15.0",
58
+ "react-draggable": "4.4.6",
59
+ "react-dropzone": "14.2.3",
60
+ "react-input-autosize": "3.0.0",
61
+ "react-spinners": "0.13.8",
62
+ "react-window": "2.2.3",
63
+ "reselect": "4.1.7",
64
+ "robot3": "0.3.2",
65
+ "sortablejs": "1.15.0",
66
+ "svgo": "3.0.2",
67
+ "tss-react": "4.9.18"
68
+ },
69
+ "resolutions": {
70
+ "cheerio": "<1.0.0",
71
+ "@mui/material": "7.1.2",
72
+ "@babel/core": "7.26.0"
73
+ },
74
+ "devDependencies": {
75
+ "@4tw/cypress-drag-drop": "2.3.0",
76
+ "@babel/core": "7.26.0",
77
+ "@babel/plugin-proposal-class-properties": "7.18.6",
78
+ "@babel/plugin-transform-runtime": "7.28.5",
79
+ "@babel/preset-env": "7.28.5",
80
+ "@babel/preset-react": "7.28.5",
81
+ "@babel/preset-typescript": "7.28.5",
82
+ "@biomejs/biome": "2.3.5",
83
+ "@parcel/transformer-inline-string": "2.8.2",
84
+ "@parcel/transformer-sass": "2.8.2",
85
+ "@parcel/transformer-svg-react": "2.8.2",
86
+ "@testing-library/react": "16.3.0",
87
+ "@types/jest": "30.0.0",
88
+ "@types/mocha": "10.0.10",
89
+ "@types/react": "19.1.0",
90
+ "@types/react-dom": "19.1.0",
91
+ "babel-jest": "29.3.1",
92
+ "babel-loader": "9.1.0",
93
+ "cheerio": "<1.0.0",
94
+ "css-loader": "6.7.3",
95
+ "cypress": "14.5.0",
96
+ "esbuild": "0.21.5",
97
+ "esbuild-sass-plugin": "2.4.4",
98
+ "html-webpack-plugin": "5.5.0",
99
+ "husky": "9.1.7",
100
+ "jest": "29.3.1",
101
+ "jest-canvas-mock": "2.4.0",
102
+ "jest-environment-jsdom": "29.3.1",
103
+ "parcel": "2.8.2",
104
+ "react-test-renderer": "18.3.1",
105
+ "sass": "1.57.1",
106
+ "sass-loader": "13.2.0",
107
+ "style-loader": "3.3.1",
108
+ "svg-inline-loader": "0.8.2",
109
+ "typescript": "5.5.4",
110
+ "webpack": "5.75.0"
111
+ },
112
+ "peerDependencies": {
113
+ "@mui/material": "7.1.2",
114
+ "react": "19.1.1",
115
+ "react-dom": "19.1.1"
116
+ }
117
+ }