@limetech/lime-elements 40.1.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -201,6 +201,12 @@ export declare class Picker {
201
201
  * @param event - event
202
202
  */
203
203
  private handleListChange;
204
+ /**
205
+ * Ends the search session a pick concludes. A single-pick picker is
206
+ * full, so its dropdown has nothing left to show; a multi-pick one
207
+ * starts over from the default suggestions.
208
+ */
209
+ private updateSearchAfterPick;
204
210
  /**
205
211
  * Change handler for the list
206
212
  *
@@ -237,6 +243,14 @@ export declare class Picker {
237
243
  private clearTextValue;
238
244
  private clearInputField;
239
245
  private resetSearchToDefault;
246
+ /**
247
+ * Ends the search session and shows the default suggestions once the
248
+ * consumer has had a chance to answer the `change` event this follows.
249
+ * Consumers commonly drop the picked item from `allItems`, and that
250
+ * arrives as a prop on their next render, so searching at once would
251
+ * read the list from before.
252
+ */
253
+ private resetSearchAfterValueChange;
240
254
  /**
241
255
  * Two-stage Esc: first press clears the typed query but keeps the
242
256
  * dropdown open showing the default suggestions; a second press
@@ -390,11 +390,12 @@ export namespace Components {
390
390
  * @exampleComponent limel-example-button-group-basic
391
391
  * @exampleComponent limel-example-button-group-mix
392
392
  * @exampleComponent limel-example-button-group-badges
393
+ * @exampleComponent limel-example-button-group-disabled-item
393
394
  * @exampleComponent limel-example-button-group-composite
394
395
  */
395
396
  interface LimelButtonGroup {
396
397
  /**
397
- * True if the button-group should be disabled
398
+ * True if the button-group should be disabled. Disables every button in the group, regardless of the `disabled` value of each individual button.
398
399
  * @default false
399
400
  */
400
401
  "disabled": boolean;
@@ -875,7 +876,7 @@ export namespace Components {
875
876
  */
876
877
  "emptyInputOnBlur": boolean;
877
878
  /**
878
- * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
879
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input is a search query over an external suggestion list and the consumer decides when the keyword has served its purpose, clearing it itself via `emptyInput()`, as `limel-picker` does.
879
880
  * @default true
880
881
  */
881
882
  "emptyInputOnChange": boolean;
@@ -4480,6 +4481,7 @@ declare global {
4480
4481
  * @exampleComponent limel-example-button-group-basic
4481
4482
  * @exampleComponent limel-example-button-group-mix
4482
4483
  * @exampleComponent limel-example-button-group-badges
4484
+ * @exampleComponent limel-example-button-group-disabled-item
4483
4485
  * @exampleComponent limel-example-button-group-composite
4484
4486
  */
4485
4487
  interface HTMLLimelButtonGroupElement extends Components.LimelButtonGroup, HTMLStencilElement {
@@ -6968,11 +6970,12 @@ declare namespace LocalJSX {
6968
6970
  * @exampleComponent limel-example-button-group-basic
6969
6971
  * @exampleComponent limel-example-button-group-mix
6970
6972
  * @exampleComponent limel-example-button-group-badges
6973
+ * @exampleComponent limel-example-button-group-disabled-item
6971
6974
  * @exampleComponent limel-example-button-group-composite
6972
6975
  */
6973
6976
  interface LimelButtonGroup {
6974
6977
  /**
6975
- * True if the button-group should be disabled
6978
+ * True if the button-group should be disabled. Disables every button in the group, regardless of the `disabled` value of each individual button.
6976
6979
  * @default false
6977
6980
  */
6978
6981
  "disabled"?: boolean;
@@ -7472,7 +7475,7 @@ declare namespace LocalJSX {
7472
7475
  */
7473
7476
  "emptyInputOnBlur"?: boolean;
7474
7477
  /**
7475
- * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input represents a search query over an external suggestion list (as in `limel-picker`), so the typed keyword survives while chips are added or removed (when user selects items from the search results list, while it is open).
7478
+ * Whether the input field should be emptied when the set of chips changes (i.e. when the `value` prop is updated — a chip is added, removed, or the array is replaced). Defaults to `true`, which is the right behavior for a standalone input chip-set where the typed text *becomes* the next chip on <kbd>Enter</kbd>. The input is then cleared to make room for the next chip, and help user type a new keyword from scratch. Set to `false` when the input is a search query over an external suggestion list and the consumer decides when the keyword has served its purpose, clearing it itself via `emptyInput()`, as `limel-picker` does.
7476
7479
  * @default true
7477
7480
  */
7478
7481
  "emptyInputOnChange"?: boolean;
@@ -11775,6 +11778,7 @@ declare module "@stencil/core" {
11775
11778
  * @exampleComponent limel-example-button-group-basic
11776
11779
  * @exampleComponent limel-example-button-group-mix
11777
11780
  * @exampleComponent limel-example-button-group-badges
11781
+ * @exampleComponent limel-example-button-group-disabled-item
11778
11782
  * @exampleComponent limel-example-button-group-composite
11779
11783
  */
11780
11784
  "limel-button-group": LocalJSX.IntrinsicElements["limel-button-group"] & JSXBase.HTMLAttributes<HTMLLimelButtonGroupElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "40.1.0",
3
+ "version": "40.2.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -79,7 +79,7 @@
79
79
  "eslint": "^9.39.4",
80
80
  "flatpickr": "^4.6.13",
81
81
  "glob": "^13.0.6",
82
- "globals": "^17.11.0",
82
+ "globals": "^17.12.0",
83
83
  "html-escaper": "^3.0.3",
84
84
  "jsonlint-mod": "^1.7.6",
85
85
  "jsx-dom": "^8.1.6",
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as o,H as r}from"./p-BGxJfR2f.js";import{c as i}from"./p-JbKhhoXs.js";const a=class{constructor(o){t(this,o),this.change=e(this,"change"),this.value=[],this.disabled=!1,this.radioGroupName=i(),this.setSelectedButton=()=>{var t;this.selectedButtonId=null===(t=this.value.find((t=>t.selected)))||void 0===t?void 0:t.id},this.renderButton=this.renderButton.bind(this),this.onChange=this.onChange.bind(this),this.renderContent=this.renderContent.bind(this)}componentWillLoad(){this.setSelectedButton()}render(){return o(r,{key:"867ce929125e09bbe9f0862e6cb68ad10f90a768",role:"radiogroup"},this.value.map(this.renderButton))}renderButton(t){const e=`b${t.id}`,r={button:!0,"button--selected":this.isButtonChecked(t)};return o("div",{class:r},o("input",{type:"radio",name:this.radioGroupName,checked:this.isButtonChecked(t),disabled:this.disabled,id:e,onChange:this.onChange}),o("label",{htmlFor:e},this.renderContent(t),this.renderBadge(t)))}renderContent(t){return t.icon?this.renderIcon(t):this.renderLabel(t)}isButtonChecked(t){return t.id===this.selectedButtonId}renderLabel(t){return o("span",{class:"button__label"},t.title)}renderIcon(t){const e=`i${t.id}`;return[o("limel-icon",{id:e,class:"button__icon","aria-label":t.title,name:t.icon,size:"small",badge:!0}),o("limel-tooltip",{elementId:e,label:t.title})]}renderBadge(t){if(t.badge)return o("limel-badge",{label:t.badge})}onChange(t){t.stopPropagation(),this.selectedButtonId=t.target.id.slice(1);const e=this.value.find((t=>t.id===this.selectedButtonId));this.change.emit(e)}valueChanged(){this.setSelectedButton()}static get watchers(){return{value:[{valueChanged:0}]}}};a.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}:host(limel-button-group){display:flex;box-sizing:border-box;align-items:center;border-radius:3.75rem;background-color:var(--button-group-background-color, rgb(var(--contrast-400)));width:max-content;max-width:100%;flex-wrap:nowrap}:host([disabled]:not([disabled=false])){cursor:not-allowed;opacity:0.4}.button{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}.button:hover,.button:focus,.button:focus-visible{will-change:color, background-color, box-shadow, transform}.button:hover,.button:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.button:hover{box-shadow:var(--button-shadow-hovered)}.button:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);background-color:var(--limel-theme-surface-background-color);box-shadow:var(--button-shadow-inset-pressed)}.button:hover,.button:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.button:has(input[disabled]):hover{box-shadow:none;transform:none}.button{position:relative;display:inline-grid;grid-auto-flow:column;align-items:center;max-width:100%;min-width:2rem;height:2rem;padding:0 0.0625rem;margin:0.125rem;border-radius:1rem;font-size:var(--limel-theme-default-font-size);user-select:none}.button:not(:last-child):after{content:"";display:block;height:1rem;width:0.125rem;border-radius:0.25rem;background-color:var(--button-group-text-color, rgb(var(--contrast-1200)));opacity:0.1;position:absolute;right:-0.1875rem;top:0;bottom:0;margin:auto}.button label{cursor:pointer;transition:color 0.2s ease;display:flex;align-items:center;flex:1;height:100%;min-width:0}.button label:has(>limel-badge) .button__label{padding-right:0.25rem}.button input[type=radio]{position:absolute;width:0;opacity:0}.button input[type=radio]:focus-visible+label:after{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border-radius:3.75rem;box-shadow:var(--shadow-depth-8-focused)}.button:focus-within{outline:none;color:var(--lime-primary-color, var(--limel-theme-primary-color))}.button:only-child .button__label{padding-left:0.75rem}.button:first-child .button__label{padding-left:0.75rem}.button.button--selected{background-color:var(--limel-theme-surface-background-color);box-shadow:var(--button-shadow-inset);color:var(--lime-primary-color, var(--limel-theme-primary-color))}.button.button--selected:active{box-shadow:var(--button-shadow-inset-pressed)}.button__label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--limel-theme-default-small-font-size);padding:0 0.75rem}.button__icon{border-radius:50%;vertical-align:middle}limel-badge{margin-right:0.25rem;pointer-events:none}.button:not(.button--selected){--badge-background-color:rgb(var(--contrast-200))}';export{a as limel_button_group}