@max-ts/components 0.2.1 → 0.2.2

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.
@@ -1,4 +1,4 @@
1
- const e = (t) => t.map(({ width: n }) => n || "1fr").join(" ");
1
+ const t = (r) => r.map(({ width: n }) => typeof n == "number" ? `${n}px` : n || "1fr").join(" ");
2
2
  export {
3
- e as getGridTemplateColumns
3
+ t as getGridTemplateColumns
4
4
  };
@@ -22,4 +22,4 @@ export type SelectProps<Value> = WithoutEmotionSpecific<Omit<MuiSelectProps<Valu
22
22
  error?: boolean;
23
23
  label?: string;
24
24
  };
25
- export declare const Select: <Value>({ required, getOptionLabel, placeholder, helperText, hideHelperText, loading, success, children, disabled, error, label, fullWidth, onChange: externalOnChange, isShowClearButton, ...props }: SelectProps<Value>) => import("react/jsx-runtime").JSX.Element;
25
+ export declare function Select<Value>({ required, getOptionLabel, placeholder, helperText, hideHelperText, loading, success, children, disabled, error, label, fullWidth, onChange: externalOnChange, isShowClearButton, ...props }: SelectProps<Value>): import("react/jsx-runtime").JSX.Element;
@@ -5,25 +5,26 @@ import { FormHelperText as R } from "../FormHelperText/FormHelperText.mjs";
5
5
  import "react";
6
6
  import "../FormHelperText/FormHelperTextContent/styles.mjs";
7
7
  import { MenuItem as w } from "../MenuItem/MenuItem.mjs";
8
- import { TagsList as D } from "../TagsList/TagsList.mjs";
9
- import { ChevronDown as H, ChevronUp as M } from "lucide-react";
10
- import { CLEAR_TEXT as f } from "./constants.mjs";
11
- import { StyledSelect as N, Placeholder as U, ProgressWrapper as V, EndAdornmentWrapper as W, StyledIconButton as C, StyledCloseFillSm as X } from "./styles.mjs";
12
- import { useLogic as _ } from "./useLogic/useLogic.mjs";
13
- const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
8
+ import { TagsList as z } from "../TagsList/TagsList.mjs";
9
+ import { ChevronDown as D, ChevronUp as H } from "lucide-react";
10
+ import { CLEAR_TEXT as h } from "./constants.mjs";
11
+ import { StyledSelect as M, Placeholder as N, ProgressWrapper as U, EndAdornmentWrapper as V, StyledIconButton as C, StyledCloseFillSm as W } from "./styles.mjs";
12
+ import { useLogic as X } from "./useLogic/useLogic.mjs";
13
+ const _ = ({ onClick: s, disabled: o, ref: t }) => /* @__PURE__ */ r.jsx(
14
14
  C,
15
15
  {
16
- disabled: e,
16
+ disabled: o,
17
17
  ref: t,
18
18
  onClick: s,
19
19
  variant: "text",
20
- title: f,
21
- "aria-label": f,
22
- children: /* @__PURE__ */ r.jsx(X, {})
20
+ title: h,
21
+ "aria-label": h,
22
+ children: /* @__PURE__ */ r.jsx(W, {})
23
23
  }
24
- ), nr = ({
24
+ );
25
+ function nr({
25
26
  required: s,
26
- getOptionLabel: e = (i) => i,
27
+ getOptionLabel: o = (i) => i,
27
28
  placeholder: t,
28
29
  helperText: d,
29
30
  hideHelperText: v = !1,
@@ -31,13 +32,13 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
31
32
  success: y,
32
33
  children: c,
33
34
  disabled: l,
34
- error: p,
35
- label: u,
35
+ error: u,
36
+ label: p,
36
37
  fullWidth: x,
37
38
  onChange: n,
38
39
  isShowClearButton: g,
39
40
  ...j
40
- }) => {
41
+ }) {
41
42
  const {
42
43
  isOpened: i,
43
44
  isShowingClearButton: S,
@@ -46,16 +47,16 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
46
47
  openSelect: a,
47
48
  closeSelect: I,
48
49
  resetButtonRef: k
49
- } = _({
50
+ } = X({
50
51
  ...j,
51
52
  children: c,
52
53
  onChange: n,
53
54
  isShowClearButton: g
54
- }), B = (o) => {
55
- if (Array.isArray(o) && o.length) {
56
- const F = (h) => n?.(h ? {
55
+ }), B = (e) => {
56
+ if (Array.isArray(e) && e.length) {
57
+ const F = (f) => n?.(f ? {
57
58
  target: {
58
- value: h
59
+ value: f
59
60
  }
60
61
  } : {
61
62
  target: {
@@ -63,22 +64,22 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
63
64
  }
64
65
  }, void 0);
65
66
  return /* @__PURE__ */ r.jsx(
66
- D,
67
+ z,
67
68
  {
68
- data: o,
69
+ data: e,
69
70
  keyId: "value",
70
- getOptionLabel: e,
71
+ getOptionLabel: o,
71
72
  onChange: F,
72
73
  onClick: a
73
74
  }
74
75
  );
75
76
  }
76
- return (Array.isArray(o) || typeof o == "string") && !o.length ? t : e(o);
77
+ return (Array.isArray(e) || typeof e == "string") && !e.length ? t : o(e);
77
78
  };
78
- return /* @__PURE__ */ r.jsxs(T, { error: p, fullWidth: x, children: [
79
- u && /* @__PURE__ */ r.jsx(L, { htmlFor: "grouped-select", required: s, children: u }),
79
+ return /* @__PURE__ */ r.jsxs(T, { error: u, fullWidth: x, children: [
80
+ p && /* @__PURE__ */ r.jsx(L, { htmlFor: "grouped-select", required: s, children: p }),
80
81
  /* @__PURE__ */ r.jsxs(
81
- N,
82
+ M,
82
83
  {
83
84
  ...j,
84
85
  open: i,
@@ -90,9 +91,9 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
90
91
  displayEmpty: !0,
91
92
  fullWidth: x,
92
93
  onChange: n,
93
- endAdornment: /* @__PURE__ */ r.jsxs(W, { children: [
94
+ endAdornment: /* @__PURE__ */ r.jsxs(V, { children: [
94
95
  S && /* @__PURE__ */ r.jsx(
95
- q,
96
+ _,
96
97
  {
97
98
  disabled: l,
98
99
  ref: k,
@@ -105,21 +106,21 @@ const q = ({ onClick: s, disabled: e, ref: t }) => /* @__PURE__ */ r.jsx(
105
106
  variant: "text",
106
107
  disabled: l,
107
108
  onClick: a,
108
- children: i ? /* @__PURE__ */ r.jsx(M, {}) : /* @__PURE__ */ r.jsx(H, {})
109
+ children: i ? /* @__PURE__ */ r.jsx(H, { size: 16 }) : /* @__PURE__ */ r.jsx(D, { size: 16 })
109
110
  }
110
111
  )
111
112
  ] }),
112
113
  children: [
113
- /* @__PURE__ */ r.jsx(U, { value: "", children: t }),
114
- m && /* @__PURE__ */ r.jsx(V, { children: /* @__PURE__ */ r.jsx(P, { color: "primary" }) }),
114
+ /* @__PURE__ */ r.jsx(N, { value: "", children: t }),
115
+ m && /* @__PURE__ */ r.jsx(U, { children: /* @__PURE__ */ r.jsx(P, { color: "primary" }) }),
115
116
  !m && c,
116
117
  !m && A && /* @__PURE__ */ r.jsx(w, { disabled: !0, children: "Нет данных" })
117
118
  ]
118
119
  }
119
120
  ),
120
- !v && /* @__PURE__ */ r.jsx(R, { error: p, success: y, children: d })
121
+ !v && /* @__PURE__ */ r.jsx(R, { error: u, success: y, children: d })
121
122
  ] });
122
- };
123
+ }
123
124
  export {
124
125
  nr as Select
125
126
  };
@@ -19,5 +19,5 @@ export declare const StyledIconButton: import('@emotion/styled').StyledComponent
19
19
  loading?: boolean;
20
20
  } & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
21
21
  export declare const StyledCloseFillSm: import('@emotion/styled').StyledComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
22
- export declare const EndAdornmentWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
+ export declare const EndAdornmentWrapper: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
23
23
  export declare const StyledSelect: typeof Select;
@@ -1,8 +1,8 @@
1
1
  import { styled as t, selectClasses as r, Select as o } from "@mui/material";
2
2
  import { CircleX as n } from "lucide-react";
3
- import { IconButton as l } from "../IconButton/IconButton.mjs";
4
- import { MenuItem as i } from "../MenuItem/MenuItem.mjs";
5
- const d = t("div")`
3
+ import { IconButton as i } from "../IconButton/IconButton.mjs";
4
+ import { MenuItem as l } from "../MenuItem/MenuItem.mjs";
5
+ const c = t("div")`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
@@ -14,16 +14,17 @@ const d = t("div")`
14
14
 
15
15
  color: ${({ theme: e }) => e.palette.grey[900]};
16
16
  }
17
- `, g = t(i)`
17
+ `, g = t(l)`
18
18
  display: none;
19
- `, m = t(l)`
20
- background-color: transparent;
21
-
19
+ `, m = t(i)`
20
+ padding: 0;
21
+ svg {
22
+ stroke: ${({ theme: e }) => e.palette.grey[600]};
23
+ }
22
24
  &:hover {
23
25
  background-color: transparent;
24
-
25
26
  svg {
26
- fill: ${({ theme: e }) => e.palette.grey[700]};
27
+ stroke: ${({ theme: e }) => e.palette.grey[700]};
27
28
  }
28
29
  }
29
30
 
@@ -34,23 +35,24 @@ const d = t("div")`
34
35
  `, h = t(n)`
35
36
  width: 16px;
36
37
  height: 16px;
37
-
38
- fill: ${({ theme: e }) => e.palette.grey[500]};
39
- `, f = t("div")`
38
+ padding: 0;
39
+ `, y = t("div", {
40
+ label: "EndAdornmentWrapper"
41
+ })`
40
42
  display: flex;
41
43
  align-items: center;
42
44
 
43
45
  margin-left: auto;
44
- `, y = t(o)`
46
+ `, x = t(o)`
45
47
  .${r.select} {
46
48
  padding-right: ${({ theme: e }) => e.spacing(2)} !important;
47
49
  }
48
50
  `;
49
51
  export {
50
- f as EndAdornmentWrapper,
52
+ y as EndAdornmentWrapper,
51
53
  g as Placeholder,
52
- d as ProgressWrapper,
54
+ c as ProgressWrapper,
53
55
  h as StyledCloseFillSm,
54
56
  m as StyledIconButton,
55
- y as StyledSelect
57
+ x as StyledSelect
56
58
  };
@@ -164,8 +164,8 @@ const f = {
164
164
  }
165
165
 
166
166
  .MuiChip-deleteIcon {
167
- width: 20px;
168
- height: 20px;
167
+ width: 16px;
168
+ height: 16px;
169
169
  margin: 0;
170
170
 
171
171
  color: ${c};
@@ -1,16 +1,16 @@
1
- import { componentsColors as F } from "./componentsColors/componentsColors.mjs";
1
+ import { componentsColors as r } from "./componentsColors/componentsColors.mjs";
2
2
  const t = () => {
3
- const r = {
3
+ const F = {
4
4
  primary: {
5
- 900: "#0F52B8",
6
- 800: "#2165CC",
7
- 700: "#1874FF",
8
- 600: "#2684FF",
9
- 500: "#4C9AFF",
10
- 400: "#70AEFF",
11
- 300: "#94C2FF",
12
- 200: "#C5DCFF",
13
- 100: "#E1EDFF"
5
+ 900: "#213555",
6
+ 800: "#2B3E6F",
7
+ 700: "#3F51B5",
8
+ 600: "#4C6FFF",
9
+ 500: "#5F7DFF",
10
+ 400: "#7C98FF",
11
+ 300: "#99B2FF",
12
+ 200: "#B7CCFF",
13
+ 100: "#D0E1FF"
14
14
  },
15
15
  secondary: {
16
16
  800: "#55B8F0"
@@ -62,16 +62,16 @@ const t = () => {
62
62
  100: "#F0F4F7"
63
63
  },
64
64
  primary: {
65
- main: r.primary[800],
66
- dark: r.primary[900],
65
+ main: F.primary[800],
66
+ dark: F.primary[900],
67
67
  contrastText: "#FFF",
68
- ...r.primary
68
+ ...F.primary
69
69
  },
70
70
  secondary: {
71
- main: r.secondary[800],
72
- dark: r.primary[900],
71
+ main: F.secondary[800],
72
+ dark: F.primary[900],
73
73
  contrastText: "#FFF",
74
- ...r.secondary
74
+ ...F.secondary
75
75
  },
76
76
  background: {
77
77
  default: "#FFF",
@@ -117,7 +117,7 @@ const t = () => {
117
117
  contrastText: "#FFF"
118
118
  };
119
119
  },
120
- components: F
120
+ components: r
121
121
  };
122
122
  };
123
123
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-ts/components",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "browser": "./src/index.ts",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",