mayak-common-library 0.0.48 → 0.0.49

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.js CHANGED
@@ -319,7 +319,6 @@ var SelectPro = ({
319
319
  setOpen(!open);
320
320
  };
321
321
  const handleClose = () => {
322
- if (isOpen) return;
323
322
  setOpen(false);
324
323
  setTimeout(() => {
325
324
  setAnchorEl(null);
@@ -328,82 +327,92 @@ var SelectPro = ({
328
327
  const childrenWithHandleChange = (0, import_react2.isValidElement)(children) ? (0, import_react2.cloneElement)(children, {
329
328
  collapseParent: handleClose
330
329
  }) : children;
331
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material4.ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { width: fullWidth ? "100%" : "inherit", children: [
332
- clickComponent ? (0, import_react2.cloneElement)(clickComponent, {
333
- ref: btn,
334
- onClick: handleClick,
335
- collapse: open
336
- }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
337
- import_material4.Button,
338
- {
339
- ref: btn,
340
- "aria-controls": open ? "basic-menu" : void 0,
341
- "aria-haspopup": "true",
342
- "aria-expanded": open ? "true" : void 0,
343
- onClick: handleClick,
344
- disableRipple: true,
345
- fullWidth: true,
346
- sx: {
347
- height: small ? "34px" : "38px",
348
- padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
349
- },
350
- className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
351
- children: [
352
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
353
- import_material4.Typography,
354
- {
355
- width: "200px",
356
- className: "text-sm leading-4 truncate text-left",
357
- children: placeholder
358
- }
359
- ),
360
- colorBorder ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(search_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
361
- dropdown_arrow_default,
362
- {
363
- style: {
364
- transform: open ? "scaleY(-1)" : "scaleY(1)",
365
- transition: "0.3s ease-in-out"
366
- }
367
- }
368
- )
369
- ]
370
- }
371
- ),
372
- btn ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
373
- import_material4.Paper,
374
- {
375
- sx: {
376
- position: "absolute",
377
- width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
378
- left: fullContainerWidth ? 0 : "initial",
379
- right: fullContainerWidth ? 0 : "initial",
380
- top: overButton ? 0 : "initial"
381
- },
382
- className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
383
- children: [
384
- intermediateChild ? intermediateChild : null,
385
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
386
- overButton ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
387
- IconButton_default,
388
- {
389
- className: "bg-accent-silver p-1 self-end absolute",
390
- onClick: handleClose,
391
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(close_default, {})
392
- }
393
- ) : null,
394
- childTitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
395
- import_material4.Typography,
396
- {
397
- className: "text-sm font-normal text-accent-silver-2",
398
- children: childTitle
399
- }
400
- ) : null,
401
- childrenWithHandleChange
402
- ] })
403
- ]
404
- }
405
- ) : null
406
- ] }) });
330
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
331
+ import_material4.ClickAwayListener,
332
+ {
333
+ onClickAway: isOpen ? () => {
334
+ return;
335
+ } : handleClose,
336
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { width: fullWidth ? "100%" : "inherit", children: [
337
+ clickComponent ? (0, import_react2.cloneElement)(clickComponent, {
338
+ ref: btn,
339
+ onClick: handleClick,
340
+ collapse: open
341
+ }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
342
+ import_material4.Button,
343
+ {
344
+ ref: btn,
345
+ "aria-controls": open ? "basic-menu" : void 0,
346
+ "aria-haspopup": "true",
347
+ "aria-expanded": open ? "true" : void 0,
348
+ onClick: handleClick,
349
+ disableRipple: true,
350
+ fullWidth: true,
351
+ sx: {
352
+ height: small ? "34px" : "38px",
353
+ padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
354
+ },
355
+ className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
356
+ children: [
357
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
358
+ import_material4.Typography,
359
+ {
360
+ width: "200px",
361
+ className: "text-sm leading-4 truncate text-left",
362
+ children: placeholder
363
+ }
364
+ ),
365
+ colorBorder ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(search_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
366
+ dropdown_arrow_default,
367
+ {
368
+ style: {
369
+ transform: open ? "scaleY(-1)" : "scaleY(1)",
370
+ transition: "0.3s ease-in-out"
371
+ }
372
+ }
373
+ )
374
+ ]
375
+ }
376
+ ),
377
+ btn ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
378
+ import_material4.Paper,
379
+ {
380
+ sx: {
381
+ position: "absolute",
382
+ width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
383
+ left: fullContainerWidth ? 0 : "initial",
384
+ right: fullContainerWidth ? 0 : "initial",
385
+ top: overButton ? 0 : "initial"
386
+ },
387
+ className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
388
+ children: [
389
+ intermediateChild ? intermediateChild : null,
390
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
391
+ overButton ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
392
+ IconButton_default,
393
+ {
394
+ className: "bg-accent-silver p-1 self-end absolute",
395
+ onClick: isOpen ? () => {
396
+ return;
397
+ } : handleClose,
398
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(close_default, {})
399
+ }
400
+ ) : null,
401
+ childTitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
402
+ import_material4.Typography,
403
+ {
404
+ className: "text-sm font-normal text-accent-silver-2",
405
+ children: childTitle
406
+ }
407
+ ) : null,
408
+ childrenWithHandleChange
409
+ ] })
410
+ ]
411
+ }
412
+ ) : null
413
+ ] })
414
+ }
415
+ );
407
416
  };
408
417
  var SelectPro_default = SelectPro;
409
418
 
package/dist/index.mjs CHANGED
@@ -259,7 +259,6 @@ var SelectPro = ({
259
259
  setOpen(!open);
260
260
  };
261
261
  const handleClose = () => {
262
- if (isOpen) return;
263
262
  setOpen(false);
264
263
  setTimeout(() => {
265
264
  setAnchorEl(null);
@@ -268,82 +267,92 @@ var SelectPro = ({
268
267
  const childrenWithHandleChange = isValidElement(children) ? cloneElement(children, {
269
268
  collapseParent: handleClose
270
269
  }) : children;
271
- return /* @__PURE__ */ jsx7(ClickAwayListener, { onClickAway: handleClose, children: /* @__PURE__ */ jsxs3(Box, { width: fullWidth ? "100%" : "inherit", children: [
272
- clickComponent ? cloneElement(clickComponent, {
273
- ref: btn,
274
- onClick: handleClick,
275
- collapse: open
276
- }) : /* @__PURE__ */ jsxs3(
277
- Button2,
278
- {
279
- ref: btn,
280
- "aria-controls": open ? "basic-menu" : void 0,
281
- "aria-haspopup": "true",
282
- "aria-expanded": open ? "true" : void 0,
283
- onClick: handleClick,
284
- disableRipple: true,
285
- fullWidth: true,
286
- sx: {
287
- height: small ? "34px" : "38px",
288
- padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
289
- },
290
- className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
291
- children: [
292
- /* @__PURE__ */ jsx7(
293
- Typography2,
294
- {
295
- width: "200px",
296
- className: "text-sm leading-4 truncate text-left",
297
- children: placeholder
298
- }
299
- ),
300
- colorBorder ? /* @__PURE__ */ jsx7(search_default, {}) : /* @__PURE__ */ jsx7(
301
- dropdown_arrow_default,
302
- {
303
- style: {
304
- transform: open ? "scaleY(-1)" : "scaleY(1)",
305
- transition: "0.3s ease-in-out"
306
- }
307
- }
308
- )
309
- ]
310
- }
311
- ),
312
- btn ? /* @__PURE__ */ jsxs3(
313
- Paper,
314
- {
315
- sx: {
316
- position: "absolute",
317
- width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
318
- left: fullContainerWidth ? 0 : "initial",
319
- right: fullContainerWidth ? 0 : "initial",
320
- top: overButton ? 0 : "initial"
321
- },
322
- className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
323
- children: [
324
- intermediateChild ? intermediateChild : null,
325
- /* @__PURE__ */ jsxs3(Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
326
- overButton ? /* @__PURE__ */ jsx7(
327
- IconButton_default,
328
- {
329
- className: "bg-accent-silver p-1 self-end absolute",
330
- onClick: handleClose,
331
- children: /* @__PURE__ */ jsx7(close_default, {})
332
- }
333
- ) : null,
334
- childTitle ? /* @__PURE__ */ jsx7(
335
- Typography2,
336
- {
337
- className: "text-sm font-normal text-accent-silver-2",
338
- children: childTitle
339
- }
340
- ) : null,
341
- childrenWithHandleChange
342
- ] })
343
- ]
344
- }
345
- ) : null
346
- ] }) });
270
+ return /* @__PURE__ */ jsx7(
271
+ ClickAwayListener,
272
+ {
273
+ onClickAway: isOpen ? () => {
274
+ return;
275
+ } : handleClose,
276
+ children: /* @__PURE__ */ jsxs3(Box, { width: fullWidth ? "100%" : "inherit", children: [
277
+ clickComponent ? cloneElement(clickComponent, {
278
+ ref: btn,
279
+ onClick: handleClick,
280
+ collapse: open
281
+ }) : /* @__PURE__ */ jsxs3(
282
+ Button2,
283
+ {
284
+ ref: btn,
285
+ "aria-controls": open ? "basic-menu" : void 0,
286
+ "aria-haspopup": "true",
287
+ "aria-expanded": open ? "true" : void 0,
288
+ onClick: handleClick,
289
+ disableRipple: true,
290
+ fullWidth: true,
291
+ sx: {
292
+ height: small ? "34px" : "38px",
293
+ padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
294
+ },
295
+ className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
296
+ children: [
297
+ /* @__PURE__ */ jsx7(
298
+ Typography2,
299
+ {
300
+ width: "200px",
301
+ className: "text-sm leading-4 truncate text-left",
302
+ children: placeholder
303
+ }
304
+ ),
305
+ colorBorder ? /* @__PURE__ */ jsx7(search_default, {}) : /* @__PURE__ */ jsx7(
306
+ dropdown_arrow_default,
307
+ {
308
+ style: {
309
+ transform: open ? "scaleY(-1)" : "scaleY(1)",
310
+ transition: "0.3s ease-in-out"
311
+ }
312
+ }
313
+ )
314
+ ]
315
+ }
316
+ ),
317
+ btn ? /* @__PURE__ */ jsxs3(
318
+ Paper,
319
+ {
320
+ sx: {
321
+ position: "absolute",
322
+ width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
323
+ left: fullContainerWidth ? 0 : "initial",
324
+ right: fullContainerWidth ? 0 : "initial",
325
+ top: overButton ? 0 : "initial"
326
+ },
327
+ className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
328
+ children: [
329
+ intermediateChild ? intermediateChild : null,
330
+ /* @__PURE__ */ jsxs3(Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
331
+ overButton ? /* @__PURE__ */ jsx7(
332
+ IconButton_default,
333
+ {
334
+ className: "bg-accent-silver p-1 self-end absolute",
335
+ onClick: isOpen ? () => {
336
+ return;
337
+ } : handleClose,
338
+ children: /* @__PURE__ */ jsx7(close_default, {})
339
+ }
340
+ ) : null,
341
+ childTitle ? /* @__PURE__ */ jsx7(
342
+ Typography2,
343
+ {
344
+ className: "text-sm font-normal text-accent-silver-2",
345
+ children: childTitle
346
+ }
347
+ ) : null,
348
+ childrenWithHandleChange
349
+ ] })
350
+ ]
351
+ }
352
+ ) : null
353
+ ] })
354
+ }
355
+ );
347
356
  };
348
357
  var SelectPro_default = SelectPro;
349
358
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mayak-common-library",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",