@sebgroup/green-core 3.22.0 → 3.23.0
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/button/button.component.js +1 -1
- package/components/button/button.trans.styles.scss.js +1 -1
- package/components/calendar/calendar.component.js +2 -3
- package/components/calendar/calendar.trans.styles.scss.js +1 -1
- package/components/context-menu/context-menu.component.d.ts +8 -0
- package/components/context-menu/context-menu.component.js +5 -0
- package/components/context-menu/context-menu.trans.styles.scss.js +1 -1
- package/components/datepicker/datepicker.component.d.ts +1 -0
- package/components/datepicker/datepicker.component.js +40 -5
- package/components/dropdown/dropdown.component.js +25 -2
- package/components/dropdown/option.component.js +1 -0
- package/components/filter-chips/filter-chip/filter-chip.component.d.ts +4 -0
- package/components/filter-chips/filter-chip/filter-chip.component.js +7 -0
- package/components/filter-chips/filter-chips.component.js +54 -2
- package/components/radio/radio-group/radio-group.component.js +2 -0
- package/components/select/select.component.d.ts +4 -2
- package/components/select/select.component.js +3 -2
- package/components/table/table.component.d.ts +7 -0
- package/components/table/table.component.js +32 -18
- package/custom-elements.json +3557 -4425
- package/gds-element.js +1 -1
- package/generated/locales/da.d.ts +4 -0
- package/generated/locales/da.js +4 -0
- package/generated/locales/de.d.ts +4 -0
- package/generated/locales/de.js +4 -0
- package/generated/locales/fi.d.ts +4 -0
- package/generated/locales/fi.js +4 -0
- package/generated/locales/fr.d.ts +4 -0
- package/generated/locales/fr.js +4 -0
- package/generated/locales/it.d.ts +4 -0
- package/generated/locales/it.js +4 -0
- package/generated/locales/nl.d.ts +4 -0
- package/generated/locales/nl.js +4 -0
- package/generated/locales/no.d.ts +4 -0
- package/generated/locales/no.js +4 -0
- package/generated/locales/sv.d.ts +4 -0
- package/generated/locales/sv.js +4 -0
- package/generated/mcp/button/api.md +1 -1
- package/generated/mcp/checkbox/guidelines.md +24 -16
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/context-menu/api.md +1 -0
- package/generated/mcp/datepicker/guidelines.md +19 -16
- package/generated/mcp/dropdown/guidelines.md +20 -13
- package/generated/mcp/fab/api.md +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/mcp/input/guidelines.md +5 -0
- package/generated/mcp/radio/guidelines.md +23 -14
- package/generated/mcp/select/api.md +0 -44
- package/generated/mcp/select/guidelines.md +6 -0
- package/generated/mcp/switch/guidelines.md +6 -0
- package/generated/mcp/textarea/guidelines.md +18 -9
- package/generated/mcp/tokens.json +1 -1
- package/generated/react/alert/index.d.ts +13 -10
- package/generated/react/avatar/index.d.ts +13 -10
- package/generated/react/avatar-group/index.d.ts +13 -10
- package/generated/react/backdrop/index.d.ts +13 -10
- package/generated/react/badge/index.d.ts +13 -10
- package/generated/react/blur/index.d.ts +13 -10
- package/generated/react/breadcrumb/index.d.ts +13 -10
- package/generated/react/breadcrumbs/index.d.ts +14 -11
- package/generated/react/button/index.d.ts +18 -15
- package/generated/react/calendar/index.d.ts +15 -12
- package/generated/react/card/index.d.ts +13 -10
- package/generated/react/card-linked/index.d.ts +13 -10
- package/generated/react/card-pattern-01/index.d.ts +13 -10
- package/generated/react/checkbox/index.d.ts +18 -15
- package/generated/react/checkbox-group/index.d.ts +19 -16
- package/generated/react/coachmark/index.d.ts +13 -10
- package/generated/react/context-menu/index.d.ts +14 -10
- package/generated/react/datepicker/index.d.ts +20 -17
- package/generated/react/details/index.d.ts +13 -10
- package/generated/react/dialog/index.d.ts +13 -10
- package/generated/react/div/index.d.ts +13 -10
- package/generated/react/divider/index.d.ts +13 -10
- package/generated/react/dropdown/index.d.ts +20 -17
- package/generated/react/fab/index.d.ts +18 -15
- package/generated/react/filter-chip/index.d.ts +13 -10
- package/generated/react/filter-chips/index.d.ts +19 -16
- package/generated/react/flex/index.d.ts +13 -10
- package/generated/react/form-summary/index.d.ts +14 -11
- package/generated/react/formatted-account/index.d.ts +14 -11
- package/generated/react/formatted-date/index.d.ts +14 -11
- package/generated/react/formatted-number/index.d.ts +14 -11
- package/generated/react/grid/index.d.ts +13 -10
- package/generated/react/grouped-list/index.d.ts +13 -10
- package/generated/react/icons/icon-ai/index.d.ts +13 -10
- package/generated/react/icons/icon-airplane-up/index.d.ts +13 -10
- package/generated/react/icons/icon-archive/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-bottom-top/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-box-left/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-box-left-alt/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-box-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-down/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-inbox/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-left/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-left-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-out-of-box/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-right-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-right-down-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-right-up-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-rotate-clockwise/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-rotate-counter-clockwise/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-rotate-left-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-rotate-right-left/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-share-left/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-share-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-split/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-up/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-wall-down/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-wall-left/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-wall-right/index.d.ts +13 -10
- package/generated/react/icons/icon-arrow-wall-up/index.d.ts +13 -10
- package/generated/react/icons/icon-arrows-repeat-right/index.d.ts +13 -10
- package/generated/react/icons/icon-asterisk/index.d.ts +13 -10
- package/generated/react/icons/icon-at/index.d.ts +13 -10
- package/generated/react/icons/icon-back/index.d.ts +13 -10
- package/generated/react/icons/icon-backward/index.d.ts +13 -10
- package/generated/react/icons/icon-bag/index.d.ts +13 -10
- package/generated/react/icons/icon-bank/index.d.ts +13 -10
- package/generated/react/icons/icon-banknote/index.d.ts +13 -10
- package/generated/react/icons/icon-banknote-2/index.d.ts +13 -10
- package/generated/react/icons/icon-barcode/index.d.ts +13 -10
- package/generated/react/icons/icon-bars-three/index.d.ts +13 -10
- package/generated/react/icons/icon-bars-two/index.d.ts +13 -10
- package/generated/react/icons/icon-basket/index.d.ts +13 -10
- package/generated/react/icons/icon-battery-loading/index.d.ts +13 -10
- package/generated/react/icons/icon-bell/index.d.ts +13 -10
- package/generated/react/icons/icon-block/index.d.ts +13 -10
- package/generated/react/icons/icon-book/index.d.ts +13 -10
- package/generated/react/icons/icon-bookmark/index.d.ts +13 -10
- package/generated/react/icons/icon-bookmark-check/index.d.ts +13 -10
- package/generated/react/icons/icon-bookmark-delete/index.d.ts +13 -10
- package/generated/react/icons/icon-bookmark-plus/index.d.ts +13 -10
- package/generated/react/icons/icon-bookmark-remove/index.d.ts +13 -10
- package/generated/react/icons/icon-books/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-app-store/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-apple-music/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-bankid/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-chrome/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-facebook/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-figma/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-firefox/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-github/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-green/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-instagram/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-linkedin/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-play-store/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-rss-feed/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-seb/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-spotify/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-storybook/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-swish-word/index.d.ts +13 -10
- package/generated/react/icons/icon-brand-x/index.d.ts +13 -10
- package/generated/react/icons/icon-brush/index.d.ts +13 -10
- package/generated/react/icons/icon-bubble-annotation/index.d.ts +13 -10
- package/generated/react/icons/icon-bubbles/index.d.ts +13 -10
- package/generated/react/icons/icon-buildings/index.d.ts +13 -10
- package/generated/react/icons/icon-bullet-list/index.d.ts +13 -10
- package/generated/react/icons/icon-calculator/index.d.ts +13 -10
- package/generated/react/icons/icon-calendar/index.d.ts +13 -10
- package/generated/react/icons/icon-calendar-check/index.d.ts +13 -10
- package/generated/react/icons/icon-calendar-repeat/index.d.ts +13 -10
- package/generated/react/icons/icon-calender-add/index.d.ts +13 -10
- package/generated/react/icons/icon-call/index.d.ts +13 -10
- package/generated/react/icons/icon-car/index.d.ts +13 -10
- package/generated/react/icons/icon-carussel/index.d.ts +13 -10
- package/generated/react/icons/icon-chain-link/index.d.ts +13 -10
- package/generated/react/icons/icon-chain-link-broken/index.d.ts +13 -10
- package/generated/react/icons/icon-chart-two/index.d.ts +13 -10
- package/generated/react/icons/icon-checklist/index.d.ts +13 -10
- package/generated/react/icons/icon-checkmark/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-bottom/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-double-down/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-double-left/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-double-right/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-double-up/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-down-small/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-grabber-vertical/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-grabber-vertical-reversed/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-left/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-left-small/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-right/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-right-small/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-top/index.d.ts +13 -10
- package/generated/react/icons/icon-chevron-top-small/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-ban/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-check/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-dots/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-info/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-minus/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-placeholder-on/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-plus/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-questionmark/index.d.ts +13 -10
- package/generated/react/icons/icon-circle-x/index.d.ts +13 -10
- package/generated/react/icons/icon-circles-three/index.d.ts +13 -10
- package/generated/react/icons/icon-clock/index.d.ts +13 -10
- package/generated/react/icons/icon-cloud-download/index.d.ts +13 -10
- package/generated/react/icons/icon-cloud-upload/index.d.ts +13 -10
- package/generated/react/icons/icon-cloudy-sun/index.d.ts +13 -10
- package/generated/react/icons/icon-code/index.d.ts +13 -10
- package/generated/react/icons/icon-code-brackets/index.d.ts +13 -10
- package/generated/react/icons/icon-compass-round/index.d.ts +13 -10
- package/generated/react/icons/icon-cookies/index.d.ts +13 -10
- package/generated/react/icons/icon-copy/index.d.ts +13 -10
- package/generated/react/icons/icon-credit-card/index.d.ts +13 -10
- package/generated/react/icons/icon-credit-card-add/index.d.ts +13 -10
- package/generated/react/icons/icon-cross-large/index.d.ts +13 -10
- package/generated/react/icons/icon-cross-small/index.d.ts +13 -10
- package/generated/react/icons/icon-cup-hot/index.d.ts +13 -10
- package/generated/react/icons/icon-cursor/index.d.ts +13 -10
- package/generated/react/icons/icon-details/index.d.ts +13 -10
- package/generated/react/icons/icon-devices/index.d.ts +13 -10
- package/generated/react/icons/icon-direction/index.d.ts +13 -10
- package/generated/react/icons/icon-dollar/index.d.ts +13 -10
- package/generated/react/icons/icon-dot-grid-one-horizontal/index.d.ts +13 -10
- package/generated/react/icons/icon-dot-grid-one-vertical/index.d.ts +13 -10
- package/generated/react/icons/icon-dot-grid-three/index.d.ts +13 -10
- package/generated/react/icons/icon-dot-grid-two/index.d.ts +13 -10
- package/generated/react/icons/icon-email/index.d.ts +13 -10
- package/generated/react/icons/icon-emoji-angry/index.d.ts +13 -10
- package/generated/react/icons/icon-emoji-neutral/index.d.ts +13 -10
- package/generated/react/icons/icon-emoji-sad/index.d.ts +13 -10
- package/generated/react/icons/icon-emoji-smile/index.d.ts +13 -10
- package/generated/react/icons/icon-emoji-smiley/index.d.ts +13 -10
- package/generated/react/icons/icon-euro/index.d.ts +13 -10
- package/generated/react/icons/icon-expand/index.d.ts +13 -10
- package/generated/react/icons/icon-eye-open/index.d.ts +13 -10
- package/generated/react/icons/icon-eye-slash/index.d.ts +13 -10
- package/generated/react/icons/icon-fashion/index.d.ts +13 -10
- package/generated/react/icons/icon-fast-forward/index.d.ts +13 -10
- package/generated/react/icons/icon-file-bend/index.d.ts +13 -10
- package/generated/react/icons/icon-file-chart/index.d.ts +13 -10
- package/generated/react/icons/icon-file-text/index.d.ts +13 -10
- package/generated/react/icons/icon-files/index.d.ts +13 -10
- package/generated/react/icons/icon-filter/index.d.ts +13 -10
- package/generated/react/icons/icon-flag/index.d.ts +13 -10
- package/generated/react/icons/icon-floppy-disk/index.d.ts +13 -10
- package/generated/react/icons/icon-focus/index.d.ts +13 -10
- package/generated/react/icons/icon-folder/index.d.ts +13 -10
- package/generated/react/icons/icon-folder-add-right/index.d.ts +13 -10
- package/generated/react/icons/icon-fullscreen/index.d.ts +13 -10
- package/generated/react/icons/icon-gift/index.d.ts +13 -10
- package/generated/react/icons/icon-globus/index.d.ts +13 -10
- package/generated/react/icons/icon-graduate-cap/index.d.ts +13 -10
- package/generated/react/icons/icon-green-power/index.d.ts +13 -10
- package/generated/react/icons/icon-group/index.d.ts +13 -10
- package/generated/react/icons/icon-growth/index.d.ts +13 -10
- package/generated/react/icons/icon-headphones/index.d.ts +13 -10
- package/generated/react/icons/icon-heart/index.d.ts +13 -10
- package/generated/react/icons/icon-heart-beat/index.d.ts +13 -10
- package/generated/react/icons/icon-history/index.d.ts +13 -10
- package/generated/react/icons/icon-home-energy-one/index.d.ts +13 -10
- package/generated/react/icons/icon-home-energy-two/index.d.ts +13 -10
- package/generated/react/icons/icon-home-open/index.d.ts +13 -10
- package/generated/react/icons/icon-home-roof/index.d.ts +13 -10
- package/generated/react/icons/icon-horizontal-alignment-bottom/index.d.ts +13 -10
- package/generated/react/icons/icon-hourglass/index.d.ts +13 -10
- package/generated/react/icons/icon-images/index.d.ts +13 -10
- package/generated/react/icons/icon-inbox-empty/index.d.ts +13 -10
- package/generated/react/icons/icon-industry/index.d.ts +13 -10
- package/generated/react/icons/icon-jpg/index.d.ts +13 -10
- package/generated/react/icons/icon-key/index.d.ts +13 -10
- package/generated/react/icons/icon-knife-spoon/index.d.ts +13 -10
- package/generated/react/icons/icon-lab/index.d.ts +13 -10
- package/generated/react/icons/icon-law/index.d.ts +13 -10
- package/generated/react/icons/icon-leisure/index.d.ts +13 -10
- package/generated/react/icons/icon-light-bulb-simple/index.d.ts +13 -10
- package/generated/react/icons/icon-lightning/index.d.ts +13 -10
- package/generated/react/icons/icon-line-chart-four/index.d.ts +13 -10
- package/generated/react/icons/icon-line-chart-one/index.d.ts +13 -10
- package/generated/react/icons/icon-line-chart-three/index.d.ts +13 -10
- package/generated/react/icons/icon-line-chart-two/index.d.ts +13 -10
- package/generated/react/icons/icon-lock/index.d.ts +13 -10
- package/generated/react/icons/icon-macbook-air/index.d.ts +13 -10
- package/generated/react/icons/icon-magnifying-glass/index.d.ts +13 -10
- package/generated/react/icons/icon-map-pin/index.d.ts +13 -10
- package/generated/react/icons/icon-megaphone/index.d.ts +13 -10
- package/generated/react/icons/icon-menu-sidebar/index.d.ts +13 -10
- package/generated/react/icons/icon-mic-off/index.d.ts +13 -10
- package/generated/react/icons/icon-mic-on/index.d.ts +13 -10
- package/generated/react/icons/icon-minimize/index.d.ts +13 -10
- package/generated/react/icons/icon-minus-large/index.d.ts +13 -10
- package/generated/react/icons/icon-minus-small/index.d.ts +13 -10
- package/generated/react/icons/icon-money-hand/index.d.ts +13 -10
- package/generated/react/icons/icon-moneybag/index.d.ts +13 -10
- package/generated/react/icons/icon-moon/index.d.ts +13 -10
- package/generated/react/icons/icon-mute/index.d.ts +13 -10
- package/generated/react/icons/icon-newspaper/index.d.ts +13 -10
- package/generated/react/icons/icon-office/index.d.ts +13 -10
- package/generated/react/icons/icon-page-add/index.d.ts +13 -10
- package/generated/react/icons/icon-paper-plane-top-right/index.d.ts +13 -10
- package/generated/react/icons/icon-paperclip/index.d.ts +13 -10
- package/generated/react/icons/icon-pause/index.d.ts +13 -10
- package/generated/react/icons/icon-pdf/index.d.ts +13 -10
- package/generated/react/icons/icon-pencil-sign/index.d.ts +13 -10
- package/generated/react/icons/icon-pencil-sparkle/index.d.ts +13 -10
- package/generated/react/icons/icon-pencil-wave/index.d.ts +13 -10
- package/generated/react/icons/icon-pension/index.d.ts +13 -10
- package/generated/react/icons/icon-people/index.d.ts +13 -10
- package/generated/react/icons/icon-people-a11y/index.d.ts +13 -10
- package/generated/react/icons/icon-people-add/index.d.ts +13 -10
- package/generated/react/icons/icon-people-added/index.d.ts +13 -10
- package/generated/react/icons/icon-people-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-people-copy/index.d.ts +13 -10
- package/generated/react/icons/icon-people-profile/index.d.ts +13 -10
- package/generated/react/icons/icon-people-remove/index.d.ts +13 -10
- package/generated/react/icons/icon-percent/index.d.ts +13 -10
- package/generated/react/icons/icon-phone/index.d.ts +13 -10
- package/generated/react/icons/icon-pie-chart/index.d.ts +13 -10
- package/generated/react/icons/icon-piggy-bank/index.d.ts +13 -10
- package/generated/react/icons/icon-pin/index.d.ts +13 -10
- package/generated/react/icons/icon-pinch/index.d.ts +13 -10
- package/generated/react/icons/icon-play/index.d.ts +13 -10
- package/generated/react/icons/icon-play-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-plus-large/index.d.ts +13 -10
- package/generated/react/icons/icon-plus-small/index.d.ts +13 -10
- package/generated/react/icons/icon-png/index.d.ts +13 -10
- package/generated/react/icons/icon-poop/index.d.ts +13 -10
- package/generated/react/icons/icon-postcard/index.d.ts +13 -10
- package/generated/react/icons/icon-pound/index.d.ts +13 -10
- package/generated/react/icons/icon-power/index.d.ts +13 -10
- package/generated/react/icons/icon-power-plant/index.d.ts +13 -10
- package/generated/react/icons/icon-printer/index.d.ts +13 -10
- package/generated/react/icons/icon-push/index.d.ts +13 -10
- package/generated/react/icons/icon-qr-code/index.d.ts +13 -10
- package/generated/react/icons/icon-rainy/index.d.ts +13 -10
- package/generated/react/icons/icon-raising-hand/index.d.ts +13 -10
- package/generated/react/icons/icon-reading-list/index.d.ts +13 -10
- package/generated/react/icons/icon-receipt-bill/index.d.ts +13 -10
- package/generated/react/icons/icon-receiption-bell/index.d.ts +13 -10
- package/generated/react/icons/icon-record/index.d.ts +13 -10
- package/generated/react/icons/icon-refund/index.d.ts +13 -10
- package/generated/react/icons/icon-robot/index.d.ts +13 -10
- package/generated/react/icons/icon-rocket/index.d.ts +13 -10
- package/generated/react/icons/icon-run-shortcut/index.d.ts +13 -10
- package/generated/react/icons/icon-safari/index.d.ts +13 -10
- package/generated/react/icons/icon-school/index.d.ts +13 -10
- package/generated/react/icons/icon-scissors/index.d.ts +13 -10
- package/generated/react/icons/icon-search-menu/index.d.ts +13 -10
- package/generated/react/icons/icon-settings-gear/index.d.ts +13 -10
- package/generated/react/icons/icon-settings-slider-hor/index.d.ts +13 -10
- package/generated/react/icons/icon-settings-slider-ver/index.d.ts +13 -10
- package/generated/react/icons/icon-shapes/index.d.ts +13 -10
- package/generated/react/icons/icon-share/index.d.ts +13 -10
- package/generated/react/icons/icon-shield/index.d.ts +13 -10
- package/generated/react/icons/icon-shield-checked/index.d.ts +13 -10
- package/generated/react/icons/icon-shield-crossed/index.d.ts +13 -10
- package/generated/react/icons/icon-shopping-bag/index.d.ts +13 -10
- package/generated/react/icons/icon-signature/index.d.ts +13 -10
- package/generated/react/icons/icon-smartwatch/index.d.ts +13 -10
- package/generated/react/icons/icon-solar/index.d.ts +13 -10
- package/generated/react/icons/icon-sort/index.d.ts +13 -10
- package/generated/react/icons/icon-sort-ascending/index.d.ts +13 -10
- package/generated/react/icons/icon-sort-descending/index.d.ts +13 -10
- package/generated/react/icons/icon-sort-down/index.d.ts +13 -10
- package/generated/react/icons/icon-sort-up/index.d.ts +13 -10
- package/generated/react/icons/icon-square-arrow-top-right/index.d.ts +13 -10
- package/generated/react/icons/icon-square-behind-square/index.d.ts +13 -10
- package/generated/react/icons/icon-square-grid-circle/index.d.ts +13 -10
- package/generated/react/icons/icon-square-placeholder/index.d.ts +13 -10
- package/generated/react/icons/icon-star/index.d.ts +13 -10
- package/generated/react/icons/icon-store/index.d.ts +13 -10
- package/generated/react/icons/icon-sun/index.d.ts +13 -10
- package/generated/react/icons/icon-sunset-arrow-down/index.d.ts +13 -10
- package/generated/react/icons/icon-tag/index.d.ts +13 -10
- package/generated/react/icons/icon-target-arrow/index.d.ts +13 -10
- package/generated/react/icons/icon-television/index.d.ts +13 -10
- package/generated/react/icons/icon-tennis/index.d.ts +13 -10
- package/generated/react/icons/icon-text-edit/index.d.ts +13 -10
- package/generated/react/icons/icon-thermostat/index.d.ts +13 -10
- package/generated/react/icons/icon-thumbs-down/index.d.ts +13 -10
- package/generated/react/icons/icon-thumbs-up/index.d.ts +13 -10
- package/generated/react/icons/icon-ticket/index.d.ts +13 -10
- package/generated/react/icons/icon-trading-view-candles/index.d.ts +13 -10
- package/generated/react/icons/icon-trash-can/index.d.ts +13 -10
- package/generated/react/icons/icon-tree/index.d.ts +13 -10
- package/generated/react/icons/icon-trending-five/index.d.ts +13 -10
- package/generated/react/icons/icon-trending-four/index.d.ts +13 -10
- package/generated/react/icons/icon-trending-one/index.d.ts +13 -10
- package/generated/react/icons/icon-trending-three/index.d.ts +13 -10
- package/generated/react/icons/icon-trending-two/index.d.ts +13 -10
- package/generated/react/icons/icon-triangle-exclamation/index.d.ts +13 -10
- package/generated/react/icons/icon-truck/index.d.ts +13 -10
- package/generated/react/icons/icon-umbrella-security/index.d.ts +13 -10
- package/generated/react/icons/icon-unlocked/index.d.ts +13 -10
- package/generated/react/icons/icon-volume-full/index.d.ts +13 -10
- package/generated/react/icons/icon-volume-half/index.d.ts +13 -10
- package/generated/react/icons/icon-volume-off/index.d.ts +13 -10
- package/generated/react/icons/icon-wallet/index.d.ts +13 -10
- package/generated/react/icons/icon-warning-sign/index.d.ts +13 -10
- package/generated/react/icons/icon-wifi-full/index.d.ts +13 -10
- package/generated/react/icons/icon-youtube/index.d.ts +13 -10
- package/generated/react/icons/icon-zap/index.d.ts +13 -10
- package/generated/react/icons/icon-zoom-in/index.d.ts +13 -10
- package/generated/react/icons/icon-zoom-out/index.d.ts +13 -10
- package/generated/react/img/index.d.ts +13 -10
- package/generated/react/index.d.ts +2 -2
- package/generated/react/index.js +2 -2
- package/generated/react/input/index.d.ts +20 -18
- package/generated/react/link/index.d.ts +13 -10
- package/generated/react/list/index.d.ts +13 -10
- package/generated/react/list-item/index.d.ts +13 -10
- package/generated/react/list-item-pattern-01/index.d.ts +13 -10
- package/generated/react/mask/index.d.ts +13 -10
- package/generated/react/menu-button/index.d.ts +13 -10
- package/generated/react/menu-heading/index.d.ts +13 -10
- package/generated/react/menu-item/index.d.ts +13 -10
- package/generated/react/option/index.d.ts +14 -11
- package/generated/react/pagination/index.d.ts +13 -10
- package/generated/react/popover/index.d.ts +13 -10
- package/generated/react/radio/index.d.ts +13 -10
- package/generated/react/radio-group/index.d.ts +19 -16
- package/generated/react/rich-text/index.d.ts +14 -11
- package/generated/react/segment/index.d.ts +14 -11
- package/generated/react/segmented-control/index.d.ts +15 -12
- package/generated/react/select/index.d.ts +25 -26
- package/generated/react/select/index.js +3 -13
- package/generated/react/sensitive-account/index.d.ts +14 -11
- package/generated/react/sensitive-date/index.d.ts +14 -11
- package/generated/react/sensitive-number/index.d.ts +14 -11
- package/generated/react/signal/index.d.ts +13 -10
- package/generated/react/spinner/index.d.ts +13 -10
- package/generated/react/switch/index.d.ts +18 -15
- package/generated/react/tab/index.d.ts +13 -10
- package/generated/react/tab-panel/index.d.ts +13 -10
- package/generated/react/table/index.d.ts +13 -10
- package/generated/react/tabs/index.d.ts +13 -10
- package/generated/react/text/index.d.ts +13 -10
- package/generated/react/textarea/index.d.ts +20 -18
- package/generated/react/theme/index.d.ts +13 -10
- package/generated/react/video/index.d.ts +13 -10
- package/package.json +1 -1
- package/primitives/field-base/field-base.trans.styles.scss.js +1 -1
- package/shared-styles/rbcb-toggle.style.js +3 -5
- package/test-setup.d.ts +1 -0
- package/test-setup.js +9 -1
- package/utils/decorators/resize-observer.d.ts +20 -1
- package/utils/decorators/resize-observer.js +21 -3
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import { GdsFormControlElement } from "../form/form-control.js";
|
|
29
29
|
import ButtonStyles from "./button.styles.js";
|
|
30
30
|
const ariaForwards = ["aria-label", "aria-haspopup", "aria-expanded"];
|
|
31
|
-
const attributeForwards = [...ariaForwards, "gds-tabindex"];
|
|
31
|
+
const attributeForwards = [...ariaForwards, "gds-tabindex", "gds-aria-selected"];
|
|
32
32
|
const html = stripWhitespace(customElementHtml);
|
|
33
33
|
let Button = class extends GdsFormControlElement {
|
|
34
34
|
constructor() {
|
|
@@ -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@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base, _ranks, _overrides;\n :host {\n display: inline-block;\n }\n @layer _base {\n .button {\n background-color: transparent;\n border: 0;\n cursor: pointer;\n font-family: inherit;\n padding: 0;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-bottom: 0.75rem;\n padding-top: 0.75rem;\n border-radius: 0.25rem;\n border: solid 1px var(--gds-sys-color-base-600);\n font-weight: 500;\n }\n .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n .button:focus, .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n .button {\n min-height: 2.75rem;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n .button {\n min-width: 100%;\n }\n }\n @media screen and (-ms-high-contrast: active) {\n .button {\n border: 2px solid currentcolor;\n }\n }\n .button.small {\n min-height: 2rem;\n height: 2rem;\n padding: 0.4375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n }\n .button.large {\n min-height: 4rem;\n padding: 1rem 1.5rem;\n font-size: 1.5rem;\n line-height: 2rem;\n }\n .button {\n box-sizing: border-box;\n font-size: inherit;\n overflow: hidden;\n display: flex;\n gap: 0.5rem;\n text-decoration: none;\n width: 100%;\n }\n .button slot:not([name]) {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n :host(:not([variant=ghost])) .button {\n transition: border var(--gds-sys-transition);\n }\n :host(:not([variant=ghost])) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host(:not([variant=ghost])) .button[aria-selected=true], :host(:not([variant=ghost])) .button:active, :host(:not([variant=ghost])) .button.active, :host(:not([variant=ghost])) .button.active:hover, :host(:not([variant=ghost])) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host(:not([variant=ghost])) .button {\n background: var(--gds-sys-color-dark-blue-2);\n border-color: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --color: var(--gds-sys-color-text-white);\n }\n :host(:not([variant=ghost])) .button:disabled, :host(:not([variant=ghost])) .button.disabled, :host(:not([variant=ghost])) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host(:not([variant=ghost])) .button:disabled::-moz-placeholder, :host(:not([variant=ghost])) .button.disabled::-moz-placeholder, :host(:not([variant=ghost])) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host(:not([variant=ghost])) .button:disabled::placeholder, :host(:not([variant=ghost])) .button.disabled::placeholder, :host(:not([variant=ghost])) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=secondary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([rank*=secondary]) .button:focus, :host([rank*=secondary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([rank*=secondary]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([rank*=secondary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host([rank*=secondary]) .button[aria-selected=true], :host([rank*=secondary]) .button:active, :host([rank*=secondary]) .button.active, :host([rank*=secondary]) .button.active:hover, :host([rank*=secondary]) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=secondary]) .button {\n background: transparent;\n border-color: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-dark-blue-2);\n --color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=secondary]) .button:disabled, :host([rank*=secondary]) .button.disabled, :host([rank*=secondary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([rank*=secondary]) .button:disabled::-moz-placeholder, :host([rank*=secondary]) .button.disabled::-moz-placeholder, :host([rank*=secondary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=secondary]) .button:disabled::placeholder, :host([rank*=secondary]) .button.disabled::placeholder, :host([rank*=secondary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=tertiary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([rank*=tertiary]) .button:focus, :host([rank*=tertiary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([rank*=tertiary]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([rank*=tertiary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host([rank*=tertiary]) .button[aria-selected=true], :host([rank*=tertiary]) .button:active, :host([rank*=tertiary]) .button.active, :host([rank*=tertiary]) .button.active:hover, :host([rank*=tertiary]) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=tertiary]) .button {\n background: transparent;\n border-color: transparent;\n color: var(--gds-sys-color-dark-blue-2);\n --color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=tertiary]) .button:disabled, :host([rank*=tertiary]) .button.disabled, :host([rank*=tertiary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([rank*=tertiary]) .button:disabled::-moz-placeholder, :host([rank*=tertiary]) .button.disabled::-moz-placeholder, :host([rank*=tertiary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=tertiary]) .button:disabled::placeholder, :host([rank*=tertiary]) .button.disabled::placeholder, :host([rank*=tertiary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n /* stylelint-disable */\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button,\n :host([variant=negative][rank=primary]) .button {\n background: var(--gds-sys-color-dark-red-1);\n border-color: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --color: var(--gds-sys-color-text-white);\n transition: border var(--gds-sys-transition);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:not(:disabled, .disabled, [aria-disabled]):hover,\n :host([variant=negative][rank=primary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-selected=true], :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active:hover,\n :host([variant=negative][rank=primary]) .button[aria-selected=true],\n :host([variant=negative][rank=primary]) .button:active,\n :host([variant=negative][rank=primary]) .button.active,\n :host([variant=negative][rank=primary]) .button.active:hover,\n :host([variant=negative][rank=primary]) .button:active:hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-selected]:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active:hover,\n :host([variant=negative][rank=primary]) .button[aria-selected]:hover,\n :host([variant=negative][rank=primary]) .button.active:hover,\n :host([variant=negative][rank=primary]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus:not(:focus-visible),\n :host([variant=negative][rank=primary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus-visible,\n :host([variant=negative][rank=primary]) .button:focus,\n :host([variant=negative][rank=primary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true],\n :host([variant=negative][rank=primary]) .button:disabled,\n :host([variant=negative][rank=primary]) .button.disabled,\n :host([variant=negative][rank=primary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-background-primary) !important;\n color: var(--gds-sys-color-text-white) !important;\n border-color: var(--gds-sys-color-dark-red-1) !important;\n cursor: not-allowed;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled::-moz-placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled::-moz-placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true]::-moz-placeholder, :host([variant=negative][rank=primary]) .button:disabled::-moz-placeholder, :host([variant=negative][rank=primary]) .button.disabled::-moz-placeholder, :host([variant=negative][rank=primary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled::placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled::placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true]::placeholder,\n :host([variant=negative][rank=primary]) .button:disabled::placeholder,\n :host([variant=negative][rank=primary]) .button.disabled::placeholder,\n :host([variant=negative][rank=primary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n /* stylelint-enable */\n :host([variant=negative][rank=secondary]) .button,\n :host([variant=negative][rank=tertiary]) .button {\n color: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-dark-red-1);\n border-color: transparent;\n transition: border var(--gds-sys-transition);\n }\n :host([variant=negative][rank=secondary]) .button:not(:disabled, .disabled, [aria-disabled]):hover,\n :host([variant=negative][rank=tertiary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative][rank=secondary]) .button[aria-selected=true], :host([variant=negative][rank=secondary]) .button:active, :host([variant=negative][rank=secondary]) .button.active, :host([variant=negative][rank=secondary]) .button.active:hover, :host([variant=negative][rank=secondary]) .button:active:hover,\n :host([variant=negative][rank=tertiary]) .button[aria-selected=true],\n :host([variant=negative][rank=tertiary]) .button:active,\n :host([variant=negative][rank=tertiary]) .button.active,\n :host([variant=negative][rank=tertiary]) .button.active:hover,\n :host([variant=negative][rank=tertiary]) .button:active:hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative][rank=secondary]) .button[aria-selected]:hover, :host([variant=negative][rank=secondary]) .button.active:hover, :host([variant=negative][rank=secondary]) .button:active:hover,\n :host([variant=negative][rank=tertiary]) .button[aria-selected]:hover,\n :host([variant=negative][rank=tertiary]) .button.active:hover,\n :host([variant=negative][rank=tertiary]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=negative][rank=secondary]) .button:focus:not(:focus-visible),\n :host([variant=negative][rank=tertiary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([variant=negative][rank=secondary]) .button:focus, :host([variant=negative][rank=secondary]) .button:focus-visible,\n :host([variant=negative][rank=tertiary]) .button:focus,\n :host([variant=negative][rank=tertiary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([variant=negative][rank=secondary]) .button {\n border-color: var(--gds-sys-color-dark-red-2);\n }\n :host([variant=ghost]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([variant=ghost]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-base-800);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button[aria-selected=true], :host([variant=ghost]) .button:active, :host([variant=ghost]) .button.active, :host([variant=ghost]) .button.active:hover, :host([variant=ghost]) .button:active:hover {\n background: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button[aria-selected]:hover, :host([variant=ghost]) .button.active:hover, :host([variant=ghost]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=ghost]) .button {\n background-color: transparent;\n border-color: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-base-800);\n --color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button:disabled, :host([variant=ghost]) .button.disabled, :host([variant=ghost]) .button[aria-disabled=true] {\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([variant=ghost]) .button:disabled::-moz-placeholder, :host([variant=ghost]) .button.disabled::-moz-placeholder, :host([variant=ghost]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([variant=ghost]) .button:disabled::placeholder, :host([variant=ghost]) .button.disabled::placeholder, :host([variant=ghost]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n }\n @layer _overrides {\n :host .button.icon {\n padding: 0.75rem;\n background: transparent;\n border-width: 0px;\n color: currentColor;\n }\n :host .button.icon:hover {\n color: currentColor;\n background: var(--gds-sys-color-base-300);\n }\n :host .button.icon slot {\n display: contents;\n }\n .button.icon.xs {\n min-height: 1.5rem;\n line-height: 0.75rem;\n padding: 0.25rem;\n }\n .button.icon.small {\n padding: 0.5rem;\n }\n .button.icon.large {\n padding: 1rem;\n }\n }\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@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base, _ranks, _overrides;\n :host {\n display: inline-block;\n }\n @layer _base {\n .button {\n background-color: transparent;\n border: 0;\n cursor: pointer;\n font-family: inherit;\n padding: 0;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-bottom: 0.75rem;\n padding-top: 0.75rem;\n border-radius: 0.25rem;\n border: solid 1px var(--gds-sys-color-base-600);\n font-weight: 500;\n }\n .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n .button:focus, .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n .button {\n min-height: 2.75rem;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n .button {\n min-width: 100%;\n }\n }\n @media screen and (-ms-high-contrast: active) {\n .button {\n border: 2px solid currentcolor;\n }\n }\n .button.small {\n min-height: 2rem;\n height: 2rem;\n padding: 0.4375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n }\n .button.large {\n min-height: 4rem;\n padding: 1rem 1.5rem;\n font-size: 1.5rem;\n line-height: 2rem;\n }\n .button {\n box-sizing: border-box;\n font-size: inherit;\n overflow: hidden;\n display: flex;\n gap: 0.5rem;\n text-decoration: none;\n width: 100%;\n }\n .button slot:not([name]) {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n :host(:not([variant=ghost])) .button {\n transition: border var(--gds-sys-transition);\n }\n :host(:not([variant=ghost])) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host(:not([variant=ghost])) .button[aria-selected=true], :host(:not([variant=ghost])) .button:active, :host(:not([variant=ghost])) .button.active, :host(:not([variant=ghost])) .button.active:hover, :host(:not([variant=ghost])) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host(:not([variant=ghost])) .button {\n background: var(--gds-sys-color-dark-blue-2);\n border-color: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --color: var(--gds-sys-color-text-white);\n }\n :host(:not([variant=ghost])) .button:disabled, :host(:not([variant=ghost])) .button.disabled, :host(:not([variant=ghost])) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host(:not([variant=ghost])) .button:disabled::-moz-placeholder, :host(:not([variant=ghost])) .button.disabled::-moz-placeholder, :host(:not([variant=ghost])) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host(:not([variant=ghost])) .button:disabled::placeholder, :host(:not([variant=ghost])) .button.disabled::placeholder, :host(:not([variant=ghost])) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=secondary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([rank*=secondary]) .button:focus, :host([rank*=secondary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([rank*=secondary]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([rank*=secondary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host([rank*=secondary]) .button[aria-selected=true], :host([rank*=secondary]) .button:active, :host([rank*=secondary]) .button.active, :host([rank*=secondary]) .button.active:hover, :host([rank*=secondary]) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=secondary]) .button {\n background: transparent;\n border-color: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-dark-blue-2);\n --color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=secondary]) .button:disabled, :host([rank*=secondary]) .button.disabled, :host([rank*=secondary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([rank*=secondary]) .button:disabled::-moz-placeholder, :host([rank*=secondary]) .button.disabled::-moz-placeholder, :host([rank*=secondary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=secondary]) .button:disabled::placeholder, :host([rank*=secondary]) .button.disabled::placeholder, :host([rank*=secondary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=tertiary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([rank*=tertiary]) .button:focus, :host([rank*=tertiary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([rank*=tertiary]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([rank*=tertiary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-blue-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-blue-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-blue-1);\n }\n :host([rank*=tertiary]) .button[aria-selected=true], :host([rank*=tertiary]) .button:active, :host([rank*=tertiary]) .button.active, :host([rank*=tertiary]) .button.active:hover, :host([rank*=tertiary]) .button:active:hover {\n background: var(--gds-sys-color-dark-blue-2);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=tertiary]) .button {\n background: transparent;\n border-color: transparent;\n color: var(--gds-sys-color-dark-blue-2);\n --color: var(--gds-sys-color-dark-blue-2);\n }\n :host([rank*=tertiary]) .button:disabled, :host([rank*=tertiary]) .button.disabled, :host([rank*=tertiary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-base-300) !important;\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([rank*=tertiary]) .button:disabled::-moz-placeholder, :host([rank*=tertiary]) .button.disabled::-moz-placeholder, :host([rank*=tertiary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([rank*=tertiary]) .button:disabled::placeholder, :host([rank*=tertiary]) .button.disabled::placeholder, :host([rank*=tertiary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n /* stylelint-disable */\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button,\n :host([variant=negative][rank=primary]) .button {\n background: var(--gds-sys-color-dark-red-1);\n border-color: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --color: var(--gds-sys-color-text-white);\n transition: border var(--gds-sys-transition);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:not(:disabled, .disabled, [aria-disabled]):hover,\n :host([variant=negative][rank=primary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-selected=true], :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active:hover,\n :host([variant=negative][rank=primary]) .button[aria-selected=true],\n :host([variant=negative][rank=primary]) .button:active,\n :host([variant=negative][rank=primary]) .button.active,\n :host([variant=negative][rank=primary]) .button.active:hover,\n :host([variant=negative][rank=primary]) .button:active:hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-selected]:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.active:hover, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:active:hover,\n :host([variant=negative][rank=primary]) .button[aria-selected]:hover,\n :host([variant=negative][rank=primary]) .button.active:hover,\n :host([variant=negative][rank=primary]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus:not(:focus-visible),\n :host([variant=negative][rank=primary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:focus-visible,\n :host([variant=negative][rank=primary]) .button:focus,\n :host([variant=negative][rank=primary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true],\n :host([variant=negative][rank=primary]) .button:disabled,\n :host([variant=negative][rank=primary]) .button.disabled,\n :host([variant=negative][rank=primary]) .button[aria-disabled=true] {\n background: var(--gds-sys-color-background-primary) !important;\n color: var(--gds-sys-color-text-white) !important;\n border-color: var(--gds-sys-color-dark-red-1) !important;\n cursor: not-allowed;\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled::-moz-placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled::-moz-placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true]::-moz-placeholder, :host([variant=negative][rank=primary]) .button:disabled::-moz-placeholder, :host([variant=negative][rank=primary]) .button.disabled::-moz-placeholder, :host([variant=negative][rank=primary]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button:disabled::placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button.disabled::placeholder, :host([variant=negative]:not([rank=secondary], [rank=tertiary])) .button[aria-disabled=true]::placeholder,\n :host([variant=negative][rank=primary]) .button:disabled::placeholder,\n :host([variant=negative][rank=primary]) .button.disabled::placeholder,\n :host([variant=negative][rank=primary]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n /* stylelint-enable */\n :host([variant=negative][rank=secondary]) .button,\n :host([variant=negative][rank=tertiary]) .button {\n color: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-dark-red-1);\n border-color: transparent;\n transition: border var(--gds-sys-transition);\n }\n :host([variant=negative][rank=secondary]) .button:not(:disabled, .disabled, [aria-disabled]):hover,\n :host([variant=negative][rank=tertiary]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-dark-red-1);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative][rank=secondary]) .button[aria-selected=true], :host([variant=negative][rank=secondary]) .button:active, :host([variant=negative][rank=secondary]) .button.active, :host([variant=negative][rank=secondary]) .button.active:hover, :host([variant=negative][rank=secondary]) .button:active:hover,\n :host([variant=negative][rank=tertiary]) .button[aria-selected=true],\n :host([variant=negative][rank=tertiary]) .button:active,\n :host([variant=negative][rank=tertiary]) .button.active,\n :host([variant=negative][rank=tertiary]) .button.active:hover,\n :host([variant=negative][rank=tertiary]) .button:active:hover {\n background: var(--gds-sys-color-dark-red-1);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-dark-red-1);\n }\n :host([variant=negative][rank=secondary]) .button[aria-selected]:hover, :host([variant=negative][rank=secondary]) .button.active:hover, :host([variant=negative][rank=secondary]) .button:active:hover,\n :host([variant=negative][rank=tertiary]) .button[aria-selected]:hover,\n :host([variant=negative][rank=tertiary]) .button.active:hover,\n :host([variant=negative][rank=tertiary]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=negative][rank=secondary]) .button:focus:not(:focus-visible),\n :host([variant=negative][rank=tertiary]) .button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host([variant=negative][rank=secondary]) .button:focus, :host([variant=negative][rank=secondary]) .button:focus-visible,\n :host([variant=negative][rank=tertiary]) .button:focus,\n :host([variant=negative][rank=tertiary]) .button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host([variant=negative][rank=secondary]) .button {\n border-color: var(--gds-sys-color-dark-red-2);\n }\n :host([variant=ghost]) .button {\n transition: border var(--gds-sys-transition);\n }\n :host([variant=ghost]) .button:not(:disabled, .disabled, [aria-disabled]):hover {\n background: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-text-white);\n --background: var(--gds-sys-color-base-800);\n --color: var(--gds-sys-color-text-white);\n border-color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button[aria-selected=true], :host([variant=ghost]) .button:active, :host([variant=ghost]) .button.active, :host([variant=ghost]) .button.active:hover, :host([variant=ghost]) .button:active:hover {\n background: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-text-white);\n --background: $bg;\n --color: $color;\n border-color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button[aria-selected]:hover, :host([variant=ghost]) .button.active:hover, :host([variant=ghost]) .button:active:hover {\n opacity: 0.9;\n }\n :host([variant=ghost]) .button {\n background-color: transparent;\n border-color: var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-base-800);\n --color: var(--gds-sys-color-base-800);\n }\n :host([variant=ghost]) .button:disabled, :host([variant=ghost]) .button.disabled, :host([variant=ghost]) .button[aria-disabled=true] {\n color: var(--gds-sys-color-text-disabled) !important;\n border-color: var(--gds-sys-color-text-disabled) !important;\n cursor: not-allowed;\n }\n :host([variant=ghost]) .button:disabled::-moz-placeholder, :host([variant=ghost]) .button.disabled::-moz-placeholder, :host([variant=ghost]) .button[aria-disabled=true]::-moz-placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n :host([variant=ghost]) .button:disabled::placeholder, :host([variant=ghost]) .button.disabled::placeholder, :host([variant=ghost]) .button[aria-disabled=true]::placeholder {\n color: var(--gds-sys-color-text-disabled);\n }\n }\n @layer _overrides {\n :host .button.icon {\n padding: 0.75rem;\n background: transparent;\n border-width: 0px;\n color: currentColor;\n }\n :host .button.icon:hover {\n color: currentColor;\n background: var(--gds-sys-color-base-300);\n }\n :host .button.icon slot {\n display: contents;\n }\n .button.icon.xs {\n min-height: 1.5rem;\n line-height: 0.75rem;\n padding: 0.25rem;\n }\n .button.icon.small {\n padding: 0.5rem;\n }\n .button.icon.large {\n padding: 1rem;\n }\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -154,9 +154,7 @@ let GdsCalendar = class extends GdsElement {
|
|
|
154
154
|
const shouldRenderBlank = this.hideExtraneousDays && isOutsideCurrentMonth;
|
|
155
155
|
return shouldRenderBlank ? html`<td inert></td>` : html`
|
|
156
156
|
<td
|
|
157
|
-
role="
|
|
158
|
-
isDisabled ? void 0 : "gridcell"
|
|
159
|
-
)}"
|
|
157
|
+
role="gridcell"
|
|
160
158
|
class="${classMap({
|
|
161
159
|
small: Boolean(this.size === "small"),
|
|
162
160
|
"custom-date": Boolean(customization),
|
|
@@ -165,6 +163,7 @@ let GdsCalendar = class extends GdsElement {
|
|
|
165
163
|
"outside-month": isOutsideCurrentMonth
|
|
166
164
|
})}"
|
|
167
165
|
?disabled=${isDisabled}
|
|
166
|
+
aria-disabled="${isDisabled ? "true" : "false"}"
|
|
168
167
|
tabindex="${isSameDay(this.focusedDate, day) ? 0 : -1}"
|
|
169
168
|
aria-selected="${this.value && isSameDay(this.value, day) ? "true" : "false"}"
|
|
170
169
|
aria-label="${this.dateLabelTemplate(day)}"
|
|
@@ -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/* medium */\n/* regular */\n/* regular */\n/* regular */\n/* hover */\n/* focus */\n/* selected */\n/* highlighted */\n/* active */\n/* disabled */\n/* today */\n/* weekend */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base {\n :host {\n display: flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n :host {\n flex-wrap: wrap;\n overflow-y: auto;\n }\n }\n :host table {\n border-spacing: 0;\n }\n :host th,\n :host td {\n box-sizing: border-box;\n height: 2.75rem;\n text-align: center;\n width: 2.75rem;\n }\n :host thead {\n /* days */\n }\n :host thead th {\n background: var(--gds-sys-color-background-primary);\n border-bottom: solid 1px var(--gds-sys-color-base-300);\n font-weight: 400;\n top: 0;\n }\n @media (max-width: 35.98em) {\n :host thead th {\n position: sticky;\n }\n }\n :host tbody {\n /* week numbers */\n }\n :host tbody th {\n font-weight: 400;\n }\n :host tbody {\n /* dates */\n }\n :host tbody td {\n border: solid 1px transparent;\n font-weight: 500;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* weekend */\n }\n :host tbody td.sg-date-holiday:not(.disabled) {\n background: var(--gds-sys-color-background-primary);\n color: var(--gds-sys-color-text-error);\n }\n :host tbody td {\n /* today */\n }\n :host tbody td.today {\n background: transparent;\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-base-800);\n }\n :host tbody td {\n /* hover */\n }\n :host tbody td:hover:not(.disabled) {\n background: var(--gds-sys-color-base-300);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-primary);\n cursor: pointer;\n }\n :host tbody td {\n /* focus */\n }\n :host tbody td:focus-visible:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host tbody td:focus-visible:focus, :host tbody td:focus-visible:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host tbody td:focus-visible:not(.disabled) {\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n cursor: pointer;\n position: relative;\n z-index: 0;\n }\n :host tbody td {\n /* selected */\n }\n :host tbody td[aria-selected=true] {\n background: var(--gds-sys-color-base-800);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-inverted);\n }\n :host tbody td {\n /* highlighted */\n }\n :host tbody td[tabindex=\"0\"] {\n border-radius: 4px;\n }\n :host tbody td {\n /* active (pressed) */\n }\n :host tbody td:hover:active:not(.disabled) {\n background: var(--gds-sys-color-base-800);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-inverted);\n }\n :host tbody td {\n /* disabled */\n }\n :host tbody td.disabled {\n background: var(--gds-sys-color-base-200);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-disabled);\n cursor: not-allowed;\n font-weight: 400;\n }\n :host tbody td.disabled.sg-date-holiday {\n color: var(--gds-sys-color-text-error);\n }\n :host tbody td.disabled .number,\n :host tbody td.disabled .indicator-dot {\n --_color: var(--gds-sys-color-text-disabled) !important;\n }\n :host tbody td.custom-date {\n position: relative;\n }\n :host tbody .number {\n color: var(--_color, \"currentColor\");\n }\n :host tbody .indicator-dot {\n display: block;\n width: 0.375rem;\n height: 0.375rem;\n top: 1.5rem;\n border-radius: 50%;\n margin: auto;\n position: absolute;\n inset-block-end: 0.125rem;\n inset-inline: 0;\n background-color: var(--_color);\n }\n :host table {\n flex-grow: 1;\n width: 100%;\n }\n :host table td {\n width: 3rem;\n height: 3rem;\n }\n }\n @layer _modifiers {\n .week-number {\n border-right: solid 1px var(--gds-sys-color-base-300);\n font-weight: 400;\n pointer-events: none;\n }\n }\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/* medium */\n/* regular */\n/* regular */\n/* regular */\n/* hover */\n/* focus */\n/* selected */\n/* highlighted */\n/* active */\n/* disabled */\n/* today */\n/* weekend */\n@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base {\n :host {\n display: flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n :host {\n flex-wrap: wrap;\n overflow-y: auto;\n }\n }\n :host table {\n border-spacing: 0;\n }\n :host th,\n :host td {\n box-sizing: border-box;\n height: 2.75rem;\n text-align: center;\n width: 2.75rem;\n }\n :host thead {\n /* days */\n }\n :host thead th {\n background: var(--gds-sys-color-background-primary);\n border-bottom: solid 1px var(--gds-sys-color-base-300);\n font-weight: 400;\n top: 0;\n }\n @media (max-width: 35.98em) {\n :host thead th {\n position: sticky;\n }\n }\n :host tbody {\n /* week numbers */\n }\n :host tbody th {\n font-weight: 400;\n }\n :host tbody {\n /* dates */\n }\n :host tbody td {\n border: solid 1px transparent;\n font-weight: 500;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* weekend */\n }\n :host tbody td.sg-date-holiday:not(.disabled) {\n background: var(--gds-sys-color-background-primary);\n color: var(--gds-sys-color-text-error);\n }\n :host tbody td {\n /* today */\n }\n :host tbody td.today {\n background: transparent;\n border-radius: 4px;\n box-shadow: inset 0 0 0 2px var(--gds-sys-color-base-800);\n color: var(--gds-sys-color-base-800);\n }\n :host tbody td {\n /* hover */\n }\n :host tbody td:hover:not(.disabled) {\n background: var(--gds-sys-color-base-300);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-primary);\n cursor: pointer;\n }\n :host tbody td {\n /* focus */\n }\n :host tbody td:focus-visible:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n :host tbody td:focus-visible:focus, :host tbody td:focus-visible:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n :host tbody td:focus-visible:not(.disabled) {\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n cursor: pointer;\n position: relative;\n z-index: 0;\n }\n :host tbody td {\n /* selected */\n }\n :host tbody td[aria-selected=true] {\n background: var(--gds-sys-color-base-800);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-inverted);\n }\n :host tbody td {\n /* highlighted */\n }\n :host tbody td[tabindex=\"0\"] {\n border-radius: 4px;\n }\n :host tbody td {\n /* active (pressed) */\n }\n :host tbody td:hover:active:not(.disabled) {\n background: var(--gds-sys-color-base-800);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-inverted);\n }\n :host tbody td {\n /* disabled */\n }\n :host tbody td.disabled {\n background: var(--gds-sys-color-base-200);\n border: solid 1px var(--gds-sys-color-background-primary);\n border-radius: 4px;\n color: var(--gds-sys-color-text-disabled);\n cursor: not-allowed;\n font-weight: 400;\n }\n :host tbody td.disabled.sg-date-holiday {\n color: var(--gds-sys-color-text-error);\n }\n :host tbody td.disabled .number,\n :host tbody td.disabled .indicator-dot {\n --_color: var(--gds-sys-color-text-disabled) !important;\n }\n :host tbody td.custom-date {\n position: relative;\n }\n :host tbody .number {\n color: var(--_color, \"currentColor\");\n }\n :host tbody .indicator-dot {\n display: block;\n width: 0.375rem;\n height: 0.375rem;\n top: 1.5rem;\n border-radius: 50%;\n margin: auto;\n position: absolute;\n inset-block-end: 0.125rem;\n inset-inline: 0;\n background-color: var(--_color);\n }\n :host table {\n flex-grow: 1;\n width: 100%;\n }\n :host table td {\n width: 3rem;\n height: 3rem;\n }\n }\n @layer _modifiers {\n .week-number {\n border-right: solid 1px var(--gds-sys-color-base-300);\n font-weight: 400;\n pointer-events: none;\n }\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -43,6 +43,14 @@ export declare class GdsContextMenu extends GdsContextMenu_base {
|
|
|
43
43
|
* The placement of the popover relative to the trigger.
|
|
44
44
|
*/
|
|
45
45
|
placement: Placement;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the context menu popover is nonmodal. When true, the popover will not trap focus,
|
|
48
|
+
* and other elements on the page (including other context menu triggers) will still be
|
|
49
|
+
* interactable while the menu is open. Enable this when rendering multiple `gds-context-menu`
|
|
50
|
+
* instances in the same view, so that clicking one trigger while another menu is open closes
|
|
51
|
+
* the first and opens the second in a single click.
|
|
52
|
+
*/
|
|
53
|
+
nonmodal: boolean;
|
|
46
54
|
private _elTriggerSlot;
|
|
47
55
|
connectedCallback(): void;
|
|
48
56
|
render(): any;
|
|
@@ -45,6 +45,7 @@ let GdsContextMenu = class extends withMarginProps(
|
|
|
45
45
|
this.label = "";
|
|
46
46
|
this.maxHeight = 500;
|
|
47
47
|
this.placement = "bottom-start";
|
|
48
|
+
this.nonmodal = false;
|
|
48
49
|
__privateAdd(this, _elTriggerBtn, void 0);
|
|
49
50
|
__privateAdd(this, _setupButton, () => {
|
|
50
51
|
if (!__privateGet(this, _elTriggerBtn))
|
|
@@ -84,6 +85,7 @@ let GdsContextMenu = class extends withMarginProps(
|
|
|
84
85
|
.placement=${this.placement}
|
|
85
86
|
.popupRole=${"menu"}
|
|
86
87
|
.calcMaxHeight=${__privateGet(this, _calcMaxHeight)}
|
|
88
|
+
.nonmodal=${this.nonmodal}
|
|
87
89
|
@gds-ui-state=${(e) => this.open = e.detail.open}
|
|
88
90
|
>
|
|
89
91
|
<gds-menu
|
|
@@ -172,6 +174,9 @@ __decorateClass([
|
|
|
172
174
|
__decorateClass([
|
|
173
175
|
property()
|
|
174
176
|
], GdsContextMenu.prototype, "placement", 2);
|
|
177
|
+
__decorateClass([
|
|
178
|
+
property({ type: Boolean, reflect: true })
|
|
179
|
+
], GdsContextMenu.prototype, "nonmodal", 2);
|
|
175
180
|
__decorateClass([
|
|
176
181
|
query('slot[name="trigger"]')
|
|
177
182
|
], GdsContextMenu.prototype, "_elTriggerSlot", 2);
|
|
@@ -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@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base, _overrides;\n :host {\n display: inline-block;\n }\n @layer _base {\n button {\n background-color: transparent;\n border: 0;\n cursor: pointer;\n font-family: inherit;\n padding: 0;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-bottom: 0.75rem;\n padding-top: 0.75rem;\n border-radius: 0.25rem;\n border: solid 1px var(--gds-sys-color-base-600);\n font-weight: 500;\n }\n button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n button:focus, button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline);\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n button {\n min-height: 2.75rem;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n button {\n min-width: 100%;\n }\n }\n @media screen and (-ms-high-contrast: active) {\n button {\n border: 2px solid currentcolor;\n }\n }\n button.small {\n min-height: 2rem;\n height: 2rem;\n padding: 0.4375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n }\n button.large {\n min-height: 4rem;\n padding: 1rem 1.5rem;\n font-size: 1.5rem;\n line-height: 2rem;\n }\n button {\n background-color: transparent;\n border: 0.0625rem solid transparent;\n padding: 0.625rem;\n height: 2.75rem;\n width: 2.75rem;\n min-width: auto;\n --color: var(--gds-sys-color-base-800);\n }\n .gds-form-group button {\n margin-top: -0.625rem;\n }\n button.small {\n height: 2rem;\n width: 2rem;\n padding: 0.4375rem;\n line-height: 1.125rem;\n }\n button svg {\n height: 1rem;\n width: 1rem;\n }\n button path,\n button line,\n button circle,\n button rect,\n button ellipse,\n button polyline,\n button text {\n fill: var(--gds-sys-color-base-800);\n stroke: var(--gds-sys-color-base-800);\n transition: all var(--gds-sys-transition);\n }\n button:hover, button.highlighted {\n background-color: rgba(0, 0, 0, 0.1);\n border-color: transparent;\n }\n button:active, button.highlighted:hover {\n background-color: rgba(0, 0, 0, 0.2);\n border-color: transparent;\n }\n }\n @layer _overrides {\n button {\n border-color: transparent;\n color: var(--gds-sys-color-base-800);\n display: flex;\n gap: 0.5rem;\n line-height: 0.75;\n padding-inline: 0.4375rem;\n width: auto;\n }\n button.highlighted {\n background-color: var(--gds-sys-color-base-300);\n }\n }\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@layer base, reset, transitional-styles;\n@layer transitional-styles {\n @layer _base, _overrides;\n :host {\n display: inline-block;\n }\n @layer _base {\n button {\n background-color: transparent;\n border: 0;\n cursor: pointer;\n font-family: inherit;\n padding: 0;\n padding-left: 1rem;\n padding-right: 1rem;\n padding-bottom: 0.75rem;\n padding-top: 0.75rem;\n border-radius: 0.25rem;\n border: solid 1px var(--gds-sys-color-base-600);\n font-weight: 500;\n }\n button:focus:not(:focus-visible) {\n box-shadow: none;\n outline: 0;\n }\n button:focus, button:focus-visible {\n outline-color: var(--gds-sys-color-focus-outline, var(--gds-sys-color-base-900));\n outline-style: solid;\n outline-width: 0.125rem;\n outline-offset: 0.125rem;\n }\n button {\n min-height: 2.75rem;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n }\n @media (max-width: 35.98em) {\n button {\n min-width: 100%;\n }\n }\n @media screen and (-ms-high-contrast: active) {\n button {\n border: 2px solid currentcolor;\n }\n }\n button.small {\n min-height: 2rem;\n height: 2rem;\n padding: 0.4375rem 0.75rem;\n font-size: 0.875rem;\n line-height: 1rem;\n }\n button.large {\n min-height: 4rem;\n padding: 1rem 1.5rem;\n font-size: 1.5rem;\n line-height: 2rem;\n }\n button {\n background-color: transparent;\n border: 0.0625rem solid transparent;\n padding: 0.625rem;\n height: 2.75rem;\n width: 2.75rem;\n min-width: auto;\n --color: var(--gds-sys-color-base-800);\n }\n .gds-form-group button {\n margin-top: -0.625rem;\n }\n button.small {\n height: 2rem;\n width: 2rem;\n padding: 0.4375rem;\n line-height: 1.125rem;\n }\n button svg {\n height: 1rem;\n width: 1rem;\n }\n button path,\n button line,\n button circle,\n button rect,\n button ellipse,\n button polyline,\n button text {\n fill: var(--gds-sys-color-base-800);\n stroke: var(--gds-sys-color-base-800);\n transition: all var(--gds-sys-transition);\n }\n button:hover, button.highlighted {\n background-color: rgba(0, 0, 0, 0.1);\n border-color: transparent;\n }\n button:active, button.highlighted:hover {\n background-color: rgba(0, 0, 0, 0.2);\n border-color: transparent;\n }\n }\n @layer _overrides {\n button {\n border-color: transparent;\n color: var(--gds-sys-color-base-800);\n display: flex;\n gap: 0.5rem;\n line-height: 0.75;\n padding-inline: 0.4375rem;\n width: auto;\n }\n button.highlighted {\n background-color: var(--gds-sys-color-base-300);\n }\n }\n}";
|
|
2
2
|
export default styles;
|
|
@@ -121,6 +121,7 @@ declare class Datepicker extends GdsFormControlElement<Date> {
|
|
|
121
121
|
private _focusedYear;
|
|
122
122
|
private _dateFormatLayout;
|
|
123
123
|
private _outOfRangeAction?;
|
|
124
|
+
private _currentLocale;
|
|
124
125
|
private _elCalendar;
|
|
125
126
|
private _elTrigger;
|
|
126
127
|
private _elFieldAsync;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
|
-
var _utcHours, _valueOnOpen, _shouldShowFooter, shouldShowFooter_fn, _renderBackToValidRangeButton, renderBackToValidRangeButton_fn, _updateOutOfRangeAction, updateOutOfRangeAction_fn, _normalizeDate, normalizeDate_fn, _focusDate, focusDate_fn, _shouldShowTodayButton, shouldShowTodayButton_fn, _getSpinnerLabel, getSpinnerLabel_fn, _getMinSpinnerValue, getMinSpinnerValue_fn, _getMaxSpinnerValue, getMaxSpinnerValue_fn, _dispatchChangeEvent, dispatchChangeEvent_fn, _dispatchInputEvent, dispatchInputEvent_fn, _handleSpinnerFocus, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, _handlePopoverStateChange, _handleSpinnerKeydown, _parseDateFormat, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, _years, years_get, _isValueOutsideRange, isValueOutsideRange_get;
|
|
8
|
+
var _utcHours, _valueOnOpen, _shouldShowFooter, shouldShowFooter_fn, _renderBackToValidRangeButton, renderBackToValidRangeButton_fn, _updateOutOfRangeAction, updateOutOfRangeAction_fn, _normalizeDate, normalizeDate_fn, _focusDate, focusDate_fn, _shouldShowTodayButton, shouldShowTodayButton_fn, _getSpinnerLabel, getSpinnerLabel_fn, _getMinSpinnerValue, getMinSpinnerValue_fn, _getMaxSpinnerValue, getMaxSpinnerValue_fn, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn, _getSpinnerValue, getSpinnerValue_fn, _dispatchChangeEvent, dispatchChangeEvent_fn, _dispatchInputEvent, dispatchInputEvent_fn, _handleSpinnerFocus, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, _handlePopoverStateChange, _handleSpinnerKeydown, _parseDateFormat, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, _years, years_get, _isValueOutsideRange, isValueOutsideRange_get;
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
10
|
import { nothing } from "lit";
|
|
11
11
|
import { property, query, queryAll, queryAsync, state } from "lit/decorators.js";
|
|
@@ -57,6 +57,8 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
57
57
|
__privateAdd(this, _getSpinnerLabel);
|
|
58
58
|
__privateAdd(this, _getMinSpinnerValue);
|
|
59
59
|
__privateAdd(this, _getMaxSpinnerValue);
|
|
60
|
+
__privateAdd(this, _getLocalizedPlaceholder);
|
|
61
|
+
__privateAdd(this, _getSpinnerValue);
|
|
60
62
|
__privateAdd(this, _dispatchChangeEvent);
|
|
61
63
|
__privateAdd(this, _dispatchInputEvent);
|
|
62
64
|
/**
|
|
@@ -84,6 +86,7 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
84
86
|
this._focusedMonth = (/* @__PURE__ */ new Date()).getMonth();
|
|
85
87
|
this._focusedYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
86
88
|
this._dateFormatLayout = __privateMethod(this, _parseDateFormat, parseDateFormat_fn).call(this, "y-m-d");
|
|
89
|
+
this._currentLocale = navigator.language;
|
|
87
90
|
__privateAdd(this, _valueOnOpen, void 0);
|
|
88
91
|
__privateAdd(this, _handleSpinnerFocus, (e) => {
|
|
89
92
|
this._elTrigger.then((field) => {
|
|
@@ -292,6 +295,19 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
292
295
|
connectedCallback() {
|
|
293
296
|
super.connectedCallback();
|
|
294
297
|
TransitionalStyles.instance.apply(this, "gds-datepicker");
|
|
298
|
+
window.addEventListener("lit-localize-status", (e) => {
|
|
299
|
+
if (e.detail.status === "ready") {
|
|
300
|
+
this._currentLocale = e.detail.readyLocale;
|
|
301
|
+
if (!this.value) {
|
|
302
|
+
__privateSet(this, _spinnerState, {
|
|
303
|
+
year: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "year"),
|
|
304
|
+
month: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "month"),
|
|
305
|
+
day: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "day")
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
this.requestUpdate();
|
|
309
|
+
}
|
|
310
|
+
});
|
|
295
311
|
}
|
|
296
312
|
focus(options) {
|
|
297
313
|
this._getValidityAnchor()?.focus(options);
|
|
@@ -342,7 +358,7 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
342
358
|
aria-invalid="${this.invalid}"
|
|
343
359
|
class="spinner"
|
|
344
360
|
.length=${f.token === "y" ? 4 : 2}
|
|
345
|
-
.value=${
|
|
361
|
+
.value=${__privateMethod(this, _getSpinnerValue, getSpinnerValue_fn).call(this, f.name)}
|
|
346
362
|
aria-valuemin=${__privateMethod(this, _getMinSpinnerValue, getMinSpinnerValue_fn).call(this, f.name)}
|
|
347
363
|
aria-valuemax=${__privateMethod(this, _getMaxSpinnerValue, getMaxSpinnerValue_fn).call(this, f.name)}
|
|
348
364
|
aria-label=${__privateMethod(this, _getSpinnerLabel, getSpinnerLabel_fn).call(this, f.name)}
|
|
@@ -558,9 +574,9 @@ let Datepicker = class extends GdsFormControlElement {
|
|
|
558
574
|
this.value = void 0;
|
|
559
575
|
if (!this.value) {
|
|
560
576
|
__privateSet(this, _spinnerState, {
|
|
561
|
-
year: "
|
|
562
|
-
month: "
|
|
563
|
-
day: "
|
|
577
|
+
year: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "year"),
|
|
578
|
+
month: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "month"),
|
|
579
|
+
day: __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, "day")
|
|
564
580
|
});
|
|
565
581
|
return;
|
|
566
582
|
}
|
|
@@ -665,6 +681,22 @@ getMaxSpinnerValue_fn = function(name) {
|
|
|
665
681
|
};
|
|
666
682
|
return max[name];
|
|
667
683
|
};
|
|
684
|
+
_getLocalizedPlaceholder = new WeakSet();
|
|
685
|
+
getLocalizedPlaceholder_fn = function(name) {
|
|
686
|
+
const placeholders = {
|
|
687
|
+
year: msg("yyyy"),
|
|
688
|
+
month: msg("mm"),
|
|
689
|
+
day: msg("dd")
|
|
690
|
+
};
|
|
691
|
+
return placeholders[name];
|
|
692
|
+
};
|
|
693
|
+
_getSpinnerValue = new WeakSet();
|
|
694
|
+
getSpinnerValue_fn = function(name) {
|
|
695
|
+
if (!this.value) {
|
|
696
|
+
return __privateMethod(this, _getLocalizedPlaceholder, getLocalizedPlaceholder_fn).call(this, name);
|
|
697
|
+
}
|
|
698
|
+
return __privateGet(this, _spinnerState)[name];
|
|
699
|
+
};
|
|
668
700
|
_dispatchChangeEvent = new WeakSet();
|
|
669
701
|
dispatchChangeEvent_fn = function() {
|
|
670
702
|
this.updateComplete.then(
|
|
@@ -811,6 +843,9 @@ __decorateClass([
|
|
|
811
843
|
__decorateClass([
|
|
812
844
|
state()
|
|
813
845
|
], Datepicker.prototype, "_outOfRangeAction", 2);
|
|
846
|
+
__decorateClass([
|
|
847
|
+
state()
|
|
848
|
+
], Datepicker.prototype, "_currentLocale", 2);
|
|
814
849
|
__decorateClass([
|
|
815
850
|
queryAsync("#calendar")
|
|
816
851
|
], Datepicker.prototype, "_elCalendar", 2);
|
|
@@ -5,7 +5,7 @@ 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, _handleOptionSelect, _toggleOptionValue, toggleOptionValue_fn, _syncOptionSelection, syncOptionSelection_fn, _focusListbox, _isCommitting, _commitSelection, commitSelection_fn, _registerAutoCloseListener, registerAutoCloseListener_fn, _unregisterAutoCloseListener, unregisterAutoCloseListener_fn, _blurCloseListener, _tabCloseListener;
|
|
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, _isPointerPressedInListbox, _handleListboxPointerDown, _handleListboxFocus, _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
11
|
import { property, query } from "lit/decorators.js";
|
|
@@ -258,6 +258,25 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
258
258
|
(items.find((o) => o.selected) || items[0])?.focus();
|
|
259
259
|
});
|
|
260
260
|
});
|
|
261
|
+
__privateAdd(this, _isPointerPressedInListbox, false);
|
|
262
|
+
__privateAdd(this, _handleListboxPointerDown, () => {
|
|
263
|
+
__privateSet(this, _isPointerPressedInListbox, true);
|
|
264
|
+
window.addEventListener(
|
|
265
|
+
"pointerup",
|
|
266
|
+
() => __privateSet(this, _isPointerPressedInListbox, false),
|
|
267
|
+
{ once: true }
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
/**
|
|
271
|
+
* A pointer press moves focus to the listbox container when it lands somewhere that is not an
|
|
272
|
+
* option. Handing that focus on to the selected option would scroll the list out from under the
|
|
273
|
+
* pointer, so the redirect is limited to programmatic focus.
|
|
274
|
+
*/
|
|
275
|
+
__privateAdd(this, _handleListboxFocus, () => {
|
|
276
|
+
if (__privateGet(this, _isPointerPressedInListbox))
|
|
277
|
+
return;
|
|
278
|
+
__privateGet(this, _focusListbox).call(this);
|
|
279
|
+
});
|
|
261
280
|
__privateAdd(this, _isCommitting, false);
|
|
262
281
|
/**
|
|
263
282
|
* A listener to close the dropdown when any other element is focused.
|
|
@@ -454,7 +473,8 @@ let Dropdown = class extends GdsFormControlElement {
|
|
|
454
473
|
role="listbox"
|
|
455
474
|
aria-multiselectable="${this.multiple}"
|
|
456
475
|
tabindex="-1"
|
|
457
|
-
@focus="${__privateGet(this,
|
|
476
|
+
@focus="${__privateGet(this, _handleListboxFocus)}"
|
|
477
|
+
@pointerdown="${__privateGet(this, _handleListboxPointerDown)}"
|
|
458
478
|
@gds-select="${__privateGet(this, _handleOptionSelect)}"
|
|
459
479
|
@gds-focus="${__privateGet(this, _handleOptionFocusChange)}"
|
|
460
480
|
@keydown=${__privateGet(this, _handleListboxKeyDown)}
|
|
@@ -572,6 +592,9 @@ syncOptionSelection_fn = function() {
|
|
|
572
592
|
});
|
|
573
593
|
};
|
|
574
594
|
_focusListbox = new WeakMap();
|
|
595
|
+
_isPointerPressedInListbox = new WeakMap();
|
|
596
|
+
_handleListboxPointerDown = new WeakMap();
|
|
597
|
+
_handleListboxFocus = new WeakMap();
|
|
575
598
|
_isCommitting = new WeakMap();
|
|
576
599
|
_commitSelection = new WeakSet();
|
|
577
600
|
commitSelection_fn = function(value, options = {}) {
|
|
@@ -44,6 +44,7 @@ let GdsOption = class extends Focusable(GdsElement) {
|
|
|
44
44
|
connectedCallback() {
|
|
45
45
|
super.connectedCallback();
|
|
46
46
|
this.setAttribute("role", "option");
|
|
47
|
+
this.setAttribute("tabindex", "-1");
|
|
47
48
|
this.updateComplete.then(() => {
|
|
48
49
|
if (this.isPlaceholder) {
|
|
49
50
|
this.hidden = true;
|
|
@@ -6,6 +6,10 @@ import { GdsElement } from '../../../gds-element';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class GdsFilterChip<ValueT = any> extends GdsElement {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
static shadowRootOptions: ShadowRootInit;
|
|
9
13
|
/**
|
|
10
14
|
* Whether the chip is selected
|
|
11
15
|
*/
|
|
@@ -46,6 +46,13 @@ let GdsFilterChip = class extends GdsElement {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
GdsFilterChip.styles = [styles];
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
GdsFilterChip.shadowRootOptions = {
|
|
53
|
+
mode: "open",
|
|
54
|
+
delegatesFocus: true
|
|
55
|
+
};
|
|
49
56
|
__decorateClass([
|
|
50
57
|
property({ reflect: true, type: Boolean })
|
|
51
58
|
], GdsFilterChip.prototype, "selected", 2);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.CAV4X6PU.js";
|
|
8
|
-
var _handleChipClick, _collapseThreshold, _collapsedAt, _getChipHeight, getChipHeight_fn, _handleSlotChange, handleSlotChange_fn;
|
|
8
|
+
var _handleKeyDown, _setRovingTabIndex, _handleChipClick, _collapseThreshold, _collapsedAt, _getChipHeight, getChipHeight_fn, _handleSlotChange, handleSlotChange_fn, _initializeRovingTabIndex;
|
|
9
9
|
import { property, query, state } from "lit/decorators.js";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
|
|
@@ -28,6 +28,47 @@ let GdsFilterChips = class extends GdsFormControlElement {
|
|
|
28
28
|
this.label = "";
|
|
29
29
|
this.rowCollapse = false;
|
|
30
30
|
this._collapsed = false;
|
|
31
|
+
__privateAdd(this, _handleKeyDown, (event) => {
|
|
32
|
+
const keys = [
|
|
33
|
+
"ArrowDown",
|
|
34
|
+
"ArrowUp",
|
|
35
|
+
"ArrowLeft",
|
|
36
|
+
"ArrowRight",
|
|
37
|
+
"Home",
|
|
38
|
+
"End"
|
|
39
|
+
];
|
|
40
|
+
if (!keys.includes(event.key))
|
|
41
|
+
return;
|
|
42
|
+
const sourceChip = event.target instanceof GdsFilterChip ? event.target : null;
|
|
43
|
+
if (!sourceChip || !this.chips.includes(sourceChip))
|
|
44
|
+
return;
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
const currentIndex = this.chips.indexOf(sourceChip);
|
|
47
|
+
let nextIndex = currentIndex;
|
|
48
|
+
switch (event.key) {
|
|
49
|
+
case "ArrowDown":
|
|
50
|
+
case "ArrowRight":
|
|
51
|
+
nextIndex = (currentIndex + 1) % this.chips.length;
|
|
52
|
+
break;
|
|
53
|
+
case "ArrowUp":
|
|
54
|
+
case "ArrowLeft":
|
|
55
|
+
nextIndex = (currentIndex - 1 + this.chips.length) % this.chips.length;
|
|
56
|
+
break;
|
|
57
|
+
case "Home":
|
|
58
|
+
nextIndex = 0;
|
|
59
|
+
break;
|
|
60
|
+
case "End":
|
|
61
|
+
nextIndex = this.chips.length - 1;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
__privateGet(this, _setRovingTabIndex).call(this, nextIndex);
|
|
65
|
+
this.chips[nextIndex]?.focus();
|
|
66
|
+
});
|
|
67
|
+
__privateAdd(this, _setRovingTabIndex, (activeIndex) => {
|
|
68
|
+
this.chips.forEach((chip, index) => {
|
|
69
|
+
chip.setAttribute("tabindex", index === activeIndex ? "0" : "-1");
|
|
70
|
+
});
|
|
71
|
+
});
|
|
31
72
|
__privateAdd(this, _handleChipClick, (event) => {
|
|
32
73
|
const clickedChip = this.chips.find(
|
|
33
74
|
(s) => s === event.target || s.contains(event.target)
|
|
@@ -53,6 +94,11 @@ let GdsFilterChips = class extends GdsFormControlElement {
|
|
|
53
94
|
});
|
|
54
95
|
__privateAdd(this, _collapseThreshold, 3);
|
|
55
96
|
__privateAdd(this, _collapsedAt, 0);
|
|
97
|
+
__privateAdd(this, _initializeRovingTabIndex, () => {
|
|
98
|
+
if (this.chips.length === 0)
|
|
99
|
+
return;
|
|
100
|
+
__privateGet(this, _setRovingTabIndex).call(this, 0);
|
|
101
|
+
});
|
|
56
102
|
}
|
|
57
103
|
get value() {
|
|
58
104
|
return this._internalValue;
|
|
@@ -76,11 +122,11 @@ let GdsFilterChips = class extends GdsFormControlElement {
|
|
|
76
122
|
role="listbox"
|
|
77
123
|
aria-label=${this.label}
|
|
78
124
|
aria-multiselectable=${this.multiple}
|
|
125
|
+
@keydown=${__privateGet(this, _handleKeyDown)}
|
|
79
126
|
>
|
|
80
127
|
<slot
|
|
81
128
|
@click=${__privateGet(this, _handleChipClick)}
|
|
82
129
|
@slotchange=${__privateMethod(this, _handleSlotChange, handleSlotChange_fn)}
|
|
83
|
-
role="none"
|
|
84
130
|
></slot>
|
|
85
131
|
</div>`;
|
|
86
132
|
}
|
|
@@ -118,6 +164,8 @@ let GdsFilterChips = class extends GdsFormControlElement {
|
|
|
118
164
|
});
|
|
119
165
|
}
|
|
120
166
|
};
|
|
167
|
+
_handleKeyDown = new WeakMap();
|
|
168
|
+
_setRovingTabIndex = new WeakMap();
|
|
121
169
|
_handleChipClick = new WeakMap();
|
|
122
170
|
_collapseThreshold = new WeakMap();
|
|
123
171
|
_collapsedAt = new WeakMap();
|
|
@@ -142,7 +190,11 @@ handleSlotChange_fn = function() {
|
|
|
142
190
|
} else {
|
|
143
191
|
this._updateSelectedFromValue();
|
|
144
192
|
}
|
|
193
|
+
this.updateComplete.then(() => {
|
|
194
|
+
__privateGet(this, _initializeRovingTabIndex).call(this);
|
|
195
|
+
});
|
|
145
196
|
};
|
|
197
|
+
_initializeRovingTabIndex = new WeakMap();
|
|
146
198
|
GdsFilterChips.styles = [FilterChipsStyles];
|
|
147
199
|
__decorateClass([
|
|
148
200
|
property({ converter: stringArrayConverter })
|
|
@@ -57,11 +57,13 @@ let RadioGroup = class extends GdsFormControlElement {
|
|
|
57
57
|
__privateMethod(this, _initializeFocusable, initializeFocusable_fn).call(this);
|
|
58
58
|
});
|
|
59
59
|
this.addEventListener("invalid", this._syncRadioStates);
|
|
60
|
+
this.addEventListener("gds-validity-state", this._syncRadioStates);
|
|
60
61
|
}
|
|
61
62
|
disconnectedCallback() {
|
|
62
63
|
super.disconnectedCallback();
|
|
63
64
|
this._isConnected = false;
|
|
64
65
|
this.removeEventListener("invalid", this._syncRadioStates);
|
|
66
|
+
this.removeEventListener("gds-validity-state", this._syncRadioStates);
|
|
65
67
|
}
|
|
66
68
|
focus(options) {
|
|
67
69
|
this._getValidityAnchor()?.focus(options);
|