mayak-common-library 0.0.51 → 0.0.53

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