@pautena/react-design-system 0.18.0 → 0.19.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 (42) hide show
  1. package/dist/action/action.d.ts +42 -0
  2. package/dist/autocomplete/autocomplete.d.ts +28 -0
  3. package/dist/board/board.d.ts +17 -0
  4. package/dist/bootstrap-dialog/bootstrap-dialog.d.ts +3 -0
  5. package/dist/center-container/center-container.d.ts +20 -4
  6. package/dist/confirm-dialog/confirm-dialog.d.ts +21 -1
  7. package/dist/content/content.d.ts +3 -0
  8. package/dist/content-placeholder/content-placeholder.d.ts +12 -0
  9. package/dist/date-range-calendar/date-range-calendar.d.ts +15 -0
  10. package/dist/date-range-picker/date-range-picker.d.ts +28 -0
  11. package/dist/dialog/dialog.types.d.ts +70 -0
  12. package/dist/drawerx/drawer/drawer.d.ts +3 -0
  13. package/dist/drawerx/drawer-app-bar/drawer-app-bar.d.ts +6 -0
  14. package/dist/drawerx/drawer-item/drawer-item.d.ts +3 -0
  15. package/dist/drawerx/drawer-layout/drawer-layout.d.ts +50 -3
  16. package/dist/drawerx/drawer-subheader/drawer-subheader.d.ts +3 -0
  17. package/dist/drawerx/drawer.types.d.ts +4 -6
  18. package/dist/enhanced-remote-table/enhanced-remote-table.d.ts +34 -0
  19. package/dist/enhanced-table/enhanced-table.d.ts +40 -2
  20. package/dist/form-dialog/form-dialog.d.ts +23 -1
  21. package/dist/group-value-card/group-value-card.d.ts +22 -0
  22. package/dist/header/header.d.ts +2 -2
  23. package/dist/header/header.types.d.ts +1 -3
  24. package/dist/header-layout/header-layout.d.ts +74 -6
  25. package/dist/index.cjs.js +103 -103
  26. package/dist/index.cjs.js.map +1 -1
  27. package/dist/index.d.ts +0 -1
  28. package/dist/index.es.js +4581 -4803
  29. package/dist/index.es.js.map +1 -1
  30. package/dist/list-panel/list-panel.d.ts +18 -0
  31. package/dist/model-form/model-form.d.ts +5 -0
  32. package/dist/object-details/object-details.d.ts +4 -0
  33. package/dist/search-input/search-input.d.ts +41 -0
  34. package/dist/select/select.d.ts +42 -0
  35. package/dist/skeleton-card/skeleton-card.d.ts +12 -0
  36. package/dist/skeleton-grid/skeleton-grid.d.ts +12 -0
  37. package/dist/table-list/table-list.d.ts +3 -0
  38. package/dist/text-field/text-field.d.ts +18 -0
  39. package/dist/value-item/value-item.d.ts +3 -0
  40. package/package.json +15 -16
  41. package/dist/sign-in/index.d.ts +0 -1
  42. package/dist/sign-in/sign-in.d.ts +0 -8
@@ -7,10 +7,28 @@ export interface ListPanelItem {
7
7
  path?: string;
8
8
  }
9
9
  export type ListPanelProps = PropsWithChildren<{
10
+ /**
11
+ * The ID of the item that should be selected by default.
12
+ */
10
13
  defaultSelectedItem?: string;
14
+ /**
15
+ * The list of items to be displayed in the panel.
16
+ */
11
17
  items: ListPanelItem[];
18
+ /**
19
+ * The mode of the list, either "panel" or "navigation".
20
+ */
12
21
  listMode?: "panel" | "navigation";
22
+ /**
23
+ * The breakpoint for column layout.
24
+ */
13
25
  colBreakpoint?: number;
26
+ /**
27
+ * Callback function that is called when the selected item changes.
28
+ */
14
29
  onSelectedItemChange?: (id: string) => void;
15
30
  }>;
31
+ /**
32
+ * ListPanel component renders a panel with a list of items and a content area.
33
+ */
16
34
  export declare const ListPanel: ({ items, defaultSelectedItem, colBreakpoint, listMode, children, onSelectedItemChange, }: ListPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,4 +6,9 @@ export interface ModelFormProps<T extends BasicModelInstance> {
6
6
  saveButtonText: string;
7
7
  onSubmit: (values: T) => void;
8
8
  }
9
+ /**
10
+ *
11
+ * ModelForm component is a generic form component for handling model-based forms.
12
+ * It renders form fields based on the provided model and handles form submission.
13
+ */
9
14
  export declare const ModelForm: <T extends BasicModelInstance>({ model, saveButtonText, dense, onSubmit, initialValues, }: ModelFormProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -4,4 +4,8 @@ export interface ObjectDetailsProps<T extends BasicModelInstance> {
4
4
  dense?: boolean;
5
5
  instance: T;
6
6
  }
7
+ /**
8
+ * ObjectDetails component renders detailed information about a given instance of a model.
9
+ * It supports rendering various types of fields including single values, groups, and arrays of groups.
10
+ */
7
11
  export declare const ObjectDetails: <T extends BasicModelInstance>({ model, instance, dense, }: ObjectDetailsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -6,14 +6,55 @@ export interface SearchFilter {
6
6
  type: "text" | "number" | "boolean" | "datetime";
7
7
  }
8
8
  export interface SearchInputProps<T> {
9
+ /**
10
+ * The label for the search input.
11
+ */
9
12
  label?: string;
13
+ /**
14
+ * The placeholder text for the search input.
15
+ */
10
16
  placeholder?: string;
17
+ /**
18
+ * If true, the search input will take up the full width of its container.
19
+ */
11
20
  fullWidth?: boolean;
21
+ /**
22
+ * Helper text to display below the search input.
23
+ */
12
24
  helperText?: string;
25
+ /**
26
+ * The size of the search input.
27
+ */
13
28
  size?: SearchInputSize;
29
+ /**
30
+ * An array of filters to apply to the search.
31
+ */
14
32
  filters?: SearchFilter[];
33
+ /**
34
+ * The system prop that allows defining system overrides and additional CSS styles.
35
+ */
15
36
  sx?: SxProps<Theme>;
37
+ /**
38
+ * The format to use for date inputs.
39
+ */
16
40
  dateFormat?: string;
41
+ /**
42
+ * Callback function to handle the search action.
43
+ */
17
44
  onSearch: (data: T) => void;
18
45
  }
46
+ export interface SearchInputProps<T> {
47
+ label?: string;
48
+ placeholder?: string;
49
+ fullWidth?: boolean;
50
+ helperText?: string;
51
+ size?: SearchInputSize;
52
+ filters?: SearchFilter[];
53
+ sx?: SxProps<Theme>;
54
+ dateFormat?: string;
55
+ onSearch: (data: T) => void;
56
+ }
57
+ /**
58
+ * A generic search input component that supports various types of filters.
59
+ */
19
60
  export declare const SearchInput: <T>({ label, placeholder, helperText, size, fullWidth, dateFormat, filters, onSearch, sx, }: SearchInputProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -2,14 +2,56 @@ import { ReactNode } from 'react';
2
2
  import { SelectInputProps } from '@mui/material/Select/SelectInput';
3
3
  export type SelectSize = "small" | "medium";
4
4
  export interface SelectProps<T> {
5
+ /**
6
+ * The label for the select input.
7
+ */
5
8
  label: string;
9
+ /**
10
+ * The selected value.
11
+ */
6
12
  value: T;
13
+ /**
14
+ * If true, the select input is in a loading state.
15
+ */
7
16
  loading?: boolean;
17
+ /**
18
+ * If true, the select input is in a fetching state.
19
+ */
8
20
  fetching?: boolean;
21
+ /**
22
+ * The size of the select input.
23
+ */
9
24
  size?: SelectSize;
25
+ /**
26
+ * The color of the select input.
27
+ */
10
28
  color?: string;
29
+ /**
30
+ * If true, the select input takes up the full width of its container.
31
+ */
11
32
  fullWidth?: boolean;
33
+ /**
34
+ * The child elements to be rendered within the select input.
35
+ */
12
36
  children?: ReactNode;
37
+ /**
38
+ * The callback function to handle changes to the select input.
39
+ */
13
40
  onChange?: SelectInputProps<T>["onChange"];
14
41
  }
42
+ export interface SelectProps<T> {
43
+ label: string;
44
+ value: T;
45
+ loading?: boolean;
46
+ fetching?: boolean;
47
+ size?: SelectSize;
48
+ color?: string;
49
+ fullWidth?: boolean;
50
+ children?: ReactNode;
51
+ onChange?: SelectInputProps<T>["onChange"];
52
+ }
53
+ /**
54
+ * A custom Select component that extends the functionality of the Material-UI Select component.
55
+ * This component supports additional features such as loading and fetching states, custom colors, and full-width display.
56
+ */
15
57
  export declare const Select: <T extends ReactNode>({ label, value, loading, fetching, size, fullWidth, color, children, onChange, }: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,17 @@
1
+ /**
2
+ * Props for the SkeletonCard component.
3
+ */
1
4
  export interface SkeletonCardProps {
5
+ /**
6
+ * The width of the skeleton card. Can be a number (interpreted as pixels) or a string (e.g., "100%", "50px").
7
+ */
2
8
  width?: number | string;
9
+ /**
10
+ * The animation style for the skeleton card. Can be "pulse", "wave", or false to disable animation.
11
+ */
3
12
  animation?: "pulse" | "wave" | false;
4
13
  }
14
+ /**
15
+ * SkeletonCard component renders a skeleton loading placeholder for a card.
16
+ */
5
17
  export declare const SkeletonCard: ({ width, animation }: SkeletonCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,16 @@
1
+ /**
2
+ * Props for the SkeletonGrid component.
3
+ */
1
4
  export interface SkeletonGridProps {
5
+ /**
6
+ * Optional size of the skeleton grid.
7
+ */
2
8
  size?: number;
3
9
  }
10
+ export interface SkeletonGridProps {
11
+ size?: number;
12
+ }
13
+ /**
14
+ * SkeletonGrid component renders a grid of skeleton cards.
15
+ */
4
16
  export declare const SkeletonGrid: ({ size }: SkeletonGridProps) => import("react/jsx-runtime").JSX.Element;
@@ -15,4 +15,7 @@ export interface TableListProps<T extends BasicModelInstance> {
15
15
  options?: TableRowOption<T>[];
16
16
  onClick?: (d: T) => void;
17
17
  }
18
+ /**
19
+ * TableList component renders a list about a given instances of a model.
20
+ */
18
21
  export declare const TableList: <T extends BasicModelInstance>({ columns: columnsProp, options, data, onClick, search, defaultSort, defaultOrder, loading, }: TableListProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,25 @@
1
1
  import { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
2
+ /**
3
+ * Props for the TextField component.
4
+ *
5
+ * @extends MuiTextFieldProps
6
+ */
2
7
  export type TextFieldProps = MuiTextFieldProps & {
8
+ /**
9
+ * Indicates if the field is in a fetching state.
10
+ */
3
11
  fetching?: boolean;
12
+ /**
13
+ * Indicates if the field is in a loading state.
14
+ */
4
15
  loading?: boolean;
16
+ /**
17
+ * Optional hex color code for the text field.
18
+ */
5
19
  hexColor?: string;
6
20
  };
21
+ /**
22
+ * A customizable TextField component that extends the functionality of the Material-UI TextField component
23
+ * and supports various props for styling and functionality.
24
+ */
7
25
  export declare const TextField: ({ id: overrideId, label, InputLabelProps, InputProps, fetching, loading, helperText, hexColor, size, fullWidth, sx, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -10,4 +10,7 @@ export declare const valueItemClasses: {
10
10
  root: string;
11
11
  content: string;
12
12
  };
13
+ /**
14
+ * `ValueItem` is a component to wrap your value components
15
+ */
13
16
  export declare const ValueItem: ValueItemComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pautena/react-design-system",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "My custom design system on top of MUI",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -23,7 +23,7 @@
23
23
  "format": "npm-run-all format:*",
24
24
  "format:js": "prettier --write \"**/*.js\"",
25
25
  "format:json": "prettier --write \"**/*.json\"",
26
- "format:md": "prettier --write \"**/*.md\"",
26
+ "format:md": "prettier --write \"**/*.md{,x}\"",
27
27
  "format:ts": "prettier --write \"**/*.ts{,x}\""
28
28
  },
29
29
  "keywords": [
@@ -51,22 +51,21 @@
51
51
  "@babel/preset-env": "^7.26.9",
52
52
  "@babel/preset-react": "^7.26.3",
53
53
  "@babel/preset-typescript": "^7.26.0",
54
+ "@chromatic-com/storybook": "^3.2.5",
54
55
  "@eslint/eslintrc": "^3.3.0",
55
56
  "@eslint/js": "^9.21.0",
56
57
  "@faker-js/faker": "^9.5.0",
57
58
  "@mui/x-data-grid-generator": "^7.27.0",
58
- "@storybook/addon-actions": "^8.6.0-beta.7",
59
- "@storybook/addon-essentials": "^8.6.0-beta.7",
60
- "@storybook/addon-interactions": "^8.6.0-beta.7",
61
- "@storybook/addon-knobs": "^8.0.1",
62
- "@storybook/addon-links": "^8.6.0-beta.7",
63
- "@storybook/addon-mdx-gfm": "^8.6.0-beta.7",
64
- "@storybook/addon-webpack5-compiler-babel": "^3.0.5",
65
- "@storybook/react": "^8.6.0-beta.7",
66
- "@storybook/react-webpack5": "^8.6.0-beta.7",
67
- "@storybook/test": "^8.6.0-beta.7",
68
- "@storybook/testing-react": "^2.0.1",
69
- "@storybook/types": "^8.6.0-beta.7",
59
+ "@storybook/addon-docs": "^8.6.4",
60
+ "@storybook/addon-essentials": "^8.6.4",
61
+ "@storybook/addon-interactions": "^8.6.4",
62
+ "@storybook/addon-links": "^8.6.4",
63
+ "@storybook/addon-onboarding": "^8.6.4",
64
+ "@storybook/addon-themes": "^8.6.4",
65
+ "@storybook/blocks": "^8.6.4",
66
+ "@storybook/react": "^8.6.4",
67
+ "@storybook/react-vite": "^8.6.4",
68
+ "@storybook/test": "^8.6.4",
70
69
  "@testing-library/jest-dom": "^6.6.3",
71
70
  "@testing-library/react": "^16.2.0",
72
71
  "@testing-library/user-event": "^14.6.1",
@@ -74,7 +73,7 @@
74
73
  "@types/react": "^19.0.10",
75
74
  "@typescript-eslint/eslint-plugin": "^8.24.1",
76
75
  "@typescript-eslint/parser": "^8.24.1",
77
- "babel-loader": "^9.2.1",
76
+ "babel-loader": "^10.0.0",
78
77
  "babel-plugin-module-resolver": "^5.0.2",
79
78
  "eslint": "^9.21.0",
80
79
  "eslint-config-prettier": "^10.0.1",
@@ -90,7 +89,7 @@
90
89
  "prettier": "^3.5.2",
91
90
  "ramda": "^0.30.1",
92
91
  "react-test-renderer": "^19.0.0",
93
- "storybook": "^8.6.0-beta.7",
92
+ "storybook": "^8.6.0",
94
93
  "tslib": "^2.8.1",
95
94
  "typescript": "^5.7.3",
96
95
  "vite": "^6.1.1",
@@ -1 +0,0 @@
1
- export * from './sign-in';
@@ -1,8 +0,0 @@
1
- export interface SignInProps {
2
- title: string;
3
- subtitle: string;
4
- error?: Error;
5
- loading?: boolean;
6
- onSubmitSignIn: (email: string, password: string) => void;
7
- }
8
- export declare const SignIn: ({ title, subtitle, loading, error, onSubmitSignIn }: SignInProps) => import("react/jsx-runtime").JSX.Element;