@sebgroup/green-core 3.21.0 → 3.21.1
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/components/context-menu/context-menu.component.js +3 -10
- package/components/context-menu/context-menu.trans.styles.js +6 -2
- package/components/dropdown/dropdown.component.d.ts +26 -4
- package/components/dropdown/dropdown.component.js +150 -67
- package/components/dropdown/dropdown.trans.styles.js +7 -2
- package/{primitives/listbox/listbox.trans.styles.scss.js → components/dropdown/dropdown.trans.styles.scss.js} +1 -1
- package/components/dropdown/index.d.ts +1 -1
- package/components/dropdown/index.js +1 -1
- package/{primitives/listbox → components/dropdown}/option.component.d.ts +1 -1
- package/{primitives/listbox → components/dropdown}/option.component.js +10 -4
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/custom-elements.json +35687 -35615
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/dropdown/api.md +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/alert/index.d.ts +7 -7
- package/generated/react/avatar/index.d.ts +7 -7
- package/generated/react/avatar-group/index.d.ts +7 -7
- package/generated/react/backdrop/index.d.ts +7 -7
- package/generated/react/badge/index.d.ts +7 -7
- package/generated/react/blur/index.d.ts +7 -7
- package/generated/react/breadcrumb/index.d.ts +7 -7
- package/generated/react/breadcrumbs/index.d.ts +7 -7
- package/generated/react/button/index.d.ts +7 -7
- package/generated/react/calendar/index.d.ts +7 -7
- package/generated/react/card/index.d.ts +7 -7
- package/generated/react/card-linked/index.d.ts +7 -7
- package/generated/react/card-pattern-01/index.d.ts +7 -7
- package/generated/react/checkbox/index.d.ts +7 -7
- package/generated/react/checkbox-group/index.d.ts +7 -7
- package/generated/react/coachmark/index.d.ts +7 -7
- package/generated/react/context-menu/index.d.ts +7 -7
- package/generated/react/datepicker/index.d.ts +7 -7
- package/generated/react/details/index.d.ts +7 -7
- package/generated/react/dialog/index.d.ts +7 -7
- package/generated/react/div/index.d.ts +7 -7
- package/generated/react/divider/index.d.ts +7 -7
- package/generated/react/dropdown/index.d.ts +12 -11
- package/generated/react/fab/index.d.ts +7 -7
- package/generated/react/filter-chip/index.d.ts +7 -7
- package/generated/react/filter-chips/index.d.ts +7 -7
- package/generated/react/flex/index.d.ts +7 -7
- package/generated/react/form-summary/index.d.ts +7 -7
- package/generated/react/formatted-account/index.d.ts +7 -7
- package/generated/react/formatted-date/index.d.ts +7 -7
- package/generated/react/formatted-number/index.d.ts +7 -7
- package/generated/react/grid/index.d.ts +7 -7
- package/generated/react/grouped-list/index.d.ts +7 -7
- package/generated/react/icons/icon-ai/index.d.ts +7 -7
- package/generated/react/icons/icon-airplane-up/index.d.ts +7 -7
- package/generated/react/icons/icon-archive/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-bottom-top/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-box-left/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-box-left-alt/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-box-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-down/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-inbox/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-left/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-left-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-out-of-box/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-right-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-right-down-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-right-up-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-rotate-clockwise/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-rotate-counter-clockwise/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-rotate-left-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-rotate-right-left/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-share-left/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-share-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-split/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-up/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-wall-down/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-wall-left/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-wall-right/index.d.ts +7 -7
- package/generated/react/icons/icon-arrow-wall-up/index.d.ts +7 -7
- package/generated/react/icons/icon-arrows-repeat-right/index.d.ts +7 -7
- package/generated/react/icons/icon-asterisk/index.d.ts +7 -7
- package/generated/react/icons/icon-at/index.d.ts +7 -7
- package/generated/react/icons/icon-back/index.d.ts +7 -7
- package/generated/react/icons/icon-backward/index.d.ts +7 -7
- package/generated/react/icons/icon-bag/index.d.ts +7 -7
- package/generated/react/icons/icon-bank/index.d.ts +7 -7
- package/generated/react/icons/icon-banknote/index.d.ts +7 -7
- package/generated/react/icons/icon-banknote-2/index.d.ts +7 -7
- package/generated/react/icons/icon-barcode/index.d.ts +7 -7
- package/generated/react/icons/icon-bars-three/index.d.ts +7 -7
- package/generated/react/icons/icon-bars-two/index.d.ts +7 -7
- package/generated/react/icons/icon-basket/index.d.ts +7 -7
- package/generated/react/icons/icon-battery-loading/index.d.ts +7 -7
- package/generated/react/icons/icon-bell/index.d.ts +7 -7
- package/generated/react/icons/icon-block/index.d.ts +7 -7
- package/generated/react/icons/icon-book/index.d.ts +7 -7
- package/generated/react/icons/icon-bookmark/index.d.ts +7 -7
- package/generated/react/icons/icon-bookmark-check/index.d.ts +7 -7
- package/generated/react/icons/icon-bookmark-delete/index.d.ts +7 -7
- package/generated/react/icons/icon-bookmark-plus/index.d.ts +7 -7
- package/generated/react/icons/icon-bookmark-remove/index.d.ts +7 -7
- package/generated/react/icons/icon-books/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-app-store/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-apple-music/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-bankid/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-chrome/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-facebook/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-figma/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-firefox/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-github/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-green/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-instagram/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-linkedin/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-play-store/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-rss-feed/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-seb/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-spotify/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-storybook/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-swish-word/index.d.ts +7 -7
- package/generated/react/icons/icon-brand-x/index.d.ts +7 -7
- package/generated/react/icons/icon-brush/index.d.ts +7 -7
- package/generated/react/icons/icon-bubble-annotation/index.d.ts +7 -7
- package/generated/react/icons/icon-bubbles/index.d.ts +7 -7
- package/generated/react/icons/icon-buildings/index.d.ts +7 -7
- package/generated/react/icons/icon-bullet-list/index.d.ts +7 -7
- package/generated/react/icons/icon-calculator/index.d.ts +7 -7
- package/generated/react/icons/icon-calendar/index.d.ts +7 -7
- package/generated/react/icons/icon-calendar-check/index.d.ts +7 -7
- package/generated/react/icons/icon-calendar-repeat/index.d.ts +7 -7
- package/generated/react/icons/icon-calender-add/index.d.ts +7 -7
- package/generated/react/icons/icon-call/index.d.ts +7 -7
- package/generated/react/icons/icon-car/index.d.ts +7 -7
- package/generated/react/icons/icon-carussel/index.d.ts +7 -7
- package/generated/react/icons/icon-chain-link/index.d.ts +7 -7
- package/generated/react/icons/icon-chain-link-broken/index.d.ts +7 -7
- package/generated/react/icons/icon-chart-two/index.d.ts +7 -7
- package/generated/react/icons/icon-checklist/index.d.ts +7 -7
- package/generated/react/icons/icon-checkmark/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-bottom/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-double-down/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-double-left/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-double-right/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-double-up/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-down-small/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-grabber-vertical/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-grabber-vertical-reversed/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-left/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-left-small/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-right/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-right-small/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-top/index.d.ts +7 -7
- package/generated/react/icons/icon-chevron-top-small/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-ban/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-check/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-dots/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-info/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-minus/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-placeholder-on/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-plus/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-questionmark/index.d.ts +7 -7
- package/generated/react/icons/icon-circle-x/index.d.ts +7 -7
- package/generated/react/icons/icon-circles-three/index.d.ts +7 -7
- package/generated/react/icons/icon-clock/index.d.ts +7 -7
- package/generated/react/icons/icon-cloud-download/index.d.ts +7 -7
- package/generated/react/icons/icon-cloud-upload/index.d.ts +7 -7
- package/generated/react/icons/icon-cloudy-sun/index.d.ts +7 -7
- package/generated/react/icons/icon-code/index.d.ts +7 -7
- package/generated/react/icons/icon-code-brackets/index.d.ts +7 -7
- package/generated/react/icons/icon-compass-round/index.d.ts +7 -7
- package/generated/react/icons/icon-cookies/index.d.ts +7 -7
- package/generated/react/icons/icon-copy/index.d.ts +7 -7
- package/generated/react/icons/icon-credit-card/index.d.ts +7 -7
- package/generated/react/icons/icon-credit-card-add/index.d.ts +7 -7
- package/generated/react/icons/icon-cross-large/index.d.ts +7 -7
- package/generated/react/icons/icon-cross-small/index.d.ts +7 -7
- package/generated/react/icons/icon-cup-hot/index.d.ts +7 -7
- package/generated/react/icons/icon-cursor/index.d.ts +7 -7
- package/generated/react/icons/icon-details/index.d.ts +7 -7
- package/generated/react/icons/icon-devices/index.d.ts +7 -7
- package/generated/react/icons/icon-direction/index.d.ts +7 -7
- package/generated/react/icons/icon-dollar/index.d.ts +7 -7
- package/generated/react/icons/icon-dot-grid-one-horizontal/index.d.ts +7 -7
- package/generated/react/icons/icon-dot-grid-one-vertical/index.d.ts +7 -7
- package/generated/react/icons/icon-dot-grid-three/index.d.ts +7 -7
- package/generated/react/icons/icon-dot-grid-two/index.d.ts +7 -7
- package/generated/react/icons/icon-email/index.d.ts +7 -7
- package/generated/react/icons/icon-emoji-angry/index.d.ts +7 -7
- package/generated/react/icons/icon-emoji-neutral/index.d.ts +7 -7
- package/generated/react/icons/icon-emoji-sad/index.d.ts +7 -7
- package/generated/react/icons/icon-emoji-smile/index.d.ts +7 -7
- package/generated/react/icons/icon-emoji-smiley/index.d.ts +7 -7
- package/generated/react/icons/icon-euro/index.d.ts +7 -7
- package/generated/react/icons/icon-expand/index.d.ts +7 -7
- package/generated/react/icons/icon-eye-open/index.d.ts +7 -7
- package/generated/react/icons/icon-eye-slash/index.d.ts +7 -7
- package/generated/react/icons/icon-fashion/index.d.ts +7 -7
- package/generated/react/icons/icon-fast-forward/index.d.ts +7 -7
- package/generated/react/icons/icon-file-bend/index.d.ts +7 -7
- package/generated/react/icons/icon-file-chart/index.d.ts +7 -7
- package/generated/react/icons/icon-file-text/index.d.ts +7 -7
- package/generated/react/icons/icon-files/index.d.ts +7 -7
- package/generated/react/icons/icon-filter/index.d.ts +7 -7
- package/generated/react/icons/icon-flag/index.d.ts +7 -7
- package/generated/react/icons/icon-floppy-disk/index.d.ts +7 -7
- package/generated/react/icons/icon-focus/index.d.ts +7 -7
- package/generated/react/icons/icon-folder/index.d.ts +7 -7
- package/generated/react/icons/icon-folder-add-right/index.d.ts +7 -7
- package/generated/react/icons/icon-fullscreen/index.d.ts +7 -7
- package/generated/react/icons/icon-gift/index.d.ts +7 -7
- package/generated/react/icons/icon-globus/index.d.ts +7 -7
- package/generated/react/icons/icon-graduate-cap/index.d.ts +7 -7
- package/generated/react/icons/icon-green-power/index.d.ts +7 -7
- package/generated/react/icons/icon-group/index.d.ts +7 -7
- package/generated/react/icons/icon-growth/index.d.ts +7 -7
- package/generated/react/icons/icon-headphones/index.d.ts +7 -7
- package/generated/react/icons/icon-heart/index.d.ts +7 -7
- package/generated/react/icons/icon-heart-beat/index.d.ts +7 -7
- package/generated/react/icons/icon-history/index.d.ts +7 -7
- package/generated/react/icons/icon-home-energy-one/index.d.ts +7 -7
- package/generated/react/icons/icon-home-energy-two/index.d.ts +7 -7
- package/generated/react/icons/icon-home-open/index.d.ts +7 -7
- package/generated/react/icons/icon-home-roof/index.d.ts +7 -7
- package/generated/react/icons/icon-horizontal-alignment-bottom/index.d.ts +7 -7
- package/generated/react/icons/icon-hourglass/index.d.ts +7 -7
- package/generated/react/icons/icon-images/index.d.ts +7 -7
- package/generated/react/icons/icon-inbox-empty/index.d.ts +7 -7
- package/generated/react/icons/icon-industry/index.d.ts +7 -7
- package/generated/react/icons/icon-jpg/index.d.ts +7 -7
- package/generated/react/icons/icon-key/index.d.ts +7 -7
- package/generated/react/icons/icon-knife-spoon/index.d.ts +7 -7
- package/generated/react/icons/icon-lab/index.d.ts +7 -7
- package/generated/react/icons/icon-law/index.d.ts +7 -7
- package/generated/react/icons/icon-leisure/index.d.ts +7 -7
- package/generated/react/icons/icon-light-bulb-simple/index.d.ts +7 -7
- package/generated/react/icons/icon-lightning/index.d.ts +7 -7
- package/generated/react/icons/icon-line-chart-four/index.d.ts +7 -7
- package/generated/react/icons/icon-line-chart-one/index.d.ts +7 -7
- package/generated/react/icons/icon-line-chart-three/index.d.ts +7 -7
- package/generated/react/icons/icon-line-chart-two/index.d.ts +7 -7
- package/generated/react/icons/icon-lock/index.d.ts +7 -7
- package/generated/react/icons/icon-macbook-air/index.d.ts +7 -7
- package/generated/react/icons/icon-magnifying-glass/index.d.ts +7 -7
- package/generated/react/icons/icon-map-pin/index.d.ts +7 -7
- package/generated/react/icons/icon-megaphone/index.d.ts +7 -7
- package/generated/react/icons/icon-menu-sidebar/index.d.ts +7 -7
- package/generated/react/icons/icon-mic-off/index.d.ts +7 -7
- package/generated/react/icons/icon-mic-on/index.d.ts +7 -7
- package/generated/react/icons/icon-minimize/index.d.ts +7 -7
- package/generated/react/icons/icon-minus-large/index.d.ts +7 -7
- package/generated/react/icons/icon-minus-small/index.d.ts +7 -7
- package/generated/react/icons/icon-money-hand/index.d.ts +7 -7
- package/generated/react/icons/icon-moneybag/index.d.ts +7 -7
- package/generated/react/icons/icon-moon/index.d.ts +7 -7
- package/generated/react/icons/icon-mute/index.d.ts +7 -7
- package/generated/react/icons/icon-newspaper/index.d.ts +7 -7
- package/generated/react/icons/icon-office/index.d.ts +7 -7
- package/generated/react/icons/icon-page-add/index.d.ts +7 -7
- package/generated/react/icons/icon-paper-plane-top-right/index.d.ts +7 -7
- package/generated/react/icons/icon-paperclip/index.d.ts +7 -7
- package/generated/react/icons/icon-pause/index.d.ts +7 -7
- package/generated/react/icons/icon-pdf/index.d.ts +7 -7
- package/generated/react/icons/icon-pencil-sign/index.d.ts +7 -7
- package/generated/react/icons/icon-pencil-sparkle/index.d.ts +7 -7
- package/generated/react/icons/icon-pencil-wave/index.d.ts +7 -7
- package/generated/react/icons/icon-pension/index.d.ts +7 -7
- package/generated/react/icons/icon-people/index.d.ts +7 -7
- package/generated/react/icons/icon-people-a11y/index.d.ts +7 -7
- package/generated/react/icons/icon-people-add/index.d.ts +7 -7
- package/generated/react/icons/icon-people-added/index.d.ts +7 -7
- package/generated/react/icons/icon-people-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-people-copy/index.d.ts +7 -7
- package/generated/react/icons/icon-people-profile/index.d.ts +7 -7
- package/generated/react/icons/icon-people-remove/index.d.ts +7 -7
- package/generated/react/icons/icon-percent/index.d.ts +7 -7
- package/generated/react/icons/icon-phone/index.d.ts +7 -7
- package/generated/react/icons/icon-pie-chart/index.d.ts +7 -7
- package/generated/react/icons/icon-piggy-bank/index.d.ts +7 -7
- package/generated/react/icons/icon-pin/index.d.ts +7 -7
- package/generated/react/icons/icon-pinch/index.d.ts +7 -7
- package/generated/react/icons/icon-play/index.d.ts +7 -7
- package/generated/react/icons/icon-play-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-plus-large/index.d.ts +7 -7
- package/generated/react/icons/icon-plus-small/index.d.ts +7 -7
- package/generated/react/icons/icon-png/index.d.ts +7 -7
- package/generated/react/icons/icon-poop/index.d.ts +7 -7
- package/generated/react/icons/icon-postcard/index.d.ts +7 -7
- package/generated/react/icons/icon-pound/index.d.ts +7 -7
- package/generated/react/icons/icon-power/index.d.ts +7 -7
- package/generated/react/icons/icon-power-plant/index.d.ts +7 -7
- package/generated/react/icons/icon-printer/index.d.ts +7 -7
- package/generated/react/icons/icon-push/index.d.ts +7 -7
- package/generated/react/icons/icon-qr-code/index.d.ts +7 -7
- package/generated/react/icons/icon-rainy/index.d.ts +7 -7
- package/generated/react/icons/icon-raising-hand/index.d.ts +7 -7
- package/generated/react/icons/icon-reading-list/index.d.ts +7 -7
- package/generated/react/icons/icon-receipt-bill/index.d.ts +7 -7
- package/generated/react/icons/icon-receiption-bell/index.d.ts +7 -7
- package/generated/react/icons/icon-record/index.d.ts +7 -7
- package/generated/react/icons/icon-refund/index.d.ts +7 -7
- package/generated/react/icons/icon-robot/index.d.ts +7 -7
- package/generated/react/icons/icon-rocket/index.d.ts +7 -7
- package/generated/react/icons/icon-run-shortcut/index.d.ts +7 -7
- package/generated/react/icons/icon-safari/index.d.ts +7 -7
- package/generated/react/icons/icon-school/index.d.ts +7 -7
- package/generated/react/icons/icon-scissors/index.d.ts +7 -7
- package/generated/react/icons/icon-search-menu/index.d.ts +7 -7
- package/generated/react/icons/icon-settings-gear/index.d.ts +7 -7
- package/generated/react/icons/icon-settings-slider-hor/index.d.ts +7 -7
- package/generated/react/icons/icon-settings-slider-ver/index.d.ts +7 -7
- package/generated/react/icons/icon-shapes/index.d.ts +7 -7
- package/generated/react/icons/icon-share/index.d.ts +7 -7
- package/generated/react/icons/icon-shield/index.d.ts +7 -7
- package/generated/react/icons/icon-shield-checked/index.d.ts +7 -7
- package/generated/react/icons/icon-shield-crossed/index.d.ts +7 -7
- package/generated/react/icons/icon-shopping-bag/index.d.ts +7 -7
- package/generated/react/icons/icon-signature/index.d.ts +7 -7
- package/generated/react/icons/icon-smartwatch/index.d.ts +7 -7
- package/generated/react/icons/icon-solar/index.d.ts +7 -7
- package/generated/react/icons/icon-sort/index.d.ts +7 -7
- package/generated/react/icons/icon-sort-ascending/index.d.ts +7 -7
- package/generated/react/icons/icon-sort-descending/index.d.ts +7 -7
- package/generated/react/icons/icon-sort-down/index.d.ts +7 -7
- package/generated/react/icons/icon-sort-up/index.d.ts +7 -7
- package/generated/react/icons/icon-square-arrow-top-right/index.d.ts +7 -7
- package/generated/react/icons/icon-square-behind-square/index.d.ts +7 -7
- package/generated/react/icons/icon-square-grid-circle/index.d.ts +7 -7
- package/generated/react/icons/icon-square-placeholder/index.d.ts +7 -7
- package/generated/react/icons/icon-star/index.d.ts +7 -7
- package/generated/react/icons/icon-store/index.d.ts +7 -7
- package/generated/react/icons/icon-sun/index.d.ts +7 -7
- package/generated/react/icons/icon-sunset-arrow-down/index.d.ts +7 -7
- package/generated/react/icons/icon-tag/index.d.ts +7 -7
- package/generated/react/icons/icon-target-arrow/index.d.ts +7 -7
- package/generated/react/icons/icon-television/index.d.ts +7 -7
- package/generated/react/icons/icon-tennis/index.d.ts +7 -7
- package/generated/react/icons/icon-text-edit/index.d.ts +7 -7
- package/generated/react/icons/icon-thermostat/index.d.ts +7 -7
- package/generated/react/icons/icon-thumbs-down/index.d.ts +7 -7
- package/generated/react/icons/icon-thumbs-up/index.d.ts +7 -7
- package/generated/react/icons/icon-ticket/index.d.ts +7 -7
- package/generated/react/icons/icon-trading-view-candles/index.d.ts +7 -7
- package/generated/react/icons/icon-trash-can/index.d.ts +7 -7
- package/generated/react/icons/icon-tree/index.d.ts +7 -7
- package/generated/react/icons/icon-trending-five/index.d.ts +7 -7
- package/generated/react/icons/icon-trending-four/index.d.ts +7 -7
- package/generated/react/icons/icon-trending-one/index.d.ts +7 -7
- package/generated/react/icons/icon-trending-three/index.d.ts +7 -7
- package/generated/react/icons/icon-trending-two/index.d.ts +7 -7
- package/generated/react/icons/icon-triangle-exclamation/index.d.ts +7 -7
- package/generated/react/icons/icon-truck/index.d.ts +7 -7
- package/generated/react/icons/icon-umbrella-security/index.d.ts +7 -7
- package/generated/react/icons/icon-unlocked/index.d.ts +7 -7
- package/generated/react/icons/icon-volume-full/index.d.ts +7 -7
- package/generated/react/icons/icon-volume-half/index.d.ts +7 -7
- package/generated/react/icons/icon-volume-off/index.d.ts +7 -7
- package/generated/react/icons/icon-wallet/index.d.ts +7 -7
- package/generated/react/icons/icon-warning-sign/index.d.ts +7 -7
- package/generated/react/icons/icon-wifi-full/index.d.ts +7 -7
- package/generated/react/icons/icon-youtube/index.d.ts +7 -7
- package/generated/react/icons/icon-zap/index.d.ts +7 -7
- package/generated/react/icons/icon-zoom-in/index.d.ts +7 -7
- package/generated/react/icons/icon-zoom-out/index.d.ts +7 -7
- package/generated/react/img/index.d.ts +7 -7
- package/generated/react/index.d.ts +9 -9
- package/generated/react/index.js +9 -9
- package/generated/react/input/index.d.ts +7 -7
- package/generated/react/link/index.d.ts +7 -7
- package/generated/react/list/index.d.ts +7 -7
- package/generated/react/list-item/index.d.ts +7 -7
- package/generated/react/list-item-pattern-01/index.d.ts +7 -7
- package/generated/react/mask/index.d.ts +7 -7
- package/generated/react/menu-button/index.d.ts +7 -7
- package/generated/react/menu-heading/index.d.ts +7 -7
- package/generated/react/menu-item/index.d.ts +7 -7
- package/generated/react/option/index.d.ts +9 -9
- package/generated/react/option/index.js +1 -1
- package/generated/react/pagination/index.d.ts +7 -7
- package/generated/react/popover/index.d.ts +7 -7
- package/generated/react/radio/index.d.ts +7 -7
- package/generated/react/radio-group/index.d.ts +7 -7
- package/generated/react/rich-text/index.d.ts +7 -7
- package/generated/react/segment/index.d.ts +7 -7
- package/generated/react/segmented-control/index.d.ts +7 -7
- package/generated/react/select/index.d.ts +7 -7
- package/generated/react/sensitive-account/index.d.ts +7 -7
- package/generated/react/sensitive-date/index.d.ts +7 -7
- package/generated/react/sensitive-number/index.d.ts +7 -7
- package/generated/react/signal/index.d.ts +7 -7
- package/generated/react/spinner/index.d.ts +7 -7
- package/generated/react/switch/index.d.ts +7 -7
- package/generated/react/tab/index.d.ts +7 -7
- package/generated/react/tab-panel/index.d.ts +7 -7
- package/generated/react/table/index.d.ts +7 -7
- package/generated/react/tabs/index.d.ts +7 -7
- package/generated/react/text/index.d.ts +7 -7
- package/generated/react/textarea/index.d.ts +7 -7
- package/generated/react/theme/index.d.ts +8 -8
- package/generated/react/video/index.d.ts +7 -7
- package/package.json +2 -4
- package/primitives/menu/menu-heading.trans.styles.js +14 -0
- package/primitives/menu/menu-item.component.js +1 -1
- package/primitives/menu/menu.component.js +2 -1
- package/pure.d.ts +1 -1
- package/pure.js +1 -1
- package/{primitives/listbox/option.styles.js → shared-styles/menu-listbox-item.style.js} +3 -3
- package/shared-styles/menu-listbox-item.trans.style.d.ts +2 -0
- package/shared-styles/menu-listbox-item.trans.style.js +15 -0
- package/shared-styles/menu-listbox.style.d.ts +11 -0
- package/{primitives/listbox/listbox.styles.js → shared-styles/menu-listbox.style.js} +5 -5
- package/shared-styles/menu-listbox.trans.style.d.ts +3 -0
- package/shared-styles/menu-listbox.trans.style.js +16 -0
- package/shared-styles/menu-listbox.trans.style.scss.js +2 -0
- package/utils/helpers/custom-element-scoping.js +1 -1
- package/utils/transitional-styles/transitional-styles.d.ts +7 -0
- package/utils/transitional-styles/transitional-styles.js +67 -35
- package/primitives/listbox/index.d.ts +0 -1
- package/primitives/listbox/index.js +0 -1
- package/primitives/listbox/listbox.component.d.ts +0 -59
- package/primitives/listbox/listbox.component.js +0 -129
- package/primitives/listbox/listbox.d.ts +0 -2
- package/primitives/listbox/listbox.js +0 -6
- package/primitives/listbox/listbox.trans.styles.js +0 -22
- package/primitives/listbox/option.styles.d.ts +0 -2
- /package/{primitives/listbox → components/dropdown}/option.d.ts +0 -0
- /package/{primitives/listbox → components/dropdown}/option.js +0 -0
- /package/primitives/{listbox/listbox.trans.styles.d.ts → menu/menu-heading.trans.styles.d.ts} +0 -0
- /package/{primitives/listbox/listbox.styles.d.ts → shared-styles/menu-listbox-item.style.d.ts} +0 -0
- /package/{primitives/listbox/option.trans.styles.scss.js → shared-styles/menu-listbox-item.trans.style.scss.js} +0 -0
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
8
|
var _elTriggerBtn, _setupButton, _handleTriggerSlotChange, _renderPopover, _handleItemClick, handleItemClick_fn, _calcMaxHeight;
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
|
-
import { css } from "lit";
|
|
11
10
|
import { property, query } from "lit/decorators.js";
|
|
12
11
|
import { when } from "lit/directives/when.js";
|
|
13
12
|
import { GdsElement } from "../../gds-element.js";
|
|
14
13
|
import { GdsMenuItem } from "../../primitives/menu/menu-item.component.js";
|
|
15
14
|
import { GdsMenu } from "../../primitives/menu/menu.component.js";
|
|
15
|
+
import menuListboxStyle from "../../shared-styles/menu-listbox.style.js";
|
|
16
16
|
import { tokens } from "../../tokens.style.js";
|
|
17
17
|
import { TransitionalStyles } from "../../transitional-styles.js";
|
|
18
18
|
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
@@ -87,7 +87,7 @@ let GdsContextMenu = class extends withMarginProps(
|
|
|
87
87
|
@gds-ui-state=${(e) => this.open = e.detail.open}
|
|
88
88
|
>
|
|
89
89
|
<gds-menu
|
|
90
|
-
class="menu"
|
|
90
|
+
class="menu-listbox"
|
|
91
91
|
aria-label=${this.label ?? this.buttonLabel}
|
|
92
92
|
@gds-menu-item-click=${__privateMethod(this, _handleItemClick, handleItemClick_fn)}
|
|
93
93
|
>
|
|
@@ -144,14 +144,7 @@ handleItemClick_fn = function() {
|
|
|
144
144
|
this.open = false;
|
|
145
145
|
};
|
|
146
146
|
_calcMaxHeight = new WeakMap();
|
|
147
|
-
GdsContextMenu.styles = [
|
|
148
|
-
tokens,
|
|
149
|
-
css`
|
|
150
|
-
.menu {
|
|
151
|
-
overflow: auto;
|
|
152
|
-
}
|
|
153
|
-
`
|
|
154
|
-
];
|
|
147
|
+
GdsContextMenu.styles = [tokens, menuListboxStyle];
|
|
155
148
|
GdsContextMenu.shadowRootOptions = {
|
|
156
149
|
mode: "open",
|
|
157
150
|
delegatesFocus: true
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "../../chunks/chunk.CAV4X6PU.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as MenuHeading from "../../primitives/menu/menu-heading.trans.styles.js";
|
|
3
|
+
import * as MenuListboxItem from "../../shared-styles/menu-listbox-item.trans.style.js";
|
|
4
|
+
import * as MenuListbox from "../../shared-styles/menu-listbox.trans.style.js";
|
|
3
5
|
import { TransitionalStyles } from "../../utils/transitional-styles/transitional-styles.js";
|
|
4
6
|
import * as Button from "../button/button.trans.styles.js";
|
|
5
7
|
import * as Popover from "../popover/popover.trans.styles.js";
|
|
@@ -7,7 +9,9 @@ import styles from "./context-menu.trans.styles.scss.js";
|
|
|
7
9
|
function register() {
|
|
8
10
|
TransitionalStyles.instance.register("gds-context-menu", styles.toString());
|
|
9
11
|
Popover.register();
|
|
10
|
-
|
|
12
|
+
MenuListbox.register();
|
|
13
|
+
MenuListboxItem.register();
|
|
14
|
+
MenuHeading.register();
|
|
11
15
|
Button.register();
|
|
12
16
|
}
|
|
13
17
|
var context_menu_trans_styles_default = register;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ListboxKbNavigation } from '../../utils/controllers/listbox-kb-nav-controller';
|
|
1
2
|
import { GdsFormControlElement } from '../form/form-control';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { GdsOption } from './option.component';
|
|
4
|
+
import type { OptionsContainer } from './option.component';
|
|
5
|
+
export * from './option.component';
|
|
6
|
+
declare class Dropdown extends GdsFormControlElement implements OptionsContainer, ListboxKbNavigation {
|
|
5
7
|
#private;
|
|
6
8
|
static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
9
|
+
constructor();
|
|
7
10
|
get type(): string;
|
|
8
11
|
/**
|
|
9
12
|
* The supporting text displayed between the label and the field itself.
|
|
@@ -122,8 +125,12 @@ declare class Dropdown extends GdsFormControlElement implements OptionsContainer
|
|
|
122
125
|
* Intended for use in integration tests.
|
|
123
126
|
*/
|
|
124
127
|
test_getFieldElement(): Element | null | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The options that keyboard navigation can move between.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
get navigableItems(): GdsOption[];
|
|
125
133
|
private _elTriggerBtn;
|
|
126
|
-
private _elListbox;
|
|
127
134
|
private _elSearchInput;
|
|
128
135
|
connectedCallback(): void;
|
|
129
136
|
disconnectedCallback(): void;
|
|
@@ -131,8 +138,23 @@ declare class Dropdown extends GdsFormControlElement implements OptionsContainer
|
|
|
131
138
|
protected _getValidityAnchor(): HTMLElement;
|
|
132
139
|
/**
|
|
133
140
|
* Update value assignment and request update when the light DOM changes.
|
|
141
|
+
*
|
|
142
|
+
* `attributeFilter` deliberately excludes `aria-selected`, which the dropdown itself writes to the
|
|
143
|
+
* options. Observing it would turn every selection into another mutation record.
|
|
134
144
|
*/
|
|
135
145
|
private _handleLightDOMChange;
|
|
146
|
+
protected updated(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Options render a checkbox toggle in multiple mode, and read that off their parent.
|
|
149
|
+
*/
|
|
150
|
+
private _handleMultipleChange;
|
|
151
|
+
get value(): any;
|
|
152
|
+
/**
|
|
153
|
+
* Writes that land while a selection is being dispatched are ignored. Such a write can only have
|
|
154
|
+
* observed pre-commit state, so honouring it would let a `change` listener anywhere in the
|
|
155
|
+
* ancestor chain replace the selection before the consumer's own handler reads it.
|
|
156
|
+
*/
|
|
157
|
+
set value(value: any);
|
|
136
158
|
/**
|
|
137
159
|
* Emits `gds-ui-state`event and does some other house-keeping when the open state changes.
|
|
138
160
|
*/
|
|
@@ -5,21 +5,24 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
|
-
var _optionElements, _shouldShowFooter, shouldShowFooter_fn, _renderCombobox, _renderTriggerButton, _handleBlur, _calcMaxHeight, _dispatchUISateEvent, _handlePopoverStateChange, _handleClearButton, _handleSearchFieldInput, _handleSearchFieldKeyDown, _handleListboxKeyDown, _handleOptionFocusChange,
|
|
8
|
+
var _optionElements, _shouldShowFooter, shouldShowFooter_fn, _renderCombobox, _renderTriggerButton, _handleBlur, _calcMaxHeight, _dispatchUISateEvent, _handlePopoverStateChange, _handleClearButton, _handleSearchFieldInput, _handleSearchFieldKeyDown, _handleListboxKeyDown, _handleOptionFocusChange, _handleOptionSelect, _toggleOptionValue, toggleOptionValue_fn, _syncOptionSelection, syncOptionSelection_fn, _focusListbox, _isCommitting, _commitSelection, commitSelection_fn, _registerAutoCloseListener, registerAutoCloseListener_fn, _unregisterAutoCloseListener, unregisterAutoCloseListener_fn, _blurCloseListener, _tabCloseListener;
|
|
9
9
|
import { localized, msg, str } from "@lit/localize";
|
|
10
10
|
import { nothing } from "lit";
|
|
11
|
-
import { property, query
|
|
12
|
-
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
|
+
import { property, query } from "lit/decorators.js";
|
|
13
12
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
14
13
|
import { when } from "lit/directives/when.js";
|
|
15
14
|
import { flip, offset } from "@floating-ui/dom";
|
|
16
15
|
import { GdsFieldBase } from "../../primitives/field-base/field-base.component.js";
|
|
17
16
|
import { GdsFormControlFooter } from "../../primitives/form-control-footer/form-control-footer.component.js";
|
|
18
17
|
import { GdsFormControlHeader } from "../../primitives/form-control-header/form-control-header.component.js";
|
|
19
|
-
import { GdsListbox } from "../../primitives/listbox/listbox.component.js";
|
|
20
18
|
import { gdsCustomElement, html } from "../../scoping.js";
|
|
21
19
|
import formControlHostStyle from "../../shared-styles/form-control-host.style.js";
|
|
20
|
+
import menuListboxStyle from "../../shared-styles/menu-listbox.style.js";
|
|
22
21
|
import { tokens } from "../../tokens.style.js";
|
|
22
|
+
import { TransitionalStyles } from "../../transitional-styles.js";
|
|
23
|
+
import {
|
|
24
|
+
ListboxKbNavController
|
|
25
|
+
} from "../../utils/controllers/listbox-kb-nav-controller.js";
|
|
23
26
|
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
24
27
|
import { observeLightDOM } from "../../utils/decorators/observe-light-dom.js";
|
|
25
28
|
import { watch } from "../../utils/decorators/watch.js";
|
|
@@ -34,12 +37,27 @@ import { IconChevronBottom } from "../icon/icons/chevron-bottom.component.js";
|
|
|
34
37
|
import { IconCrossSmall } from "../icon/icons/cross-small.component.js";
|
|
35
38
|
import { GdsPopover } from "../popover/popover.component.js";
|
|
36
39
|
import DropdownStyles from "./dropdown.styles.js";
|
|
37
|
-
|
|
40
|
+
import { GdsOption } from "./option.component.js";
|
|
41
|
+
export * from "./option.component.js";
|
|
38
42
|
let Dropdown = class extends GdsFormControlElement {
|
|
39
43
|
constructor() {
|
|
40
|
-
super(
|
|
44
|
+
super();
|
|
41
45
|
__privateAdd(this, _shouldShowFooter);
|
|
42
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Derives the next multi-select value from the current value rather than from the DOM, so that
|
|
48
|
+
* `value` stays the only source of truth. Options are listed in DOM order.
|
|
49
|
+
*/
|
|
50
|
+
__privateAdd(this, _toggleOptionValue);
|
|
51
|
+
/**
|
|
52
|
+
* Pushes `value` onto the options. This is one-way on purpose: the selected state of an option is
|
|
53
|
+
* a projection of `value`, never a source it is read back from.
|
|
54
|
+
*/
|
|
55
|
+
__privateAdd(this, _syncOptionSelection);
|
|
56
|
+
/**
|
|
57
|
+
* Commits a user initiated value change as one synchronous step, so that no re-render or foreign
|
|
58
|
+
* listener can land between the new value and the events that report it.
|
|
59
|
+
*/
|
|
60
|
+
__privateAdd(this, _commitSelection);
|
|
43
61
|
__privateAdd(this, _registerAutoCloseListener);
|
|
44
62
|
__privateAdd(this, _unregisterAutoCloseListener);
|
|
45
63
|
this.supportingText = "";
|
|
@@ -80,8 +98,9 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
80
98
|
e.stopImmediatePropagation();
|
|
81
99
|
}}
|
|
82
100
|
@input=${(e) => {
|
|
83
|
-
this.
|
|
84
|
-
|
|
101
|
+
__privateMethod(this, _commitSelection, commitSelection_fn).call(this, e.target.value, {
|
|
102
|
+
emitChange: false
|
|
103
|
+
});
|
|
85
104
|
__privateGet(this, _handleSearchFieldInput).call(this, e);
|
|
86
105
|
__privateGet(this, _dispatchUISateEvent).call(this, true, "show") && (this.open = true);
|
|
87
106
|
}}
|
|
@@ -89,10 +108,10 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
89
108
|
if (e.key === "ArrowDown") {
|
|
90
109
|
e.preventDefault();
|
|
91
110
|
__privateGet(this, _dispatchUISateEvent).call(this, true, "show") && (this.open = true);
|
|
92
|
-
this.
|
|
111
|
+
this.updateComplete.then(() => __privateGet(this, _focusListbox).call(this));
|
|
93
112
|
}
|
|
94
113
|
if (e.key === "Enter") {
|
|
95
|
-
|
|
114
|
+
__privateMethod(this, _commitSelection, commitSelection_fn).call(this, this.value, { emitInput: false });
|
|
96
115
|
}
|
|
97
116
|
}}
|
|
98
117
|
/>
|
|
@@ -157,13 +176,12 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
157
176
|
__privateAdd(this, _handleClearButton, (e) => {
|
|
158
177
|
e.preventDefault();
|
|
159
178
|
e.stopPropagation();
|
|
160
|
-
this.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
179
|
+
__privateMethod(this, _commitSelection, commitSelection_fn).call(this, void 0, {
|
|
180
|
+
beforeDispatch: () => this.dispatchCustomEvent("gds-input-cleared", {
|
|
181
|
+
bubbles: true,
|
|
182
|
+
composed: true
|
|
183
|
+
})
|
|
164
184
|
});
|
|
165
|
-
__privateGet(this, _dispatchInputEvent).call(this);
|
|
166
|
-
__privateGet(this, _dispatchChangeEvent).call(this);
|
|
167
185
|
});
|
|
168
186
|
/**
|
|
169
187
|
* Event handler for filtering the options in the dropdown.
|
|
@@ -191,13 +209,10 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
191
209
|
* If found, focus should be moved to the listbox.
|
|
192
210
|
*/
|
|
193
211
|
__privateAdd(this, _handleSearchFieldKeyDown, (e) => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
212
|
+
if (e.key === "ArrowDown" || e.key === "Tab") {
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
__privateGet(this, _focusListbox).call(this);
|
|
215
|
+
}
|
|
201
216
|
});
|
|
202
217
|
/**
|
|
203
218
|
* Check for Tab in the listbox.
|
|
@@ -215,23 +230,35 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
215
230
|
if (triggerButton)
|
|
216
231
|
triggerButton.ariaActiveDescendantElement = e.target;
|
|
217
232
|
});
|
|
218
|
-
__privateAdd(this,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
__privateAdd(this, _handleOptionSelect, (e) => {
|
|
234
|
+
const option = e.target;
|
|
235
|
+
if (!this.options.includes(option))
|
|
236
|
+
return;
|
|
237
|
+
if (this.multiple) {
|
|
238
|
+
__privateMethod(this, _commitSelection, commitSelection_fn).call(this, __privateMethod(this, _toggleOptionValue, toggleOptionValue_fn).call(this, option));
|
|
239
|
+
} else {
|
|
240
|
+
__privateMethod(this, _commitSelection, commitSelection_fn).call(this, option.value, {
|
|
241
|
+
beforeDispatch: () => {
|
|
242
|
+
if (__privateGet(this, _dispatchUISateEvent).call(this, false, "close")) {
|
|
243
|
+
this.open = false;
|
|
244
|
+
setTimeout(() => this._elTriggerBtn?.focus(), 0);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
225
249
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
250
|
+
/**
|
|
251
|
+
* The listbox container is the popover's first slotted child, so it receives programmatic focus
|
|
252
|
+
* and hands it on to an option. Deferred because the popover can open before the dropdown has
|
|
253
|
+
* rendered the open state, which is what un-hides the options.
|
|
254
|
+
*/
|
|
255
|
+
__privateAdd(this, _focusListbox, () => {
|
|
256
|
+
this.updateComplete.then(() => {
|
|
257
|
+
const items = this.navigableItems;
|
|
258
|
+
(items.find((o) => o.selected) || items[0])?.focus();
|
|
259
|
+
});
|
|
234
260
|
});
|
|
261
|
+
__privateAdd(this, _isCommitting, false);
|
|
235
262
|
/**
|
|
236
263
|
* A listener to close the dropdown when any other element is focused.
|
|
237
264
|
*/
|
|
@@ -247,6 +274,7 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
247
274
|
this._elTriggerBtn?.focus();
|
|
248
275
|
}
|
|
249
276
|
});
|
|
277
|
+
new ListboxKbNavController(this);
|
|
250
278
|
}
|
|
251
279
|
get type() {
|
|
252
280
|
return "gds-dropdown";
|
|
@@ -307,9 +335,17 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
307
335
|
test_getFieldElement() {
|
|
308
336
|
return this.shadowRoot?.querySelector("#field");
|
|
309
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* The options that keyboard navigation can move between.
|
|
340
|
+
* @internal
|
|
341
|
+
*/
|
|
342
|
+
get navigableItems() {
|
|
343
|
+
return this.options.filter((o) => !o.hidden);
|
|
344
|
+
}
|
|
310
345
|
connectedCallback() {
|
|
311
346
|
super.connectedCallback();
|
|
312
347
|
this.addEventListener("blur", __privateGet(this, _handleBlur));
|
|
348
|
+
TransitionalStyles.instance.applyScoped(this, "gds-dropdown", "t-listbox");
|
|
313
349
|
this.updateComplete.then(() => {
|
|
314
350
|
this._handleLightDOMChange();
|
|
315
351
|
this._handleOpenChange();
|
|
@@ -412,17 +448,19 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
412
448
|
@input=${__privateGet(this, _handleSearchFieldInput)}
|
|
413
449
|
/>`
|
|
414
450
|
)}
|
|
415
|
-
<
|
|
451
|
+
<div
|
|
416
452
|
id="listbox"
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
453
|
+
class="menu-listbox"
|
|
454
|
+
role="listbox"
|
|
455
|
+
aria-multiselectable="${this.multiple}"
|
|
456
|
+
tabindex="-1"
|
|
457
|
+
@focus="${__privateGet(this, _focusListbox)}"
|
|
458
|
+
@gds-select="${__privateGet(this, _handleOptionSelect)}"
|
|
421
459
|
@gds-focus="${__privateGet(this, _handleOptionFocusChange)}"
|
|
422
460
|
@keydown=${__privateGet(this, _handleListboxKeyDown)}
|
|
423
461
|
>
|
|
424
462
|
<slot></slot>
|
|
425
|
-
</
|
|
463
|
+
</div>
|
|
426
464
|
</gds-popover>
|
|
427
465
|
|
|
428
466
|
${when(
|
|
@@ -453,16 +491,37 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
453
491
|
if (this.multiple) {
|
|
454
492
|
return;
|
|
455
493
|
}
|
|
494
|
+
if (this.options.length === 0 && !this.placeholder) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
456
497
|
if (this.value === void 0) {
|
|
457
498
|
if (this.placeholder)
|
|
458
499
|
this.value = this.placeholder.value;
|
|
459
500
|
else
|
|
460
501
|
this.value = this.options[0]?.value;
|
|
461
502
|
} else if (!this.combobox && !this.placeholder && this.options.find((o) => this.compareWith(o.value, this.value)) === void 0) {
|
|
462
|
-
this.options[0] && (this.options[0].selected = true);
|
|
463
503
|
this.value = this.options[0]?.value;
|
|
464
504
|
}
|
|
465
505
|
}
|
|
506
|
+
updated() {
|
|
507
|
+
__privateMethod(this, _syncOptionSelection, syncOptionSelection_fn).call(this);
|
|
508
|
+
}
|
|
509
|
+
_handleMultipleChange() {
|
|
510
|
+
this.options.forEach((o) => o.requestUpdate());
|
|
511
|
+
}
|
|
512
|
+
get value() {
|
|
513
|
+
return super.value;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Writes that land while a selection is being dispatched are ignored. Such a write can only have
|
|
517
|
+
* observed pre-commit state, so honouring it would let a `change` listener anywhere in the
|
|
518
|
+
* ancestor chain replace the selection before the consumer's own handler reads it.
|
|
519
|
+
*/
|
|
520
|
+
set value(value) {
|
|
521
|
+
if (__privateGet(this, _isCommitting))
|
|
522
|
+
return;
|
|
523
|
+
super.value = value;
|
|
524
|
+
}
|
|
466
525
|
_handleOpenChange() {
|
|
467
526
|
const open = this.open;
|
|
468
527
|
this.options.forEach((o) => o.hidden = !open);
|
|
@@ -497,24 +556,42 @@ _handleSearchFieldInput = new WeakMap();
|
|
|
497
556
|
_handleSearchFieldKeyDown = new WeakMap();
|
|
498
557
|
_handleListboxKeyDown = new WeakMap();
|
|
499
558
|
_handleOptionFocusChange = new WeakMap();
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
__privateGet(this, _dispatchChangeEvent).call(this);
|
|
559
|
+
_handleOptionSelect = new WeakMap();
|
|
560
|
+
_toggleOptionValue = new WeakSet();
|
|
561
|
+
toggleOptionValue_fn = function(option) {
|
|
562
|
+
const current = Array.isArray(this.value) ? this.value : [];
|
|
563
|
+
const isSelected = (v) => current.some((c) => this.compareWith(c, v));
|
|
564
|
+
const select = !isSelected(option.value);
|
|
565
|
+
return this.options.filter((o) => o === option ? select : isSelected(o.value)).map((o) => o.value);
|
|
566
|
+
};
|
|
567
|
+
_syncOptionSelection = new WeakSet();
|
|
568
|
+
syncOptionSelection_fn = function() {
|
|
569
|
+
const values = this.multiple ? Array.isArray(this.value) ? this.value : [] : [this.value];
|
|
570
|
+
this.options.forEach((o) => {
|
|
571
|
+
o.selected = values.some((v) => this.compareWith(v, o.value));
|
|
514
572
|
});
|
|
515
573
|
};
|
|
516
|
-
|
|
517
|
-
|
|
574
|
+
_focusListbox = new WeakMap();
|
|
575
|
+
_isCommitting = new WeakMap();
|
|
576
|
+
_commitSelection = new WeakSet();
|
|
577
|
+
commitSelection_fn = function(value, options = {}) {
|
|
578
|
+
const { emitInput = true, emitChange = true, beforeDispatch } = options;
|
|
579
|
+
this.value = value;
|
|
580
|
+
__privateSet(this, _isCommitting, true);
|
|
581
|
+
try {
|
|
582
|
+
beforeDispatch?.();
|
|
583
|
+
if (emitInput)
|
|
584
|
+
this.dispatchStandardEvent("input", { bubbles: true, composed: true });
|
|
585
|
+
if (emitChange)
|
|
586
|
+
this.dispatchCustomEvent("change", {
|
|
587
|
+
detail: { value },
|
|
588
|
+
bubbles: true,
|
|
589
|
+
composed: true
|
|
590
|
+
});
|
|
591
|
+
} finally {
|
|
592
|
+
__privateSet(this, _isCommitting, false);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
518
595
|
_registerAutoCloseListener = new WeakSet();
|
|
519
596
|
registerAutoCloseListener_fn = function() {
|
|
520
597
|
this.addEventListener("blur", __privateGet(this, _blurCloseListener));
|
|
@@ -529,7 +606,12 @@ unregisterAutoCloseListener_fn = function() {
|
|
|
529
606
|
};
|
|
530
607
|
_blurCloseListener = new WeakMap();
|
|
531
608
|
_tabCloseListener = new WeakMap();
|
|
532
|
-
Dropdown.styles = [
|
|
609
|
+
Dropdown.styles = [
|
|
610
|
+
tokens,
|
|
611
|
+
formControlHostStyle,
|
|
612
|
+
menuListboxStyle,
|
|
613
|
+
DropdownStyles
|
|
614
|
+
];
|
|
533
615
|
__decorateClass([
|
|
534
616
|
property({ attribute: "supporting-text" })
|
|
535
617
|
], Dropdown.prototype, "supportingText", 2);
|
|
@@ -582,20 +664,21 @@ __decorateClass([
|
|
|
582
664
|
__decorateClass([
|
|
583
665
|
query("#trigger")
|
|
584
666
|
], Dropdown.prototype, "_elTriggerBtn", 2);
|
|
585
|
-
__decorateClass([
|
|
586
|
-
queryAsync("#listbox")
|
|
587
|
-
], Dropdown.prototype, "_elListbox", 2);
|
|
588
667
|
__decorateClass([
|
|
589
668
|
query("#searchinput")
|
|
590
669
|
], Dropdown.prototype, "_elSearchInput", 2);
|
|
591
670
|
__decorateClass([
|
|
592
671
|
observeLightDOM({
|
|
593
672
|
attributes: true,
|
|
673
|
+
attributeFilter: ["gds-element", "value", "isplaceholder"],
|
|
594
674
|
childList: true,
|
|
595
675
|
subtree: true,
|
|
596
676
|
characterData: true
|
|
597
677
|
})
|
|
598
678
|
], Dropdown.prototype, "_handleLightDOMChange", 1);
|
|
679
|
+
__decorateClass([
|
|
680
|
+
watch("multiple")
|
|
681
|
+
], Dropdown.prototype, "_handleMultipleChange", 1);
|
|
599
682
|
__decorateClass([
|
|
600
683
|
watch("open")
|
|
601
684
|
], Dropdown.prototype, "_handleOpenChange", 1);
|
|
@@ -617,7 +700,7 @@ GdsDropdown = __decorateClass([
|
|
|
617
700
|
GdsFormControlHeader,
|
|
618
701
|
GdsFormControlFooter,
|
|
619
702
|
GdsFieldBase,
|
|
620
|
-
|
|
703
|
+
GdsOption,
|
|
621
704
|
GdsPopover,
|
|
622
705
|
IconCheckmark,
|
|
623
706
|
IconChevronBottom,
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import "../../chunks/chunk.CAV4X6PU.js";
|
|
2
2
|
import * as FieldBase from "../../primitives/field-base/field-base.trans.styles.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as MenuHeading from "../../primitives/menu/menu-heading.trans.styles.js";
|
|
4
|
+
import * as MenuListboxItem from "../../shared-styles/menu-listbox-item.trans.style.js";
|
|
5
|
+
import { TransitionalStyles } from "../../utils/transitional-styles/transitional-styles.js";
|
|
4
6
|
import * as Button from "../button/button.trans.styles.js";
|
|
5
7
|
import * as Popover from "../popover/popover.trans.styles.js";
|
|
8
|
+
import styles from "./dropdown.trans.styles.scss.js";
|
|
6
9
|
function register() {
|
|
7
|
-
|
|
10
|
+
TransitionalStyles.instance.register("gds-dropdown", styles.toString());
|
|
11
|
+
MenuListboxItem.register();
|
|
12
|
+
MenuHeading.register();
|
|
8
13
|
Popover.register();
|
|
9
14
|
Button.register();
|
|
10
15
|
FieldBase.register();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const styles = "/* stylelint-disable max-nesting-depth */\n/**\n * Assert that a map is in ascending order\n * @mixin assert-ascending\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Assert that the first breakpoint in a map starts at zero\n * @mixin assert-starts-at-zero\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Check if a value is important\n * @function is-important\n * @param {Boolean} $important - Whether the value is important\n * @return {String} - \"!important\" if true, otherwise an empty string\n */\n/**\n * Replace a substring in a string\n * @function str-replace\n * @param {String} $string - The original string\n * @param {String} $search - The substring to replace\n * @param {String} $replace - The replacement string\n * @return {String} - The updated string\n */\n/**\n * Convert a map to its negative variant\n * @function negativify-map\n * @param {Map} $map - The map to convert\n * @return {Map} - The negative variant of the map\n */\n/**\n * Generate utility classes\n * @mixin generate-utility\n * @param {Map} $utility - Utility map\n * @param {String} $infix - Infix for class names\n * @param {Boolean} $is-rfs-media-query - Whether to use RFS media query\n */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n * @function luminance\n * @param {Color} $color - The color to calculate luminance for\n * @return {Number} - The luminance value\n */\n/**\n * Calculate the contrast ratio between two colors.\n * @function color-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @return {Number} - The contrast ratio\n */\n/**\n * Remove the unit of a length\n * @function strip-unit\n * @param {Number} $number - Number to remove unit from\n * @return {Number} - Unitless number\n */\n/**\n * Validate font size\n * @function validate-font-size\n * @param {Number} $size - Font size to validate\n * @return {Number} - Validated font size in pixels\n */\n/**\n * Get ratio for WCAG level\n * @function get-ratio\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @return {Number} - Ratio value\n */\n/**\n * Determine if a color is light or dark\n * @function light-or-dark\n * @param {Color} $color - The color to check\n * @return {String} - \"light\" or \"dark\"\n */\n/**\n * Get the most legible color (black or white) for a given background color\n * @function most-legible-color\n * @param {Color} $color - The background color\n * @return {Color} - The most legible color\n */\n/**\n * Get the desired color combination for foreground and background colors\n * @function desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n * @return {List} - List containing background and foreground colors\n */\n/**\n * @mixin desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n */\n/**\n * Get an accessible color for a given foreground and background color\n * @function a11y-color\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @param {Number} $maxOffset - Maximum offset\n * @param {Boolean} $darkMode - Is dark mode\n * @param {Number} $ratio - Contrast ratio\n * @return {Color} - Accessible color\n */\n/**\n * Get the maximum contrast color\n * @function max-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Color} $max - Maximum contrast color\n * @return {Color} - Maximum contrast color\n */\n/**\n * Get the RGB values of a color as a string\n * @function stripped-rgb\n * @param {Color} $color - The color\n * @return {String} - RGB values as a string\n */\n/**\n * Get the HSL values of a color as a string\n * @function stripped-hsl\n * @param {Color} $color - The color\n * @return {String} - HSL values as a string\n */\n/**\n * Convert a map of colors to a map of HSL values\n * @function hsl-map\n * @param {Map} $colors - Map of colors\n * @return {Map} - Map of HSL values\n */\n/**\n* @deprecated\n* Use `add-focus` instead\n*/\n/** add background color, color and border-color to element when it has focus-visible i.e. tab focus */\n/**\n * Breakpoint viewport sizes and media queries.\n *\n * Breakpoints are defined as a map of (name: minimum width), order from small to large:\n *\n * (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n *\n * The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n */\n/**\n * Name of the next breakpoint, or null for the last breakpoint.\n *\n * >> breakpoint-next(sm)\n * md\n * >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * md\n * >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n * md\n */\n/**\n * Minimum breakpoint width. Null for the smallest (first) breakpoint.\n *\n * >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 576px\n */\n/**\n * Maximum breakpoint width.\n * The maximum value is reduced by 0.02px to work around the limitations of\n * `min-` and `max-` prefixes and viewports with fractional widths.\n * See https://www.w3.org/TR/mediaqueries-4/#mq-min-max\n * Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.\n * See https://bugs.webkit.org/show_bug.cgi?id=178261\n *\n * >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 767.98px\n */\n/**\n * Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.\n * Useful for making responsive utilities.\n *\n * >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"\" (Returns a blank string)\n * >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"-sm\"\n */\n/**\n * Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n * Makes the @content apply to the given breakpoint and wider.\n */\n/**\n * Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n * Makes the @content apply to the given breakpoint and narrower.\n */\n/**\n * Media that spans multiple breakpoint widths.\n * Makes the @content apply between the min and max breakpoints\n */\n/**\n * Media between the breakpoint's minimum and maximum widths.\n * No minimum for the smallest breakpoint, and no maximum for the largest one.\n * Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n
|
|
1
|
+
const styles = "/* stylelint-disable max-nesting-depth */\n/**\n * Assert that a map is in ascending order\n * @mixin assert-ascending\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Assert that the first breakpoint in a map starts at zero\n * @mixin assert-starts-at-zero\n * @param {Map} $map - The map to check\n * @param {String} $map-name - The name of the map\n */\n/**\n * Check if a value is important\n * @function is-important\n * @param {Boolean} $important - Whether the value is important\n * @return {String} - \"!important\" if true, otherwise an empty string\n */\n/**\n * Replace a substring in a string\n * @function str-replace\n * @param {String} $string - The original string\n * @param {String} $search - The substring to replace\n * @param {String} $replace - The replacement string\n * @return {String} - The updated string\n */\n/**\n * Convert a map to its negative variant\n * @function negativify-map\n * @param {Map} $map - The map to convert\n * @return {Map} - The negative variant of the map\n */\n/**\n * Generate utility classes\n * @mixin generate-utility\n * @param {Map} $utility - Utility map\n * @param {String} $infix - Infix for class names\n * @param {Boolean} $is-rfs-media-query - Whether to use RFS media query\n */\n/* stylelint-enable max-nesting-depth */\n/**\n * Calculate the luminance for a color.\n * @function luminance\n * @param {Color} $color - The color to calculate luminance for\n * @return {Number} - The luminance value\n */\n/**\n * Calculate the contrast ratio between two colors.\n * @function color-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @return {Number} - The contrast ratio\n */\n/**\n * Remove the unit of a length\n * @function strip-unit\n * @param {Number} $number - Number to remove unit from\n * @return {Number} - Unitless number\n */\n/**\n * Validate font size\n * @function validate-font-size\n * @param {Number} $size - Font size to validate\n * @return {Number} - Validated font size in pixels\n */\n/**\n * Get ratio for WCAG level\n * @function get-ratio\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @return {Number} - Ratio value\n */\n/**\n * Determine if a color is light or dark\n * @function light-or-dark\n * @param {Color} $color - The color to check\n * @return {String} - \"light\" or \"dark\"\n */\n/**\n * Get the most legible color (black or white) for a given background color\n * @function most-legible-color\n * @param {Color} $color - The background color\n * @return {Color} - The most legible color\n */\n/**\n * Get the desired color combination for foreground and background colors\n * @function desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n * @return {List} - List containing background and foreground colors\n */\n/**\n * @mixin desired-color-combination\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Number} $offsetThreshold - Offset threshold\n * @param {Number} $ratio - Contrast ratio\n */\n/**\n * Get an accessible color for a given foreground and background color\n * @function a11y-color\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {String} $level - WCAG level\n * @param {Number} $size - Font size\n * @param {Boolean} $bold - Is bold\n * @param {Boolean} $graphic - Is graphic\n * @param {Number} $maxOffset - Maximum offset\n * @param {Boolean} $darkMode - Is dark mode\n * @param {Number} $ratio - Contrast ratio\n * @return {Color} - Accessible color\n */\n/**\n * Get the maximum contrast color\n * @function max-contrast\n * @param {Color} $fg - Foreground color\n * @param {Color} $bg - Background color\n * @param {Color} $max - Maximum contrast color\n * @return {Color} - Maximum contrast color\n */\n/**\n * Get the RGB values of a color as a string\n * @function stripped-rgb\n * @param {Color} $color - The color\n * @return {String} - RGB values as a string\n */\n/**\n * Get the HSL values of a color as a string\n * @function stripped-hsl\n * @param {Color} $color - The color\n * @return {String} - HSL values as a string\n */\n/**\n * Convert a map of colors to a map of HSL values\n * @function hsl-map\n * @param {Map} $colors - Map of colors\n * @return {Map} - Map of HSL values\n */\n/**\n* @deprecated\n* Use `add-focus` instead\n*/\n/** add background color, color and border-color to element when it has focus-visible i.e. tab focus */\n/**\n * Breakpoint viewport sizes and media queries.\n *\n * Breakpoints are defined as a map of (name: minimum width), order from small to large:\n *\n * (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n *\n * The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n */\n/**\n * Name of the next breakpoint, or null for the last breakpoint.\n *\n * >> breakpoint-next(sm)\n * md\n * >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * md\n * >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n * md\n */\n/**\n * Minimum breakpoint width. Null for the smallest (first) breakpoint.\n *\n * >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 576px\n */\n/**\n * Maximum breakpoint width.\n * The maximum value is reduced by 0.02px to work around the limitations of\n * `min-` and `max-` prefixes and viewports with fractional widths.\n * See https://www.w3.org/TR/mediaqueries-4/#mq-min-max\n * Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.\n * See https://bugs.webkit.org/show_bug.cgi?id=178261\n *\n * >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * 767.98px\n */\n/**\n * Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.\n * Useful for making responsive utilities.\n *\n * >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"\" (Returns a blank string)\n * >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n * \"-sm\"\n */\n/**\n * Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n * Makes the @content apply to the given breakpoint and wider.\n */\n/**\n * Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n * Makes the @content apply to the given breakpoint and narrower.\n */\n/**\n * Media that spans multiple breakpoint widths.\n * Makes the @content apply between the min and max breakpoints\n */\n/**\n * Media between the breakpoint's minimum and maximum widths.\n * No minimum for the smallest breakpoint, and no maximum for the largest one.\n * Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n/** \n * @deprecated in favor of Grouped list component\n */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n #listbox {\n padding-left: 0;\n margin-bottom: 0;\n margin-top: 0;\n display: flex;\n flex-direction: column;\n list-style: none;\n }\n #listbox > li {\n padding-bottom: 0.5rem;\n padding-top: 0.5rem;\n border: 0;\n display: block;\n position: relative;\n }\n #listbox > li::before {\n font-weight: 500;\n display: inline-block;\n left: 0;\n position: absolute;\n text-align: center;\n }\n #listbox {\n overflow-y: auto;\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -10,7 +10,7 @@ declare const GdsOption_base: (new (...args: any[]) => import("lit").LitElement)
|
|
|
10
10
|
* A listbox option is an option in a listbox widget.
|
|
11
11
|
* This primitive corresponds to the aria `option` role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role
|
|
12
12
|
*
|
|
13
|
-
* Can be used together with the `gds-
|
|
13
|
+
* Can be used together with the `gds-dropdown` component.
|
|
14
14
|
*
|
|
15
15
|
* @slot - The default slot. Custom content can be used to display the option.
|
|
16
16
|
*
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
var _hidden, _emitSelect, emitSelect_fn;
|
|
9
9
|
import { property } from "lit/decorators.js";
|
|
10
10
|
import { when } from "lit/directives/when.js";
|
|
11
|
-
import { IconCheckmark } from "../../components/icon/icons/checkmark.component.js";
|
|
12
11
|
import { GdsElement } from "../../gds-element.js";
|
|
13
12
|
import { gdsCustomElement, html } from "../../scoping.js";
|
|
13
|
+
import menuListboxItemStyles from "../../shared-styles/menu-listbox-item.style.js";
|
|
14
14
|
import rbcbToggleStyles from "../../shared-styles/rbcb-toggle.style.js";
|
|
15
15
|
import { checkboxToggle } from "../../shared-styles/rbcb-toggle.template.js";
|
|
16
16
|
import { tokens } from "../../tokens.style.js";
|
|
17
17
|
import { TransitionalStyles } from "../../transitional-styles.js";
|
|
18
18
|
import { watch } from "../../utils/decorators/index.js";
|
|
19
19
|
import { Focusable } from "../../utils/mixins/focusable.js";
|
|
20
|
-
import
|
|
20
|
+
import { IconCheckmark } from "../icon/icons/checkmark.component.js";
|
|
21
21
|
let GdsOption = class extends Focusable(GdsElement) {
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
@@ -94,7 +94,7 @@ emitSelect_fn = function(e) {
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
|
-
GdsOption.styles = [tokens, rbcbToggleStyles,
|
|
97
|
+
GdsOption.styles = [tokens, rbcbToggleStyles, menuListboxItemStyles];
|
|
98
98
|
__decorateClass([
|
|
99
99
|
property()
|
|
100
100
|
], GdsOption.prototype, "value", 2);
|
|
@@ -107,7 +107,13 @@ __decorateClass([
|
|
|
107
107
|
__decorateClass([
|
|
108
108
|
property({
|
|
109
109
|
attribute: "aria-selected",
|
|
110
|
-
reflect: true
|
|
110
|
+
reflect: true,
|
|
111
|
+
// `aria-selected` is an enumerated attribute, not a boolean one: it is authored as the literal
|
|
112
|
+
// strings "true" and "false", and has to stay present in both states.
|
|
113
|
+
converter: {
|
|
114
|
+
fromAttribute: (value) => value === "true",
|
|
115
|
+
toAttribute: (value) => value ? "true" : "false"
|
|
116
|
+
}
|
|
111
117
|
})
|
|
112
118
|
], GdsOption.prototype, "selected", 2);
|
|
113
119
|
__decorateClass([
|
package/components/index.d.ts
CHANGED
package/components/index.js
CHANGED