mayak-common-library 0.0.40 → 0.0.42
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.
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +54 -3
- package/dist/index.mjs +53 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -19,6 +19,8 @@ import { PatternFormatProps } from 'react-number-format/types/types';
|
|
|
19
19
|
import { UseControllerProps } from 'react-hook-form';
|
|
20
20
|
export { default as MapIcon } from '@/icons/map-search.svg';
|
|
21
21
|
import { ListProps } from '@mui/material/List/List';
|
|
22
|
+
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
23
|
+
import { FormControlLabelProps as FormControlLabelProps$1 } from '@mui/material/FormControlLabel/FormControlLabel';
|
|
22
24
|
|
|
23
25
|
declare function Greet(props: {
|
|
24
26
|
name: string;
|
|
@@ -50,6 +52,7 @@ interface SelectProProps {
|
|
|
50
52
|
small?: boolean;
|
|
51
53
|
fullWidth?: boolean;
|
|
52
54
|
freeChildWidth?: boolean;
|
|
55
|
+
isOpen?: boolean;
|
|
53
56
|
}
|
|
54
57
|
declare const SelectPro: FC<PropsWithChildren & SelectProProps>;
|
|
55
58
|
|
|
@@ -234,4 +237,12 @@ interface ToggleButtonGroupProps extends ToggleButtonGroupProps$1 {
|
|
|
234
237
|
}
|
|
235
238
|
declare const ToggleButtonGroup: FC<ToggleButtonGroupProps & PropsWithChildren>;
|
|
236
239
|
|
|
237
|
-
|
|
240
|
+
interface CustomCheckboxProps {
|
|
241
|
+
labelProps?: FormControlLabelProps$1;
|
|
242
|
+
checkboxProps?: CheckboxProps;
|
|
243
|
+
label?: string;
|
|
244
|
+
toggleView?: boolean;
|
|
245
|
+
}
|
|
246
|
+
declare const CustomCheckbox: FC<CustomCheckboxProps>;
|
|
247
|
+
|
|
248
|
+
export { AppBar, ArticleCard, Autocomplete, CustomAvatar as Avatar, CustomBadge as Badge, BigNumber, Button, CategoryCard, CustomCheckbox as Checkbox, CustomChip as Chip, FromToInput, Greet, IconButton, ImageContainer, CustomInput as Input, JobCard, List, ListItem, CustomMenuItem as MenuItem, PhoneInput, Providers, CustomRadio as Radio, CustomRadioGroup as RadioGroup, RealtorCard, RealtyCard, SearchInput, CustomSelect as Select, SelectPro, CustomSlider as Slider, CustomSwitch as Switch, TeamPersonCard, Text, TextBlock, TitleBlock, ToggleButton, ToggleButtonGroup, ToggleButtonsWithLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ import { PatternFormatProps } from 'react-number-format/types/types';
|
|
|
19
19
|
import { UseControllerProps } from 'react-hook-form';
|
|
20
20
|
export { default as MapIcon } from '@/icons/map-search.svg';
|
|
21
21
|
import { ListProps } from '@mui/material/List/List';
|
|
22
|
+
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
23
|
+
import { FormControlLabelProps as FormControlLabelProps$1 } from '@mui/material/FormControlLabel/FormControlLabel';
|
|
22
24
|
|
|
23
25
|
declare function Greet(props: {
|
|
24
26
|
name: string;
|
|
@@ -50,6 +52,7 @@ interface SelectProProps {
|
|
|
50
52
|
small?: boolean;
|
|
51
53
|
fullWidth?: boolean;
|
|
52
54
|
freeChildWidth?: boolean;
|
|
55
|
+
isOpen?: boolean;
|
|
53
56
|
}
|
|
54
57
|
declare const SelectPro: FC<PropsWithChildren & SelectProProps>;
|
|
55
58
|
|
|
@@ -234,4 +237,12 @@ interface ToggleButtonGroupProps extends ToggleButtonGroupProps$1 {
|
|
|
234
237
|
}
|
|
235
238
|
declare const ToggleButtonGroup: FC<ToggleButtonGroupProps & PropsWithChildren>;
|
|
236
239
|
|
|
237
|
-
|
|
240
|
+
interface CustomCheckboxProps {
|
|
241
|
+
labelProps?: FormControlLabelProps$1;
|
|
242
|
+
checkboxProps?: CheckboxProps;
|
|
243
|
+
label?: string;
|
|
244
|
+
toggleView?: boolean;
|
|
245
|
+
}
|
|
246
|
+
declare const CustomCheckbox: FC<CustomCheckboxProps>;
|
|
247
|
+
|
|
248
|
+
export { AppBar, ArticleCard, Autocomplete, CustomAvatar as Avatar, CustomBadge as Badge, BigNumber, Button, CategoryCard, CustomCheckbox as Checkbox, CustomChip as Chip, FromToInput, Greet, IconButton, ImageContainer, CustomInput as Input, JobCard, List, ListItem, CustomMenuItem as MenuItem, PhoneInput, Providers, CustomRadio as Radio, CustomRadioGroup as RadioGroup, RealtorCard, RealtyCard, SearchInput, CustomSelect as Select, SelectPro, CustomSlider as Slider, CustomSwitch as Switch, TeamPersonCard, Text, TextBlock, TitleBlock, ToggleButton, ToggleButtonGroup, ToggleButtonsWithLabel };
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __export(src_exports, {
|
|
|
67
67
|
BigNumber: () => BigNumber_default,
|
|
68
68
|
Button: () => Button_default,
|
|
69
69
|
CategoryCard: () => CategoryCard_default,
|
|
70
|
+
Checkbox: () => Checkbox_default,
|
|
70
71
|
Chip: () => Chip_default,
|
|
71
72
|
FromToInput: () => FromToInput_default,
|
|
72
73
|
Greet: () => Greet,
|
|
@@ -301,11 +302,13 @@ var SelectPro = ({
|
|
|
301
302
|
overButton = false,
|
|
302
303
|
small = false,
|
|
303
304
|
fullWidth = false,
|
|
304
|
-
freeChildWidth = false
|
|
305
|
+
freeChildWidth = false,
|
|
306
|
+
isOpen
|
|
305
307
|
}) => {
|
|
306
308
|
const [btn, setAnchorEl] = (0, import_react2.useState)(null);
|
|
307
309
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
308
310
|
const handleClick = (event) => {
|
|
311
|
+
if (isOpen) return;
|
|
309
312
|
event.persist();
|
|
310
313
|
if (open)
|
|
311
314
|
setTimeout(() => {
|
|
@@ -315,6 +318,7 @@ var SelectPro = ({
|
|
|
315
318
|
setOpen(!open);
|
|
316
319
|
};
|
|
317
320
|
const handleClose = () => {
|
|
321
|
+
if (isOpen) return;
|
|
318
322
|
setOpen(false);
|
|
319
323
|
setTimeout(() => {
|
|
320
324
|
setAnchorEl(null);
|
|
@@ -667,8 +671,8 @@ var SearchInput = (props) => {
|
|
|
667
671
|
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material12.Stack, { direction: "row", alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material12.InputAdornment, { position: "start", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(search_default, {}) }) }),
|
|
668
672
|
disableUnderline: true,
|
|
669
673
|
placeholder: "\u041F\u043E\u0448\u0443\u043A \u043F\u043E \u0440\u0430\u0439\u043E\u043D\u0443, \u0432\u0443\u043B\u0438\u0446\u0456, \u0416\u041A",
|
|
670
|
-
className: `w-full border rounded-none border-solid normal-case text-accent-dark hover:bg-white
|
|
671
|
-
${collapse ? "bg-white border-transparent" : "
|
|
674
|
+
className: `w-full border rounded-none border-solid normal-case text-accent-dark hover:bg-white gap-x-2 px-5 h-[38px]
|
|
675
|
+
${collapse ? "bg-white border-transparent" : "border-accent-beige"} `
|
|
672
676
|
})
|
|
673
677
|
);
|
|
674
678
|
};
|
|
@@ -1341,6 +1345,52 @@ var ToggleButtonsWithLabel = (props) => {
|
|
|
1341
1345
|
] });
|
|
1342
1346
|
};
|
|
1343
1347
|
var ToggleButtonsWithLabel_default = ToggleButtonsWithLabel;
|
|
1348
|
+
|
|
1349
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
1350
|
+
var import_Checkbox = __toESM(require("@mui/material/Checkbox"));
|
|
1351
|
+
var import_material31 = require("@mui/material");
|
|
1352
|
+
var import_Typography9 = __toESM(require("@mui/material/Typography"));
|
|
1353
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1354
|
+
var BpIcon = (0, import_material31.styled)("span")(() => ({
|
|
1355
|
+
width: 16,
|
|
1356
|
+
height: 16,
|
|
1357
|
+
backgroundColor: "white"
|
|
1358
|
+
}));
|
|
1359
|
+
var BpCheckedIcon = (0, import_material31.styled)(BpIcon)({
|
|
1360
|
+
"&::before": {
|
|
1361
|
+
width: 16,
|
|
1362
|
+
height: 16,
|
|
1363
|
+
display: "flex",
|
|
1364
|
+
alignItems: "center",
|
|
1365
|
+
justifyContent: "center",
|
|
1366
|
+
content: `url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3.66667L4.82353 8L11 1' stroke='%23343434' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
var CustomCheckbox = (props) => {
|
|
1370
|
+
const { label, labelProps, checkboxProps, toggleView = false } = props;
|
|
1371
|
+
if (label)
|
|
1372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1373
|
+
import_material31.FormControlLabel,
|
|
1374
|
+
__spreadProps(__spreadValues({
|
|
1375
|
+
className: `w-fit bg-accent-silver px-3 py-0.5 ml-0 ${toggleView ? "gap-0" : "gap-x-1"} ${(checkboxProps == null ? void 0 : checkboxProps.checked) && toggleView && "!bg-accent-beige"}`,
|
|
1376
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1377
|
+
import_Checkbox.default,
|
|
1378
|
+
__spreadProps(__spreadValues({}, checkboxProps), {
|
|
1379
|
+
className: "p-0",
|
|
1380
|
+
disableRipple: true,
|
|
1381
|
+
color: "default",
|
|
1382
|
+
checkedIcon: toggleView ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(BpCheckedIcon, {}),
|
|
1383
|
+
icon: toggleView ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, {}) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(BpIcon, {})
|
|
1384
|
+
})
|
|
1385
|
+
)
|
|
1386
|
+
}, labelProps), {
|
|
1387
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_Typography9.default, { className: "text-xs leading-6", children: label }),
|
|
1388
|
+
labelPlacement: "start"
|
|
1389
|
+
})
|
|
1390
|
+
);
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_Checkbox.default, __spreadValues({}, checkboxProps));
|
|
1392
|
+
};
|
|
1393
|
+
var Checkbox_default = CustomCheckbox;
|
|
1344
1394
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1345
1395
|
0 && (module.exports = {
|
|
1346
1396
|
AppBar,
|
|
@@ -1351,6 +1401,7 @@ var ToggleButtonsWithLabel_default = ToggleButtonsWithLabel;
|
|
|
1351
1401
|
BigNumber,
|
|
1352
1402
|
Button,
|
|
1353
1403
|
CategoryCard,
|
|
1404
|
+
Checkbox,
|
|
1354
1405
|
Chip,
|
|
1355
1406
|
FromToInput,
|
|
1356
1407
|
Greet,
|
package/dist/index.mjs
CHANGED
|
@@ -242,11 +242,13 @@ var SelectPro = ({
|
|
|
242
242
|
overButton = false,
|
|
243
243
|
small = false,
|
|
244
244
|
fullWidth = false,
|
|
245
|
-
freeChildWidth = false
|
|
245
|
+
freeChildWidth = false,
|
|
246
|
+
isOpen
|
|
246
247
|
}) => {
|
|
247
248
|
const [btn, setAnchorEl] = useState2(null);
|
|
248
249
|
const [open, setOpen] = useState2(false);
|
|
249
250
|
const handleClick = (event) => {
|
|
251
|
+
if (isOpen) return;
|
|
250
252
|
event.persist();
|
|
251
253
|
if (open)
|
|
252
254
|
setTimeout(() => {
|
|
@@ -256,6 +258,7 @@ var SelectPro = ({
|
|
|
256
258
|
setOpen(!open);
|
|
257
259
|
};
|
|
258
260
|
const handleClose = () => {
|
|
261
|
+
if (isOpen) return;
|
|
259
262
|
setOpen(false);
|
|
260
263
|
setTimeout(() => {
|
|
261
264
|
setAnchorEl(null);
|
|
@@ -608,8 +611,8 @@ var SearchInput = (props) => {
|
|
|
608
611
|
startAdornment: /* @__PURE__ */ jsx20(Stack3, { direction: "row", alignItems: "center", children: /* @__PURE__ */ jsx20(InputAdornment2, { position: "start", children: /* @__PURE__ */ jsx20(search_default, {}) }) }),
|
|
609
612
|
disableUnderline: true,
|
|
610
613
|
placeholder: "\u041F\u043E\u0448\u0443\u043A \u043F\u043E \u0440\u0430\u0439\u043E\u043D\u0443, \u0432\u0443\u043B\u0438\u0446\u0456, \u0416\u041A",
|
|
611
|
-
className: `w-full border rounded-none border-solid normal-case text-accent-dark hover:bg-white
|
|
612
|
-
${collapse ? "bg-white border-transparent" : "
|
|
614
|
+
className: `w-full border rounded-none border-solid normal-case text-accent-dark hover:bg-white gap-x-2 px-5 h-[38px]
|
|
615
|
+
${collapse ? "bg-white border-transparent" : "border-accent-beige"} `
|
|
613
616
|
})
|
|
614
617
|
);
|
|
615
618
|
};
|
|
@@ -1294,6 +1297,52 @@ var ToggleButtonsWithLabel = (props) => {
|
|
|
1294
1297
|
] });
|
|
1295
1298
|
};
|
|
1296
1299
|
var ToggleButtonsWithLabel_default = ToggleButtonsWithLabel;
|
|
1300
|
+
|
|
1301
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
1302
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
1303
|
+
import { FormControlLabel as FormControlLabel2, styled as styled11 } from "@mui/material";
|
|
1304
|
+
import Typography18 from "@mui/material/Typography";
|
|
1305
|
+
import { Fragment as Fragment5, jsx as jsx47 } from "react/jsx-runtime";
|
|
1306
|
+
var BpIcon = styled11("span")(() => ({
|
|
1307
|
+
width: 16,
|
|
1308
|
+
height: 16,
|
|
1309
|
+
backgroundColor: "white"
|
|
1310
|
+
}));
|
|
1311
|
+
var BpCheckedIcon = styled11(BpIcon)({
|
|
1312
|
+
"&::before": {
|
|
1313
|
+
width: 16,
|
|
1314
|
+
height: 16,
|
|
1315
|
+
display: "flex",
|
|
1316
|
+
alignItems: "center",
|
|
1317
|
+
justifyContent: "center",
|
|
1318
|
+
content: `url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3.66667L4.82353 8L11 1' stroke='%23343434' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")`
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
var CustomCheckbox = (props) => {
|
|
1322
|
+
const { label, labelProps, checkboxProps, toggleView = false } = props;
|
|
1323
|
+
if (label)
|
|
1324
|
+
return /* @__PURE__ */ jsx47(
|
|
1325
|
+
FormControlLabel2,
|
|
1326
|
+
__spreadProps(__spreadValues({
|
|
1327
|
+
className: `w-fit bg-accent-silver px-3 py-0.5 ml-0 ${toggleView ? "gap-0" : "gap-x-1"} ${(checkboxProps == null ? void 0 : checkboxProps.checked) && toggleView && "!bg-accent-beige"}`,
|
|
1328
|
+
control: /* @__PURE__ */ jsx47(
|
|
1329
|
+
Checkbox,
|
|
1330
|
+
__spreadProps(__spreadValues({}, checkboxProps), {
|
|
1331
|
+
className: "p-0",
|
|
1332
|
+
disableRipple: true,
|
|
1333
|
+
color: "default",
|
|
1334
|
+
checkedIcon: toggleView ? /* @__PURE__ */ jsx47(Fragment5, {}) : /* @__PURE__ */ jsx47(BpCheckedIcon, {}),
|
|
1335
|
+
icon: toggleView ? /* @__PURE__ */ jsx47(Fragment5, {}) : /* @__PURE__ */ jsx47(BpIcon, {})
|
|
1336
|
+
})
|
|
1337
|
+
)
|
|
1338
|
+
}, labelProps), {
|
|
1339
|
+
label: /* @__PURE__ */ jsx47(Typography18, { className: "text-xs leading-6", children: label }),
|
|
1340
|
+
labelPlacement: "start"
|
|
1341
|
+
})
|
|
1342
|
+
);
|
|
1343
|
+
return /* @__PURE__ */ jsx47(Checkbox, __spreadValues({}, checkboxProps));
|
|
1344
|
+
};
|
|
1345
|
+
var Checkbox_default = CustomCheckbox;
|
|
1297
1346
|
export {
|
|
1298
1347
|
AppBar_default as AppBar,
|
|
1299
1348
|
ArticleCard_default as ArticleCard,
|
|
@@ -1303,6 +1352,7 @@ export {
|
|
|
1303
1352
|
BigNumber_default as BigNumber,
|
|
1304
1353
|
Button_default as Button,
|
|
1305
1354
|
CategoryCard_default as CategoryCard,
|
|
1355
|
+
Checkbox_default as Checkbox,
|
|
1306
1356
|
Chip_default as Chip,
|
|
1307
1357
|
FromToInput_default as FromToInput,
|
|
1308
1358
|
Greet,
|