@limetech/lime-elements 37.2.3 → 37.2.4
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/CHANGELOG.md +12 -0
- package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +8 -3
- package/dist/cjs/limel-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +7 -2
- package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-input-field_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-input-field_3.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-split-button.cjs.entry.js +7 -2
- package/dist/cjs/limel-split-button.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
- package/dist/collection/components/button/button.css +3 -4
- package/dist/collection/components/button/button.js +8 -3
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/button-group/button-group.css +1 -1
- package/dist/collection/components/chip-set/chip-set.css +3 -4
- package/dist/collection/components/collapsible-section/collapsible-section.css +0 -4
- package/dist/collection/components/icon-button/icon-button.css +18 -15
- package/dist/collection/components/icon-button/icon-button.js +7 -2
- package/dist/collection/components/icon-button/icon-button.js.map +1 -1
- package/dist/collection/components/input-field/input-field.css +1 -2
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/split-button/split-button.css +0 -4
- package/dist/collection/components/split-button/split-button.js +6 -1
- package/dist/collection/components/split-button/split-button.js.map +1 -1
- package/dist/collection/components/switch/switch.css +2 -5
- package/dist/collection/style/internal/shared_input-select-picker.scss +0 -1
- package/dist/esm/limel-button-group.entry.js +1 -1
- package/dist/esm/limel-button-group.entry.js.map +1 -1
- package/dist/esm/limel-button.entry.js +9 -4
- package/dist/esm/limel-button.entry.js.map +1 -1
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js.map +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
- package/dist/esm/limel-icon-button.entry.js +8 -3
- package/dist/esm/limel-icon-button.entry.js.map +1 -1
- package/dist/esm/limel-input-field_3.entry.js +1 -1
- package/dist/esm/limel-input-field_3.entry.js.map +1 -1
- package/dist/esm/limel-select.entry.js +1 -1
- package/dist/esm/limel-select.entry.js.map +1 -1
- package/dist/esm/limel-split-button.entry.js +7 -2
- package/dist/esm/limel-split-button.entry.js.map +1 -1
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-1291ed2c.entry.js +2 -0
- package/dist/lime-elements/p-1291ed2c.entry.js.map +1 -0
- package/dist/lime-elements/{p-fe2a3b79.entry.js → p-3074ae42.entry.js} +2 -2
- package/dist/lime-elements/{p-fe2a3b79.entry.js.map → p-3074ae42.entry.js.map} +1 -1
- package/dist/lime-elements/{p-e9f78225.entry.js → p-386d1c5a.entry.js} +2 -2
- package/dist/lime-elements/{p-e9f78225.entry.js.map → p-386d1c5a.entry.js.map} +1 -1
- package/dist/lime-elements/p-8be76471.entry.js +2 -0
- package/dist/lime-elements/p-8be76471.entry.js.map +1 -0
- package/dist/lime-elements/{p-a2b7eea7.entry.js → p-9928ba36.entry.js} +2 -2
- package/dist/lime-elements/p-9928ba36.entry.js.map +1 -0
- package/dist/lime-elements/p-af1eb67f.entry.js +2 -0
- package/dist/lime-elements/p-af1eb67f.entry.js.map +1 -0
- package/dist/lime-elements/p-b9922526.entry.js +2 -0
- package/dist/lime-elements/p-b9922526.entry.js.map +1 -0
- package/dist/lime-elements/{p-f4795ad3.entry.js → p-c022dd0d.entry.js} +2 -2
- package/dist/lime-elements/{p-f4795ad3.entry.js.map → p-c022dd0d.entry.js.map} +1 -1
- package/dist/lime-elements/p-d3f9a2f1.entry.js +2 -0
- package/dist/lime-elements/p-d3f9a2f1.entry.js.map +1 -0
- package/dist/lime-elements/style/internal/shared_input-select-picker.scss +0 -1
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/icon-button/icon-button.d.ts +1 -0
- package/dist/types/components/split-button/split-button.d.ts +1 -0
- package/package.json +3 -3
- package/dist/lime-elements/p-11f7f7d9.entry.js +0 -2
- package/dist/lime-elements/p-11f7f7d9.entry.js.map +0 -1
- package/dist/lime-elements/p-178a0b8a.entry.js +0 -2
- package/dist/lime-elements/p-178a0b8a.entry.js.map +0 -1
- package/dist/lime-elements/p-3480e5ff.entry.js +0 -2
- package/dist/lime-elements/p-3480e5ff.entry.js.map +0 -1
- package/dist/lime-elements/p-a2b7eea7.entry.js.map +0 -1
- package/dist/lime-elements/p-d7ef9472.entry.js +0 -2
- package/dist/lime-elements/p-d7ef9472.entry.js.map +0 -1
- package/dist/lime-elements/p-f94723c3.entry.js +0 -2
- package/dist/lime-elements/p-f94723c3.entry.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["now","root","Date","FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","toNumber","isObject","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","this","inputFieldCss","InputField","constructor","hostRef","completionsList","initialize","element","limelInputField","shadowRoot","querySelector","mdcTextField","MDCTextField","mapCompletions","window","addEventListener","layout","passive","setFocus","completions","map","item","text","focus","getContainerClassList","classList","label","isInvalid","disabled","readonly","required","value","hasPrefix","hasSuffix","type","helperText","maxlength","leadingIcon","getTrailingIcon","renderInput","properties","h","Object","assign","pattern","onWheel","handleWheel","onKeyDown","placeholder","renderTextarea","class","_a","getAdditionalProps","props","step","Number","isInteger","minlength","onFocus","isFocused","showCompletions","onBlur","isModified","hasHelperText","hasHelperLine","renderHelperLine","length","helperTextId","maxLength","invalid","renderEmptyValueForReadonly","renderSuffix","suffix","renderPrefix","prefix","getInputElement","checkValidity","elementName","renderLabel","labelClassList","id","labelId","renderLeadingIcon","name","renderTrailingLinkOrButton","html","trailingIcon","hasLink","push","renderLinkIcon","getLink","renderTrailingIcon","showLink","includes","href","getHref","target","getTarget","linkProps","icon","tabindex","role","tabIndex","onKeyPress","handleIconKeyPress","onClick","handleIconClick","renderFormattedNumber","renderValue","formatNumber","Intl","NumberFormat","locale","format","event","isForwardTab","key","TAB","keyCode","TAB_KEY_CODE","altKey","metaKey","shiftKey","isUp","ARROW_UP","ARROW_UP_KEY_CODE","isDown","ARROW_DOWN","ARROW_DOWN_KEY_CODE","list","document","portalId","preventDefault","listElement","handleCompletionChange","stopPropagation","detail","changeEmitter","renderAutocompleteList","dropdownZIndex","getComputedStyle","getPropertyValue","visible","containerId","inheritParentWidth","containerStyle","open","allowClicksElement","style","display","onDismiss","handleCloseMenu","renderListResult","filteredCompletions","filterCompletions","onChange","handleKeyDownInDropdown","items","keyFound","ESCAPE","ENTER","keyCodeFound","ESCAPE_KEY_CODE","ENTER_KEY_CODE","filter","completion","toLowerCase","indexOf","handleChange","data","change","emit","action","isEnter","isSpace","SPACE","SPACE_KEY_CODE","globalConfig","defaultLocale","debounceTimeout","createRandomString","connectedCallback","componentDidLoad","disconnectedCallback","destroy","removeEventListener","componentDidUpdate","valid","render","onInput","valueWatcher","newValue","completionsWatcher","RadioButtonTemplate","checked","htmlFor","ListRenderer","defaultConfig","isOpen","badgeIcons","getIndexForWhichToApplyTabIndex","i","selected","renderListItem","index","rendertext","config","renderVariantListItem","classNames","hasPrimaryComponent","attributes","applyTabIndexToItemAtIndex","renderIcon","getPrimaryComponent","renderText","twoLines","avatarList","renderDivider","renderActionMenu","actions","primaryComponent","isSimpleItem","secondaryText","getIconName","color","getIconColor","iconColor","badge","size","iconSize","classes","openDirection","slot","itemTemplate","CheckboxTemplate","renderVariantListItemContent","hasIcons","some","selectableListTypes","selectable","commandKey","PrimaryComponent","listCss","ACTION_EVENT","listStrings","List","listRenderer","setup","setupList","setupListeners","mdcList","teardown","MDCList","hasTypeahead","unlisten","handleAction","multiple","listen","singleSelection","_b","handleSingleSelect","handleMultiSelect","listItems","isListItem","selectedItem","find","selectedItems","listIndex","triggerIconColorWarning","maxLinesSecondaryText","toFixed","Host","handleType","itemsChanged","selectedIndex","findIndex","initializeListType","console","warn","menuSurfaceCss","MenuSurface","menuElement","host","menuSurface","MDCMenuSurface","setAnchorCorner","Corner","TOP_START","handleDocumentClick","capture","handleKeyDown","handleResize","elementPath","composedPath","isDescendant","clickedInAllowedElement","dismiss","preventClickEventPropagation","stopEvent","once","isEscape","isTab"],"sources":["./node_modules/lodash-es/now.js","./node_modules/lodash-es/debounce.js","./src/components/input-field/input-field.scss?tag=limel-input-field&encapsulation=shadow","./src/components/input-field/input-field.tsx","./src/components/list/radio-button/radio-button.template.tsx","./src/components/list/list-renderer.tsx","./src/components/list/list.scss?tag=limel-list&encapsulation=shadow","./src/components/list/list.tsx","./src/components/menu-surface/menu-surface.scss?tag=limel-menu-surface&encapsulation=shadow","./src/components/menu-surface/menu-surface.tsx"],"sourcesContent":["import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","@use '../../style/internal/z-index';\n@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n\n@use '@material/textfield';\n@use '@material/textfield/icon';\n@use '@material/notched-outline/mdc-notched-outline';\n@use '@material/floating-label';\n@use '@material/floating-label/mdc-floating-label';\n@use '@material/ripple';\n@use '@material/list';\n@use '@material/elevation';\n@use '@material/menu-surface';\n\n/**\n * @prop --textarea-height: Height of the field when type is set to `textarea`\n */\n\n:host {\n position: relative;\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([type='textarea']) {\n height: var(--textarea-height, 100%);\n\n .mdc-text-field.mdc-text-field--textarea {\n height: var(--textarea-height, 100%);\n\n .mdc-text-field__input {\n margin-top: functions.pxToRem(8);\n margin-bottom: 0;\n }\n }\n}\n\n@include mixins.hide-helper-line-when-not-needed(limel-input-field);\n\n@include textfield.core-styles;\n@include icon.icon-core-styles;\n\n@include shared_input-select-picker.outlined-style-overrides;\n@include shared_input-select-picker.readonly-overrides;\n@include shared_input-select-picker.cropped-label-hack;\n@include shared_input-select-picker.disabled-overrides;\n@include shared_input-select-picker.leading-icon;\n@include shared_input-select-picker.trailing-icon;\n@include shared_input-select-picker.floating-label-overrides;\n@include shared_input-select-picker.lime-empty-value-for-readonly;\n@include shared_input-select-picker.lime-looks-like-input-value;\n\n.mdc-text-field--with-trailing-icon {\n .mdc-text-field__icon--trailing {\n margin-right: functions.pxToRem(8);\n }\n}\n\n.lime-text-field--empty {\n .mdc-text-field__icon--trailing {\n @include shared_input-select-picker.looks-disabled;\n box-shadow: none !important;\n }\n}\n\n.mdc-text-field {\n width: 100%;\n\n &:not(.mdc-text-field--disabled) {\n .mdc-text-field__affix,\n .mdc-text-field__icon {\n color: rgb(var(--contrast-900));\n }\n }\n &.mdc-text-field--disabled {\n .mdc-text-field__affix,\n .mdc-text-field__icon {\n color: rgb(var(--contrast-700));\n }\n }\n}\n\n.lime-formatted-input {\n display: none;\n width: calc(100% - #{functions.pxToRem(20)});\n z-index: z-index.$input-field--formatted-value;\n\n pointer-events: none;\n\n :not(.mdc-text-field--focused):not(.mdc-text-field--invalid) & {\n display: block;\n }\n\n + .mdc-text-field__input {\n z-index: z-index.$input-field--input-with-formatted-value;\n }\n}\n\n:not(.mdc-text-field--focused):not(.mdc-text-field--invalid) {\n .mdc-text-field__input[type='number'] {\n color: transparent;\n -webkit-text-fill-color: transparent;\n }\n\n &.lime-text-field--readonly {\n .mdc-text-field__input[type='number'] {\n visibility: hidden;\n // Not having `visibility: hidden;` makes the unformatted\n // value selectable; which is not so nice when users\n // click drag to select content on the screen.\n // The reason to have it only on `readonly` mode is\n // 1. This is the use case where it makes most sense\n // 2. We don't want to repeat the same thing in the\n // accessibility tree, and make it readable for assistive\n // technologies.\n // 3. When not readonly, clicking on the `<input />`\n // element sets the focus and activates the edit mode.\n // So we cannot always have it `hidden` on.\n // which is why we have instead\n // `color: transparent` a few lines before this.\n }\n }\n}\n\n.autocomplete-list-container {\n position: relative;\n}\n\n.autocomplete-list {\n background-color: var(--lime-elevated-surface-background-color);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n max-height: functions.pxToRem(200);\n overflow-y: auto;\n}\n\n.mdc-deprecated-list-item {\n cursor: pointer;\n}\n\ninput.mdc-text-field__input {\n @include shared_input-select-picker.input-field-placeholder;\n\n &::-webkit-search-cancel-button {\n @include mixins.clear-all-button;\n\n -webkit-appearance: none;\n\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n margin: auto;\n\n &:active {\n transform: none; //Makes the \"clear-all button\" work\n }\n .mdc-text-field--label-floating & {\n opacity: 1;\n }\n }\n}\n\n@import './partial-styles/trailing-icon.scss';\n@import './partial-styles/readonly';\n","import { MDCTextField } from '@material/textfield';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { debounce } from 'lodash-es';\nimport {\n ARROW_DOWN,\n ARROW_DOWN_KEY_CODE,\n ARROW_UP,\n ARROW_UP_KEY_CODE,\n ENTER,\n ENTER_KEY_CODE,\n ESCAPE,\n ESCAPE_KEY_CODE,\n SPACE,\n SPACE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\nimport { InputType } from '../input-field/input-field.types';\nimport { ListItem } from '../list/list-item.types';\nimport { getHref, getTarget } from '../../util/link-helper';\nimport { JSXBase } from '@stencil/core/internal';\nimport { createRandomString } from '../../util/random-string';\nimport { LimelListCustomEvent } from 'src/components';\nimport { globalConfig } from '../../global/config';\n\ninterface LinkProperties {\n href: string;\n target?: string;\n}\n\n/**\n * @exampleComponent limel-example-input-field-text\n * @exampleComponent limel-example-input-field-placeholder\n * @exampleComponent limel-example-input-field-text-multiple\n * @exampleComponent limel-example-input-field-number\n * @exampleComponent limel-example-input-field-autocomplete\n * @exampleComponent limel-example-input-field-icon-leading\n * @exampleComponent limel-example-input-field-icon-trailing\n * @exampleComponent limel-example-input-field-icon-both\n * @exampleComponent limel-example-input-field-showlink\n * @exampleComponent limel-example-input-field-error-icon\n * @exampleComponent limel-example-input-field-textarea\n * @exampleComponent limel-example-input-field-suffix\n * @exampleComponent limel-example-input-field-prefix\n * @exampleComponent limel-example-input-field-search\n * @exampleComponent limel-example-input-field-pattern\n * @exampleComponent limel-example-input-field-focus\n */\n@Component({\n tag: 'limel-input-field',\n shadow: true,\n styleUrl: 'input-field.scss',\n})\nexport class InputField {\n /**\n * Set to `true` to disable the field.\n * Use `disabled` to indicate that the field can normally be interacted\n * with, but is currently disabled. This tells the user that if certain\n * requirements are met, the field may become enabled again.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to make the field read-only.\n * Use `readonly` when the field is only there to present the data it holds,\n * and will not become possible for the current user to edit.\n */\n @Prop({ reflect: true })\n public readonly = false;\n\n /**\n * Set to `true` to indicate that the current value of the input field is\n * invalid.\n */\n @Prop({ reflect: true })\n public invalid = false;\n\n /**\n * The input label.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * The placeholder text shown inside the input field, when the field is focused and empty.\n */\n @Prop({ reflect: true })\n public placeholder: string;\n\n /**\n * Optional helper text to display below the input field when it has focus\n */\n @Prop({ reflect: true })\n public helperText: string;\n\n /**\n * A short piece of text to display before the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public prefix: string;\n\n /**\n * A short piece of text to display after the value inside the input field.\n * Displayed for all types except `textarea`.\n */\n @Prop({ reflect: true })\n public suffix: string;\n\n /**\n * Set to `true` to indicate that the field is required.\n */\n @Prop({ reflect: true })\n public required = false;\n\n /**\n * The value of the field.\n */\n @Prop({ reflect: true })\n public value: string;\n\n /**\n * Trailing icon to show to the far right in the field.\n */\n @Prop({ reflect: true })\n public trailingIcon: string;\n\n /**\n * Leading icon to show to the far left in the field.\n */\n @Prop({ reflect: true })\n public leadingIcon: string;\n\n /**\n * Regular expression that the current value of the input field must match.\n * No forward slashes should be specified around the pattern.\n * Only used if type is `text`, `tel`, `email`, `url`, `urlAsText`,\n * `password`, or `search`.\n */\n @Prop({ reflect: true })\n public pattern: string;\n\n /**\n * Type of input.\n *\n * Note** regarding type `url`: `limel-input` uses the native validation\n * built into the browser for many types of input fields. The native\n * validation for `url` is very strict, and does not allow relative urls,\n * nor any other formats that are not a \"fully qualified\" url. To allow\n * such urls, use the type `urlAsText` instead. `urlAsText` works exactly\n * like `text` in all regards, except that it enables use of the `showLink`\n * property.\n */\n @Prop({ reflect: true })\n public type: InputType = 'text';\n\n /**\n * Set to `true` to format the current value of the input field only\n * if the field is of type number.\n * The number format is determined by the current language of the browser.\n */\n @Prop({ reflect: true })\n public formatNumber = true;\n\n /**\n * Incremental values that are valid if the field type is `number`.\n */\n @Prop({ reflect: true })\n public step: number | 'any' = 'any';\n\n /**\n * Maximum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public max: number;\n\n /**\n * Minimum allowed value if input type is `number`.\n */\n @Prop({ reflect: true })\n public min: number;\n\n /**\n * Maximum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public maxlength: number;\n\n /**\n * Minimum length of the value if type is `password`, `search`, `tel`,\n * `text`, `url`, or `urlAsText`.\n */\n @Prop({ reflect: true })\n public minlength: number;\n\n /**\n * list of suggestions `value` can autocomplete to.\n */\n @Prop()\n public completions: string[] = [];\n\n /**\n * For inputs of type `email`, `tel`, `url`, and `urlAsText`, set this to\n * `true` to show a trailing icon with a `mailto:`,`tel:`, or normal link,\n * respectively. The default icon can be overridden using the `trailingIcon`\n * property.\n */\n @Prop({ reflect: true })\n public showLink = false;\n\n /**\n * The locale to use for formatting numbers.\n */\n @Prop({ reflect: true })\n public locale: string = globalConfig.defaultLocale;\n\n /**\n * Emitted when the input value is changed.\n */\n @Event()\n private change: EventEmitter<string>;\n\n /**\n * Emitted when `trailingIcon` or `leadingIcon` is set\n * and the icon is interacted with.\n */\n @Event()\n private action: EventEmitter<void>;\n\n @Element()\n private limelInputField: HTMLLimelInputFieldElement;\n\n @State()\n private isFocused: boolean = false;\n\n @State()\n private isModified: boolean = false;\n\n @State()\n public showCompletions: boolean = false;\n\n private mdcTextField: MDCTextField;\n private completionsList: ListItem[] = [];\n private portalId: string;\n private helperTextId: string;\n private labelId: string;\n\n constructor() {\n const debounceTimeout = 300;\n this.changeEmitter = debounce(this.changeEmitter, debounceTimeout);\n\n this.portalId = createRandomString();\n this.helperTextId = createRandomString();\n this.labelId = createRandomString();\n }\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n public disconnectedCallback() {\n if (this.mdcTextField) {\n this.mdcTextField.destroy();\n }\n\n window.removeEventListener('resize', this.layout);\n this.limelInputField.removeEventListener('focus', this.setFocus);\n }\n\n public componentDidUpdate() {\n if (this.invalid) {\n this.mdcTextField.valid = false;\n }\n }\n\n public render() {\n const properties = this.getAdditionalProps();\n properties['aria-labelledby'] = this.labelId;\n properties.class = 'mdc-text-field__input';\n properties.onInput = this.handleChange;\n properties.onFocus = this.onFocus;\n properties.onBlur = this.onBlur;\n properties.required = this.required;\n properties.readonly = this.readonly;\n properties.disabled = this.disabled || this.readonly;\n\n if (this.hasHelperText()) {\n properties['aria-controls'] = this.helperTextId;\n properties['aria-describedby'] = this.helperTextId;\n }\n\n return [\n <label class={this.getContainerClassList()}>\n <span class=\"mdc-notched-outline\" tabindex=\"-1\">\n <span class=\"mdc-notched-outline__leading\"></span>\n {this.renderLabel()}\n <span class=\"mdc-notched-outline__trailing\"></span>\n </span>\n {this.renderLeadingIcon()}\n {this.renderEmptyValueForReadonly()}\n {this.renderPrefix()}\n {this.renderFormattedNumber()}\n {this.renderInput(properties)}\n {this.renderSuffix()}\n {this.renderTextarea(properties)}\n {this.renderTrailingLinkOrButton()}\n </label>,\n this.renderHelperLine(),\n this.renderAutocompleteList(),\n ];\n }\n\n @Watch('value')\n protected valueWatcher(newValue: string) {\n if (!this.mdcTextField) {\n return;\n }\n\n if (newValue !== this.mdcTextField.value) {\n this.mdcTextField.value = newValue || '';\n }\n }\n\n @Watch('completions')\n protected completionsWatcher() {\n this.mapCompletions();\n }\n\n private initialize = () => {\n const element =\n this.limelInputField.shadowRoot.querySelector('.mdc-text-field');\n if (!element) {\n return;\n }\n\n this.mdcTextField = new MDCTextField(element);\n\n this.mapCompletions();\n\n window.addEventListener('resize', this.layout, { passive: true });\n this.limelInputField.addEventListener('focus', this.setFocus);\n };\n\n private mapCompletions = () => {\n this.completionsList = [...this.completions].map((item) => {\n return { text: item };\n });\n };\n\n private setFocus = () => {\n this.mdcTextField.focus();\n };\n\n private getContainerClassList = () => {\n const classList = {\n 'mdc-text-field': true,\n 'mdc-text-field--no-label': !this.label,\n 'mdc-text-field--outlined': true,\n 'mdc-text-field--invalid': this.isInvalid(),\n 'mdc-text-field--disabled': this.disabled || this.readonly,\n 'lime-text-field--readonly': this.readonly,\n 'mdc-text-field--required': this.required,\n 'lime-text-field--empty': !this.value,\n 'lime-has-prefix': this.hasPrefix(),\n 'lime-has-suffix': this.hasSuffix(),\n };\n\n if (this.type === 'textarea') {\n classList['mdc-text-field--textarea'] = true;\n classList['has-helper-line'] =\n !!this.helperText || !!this.maxlength;\n } else {\n classList['mdc-text-field--with-leading-icon'] = !!this.leadingIcon;\n classList['mdc-text-field--with-trailing-icon'] =\n !!this.getTrailingIcon();\n }\n\n return classList;\n };\n\n private renderInput = (\n properties: JSXBase.InputHTMLAttributes<HTMLInputElement>,\n ) => {\n if (this.type === 'textarea') {\n return;\n }\n\n const type = this.type === 'urlAsText' ? 'text' : this.type;\n\n return (\n <input\n {...properties}\n type={type}\n pattern={this.pattern}\n onWheel={this.handleWheel}\n onKeyDown={this.onKeyDown}\n value={this.value}\n placeholder={this.placeholder}\n />\n );\n };\n\n private renderTextarea = (\n properties: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>,\n ) => {\n if (this.type !== 'textarea') {\n return;\n }\n\n return (\n <span class=\"mdc-text-field__resizer\">\n <textarea {...properties} placeholder={this.placeholder}>\n {this.value}\n </textarea>\n </span>\n );\n };\n\n private layout = () => {\n this.mdcTextField?.layout();\n };\n\n private getAdditionalProps = () => {\n const props: any = {};\n\n if (this.type === 'number') {\n props.step = this.step;\n }\n\n if (this.type === 'number' && Number.isInteger(this.min)) {\n props.min = this.min;\n }\n\n if (this.type === 'number' && Number.isInteger(this.max)) {\n props.max = this.max;\n }\n\n if (this.minlength) {\n props.minlength = this.minlength;\n }\n\n if (this.maxlength) {\n props.maxlength = this.maxlength;\n }\n\n return props;\n };\n\n private onFocus = () => {\n this.isFocused = true;\n this.showCompletions = true;\n };\n\n private onBlur = () => {\n this.isFocused = false;\n this.isModified = true;\n };\n\n private hasHelperText = () => {\n return this.helperText !== null && this.helperText !== undefined;\n };\n\n private hasHelperLine = () => {\n return this.maxlength || this.hasHelperText();\n };\n\n private renderHelperLine = () => {\n const text: string = this.value || '';\n const length = text.length;\n\n if (!this.hasHelperLine()) {\n return;\n }\n\n return (\n <limel-helper-line\n helperTextId={this.helperTextId}\n helperText={this.helperText}\n length={length}\n maxLength={this.maxlength}\n invalid={this.isInvalid()}\n />\n );\n };\n\n private renderEmptyValueForReadonly = () => {\n if (this.readonly && !this.value) {\n return (\n <span class=\"lime-empty-value-for-readonly lime-looks-like-input-value\">\n –\n </span>\n );\n }\n };\n\n private renderSuffix = () => {\n if (!this.hasSuffix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--suffix': true,\n };\n\n return <span class={classList}>{this.suffix}</span>;\n };\n\n private hasSuffix = () => {\n return this.suffix !== null && this.suffix !== undefined;\n };\n\n private renderPrefix = () => {\n if (!this.hasPrefix() || this.type === 'textarea') {\n return;\n }\n\n const classList = {\n 'mdc-text-field__affix': true,\n 'mdc-text-field__affix--prefix': true,\n };\n\n return <span class={classList}>{this.prefix}</span>;\n };\n\n private hasPrefix = () => {\n return this.prefix !== null && this.prefix !== undefined;\n };\n\n private isInvalid = () => {\n if (this.readonly) {\n // A readonly field can never be invalid.\n return false;\n }\n\n if (this.invalid) {\n // `this.invalid` is set by the consumer. If the consumer explicitly\n // told us to consider the field invalid, we consider it invalid\n // regardless of what our internal validation thinks, and regardless\n // of whether the field has been modified.\n return true;\n }\n\n if (!this.isModified) {\n return false;\n }\n\n const element = this.getInputElement();\n\n return !(element && element.checkValidity());\n };\n\n private getInputElement = (): HTMLInputElement | HTMLTextAreaElement => {\n let elementName = 'input';\n if (this.type === 'textarea') {\n elementName = 'textarea';\n }\n\n return this.limelInputField.shadowRoot.querySelector(elementName);\n };\n\n private renderLabel = () => {\n const labelClassList = {\n 'mdc-floating-label': true,\n 'mdc-floating-label--float-above':\n !!this.value || this.isFocused || this.readonly,\n };\n\n if (!this.label) {\n return;\n }\n\n return (\n <span class=\"mdc-notched-outline__notch\">\n <span class={labelClassList} id={this.labelId}>\n {this.label}\n </span>\n </span>\n );\n };\n\n private renderLeadingIcon = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n if (this.leadingIcon) {\n return (\n <i class=\"material-icons mdc-text-field__icon mdc-text-field__icon--leading\">\n <limel-icon name={this.leadingIcon} />\n </i>\n );\n }\n };\n\n private renderTrailingLinkOrButton = () => {\n if (this.type === 'textarea') {\n return;\n }\n\n const html = [];\n\n const trailingIcon = this.getTrailingIcon();\n\n if (!this.isInvalid() && this.hasLink()) {\n html.push(this.renderLinkIcon(this.getLink(), trailingIcon));\n } else if (trailingIcon) {\n html.push(this.renderTrailingIcon(trailingIcon));\n }\n\n return html;\n };\n\n private hasLink = () => {\n return (\n this.showLink &&\n ['email', 'tel', 'url', 'urlAsText'].includes(this.type)\n );\n };\n\n private getLink = () => {\n const props: LinkProperties = { href: '' };\n switch (this.type) {\n case 'email':\n props.href = `mailto:${this.value}`;\n break;\n case 'tel':\n props.href = `tel:${this.value}`;\n break;\n default:\n props.href = getHref(this.value);\n props.target = getTarget(this.value);\n }\n\n return props;\n };\n\n private renderLinkIcon = (linkProps: LinkProperties, icon: string) => {\n // If the trailing icon uses the class `mdc-text-field__icon--trailing`,\n // MDC attaches a click handler to it, which apparently runs\n // `preventDefault()` on the event. For links, we don't want that,\n // so instead of `mdc-text-field__icon--trailing`, we use our own class\n // `lime-trailing-icon-for-link`, which uses all the same styling. /Ads\n return (\n <a\n {...linkProps}\n class=\"material-icons mdc-text-field__icon lime-trailing-icon-for-link\"\n tabindex={this.disabled || !this.value ? '-1' : '0'}\n role=\"button\"\n >\n <limel-icon name={icon} />\n </a>\n );\n };\n\n private renderTrailingIcon = (icon: string) => {\n const props: any = {\n tabIndex: this.isInvalid() ? '-1' : '0',\n };\n if (!this.isInvalid()) {\n props.onKeyPress = this.handleIconKeyPress;\n props.onClick = this.handleIconClick;\n props.role = 'button';\n }\n\n return (\n <i\n class=\"material-icons mdc-text-field__icon mdc-text-field__icon--trailing\"\n {...props}\n >\n <limel-icon name={icon} />\n </i>\n );\n };\n\n private getTrailingIcon = () => {\n if (this.isInvalid()) {\n return 'high_importance';\n }\n\n if (this.trailingIcon) {\n return this.trailingIcon;\n }\n\n if (this.showLink && this.type === 'email') {\n return 'filled_message';\n }\n\n if (this.showLink && this.type === 'tel') {\n return 'phone';\n }\n\n if (\n this.showLink &&\n (this.type === 'url' || this.type === 'urlAsText')\n ) {\n return 'external_link';\n }\n };\n\n private renderFormattedNumber = () => {\n if (this.type !== 'number') {\n return;\n }\n\n let renderValue = this.value;\n if (this.formatNumber && this.value) {\n renderValue = new Intl.NumberFormat(this.locale).format(\n Number(this.value),\n );\n }\n\n return (\n <span class=\"lime-formatted-input lime-looks-like-input-value\">\n {renderValue}\n </span>\n );\n };\n\n /**\n * Key handler for the input field\n * Will change focus to the first/last item in the dropdown list to enable selection with the keyboard\n *\n * @param event - event\n */\n\n private onKeyDown = (event: KeyboardEvent): void => {\n this.showCompletions = true;\n const isForwardTab =\n (event.key === TAB || event.keyCode === TAB_KEY_CODE) &&\n !event.altKey &&\n !event.metaKey &&\n !event.shiftKey;\n const isUp =\n event.key === ARROW_UP || event.keyCode === ARROW_UP_KEY_CODE;\n const isDown =\n event.key === ARROW_DOWN || event.keyCode === ARROW_DOWN_KEY_CODE;\n\n if (event.keyCode === TAB_KEY_CODE && event.shiftKey) {\n this.showCompletions = false;\n }\n\n if (!isForwardTab && !isUp && !isDown) {\n return;\n }\n\n const list = document.querySelector(` #${this.portalId} limel-list`);\n\n if (!list) {\n return;\n }\n\n event.preventDefault();\n if (isForwardTab || isDown) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:first-child',\n );\n listElement.focus();\n\n return;\n }\n\n if (isUp) {\n const listElement: HTMLElement = list.shadowRoot.querySelector(\n '.mdc-deprecated-list-item:last-child',\n );\n listElement.focus();\n }\n };\n\n private handleCompletionChange = (\n event: LimelListCustomEvent<ListItem>,\n ) => {\n event.stopPropagation();\n if (!event.detail) {\n return;\n }\n\n this.showCompletions = false;\n\n /*\n This change event doesn't need to be debounced in itself, but we want\n to make absolutely sure that an earlier change event that *has* been\n debounced doesn't emit after this one. Therefore, we run this through\n the same debounced emitter function. /Ads\n */\n this.changeEmitter(event.detail.text);\n };\n\n private renderAutocompleteList = () => {\n if (this.type === 'textarea' || !this.completions.length) {\n return;\n }\n\n const dropdownZIndex = getComputedStyle(\n this.limelInputField,\n ).getPropertyValue('--dropdown-z-index');\n\n return (\n <limel-portal\n visible={this.showCompletions}\n containerId={this.portalId}\n inheritParentWidth={true}\n containerStyle={{ 'z-index': dropdownZIndex }}\n >\n <limel-menu-surface\n open={this.showCompletions}\n allowClicksElement={this.limelInputField}\n style={{\n '--mdc-menu-min-width': '100%',\n 'max-height': 'inherit',\n display: 'flex',\n }}\n onDismiss={this.handleCloseMenu}\n >\n {this.renderListResult()}\n </limel-menu-surface>\n </limel-portal>\n );\n };\n\n private renderListResult = () => {\n const filteredCompletions: ListItem[] = this.filterCompletions(\n this.value,\n );\n if (!filteredCompletions || filteredCompletions.length === 0) {\n return null;\n }\n\n return (\n <limel-list\n onChange={this.handleCompletionChange}\n onKeyDown={this.handleKeyDownInDropdown}\n type=\"selectable\"\n items={filteredCompletions}\n />\n );\n };\n\n private handleKeyDownInDropdown = (event: KeyboardEvent) => {\n const keyFound = [TAB, ESCAPE, ENTER].includes(event.key);\n const keyCodeFound = [\n TAB_KEY_CODE,\n ESCAPE_KEY_CODE,\n ENTER_KEY_CODE,\n ].includes(event.keyCode);\n if (keyFound || keyCodeFound) {\n this.setFocus();\n }\n };\n\n private handleCloseMenu = () => {\n this.showCompletions = false;\n };\n\n private filterCompletions = (filter: string) => {\n if (!filter) {\n return this.completionsList;\n }\n\n return this.completionsList.filter(\n (completion) =>\n completion.text.toLowerCase().indexOf(filter.toLowerCase()) >\n -1,\n );\n };\n\n private handleChange = (event) => {\n event.stopPropagation();\n let value = event.target.value;\n\n if (this.type === 'number') {\n if (!value && event.data) {\n event.stopPropagation();\n\n return;\n }\n\n if (value) {\n value = Number(value);\n }\n }\n\n this.changeEmitter(value);\n };\n\n private changeEmitter = (value: string) => {\n this.change.emit(value);\n };\n\n private handleIconClick = () => {\n if (!this.isInvalid()) {\n this.action.emit();\n }\n };\n\n private handleIconKeyPress = (event: KeyboardEvent) => {\n const isEnter = event.key === ENTER || event.keyCode === ENTER_KEY_CODE;\n const isSpace = event.key === SPACE || event.keyCode === SPACE_KEY_CODE;\n\n if ((isSpace || isEnter) && !this.isInvalid()) {\n this.action.emit();\n }\n };\n\n private handleWheel = () => {\n // This empty event handler is here to circumvent a bug.\n // In some browsers (Chrome for example), hovering the input with\n // the input focused, and scrolling, will both change the value\n // AND scroll the page. We would prefer to never change the value\n // on scroll, instead always scrolling the page, but since we\n // haven't found a way to do that, this is the next best thing, as\n // it prevents the page from being scrolled, but only in the\n // circumstances when the value is changed by the scrolling.\n // Please test THOROUGHLY if you remove this event handler 😄\n };\n}\n","import { FunctionalComponent, h } from '@stencil/core';\n\ninterface RadioButtonTemplateProps {\n disabled?: boolean;\n id: string;\n checked?: boolean;\n onChange?: (event: Event) => void;\n label?: string;\n}\n\nexport const RadioButtonTemplate: FunctionalComponent<\n RadioButtonTemplateProps\n> = (props) => {\n return (\n <div class=\"mdc-form-field\">\n <div\n class={`\n mdc-radio\n ${props.disabled ? 'mdc-radio--disabled' : ''}\n `}\n >\n <input\n class=\"mdc-radio__native-control\"\n type=\"radio\"\n id={props.id}\n checked={props.checked}\n disabled={props.disabled}\n onChange={props.onChange}\n />\n <div class=\"mdc-radio__background\">\n <div class=\"mdc-radio__outer-circle\" />\n <div class=\"mdc-radio__inner-circle\" />\n </div>\n </div>\n <label\n class={`${props.disabled ? 'disabled' : ''}`}\n htmlFor={props.id}\n >\n {props.label}\n </label>\n </div>\n );\n};\n","import { ListItem, ListSeparator } from '../list/list-item.types';\nimport { MenuItem } from '../menu/menu.types';\nimport { h } from '@stencil/core';\nimport { CheckboxTemplate } from '../checkbox/checkbox.template';\nimport { ListRendererConfig } from './list-renderer-config';\nimport { RadioButtonTemplate } from './radio-button/radio-button.template';\nimport { getIconColor, getIconName } from '../icon/get-icon-props';\n\nexport class ListRenderer {\n private defaultConfig: ListRendererConfig = {\n isOpen: true,\n badgeIcons: false,\n };\n\n private config: ListRendererConfig;\n\n private hasIcons: boolean;\n private twoLines: boolean;\n private avatarList: boolean;\n private commandKey: boolean;\n\n private applyTabIndexToItemAtIndex: number;\n\n public render(\n items: Array<ListItem | ListSeparator>,\n config: ListRendererConfig = {},\n ) {\n items = items || [];\n this.config = { ...this.defaultConfig, ...config };\n\n this.twoLines = items.some((item) => {\n return 'secondaryText' in item && !!item.secondaryText;\n });\n\n this.hasIcons = items.some((item) => {\n return 'icon' in item && !!item.icon;\n });\n\n this.avatarList = this.config.badgeIcons && this.hasIcons;\n const selectableListTypes = ['selectable', 'radio', 'checkbox'];\n\n let role;\n switch (this.config.type) {\n case 'checkbox':\n role = 'group';\n break;\n case 'radio':\n role = 'radiogroup';\n break;\n default:\n role = 'listbox';\n }\n\n this.applyTabIndexToItemAtIndex =\n this.getIndexForWhichToApplyTabIndex(items);\n\n const classNames = {\n 'mdc-deprecated-list': true,\n 'mdc-deprecated-list--two-line': this.twoLines,\n selectable: selectableListTypes.includes(this.config.type),\n 'mdc-deprecated-list--avatar-list': this.avatarList,\n 'list--compact':\n this.twoLines &&\n this.commandKey &&\n ['small', 'x-small'].includes(this.config.iconSize),\n };\n\n return (\n <ul class={classNames} role={role} aria-orientation=\"vertical\">\n {items.map(this.renderListItem)}\n </ul>\n );\n }\n\n /**\n * Determine which ListItem should have the `tab-index` attribute set,\n * and return the index at which that ListItem is located in `items`.\n * Returns `undefined` if no item should have the attribute set.\n * See https://github.com/material-components/material-components-web/tree/e66a43a75fef4f9179e24856649518e15e279a04/packages/mdc-list#accessibility\n *\n * @param items - the items of the list, including any `ListSeparator`:s\n * @returns the index as per the description\n */\n private getIndexForWhichToApplyTabIndex = (\n items: Array<ListItem | ListSeparator>,\n ) => {\n let result;\n for (let i = 0, max = items.length; i < max; i += 1) {\n if ('separator' in items[i]) {\n // Ignore ListSeparator\n } else {\n const item = items[i] as ListItem<any>;\n if (item.selected) {\n result = i;\n break;\n }\n\n if (result === undefined && !item.disabled) {\n result = i;\n // Do NOT break, as any later item with\n // `selected=true` should get the tab-index instead!\n }\n }\n }\n\n return result;\n };\n\n /**\n * Render a single list item\n *\n * @param item - the item to render\n * @param index - the index the item had in the `items` array\n * @returns the list item\n */\n private renderListItem = (\n item: ListItem | ListSeparator,\n index: number,\n ) => {\n if ('separator' in item) {\n return (\n <li class=\"mdc-deprecated-list-divider\" role=\"separator\">\n {this.rendertext(item)}\n <div class=\"limel-list-divider-line\" />\n </li>\n );\n }\n\n if (['radio', 'checkbox'].includes(this.config.type)) {\n return this.renderVariantListItem(this.config, item, index);\n }\n\n const classNames = {\n 'mdc-deprecated-list-item': true,\n 'mdc-deprecated-list-item--disabled': item.disabled,\n 'mdc-deprecated-list-item--selected': item.selected,\n 'has-primary-component': this.hasPrimaryComponent(item),\n };\n\n const attributes: { tabindex?: string } = {};\n if (index === this.applyTabIndexToItemAtIndex) {\n attributes.tabindex = '0';\n }\n\n return (\n <li\n class={classNames}\n aria-disabled={item.disabled ? 'true' : 'false'}\n aria-selected={item.selected ? 'true' : 'false'}\n data-index={index}\n {...attributes}\n >\n {this.renderIcon(this.config, item)}\n {this.getPrimaryComponent(item)}\n {this.renderText(item)}\n {this.twoLines && this.avatarList ? this.renderDivider() : null}\n {this.renderActionMenu(item.actions)}\n </li>\n );\n };\n\n private rendertext = (item: ListSeparator) => {\n if ('text' in item) {\n return <h2 class=\"limel-list-divider-title\">{item.text}</h2>;\n }\n };\n\n private getPrimaryComponent(item: ListItem): Element {\n if (!this.hasPrimaryComponent(item)) {\n return;\n }\n\n const PrimaryComponent = item.primaryComponent.name;\n const props = item.primaryComponent.props;\n\n return <PrimaryComponent {...props} />;\n }\n\n private hasPrimaryComponent = (item: ListItem) => {\n return !!item?.primaryComponent?.name;\n };\n\n /**\n * Render the text of the list item\n *\n * @param item - the list item\n * @returns the text for the list item\n */\n private renderText = (item: ListItem) => {\n if (this.isSimpleItem(item)) {\n return (\n <span class=\"mdc-deprecated-list-item__text\">{item.text}</span>\n );\n }\n\n return (\n <div class=\"mdc-deprecated-list-item__text\">\n <div class=\"mdc-deprecated-list-item__primary-command-text\">\n <div class=\"mdc-deprecated-list-item__primary-text\">\n {item.text}\n </div>\n </div>\n <div class=\"mdc-deprecated-list-item__secondary-text\">\n {item.secondaryText}\n </div>\n </div>\n );\n };\n\n private isSimpleItem = (item: ListItem): boolean => {\n return !('secondaryText' in item);\n };\n\n /**\n * Render an icon for a list item\n *\n * @param config - the config object, passed on from the `renderListItem` function\n * @param item - the list item\n * @returns the icon element\n */\n private renderIcon = (config: ListRendererConfig, item: ListItem) => {\n const style: any = {};\n const name = getIconName(item.icon);\n if (!name) {\n return;\n }\n\n const color = getIconColor(item.icon, item.iconColor);\n\n if (color) {\n if (config.badgeIcons) {\n style['--icon-background-color'] = color;\n } else {\n style.color = color;\n }\n }\n\n return (\n <limel-icon\n badge={config.badgeIcons}\n class=\"mdc-deprecated-list-item__graphic\"\n name={name}\n style={style}\n size={config.iconSize}\n />\n );\n };\n\n private renderDivider = () => {\n const classes = {\n 'mdc-deprecated-list-divider': true,\n 'mdc-deprecated-list-divider--inset': true,\n };\n if (this.config.iconSize) {\n classes[this.config.iconSize] = true;\n }\n\n return <hr class={classes} />;\n };\n\n private renderActionMenu = (actions: Array<MenuItem | ListSeparator>) => {\n if (!actions || actions.length === 0) {\n return;\n }\n\n return (\n <limel-menu\n class=\"mdc-deprecated-list-item__meta\"\n items={actions}\n openDirection=\"left-start\"\n >\n <limel-icon-button\n class=\"action-menu-trigger\"\n slot=\"trigger\"\n icon=\"menu_2\"\n />\n </limel-menu>\n );\n };\n\n private renderVariantListItem = (\n config: ListRendererConfig,\n item: ListItem,\n index: number,\n ) => {\n let itemTemplate;\n if (config.type === 'radio') {\n itemTemplate = (\n <RadioButtonTemplate\n id={`c_${index}`}\n checked={item.selected}\n disabled={item.disabled}\n />\n );\n } else if (config.type === 'checkbox') {\n itemTemplate = (\n <CheckboxTemplate\n id={`c_${index}`}\n checked={item.selected}\n disabled={item.disabled}\n />\n );\n }\n\n const classNames = {\n 'mdc-deprecated-list-item': true,\n 'mdc-deprecated-list-item--disabled': item.disabled,\n 'mdc-deprecated-list-item__text': !item.secondaryText,\n 'has-primary-component': this.hasPrimaryComponent(item),\n };\n\n const attributes: { tabindex?: string } = {};\n if (index === this.applyTabIndexToItemAtIndex) {\n attributes.tabindex = '0';\n }\n\n return (\n <li\n class={classNames}\n role={config.type}\n aria-checked={item.selected ? 'true' : 'false'}\n aria-disabled={item.disabled ? 'true' : 'false'}\n data-index={index}\n {...attributes}\n >\n {this.renderVariantListItemContent(config, item, itemTemplate)}\n </li>\n );\n };\n\n private renderVariantListItemContent = (\n config: ListRendererConfig,\n item: ListItem,\n itemTemplate: any,\n ) => {\n if (this.hasIcons) {\n return [\n item.icon ? this.renderIcon(config, item) : null,\n this.getPrimaryComponent(item),\n this.renderText(item),\n <div class=\"mdc-deprecated-list-item__meta\">\n {itemTemplate}\n </div>,\n ];\n }\n\n return [\n <div class=\"mdc-deprecated-list-item__graphic\">{itemTemplate}</div>,\n this.getPrimaryComponent(item),\n this.renderText(item),\n ];\n };\n}\n","@use '../../style/functions';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n@use '../checkbox/checkbox.scss';\n\n@use '@material/list';\n\n$list-border-radius: 0.375rem; // 6px\n$list--has-interactive-items--mdc-list-item--hover: 1;\n$list-static-actions-list: 1;\n$list-mdc-list-item: 0;\n\n/**\n * @prop --icon-background-color: Color to use for icon background when `badgeIcons=true`.\n * @prop --icon-color: Color to use for icon. Defaults to grey when `badgeIcons=false`. Defaults to white when `badgeIcons=true`.\n * @prop --list-grid-max-width: Maximum width of a list that has `has-grid-layout` class. Defaults to `100%`.\n * @prop --list-grid-item-max-width: Maximum width of items in a list that has `has-grid-layout` class. Defaults to `10rem`.\n * @prop --list-grid-item-min-width: Minimum width of items in a list that has `has-grid-layout` class. Defaults to `7.5rem`.\n * @prop --list-grid-gap: Distance between items in a list that has `has-grid-layout` class. Defaults to `0.75rem`.\n * @prop --list-background-color-of-odd-interactive-items: Background color of odd list items, when `has-striped-rows` class is applied to the component. Defaults to `--contrast-200`.\n * @prop --list-background-color-of-even-interactive-items: Background color of even list items, when `has-striped-rows` class is applied to the component. Defaults to `transparent`.\n * @prop --list-margin: Space around the list. Defaults to `0.25rem`, which visualizes keyboard-focused items in a better way, as it adds some space for the outline effect;\n */\n\n:host(limel-list) {\n display: block;\n isolation: isolate;\n @include checkbox.custom-checkbox-styles;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n@include list.deprecated-core-styles;\n\n.mdc-deprecated-list,\n.mdc-deprecated-list-item__secondary-text {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\n.mdc-deprecated-list {\n --mdc-theme-text-icon-on-background: var(\n --icon-color,\n rgb(var(--contrast-900))\n );\n margin: var(\n --list-margin,\n 0.25rem\n ); // added space to visualize keyboard-focused items\n padding: 0;\n border-radius: $list-border-radius;\n\n .mdc-deprecated-list-divider {\n border-bottom-color: transparent;\n display: flex;\n align-items: center;\n gap: 0.75rem;\n height: auto;\n padding: 0 0.5rem;\n }\n\n .limel-list-divider-line {\n background-color: rgb(var(--contrast-400));\n height: 0.125rem;\n border-radius: 1rem;\n min-width: 1rem;\n flex-grow: 1;\n }\n\n .limel-list-divider-title {\n all: unset;\n @include mixins.truncate-text;\n color: rgb(var(--contrast-900));\n font-size: 0.8125rem; // 13px\n }\n\n .mdc-deprecated-list-item {\n transition: background-color 0.2s ease;\n box-sizing: border-box;\n z-index: $list-mdc-list-item; // in Chrome on Windows, menus flicker when they have a scroll bar and user hovers on them. We may be able to remove this in future versions of Chrome. Kia 2021-May-12\n\n &:not(.mdc-deprecated-list-item--disabled) {\n &:hover {\n background-color: rgb(var(--contrast-300));\n z-index: 1;\n }\n }\n\n &.mdc-deprecated-list-item--disabled {\n cursor: not-allowed;\n\n limel-icon {\n opacity: 0.38; // similar to `mdc-deprecated-list-item__text` when disabled\n }\n }\n\n &:first-child {\n border-top-left-radius: $list-border-radius;\n border-top-right-radius: $list-border-radius;\n }\n &:last-child {\n border-bottom-right-radius: $list-border-radius;\n border-bottom-left-radius: $list-border-radius;\n }\n }\n\n &.selectable\n .mdc-deprecated-list-item:not(.mdc-deprecated-list-item--disabled) {\n cursor: pointer;\n }\n\n .mdc-deprecated-list-item__meta {\n // the action menu on the right side a list item\n line-height: 100%;\n margin-right: -0.5rem;\n }\n\n .mdc-deprecated-list-item__graphic {\n margin-right: functions.pxToRem(8);\n }\n\n &.mdc-deprecated-list--avatar-list {\n position: relative;\n\n limel-icon.mdc-deprecated-list-item__graphic {\n background-color: var(\n --icon-background-color,\n rgb(var(--contrast-900))\n );\n color: var(--icon-color, rgba(var(--color-white), 0.88));\n margin-right: functions.pxToRem(12);\n margin-left: functions.pxToRem(-4);\n }\n\n hr.mdc-deprecated-list-divider {\n position: absolute;\n bottom: 0;\n\n &.mdc-deprecated-list-divider--inset {\n --icon-width: #{functions.pxToRem(40)};\n --icon-right-padding: #{functions.pxToRem(12)};\n --list-right-padding: #{functions.pxToRem(12)};\n right: 0;\n width: calc(\n 100% - var(--icon-width) - var(--icon-right-padding) - var(\n --list-right-padding\n )\n );\n\n &.x-small {\n --icon-width: #{functions.pxToRem(24)};\n }\n\n &.small {\n --icon-width: #{functions.pxToRem(32)};\n }\n\n &.medium {\n --icon-width: #{functions.pxToRem(40)};\n }\n\n &.large {\n --icon-width: #{functions.pxToRem(48)};\n }\n }\n }\n\n .mdc-deprecated-list-item:last-child hr.mdc-deprecated-list-divider {\n display: none;\n }\n }\n\n &.mdc-deprecated-list--two-line {\n .mdc-deprecated-list-item__text {\n padding-top: functions.pxToRem(8);\n padding-bottom: functions.pxToRem(8);\n }\n .mdc-deprecated-list-item__primary-text {\n margin-bottom: functions.pxToRem(4);\n }\n }\n\n .mdc-deprecated-list-item__secondary-text,\n .mdc-deprecated-list-item__primary-text,\n .mdc-deprecated-list-item__command-text {\n margin: 0;\n &:before,\n &:after {\n display: none;\n }\n }\n\n .mdc-deprecated-list-item__command-text {\n color: rgb(var(--contrast-800));\n margin-left: 0.7rem;\n }\n\n .mdc-deprecated-list-item__text {\n align-self: center;\n width: 100%;\n }\n\n .has-primary-component {\n .mdc-deprecated-list-item__text {\n margin-left: 0.5rem;\n }\n }\n .mdc-deprecated-list-item__primary-command-text {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: baseline;\n }\n\n // Tweaks to display the icon correctly in Edge\n limel-icon.mdc-deprecated-list-item__graphic {\n display: block;\n }\n}\n\n.mdc-deprecated-list:not(.mdc-deprecated-list--avatar-list) {\n limel-icon.mdc-deprecated-list-item__graphic {\n // Tweaks to make icon lists align nicely with badge-icon lists.\n &[size='x-small'] {\n margin-right: functions.pxToRem(4);\n }\n &[size='small'] {\n margin-right: functions.pxToRem(8);\n }\n &[size='medium'] {\n margin-right: functions.pxToRem(8);\n }\n &[size='large'] {\n margin-right: functions.pxToRem(12);\n }\n }\n}\n\n.mdc-deprecated-list-item.mdc-deprecated-list-item--selected {\n &:before {\n background-color: var(--mdc-theme-primary);\n opacity: 0.15;\n }\n}\n\n:not(.mdc-deprecated-list--non-interactive) {\n > {\n :not(.mdc-deprecated-list-item--disabled).mdc-deprecated-list-item {\n @include mixins.visualize-keyboard-focus;\n\n &:focus-visible {\n border-radius: $list-border-radius;\n z-index: $list--has-interactive-items--mdc-list-item--hover;\n }\n }\n }\n}\n\n@import '../checkbox/checkbox.scss';\n\n@import './radio-button/radio-button.scss';\n\n@import './partial-styles/custom-styles.scss';\n@import './partial-styles/enable-multiline-text.scss';\n@import './partial-styles/_has-grid-layout.scss';\n@import './partial-styles/_static-actions.scss';\n","import { IconSize } from '../icon/icon.types';\nimport { ListItem, ListSeparator } from './list-item.types';\nimport { ListType } from './list.types';\nimport { MDCList, MDCListActionEvent } from '@material/list';\nimport { strings as listStrings } from '@material/list/constants';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n Watch,\n} from '@stencil/core';\nimport { ListRenderer } from './list-renderer';\nimport { ListRendererConfig } from './list-renderer-config';\n\nconst { ACTION_EVENT } = listStrings;\n\n/**\n * @exampleComponent limel-example-list\n * @exampleComponent limel-example-list-secondary\n * @exampleComponent limel-example-list-separator\n * @exampleComponent limel-example-list-selectable\n * @exampleComponent limel-example-list-icons\n * @exampleComponent limel-example-list-badge-icons\n * @exampleComponent limel-example-list-checkbox\n * @exampleComponent limel-example-list-checkbox-icons\n * @exampleComponent limel-example-list-radio-button\n * @exampleComponent limel-example-list-radio-button-icons\n * @exampleComponent limel-example-list-action\n * @exampleComponent limel-example-list-striped\n * @exampleComponent limel-example-list-badge-icons-with-multiple-lines\n * @exampleComponent limel-example-list-grid\n * @exampleComponent limel-example-list-primary-component\n */\n@Component({\n tag: 'limel-list',\n shadow: true,\n styleUrl: 'list.scss',\n})\nexport class List {\n /**\n * List of items to display\n */\n @Prop()\n public items: Array<ListItem | ListSeparator>;\n\n /**\n * Set to `true` if the list should display larger icons with a background\n */\n @Prop()\n public badgeIcons: boolean;\n\n /**\n * Size of the icons in the list\n */\n @Prop()\n public iconSize: IconSize = 'small';\n\n /**\n * The type of the list, omit to get a regular list. Available types are:\n * `selectable`: regular list with single selection.\n * `radio`: radio button list with single selection.\n * `checkbox`: checkbox list with multiple selection.\n */\n @Prop()\n public type: ListType;\n\n /**\n * By default, lists will display 3 lines of text, and then truncate the rest.\n * Consumers can increase or decrease this number by specifying\n * `maxLinesSecondaryText`. If consumer enters zero or negative\n * numbers we default to 1; and if they type decimals we round up.\n */\n // eslint-disable-next-line no-magic-numbers\n @Prop() maxLinesSecondaryText: number = 3;\n\n @Element()\n private element: HTMLLimelListElement;\n\n private config: ListRendererConfig;\n private listRenderer = new ListRenderer();\n private mdcList: MDCList;\n private multiple: boolean;\n private selectable: boolean;\n\n /**\n * Fired when a new value has been selected from the list.\n * Only fired if `type` is set to `selectable`, `radio` or `checkbox`.\n */\n @Event()\n private change: EventEmitter<ListItem | ListItem[]>;\n\n /**\n * Fired when an action has been selected from the action menu of a list item\n */\n @Event()\n protected select: EventEmitter<ListItem | ListItem[]>;\n\n public connectedCallback() {\n this.setup();\n }\n\n public disconnectedCallback() {\n this.teardown();\n }\n\n public componentDidLoad() {\n this.setup();\n this.triggerIconColorWarning();\n }\n\n public render() {\n this.config = {\n badgeIcons: this.badgeIcons,\n type: this.type,\n iconSize: this.iconSize,\n };\n let maxLinesSecondaryText = +this.maxLinesSecondaryText?.toFixed();\n if (this.maxLinesSecondaryText < 1) {\n maxLinesSecondaryText = 1;\n }\n\n const html = this.listRenderer.render(this.items, this.config);\n\n return (\n <Host\n style={{\n '--maxLinesSecondaryText': `${maxLinesSecondaryText}`,\n }}\n >\n {html}\n </Host>\n );\n }\n\n @Watch('type')\n protected handleType() {\n this.setupListeners();\n }\n\n @Watch('items')\n protected itemsChanged() {\n if (!this.mdcList) {\n return;\n }\n\n setTimeout(() => {\n this.setup();\n\n const listItems = this.items.filter(this.isListItem);\n\n if (this.multiple) {\n this.mdcList.selectedIndex = listItems\n .filter((item: ListItem) => item.selected)\n .map((item: ListItem) => listItems.indexOf(item));\n } else {\n const selectedIndex = listItems.findIndex(\n (item: ListItem) => item.selected,\n );\n\n if (selectedIndex === -1) {\n this.mdcList.initializeListType();\n } else {\n this.mdcList.selectedIndex = selectedIndex;\n }\n }\n }, 0);\n }\n\n private setup = () => {\n this.setupList();\n\n this.setupListeners();\n };\n\n private setupList = () => {\n if (this.mdcList) {\n this.teardown();\n this.mdcList = null;\n }\n\n const element = this.element.shadowRoot.querySelector(\n '.mdc-deprecated-list',\n );\n if (!element) {\n return;\n }\n\n this.mdcList = new MDCList(element);\n this.mdcList.hasTypeahead = true;\n };\n\n private setupListeners = () => {\n if (!this.mdcList) {\n return;\n }\n\n this.mdcList.unlisten(ACTION_EVENT, this.handleAction);\n\n this.selectable = ['selectable', 'radio', 'checkbox'].includes(\n this.type,\n );\n this.multiple = this.type === 'checkbox';\n\n if (!this.selectable) {\n return;\n }\n\n this.mdcList.listen(ACTION_EVENT, this.handleAction);\n this.mdcList.singleSelection = !this.multiple;\n };\n\n private teardown = () => {\n this.mdcList?.unlisten(ACTION_EVENT, this.handleAction);\n this.mdcList?.destroy();\n };\n\n private handleAction = (event: MDCListActionEvent) => {\n if (!this.multiple) {\n this.handleSingleSelect(event.detail.index);\n\n return;\n }\n\n this.handleMultiSelect(event.detail.index);\n };\n\n private handleSingleSelect = (index: number) => {\n const listItems = this.items.filter(this.isListItem) as ListItem[];\n if (listItems[index].disabled) {\n return;\n }\n\n const selectedItem: ListItem = listItems.find((item: ListItem) => {\n return !!item.selected;\n });\n\n if (selectedItem) {\n this.change.emit({ ...selectedItem, selected: false });\n }\n\n if (listItems[index] !== selectedItem) {\n this.change.emit({ ...listItems[index], selected: true });\n }\n };\n\n private handleMultiSelect = (index: number) => {\n const listItems = this.items.filter(this.isListItem) as ListItem[];\n if (listItems[index].disabled) {\n return;\n }\n\n const selectedItems: ListItem[] = listItems\n .filter((item: ListItem, listIndex: number) => {\n if (listIndex === index) {\n // This is the item that was selected or deselected,\n // so we negate its previous selection status.\n return !item.selected;\n }\n\n // This is an item that didn't change, so we keep its selection status.\n return item.selected;\n })\n .map((item: ListItem) => {\n return { ...item, selected: true };\n });\n\n this.change.emit(selectedItems);\n };\n\n private isListItem = (item: ListItem): boolean => {\n return !('separator' in item);\n };\n\n private triggerIconColorWarning() {\n if (this.items.some((item) => 'iconColor' in item)) {\n /* eslint-disable-next-line no-console */\n console.warn(\n \"The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.\",\n );\n }\n }\n}\n","@use '@material/menu-surface';\n@use '@material/elevation';\n@use '@material/menu';\n\n/**\n* @prop --limel-menu-surface-display: defines whether the surface is treated as a block, flex or grid. It affects layout used to display its children. Defaults to `block`.\n* @prop --limel-menu-surface-flex-direction: defines the direction of menu-surface layout.\n*/\n\n:host(limel-menu-surface) {\n display: block;\n max-height: inherit;\n}\n\n@include menu-surface.core-styles;\n@include menu.core-styles;\n\n.mdc-menu-surface {\n display: var(--limel-menu-surface-display, block);\n flex-direction: var(--limel-menu-surface-flex-direction, row);\n max-height: inherit;\n position: relative;\n --mdc-menu-max-width: var(\n --menu-surface-width,\n min(calc(100vw - 2rem), 20rem)\n );\n background-color: var(--lime-elevated-surface-background-color);\n}\n\n:host(limel-menu-surface.has-grid-layout) {\n .mdc-menu-surface {\n width: var(--menu-surface-width, min(calc(100vw - 2rem), 40rem));\n max-width: unset;\n }\n}\n","import { Corner, MDCMenuSurface } from '@material/menu-surface';\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { isDescendant } from '../../util/dom';\nimport {\n ESCAPE,\n ESCAPE_KEY_CODE,\n TAB,\n TAB_KEY_CODE,\n} from '../../util/keycodes';\n\n/**\n * @slot - Content to put inside the surface\n * @private\n */\n@Component({\n tag: 'limel-menu-surface',\n shadow: true,\n styleUrl: 'menu-surface.scss',\n})\nexport class MenuSurface {\n /**\n * True if the menu surface is open, false otherwise\n */\n @Prop()\n public open = false;\n\n /**\n * Clicks in this element should not be prevented when the menu surface is open\n */\n @Prop()\n public allowClicksElement: HTMLElement;\n\n /**\n * Emitted when the menu surface is dismissed and should be closed\n */\n @Event()\n public dismiss: EventEmitter<void>;\n\n @Element()\n private host: HTMLLimelMenuSurfaceElement;\n\n private menuSurface: MDCMenuSurface;\n\n public connectedCallback() {\n this.setup();\n }\n\n public disconnectedCallback() {\n this.teardown();\n }\n\n public componentDidLoad() {\n this.setup();\n }\n\n public render() {\n const classList = {\n 'mdc-menu': true,\n 'mdc-menu-surface': true,\n 'mdc-menu-surface--open': this.open,\n 'mdc-elevation-transition': true,\n 'mdc-elevation--z4': true,\n };\n\n return (\n <div class={classList} tabindex=\"-1\">\n <slot />\n </div>\n );\n }\n\n private setup = () => {\n const menuElement: HTMLElement =\n this.host.shadowRoot.querySelector('.mdc-menu-surface');\n if (!menuElement) {\n return;\n }\n\n this.menuSurface = new MDCMenuSurface(menuElement);\n this.menuSurface.setAnchorCorner(Corner.TOP_START);\n\n document.addEventListener('mousedown', this.handleDocumentClick, {\n capture: true,\n });\n this.host.addEventListener('keydown', this.handleKeyDown);\n window.addEventListener('resize', this.handleResize, {\n passive: true,\n });\n };\n\n private teardown = () => {\n this.menuSurface?.destroy();\n document.removeEventListener('mousedown', this.handleDocumentClick, {\n capture: true,\n });\n this.host.removeEventListener('keydown', this.handleKeyDown);\n window.removeEventListener('resize', this.handleResize);\n };\n\n private handleDocumentClick = (event) => {\n const elementPath = event.composedPath ? event.composedPath() : [];\n\n if (!this.open) {\n return;\n }\n\n if (isDescendant(event.target, this.host)) {\n return;\n }\n\n if (this.allowClicksElement) {\n const clickedInAllowedElement = elementPath.includes(\n this.allowClicksElement,\n );\n\n if (clickedInAllowedElement) {\n return;\n }\n }\n\n this.dismiss.emit();\n this.preventClickEventPropagation();\n };\n\n private handleResize = () => {\n if (this.open) {\n this.dismiss.emit();\n }\n };\n\n private preventClickEventPropagation = () => {\n // When the menu surface is open, we want to stop the `click` event from propagating\n // when clicking outside the surface itself. This is to prevent any dialog that might\n // be open from closing, etc. However, when dragging a scrollbar no `click` event is emitted,\n // only mousedown and mouseup. So we listen for `mousedown` and attach a one-time listener\n // for `click`, so we can capture and \"kill\" it.\n document.addEventListener('click', this.stopEvent, {\n capture: true,\n once: true,\n });\n // We also capture and \"kill\" the next `mouseup` event.\n document.addEventListener('mouseup', this.stopEvent, {\n capture: true,\n once: true,\n });\n // If the user dragged the scrollbar, no `click` event happens. So when we get the\n // `mouseup` event, remove the handler for `click` if it's still there.\n // Otherwise, we would catch the next click even though the menu is no longer open.\n document.addEventListener(\n 'mouseup',\n () => {\n document.removeEventListener('click', this.stopEvent, {\n capture: true,\n });\n },\n {\n once: true,\n },\n );\n };\n\n private stopEvent = (event) => {\n event.stopPropagation();\n event.preventDefault();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const isEscape =\n event.key === ESCAPE || event.keyCode === ESCAPE_KEY_CODE;\n const isTab = event.key === TAB || event.keyCode === TAB_KEY_CODE;\n\n if (this.open && (isEscape || isTab)) {\n event.stopPropagation();\n this.dismiss.emit();\n }\n };\n}\n"],"mappings":"8vBAkBA,IAAIA,EAAM,WACR,OAAOC,EAAKC,KAAKF,KACnB,ECfA,IAAIG,EAAkB,sBAGtB,IAAIC,EAAYC,KAAKC,IACj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0 @@
|
|
|
1
|
-
import{r as e,c as t,h as o,H as r}from"./p-3075aa67.js";const i='@charset "UTF-8";:host(limel-split-button.has-menu){--button-padding-right:2rem}:host(limel-split-button){display:inline-flex;isolation:isolate}:host(limel-split-button) *{box-sizing:border-box}:host([disabled]){pointer-events:none}limel-button{width:100%}limel-menu{display:flex;justify-content:flex-end;position:relative;z-index:1;padding:0.125rem;margin-left:calc(var(--button-padding-right) * -1);width:var(--button-padding-right)}limel-menu:before{transition:background-color 0.5s ease;content:"";position:absolute;inset:0.375rem auto 0.375rem 0.6875rem;width:1px;background-color:currentColor;opacity:0.2}limel-menu:not([disabled]){color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}limel-menu:not([disabled]).primary{color:var(--mdc-theme-on-primary, rgb(var(--color-white)))}limel-menu[disabled]{color:rgba(var(--contrast-1600), 0.37)}limel-menu:hover:before,limel-menu:focus-within:before{background-color:transparent}.menu-trigger{all:unset;text-align:center;font-weight:bold;border-radius:0.125rem;height:100%;width:1rem}.menu-trigger:not(:disabled){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:"inherit";background-color:transparent;cursor:pointer}.menu-trigger:not(:disabled):hover{color:"inherit";background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.menu-trigger:not(:disabled):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.menu-trigger:not(:disabled):focus{outline:none}.menu-trigger:not(:disabled):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.menu-trigger:not(:disabled):focus-visible,.menu-trigger:not(:disabled):hover{background-color:rgb(var(--color-white), 0.1)}.menu-trigger:before{content:"";position:absolute;inset:-0.25rem;z-index:-1}';const n=class{constructor(r){e(this,r);this.select=t(this,"select",7);this.renderMenu=()=>{if(!this.items.length){return}return o("limel-menu",{class:{primary:this.primary},disabled:this.disabled,items:this.items,openDirection:"bottom"},o("button",{class:"menu-trigger",slot:"trigger",disabled:this.disabled},"⋮"))};this.label=undefined;this.primary=false;this.icon=undefined;this.disabled=false;this.items=[]}render(){return o(r,{class:{"has-menu":!!this.items.length}},o("limel-button",{label:this.label,primary:this.primary,icon:this.icon,disabled:this.disabled}),this.renderMenu())}};n.style=i;export{n as limel_split_button};
|
|
2
|
-
//# sourceMappingURL=p-3480e5ff.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["splitButtonCss","SplitButton","this","renderMenu","items","length","h","class","primary","disabled","openDirection","slot","render","Host","label","icon"],"sources":["./src/components/split-button/split-button.scss?tag=limel-split-button&encapsulation=shadow","./src/components/split-button/split-button.tsx"],"sourcesContent":["@import '../../style/mixins';\n\n:host(limel-split-button.has-menu) {\n --button-padding-right: 2rem;\n}\n\n:host(limel-split-button) {\n display: inline-flex;\n isolation: isolate;\n\n * {\n box-sizing: border-box;\n }\n}\n\n:host([disabled]) {\n pointer-events: none;\n}\n\nlimel-button {\n width: 100%;\n}\n\n$distance-around-trigger: 0.125rem;\n\nlimel-menu {\n display: flex;\n justify-content: flex-end;\n position: relative;\n z-index: 1;\n\n padding: $distance-around-trigger;\n margin-left: calc(var(--button-padding-right) * -1);\n width: var(--button-padding-right);\n\n &:before {\n transition: background-color 0.5s ease;\n content: '';\n position: absolute;\n inset: 0.375rem auto 0.375rem 0.6875rem;\n width: 1px;\n background-color: currentColor;\n\n opacity: 0.2;\n }\n\n &:not([disabled]) {\n color: var(\n --mdc-theme-primary,\n rgb(var(--color-teal-default))\n ); // similar to limel-button text\n\n &.primary {\n color: var(\n --mdc-theme-on-primary,\n rgb(var(--color-white))\n ); // similar to limel-button text\n }\n }\n\n &[disabled] {\n color: rgba(var(--contrast-1600), 0.37); // similar to limel-button text\n }\n\n &:hover,\n &:focus-within {\n &:before {\n background-color: transparent;\n }\n }\n}\n\n.menu-trigger {\n all: unset;\n\n text-align: center;\n font-weight: bold;\n\n border-radius: 0.125rem;\n height: 100%;\n width: 1rem;\n\n &:not(:disabled) {\n @include is-flat-clickable(\n $color: 'inherit',\n $color--hovered: 'inherit'\n );\n @include visualize-keyboard-focus();\n cursor: pointer;\n\n &:focus-visible,\n &:hover {\n background-color: rgb(var(--color-white), 0.1);\n }\n }\n\n &:before {\n // prevents unintentionally activating the default action,\n // by clicking on the edge of menu trigger,\n // which would be activating the default onClick action\n // on `limel-button`.\n content: '';\n position: absolute;\n inset: -$distance-around-trigger * 2;\n z-index: -1;\n }\n}\n","import { Component, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { ListSeparator } from '../list/list-item.types';\nimport { MenuItem } from '../menu/menu.types';\n\n/**\n * A split button is a button with two components:\n * a button and a side-menu attached to it.\n *\n * Clicking on the button runs a default action,\n * and clicking on the arrow opens up a list of other possible actions.\n *\n * :::warning\n * - Never use a split button for navigation purposes, such as going to next page.\n * The button should only be used for performing commands!\n * - Never use this component instead of a Select or Menu component!\n * :::\n *\n * @exampleComponent limel-example-split-button-basic\n * @exampleComponent limel-example-split-button-repeat-default-command\n */\n@Component({\n tag: 'limel-split-button',\n styleUrl: 'split-button.scss',\n shadow: true,\n})\nexport class SplitButton {\n /**\n * The text to show on the default action part of the button.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to make the button primary.\n */\n @Prop({ reflect: true })\n public primary = false;\n\n /**\n * Set icon for the button\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * A list of items and separators to show in the menu.\n */\n @Prop()\n public items: Array<MenuItem | ListSeparator> = [];\n\n /**\n * Is emitted when a menu item is selected.\n */\n @Event()\n public select: EventEmitter<MenuItem>;\n\n render() {\n return (\n <Host\n class={{\n 'has-menu': !!this.items.length,\n }}\n >\n <limel-button\n label={this.label}\n primary={this.primary}\n icon={this.icon}\n disabled={this.disabled}\n />\n {this.renderMenu()}\n </Host>\n );\n }\n\n private renderMenu = () => {\n if (!this.items.length) {\n return;\n }\n\n return (\n <limel-menu\n class={{\n primary: this.primary,\n }}\n disabled={this.disabled}\n items={this.items}\n openDirection=\"bottom\"\n >\n <button\n class=\"menu-trigger\"\n slot=\"trigger\"\n disabled={this.disabled}\n >\n ⋮\n </button>\n </limel-menu>\n );\n };\n}\n"],"mappings":"yDAAA,MAAMA,EAAiB,y0D,MCyBVC,EAAW,M,wDAuDZC,KAAAC,WAAa,KACjB,IAAKD,KAAKE,MAAMC,OAAQ,CACpB,M,CAGJ,OACIC,EAAA,cACIC,MAAO,CACHC,QAASN,KAAKM,SAElBC,SAAUP,KAAKO,SACfL,MAAOF,KAAKE,MACZM,cAAc,UAEdJ,EAAA,UACIC,MAAM,eACNI,KAAK,UACLF,SAAUP,KAAKO,UAAQ,KAIlB,E,kCAjEJ,M,kCAYC,M,WAM8B,E,CAQhDG,SACI,OACIN,EAACO,EAAI,CACDN,MAAO,CACH,aAAcL,KAAKE,MAAMC,SAG7BC,EAAA,gBACIQ,MAAOZ,KAAKY,MACZN,QAASN,KAAKM,QACdO,KAAMb,KAAKa,KACXN,SAAUP,KAAKO,WAElBP,KAAKC,a"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["buttonGroupCss","ButtonGroup","constructor","hostRef","this","radioGroupName","createRandomString","setSelectedButton","selectedButtonId","_a","value","find","button","selected","id","renderButton","bind","onChange","renderContent","componentWillLoad","render","classes","disabled","h","class","role","map","buttonId","isButtonChecked","type","name","checked","htmlFor","renderBadge","icon","renderIcon","renderLabel","title","iconId","size","badge","elementId","label","event","stopPropagation","target","substr","item","change","emit","valueChanged"],"sources":["./src/components/button-group/button-group.scss?tag=limel-button-group&encapsulation=shadow","./src/components/button-group/button-group.tsx"],"sourcesContent":["@use '../../style/internal/z-index';\n@use '../../style/functions';\n@use '../../style/internal/shared_input-select-picker';\n@use '../../style/mixins';\n\n@use '@material/chips/deprecated/mdc-chips';\n/**\n* @prop --button-group-background-color: Background color of the component. Defaults to `--contrast-400`\n*/\n\n.mdc-chip {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\n.mdc-chip {\n @include mixins.is-flat-inset-clickable($background-color: transparent);\n max-width: 100%;\n min-width: functions.pxToRem(32);\n padding: 0 functions.pxToRem(1);\n display: inline-grid;\n grid-auto-flow: column;\n margin: functions.pxToRem(2) !important;\n font-size: functions.pxToRem(14);\n\n &:not(:last-child) {\n &:after {\n content: '';\n display: block;\n\n height: functions.pxToRem(16);\n width: functions.pxToRem(2);\n border-radius: functions.pxToRem(4);\n background-color: var(\n --button-group-text-color,\n rgb(var(--contrast-1200))\n );\n opacity: 0.1;\n\n position: absolute;\n right: functions.pxToRem(-3);\n top: 0;\n bottom: 0;\n margin: auto;\n }\n }\n\n label {\n cursor: pointer;\n transition: color 0.2s ease;\n display: flex;\n align-items: center;\n &:has(> limel-badge) {\n .mdc-chip__text {\n padding-right: 0.25rem;\n }\n }\n }\n\n input[type='radio'] {\n width: 0;\n position: absolute;\n opacity: 0; // This removes some visual defects on iOS and Firefox, created by \"user agent styles\"\n\n &:focus-visible {\n + label {\n &:after {\n // visualizes keyboard navigation on Chrome & Firefox\n // only when non-pointer input is being used,\n // e.g. tabbed into using keyboard\n content: '';\n display: block;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-radius: functions.pxToRem(60);\n box-shadow: var(--shadow-depth-8-focused);\n z-index: z-index.$button-group-radio-button-keyboard-focused;\n }\n }\n }\n }\n\n span[role='gridcell'] {\n min-width: 0; // This is needed to force mdc-chip__text (which is inside this span) to truncate\n\n &:focus-within {\n // Cannot use `:focus-visible` here, since it is the radio button\n // which gets focused, which is inside this element…\n // and we are removing or hiding the visual appearance of the button\n outline: none;\n color: var(--mdc-theme-primary);\n }\n\n &:only-child {\n .mdc-chip__text {\n padding-left: functions.pxToRem(12);\n }\n }\n\n &:first-child {\n .mdc-chip__text {\n padding-left: functions.pxToRem(12);\n }\n }\n }\n\n &.mdc-chip--selected {\n background-color: var(--mdc-theme-surface);\n box-shadow: var(--button-shadow-inset);\n\n &:active {\n box-shadow: var(--button-shadow-inset-pressed);\n }\n }\n}\n\n.mdc-chip__text {\n font-size: functions.pxToRem(13);\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n padding: 0 functions.pxToRem(12) 0 functions.pxToRem(4);\n}\n\n.mdc-chip-set {\n align-items: center;\n border-radius: functions.pxToRem(60);\n background-color: var(\n --button-group-background-color,\n rgb(var(--contrast-400))\n );\n padding: 0;\n\n width: max-content;\n max-width: 100%;\n\n flex-wrap: nowrap; // Not sure about this. It'll put items on one row, but also can look bad on action bars. Kia\n\n &.disabled {\n @include shared_input-select-picker.looks-disabled;\n }\n}\n\nlimel-badge {\n margin-right: 0.25rem;\n pointer-events: none;\n}\n\n.mdc-chip:not(.mdc-chip--selected) {\n --badge-background-color: rgb(var(--contrast-200));\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { Button } from '../button/button.types';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * A button group control is a linear set of two or more buttons.\n *\n * ## Usage\n *\n * Button groups are often used to display different views of the same thing. A\n * common example of this component is when you switch between [ Map | Transit\n * | Satellite ] views to look at an area on the map.\n *\n * In some cases, button groups may serve as quick filters as well. For example\n * a list of contacts, in which the user can switch to [ All | Favorites\n * | Frequently contacted ] can incorporate a button group to quickly filter out\n * items and display subsets of them.\n *\n * ## Layout\n *\n * The button groups are usually placed in top headers and action bars,\n * sometimes with other elements. Since the group items will always be rendered\n * in a row, you must make sure not to have too many buttons in the group.\n * Because if the container of your button group does not get enough space to\n * fit in all its buttons, they will have to truncate their text and may appear\n * very cramped together. Always think about how your button group will appear\n * on a small screen such as phones.\n * :::note\n * Button can contain text or icons, but not both simultaneously!\n * :::\n *\n * Within the group, icon buttons will all have the same width, while each text button\n * inherits its width from its content.\n *\n * @exampleComponent limel-example-button-group-icons\n * @exampleComponent limel-example-button-group\n * @exampleComponent limel-example-button-group-mix\n * @exampleComponent limel-example-button-group-badges\n * @exampleComponent limel-example-button-group-composite\n */\n@Component({\n tag: 'limel-button-group',\n shadow: true,\n styleUrl: 'button-group.scss',\n})\nexport class ButtonGroup {\n /**\n * List of buttons for the group\n */\n @Prop()\n public value: Button[] = [];\n\n /**\n * True if the button-group should be disabled\n */\n @Prop({ reflect: true })\n public disabled: boolean = false;\n\n /**\n * Dispatched when a button is selected/deselected\n */\n @Event()\n private change: EventEmitter<Button>;\n\n @State()\n private selectedButtonId: string;\n\n private radioGroupName = createRandomString();\n\n constructor() {\n this.renderButton = this.renderButton.bind(this);\n this.onChange = this.onChange.bind(this);\n this.renderContent = this.renderContent.bind(this);\n }\n\n public componentWillLoad() {\n this.setSelectedButton();\n }\n\n public render() {\n const classes = {\n 'mdc-chip-set': true,\n disabled: this.disabled,\n 'mdc-chip-set--choice': true,\n };\n\n return (\n <div class={classes} role=\"grid\">\n {this.value.map(this.renderButton)}\n </div>\n );\n }\n\n private renderButton(button: Button) {\n // Prefix with 'b' because html IDs cannot start with a digit,\n // and we need to differentiate from the ID on the limel-icon. /Ads\n const buttonId = `b${button.id}`;\n\n const classes = {\n 'mdc-chip': true,\n 'mdc-chip--selected': this.isButtonChecked(button),\n };\n\n return (\n <div class={classes} role=\"row\">\n <span role=\"gridcell\">\n <input\n type=\"radio\"\n name={this.radioGroupName}\n checked={this.isButtonChecked(button)}\n id={buttonId}\n onChange={this.onChange}\n />\n <label htmlFor={buttonId}>\n {this.renderContent(button)}\n {this.renderBadge(button)}\n </label>\n </span>\n </div>\n );\n }\n\n private renderContent(button: Button) {\n if (button.icon) {\n return this.renderIcon(button);\n }\n\n return this.renderLabel(button);\n }\n\n private isButtonChecked(button: Button) {\n return button.id === this.selectedButtonId;\n }\n\n private renderLabel(button: Button) {\n return <span class=\"mdc-chip__text\">{button.title}</span>;\n }\n\n private renderIcon(button: Button) {\n // Prefix with 'i' because html IDs cannot start with a digit,\n // and we need to differentiate from the \"buttonId\". /Ads\n const iconId = `i${button.id}`;\n\n return [\n <limel-icon\n id={iconId}\n class=\"mdc-chip__icon\"\n aria-label={button.title}\n name={button.icon}\n size=\"small\"\n badge={true}\n />,\n <limel-tooltip elementId={iconId} label={button.title} />,\n ];\n }\n\n private renderBadge(button: Button) {\n if (!button.badge) {\n return;\n }\n\n return <limel-badge label={button.badge} />;\n }\n\n private onChange(event: Event) {\n event.stopPropagation();\n const target = event.target as HTMLInputElement;\n // The ID is prefixed with `b` in the HTML, remember? /Ads\n this.selectedButtonId = target.id.substr(1);\n const button = this.value.find((item) => {\n return item.id === this.selectedButtonId;\n });\n this.change.emit(button);\n }\n\n private setSelectedButton = () => {\n this.selectedButtonId = this.value.find((button) => {\n return button.selected;\n })?.id;\n };\n\n @Watch('value')\n protected valueChanged() {\n this.setSelectedButton();\n }\n}\n"],"mappings":"iFAAA,MAAMA,EAAiB,mjlB,MCqDVC,EAAW,MAwBpBC,YAAAC,G,yCAFQC,KAAAC,eAAiBC,IA4GjBF,KAAAG,kBAAoB,K,MACxBH,KAAKI,kBAAmBC,EAAAL,KAAKM,MAAMC,MAAMC,GAC9BA,EAAOC,cAChB,MAAAJ,SAAA,SAAAA,EAAEK,EAAE,E,WAhIe,G,cAME,M,gCAcvBV,KAAKW,aAAeX,KAAKW,aAAaC,KAAKZ,MAC3CA,KAAKa,SAAWb,KAAKa,SAASD,KAAKZ,MACnCA,KAAKc,cAAgBd,KAAKc,cAAcF,KAAKZ,K,CAG1Ce,oBACHf,KAAKG,mB,CAGFa,SACH,MAAMC,EAAU,CACZ,eAAgB,KAChBC,SAAUlB,KAAKkB,SACf,uBAAwB,MAG5B,OACIC,EAAA,OAAKC,MAAOH,EAASI,KAAK,QACrBrB,KAAKM,MAAMgB,IAAItB,KAAKW,c,CAKzBA,aAAaH,GAGjB,MAA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}from"./p-3075aa67.js";import{m as s,r as n}from"./p-fa37036b.js";import{c as a}from"./p-3ccdc4a3.js";const r='@charset "UTF-8";:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([aria-expanded=true]) button,:host([aria-expanded]:not([aria-expanded=false])) button{box-shadow:var(--button-shadow-inset-pressed) !important}button{all:unset;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--icon-background-color, transparent);display:inline-flex;align-items:center;justify-content:center;height:2.25rem;width:2.25rem;border-radius:50%}button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}:host([elevated]) button:not(:hover):not(:active):not(:focus-visible){box-shadow:var(--button-shadow-normal)}button:disabled{color:var(--mdc-theme-text-disabled-on-background)}limel-icon{width:1.25rem}';const i=class{constructor(o){t(this,o);this.tooltipId=a();this.icon=undefined;this.elevated=false;this.label=undefined;this.disabled=false}connectedCallback(){this.initialize()}componentWillLoad(){s(this.host)}disconnectedCallback(){n(this.host)}componentDidLoad(){this.initialize()}initialize(){const t=this.host.shadowRoot.querySelector(".mdc-icon-button");if(!t){return}}render(){const t={};if(this.host.hasAttribute("tabindex")){t.tabindex=this.host.getAttribute("tabindex")}return o("button",Object.assign({disabled:this.disabled,id:this.tooltipId},t),o("limel-icon",{name:this.icon,badge:true}),this.renderTooltip(this.tooltipId))}renderTooltip(t){if(this.label){return o("limel-tooltip",{elementId:t,label:this.label})}}get host(){return e(this)}};i.style=r;export{i as limel_icon_button};
|
|
2
|
-
//# sourceMappingURL=p-d7ef9472.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["iconButtonCss","IconButton","this","tooltipId","createRandomString","connectedCallback","initialize","componentWillLoad","makeEnterClickable","host","disconnectedCallback","removeEnterClickable","componentDidLoad","element","shadowRoot","querySelector","render","buttonAttributes","hasAttribute","tabindex","getAttribute","h","Object","assign","disabled","id","name","icon","badge","renderTooltip","label","elementId"],"sources":["./src/components/icon-button/icon-button.scss?tag=limel-icon-button&encapsulation=shadow","./src/components/icon-button/icon-button.tsx"],"sourcesContent":["@use '../../style/mixins';\n\n/**\n * @prop --icon-background-color: Background color of the button.\n */\n\n:host([hidden]) {\n display: none;\n}\n\n:host([disabled]) {\n pointer-events: none;\n}\n\n@include mixins.visualize-aria-expanded('button');\n\nbutton {\n all: unset;\n @include mixins.is-flat-clickable(\n $background-color: var(--icon-background-color, transparent)\n );\n @include mixins.visualize-keyboard-focus;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n height: 2.25rem;\n width: 2.25rem;\n border-radius: 50%;\n\n :host([elevated]) & {\n &:not(:hover):not(:active):not(:focus-visible) {\n box-shadow: var(--button-shadow-normal);\n }\n }\n\n &:disabled {\n color: var(--mdc-theme-text-disabled-on-background);\n }\n}\n\nlimel-icon {\n width: 1.25rem;\n}\n","import { Component, Element, h, Prop } from '@stencil/core';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from 'src/util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * @exampleComponent limel-example-icon-button-basic\n * @exampleComponent limel-example-icon-button-disabled\n * @exampleComponent limel-example-icon-button-elevated\n * @exampleComponent limel-example-icon-button-toggle-state\n * @exampleComponent limel-example-icon-button-composite\n */\n@Component({\n tag: 'limel-icon-button',\n shadow: true,\n styleUrl: 'icon-button.scss',\n})\nexport class IconButton {\n /**\n * The icon to display.\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to give the button our standard \"elevated\" look, lifting\n * it off the flat layout.\n */\n @Prop({ reflect: true })\n public elevated = false;\n\n /**\n * The text to show to screenreaders and other assistive tech.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n @Element()\n private host: HTMLLimelIconButtonElement;\n\n public connectedCallback() {\n this.initialize();\n }\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public componentDidLoad() {\n this.initialize();\n }\n\n private tooltipId = createRandomString();\n\n private initialize() {\n const element = this.host.shadowRoot.querySelector('.mdc-icon-button');\n if (!element) {\n return;\n }\n }\n\n public render() {\n const buttonAttributes: { tabindex?: string } = {};\n\n if (this.host.hasAttribute('tabindex')) {\n buttonAttributes.tabindex = this.host.getAttribute('tabindex');\n }\n\n return (\n <button\n disabled={this.disabled}\n id={this.tooltipId}\n {...buttonAttributes}\n >\n <limel-icon name={this.icon} badge={true} />\n {this.renderTooltip(this.tooltipId)}\n </button>\n );\n }\n private renderTooltip(tooltipId) {\n if (this.label) {\n return <limel-tooltip elementId={tooltipId} label={this.label} />;\n }\n }\n}\n"],"mappings":"iIAAA,MAAMA,EAAgB,2lC,MCmBTC,EAAU,M,yBA6CXC,KAAAC,UAAYC,I,kCAjCF,M,mCAYA,K,CAKXC,oBACHH,KAAKI,Y,CAGFC,oBACHC,EAAmBN,KAAKO,K,CAGrBC,uBACHC,EAAqBT,KAAKO,K,CAGvBG,mBACHV,KAAKI,Y,CAKDA,aACJ,MAAMO,EAAUX,KAAKO,KAAKK,WAAWC,cAAc,oBACnD,IAAKF,EAAS,CACV,M,EAIDG,SACH,MAAMC,EAA0C,GAEhD,GAAIf,KAAKO,KAAKS,aAAa,YAAa,CACpCD,EAAiBE,SAAWjB,KAAKO,KAAKW,aAAa,W,CAGvD,OACIC,EAAA,SAAAC,OAAAC,OAAA,CACIC,SAAUtB,KAAKsB,SACfC,GAAIvB,KAAKC,WACLc,GAEJI,EAAA,cAAYK,KAAMxB,KAAKyB,KAAMC,MAAO,OACnC1B,KAAK2B,cAAc3B,KAAKC,W,CAI7B0B,cAAc1B,GAClB,GAAID,KAAK4B,MAAO,CACZ,OAAOT,EAAA,iBAAeU,UAAW5B,EAAW2B,MAAO5B,KAAK4B,O"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,g as o}from"./p-3075aa67.js";import{m as r,r as a}from"./p-fa37036b.js";const n='@charset "UTF-8";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host{display:inline-block}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([aria-expanded=true]) button,:host([aria-expanded]:not([aria-expanded=false])) button{box-shadow:var(--button-shadow-inset-pressed) !important}button.mdc-button{font-family:inherit}button{display:flex;align-items:center;justify-content:center;gap:0.125rem;border:none;border-radius:0.4rem;padding-top:0;padding-right:var(--button-padding-right, 0.5rem);padding-bottom:0;padding-left:var(--button-padding-left, 0.5rem);min-height:2.25rem;width:100%}button:disabled.outlined{border-color:rgba(var(--contrast-1700), 0.2)}button:not(:disabled){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}button:not(:disabled):focus{outline:none}button:not(:disabled):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button:not(:disabled):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}button:not(:disabled):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}:host(limel-button[primary]) button:not(:disabled){color:var(--mdc-theme-on-primary, rgb(var(--color-white)));background-color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button[primary]) button:disabled{background-color:rgba(var(--contrast-1700), 0.15)}:host(limel-button:not([primary])) button:not(:disabled){color:var(--mdc-theme-primary, rgb(var(--color-teal-default)))}:host(limel-button:not([primary])) button:disabled{color:rgba(var(--contrast-1600), 0.37);background-color:rgba(var(--contrast-1600), 0.1)}.icon{width:1.25rem;flex-shrink:0}.label{font-size:0.875rem;font-weight:600;letter-spacing:0.03125rem;padding:0 0.25rem}limel-spinner{position:absolute}limel-icon{vertical-align:top}svg{height:1.875rem;opacity:0;pointer-events:none;position:absolute;width:1.875rem}svg line{stroke:rgb(var(--color-white));stroke-width:2}limel-icon,.label,limel-spinner,svg{transition:opacity 300ms ease-in-out}.loading limel-icon,.loading .label{opacity:0}.loading limel-spinner{opacity:1}.just-loaded limel-icon,.just-loaded .label,.just-failed limel-icon,.just-failed .label{opacity:0}.just-loaded svg,.just-failed svg{opacity:1}.just-failed{background-color:var(--lime-error-text-color) !important;animation:shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both}.outlined{border:1px solid;border-color:var(--mdc-theme-primary)}@keyframes shake{10%,90%{transform:translate3d(-0.0625rem, 0, 0)}20%,80%{transform:translate3d(0.125rem, 0, 0)}30%,50%,70%{transform:translate3d(-0.1875rem, 0, 0)}40%,60%{transform:translate3d(0.1875rem, 0, 0)}}@keyframes reduced-presence{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.7)}}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded){animation:reduced-presence 0.3s ease forwards;transition:padding 0.3s ease, min-width 0.3s ease;transition-delay:0.3s;padding:0;min-width:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .label{transition:font-size 0.8s ease;transition-delay:0.3s;font-size:0;opacity:0}:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-icon,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) limel-spinner,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) svg,:host(.has-reduced-presence) button[disabled]:not(.loading):not(.just-loaded) .icon{transition:all 0.3s ease;transition-delay:0.3s;opacity:0;width:0;height:0}';const s=class{constructor(t){e(this,t);this.label=undefined;this.primary=false;this.outlined=false;this.icon=undefined;this.disabled=false;this.loading=false;this.loadingFailed=false;this.justLoaded=false}componentWillLoad(){r(this.host)}disconnectedCallback(){a(this.host)}render(){return t("button",{class:{loading:this.loading,"just-loaded":this.justLoaded&&!this.loadingFailed,"just-failed":this.justLoaded&&this.loadingFailed,outlined:this.outlined},disabled:this.disabled||this.loading},this.renderIcon(),this.renderLabel(),this.renderSpinner(),t("svg",{viewBox:"0 0 30 30"},this.renderLoadingIcons()))}loadingWatcher(e,t){if(t&&!e){this.justLoaded=true;const e=2e3;this.justLoadedTimeout=window.setTimeout((()=>{this.justLoaded=false}),e)}else if(e){this.justLoaded=false;window.clearTimeout(this.justLoadedTimeout)}}renderLoadingIcons(){if(this.loadingFailed){return[t("line",{x1:"9",y1:"9",x2:"21",y2:"21"}),t("line",{x1:"21",y1:"9",x2:"9",y2:"21"})]}return[t("line",{x1:"8",y1:"14",x2:"15",y2:"20"}),t("line",{x1:"23",y1:"9",x2:"14",y2:"20"})]}renderIcon(){if(!this.icon){return}return t("limel-icon",{class:"icon",name:this.icon})}renderLabel(){if(!this.label){return}return t("span",{class:"label"},this.label)}renderSpinner(){if(!this.loading){return}return t("limel-spinner",{limeBranded:false})}get host(){return o(this)}static get watchers(){return{loading:["loadingWatcher"]}}};s.style=n;export{s as limel_button};
|
|
2
|
-
//# sourceMappingURL=p-f94723c3.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["buttonCss","Button","componentWillLoad","makeEnterClickable","this","host","disconnectedCallback","removeEnterClickable","render","h","class","loading","justLoaded","loadingFailed","outlined","disabled","renderIcon","renderLabel","renderSpinner","viewBox","renderLoadingIcons","loadingWatcher","newValue","oldValue","TIMEOUT","justLoadedTimeout","window","setTimeout","clearTimeout","x1","y1","x2","y2","icon","name","label","limeBranded"],"sources":["./src/components/button/button.scss?tag=limel-button&encapsulation=shadow","./src/components/button/button.tsx"],"sourcesContent":["@use '../../style/functions';\n@use '../../style/mixins';\n\n@use '../../style/internal/lime-theme';\n\n:host {\n display: inline-block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([disabled]) {\n pointer-events: none;\n}\n\n@include mixins.visualize-aria-expanded('button');\n\nbutton.mdc-button {\n // As long as this component is depended on MDC,\n // we need to force it to be font-agnostic.\n // When MDC-dependency is removed, this block can also be removed.\n // However, on removal of MDC-dependency, we should also make sure to check\n // other font-related styles that might be set by MDC,\n // such as `letter-spacing` or `font-size`.\n font-family: inherit;\n}\n\nbutton {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.125rem;\n\n border: none;\n border-radius: 0.4rem;\n padding: {\n top: 0;\n right: var(--button-padding-right, 0.5rem);\n bottom: 0;\n left: var(--button-padding-left, 0.5rem);\n }\n\n min-height: 2.25rem;\n width: 100%;\n\n &:disabled {\n &.outlined {\n border-color: rgba(var(--contrast-1700), 0.2);\n }\n }\n\n &:not(:disabled) {\n @include mixins.visualize-keyboard-focus;\n @include mixins.is-elevated-clickable();\n }\n\n :host(limel-button[primary]) & {\n &:not(:disabled) {\n color: var(--mdc-theme-on-primary, rgb(var(--color-white)));\n background-color: var(\n --mdc-theme-primary,\n rgb(var(--color-teal-default))\n );\n }\n &:disabled {\n background-color: rgba(var(--contrast-1700), 0.15);\n }\n }\n\n :host(limel-button:not([primary])) & {\n &:not(:disabled) {\n color: var(--mdc-theme-primary, rgb(var(--color-teal-default)));\n }\n &:disabled {\n color: rgba(var(--contrast-1600), 0.37);\n background-color: rgba(var(--contrast-1600), 0.1);\n }\n }\n}\n\n.icon {\n width: 1.25rem;\n flex-shrink: 0;\n}\n\n.label {\n font-size: 0.875rem;\n font-weight: 600;\n letter-spacing: functions.pxToRem(0.5);\n padding: 0 0.25rem;\n}\n\nlimel-spinner {\n position: absolute;\n}\n\nlimel-icon {\n vertical-align: top;\n}\n\nsvg {\n height: functions.pxToRem(30);\n opacity: 0;\n pointer-events: none;\n position: absolute;\n width: functions.pxToRem(30);\n\n line {\n stroke: rgb(var(--color-white));\n stroke-width: 2;\n }\n}\n\nlimel-icon,\n.label,\nlimel-spinner,\nsvg {\n transition: opacity 300ms ease-in-out;\n}\n\n.loading {\n limel-icon,\n .label {\n opacity: 0;\n }\n limel-spinner {\n opacity: 1;\n }\n}\n\n.just-loaded,\n.just-failed {\n limel-icon,\n .label {\n opacity: 0;\n }\n svg {\n opacity: 1;\n }\n}\n\n.just-failed {\n background-color: var(--lime-error-text-color) !important;\n animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;\n}\n\n.outlined {\n border: 1px solid;\n border-color: var(--mdc-theme-primary);\n}\n\n@keyframes shake {\n 10%,\n 90% {\n transform: translate3d(#{functions.pxToRem(-1)}, 0, 0);\n }\n\n 20%,\n 80% {\n transform: translate3d(#{functions.pxToRem(2)}, 0, 0);\n }\n\n 30%,\n 50%,\n 70% {\n transform: translate3d(#{functions.pxToRem(-3)}, 0, 0);\n }\n\n 40%,\n 60% {\n transform: translate3d(#{functions.pxToRem(3)}, 0, 0);\n }\n}\n\n@import './partial-styles/_has-reduced-presence';\n","import { Component, h, Prop, State, Watch, Element } from '@stencil/core';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\n\n/**\n * @exampleComponent limel-example-button-basic\n * @exampleComponent limel-example-button-primary\n * @exampleComponent limel-example-button-outlined\n * @exampleComponent limel-example-button-disabled\n * @exampleComponent limel-example-button-icon\n * @exampleComponent limel-example-button-loading\n * @exampleComponent limel-example-button-click-success\n * @exampleComponent limel-example-button-click-fail\n * @exampleComponent limel-example-button-reduce-presence\n * @exampleComponent limel-example-button-colors\n * @exampleComponent limel-example-button-composite\n */\n@Component({\n tag: 'limel-button',\n shadow: true,\n styleUrl: 'button.scss',\n})\nexport class Button {\n /**\n * The text to show on the button.\n */\n @Prop({ reflect: true })\n public label: string;\n\n /**\n * Set to `true` to make the button primary.\n */\n @Prop({ reflect: true })\n public primary = false;\n\n /**\n * Set to `true` to make the button outlined.\n */\n @Prop({ reflect: true })\n public outlined = false;\n\n /**\n * Set icon for the button\n */\n @Prop({ reflect: true })\n public icon: string;\n\n /**\n * Set to `true` to disable the button.\n */\n @Prop({ reflect: true })\n public disabled = false;\n\n /**\n * Set to `true` to put the button in the `loading` state.\n * This also disables the button.\n */\n @Prop({ reflect: true })\n public loading = false;\n\n /**\n * Set to `true` to indicate failure instead of success when the button is\n * no longer in the `loading` state.\n */\n @Prop({ reflect: true })\n public loadingFailed = false;\n\n @State()\n private justLoaded = false;\n\n @Element()\n private host: HTMLElement;\n\n private justLoadedTimeout?: number;\n\n public componentWillLoad() {\n makeEnterClickable(this.host);\n }\n\n public disconnectedCallback() {\n removeEnterClickable(this.host);\n }\n\n public render() {\n return (\n <button\n class={{\n loading: this.loading,\n 'just-loaded': this.justLoaded && !this.loadingFailed,\n 'just-failed': this.justLoaded && this.loadingFailed,\n outlined: this.outlined,\n }}\n disabled={this.disabled || this.loading}\n >\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderSpinner()}\n <svg viewBox=\"0 0 30 30\">{this.renderLoadingIcons()}</svg>\n </button>\n );\n }\n\n @Watch('loading')\n protected loadingWatcher(newValue: boolean, oldValue: boolean) {\n if (oldValue && !newValue) {\n this.justLoaded = true;\n const TIMEOUT = 2000;\n this.justLoadedTimeout = window.setTimeout(() => {\n this.justLoaded = false;\n }, TIMEOUT);\n } else if (newValue) {\n this.justLoaded = false;\n window.clearTimeout(this.justLoadedTimeout);\n }\n }\n\n private renderLoadingIcons() {\n if (this.loadingFailed) {\n return [\n <line x1=\"9\" y1=\"9\" x2=\"21\" y2=\"21\" />,\n <line x1=\"21\" y1=\"9\" x2=\"9\" y2=\"21\" />,\n ];\n }\n\n return [\n <line x1=\"8\" y1=\"14\" x2=\"15\" y2=\"20\" />,\n <line x1=\"23\" y1=\"9\" x2=\"14\" y2=\"20\" />,\n ];\n }\n\n private renderIcon() {\n if (!this.icon) {\n return;\n }\n\n return <limel-icon class=\"icon\" name={this.icon} />;\n }\n\n private renderLabel() {\n if (!this.label) {\n return;\n }\n\n return <span class=\"label\">{this.label}</span>;\n }\n\n private renderSpinner() {\n if (!this.loading) {\n return;\n }\n\n return <limel-spinner limeBranded={false} />;\n }\n}\n"],"mappings":"6FAAA,MAAMA,EAAY,40J,MCwBLC,EAAM,M,2DAWE,M,cAMC,M,kCAYA,M,aAOD,M,mBAOM,M,gBAGF,K,CAOdC,oBACHC,EAAmBC,KAAKC,K,CAGrBC,uBACHC,EAAqBH,KAAKC,K,CAGvBG,SACH,OACIC,EAAA,UACIC,MAAO,CACHC,QAASP,KAAKO,QACd,cAAeP,KAAKQ,aAAeR,KAAKS,cACxC,cAAeT,KAAKQ,YAAcR,KAAKS,cACvCC,SAAUV,KAAKU,UAEnBC,SAAUX,KAAKW,UAAYX,KAAKO,SAE/BP,KAAKY,aACLZ,KAAKa,cACLb,KAAKc,gBACNT,EAAA,OAAKU,QAAQ,aAAaf,KAAKgB,sB,CAMjCC,eAAeC,EAAmBC,GACxC,GAAIA,IAAaD,EAAU,CACvBlB,KAAKQ,WAAa,KAClB,MAAMY,EAAU,IAChBpB,KAAKqB,kBAAoBC,OAAO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