@ukic/web-components 3.25.0 → 3.27.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/OpenInNew.js +5 -0
- package/components/OpenInNew.js.map +1 -0
- package/components/check-icon.js +8 -0
- package/components/check-icon.js.map +1 -0
- package/components/chevron-icon.js +8 -0
- package/components/chevron-icon.js.map +1 -0
- package/components/close-icon.js +10 -0
- package/components/close-icon.js.map +1 -0
- package/components/constants.js +184 -0
- package/components/constants.js.map +1 -0
- package/components/custom-elements.d.ts +2 -0
- package/components/helpers.js +547 -0
- package/components/helpers.js.map +1 -0
- package/components/ic-accordion-group.d.ts +11 -0
- package/components/ic-accordion-group.js +191 -0
- package/components/ic-accordion-group.js.map +1 -0
- package/components/ic-accordion.d.ts +11 -0
- package/components/ic-accordion.js +188 -0
- package/components/ic-accordion.js.map +1 -0
- package/components/ic-action-chip.d.ts +11 -0
- package/components/ic-action-chip.js +164 -0
- package/components/ic-action-chip.js.map +1 -0
- package/components/ic-alert.d.ts +11 -0
- package/components/ic-alert.js +193 -0
- package/components/ic-alert.js.map +1 -0
- package/components/ic-back-to-top.d.ts +11 -0
- package/components/ic-back-to-top.js +216 -0
- package/components/ic-back-to-top.js.map +1 -0
- package/components/ic-badge.d.ts +11 -0
- package/components/ic-badge.js +222 -0
- package/components/ic-badge.js.map +1 -0
- package/components/ic-breadcrumb-group.d.ts +11 -0
- package/components/ic-breadcrumb-group.js +278 -0
- package/components/ic-breadcrumb-group.js.map +1 -0
- package/components/ic-breadcrumb.d.ts +11 -0
- package/components/ic-breadcrumb.js +8 -0
- package/components/ic-breadcrumb.js.map +1 -0
- package/components/ic-breadcrumb2.js +145 -0
- package/components/ic-breadcrumb2.js.map +1 -0
- package/components/ic-button.d.ts +11 -0
- package/components/ic-button.js +8 -0
- package/components/ic-button.js.map +1 -0
- package/components/ic-button2.js +509 -0
- package/components/ic-button2.js.map +1 -0
- package/components/ic-card-horizontal.d.ts +11 -0
- package/components/ic-card-horizontal.js +214 -0
- package/components/ic-card-horizontal.js.map +1 -0
- package/components/ic-card-vertical.d.ts +11 -0
- package/components/ic-card-vertical.js +219 -0
- package/components/ic-card-vertical.js.map +1 -0
- package/components/ic-checkbox-group.d.ts +11 -0
- package/components/ic-checkbox-group.js +198 -0
- package/components/ic-checkbox-group.js.map +1 -0
- package/components/ic-checkbox.d.ts +11 -0
- package/components/ic-checkbox.js +202 -0
- package/components/ic-checkbox.js.map +1 -0
- package/components/ic-chip.d.ts +11 -0
- package/components/ic-chip.js +183 -0
- package/components/ic-chip.js.map +1 -0
- package/components/ic-classification-banner.d.ts +11 -0
- package/components/ic-classification-banner.js +102 -0
- package/components/ic-classification-banner.js.map +1 -0
- package/components/ic-data-list.d.ts +11 -0
- package/components/ic-data-list.js +63 -0
- package/components/ic-data-list.js.map +1 -0
- package/components/ic-data-row.d.ts +11 -0
- package/components/ic-data-row.js +115 -0
- package/components/ic-data-row.js.map +1 -0
- package/components/ic-dialog.d.ts +11 -0
- package/components/ic-dialog.js +366 -0
- package/components/ic-dialog.js.map +1 -0
- package/components/ic-divider.d.ts +11 -0
- package/components/ic-divider.js +8 -0
- package/components/ic-divider.js.map +1 -0
- package/components/ic-divider2.js +148 -0
- package/components/ic-divider2.js.map +1 -0
- package/components/ic-empty-state.d.ts +11 -0
- package/components/ic-empty-state.js +82 -0
- package/components/ic-empty-state.js.map +1 -0
- package/components/ic-footer-link-group.d.ts +11 -0
- package/components/ic-footer-link-group.js +101 -0
- package/components/ic-footer-link-group.js.map +1 -0
- package/components/ic-footer-link.d.ts +11 -0
- package/components/ic-footer-link.js +95 -0
- package/components/ic-footer-link.js.map +1 -0
- package/components/ic-footer.d.ts +11 -0
- package/components/ic-footer.js +156 -0
- package/components/ic-footer.js.map +1 -0
- package/components/ic-hero.d.ts +11 -0
- package/components/ic-hero.js +145 -0
- package/components/ic-hero.js.map +1 -0
- package/components/ic-horizontal-scroll.d.ts +11 -0
- package/components/ic-horizontal-scroll.js +8 -0
- package/components/ic-horizontal-scroll.js.map +1 -0
- package/components/ic-horizontal-scroll2.js +240 -0
- package/components/ic-horizontal-scroll2.js.map +1 -0
- package/components/ic-input-component-container.d.ts +11 -0
- package/components/ic-input-component-container.js +8 -0
- package/components/ic-input-component-container.js.map +1 -0
- package/components/ic-input-component-container2.js +95 -0
- package/components/ic-input-component-container2.js.map +1 -0
- package/components/ic-input-container.d.ts +11 -0
- package/components/ic-input-container.js +8 -0
- package/components/ic-input-container.js.map +1 -0
- package/components/ic-input-container2.js +47 -0
- package/components/ic-input-container2.js.map +1 -0
- package/components/ic-input-label.d.ts +11 -0
- package/components/ic-input-label.js +8 -0
- package/components/ic-input-label.js.map +1 -0
- package/components/ic-input-label2.js +121 -0
- package/components/ic-input-label2.js.map +1 -0
- package/components/ic-input-validation.d.ts +11 -0
- package/components/ic-input-validation.js +8 -0
- package/components/ic-input-validation.js.map +1 -0
- package/components/ic-input-validation2.js +90 -0
- package/components/ic-input-validation2.js.map +1 -0
- package/components/ic-layout-grid-item.d.ts +11 -0
- package/components/ic-layout-grid-item.js +95 -0
- package/components/ic-layout-grid-item.js.map +1 -0
- package/components/ic-layout-grid.d.ts +11 -0
- package/components/ic-layout-grid.js +188 -0
- package/components/ic-layout-grid.js.map +1 -0
- package/components/ic-link.d.ts +11 -0
- package/components/ic-link.js +8 -0
- package/components/ic-link.js.map +1 -0
- package/components/ic-link2.js +135 -0
- package/components/ic-link2.js.map +1 -0
- package/components/ic-loading-indicator.d.ts +11 -0
- package/components/ic-loading-indicator.js +8 -0
- package/components/ic-loading-indicator.js.map +1 -0
- package/components/ic-loading-indicator2.js +278 -0
- package/components/ic-loading-indicator2.js.map +1 -0
- package/components/ic-menu-group.d.ts +11 -0
- package/components/ic-menu-group.js +47 -0
- package/components/ic-menu-group.js.map +1 -0
- package/components/ic-menu-item.d.ts +11 -0
- package/components/ic-menu-item.js +8 -0
- package/components/ic-menu-item.js.map +1 -0
- package/components/ic-menu-item2.js +171 -0
- package/components/ic-menu-item2.js.map +1 -0
- package/components/ic-menu.d.ts +11 -0
- package/components/ic-menu.js +8 -0
- package/components/ic-menu.js.map +1 -0
- package/components/ic-menu2.js +2590 -0
- package/components/ic-menu2.js.map +1 -0
- package/components/ic-navigation-button.d.ts +11 -0
- package/components/ic-navigation-button.js +175 -0
- package/components/ic-navigation-button.js.map +1 -0
- package/components/ic-navigation-group.d.ts +11 -0
- package/components/ic-navigation-group.js +326 -0
- package/components/ic-navigation-group.js.map +1 -0
- package/components/ic-navigation-item.d.ts +11 -0
- package/components/ic-navigation-item.js +294 -0
- package/components/ic-navigation-item.js.map +1 -0
- package/components/ic-navigation-menu.d.ts +11 -0
- package/components/ic-navigation-menu.js +8 -0
- package/components/ic-navigation-menu.js.map +1 -0
- package/components/ic-navigation-menu2.js +188 -0
- package/components/ic-navigation-menu2.js.map +1 -0
- package/components/ic-page-header.d.ts +11 -0
- package/components/ic-page-header.js +196 -0
- package/components/ic-page-header.js.map +1 -0
- package/components/ic-pagination-bar.d.ts +11 -0
- package/components/ic-pagination-bar.js +523 -0
- package/components/ic-pagination-bar.js.map +1 -0
- package/components/ic-pagination-item.d.ts +11 -0
- package/components/ic-pagination-item.js +8 -0
- package/components/ic-pagination-item.js.map +1 -0
- package/components/ic-pagination-item2.js +107 -0
- package/components/ic-pagination-item2.js.map +1 -0
- package/components/ic-pagination.d.ts +11 -0
- package/components/ic-pagination.js +8 -0
- package/components/ic-pagination.js.map +1 -0
- package/components/ic-pagination2.js +379 -0
- package/components/ic-pagination2.js.map +1 -0
- package/components/ic-popover-menu.d.ts +11 -0
- package/components/ic-popover-menu.js +369 -0
- package/components/ic-popover-menu.js.map +1 -0
- package/components/ic-radio-group.d.ts +11 -0
- package/components/ic-radio-group.js +317 -0
- package/components/ic-radio-group.js.map +1 -0
- package/components/ic-radio-option.d.ts +11 -0
- package/components/ic-radio-option.js +211 -0
- package/components/ic-radio-option.js.map +1 -0
- package/components/ic-search-bar.d.ts +11 -0
- package/components/ic-search-bar.js +719 -0
- package/components/ic-search-bar.js.map +1 -0
- package/components/ic-section-container.d.ts +11 -0
- package/components/ic-section-container.js +8 -0
- package/components/ic-section-container.js.map +1 -0
- package/components/ic-section-container2.js +50 -0
- package/components/ic-section-container2.js.map +1 -0
- package/components/ic-select.d.ts +11 -0
- package/components/ic-select.js +8 -0
- package/components/ic-select.js.map +1 -0
- package/components/ic-select2.js +806 -0
- package/components/ic-select2.js.map +1 -0
- package/components/ic-side-navigation.d.ts +11 -0
- package/components/ic-side-navigation.js +568 -0
- package/components/ic-side-navigation.js.map +1 -0
- package/components/ic-skeleton.d.ts +11 -0
- package/components/ic-skeleton.js +81 -0
- package/components/ic-skeleton.js.map +1 -0
- package/components/ic-skip-link.d.ts +11 -0
- package/components/ic-skip-link.js +91 -0
- package/components/ic-skip-link.js.map +1 -0
- package/components/ic-status-tag.d.ts +11 -0
- package/components/ic-status-tag.js +85 -0
- package/components/ic-status-tag.js.map +1 -0
- package/components/ic-step.d.ts +11 -0
- package/components/ic-step.js +200 -0
- package/components/ic-step.js.map +1 -0
- package/components/ic-stepper.d.ts +11 -0
- package/components/ic-stepper.js +340 -0
- package/components/ic-stepper.js.map +1 -0
- package/components/ic-switch.d.ts +11 -0
- package/components/ic-switch.js +164 -0
- package/components/ic-switch.js.map +1 -0
- package/components/ic-tab-context.d.ts +11 -0
- package/components/ic-tab-context.js +275 -0
- package/components/ic-tab-context.js.map +1 -0
- package/components/ic-tab-group.d.ts +11 -0
- package/components/ic-tab-group.js +89 -0
- package/components/ic-tab-group.js.map +1 -0
- package/components/ic-tab-panel.d.ts +11 -0
- package/components/ic-tab-panel.js +63 -0
- package/components/ic-tab-panel.js.map +1 -0
- package/components/ic-tab.d.ts +11 -0
- package/components/ic-tab.js +143 -0
- package/components/ic-tab.js.map +1 -0
- package/components/ic-text-field.d.ts +11 -0
- package/components/ic-text-field.js +8 -0
- package/components/ic-text-field.js.map +1 -0
- package/components/ic-text-field2.js +532 -0
- package/components/ic-text-field2.js.map +1 -0
- package/components/ic-theme.d.ts +11 -0
- package/components/ic-theme.js +105 -0
- package/components/ic-theme.js.map +1 -0
- package/components/ic-toast-region.d.ts +11 -0
- package/components/ic-toast-region.js +76 -0
- package/components/ic-toast-region.js.map +1 -0
- package/components/ic-toast.d.ts +11 -0
- package/components/ic-toast.js +295 -0
- package/components/ic-toast.js.map +1 -0
- package/components/ic-toggle-button-group.d.ts +11 -0
- package/components/ic-toggle-button-group.js +323 -0
- package/components/ic-toggle-button-group.js.map +1 -0
- package/components/ic-toggle-button.d.ts +11 -0
- package/components/ic-toggle-button.js +235 -0
- package/components/ic-toggle-button.js.map +1 -0
- package/components/ic-tooltip.d.ts +11 -0
- package/components/ic-tooltip.js +8 -0
- package/components/ic-tooltip.js.map +1 -0
- package/components/ic-tooltip2.js +2078 -0
- package/components/ic-tooltip2.js.map +1 -0
- package/components/ic-top-navigation.d.ts +11 -0
- package/components/ic-top-navigation.js +320 -0
- package/components/ic-top-navigation.js.map +1 -0
- package/components/ic-typography.d.ts +11 -0
- package/components/ic-typography.js +8 -0
- package/components/ic-typography.js.map +1 -0
- package/components/ic-typography2.js +228 -0
- package/components/ic-typography2.js.map +1 -0
- package/components/index.d.ts +33 -0
- package/components/index.js +4 -0
- package/components/index.js.map +1 -0
- package/components/package.json +9 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js +63 -37
- package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-pagination_3.cjs.entry.js +17 -17
- package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +12 -8
- package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-menu/ic-menu.css +19 -0
- package/dist/collection/components/ic-menu/ic-menu.js +62 -36
- package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
- package/dist/collection/components/ic-menu/ic-menu.types.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.js +17 -17
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select_(single).stories.js +54 -0
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +33 -9
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +26 -0
- package/dist/components/ic-menu2.js +63 -37
- package/dist/components/ic-menu2.js.map +1 -1
- package/dist/components/ic-page-header.js.map +1 -1
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js.map +1 -1
- package/dist/components/ic-select2.js +17 -17
- package/dist/components/ic-select2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +13 -8
- package/dist/components/ic-top-navigation.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-46e5a58b.entry.js → p-12474095.entry.js} +2 -2
- package/dist/core/p-12474095.entry.js.map +1 -0
- package/dist/core/p-98dee727.entry.js.map +1 -1
- package/dist/core/p-d1220d2a.entry.js.map +1 -1
- package/dist/core/p-e0b66371.entry.js +2 -0
- package/dist/core/p-e0b66371.entry.js.map +1 -0
- package/dist/core/{p-171a19bf.entry.js → p-fdc4376e.entry.js} +2 -2
- package/dist/core/p-fdc4376e.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-input-component-container_3.entry.js +63 -37
- package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
- package/dist/esm/ic-pagination_3.entry.js +17 -17
- package/dist/esm/ic-pagination_3.entry.js.map +1 -1
- package/dist/esm/ic-section-container.entry.js.map +1 -1
- package/dist/esm/ic-top-navigation.entry.js +12 -8
- package/dist/esm/ic-top-navigation.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-menu/ic-menu.types.d.ts +1 -0
- package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +4 -1
- package/dist/types/components.d.ts +10 -2
- package/hydrate/index.js +93 -62
- package/hydrate/index.mjs +93 -62
- package/package.json +4 -2
- package/vscode-data.json +5 -1
- package/dist/core/p-171a19bf.entry.js.map +0 -1
- package/dist/core/p-343670b4.entry.js +0 -2
- package/dist/core/p-343670b4.entry.js.map +0 -1
- package/dist/core/p-46e5a58b.entry.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface IcMenuItem extends Components.IcMenuItem, HTMLElement {}
|
|
4
|
+
export const IcMenuItem: {
|
|
5
|
+
prototype: IcMenuItem;
|
|
6
|
+
new (): IcMenuItem;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ic-menu-item.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { m as isPropDefined, r as removeDisabledFalse, o as onComponentRequiredPropUndefined, i as isSlotUsed } from './helpers.js';
|
|
3
|
+
import { c as checkIcon } from './check-icon.js';
|
|
4
|
+
import { c as chevronIcon } from './chevron-icon.js';
|
|
5
|
+
import { d as defineCustomElement$4 } from './ic-button2.js';
|
|
6
|
+
import { d as defineCustomElement$3 } from './ic-loading-indicator2.js';
|
|
7
|
+
import { d as defineCustomElement$2 } from './ic-tooltip2.js';
|
|
8
|
+
import { d as defineCustomElement$1 } from './ic-typography2.js';
|
|
9
|
+
|
|
10
|
+
const icMenuItemCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host ::part(button){color:var(--ic-popover-menu-item-check);--ic-typography-color:var(--ic-popover-menu-item-check);padding:calc(var(--ic-space-xxxs) / 2);display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:0;min-height:2.5rem;height:auto}.focus-border{display:flex;align-items:flex-start;gap:var(--ic-space-xs);border-radius:var(--ic-border-radius);margin:calc(var(--ic-space-xxxs) / 2);padding:var(--ic-space-xxs);border:var(--ic-space-xxxs) dashed transparent;--icon-height:auto}:host(.ic-menu-item-disabled) ::part(button){color:var(--ic-popover-menu-item-check-disabled) !important;--ic-typography-color:var(--ic-popover-menu-item-check-disabled) !important;pointer-events:none}:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host(.ic-menu-item-variant-destructive) ::part(button){color:var(--ic-popover-menu-destructive-item-icon);--ic-typography-color:var(--ic-popover-menu-destructive-item-label)}:host ::part(button):hover{background-color:var(--ic-popover-background-hover)}:host ::part(button):focus-visible,:host ::part(button):focus{color:var(--ic-popover-menu-item-icon-focused);--ic-typography-color:purple;background-color:var(--ic-popover-background-focus);box-shadow:none}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{color:var(--ic-popover-menu-item-icon-disabled) !important;--ic-typography-color:orange !important}:host(.ic-menu-item-variant-destructive) ::part(button):focus-visible,:host(.ic-menu-item-variant-destructive) ::part(button):focus{background-color:var(--ic-popover-destructive-background-focus)}ic-button:focus-within .menu-item-label,ic-button:focus-within .shortcut,ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-focused)}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:var(--ic-popover-menu-border)}:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-label-disabled) !important}:host ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-item-label) !important;--ic-typography-color:var(--ic-popover-menu-item-label) !important}:host(.ic-menu-item-variant-destructive) ::part(button):active{background-color:var(--ic-popover-background-pressed);color:var(--ic-popover-menu-destructive-item-label) !important;--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.menu-item-info{display:flex;flex-direction:column;flex:1;align-items:baseline;white-space:pre-line;text-align:left}.menu-labels{display:flex;align-items:baseline;gap:var(--ic-space-xs)}.menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}.shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut);display:flex;flex:min-content}:host(.ic-menu-item-variant-destructive) .menu-item-label{text-transform:uppercase;font-weight:600;letter-spacing:0.025em}ic-button:active .menu-item-label{--ic-typography-color:var(--ic-popover-menu-item-label)}ic-button:active .menu-item-description{--ic-typography-color:var(--ic-popover-menu-item-description)}ic-button:active .shortcut{--ic-typography-color:var(--ic-popover-menu-item-shortcut)}:host(.ic-menu-item-variant-destructive) ic-button:active .menu-item-label{--ic-typography-color:var(\n --ic-popover-menu-destructive-item-label\n ) !important}.icon,.check-icon,.submenu-icon,.icon ::slotted(svg),.check-icon svg,.submenu-icon svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}.check-icon.hide{visibility:hidden}@media (forced-colors: active){:host ::part(button){border:canvas}:host ::part(button):focus-visible{outline:var(--ic-space-xxxs) solid transparent}.focus-border{border-color:canvas}:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border{border-color:GrayText}:host(.ic-menu-item-disabled) .menu-item-info,:host(.ic-menu-item-disabled) .menu-item-label,:host(.ic-menu-item-disabled) .shortcut,:host(.ic-menu-item-disabled) .menu-item-description,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description{--ic-typography-color:GrayText !important}:host(.ic-menu-item-disabled) ::part(button):focus-visible,:host(.ic-menu-item-disabled) ::part(button):focus{outline-color:GrayText !important}}";
|
|
11
|
+
const IcMenuItemStyle0 = icMenuItemCss;
|
|
12
|
+
|
|
13
|
+
const MenuItem = /*@__PURE__*/ proxyCustomElement(class MenuItem extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.__registerHost();
|
|
17
|
+
this.__attachShadow();
|
|
18
|
+
this.childBlur = createEvent(this, "childBlur", 7);
|
|
19
|
+
this.handleMenuItemClick = createEvent(this, "handleMenuItemClick", 7);
|
|
20
|
+
this.icToggleChecked = createEvent(this, "icToggleChecked", 7);
|
|
21
|
+
this.triggerPopoverMenuInstance = createEvent(this, "triggerPopoverMenuInstance", 7);
|
|
22
|
+
/**
|
|
23
|
+
* If `true`, the menu item will be in a checked state. This is only applicable when variant is set to `toggle`.
|
|
24
|
+
*/
|
|
25
|
+
this.checked = false;
|
|
26
|
+
/**
|
|
27
|
+
* If `true`, the menu item will be in disabled state.
|
|
28
|
+
*/
|
|
29
|
+
this.disabled = false;
|
|
30
|
+
/**
|
|
31
|
+
* The variant of the menu item.
|
|
32
|
+
*/
|
|
33
|
+
this.variant = "default";
|
|
34
|
+
this.handleClick = (e) => {
|
|
35
|
+
if (isPropDefined(this.submenuTriggerFor)) {
|
|
36
|
+
this.triggerPopoverMenuInstance.emit();
|
|
37
|
+
}
|
|
38
|
+
else if (this.variant === "toggle") {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
this.checked = !this.checked;
|
|
41
|
+
this.icToggleChecked.emit({
|
|
42
|
+
checked: this.checked,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
this.handleMenuItemClick.emit(this.el);
|
|
46
|
+
};
|
|
47
|
+
this.getMenuItemAriaLabel = () => {
|
|
48
|
+
let ariaLabel = this.label;
|
|
49
|
+
if (isPropDefined(this.description)) {
|
|
50
|
+
ariaLabel = `${ariaLabel}, ${this.description}`;
|
|
51
|
+
}
|
|
52
|
+
if (isPropDefined(this.keyboardShortcutLabel)) {
|
|
53
|
+
ariaLabel = `${ariaLabel}, ${this.keyboardShortcutLabel}`;
|
|
54
|
+
}
|
|
55
|
+
if (this.variant === "destructive") {
|
|
56
|
+
ariaLabel = `${ariaLabel}, destructive`;
|
|
57
|
+
}
|
|
58
|
+
if (isPropDefined(this.submenuTriggerFor)) {
|
|
59
|
+
ariaLabel = `${ariaLabel}, triggers submenu`;
|
|
60
|
+
}
|
|
61
|
+
if (this.el.classList.contains("ic-popover-submenu-back-button")) {
|
|
62
|
+
ariaLabel = "Go back to parent menu";
|
|
63
|
+
}
|
|
64
|
+
const parentEl = this.el.parentElement;
|
|
65
|
+
if (parentEl &&
|
|
66
|
+
parentEl.tagName === "IC-MENU-GROUP" &&
|
|
67
|
+
parentEl.label) {
|
|
68
|
+
return `${ariaLabel}, ${parentEl.label} menu group`;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return ariaLabel;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
watchDisabledHandler() {
|
|
76
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
77
|
+
}
|
|
78
|
+
componentWillLoad() {
|
|
79
|
+
// This ensures that trigger menu items are always set to the default variant
|
|
80
|
+
if (isPropDefined(this.submenuTriggerFor) && this.variant !== "default") {
|
|
81
|
+
this.variant = "default";
|
|
82
|
+
}
|
|
83
|
+
removeDisabledFalse(this.disabled, this.el);
|
|
84
|
+
}
|
|
85
|
+
componentDidLoad() {
|
|
86
|
+
onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Menu Item");
|
|
87
|
+
}
|
|
88
|
+
handleHostClick(e) {
|
|
89
|
+
if (this.disabled) {
|
|
90
|
+
e.stopImmediatePropagation();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
// A sub-component to layout the menu information correctly in ic-button
|
|
95
|
+
const MenuItemInformation = () => {
|
|
96
|
+
return (h("div", { class: "menu-item-info" }, h("div", { class: "menu-labels" }, h("ic-typography", { class: "menu-item-label" }, this.label), this.keyboardShortcutLabel && (h("ic-typography", { variant: "caption", class: "shortcut" }, this.keyboardShortcutLabel))), this.description && (h("ic-typography", { class: "menu-item-description", variant: "caption" }, this.description))));
|
|
97
|
+
};
|
|
98
|
+
return (h(Host, { class: {
|
|
99
|
+
["ic-menu-item-disabled"]: !!this.disabled,
|
|
100
|
+
[`ic-menu-item-variant-${this.variant}`]: this.variant !== undefined,
|
|
101
|
+
} }, h("ic-button", { fullWidth: true, variant: "tertiary", onClick: this.handleClick, href: isPropDefined(this.href), hreflang: isPropDefined(this.hreflang), target: isPropDefined(this.target), rel: isPropDefined(this.rel), referrerpolicy: this.referrerpolicy, role: this.variant === "toggle" ? "menuitemcheckbox" : "menuitem", "aria-disabled": `${this.disabled}`, "aria-checked": this.variant === "toggle"
|
|
102
|
+
? this.checked
|
|
103
|
+
? "true"
|
|
104
|
+
: "false"
|
|
105
|
+
: undefined, "aria-label": this.getMenuItemAriaLabel(), "aria-haspopup": isPropDefined(this.submenuTriggerFor) ||
|
|
106
|
+
this.el.classList.contains("ic-popover-submenu-back-button")
|
|
107
|
+
? "menu"
|
|
108
|
+
: false }, h("div", { class: "focus-border" }, isSlotUsed(this.el, "icon") && (h("span", { class: "icon" }, h("slot", { name: "icon" }))), h(MenuItemInformation, null), this.variant === "toggle" && (h("span", { class: {
|
|
109
|
+
["check-icon"]: true,
|
|
110
|
+
["hide"]: !this.checked,
|
|
111
|
+
}, "aria-hidden": "true", innerHTML: checkIcon })), isPropDefined(this.submenuTriggerFor) && (h("span", { class: { ["submenu-icon"]: true }, "aria-hidden": "true", innerHTML: chevronIcon }))))));
|
|
112
|
+
}
|
|
113
|
+
static get delegatesFocus() { return true; }
|
|
114
|
+
get el() { return this; }
|
|
115
|
+
static get watchers() { return {
|
|
116
|
+
"disabled": ["watchDisabledHandler"]
|
|
117
|
+
}; }
|
|
118
|
+
static get style() { return IcMenuItemStyle0; }
|
|
119
|
+
}, [17, "ic-menu-item", {
|
|
120
|
+
"checked": [1540],
|
|
121
|
+
"description": [1],
|
|
122
|
+
"disabled": [4],
|
|
123
|
+
"href": [1],
|
|
124
|
+
"hreflang": [1],
|
|
125
|
+
"keyboardShortcutLabel": [1, "keyboard-shortcut-label"],
|
|
126
|
+
"label": [1],
|
|
127
|
+
"referrerpolicy": [1],
|
|
128
|
+
"rel": [1],
|
|
129
|
+
"submenuTriggerFor": [1, "submenu-trigger-for"],
|
|
130
|
+
"target": [1],
|
|
131
|
+
"variant": [1537]
|
|
132
|
+
}, [[2, "click", "handleHostClick"]], {
|
|
133
|
+
"disabled": ["watchDisabledHandler"]
|
|
134
|
+
}]);
|
|
135
|
+
function defineCustomElement() {
|
|
136
|
+
if (typeof customElements === "undefined") {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const components = ["ic-menu-item", "ic-button", "ic-loading-indicator", "ic-tooltip", "ic-typography"];
|
|
140
|
+
components.forEach(tagName => { switch (tagName) {
|
|
141
|
+
case "ic-menu-item":
|
|
142
|
+
if (!customElements.get(tagName)) {
|
|
143
|
+
customElements.define(tagName, MenuItem);
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case "ic-button":
|
|
147
|
+
if (!customElements.get(tagName)) {
|
|
148
|
+
defineCustomElement$4();
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "ic-loading-indicator":
|
|
152
|
+
if (!customElements.get(tagName)) {
|
|
153
|
+
defineCustomElement$3();
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
case "ic-tooltip":
|
|
157
|
+
if (!customElements.get(tagName)) {
|
|
158
|
+
defineCustomElement$2();
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
case "ic-typography":
|
|
162
|
+
if (!customElements.get(tagName)) {
|
|
163
|
+
defineCustomElement$1();
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
} });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { MenuItem as M, defineCustomElement as d };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=ic-menu-item2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ic-menu-item2.js","mappings":"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","names":["Check","Chevron"],"sources":["src/components/ic-menu-item/ic-menu-item.css?tag=ic-menu-item&encapsulation=shadow","src/components/ic-menu-item/ic-menu-item.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host ::part(button) {\n color: var(--ic-popover-menu-item-check);\n\n --ic-typography-color: var(--ic-popover-menu-item-check);\n\n padding: calc(var(--ic-space-xxxs) / 2);\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: 0;\n min-height: 2.5rem;\n height: auto;\n}\n\n.focus-border {\n display: flex;\n align-items: flex-start;\n gap: var(--ic-space-xs);\n border-radius: var(--ic-border-radius);\n margin: calc(var(--ic-space-xxxs) / 2);\n padding: var(--ic-space-xxs);\n border: var(--ic-space-xxxs) dashed transparent;\n\n --icon-height: auto;\n}\n\n:host(.ic-menu-item-disabled) ::part(button) {\n color: var(--ic-popover-menu-item-check-disabled) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-check-disabled) !important;\n\n pointer-events: none;\n}\n\n:host(.ic-menu-item-disabled) .menu-item-label,\n:host(.ic-menu-item-disabled) .shortcut,\n:host(.ic-menu-item-disabled) .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host(.ic-menu-item-variant-destructive) ::part(button) {\n color: var(--ic-popover-menu-destructive-item-icon);\n\n --ic-typography-color: var(--ic-popover-menu-destructive-item-label);\n}\n\n:host ::part(button):hover {\n background-color: var(--ic-popover-background-hover);\n}\n\n:host ::part(button):focus-visible,\n:host ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-focused);\n\n --ic-typography-color: purple;\n\n background-color: var(--ic-popover-background-focus);\n box-shadow: none;\n}\n\n:host(.ic-menu-item-disabled) ::part(button):focus-visible,\n:host(.ic-menu-item-disabled) ::part(button):focus {\n color: var(--ic-popover-menu-item-icon-disabled) !important;\n\n --ic-typography-color: orange !important;\n}\n\n:host(.ic-menu-item-variant-destructive) ::part(button):focus-visible,\n:host(.ic-menu-item-variant-destructive) ::part(button):focus {\n background-color: var(--ic-popover-destructive-background-focus);\n}\n\nic-button:focus-within .menu-item-label,\nic-button:focus-within .shortcut,\nic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-focused);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: var(--ic-popover-menu-border);\n}\n\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n:host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n:host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-label-disabled) !important;\n}\n\n:host ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-item-label) !important;\n\n --ic-typography-color: var(--ic-popover-menu-item-label) !important;\n}\n\n:host(.ic-menu-item-variant-destructive) ::part(button):active {\n background-color: var(--ic-popover-background-pressed);\n color: var(--ic-popover-menu-destructive-item-label) !important;\n\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.menu-item-info {\n display: flex;\n flex-direction: column;\n flex: 1;\n align-items: baseline;\n white-space: pre-line;\n text-align: left;\n}\n\n.menu-labels {\n display: flex;\n align-items: baseline;\n gap: var(--ic-space-xs);\n}\n\n.menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\n.shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n\n display: flex;\n flex: min-content;\n}\n\n:host(.ic-menu-item-variant-destructive) .menu-item-label {\n text-transform: uppercase;\n font-weight: 600;\n letter-spacing: 0.025em;\n}\n\nic-button:active .menu-item-label {\n --ic-typography-color: var(--ic-popover-menu-item-label);\n}\n\nic-button:active .menu-item-description {\n --ic-typography-color: var(--ic-popover-menu-item-description);\n}\n\nic-button:active .shortcut {\n --ic-typography-color: var(--ic-popover-menu-item-shortcut);\n}\n\n:host(.ic-menu-item-variant-destructive) ic-button:active .menu-item-label {\n --ic-typography-color: var(\n --ic-popover-menu-destructive-item-label\n ) !important;\n}\n\n.icon,\n.check-icon,\n.submenu-icon,\n.icon ::slotted(svg),\n.check-icon svg,\n.submenu-icon svg {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n.check-icon.hide {\n visibility: hidden;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n :host ::part(button) {\n border: canvas;\n }\n\n :host ::part(button):focus-visible {\n outline: var(--ic-space-xxxs) solid transparent;\n }\n\n .focus-border {\n border-color: canvas;\n }\n\n :host(.ic-menu-item-disabled) ic-button:focus-within .focus-border {\n border-color: GrayText;\n }\n\n :host(.ic-menu-item-disabled) .menu-item-info,\n :host(.ic-menu-item-disabled) .menu-item-label,\n :host(.ic-menu-item-disabled) .shortcut,\n :host(.ic-menu-item-disabled) .menu-item-description,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-info,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-label,\n :host(.ic-menu-item-disabled) ic-button:focus-within .shortcut,\n :host(.ic-menu-item-disabled) ic-button:focus-within .menu-item-description {\n --ic-typography-color: GrayText !important;\n }\n\n :host(.ic-menu-item-disabled) ::part(button):focus-visible,\n :host(.ic-menu-item-disabled) ::part(button):focus {\n outline-color: GrayText !important;\n }\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n h,\n Event,\n EventEmitter,\n Listen,\n Watch,\n} from \"@stencil/core\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n removeDisabledFalse,\n isPropDefined,\n} from \"../../utils/helpers\";\nimport { IcMenuItemVariants } from \"./ic-menu-item.types\";\nimport Check from \"../../assets/check-icon.svg\";\nimport Chevron from \"../../assets/chevron-icon.svg\";\n\n/**\n * @slot icon - Content will be placed to the left of the menu item label.\n */\n\n@Component({\n tag: \"ic-menu-item\",\n styleUrl: \"ic-menu-item.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class MenuItem {\n @Element() el: HTMLIcMenuItemElement;\n\n /**\n * If `true`, the menu item will be in a checked state. This is only applicable when variant is set to `toggle`.\n */\n @Prop({ mutable: true, reflect: true }) checked?: boolean = false;\n\n /**\n * The description displayed in the menu item, below the label.\n */\n @Prop() description?: string;\n\n /**\n * If `true`, the menu item will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The URL that the link points to. This will render the menu item as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * The label describing the keyboard shortcut for a menu item's action.\n */\n @Prop() keyboardShortcutLabel?: string;\n\n /**\n * The label to display in the menu item.\n */\n @Prop() label!: string;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * This references the popover menu instance that the menu item is a trigger for. If this prop is set, then the variant will always be default.\n */\n @Prop() submenuTriggerFor?: string;\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The variant of the menu item.\n */\n @Prop({ mutable: true, reflect: true }) variant?: IcMenuItemVariants =\n \"default\";\n\n /**\n * @internal Emitted when item loses focus.\n */\n @Event() childBlur: EventEmitter<void>;\n\n /**\n * @internal Emitted when the user clicks a menu item.\n */\n @Event() handleMenuItemClick: EventEmitter<HTMLIcMenuItemElement>;\n\n /**\n * Emitted when the user clicks a menu item that is set to the toggle variant.\n */\n @Event() icToggleChecked: EventEmitter<{\n checked: boolean;\n }>;\n\n /**\n * @internal Emitted when the user clicks a menu item that triggers a popover menu instance.\n */\n @Event() triggerPopoverMenuInstance: EventEmitter<void>;\n\n componentWillLoad(): void {\n // This ensures that trigger menu items are always set to the default variant\n if (isPropDefined(this.submenuTriggerFor) && this.variant !== \"default\") {\n this.variant = \"default\";\n }\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Menu Item\"\n );\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(e: Event): void {\n if (this.disabled) {\n e.stopImmediatePropagation();\n }\n }\n\n private handleClick = (e: Event): void => {\n if (isPropDefined(this.submenuTriggerFor)) {\n this.triggerPopoverMenuInstance.emit();\n } else if (this.variant === \"toggle\") {\n e.preventDefault();\n this.checked = !this.checked;\n this.icToggleChecked.emit({\n checked: this.checked,\n });\n }\n this.handleMenuItemClick.emit(this.el);\n };\n\n private getMenuItemAriaLabel = (): string => {\n let ariaLabel = this.label;\n\n if (isPropDefined(this.description)) {\n ariaLabel = `${ariaLabel}, ${this.description}`;\n }\n\n if (isPropDefined(this.keyboardShortcutLabel)) {\n ariaLabel = `${ariaLabel}, ${this.keyboardShortcutLabel}`;\n }\n\n if (this.variant === \"destructive\") {\n ariaLabel = `${ariaLabel}, destructive`;\n }\n\n if (isPropDefined(this.submenuTriggerFor)) {\n ariaLabel = `${ariaLabel}, triggers submenu`;\n }\n\n if (this.el.classList.contains(\"ic-popover-submenu-back-button\")) {\n ariaLabel = \"Go back to parent menu\";\n }\n const parentEl = this.el.parentElement;\n\n if (\n parentEl &&\n parentEl.tagName === \"IC-MENU-GROUP\" &&\n (parentEl as HTMLIcMenuGroupElement).label\n ) {\n return `${ariaLabel}, ${\n (parentEl as HTMLIcMenuGroupElement).label\n } menu group`;\n } else {\n return ariaLabel;\n }\n };\n\n render() {\n // A sub-component to layout the menu information correctly in ic-button\n const MenuItemInformation = () => {\n return (\n <div class=\"menu-item-info\">\n <div class=\"menu-labels\">\n <ic-typography class=\"menu-item-label\">{this.label}</ic-typography>\n {this.keyboardShortcutLabel && (\n <ic-typography variant=\"caption\" class=\"shortcut\">\n {this.keyboardShortcutLabel}\n </ic-typography>\n )}\n </div>\n {this.description && (\n <ic-typography class=\"menu-item-description\" variant=\"caption\">\n {this.description}\n </ic-typography>\n )}\n </div>\n );\n };\n\n return (\n <Host\n class={{\n [\"ic-menu-item-disabled\"]: !!this.disabled,\n [`ic-menu-item-variant-${this.variant}`]: this.variant !== undefined,\n }}\n >\n <ic-button\n fullWidth\n variant=\"tertiary\"\n onClick={this.handleClick}\n href={isPropDefined(this.href)}\n hreflang={isPropDefined(this.hreflang)}\n target={isPropDefined(this.target)}\n rel={isPropDefined(this.rel)}\n referrerpolicy={this.referrerpolicy}\n role={this.variant === \"toggle\" ? \"menuitemcheckbox\" : \"menuitem\"}\n aria-disabled={`${this.disabled}`}\n aria-checked={\n this.variant === \"toggle\"\n ? this.checked\n ? \"true\"\n : \"false\"\n : undefined\n }\n aria-label={this.getMenuItemAriaLabel()}\n aria-haspopup={\n isPropDefined(this.submenuTriggerFor) ||\n this.el.classList.contains(\"ic-popover-submenu-back-button\")\n ? \"menu\"\n : false\n }\n >\n <div class=\"focus-border\">\n {isSlotUsed(this.el, \"icon\") && (\n <span class=\"icon\">\n <slot name=\"icon\"></slot>\n </span>\n )}\n <MenuItemInformation />\n {this.variant === \"toggle\" && (\n <span\n class={{\n [\"check-icon\"]: true,\n [\"hide\"]: !this.checked,\n }}\n aria-hidden=\"true\"\n innerHTML={Check}\n />\n )}\n {isPropDefined(this.submenuTriggerFor) && (\n <span\n class={{ [\"submenu-icon\"]: true }}\n aria-hidden=\"true\"\n innerHTML={Chevron}\n />\n )}\n </div>\n </ic-button>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../dist/types/components";
|
|
2
|
+
|
|
3
|
+
interface IcMenu extends Components.IcMenu, HTMLElement {}
|
|
4
|
+
export const IcMenu: {
|
|
5
|
+
prototype: IcMenu;
|
|
6
|
+
new (): IcMenu;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"ic-menu.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|