@tracktor/design-system 4.3.3 → 4.5.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.
@@ -0,0 +1,75 @@
1
+ import { ChipProps } from '@mui/material';
2
+ type Option = {
3
+ id?: string | number;
4
+ label: string;
5
+ value: string;
6
+ };
7
+ interface ChipFilterBaseProps {
8
+ /**
9
+ * The label of the chip filter.
10
+ */
11
+ label?: ChipProps["label"];
12
+ /**
13
+ * The label displayed in the menu for the chip filter, only with multiple options.
14
+ */
15
+ labelMenu?: string;
16
+ /**
17
+ * The size of the chip filter.
18
+ */
19
+ size?: ChipProps["size"];
20
+ /**
21
+ * The variant of the chip filter.
22
+ */
23
+ variant?: ChipProps["variant"];
24
+ /**
25
+ * Indicates if the chip filter is disabled.
26
+ */
27
+ disabled?: ChipProps["disabled"];
28
+ /**
29
+ * The options available for selection in the chip filter.
30
+ * If "options" is not an array, it is considered a single option (toggle behavior).
31
+ */
32
+ options?: Option | Option[];
33
+ /**
34
+ * Indicates if there should be a separator between the label menu and the options selected in the menu.
35
+ * Defaults to ":"
36
+ */
37
+ separatorBetweenLabelAndOptionSelected?: string;
38
+ /**
39
+ * Indicates if the label should only be displayed after a selection is made.
40
+ */
41
+ labelOnlyAfterSelection?: boolean;
42
+ }
43
+ export interface ChipFilterSingleProps extends ChipFilterBaseProps {
44
+ /**
45
+ * Indicates if the chip filter allows multiple selections.
46
+ */
47
+ multiple?: false;
48
+ /**
49
+ * The value of the chip filter.
50
+ */
51
+ value?: string;
52
+ /**
53
+ * Callback function triggered when the value of the chip filter changes.
54
+ * @param value
55
+ */
56
+ onChange?: (value?: string) => void;
57
+ }
58
+ export interface ChipFilterMultipleProps extends ChipFilterBaseProps {
59
+ /**
60
+ * Indicates if the chip filter allows multiple selections.
61
+ */
62
+ multiple: true;
63
+ /**
64
+ * The value of the chip filter.
65
+ */
66
+ value?: string[];
67
+ /**
68
+ * Callback function triggered when the value of the chip filter changes.
69
+ * @param value
70
+ */
71
+ onChange?: (value: string[]) => void;
72
+ }
73
+ export type ChipFilterProps = ChipFilterSingleProps | ChipFilterMultipleProps;
74
+ declare const ChipFilter: ({ label, value, onChange, options, variant, disabled, labelMenu, labelOnlyAfterSelection, separatorBetweenLabelAndOptionSelected, multiple, size, }: ChipFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
75
+ export default ChipFilter;
@@ -24,6 +24,9 @@ declare module "@mui/material/Chip" {
24
24
  interface ChipPropsSizeOverrides {
25
25
  xSmall: true;
26
26
  }
27
+ interface ChipPropsColorOverrides {
28
+ active: true;
29
+ }
27
30
  }
28
31
  declare module "@mui/material/FormControlLabel" {
29
32
  interface FormControlLabelProps {
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ apply: string;
2
3
  clickToUpload: string;
3
4
  files: string;
4
5
  reset: string;
@@ -1,4 +1,5 @@
1
1
  declare const _default: {
2
+ apply: string;
2
3
  clickToUpload: string;
3
4
  files: string;
4
5
  reset: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tracktor/design-system",
3
3
  "description": "Tracktor Design System",
4
4
  "sideEffects": false,
5
- "version": "4.3.3",
5
+ "version": "4.5.0",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "types": "./dist/src/main.d.ts",