coles-solid-library 0.4.5 → 0.4.7

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.esm.js CHANGED
@@ -578,8 +578,8 @@ styleInject(css_248z$i);
578
578
 
579
579
  var _tmpl$$n = /*#__PURE__*/template(`<div>No <!> Found`),
580
580
  _tmpl$2$c = /*#__PURE__*/template(`<div>No Elements Found`),
581
- _tmpl$3$4 = /*#__PURE__*/template(`<div>`),
582
- _tmpl$4$2 = /*#__PURE__*/template(`<div><div><div></div></div><div>`);
581
+ _tmpl$3$5 = /*#__PURE__*/template(`<div>`),
582
+ _tmpl$4$3 = /*#__PURE__*/template(`<div><div><div></div></div><div>`);
583
583
  const carouselTitleContext = createContext(createSignal([]));
584
584
  const Provider$2 = props => {
585
585
  return createComponent(carouselTitleContext.Provider, {
@@ -684,7 +684,7 @@ const Carousel = ({
684
684
  return createSignal([]);
685
685
  },
686
686
  get children() {
687
- var _el$6 = _tmpl$4$2(),
687
+ var _el$6 = _tmpl$4$3(),
688
688
  _el$7 = _el$6.firstChild,
689
689
  _el$8 = _el$7.firstChild,
690
690
  _el$11 = _el$7.nextSibling;
@@ -701,7 +701,7 @@ const Carousel = ({
701
701
  return Object.keys(props).includes('elements');
702
702
  },
703
703
  get children() {
704
- var _el$9 = _tmpl$3$4();
704
+ var _el$9 = _tmpl$3$5();
705
705
  insert(_el$9, slideName);
706
706
  createRenderEffect(() => className(_el$9, `${style$7.carouselSlide}`));
707
707
  return _el$9;
@@ -712,7 +712,7 @@ const Carousel = ({
712
712
  return Object.keys(props).includes('children');
713
713
  },
714
714
  get children() {
715
- var _el$10 = _tmpl$3$4();
715
+ var _el$10 = _tmpl$3$5();
716
716
  insert(_el$10, slideName);
717
717
  createRenderEffect(() => className(_el$10, `${style$7.carouselSlide}`));
718
718
  return _el$10;
@@ -761,11 +761,11 @@ styleInject(css_248z$h);
761
761
 
762
762
  var _tmpl$$m = /*#__PURE__*/template(`<span>`),
763
763
  _tmpl$2$b = /*#__PURE__*/template(`<span>:`),
764
- _tmpl$3$3 = /*#__PURE__*/template(`<span><span>`);
764
+ _tmpl$3$4 = /*#__PURE__*/template(`<span><span>`);
765
765
  const Chip = props => {
766
766
  const hoverChip = props.onClick ? `${style$6.hover}` : "";
767
767
  return (() => {
768
- var _el$ = _tmpl$3$3(),
768
+ var _el$ = _tmpl$3$4(),
769
769
  _el$4 = _el$.firstChild;
770
770
  addEventListener(_el$, "click", props.onClick, true);
771
771
  insert(_el$, createComponent(Show, {
@@ -1395,6 +1395,100 @@ function useClickOutside(elementRefs, callback) {
1395
1395
  });
1396
1396
  }
1397
1397
 
1398
+ /**
1399
+ * Shared hook for positioning overlay elements (dropdowns, menus, etc.)
1400
+ * relative to an anchor element. Handles viewport boundary detection,
1401
+ * above/below placement, scroll and resize tracking.
1402
+ *
1403
+ * @param anchorRef - Accessor returning the anchor DOM element
1404
+ * @param overlayRef - Accessor returning the overlay DOM element
1405
+ * @param open - Accessor returning whether the overlay is currently open
1406
+ * @param config - Optional positioning configuration
1407
+ */
1408
+ function useOverlayPosition(anchorRef, overlayRef, open, config) {
1409
+ const VIEWPORT_MARGIN = 4;
1410
+ const MIN_HEIGHT = 160;
1411
+ const [dropTop, setDropTop] = createSignal(false);
1412
+ const getOverlayMetrics = () => {
1413
+ const el = overlayRef();
1414
+ if (!el) return {
1415
+ height: 0,
1416
+ width: 0
1417
+ };
1418
+ const rect = el.getBoundingClientRect();
1419
+ // When scaled/hidden, height can be 0; fallback to scrollHeight
1420
+ const height = rect.height === 0 ? el.scrollHeight || rect.height : rect.height;
1421
+ return {
1422
+ height,
1423
+ width: rect.width
1424
+ };
1425
+ };
1426
+ const updatePosition = () => {
1427
+ const overlay = overlayRef();
1428
+ const anchor = anchorRef();
1429
+ if (!overlay || !anchor) return;
1430
+ const baseRect = anchor.getBoundingClientRect();
1431
+ const {
1432
+ height: overlayHeight
1433
+ } = getOverlayMetrics();
1434
+ const spaceBelow = window.innerHeight - baseRect.bottom;
1435
+ const spaceAbove = baseRect.top;
1436
+ // Decide orientation: prefer below if it fits, else above, else whichever has more room
1437
+ let placeAbove = false;
1438
+ if (overlayHeight + VIEWPORT_MARGIN <= spaceBelow) {
1439
+ placeAbove = false;
1440
+ } else if (overlayHeight + VIEWPORT_MARGIN <= spaceAbove) {
1441
+ placeAbove = true;
1442
+ } else {
1443
+ placeAbove = spaceAbove > spaceBelow;
1444
+ }
1445
+ setDropTop(placeAbove);
1446
+ // Clamp max-height to available space
1447
+ const availableSpace = (placeAbove ? spaceAbove : spaceBelow) - VIEWPORT_MARGIN;
1448
+ const maxHeight = Math.max(MIN_HEIGHT, availableSpace);
1449
+ let newY;
1450
+ if (!placeAbove) {
1451
+ newY = baseRect.bottom + window.scrollY;
1452
+ if (newY + overlayHeight + VIEWPORT_MARGIN > window.scrollY + window.innerHeight) {
1453
+ newY = window.scrollY + window.innerHeight - overlayHeight - VIEWPORT_MARGIN;
1454
+ }
1455
+ } else {
1456
+ newY = baseRect.top + window.scrollY - overlayHeight;
1457
+ if (newY < window.scrollY + VIEWPORT_MARGIN) {
1458
+ newY = window.scrollY + VIEWPORT_MARGIN;
1459
+ }
1460
+ }
1461
+ // Final guard
1462
+ if (newY < window.scrollY + VIEWPORT_MARGIN) {
1463
+ newY = window.scrollY + VIEWPORT_MARGIN;
1464
+ }
1465
+ const newX = baseRect.left + window.scrollX;
1466
+ overlay.style.left = `${newX}px`;
1467
+ overlay.style.top = `${newY}px`;
1468
+ overlay.style.width = `${baseRect.width}px`;
1469
+ overlay.style.maxHeight = `${maxHeight}px`;
1470
+ };
1471
+ // Re-position when open changes
1472
+ createEffect(() => {
1473
+ if (open()) {
1474
+ queueMicrotask(() => updatePosition());
1475
+ }
1476
+ });
1477
+ // Attach scroll/resize listeners
1478
+ onMount(() => {
1479
+ document.addEventListener('scroll', updatePosition, true);
1480
+ window.addEventListener('resize', updatePosition);
1481
+ onCleanup(() => {
1482
+ document.removeEventListener('scroll', updatePosition, true);
1483
+ window.removeEventListener('resize', updatePosition);
1484
+ });
1485
+ });
1486
+ return {
1487
+ dropTop,
1488
+ updatePosition
1489
+ };
1490
+ }
1491
+
1398
1492
  var css_248z$e = "@charset \"UTF-8\";\n.input-module_input__-LMoi {\n width: 100%;\n max-width: 400px;\n border-radius: var(--border-radius-lg, 16px);\n font-size: var(--font-size-base, 16px);\n transition: border 0.7s ease, padding 0.7s ease;\n}\n@media screen and (max-width: 768px) {\n .input-module_input__-LMoi {\n width: 100%;\n max-width: 100%;\n }\n}\n.input-module_input__-LMoi[type=checkbox] {\n width: -moz-min-content;\n width: min-content;\n -webkit-appearance: none;\n border: 1px solid #cacece;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);\n padding: var(--spacing-1, 8px);\n border-radius: var(--border-radius-sm);\n display: inline-block;\n position: relative;\n}\n.input-module_input__-LMoi[type=checkbox]:checked {\n background-color: inherit;\n border: 1px solid #adb8c0;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05), inset 15px 10px -12px rgba(255, 255, 255, 0.1);\n color: inherit;\n}\n.input-module_input__-LMoi[type=checkbox]:checked:after {\n content: \"✔\";\n position: absolute;\n top: -15%;\n left: 15%;\n width: 10px;\n height: 10px;\n border-radius: 10%;\n}\n.input-module_input__-LMoi:not([type=checkbox])::-moz-placeholder {\n opacity: 0;\n}\n.input-module_input__-LMoi:not([type=checkbox])::placeholder {\n opacity: 0;\n}\n.input-module_input__-LMoi:focus {\n outline: none;\n}\n.input-module_input__-LMoi.input-module_error__vs2kz {\n border: 1px solid var(--warn-color);\n}\n.input-module_input__-LMoi.input-module_success__beiu5 {\n border: 1px solid green;\n}\n.input-module_input__-LMoi.input-module_warning__b6S5s {\n border: 1px solid orange;\n}\n.input-module_input__-LMoi.input-module_info__pWO0n {\n border: 1px solid blue;\n}\n.input-module_input__-LMoi.input-module_disabled__40ZHw {\n border: 1px solid gray;\n}\n\n.input-module_inFormField__kk-PD {\n border: none;\n outline: none;\n transition: padding 0.7s ease;\n}\n\n.input-module_checkbox__Yu-9M {\n cursor: pointer;\n}\n\n.input-module_transparent__aXcGX {\n background-color: inherit !important;\n opacity: 1;\n color: inherit !important;\n border: none;\n}\n.input-module_transparent__aXcGX :focus {\n outline: none;\n}";
1399
1493
  var styles$9 = {"input":"input-module_input__-LMoi","disabled":"input-module_disabled__40ZHw","inFormField":"input-module_inFormField__kk-PD","transparent":"input-module_transparent__aXcGX"};
1400
1494
  styleInject(css_248z$e);
@@ -1720,8 +1814,8 @@ function Checkbox(props) {
1720
1814
  })();
1721
1815
  }
1722
1816
 
1723
- var css_248z$c = ".selectStyles-module_solid_select__placeholder__VO5-- {\n opacity: var(--text-emphasis-medium, 87%);\n transition: all 0.7s ease;\n}\n\n.selectStyles-module_solid_select__transparent__nOpvm {\n background-color: transparent;\n}\n\n.selectStyles-module_solid_select__3plh1 {\n display: inline-block;\n position: relative;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n text-align: left;\n border-radius: 8px;\n width: 100%;\n margin: 0px 6px;\n}\n\n.selectStyles-module_solid_select__control__Wmmpg {\n display: flex;\n align-items: center;\n width: 100%;\n max-height: 48px;\n border-radius: 8px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n cursor: pointer;\n transition: border 0.7s ease, padding 0.7s ease;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.selectStyles-module_solid_select__control__Wmmpg:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control__Wmmpg:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__control_no_form__Cq9Sc {\n display: flex;\n align-items: center;\n width: 100%;\n height: 48px;\n border-radius: 8px;\n width: 200px;\n margin-top: 2px;\n cursor: pointer;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__disabled__5rUz8 {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.selectStyles-module_solid_select__arrow__OPCZo {\n font-size: 0.7em;\n}\n\n.selectStyles-module_solid_select__value__rNtqF {\n flex-grow: 1;\n transition: all 0.3s ease;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n}\n\n.selectStyles-module_multiselect-value__UUhhP {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.selectStyles-module_solid_select__dropdown__UCt-N {\n position: absolute;\n background-color: var(--surface-color, #EEEEEE);\n top: 100%;\n left: 0;\n z-index: 999999999999999;\n max-height: 200px;\n border-radius: 8px;\n overflow-x: hidden;\n overflow-y: auto;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n transform-origin: top;\n transform: scaleY(0);\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n}\n\n.selectStyles-module_dropTop__IVz9p {\n transform-origin: bottom;\n}\n\n.selectStyles-module_dropBottom__cYJF0 {\n transform-origin: top;\n}\n\n.selectStyles-module_open__f8zLA {\n transform: scaleY(1);\n opacity: 1;\n}\n\n.selectStyles-module_solid_select__option__47WMY {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n min-height: 32px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n border-radius: 8px;\n}\n.selectStyles-module_solid_select__option__47WMY:hover {\n border: 2px inset var(--primary-color-varient, #43A047);\n}\n.selectStyles-module_solid_select__option__47WMY:has(.selectStyles-module_selected__1-CKm) {\n font-weight: bold;\n}\n\n.selectStyles-module_solid_select__option_highlight__hPSRL {\n border: 2px inset var(--primary-color-varient, #43A047);\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n\n.selectStyles-module_solid_select__option_disabled__IZBcA {\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n}\n\n.selectStyles-module_checkmark__UWcbd {\n display: inline-block;\n width: 1.2em;\n margin-right: 4px;\n text-align: center;\n}\n\n.selectStyles-module_option-label__bBFSW {\n width: -moz-max-content;\n width: max-content;\n height: -moz-max-content;\n height: max-content;\n}";
1724
- var styles$7 = {"solid_select__placeholder":"selectStyles-module_solid_select__placeholder__VO5--","solid_select__transparent":"selectStyles-module_solid_select__transparent__nOpvm","solid_select":"selectStyles-module_solid_select__3plh1","solid_select__control":"selectStyles-module_solid_select__control__Wmmpg","solid_select__control_no_form":"selectStyles-module_solid_select__control_no_form__Cq9Sc","solid_select__disabled":"selectStyles-module_solid_select__disabled__5rUz8","solid_select__arrow":"selectStyles-module_solid_select__arrow__OPCZo","solid_select__value":"selectStyles-module_solid_select__value__rNtqF","multiselect-value":"selectStyles-module_multiselect-value__UUhhP","solid_select__dropdown":"selectStyles-module_solid_select__dropdown__UCt-N","dropTop":"selectStyles-module_dropTop__IVz9p","dropBottom":"selectStyles-module_dropBottom__cYJF0","open":"selectStyles-module_open__f8zLA","solid_select__option":"selectStyles-module_solid_select__option__47WMY","selected":"selectStyles-module_selected__1-CKm","solid_select__option_highlight":"selectStyles-module_solid_select__option_highlight__hPSRL","solid_select__option_disabled":"selectStyles-module_solid_select__option_disabled__IZBcA","checkmark":"selectStyles-module_checkmark__UWcbd","option-label":"selectStyles-module_option-label__bBFSW"};
1817
+ var css_248z$c = ".selectStyles-module_solid_select__placeholder__VO5-- {\n opacity: var(--text-emphasis-medium, 87%);\n transition: all 0.7s ease;\n}\n\n.selectStyles-module_solid_select__transparent__nOpvm {\n background-color: transparent;\n}\n\n.selectStyles-module_solid_select__3plh1 {\n display: inline-block;\n position: relative;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n text-align: left;\n border-radius: 8px;\n width: 100%;\n margin: 0px 6px;\n}\n\n.selectStyles-module_solid_select__control__Wmmpg {\n display: flex;\n align-items: center;\n width: 100%;\n max-height: 48px;\n border-radius: 8px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n cursor: pointer;\n transition: border 0.7s ease, padding 0.7s ease;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.selectStyles-module_solid_select__control__Wmmpg:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control__Wmmpg:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__control_no_form__Cq9Sc {\n display: flex;\n align-items: center;\n width: 100%;\n height: 48px;\n border-radius: 8px;\n width: 200px;\n margin-top: 2px;\n cursor: pointer;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:first-child {\n flex-grow: 1;\n}\n.selectStyles-module_solid_select__control_no_form__Cq9Sc:last-child {\n padding: 0px 6px;\n margin: 0px;\n}\n\n.selectStyles-module_solid_select__disabled__5rUz8 {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.selectStyles-module_solid_select__arrow__OPCZo {\n font-size: 0.7em;\n}\n\n.selectStyles-module_solid_select__value__rNtqF {\n flex-grow: 1;\n transition: all 0.3s ease;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n}\n\n.selectStyles-module_multiselect-value__UUhhP {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n.selectStyles-module_solid_select__dropdown__UCt-N {\n position: absolute;\n background-color: var(--surface-color, #EEEEEE);\n top: 100%;\n left: 0;\n z-index: 999999999999999;\n max-height: 200px;\n border-radius: 8px;\n overflow-x: hidden;\n overflow-y: auto;\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);\n transform-origin: top;\n transform: scaleY(0);\n transition: transform 0.3s ease-out, opacity 0.3s ease-out;\n opacity: 0;\n}\n\n.selectStyles-module_dropTop__IVz9p {\n transform-origin: bottom;\n}\n\n.selectStyles-module_dropBottom__cYJF0 {\n transform-origin: top;\n}\n\n.selectStyles-module_open__f8zLA {\n transform: scaleY(1);\n opacity: 1;\n}\n\n.selectStyles-module_solid_select__option__47WMY {\n padding: 8px;\n cursor: pointer;\n display: flex;\n align-items: center;\n min-height: 32px;\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n border-radius: 8px;\n}\n.selectStyles-module_solid_select__option__47WMY:hover {\n border: 2px inset var(--primary-color-varient, #43A047);\n}\n.selectStyles-module_solid_select__option__47WMY:has(.selectStyles-module_selected__1-CKm) {\n font-weight: bold;\n}\n\n.selectStyles-module_solid_select__option_highlight__hPSRL {\n border: 2px inset var(--primary-color-varient, #43A047);\n background-color: var(--container-color, #ffffff);\n color: var(--on-container-color, #000);\n}\n\n.selectStyles-module_solid_select__option_disabled__IZBcA {\n cursor: not-allowed;\n opacity: 0.6;\n pointer-events: none;\n}\n\n.selectStyles-module_checkmark__UWcbd {\n display: inline-block;\n width: 1.2em;\n margin-right: 4px;\n text-align: center;\n}\n\n.selectStyles-module_option-label__bBFSW {\n width: -moz-max-content;\n width: max-content;\n height: -moz-max-content;\n height: max-content;\n}\n\n.selectStyles-module_solid_select__mobile_backdrop__MQU3O {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999999999999999;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: flex-end;\n justify-content: center;\n animation: selectStyles-module_mobileBackdropFadeIn__BMxpT 0.2s ease-out;\n}\n\n.selectStyles-module_solid_select__mobile_popup__-MO-i {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 90vw;\n max-width: 400px;\n max-height: 60vh;\n border-radius: 16px 16px 0 0;\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.45);\n animation: selectStyles-module_mobileSlideUp__JlYpt 0.3s ease-out;\n}\n\n.selectStyles-module_solid_select__mobile_header__gpULA {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 16px;\n min-height: 48px;\n background-color: var(--surface-color, #EEEEEE);\n color: var(--on-surface-color, #000000);\n border-bottom: 1px solid var(--surface-color-variant, #ccc);\n flex-shrink: 0;\n}\n\n.selectStyles-module_solid_select__mobile_title__MNbIa {\n font-size: 18px;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.selectStyles-module_solid_select__mobile_close__RgfaX {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border: none;\n border-radius: 50%;\n background: transparent;\n color: var(--on-surface-color, #000000);\n font-size: 18px;\n cursor: pointer;\n flex-shrink: 0;\n transition: background-color 0.15s ease;\n}\n.selectStyles-module_solid_select__mobile_close__RgfaX:hover {\n background-color: var(--surface-color-variant, #ccc);\n}\n.selectStyles-module_solid_select__mobile_close__RgfaX:active {\n background-color: var(--surface-color-variant, #ccc);\n}\n\n.selectStyles-module_solid_select__mobile_options__01rHy {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 8px 0;\n -webkit-overflow-scrolling: touch;\n}\n\n.selectStyles-module_solid_select__mobile_footer__U08m7 {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px 16px;\n min-height: 52px;\n background-color: var(--surface-color, #EEEEEE);\n border-top: 1px solid var(--surface-color-variant, #ccc);\n flex-shrink: 0;\n}\n\n.selectStyles-module_solid_select__mobile_done__Xp6Gu {\n padding: 8px 24px;\n border: none;\n border-radius: 8px;\n background-color: var(--primary-color, #4CAF50);\n color: var(--on-primary-color, #fff);\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.15s ease, box-shadow 0.15s ease;\n}\n.selectStyles-module_solid_select__mobile_done__Xp6Gu:hover {\n background-color: var(--primary-color-varient, #43A047);\n}\n.selectStyles-module_solid_select__mobile_done__Xp6Gu:active {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);\n}\n\n@keyframes selectStyles-module_mobileBackdropFadeIn__BMxpT {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes selectStyles-module_mobileSlideUp__JlYpt {\n from {\n transform: translateY(30%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}";
1818
+ var styles$7 = {"solid_select__placeholder":"selectStyles-module_solid_select__placeholder__VO5--","solid_select__transparent":"selectStyles-module_solid_select__transparent__nOpvm","solid_select":"selectStyles-module_solid_select__3plh1","solid_select__control":"selectStyles-module_solid_select__control__Wmmpg","solid_select__control_no_form":"selectStyles-module_solid_select__control_no_form__Cq9Sc","solid_select__disabled":"selectStyles-module_solid_select__disabled__5rUz8","solid_select__arrow":"selectStyles-module_solid_select__arrow__OPCZo","solid_select__value":"selectStyles-module_solid_select__value__rNtqF","multiselect-value":"selectStyles-module_multiselect-value__UUhhP","solid_select__dropdown":"selectStyles-module_solid_select__dropdown__UCt-N","dropTop":"selectStyles-module_dropTop__IVz9p","dropBottom":"selectStyles-module_dropBottom__cYJF0","open":"selectStyles-module_open__f8zLA","solid_select__option":"selectStyles-module_solid_select__option__47WMY","selected":"selectStyles-module_selected__1-CKm","solid_select__option_highlight":"selectStyles-module_solid_select__option_highlight__hPSRL","solid_select__option_disabled":"selectStyles-module_solid_select__option_disabled__IZBcA","checkmark":"selectStyles-module_checkmark__UWcbd","option-label":"selectStyles-module_option-label__bBFSW","solid_select__mobile_backdrop":"selectStyles-module_solid_select__mobile_backdrop__MQU3O","mobileBackdropFadeIn":"selectStyles-module_mobileBackdropFadeIn__BMxpT","solid_select__mobile_popup":"selectStyles-module_solid_select__mobile_popup__-MO-i","mobileSlideUp":"selectStyles-module_mobileSlideUp__JlYpt","solid_select__mobile_header":"selectStyles-module_solid_select__mobile_header__gpULA","solid_select__mobile_title":"selectStyles-module_solid_select__mobile_title__MNbIa","solid_select__mobile_close":"selectStyles-module_solid_select__mobile_close__RgfaX","solid_select__mobile_options":"selectStyles-module_solid_select__mobile_options__01rHy","solid_select__mobile_footer":"selectStyles-module_solid_select__mobile_footer__U08m7","solid_select__mobile_done":"selectStyles-module_solid_select__mobile_done__Xp6Gu"};
1725
1819
  styleInject(css_248z$c);
1726
1820
 
1727
1821
  const manager = new class WinManager {
@@ -1810,54 +1904,13 @@ const SelectContextProvider = props => {
1810
1904
  });
1811
1905
  };
1812
1906
 
1813
- var _tmpl$$g = /*#__PURE__*/template(`<span>`),
1814
- _tmpl$2$8 = /*#__PURE__*/template(`<span>▲`),
1815
- _tmpl$3$2 = /*#__PURE__*/template(`<span>▼`),
1816
- _tmpl$4$1 = /*#__PURE__*/template(`<div>`),
1817
- _tmpl$5$1 = /*#__PURE__*/template(`<div is=coles-solid-select role=button aria-haspopup=listbox tabindex=0><div><span>`, true, false, false);
1818
- function Select(props) {
1819
- const isMultiple = Object.keys(props).includes("multiple") || props.multiple === true;
1820
- const [placeholder, setPlaceholder] = createSignal(props?.placeholder ?? "Select...");
1821
- // Internal state for selected value(s). Use provided value or defaultValue or an initial default.
1822
- const [currStyle, setCurrStyle] = createSignal("primary");
1823
- const defaultSelected = isMultiple ? props.value ?? props.defaultValue ?? [] : props.value ?? props.defaultValue ?? undefined;
1824
- const [selected, setSelected] = createSignal(defaultSelected);
1825
- const [selectRef, setSelectRef] = createSignal();
1826
- const [dropdownRef, setDropdownRef] = createSignal();
1827
- const form = useFormProvider();
1828
- const formContext = useFormContext();
1829
- const hasForm = !!form?.formName || !!form?.getName || !!form?.getValue || !!form?.setValue || !!form?.getTextInside;
1830
- const hasFormContext = hasForm && !!formContext?.formGroup;
1831
- const currentValue = () => {
1832
- if (hasFormContext) {
1833
- return formContext.data?.[form?.formName ?? ''];
1834
- }
1835
- if (hasForm) {
1836
- return form.getValue();
1837
- }
1838
- return props?.value;
1839
- };
1840
- // Signal for dropdown open/closed
1841
- const [open, setOpen] = createSignal(false);
1842
- const [optionOrder, setOptionOrder] = createSignal([]);
1843
- const [highlightedIndex, setHighlightedIndex] = createSignal(-1);
1844
- const [typeahead, setTypeahead] = createSignal("");
1845
- let typeaheadTimeoutId;
1846
- let lastTypeaheadAt = 0;
1847
- const TYPEAHEAD_TIMEOUT = 650;
1848
- const isDisabled = () => {
1849
- const fieldset = form?.getFormFieldRef?.();
1850
- const fieldsetDisabled = !!fieldset?.hasAttribute?.('disabled');
1851
- return !!props.disabled || fieldsetDisabled;
1852
- };
1853
- const menuLocRef = createMemo(() => {
1854
- if (!!form?.getFormFieldRef) {
1855
- return form.getFormFieldRef();
1856
- }
1857
- return selectRef();
1858
- });
1907
+ /**
1908
+ * Manages the registry of options for a Select component.
1909
+ * Handles registration, unregistration, ordering, and label resolution.
1910
+ */
1911
+ function useSelectOptions() {
1859
1912
  const [options, setOptions] = createStore({});
1860
- // Register and unregister functions using the store
1913
+ const [optionOrder, setOptionOrder] = createSignal([]);
1861
1914
  const registerOption = (val, label, labelText = "") => {
1862
1915
  const stringVal = JSON.stringify(val);
1863
1916
  setOptions(store => ({
@@ -1890,8 +1943,28 @@ function Select(props) {
1890
1943
  if (typeof entry.label === "string" || typeof entry.label === "number") return String(entry.label);
1891
1944
  return String(entry.raw ?? entry.value ?? "").trim();
1892
1945
  };
1946
+ const getLabel = val => {
1947
+ const stringVal = JSON.stringify(val);
1948
+ return options[stringVal]?.label || String(val);
1949
+ };
1950
+ return {
1951
+ options,
1952
+ registerOption,
1953
+ unregisterOption,
1954
+ optionEntries,
1955
+ getOptionLabelText,
1956
+ getLabel
1957
+ };
1958
+ }
1959
+
1960
+ /**
1961
+ * Manages highlighted-index state for keyboard navigation in a Select dropdown.
1962
+ * Provides movement, scroll-into-view, and reset-to-selected helpers.
1963
+ */
1964
+ function useHighlight(config) {
1965
+ const [highlightedIndex, setHighlightedIndex] = createSignal(-1);
1893
1966
  const scrollHighlightedIntoView = index => {
1894
- const dropdown = dropdownRef();
1967
+ const dropdown = config.dropdownRef();
1895
1968
  if (!dropdown) return;
1896
1969
  const optionsEls = dropdown.querySelectorAll('[role="option"]');
1897
1970
  const idx = index ?? highlightedIndex();
@@ -1903,42 +1976,71 @@ function Select(props) {
1903
1976
  }
1904
1977
  };
1905
1978
  const moveHighlight = delta => {
1906
- const entries = optionEntries();
1979
+ const entries = config.optionEntries();
1907
1980
  if (!entries.length) return;
1908
1981
  const nextIndex = ((highlightedIndex() < 0 ? 0 : highlightedIndex()) + delta + entries.length) % entries.length;
1909
1982
  setHighlightedIndex(nextIndex);
1910
1983
  queueMicrotask(() => scrollHighlightedIntoView(nextIndex));
1911
1984
  };
1912
1985
  const setHighlightToSelectedOrFirst = () => {
1913
- const entries = optionEntries();
1986
+ const entries = config.optionEntries();
1914
1987
  if (!entries.length) {
1915
1988
  setHighlightedIndex(-1);
1916
1989
  return;
1917
1990
  }
1918
- let idx = entries.findIndex(entry => isSelected(entry.raw));
1991
+ let idx = entries.findIndex(entry => config.isSelected(entry.raw));
1919
1992
  if (idx < 0) idx = 0;
1920
1993
  setHighlightedIndex(idx);
1921
1994
  queueMicrotask(() => scrollHighlightedIntoView(idx));
1922
1995
  };
1996
+ // Clamp highlighted index when entries change
1997
+ createEffect(() => {
1998
+ const entries = config.optionEntries();
1999
+ if (!entries.length) {
2000
+ if (highlightedIndex() !== -1) setHighlightedIndex(-1);
2001
+ return;
2002
+ }
2003
+ if (highlightedIndex() >= entries.length) {
2004
+ setHighlightedIndex(entries.length - 1);
2005
+ }
2006
+ });
2007
+ return {
2008
+ highlightedIndex,
2009
+ setHighlightedIndex,
2010
+ moveHighlight,
2011
+ setHighlightToSelectedOrFirst,
2012
+ scrollHighlightedIntoView
2013
+ };
2014
+ }
2015
+
2016
+ const TYPEAHEAD_TIMEOUT = 650;
2017
+ /**
2018
+ * Typeahead search for Select. Buffers keystrokes and finds
2019
+ * the first option whose label starts with the typed string.
2020
+ */
2021
+ function useTypeahead(config) {
2022
+ const [typeahead, setTypeahead] = createSignal("");
2023
+ let timeoutId;
2024
+ let lastTypeaheadAt = 0;
2025
+ const resetTypeahead = () => {
2026
+ setTypeahead("");
2027
+ if (timeoutId) {
2028
+ window.clearTimeout(timeoutId);
2029
+ timeoutId = undefined;
2030
+ }
2031
+ };
1923
2032
  const findMatchIndex = search => {
1924
- const entries = optionEntries();
2033
+ const entries = config.optionEntries();
1925
2034
  if (!entries.length) return -1;
1926
2035
  const normalized = search.toLowerCase();
1927
- const start = highlightedIndex() >= 0 ? (highlightedIndex() + 1) % entries.length : 0;
2036
+ const start = config.highlightedIndex() >= 0 ? (config.highlightedIndex() + 1) % entries.length : 0;
1928
2037
  for (let i = 0; i < entries.length; i += 1) {
1929
2038
  const idx = (start + i) % entries.length;
1930
- const label = getOptionLabelText(entries[idx]).toLowerCase();
2039
+ const label = config.getOptionLabelText(entries[idx]).toLowerCase();
1931
2040
  if (label.startsWith(normalized)) return idx;
1932
2041
  }
1933
2042
  return -1;
1934
2043
  };
1935
- const resetTypeahead = () => {
1936
- setTypeahead("");
1937
- if (typeaheadTimeoutId) {
1938
- window.clearTimeout(typeaheadTimeoutId);
1939
- typeaheadTimeoutId = undefined;
1940
- }
1941
- };
1942
2044
  const handleTypeahead = key => {
1943
2045
  const now = Date.now();
1944
2046
  const prev = typeahead();
@@ -1946,23 +2048,118 @@ function Select(props) {
1946
2048
  const nextBuffer = isRepeat ? key : `${prev}${key}`;
1947
2049
  lastTypeaheadAt = now;
1948
2050
  setTypeahead(nextBuffer);
1949
- if (typeaheadTimeoutId) window.clearTimeout(typeaheadTimeoutId);
1950
- typeaheadTimeoutId = window.setTimeout(() => setTypeahead(""), TYPEAHEAD_TIMEOUT);
2051
+ if (timeoutId) window.clearTimeout(timeoutId);
2052
+ timeoutId = window.setTimeout(() => setTypeahead(""), TYPEAHEAD_TIMEOUT);
1951
2053
  const matchIndex = findMatchIndex(nextBuffer);
1952
2054
  if (matchIndex >= 0) {
1953
- setHighlightedIndex(matchIndex);
1954
- queueMicrotask(() => scrollHighlightedIntoView(matchIndex));
2055
+ config.onMatch(matchIndex);
1955
2056
  }
1956
2057
  };
1957
- const getLabel = val => {
1958
- const stringVal = JSON.stringify(val);
1959
- return options[stringVal]?.label || String(val);
2058
+ onCleanup(() => {
2059
+ if (timeoutId) {
2060
+ window.clearTimeout(timeoutId);
2061
+ }
2062
+ });
2063
+ return {
2064
+ handleTypeahead,
2065
+ resetTypeahead
1960
2066
  };
2067
+ }
2068
+
2069
+ var _tmpl$$g = /*#__PURE__*/template(`<span>`),
2070
+ _tmpl$2$8 = /*#__PURE__*/template(`<span>▲`),
2071
+ _tmpl$3$3 = /*#__PURE__*/template(`<span>▼`),
2072
+ _tmpl$4$2 = /*#__PURE__*/template(`<div>`),
2073
+ _tmpl$5$1 = /*#__PURE__*/template(`<div><button type=button>Done`),
2074
+ _tmpl$6$1 = /*#__PURE__*/template(`<div><div role=dialog aria-modal=true tabindex=-1><div><span></span><button type=button aria-label=Close>✕</button></div><div role=listbox>`),
2075
+ _tmpl$7$1 = /*#__PURE__*/template(`<div is=coles-solid-select role=button tabindex=0><div><span>`, true, false, false);
2076
+ function Select(props) {
2077
+ const isMultiple = props.multiple !== undefined || props.multiple === true;
2078
+ const [currStyle, setCurrStyle] = createSignal("primary");
2079
+ const defaultSelected = isMultiple ? props.value ?? props.defaultValue ?? [] : props.value ?? props.defaultValue ?? undefined;
2080
+ const [selected, setSelected] = createSignal(defaultSelected);
2081
+ const [selectRef, setSelectRef] = createSignal();
2082
+ const [dropdownRef, setDropdownRef] = createSignal();
2083
+ const [mobilePopupRef, setMobilePopupRef] = createSignal();
2084
+ // Resolved rendering mode: 'popup' for fullscreen mobile popup, 'desktop' for traditional dropdown
2085
+ const resolvedMode = createMemo(() => {
2086
+ const mode = props.mobileMode ?? 'auto';
2087
+ if (mode === 'popup') return 'popup';
2088
+ if (mode === 'desktop') return 'desktop';
2089
+ // 'auto': detect mobile at runtime
2090
+ return isMobile() ? 'popup' : 'desktop';
2091
+ });
2092
+ const form = useFormProvider();
2093
+ const formContext = useFormContext();
2094
+ const hasForm = !!form?.formName || !!form?.getName || !!form?.getValue || !!form?.setValue || !!form?.getTextInside;
2095
+ const hasFormContext = hasForm && !!formContext?.formGroup;
2096
+ const currentValue = () => {
2097
+ if (hasFormContext) {
2098
+ return formContext.data?.[form?.formName ?? ''];
2099
+ }
2100
+ if (hasForm) {
2101
+ return form.getValue();
2102
+ }
2103
+ return props?.value;
2104
+ };
2105
+ // Signal for dropdown open/closed
2106
+ const [open, setOpen] = createSignal(false);
2107
+ const [menuRect, setMenuRect] = createSignal();
2108
+ const isDisabled = () => {
2109
+ const fieldset = form?.getFormFieldRef?.();
2110
+ const fieldsetDisabled = !!fieldset?.hasAttribute?.('disabled');
2111
+ return !!props.disabled || fieldsetDisabled;
2112
+ };
2113
+ const menuLocRef = createMemo(() => {
2114
+ if (!!form?.getFormFieldRef) {
2115
+ return form.getFormFieldRef();
2116
+ }
2117
+ return selectRef();
2118
+ });
2119
+ // --- Option registry (extracted hook) ---
2120
+ const {
2121
+ options,
2122
+ registerOption,
2123
+ unregisterOption,
2124
+ optionEntries,
2125
+ getOptionLabelText,
2126
+ getLabel
2127
+ } = useSelectOptions();
1961
2128
  // Helper to check if a value is selected (for Option highlighting)
1962
2129
  const isSelected = val => {
1963
2130
  const current = currentValue();
1964
2131
  return isMultiple ? Array.isArray(current) && current.includes(val) : current === val;
1965
2132
  };
2133
+ // --- Highlight management (extracted hook) ---
2134
+ // Use combined ref so scrollIntoView works in both desktop dropdown and mobile popup modes
2135
+ const activeListRef = createMemo(() => resolvedMode() === 'popup' ? mobilePopupRef() : dropdownRef());
2136
+ const {
2137
+ highlightedIndex,
2138
+ setHighlightedIndex,
2139
+ moveHighlight,
2140
+ setHighlightToSelectedOrFirst,
2141
+ scrollHighlightedIntoView
2142
+ } = useHighlight({
2143
+ optionEntries,
2144
+ isSelected,
2145
+ dropdownRef: activeListRef
2146
+ });
2147
+ // --- Typeahead search (extracted hook) ---
2148
+ const {
2149
+ handleTypeahead,
2150
+ resetTypeahead
2151
+ } = useTypeahead({
2152
+ optionEntries,
2153
+ highlightedIndex,
2154
+ getOptionLabelText,
2155
+ onMatch: index => {
2156
+ setHighlightedIndex(index);
2157
+ queueMicrotask(() => scrollHighlightedIntoView(index));
2158
+ }
2159
+ });
2160
+ // --- Overlay positioning (extracted hook) ---
2161
+ const {
2162
+ dropTop} = useOverlayPosition(menuLocRef, dropdownRef, open);
1966
2163
  // Function to handle selecting/toggling an option for single or multi-select
1967
2164
  // When not using a form or greater FormContext
1968
2165
  const selectValue = val => {
@@ -1991,7 +2188,7 @@ function Select(props) {
1991
2188
  };
1992
2189
  // Compute the content to display in the closed select (trigger area)
1993
2190
  const displayValue = createMemo(() => {
1994
- const current = currentValue(); //selected();
2191
+ const current = currentValue();
1995
2192
  if (isMultiple) {
1996
2193
  const selectedArray = Array.isArray(current) ? current : [];
1997
2194
  if (selectedArray.length === 0) {
@@ -2052,149 +2249,19 @@ function Select(props) {
2052
2249
  }
2053
2250
  }
2054
2251
  });
2055
- const VIEWPORT_MARGIN = 4; // minimal gap from screen edges
2056
- const getDropdownMetrics = () => {
2057
- const dr = dropdownRef();
2058
- if (!dr) return {
2059
- height: 0,
2060
- width: 0
2061
- };
2062
- const rect = dr.getBoundingClientRect();
2063
- // When scaled closed, height can be 0; fallback to scrollHeight
2064
- const height = rect.height === 0 ? dr.scrollHeight || rect.height : rect.height;
2065
- return {
2066
- height,
2067
- width: rect.width
2068
- };
2069
- };
2070
- const dropdownBelowScreen = () => {
2071
- const menuLoc = menuLocRef();
2072
- if (menuLoc && dropdownRef()) {
2073
- const selectRect = menuLoc.getBoundingClientRect();
2074
- const {
2075
- height
2076
- } = getDropdownMetrics();
2077
- return selectRect.bottom + height + VIEWPORT_MARGIN > window.innerHeight && selectRect.top - height - VIEWPORT_MARGIN >= 0 ? true : selectRect.bottom + height + VIEWPORT_MARGIN > window.innerHeight;
2078
- }
2079
- return false;
2080
- };
2081
- const [menuRect, setMenuRect] = createSignal();
2082
- const selectLocation = createMemo(() => {
2083
- const select = selectRef();
2084
- const menuLoc = menuLocRef();
2085
- const getLocation = rect => {
2086
- if (dropdownBelowScreen()) {
2087
- return {
2088
- x: rect.left,
2089
- y: rect.top - rect.height
2090
- };
2091
- }
2092
- return {
2093
- x: rect.left,
2094
- y: rect.bottom
2095
- };
2096
- };
2097
- if (hasForm || hasFormContext) {
2098
- if (menuLoc) {
2099
- const rect = menuRect() ?? menuLoc.getBoundingClientRect();
2100
- return getLocation(rect);
2101
- } else if (select) {
2102
- const rect = select.getBoundingClientRect();
2103
- return getLocation(rect);
2104
- }
2105
- } else {
2106
- if (select) {
2107
- const rect = select.getBoundingClientRect();
2108
- return getLocation(rect);
2109
- }
2110
- }
2111
- return {
2112
- x: 0,
2113
- y: 0
2114
- };
2115
- });
2116
- const selectWidth = () => {
2117
- if (menuLocRef()) {
2118
- return menuLocRef().getBoundingClientRect().width;
2119
- }
2120
- return 0;
2121
- };
2122
- createMemo(() => {
2123
- const value = currentValue();
2124
- if (isMultiple) {
2125
- const selectedArray = Array.isArray(value) ? value : [];
2126
- if (selectedArray.length === 0) {
2127
- return 0;
2128
- }
2129
- const labels = selectedArray.map(val => options[JSON.stringify(val)]?.label || String(val));
2130
- return labels.join(", ").length * 8; // Approximate width based on character count
2131
- } else {
2132
- return selectWidth();
2133
- }
2134
- });
2135
- const updatePosition = () => {
2252
+ // --- Width sync effect ---
2253
+ createEffect(() => {
2136
2254
  const dropdown = dropdownRef();
2137
2255
  const select = selectRef();
2138
- const anchor = menuLocRef();
2139
- if (!dropdown || !(select || anchor)) return;
2140
- const baseRect = (anchor ?? select).getBoundingClientRect();
2141
- const {
2142
- height: ddHeight
2143
- } = getDropdownMetrics();
2144
- const spaceBelow = window.innerHeight - baseRect.bottom;
2145
- const spaceAbove = baseRect.top;
2146
- // Decide orientation: prefer below if it fits fully else choose the side with more space.
2147
- let placeAbove = false;
2148
- if (ddHeight + VIEWPORT_MARGIN <= spaceBelow) {
2149
- placeAbove = false;
2150
- } else if (ddHeight + VIEWPORT_MARGIN <= spaceAbove) {
2151
- placeAbove = true;
2152
- } else {
2153
- // Neither fits: pick side with more space
2154
- placeAbove = spaceAbove > spaceBelow;
2155
- }
2156
- // store orientation for class assignment
2157
- setDropTop(placeAbove);
2158
- // Compute available vertical space for dropdown and clamp to a sensible minimum
2159
- const availableSpace = (placeAbove ? spaceAbove : spaceBelow) - VIEWPORT_MARGIN;
2160
- const maxHeight = Math.max(160, availableSpace); // ensure at least 160px so a few options are visible
2161
- let newY;
2162
- if (!placeAbove) {
2163
- newY = baseRect.bottom + window.scrollY; // default below
2164
- // Clamp if overflow
2165
- if (newY + ddHeight + VIEWPORT_MARGIN > window.scrollY + window.innerHeight) {
2166
- newY = window.scrollY + window.innerHeight - ddHeight - VIEWPORT_MARGIN;
2167
- }
2168
- } else {
2169
- newY = baseRect.top + window.scrollY - ddHeight; // above
2170
- if (newY < window.scrollY + VIEWPORT_MARGIN) {
2171
- newY = window.scrollY + VIEWPORT_MARGIN;
2172
- }
2173
- }
2174
- // Final guard: ensure dropdown not negative even for huge heights
2175
- if (newY < window.scrollY + VIEWPORT_MARGIN) {
2176
- newY = window.scrollY + VIEWPORT_MARGIN;
2177
- }
2178
- const newX = baseRect.left + window.scrollX;
2179
- dropdown.style.left = `${newX}px`;
2180
- dropdown.style.top = `${newY}px`;
2181
- dropdown.style.width = `${baseRect.width}px`;
2182
- dropdown.style.maxHeight = `${maxHeight}px`;
2183
- };
2184
- // Update width of select to match option text width
2185
- createEffect(() => {
2186
- if (selectRef() && dropdownRef()) {
2187
- const dropdownWidth = dropdownRef().getBoundingClientRect().width;
2188
- const selectWidth = selectRef().getBoundingClientRect().width;
2256
+ if (select && dropdown) {
2257
+ const dropdownWidth = dropdown.getBoundingClientRect().width;
2258
+ const selectWidth = select.getBoundingClientRect().width;
2189
2259
  if (dropdownWidth !== selectWidth) {
2190
- setDropdownRef(old => {
2191
- if (!old) return;
2192
- old.style.width = `${selectWidth}px`;
2193
- return old;
2194
- });
2260
+ dropdown.style.width = `${selectWidth}px`;
2195
2261
  }
2196
2262
  }
2197
2263
  });
2264
+ // --- Form sync effects ---
2198
2265
  createEffect(() => {
2199
2266
  if (hasFormContext) {
2200
2267
  const value = currentValue();
@@ -2207,7 +2274,7 @@ function Select(props) {
2207
2274
  form.setValue?.(value);
2208
2275
  }
2209
2276
  });
2210
- const isTransparent = Object.keys(props).includes("transparent") || props.transparent === true;
2277
+ const isTransparent = props.transparent !== undefined || props.transparent === true;
2211
2278
  const styleClassTransparent = isTransparent ? "solid_select__transparent" : "";
2212
2279
  // Give Current Value to Props
2213
2280
  createEffect(() => {
@@ -2215,6 +2282,8 @@ function Select(props) {
2215
2282
  });
2216
2283
  useClickOutside([dropdownRef, selectRef], () => {
2217
2284
  if (isDisabled()) return;
2285
+ // Desktop mode uses click-outside; mobile popup uses backdrop tap
2286
+ if (resolvedMode() === 'popup') return;
2218
2287
  setOpen(false);
2219
2288
  form?.setFocused?.(prev => {
2220
2289
  if (prev) {
@@ -2254,35 +2323,62 @@ function Select(props) {
2254
2323
  if (dropdown) {
2255
2324
  ignoreWindowManager(dropdown);
2256
2325
  }
2257
- document.addEventListener('scroll', updatePosition, true);
2258
- window.addEventListener('resize', updatePosition);
2259
- onCleanup(() => {
2260
- document.removeEventListener('scroll', updatePosition, true);
2261
- window.removeEventListener('resize', updatePosition);
2262
- });
2263
2326
  });
2327
+ // --- Mobile popup window manager lifecycle ---
2328
+ const closeMobilePopup = () => {
2329
+ setOpen(false);
2330
+ form?.setFocused?.(prev => {
2331
+ if (prev) {
2332
+ formContext?.formGroup?.validate?.(form?.formName ?? '');
2333
+ }
2334
+ return false;
2335
+ });
2336
+ };
2264
2337
  children(() => props.children);
2265
- const selectDropX = createMemo(() => `${selectLocation().x}px`);
2266
- const selectDropY = createMemo(() => `${selectLocation().y}px`);
2267
- createEffect(() => {
2268
- if (open()) {
2269
- // Wait a tick so dropdown renders before measuring
2270
- queueMicrotask(() => updatePosition());
2271
- }
2272
- });
2273
- createEffect(() => {
2274
- const entries = optionEntries();
2275
- if (!entries.length) {
2276
- if (highlightedIndex() !== -1) setHighlightedIndex(-1);
2277
- return;
2278
- }
2279
- if (highlightedIndex() >= entries.length) {
2280
- setHighlightedIndex(entries.length - 1);
2338
+ const selectLocation = createMemo(() => {
2339
+ const select = selectRef();
2340
+ const menuLoc = menuLocRef();
2341
+ const getLocation = rect => {
2342
+ if (dropTop()) {
2343
+ return {
2344
+ x: rect.left,
2345
+ y: rect.top - rect.height
2346
+ };
2347
+ }
2348
+ return {
2349
+ x: rect.left,
2350
+ y: rect.bottom
2351
+ };
2352
+ };
2353
+ if (hasForm || hasFormContext) {
2354
+ if (menuLoc) {
2355
+ const rect = menuRect() ?? menuLoc.getBoundingClientRect();
2356
+ return getLocation(rect);
2357
+ } else if (select) {
2358
+ const rect = select.getBoundingClientRect();
2359
+ return getLocation(rect);
2360
+ }
2361
+ } else {
2362
+ if (select) {
2363
+ const rect = select.getBoundingClientRect();
2364
+ return getLocation(rect);
2365
+ }
2281
2366
  }
2367
+ return {
2368
+ x: 0,
2369
+ y: 0
2370
+ };
2282
2371
  });
2372
+ const selectDropX = createMemo(() => `${selectLocation().x}px`);
2373
+ const selectDropY = createMemo(() => `${selectLocation().y}px`);
2374
+ // --- Open/close effects ---
2283
2375
  createEffect(() => {
2284
2376
  if (open()) {
2285
2377
  setHighlightToSelectedOrFirst();
2378
+ // Auto-focus mobile popup for keyboard interaction
2379
+ if (resolvedMode() === 'popup') {
2380
+ queueMicrotask(() => mobilePopupRef()?.focus());
2381
+ }
2286
2382
  } else {
2287
2383
  setHighlightedIndex(-1);
2288
2384
  resetTypeahead();
@@ -2293,11 +2389,7 @@ function Select(props) {
2293
2389
  setOpen(false);
2294
2390
  }
2295
2391
  });
2296
- onCleanup(() => {
2297
- if (typeaheadTimeoutId) {
2298
- window.clearTimeout(typeaheadTimeoutId);
2299
- }
2300
- });
2392
+ // --- Context provider value ---
2301
2393
  const providerValue = createMemo(() => ({
2302
2394
  isSelected,
2303
2395
  selectValue,
@@ -2311,73 +2403,113 @@ function Select(props) {
2311
2403
  },
2312
2404
  selectRef,
2313
2405
  selectStyle: currStyle,
2314
- isDisabled
2406
+ isDisabled,
2407
+ closeDropdown: () => {
2408
+ if (!isMultiple) setOpen(false);
2409
+ }
2315
2410
  }));
2316
- const [dropTop, setDropTop] = createSignal(false);
2317
- return (() => {
2318
- var _el$7 = _tmpl$5$1(),
2319
- _el$8 = _el$7.firstChild,
2320
- _el$9 = _el$8.firstChild;
2321
- _el$7.$$keydown = e => {
2322
- if (isDisabled()) return;
2323
- if (e.key === "Tab") {
2324
- setOpen(false);
2325
- return;
2411
+ // --- Keyboard handler ---
2412
+ const handleKeyDown = e => {
2413
+ if (isDisabled()) return;
2414
+ if (e.key === "Tab") {
2415
+ setOpen(false);
2416
+ return;
2417
+ }
2418
+ if (e.key === "ArrowDown") {
2419
+ e.preventDefault();
2420
+ if (!open()) {
2421
+ setOpen(true);
2422
+ setHighlightToSelectedOrFirst();
2423
+ } else {
2424
+ moveHighlight(1);
2326
2425
  }
2327
- if (e.key === "ArrowDown") {
2426
+ } else if (e.key === "ArrowUp") {
2427
+ e.preventDefault();
2428
+ if (!open()) {
2429
+ setOpen(true);
2430
+ setHighlightToSelectedOrFirst();
2431
+ } else {
2432
+ moveHighlight(-1);
2433
+ }
2434
+ } else if (e.key === "Home") {
2435
+ e.preventDefault();
2436
+ if (!open()) setOpen(true);
2437
+ if (optionEntries().length) {
2438
+ setHighlightedIndex(0);
2439
+ queueMicrotask(() => scrollHighlightedIntoView(0));
2440
+ }
2441
+ } else if (e.key === "End") {
2442
+ e.preventDefault();
2443
+ if (!open()) setOpen(true);
2444
+ const entries = optionEntries();
2445
+ if (entries.length) {
2446
+ const last = entries.length - 1;
2447
+ setHighlightedIndex(last);
2448
+ queueMicrotask(() => scrollHighlightedIntoView(last));
2449
+ }
2450
+ } else if (e.key === "Enter") {
2451
+ const entries = optionEntries();
2452
+ const idx = highlightedIndex();
2453
+ if (open() && entries.length && idx >= 0 && idx < entries.length) {
2328
2454
  e.preventDefault();
2329
- if (!open()) {
2330
- setOpen(true);
2331
- setHighlightToSelectedOrFirst();
2455
+ const dropdown = dropdownRef();
2456
+ const optionEls = dropdown?.querySelectorAll('[role="option"]');
2457
+ const optionEl = optionEls?.[idx];
2458
+ if (optionEl) {
2459
+ optionEl.click();
2332
2460
  } else {
2333
- moveHighlight(1);
2461
+ selectValue(entries[idx].raw);
2334
2462
  }
2335
- } else if (e.key === "ArrowUp") {
2463
+ }
2464
+ } else if (e.key === "Escape") {
2465
+ setOpen(false);
2466
+ } else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
2467
+ if (!open()) setOpen(true);
2468
+ e.preventDefault();
2469
+ handleTypeahead(e.key);
2470
+ }
2471
+ };
2472
+ // --- Mobile popup keyboard handler ---
2473
+ const mobilePopupTitle = createMemo(() => {
2474
+ const formLabel = form?.getName?.();
2475
+ if (formLabel && formLabel.trim()) return formLabel.trim();
2476
+ if (props.placeholder) return props.placeholder;
2477
+ return '';
2478
+ });
2479
+ const handleMobileKeyDown = e => {
2480
+ if (isDisabled()) return;
2481
+ if (e.key === "Escape") {
2482
+ closeMobilePopup();
2483
+ } else if (e.key === "ArrowDown") {
2484
+ e.preventDefault();
2485
+ moveHighlight(1);
2486
+ } else if (e.key === "ArrowUp") {
2487
+ e.preventDefault();
2488
+ moveHighlight(-1);
2489
+ } else if (e.key === "Enter") {
2490
+ const entries = optionEntries();
2491
+ const idx = highlightedIndex();
2492
+ if (entries.length && idx >= 0 && idx < entries.length) {
2336
2493
  e.preventDefault();
2337
- if (!open()) {
2338
- setOpen(true);
2339
- setHighlightToSelectedOrFirst();
2494
+ const popup = mobilePopupRef();
2495
+ const optionEls = popup?.querySelectorAll('[role="option"]');
2496
+ const optionEl = optionEls?.[idx];
2497
+ if (optionEl) {
2498
+ optionEl.click();
2340
2499
  } else {
2341
- moveHighlight(-1);
2342
- }
2343
- } else if (e.key === "Home") {
2344
- e.preventDefault();
2345
- if (!open()) setOpen(true);
2346
- if (optionEntries().length) {
2347
- setHighlightedIndex(0);
2348
- queueMicrotask(() => scrollHighlightedIntoView(0));
2349
- }
2350
- } else if (e.key === "End") {
2351
- e.preventDefault();
2352
- if (!open()) setOpen(true);
2353
- const entries = optionEntries();
2354
- if (entries.length) {
2355
- const last = entries.length - 1;
2356
- setHighlightedIndex(last);
2357
- queueMicrotask(() => scrollHighlightedIntoView(last));
2358
- }
2359
- } else if (e.key === "Enter") {
2360
- const entries = optionEntries();
2361
- const idx = highlightedIndex();
2362
- if (open() && entries.length && idx >= 0 && idx < entries.length) {
2363
- e.preventDefault();
2364
- const dropdown = dropdownRef();
2365
- const optionEls = dropdown?.querySelectorAll('[role="option"]');
2366
- const optionEl = optionEls?.[idx];
2367
- if (optionEl) {
2368
- optionEl.click();
2369
- } else {
2370
- selectValue(entries[idx].raw);
2371
- }
2500
+ selectValue(entries[idx].raw);
2372
2501
  }
2373
- } else if (e.key === "Escape") {
2374
- setOpen(false);
2375
- } else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
2376
- if (!open()) setOpen(true);
2377
- e.preventDefault();
2378
- handleTypeahead(e.key);
2379
2502
  }
2380
- };
2503
+ } else if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
2504
+ e.preventDefault();
2505
+ handleTypeahead(e.key);
2506
+ }
2507
+ };
2508
+ return (() => {
2509
+ var _el$7 = _tmpl$7$1(),
2510
+ _el$8 = _el$7.firstChild,
2511
+ _el$9 = _el$8.firstChild;
2512
+ addEventListener(_el$7, "keydown", resolvedMode() === 'popup' ? undefined : handleKeyDown, true);
2381
2513
  _el$7.addEventListener("focus", () => {
2382
2514
  if (isDisabled()) return;
2383
2515
  form?.setFocused?.(true);
@@ -2407,7 +2539,7 @@ function Select(props) {
2407
2539
  return !open();
2408
2540
  },
2409
2541
  get children() {
2410
- var _el$11 = _tmpl$3$2();
2542
+ var _el$11 = _tmpl$3$3();
2411
2543
  createRenderEffect(() => className(_el$11, styles$7['solid_select__arrow']));
2412
2544
  return _el$11;
2413
2545
  }
@@ -2417,51 +2549,140 @@ function Select(props) {
2417
2549
  return providerValue();
2418
2550
  },
2419
2551
  get children() {
2420
- return createComponent(Portal, {
2552
+ return [createComponent(Show, {
2553
+ get when() {
2554
+ return resolvedMode() === 'desktop';
2555
+ },
2421
2556
  get children() {
2422
- var _el$12 = _tmpl$4$1();
2423
- use(setDropdownRef, _el$12);
2424
- insert(_el$12, () => props.children);
2425
- createRenderEffect(_p$ => {
2426
- var _v$ = `${styles$7['solid_select__dropdown']} ${dropTop() ? styles$7.dropTop : styles$7.dropBottom} ${open() ? styles$7.open : ''} ${props.dropdownClass || ""}`,
2427
- _v$2 = selectDropY(),
2428
- _v$3 = selectDropX(),
2429
- _v$4 = `${menuLocRef()?.getBoundingClientRect().width ?? 100}px !important`;
2430
- _v$ !== _p$.e && className(_el$12, _p$.e = _v$);
2431
- _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$12.style.setProperty("top", _v$2) : _el$12.style.removeProperty("top"));
2432
- _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$12.style.setProperty("left", _v$3) : _el$12.style.removeProperty("left"));
2433
- _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$12.style.setProperty("width", _v$4) : _el$12.style.removeProperty("width"));
2434
- return _p$;
2435
- }, {
2436
- e: undefined,
2437
- t: undefined,
2438
- a: undefined,
2439
- o: undefined
2557
+ return createComponent(Portal, {
2558
+ get children() {
2559
+ var _el$12 = _tmpl$4$2();
2560
+ use(setDropdownRef, _el$12);
2561
+ insert(_el$12, () => props.children);
2562
+ createRenderEffect(_p$ => {
2563
+ var _v$ = `${styles$7['solid_select__dropdown']} ${dropTop() ? styles$7.dropTop : styles$7.dropBottom} ${open() ? styles$7.open : ''} ${props.dropdownClass || ""}`,
2564
+ _v$2 = selectDropY(),
2565
+ _v$3 = selectDropX(),
2566
+ _v$4 = `${menuLocRef()?.getBoundingClientRect().width ?? 100}px !important`;
2567
+ _v$ !== _p$.e && className(_el$12, _p$.e = _v$);
2568
+ _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$12.style.setProperty("top", _v$2) : _el$12.style.removeProperty("top"));
2569
+ _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$12.style.setProperty("left", _v$3) : _el$12.style.removeProperty("left"));
2570
+ _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$12.style.setProperty("width", _v$4) : _el$12.style.removeProperty("width"));
2571
+ return _p$;
2572
+ }, {
2573
+ e: undefined,
2574
+ t: undefined,
2575
+ a: undefined,
2576
+ o: undefined
2577
+ });
2578
+ return _el$12;
2579
+ }
2440
2580
  });
2441
- return _el$12;
2442
2581
  }
2443
- });
2582
+ }), createComponent(Show, {
2583
+ get when() {
2584
+ return resolvedMode() === 'popup';
2585
+ },
2586
+ get children() {
2587
+ return createComponent(Portal, {
2588
+ get children() {
2589
+ return createComponent(Show, {
2590
+ get when() {
2591
+ return open();
2592
+ },
2593
+ get children() {
2594
+ var _el$13 = _tmpl$6$1(),
2595
+ _el$14 = _el$13.firstChild,
2596
+ _el$15 = _el$14.firstChild,
2597
+ _el$16 = _el$15.firstChild,
2598
+ _el$17 = _el$16.nextSibling,
2599
+ _el$18 = _el$15.nextSibling;
2600
+ _el$13.$$mousedown = e => {
2601
+ // Close when clicking the backdrop itself (outside the popup)
2602
+ if (e.target === e.currentTarget) {
2603
+ closeMobilePopup();
2604
+ }
2605
+ };
2606
+ use(el => ignoreWindowManager(el), _el$13);
2607
+ _el$14.$$keydown = handleMobileKeyDown;
2608
+ use(setMobilePopupRef, _el$14);
2609
+ insert(_el$16, mobilePopupTitle);
2610
+ _el$17.$$click = () => closeMobilePopup();
2611
+ insert(_el$18, () => props.children);
2612
+ insert(_el$14, createComponent(Show, {
2613
+ when: isMultiple,
2614
+ get children() {
2615
+ var _el$19 = _tmpl$5$1(),
2616
+ _el$20 = _el$19.firstChild;
2617
+ _el$20.$$click = () => closeMobilePopup();
2618
+ createRenderEffect(_p$ => {
2619
+ var _v$5 = styles$7['solid_select__mobile_footer'],
2620
+ _v$6 = styles$7['solid_select__mobile_done'];
2621
+ _v$5 !== _p$.e && className(_el$19, _p$.e = _v$5);
2622
+ _v$6 !== _p$.t && className(_el$20, _p$.t = _v$6);
2623
+ return _p$;
2624
+ }, {
2625
+ e: undefined,
2626
+ t: undefined
2627
+ });
2628
+ return _el$19;
2629
+ }
2630
+ }), null);
2631
+ createRenderEffect(_p$ => {
2632
+ var _v$7 = styles$7['solid_select__mobile_backdrop'],
2633
+ _v$8 = mobilePopupTitle() || undefined,
2634
+ _v$9 = `${styles$7['solid_select__mobile_popup']} ${props.dropdownClass || ""}`,
2635
+ _v$10 = styles$7['solid_select__mobile_header'],
2636
+ _v$11 = styles$7['solid_select__mobile_title'],
2637
+ _v$12 = styles$7['solid_select__mobile_close'],
2638
+ _v$13 = styles$7['solid_select__mobile_options'];
2639
+ _v$7 !== _p$.e && className(_el$13, _p$.e = _v$7);
2640
+ _v$8 !== _p$.t && setAttribute(_el$14, "aria-label", _p$.t = _v$8);
2641
+ _v$9 !== _p$.a && className(_el$14, _p$.a = _v$9);
2642
+ _v$10 !== _p$.o && className(_el$15, _p$.o = _v$10);
2643
+ _v$11 !== _p$.i && className(_el$16, _p$.i = _v$11);
2644
+ _v$12 !== _p$.n && className(_el$17, _p$.n = _v$12);
2645
+ _v$13 !== _p$.s && className(_el$18, _p$.s = _v$13);
2646
+ return _p$;
2647
+ }, {
2648
+ e: undefined,
2649
+ t: undefined,
2650
+ a: undefined,
2651
+ o: undefined,
2652
+ i: undefined,
2653
+ n: undefined,
2654
+ s: undefined
2655
+ });
2656
+ return _el$13;
2657
+ }
2658
+ });
2659
+ }
2660
+ });
2661
+ }
2662
+ })];
2444
2663
  }
2445
2664
  }), null);
2446
2665
  createRenderEffect(_p$ => {
2447
- var _v$5 = props.id,
2448
- _v$6 = `${styles$7.solid_select__control_no_form} ${styles$7[styleClassTransparent]} ${isDisabled() ? styles$7.solid_select__disabled : ''} coles-solid-selectControl`,
2449
- _v$7 = isDisabled() ? false : open(),
2450
- _v$8 = isDisabled(),
2451
- _v$9 = props.tooltip,
2452
- _v$10 = `${styles$7['solid_select__control']} ${props.class || ""} ${isDisabled() ? styles$7.solid_select__disabled : ''}`,
2453
- _v$11 = !hasForm ? {
2666
+ var _v$14 = props.id,
2667
+ _v$15 = `${styles$7.solid_select__control_no_form} ${styles$7[styleClassTransparent]} ${isDisabled() ? styles$7.solid_select__disabled : ''} coles-solid-selectControl`,
2668
+ _v$16 = resolvedMode() === 'popup' ? 'dialog' : 'listbox',
2669
+ _v$17 = isDisabled() ? false : open(),
2670
+ _v$18 = isDisabled(),
2671
+ _v$19 = props.tooltip,
2672
+ _v$20 = `${styles$7['solid_select__control']} ${props.class || ""} ${isDisabled() ? styles$7.solid_select__disabled : ''}`,
2673
+ _v$21 = !hasForm ? {
2454
2674
  height: '48px'
2455
2675
  } : {},
2456
- _v$12 = styles$7['solid_select__value'];
2457
- _v$5 !== _p$.e && (_el$7.id = _p$.e = _v$5);
2458
- _v$6 !== _p$.t && className(_el$7, _p$.t = _v$6);
2459
- _v$7 !== _p$.a && (_el$7.ariaExpanded = _p$.a = _v$7);
2460
- _v$8 !== _p$.o && (_el$7.ariaDisabled = _p$.o = _v$8);
2461
- _v$9 !== _p$.i && (_el$7.title = _p$.i = _v$9);
2462
- _v$10 !== _p$.n && className(_el$8, _p$.n = _v$10);
2463
- _p$.s = style$9(_el$8, _v$11, _p$.s);
2464
- _v$12 !== _p$.h && className(_el$9, _p$.h = _v$12);
2676
+ _v$22 = styles$7['solid_select__value'];
2677
+ _v$14 !== _p$.e && (_el$7.id = _p$.e = _v$14);
2678
+ _v$15 !== _p$.t && className(_el$7, _p$.t = _v$15);
2679
+ _v$16 !== _p$.a && (_el$7.ariaHaspopup = _p$.a = _v$16);
2680
+ _v$17 !== _p$.o && (_el$7.ariaExpanded = _p$.o = _v$17);
2681
+ _v$18 !== _p$.i && (_el$7.ariaDisabled = _p$.i = _v$18);
2682
+ _v$19 !== _p$.n && (_el$7.title = _p$.n = _v$19);
2683
+ _v$20 !== _p$.s && className(_el$8, _p$.s = _v$20);
2684
+ _p$.h = style$9(_el$8, _v$21, _p$.h);
2685
+ _v$22 !== _p$.r && className(_el$9, _p$.r = _v$22);
2465
2686
  return _p$;
2466
2687
  }, {
2467
2688
  e: undefined,
@@ -2471,12 +2692,13 @@ function Select(props) {
2471
2692
  i: undefined,
2472
2693
  n: undefined,
2473
2694
  s: undefined,
2474
- h: undefined
2695
+ h: undefined,
2696
+ r: undefined
2475
2697
  });
2476
2698
  return _el$7;
2477
2699
  })();
2478
2700
  }
2479
- delegateEvents(["keydown", "click"]);
2701
+ delegateEvents(["keydown", "click", "mousedown"]);
2480
2702
 
2481
2703
  var _tmpl$$f = /*#__PURE__*/template(`<div role=option><span></span><span is=coles-select-label>`, true, false, false);
2482
2704
  function Option(props) {
@@ -2550,8 +2772,11 @@ function Option(props) {
2550
2772
  !contextSuccess ? selectFormFieldValue(props.value) : true;
2551
2773
  if (!formField?.getName?.()) {
2552
2774
  select.selectValue?.(props.value);
2553
- formField?.setFocused?.(true);
2775
+ } else {
2776
+ // Form handled the value — still need to close for single select
2777
+ select.closeDropdown?.();
2554
2778
  }
2779
+ formField?.setFocused?.(true);
2555
2780
  };
2556
2781
  return (() => {
2557
2782
  var _el$ = _tmpl$$f(),
@@ -2724,13 +2949,20 @@ var style$3 = {"popup":"popup-module_popup__5A6Ji","wrapper":"popup-module_wrapp
2724
2949
  styleInject(css_248z$a);
2725
2950
 
2726
2951
  var _tmpl$$d = /*#__PURE__*/template(`<b>X`),
2727
- _tmpl$2$7 = /*#__PURE__*/template(`<div><div><div><h2></h2><span></span></div><div>`);
2952
+ _tmpl$2$7 = /*#__PURE__*/template(`<div><h2></h2><span>`),
2953
+ _tmpl$3$2 = /*#__PURE__*/template(`<div>`),
2954
+ _tmpl$4$1 = /*#__PURE__*/template(`<div><div>`);
2728
2955
  const Modal = props => {
2729
2956
  const defaultX = createMemo(() => props.translate?.x ?? "-50%");
2730
2957
  const defaultY = createMemo(() => props.translate?.y ?? "-50%");
2731
2958
  const isShown = createMemo(() => props.show[0]());
2732
2959
  const [innerPopup, setInnerPopup] = createSignal();
2733
2960
  // const [ignoreClicks, setIgnoreClicks] = createSignal(true);
2961
+ const showHeader = createMemo(() => {
2962
+ const hasKey = Object.keys(props).includes("noHeader");
2963
+ if (hasKey && props.noHeader === undefined) return false;
2964
+ return !props.noHeader;
2965
+ });
2734
2966
  // Maintain a stable entry reference so unregister removes the correct instance.
2735
2967
  let wmEntry;
2736
2968
  createEffect(() => {
@@ -2794,50 +3026,70 @@ const Modal = props => {
2794
3026
  get children() {
2795
3027
  return createComponent(Portal, {
2796
3028
  get children() {
2797
- var _el$ = _tmpl$2$7(),
2798
- _el$2 = _el$.firstChild,
2799
- _el$3 = _el$2.firstChild,
2800
- _el$4 = _el$3.firstChild,
2801
- _el$5 = _el$4.nextSibling,
2802
- _el$7 = _el$3.nextSibling;
3029
+ var _el$ = _tmpl$4$1(),
3030
+ _el$2 = _el$.firstChild;
2803
3031
  use(el => {
2804
3032
  setInnerPopup(el);
2805
3033
  // @ts-ignore
2806
3034
  props?.ref?.(el);
2807
3035
  }, _el$2);
2808
- insert(_el$4, () => props.title ?? "Modal");
2809
- insert(_el$5, createComponent(Button, {
2810
- transparent: true,
2811
- onClick: () => props.show[1](false),
3036
+ insert(_el$2, createComponent(Show, {
3037
+ get when() {
3038
+ return showHeader();
3039
+ },
2812
3040
  get children() {
2813
- return _tmpl$$d();
3041
+ return [(() => {
3042
+ var _el$3 = _tmpl$2$7(),
3043
+ _el$4 = _el$3.firstChild,
3044
+ _el$5 = _el$4.nextSibling;
3045
+ insert(_el$4, () => props.title ?? "Modal");
3046
+ insert(_el$5, createComponent(Button, {
3047
+ transparent: true,
3048
+ onClick: () => props.show[1](false),
3049
+ get children() {
3050
+ return _tmpl$$d();
3051
+ }
3052
+ }));
3053
+ createRenderEffect(() => className(_el$3, style$3.header));
3054
+ return _el$3;
3055
+ })(), (() => {
3056
+ var _el$7 = _tmpl$3$2();
3057
+ insert(_el$7, () => props.children);
3058
+ createRenderEffect(() => className(_el$7, style$3.body));
3059
+ return _el$7;
3060
+ })()];
2814
3061
  }
2815
- }));
2816
- insert(_el$7, () => props.children);
3062
+ }), null);
3063
+ insert(_el$2, createComponent(Show, {
3064
+ get when() {
3065
+ return !showHeader();
3066
+ },
3067
+ get children() {
3068
+ var _el$8 = _tmpl$3$2();
3069
+ _el$8.style.setProperty("height", "100%");
3070
+ insert(_el$8, () => props.children);
3071
+ createRenderEffect(() => className(_el$8, style$3.body));
3072
+ return _el$8;
3073
+ }
3074
+ }), null);
2817
3075
  createRenderEffect(_p$ => {
2818
3076
  var _v$ = style$3.backdrop,
2819
3077
  _v$2 = widthStyle(),
2820
3078
  _v$3 = heightStyle(),
2821
3079
  _v$4 = shouldTranslate(),
2822
- _v$5 = `${style$3["primary"]} ${style$3.wrapper} ${style$3.popup}`,
2823
- _v$6 = style$3.header,
2824
- _v$7 = style$3.body;
3080
+ _v$5 = `${style$3["primary"]} ${style$3.wrapper} ${style$3.popup}`;
2825
3081
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
2826
3082
  _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$2.style.setProperty("width", _v$2) : _el$2.style.removeProperty("width"));
2827
3083
  _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$2.style.setProperty("height", _v$3) : _el$2.style.removeProperty("height"));
2828
3084
  _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$2.style.setProperty("transform", _v$4) : _el$2.style.removeProperty("transform"));
2829
3085
  _v$5 !== _p$.i && className(_el$2, _p$.i = _v$5);
2830
- _v$6 !== _p$.n && className(_el$3, _p$.n = _v$6);
2831
- _v$7 !== _p$.s && className(_el$7, _p$.s = _v$7);
2832
3086
  return _p$;
2833
3087
  }, {
2834
3088
  e: undefined,
2835
3089
  t: undefined,
2836
3090
  a: undefined,
2837
3091
  o: undefined,
2838
- i: undefined,
2839
- n: undefined,
2840
- s: undefined
3092
+ i: undefined
2841
3093
  });
2842
3094
  return _el$;
2843
3095
  }
@@ -3140,7 +3392,7 @@ const useMenuContext = () => {
3140
3392
 
3141
3393
  var _tmpl$$7 = /*#__PURE__*/template(`<div><ul>`);
3142
3394
  const Menu = props => {
3143
- const [local, others] = splitProps(props, ['anchorElement', 'children', 'ref', 'show', 'position']);
3395
+ const [local, others] = splitProps(props, ['anchorElement', 'children', 'ref', 'show', 'position', 'listClass']);
3144
3396
  const [menuRef, setMenuRef] = createSignal();
3145
3397
  const menuContext = useMenuContext();
3146
3398
  const openStyle = () => {
@@ -3238,7 +3490,7 @@ const Menu = props => {
3238
3490
  }
3239
3491
  }), false, true);
3240
3492
  insert(_el$2, () => local.children);
3241
- createRenderEffect(() => className(_el$2, `${styles$4.list}`));
3493
+ createRenderEffect(() => className(_el$2, `${styles$4.list} ${local.listClass ?? ''}`));
3242
3494
  return _el$;
3243
3495
  }
3244
3496
  });
@@ -3261,7 +3513,7 @@ const MenuItem = props => {
3261
3513
 
3262
3514
  var _tmpl$$5 = /*#__PURE__*/template(`<li><span><span></span></span><ul>`);
3263
3515
  const MenuDropdown = props => {
3264
- const [local, others] = splitProps(props, ['children', 'class', 'header']);
3516
+ const [local, others] = splitProps(props, ['children', 'class', 'header', 'dropListClass']);
3265
3517
  const [isOpen, setIsOpen] = createSignal(false);
3266
3518
  const onButtonClick = e => {
3267
3519
  setIsOpen(old => {
@@ -3315,7 +3567,7 @@ const MenuDropdown = props => {
3315
3567
  createRenderEffect(_p$ => {
3316
3568
  var _v$ = `${styles$4.listHeader}`,
3317
3569
  _v$2 = `${styles$4.header}`,
3318
- _v$3 = `${styles$4.list} ${styles$4.droplist} ${isOpen() ? styles$4.openDropList : ''}`;
3570
+ _v$3 = `${styles$4.list} ${styles$4.droplist} ${isOpen() ? styles$4.openDropList : ''} ${local.dropListClass ?? ''}`;
3319
3571
  _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
3320
3572
  _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
3321
3573
  _v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);