@aceshooting/lyra-ui 8.2.1 → 8.2.3

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +2 -4
  3. package/custom-elements.json +1 -1
  4. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +1 -1
  5. package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +1 -0
  6. package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +1 -0
  7. package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +1 -0
  8. package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +1 -0
  9. package/dist/components/agent-tools/eval-result/eval-result.styles.js +1 -0
  10. package/dist/components/agent-tools/mcp-app/mcp-app.styles.js +1 -0
  11. package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +1 -1
  12. package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +1 -1
  13. package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +1 -0
  14. package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +1 -1
  15. package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +1 -0
  16. package/dist/components/charts/chart/chart.styles.js +1 -0
  17. package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +1 -0
  18. package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +1 -0
  19. package/dist/components/conversation/code-block/code-block.styles.js +7 -0
  20. package/dist/components/conversation/message-parts/message-parts.styles.js +1 -0
  21. package/dist/components/conversation/prompt-input/prompt-input.styles.js +1 -0
  22. package/dist/components/conversation/prompt-queue/prompt-queue.styles.js +1 -0
  23. package/dist/components/conversation/realtime-session/realtime-session.styles.js +1 -1
  24. package/dist/components/data/calendar/calendar.styles.js +1 -0
  25. package/dist/components/data/data-grid/data-grid.styles.js +1 -0
  26. package/dist/components/data/pagination/pagination.styles.js +1 -0
  27. package/dist/components/data/query-builder/query-builder.styles.js +1 -0
  28. package/dist/components/data/table/table.styles.js +1 -0
  29. package/dist/components/forms/input/input.class.d.ts +9 -0
  30. package/dist/components/forms/input/input.class.js +4 -3
  31. package/dist/components/forms/input/time-input.styles.js +1 -0
  32. package/dist/components/layout/button-group/button-group.styles.js +4 -9
  33. package/dist/components/layout/card/card.styles.js +4 -0
  34. package/dist/components/layout/carousel/carousel.styles.js +1 -0
  35. package/dist/components/layout/control-group/control-group.styles.js +1 -0
  36. package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +1 -0
  37. package/dist/components/layout/page/page.styles.js +1 -0
  38. package/dist/components/media/lightbox/lightbox.styles.js +1 -0
  39. package/dist/components/media/map/map-loader.d.ts +3 -3
  40. package/dist/components/media/map/map-loader.js +1 -1
  41. package/dist/components/media/map/map.class.d.ts +3 -2
  42. package/dist/components/media/map/map.styles.js +207 -9
  43. package/dist/components/media/video/video.styles.js +1 -0
  44. package/dist/components/media/video-playlist/video-playlist.styles.js +1 -0
  45. package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +1 -0
  46. package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +1 -0
  47. package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +1 -0
  48. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +1 -0
  49. package/dist/components/retrieval/rag-answer/rag-answer.styles.js +1 -1
  50. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.styles.js +1 -0
  51. package/dist/components/retrieval/retrieval-compare/retrieval-compare.styles.js +1 -0
  52. package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +1 -0
  53. package/dist/components/utility/diff-view/diff-view.styles.js +5 -0
  54. package/dist/components/viewers/document-compare/document-compare.styles.js +1 -0
  55. package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +1 -0
  56. package/dist/internal/package-metadata.d.ts +1 -1
  57. package/dist/internal/package-metadata.js +1 -1
  58. package/llms/components/lr-input.md +6 -0
  59. package/llms/components/lr-map.md +6 -6
  60. package/llms/peers.md +1 -1
  61. package/llms-full.txt +12 -6
  62. package/package.json +4 -4
  63. package/vscode-html-data.json +1 -1
  64. package/web-types.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import{css}from"lit";const styles=css`
2
- :host { display: block; container-type: inline-size; }
2
+ :host { display: block; container-type: inline-size; contain-intrinsic-inline-size: var(--lr-size-20rem); }
3
3
  [part='base'] { display: flex; flex-direction: column; gap: var(--lr-space-m); }
4
4
  [part='heading'], [part='runs-heading'] { margin: 0; font-size: var(--lr-font-size-lg); font-weight: var(--lr-font-weight-semibold); }
5
5
  [part='metrics'] { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--lr-size-10rem), 1fr)); gap: var(--lr-space-s); }
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -4,6 +4,7 @@ import{css}from"lit";const styles=css`
4
4
  /* Makes the host a query container so the @container rule below reacts to the frame's own
5
5
  allocated width (a sidebar, a split pane, a dialog) instead of the viewport's. */
6
6
  container-type: inline-size;
7
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
7
8
  }
8
9
  [part='base'] {
9
10
  display: flex;
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  --lr-compare-panel-max-height: var(--lr-size-24rem);
6
7
  }
7
8
 
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -1,5 +1,5 @@
1
1
  import{css}from"lit";const styles=css`
2
- :host { display: block; container-type: inline-size; }
2
+ :host { display: block; container-type: inline-size; contain-intrinsic-inline-size: var(--lr-size-20rem); }
3
3
  [part='base'] { display: flex; flex-direction: column; gap: var(--lr-space-m); }
4
4
  [part='toolbar'] { display: flex; flex-wrap: wrap; gap: var(--lr-space-s); align-items: center; }
5
5
  [part='toolbar'] h2 { min-inline-size: 0; flex: 1; margin: 0; font-size: var(--lr-font-size-lg); }
@@ -1,5 +1,5 @@
1
1
  import{css}from"lit";const styles=css`
2
- :host { display: block; container-type: inline-size; }
2
+ :host { display: block; container-type: inline-size; contain-intrinsic-inline-size: var(--lr-size-20rem); }
3
3
  ul { display: flex; flex-direction: column; gap: var(--lr-space-xs); margin: 0; padding-inline-start: var(--lr-space-l); list-style: none; }
4
4
  [part='tree'] { padding-inline-start: 0; }
5
5
  [part~='node'] { min-inline-size: 0; border-inline-start: var(--lr-border-width-thin) solid var(--lr-color-border); padding-inline-start: var(--lr-space-s); }
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  --lr-span-waterfall-name-width: var(--lr-size-8rem);
6
7
  }
7
8
 
@@ -1,5 +1,5 @@
1
1
  import{css}from"lit";const styles=css`
2
- :host { display: block; container-type: inline-size; }
2
+ :host { display: block; container-type: inline-size; contain-intrinsic-inline-size: var(--lr-size-20rem); }
3
3
  [part='list'] { display: flex; flex-direction: column; gap: var(--lr-space-xs); margin: 0; padding: 0; list-style: none; }
4
4
  [part~='run'] { margin-inline-start: calc(var(--lr-subagent-depth, 0) * var(--lr-space-l)); border: var(--lr-border-width-thin) solid var(--lr-color-border); border-radius: var(--lr-radius); overflow: hidden; }
5
5
  [part~='run-selected'] {
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  --_lr-trace-tree-bar-column: var(--lr-size-6rem);
6
7
  --_lr-trace-tree-tokens-in-column: 0;
7
8
  --_lr-trace-tree-tokens-out-column: 0;
@@ -7,6 +7,7 @@ import{css}from"lit";const styles=css`
7
7
  min-block-size: var(--lr-chart-height, var(--lr-size-280px));
8
8
  block-size: auto;
9
9
  container-type: inline-size;
10
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
10
11
  /* Chart.js renders to canvas, not the DOM, so it can't consume CSS
11
12
  var() directly — chart.ts's themeColors() resolves these once per
12
13
  draw() via getComputedStyle, same pattern as heatmap.ts's scale-lo/-hi.
@@ -5,6 +5,7 @@ import{css}from"lit";const styles=css`
5
5
  min-block-size: 0;
6
6
  block-size: 100%;
7
7
  container-type: inline-size;
8
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
8
9
  }
9
10
  [part='base'] {
10
11
  display: grid;
@@ -6,6 +6,7 @@ import{css}from"lit";const styles=css`
6
6
  min-block-size: 0;
7
7
  position: relative;
8
8
  container-type: inline-size;
9
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
9
10
  }
10
11
  [part='base'] {
11
12
  display: flex;
@@ -167,6 +167,13 @@ import{css}from"lit";const styles=css`
167
167
  [part='pre'] {
168
168
  margin: 0;
169
169
  padding: var(--lr-space-s) var(--lr-space-m);
170
+ /* The body owns scrolling, so this descendant's painted box must grow to the longest
171
+ unwrapped line instead of stopping at the body's initially visible width. The 100%
172
+ minimum keeps short code filling the scrollport; max-content extends the background and
173
+ line-state painting through the full horizontal overflow range. */
174
+ box-sizing: border-box;
175
+ inline-size: max-content;
176
+ min-inline-size: 100%;
170
177
  /* Source code is read left-to-right regardless of the surrounding document
171
178
  direction -- like every code surface (VS Code, GitHub, devtools). Without
172
179
  this, an ancestor dir="rtl" bidi-reorders each line (a trailing ';' jumps
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -2,6 +2,7 @@ import{css}from"lit";const styles=css`
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
5
6
  }
6
7
 
7
8
  [part='base'] {
@@ -1,5 +1,5 @@
1
1
  import{css}from"lit";const styles=css`
2
- :host { display: block; container-type: inline-size; }
2
+ :host { display: block; container-type: inline-size; contain-intrinsic-inline-size: var(--lr-size-20rem); }
3
3
  [part='base'] { display: flex; flex-direction: column; gap: var(--lr-space-m); }
4
4
  [part='header'] { display: grid; grid-template-columns: auto minmax(var(--lr-size-8rem), 1fr) auto; gap: var(--lr-space-s); align-items: center; }
5
5
  [part='activity'] { min-inline-size: 0; }
@@ -7,6 +7,7 @@ import{css}from"lit";const styles=css`
7
7
  declare container-type on some ancestor whose box crosses the same threshold, making it
8
8
  effectively dead code out of the box. */
9
9
  container-type: inline-size;
10
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
10
11
  --lr-calendar-day-min-block-size: var(--lr-size-6rem);
11
12
  /* Component-scoped indirection over the shared --lr-color-brand-quiet token, so a consumer
12
13
  can retint the persistent selected-day highlight without also recoloring
@@ -27,6 +27,7 @@ import{css}from"lit";const styles=css`
27
27
  position: relative;
28
28
  isolation: isolate;
29
29
  container-type: inline-size;
30
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
30
31
  overflow: hidden;
31
32
  border: var(--border-width) solid var(--border-color);
32
33
  border-radius: var(--border-radius);
@@ -3,6 +3,7 @@ import{css}from"lit";const styles=css`
3
3
  display: block;
4
4
  min-inline-size: 0;
5
5
  container-type: inline-size;
6
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
6
7
  /* Both knobs read the shared control ladder, which owns every tier and matches both the s/m/l
7
8
  and small/medium/large spellings in one selector list. Keeping the public
8
9
  --lr-pagination-* names in front lets a consumer retune this component alone, while the
@@ -6,6 +6,7 @@ import{css}from"lit";const styles=css`
6
6
  component's own allocated width (a sidebar, a split pane, a dialog) rather than the
7
7
  viewport. */
8
8
  container-type: inline-size;
9
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
9
10
  }
10
11
 
11
12
  [part='base'] {
@@ -15,6 +15,7 @@ import{css}from"lit";const styles=css`
15
15
  /* Makes [part='base'] a query container so the @container rules below can
16
16
  react to the table's own available width instead of the viewport's. */
17
17
  container-type: inline-size;
18
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
18
19
  }
19
20
  [part='filter-label'] {
20
21
  display: flex;
@@ -246,6 +246,15 @@ export declare class LyraInput extends LyraInput_base {
246
246
  private touched;
247
247
  private readonly slotPresence;
248
248
  private inputEl?;
249
+ /** Id of the internal native `<input>` (and the `for` of its paired `<label>`), so a
250
+ * shadow-DOM-aware password manager keys its field detection off the same id the consumer put
251
+ * on the host, rather than a fixed literal. Falls back to `"input"` when the host carries no
252
+ * `id`, leaving the rendered output byte-identical to before this existed. `id` is a plain
253
+ * inherited DOM property rather than a reactive `@property`, so a host `id` set declaratively in
254
+ * markup is picked up on first render (the native IDL reflects the parsed attribute before Lit's
255
+ * own `render()` runs); mutating `el.id` after first render only takes effect on this component's
256
+ * next unrelated re-render. */
257
+ private get inputId();
249
258
  constructor();
250
259
  formResetCallback(): void;
251
260
  /** The internal native `<input>` element, for direct DOM access — mirrors `<lr-textarea>`'s own `input` getter. */
@@ -1,6 +1,6 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{FormAssociated,isBarredFromValidation}from"../../../internal/form-associated.js";import{SET_ANCHORED_VALIDITY}from"../../../internal/anchored-validity.js";import{lengthViolations}from"../../../internal/length-constraints.js";import{closeIcon,eyeIcon,eyeOffIcon}from"../../../internal/icons.js";import{styles}from"./input.styles.js";import{sizes}from"../../../internal/sizes.styles.js";import{autocorrectConverter,normalizeAutocorrect,spellcheckConverter}from"../../../internal/converters.js";import{finiteCount}from"../../../internal/numbers.js";import{submitOnEnter}from"../../../internal/submit-on-enter.js";import{dispatchNativeEvent,dispatchNativeInputEvent,relayNativeEvent}from"../../../internal/native-event-relay.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_hidePassword,LYRA_DEFAULT_inputLabel,LYRA_DEFAULT_open,LYRA_DEFAULT_restore,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_showPassword,LYRA_DEFAULT_valueInvalid}from"../../../internal/default-strings.generated.js";const LENGTH_CONSTRAINED_TYPES=["text","password","email","search","tel","url"];class LyraInputBase extends LyraElement{}class LyraInput extends FormAssociated(LyraInputBase){static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,hidePassword:LYRA_DEFAULT_hidePassword,inputLabel:LYRA_DEFAULT_inputLabel,open:LYRA_DEFAULT_open,restore:LYRA_DEFAULT_restore,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,showPassword:LYRA_DEFAULT_showPassword,valueInvalid:LYRA_DEFAULT_valueInvalid}}static{this.styles=[LyraElement.styles,sizes,styles]}get value(){return super.value}set value(next){super.value=next??""}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=normalizeAutocorrect(next);this.requestUpdate()}get inputmode(){return this.inputMode}set inputmode(next){this.inputMode=next??""}get enterkeyhint(){return this.enterKeyHint}set enterkeyhint(next){this.enterKeyHint=next??""}get defaultValueAlias(){return this.defaultValue}set defaultValueAlias(next){this.defaultValue=next??""}constructor(){super();this.type="text";this.size="m";this.appearance="outlined";this.filled=false;this.pill=false;this.placeholder="";this.clearable=false;this.withClear=false;this.readonly=false;this.label="";this.hint="";this.helpText="";this.withLabel=false;this.withHint=false;this.errorText="";this.accessibleLabel=null;this.autocomplete="";this.title="";this.autofocus=false;this.spellcheck=true;this.autocapitalize="";this.autocorrectValue=true;this.inputMode="";this.enterKeyHint="";this.passwordToggle=false;this.passwordVisible=false;this.withoutSpinButtons=false;this.noSpinButtons=false;this.touched=false;this.slotPresence=new SlotPresenceController(this);this.onInput=event=>{if(!this.inputEl)return;this.value=this.inputEl.value;relayNativeEvent(this,event);this.emit("lr-input",{value:this.value})};this.onChange=event=>{if(!this.inputEl)return;this.value=this.inputEl.value;relayNativeEvent(this,event);this.emit("lr-change",{value:this.value})};this.onFocus=event=>{relayNativeEvent(this,event);this.emit("lr-focus")};this.onBlur=event=>{if(!this.effectiveDisabled)this.touched=true;relayNativeEvent(this,event);this.emit("lr-blur")};this.onKeyDown=event=>{if(this.effectiveDisabled||this.readonly)return;submitOnEnter(this,event)};this.onTogglePasswordVisible=()=>{this.passwordVisible=!this.passwordVisible};this.onClear=()=>{if(this.effectiveDisabled||this.readonly||this.value==="")return;this.value="";if(this.inputEl)this.inputEl.value="";dispatchNativeInputEvent(this,{inputType:"deleteContentBackward"});this.emit("lr-input",{value:this.value});dispatchNativeEvent(this,"change");this.emit("lr-change",{value:this.value});this.emit("lr-clear");this.inputEl?.focus()};this.addEventListener("invalid",()=>{this.touched=true})}formResetCallback(){super.formResetCallback();this.touched=false}get input(){return this.inputEl??null}click(){if(!this.effectiveDisabled)this.inputEl?.click()}focus(options){if(!this.effectiveDisabled)this.inputEl?.focus(options)}blur(){this.inputEl?.blur()}select(){this.inputEl?.select()}get valueAsDate(){const native=this.inputEl;if(!native)return null;if(native.value!==this.value)native.value=this.value;return native.valueAsDate}set valueAsDate(next){const native=this.inputEl;if(!native)return;native.valueAsDate=next;this.value=native.value}get valueAsNumber(){const native=this.inputEl;if(!native)return Number.NaN;if(native.value!==this.value)native.value=this.value;return native.valueAsNumber}set valueAsNumber(next){const native=this.inputEl;if(!native)return;native.valueAsNumber=next;this.value=native.value}showPicker(){const native=this.inputEl;if(!native||this.effectiveDisabled||this.readonly)return;if(!("showPicker"in HTMLInputElement.prototype))return;try{native.showPicker()}catch{}}stepUp(steps=1){this.applyStep("up",steps)}stepDown(steps=1){this.applyStep("down",steps)}applyStep(direction,steps){const native=this.inputEl;if(!native||this.effectiveDisabled||this.readonly)return;const count=finiteCount(steps,1);if(count===0)return;try{if(direction==="up")native.stepUp(count);else native.stepDown(count)}catch{return}if(this.value!==native.value)this.value=native.value}get selectionStart(){return this.inputEl?.selectionStart??null}set selectionStart(value){if(this.inputEl)this.inputEl.selectionStart=value??0}get selectionEnd(){return this.inputEl?.selectionEnd??null}set selectionEnd(value){if(this.inputEl)this.inputEl.selectionEnd=value??0}setSelectionRange(selectionStart,selectionEnd,selectionDirection="none"){this.inputEl?.setSelectionRange(selectionStart,selectionEnd,selectionDirection)}setRangeText(replacement,start,end,selectMode="preserve"){const input=this.inputEl;if(!input)return;if(start===void 0||end===void 0){input.setRangeText(replacement)}else{input.setRangeText(replacement,start,end,selectMode)}this.value=input.value}updateValidity(){const native=this.inputEl;if(isBarredFromValidation(this,this.internals)){this[SET_ANCHORED_VALIDITY]({});return}if(!native){if(this.required&&this.value===""){this[SET_ANCHORED_VALIDITY]({valueMissing:true},this.localize("fieldRequired"))}else{this[SET_ANCHORED_VALIDITY]({})}return}if(native.value!==this.value)native.value=this.value;const sanitizedAway=this.value!==""&&native.value==="";const v=native.validity;const own=LENGTH_CONSTRAINED_TYPES.includes(this.type)?lengthViolations(this.value,this.minlength,this.maxlength):{tooShort:false,tooLong:false};const tooShort=v.tooShort||own.tooShort;const tooLong=v.tooLong||own.tooLong;if(v.valid&&!tooShort&&!tooLong){if(sanitizedAway){this[SET_ANCHORED_VALIDITY]({badInput:true},this.localize("valueInvalid"));return}this[SET_ANCHORED_VALIDITY]({});return}this[SET_ANCHORED_VALIDITY]({valueMissing:v.valueMissing,typeMismatch:v.typeMismatch,rangeUnderflow:v.rangeUnderflow,rangeOverflow:v.rangeOverflow,stepMismatch:v.stepMismatch,tooShort,tooLong,patternMismatch:v.patternMismatch,badInput:v.badInput},native.validationMessage||this.localize("valueInvalid"))}updated(changed){super.updated(changed);if(changed.has("value")){if(this.value==="")this.internals.states.add("blank");else this.internals.states.delete("blank")}if(changed.has("type")||changed.has("min")||changed.has("max")||changed.has("step")||changed.has("minlength")||changed.has("maxlength")||changed.has("pattern")||changed.has("readonly")){this.updateValidity()}}renderControls(){return nothing}get inputWrapperParts(){return"base form-control-input input-wrapper"}render(){const hasHint=this.slotPresence.has("hint")||this.slotPresence.has("help-text")||this.hint.length>0||this.helpText.length>0||this.withHint;const hasError=this.slotPresence.has("error")||this.errorText.length>0;const hasLabel=this.slotPresence.has("label")||this.label.length>0||this.withLabel;const describedBy=[hasError?"input-error":"",hasHint?"input-hint":""].filter(Boolean).join(" ");const isPassword=this.type==="password";const showPasswordToggle=isPassword&&this.passwordToggle;const nativeType=isPassword&&this.passwordVisible?"text":this.type;const canClear=(this.clearable||this.withClear)&&(this.type==="text"||this.type==="search")&&this.value!=="";return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{FormAssociated,isBarredFromValidation}from"../../../internal/form-associated.js";import{SET_ANCHORED_VALIDITY}from"../../../internal/anchored-validity.js";import{lengthViolations}from"../../../internal/length-constraints.js";import{closeIcon,eyeIcon,eyeOffIcon}from"../../../internal/icons.js";import{styles}from"./input.styles.js";import{sizes}from"../../../internal/sizes.styles.js";import{autocorrectConverter,normalizeAutocorrect,spellcheckConverter}from"../../../internal/converters.js";import{finiteCount}from"../../../internal/numbers.js";import{submitOnEnter}from"../../../internal/submit-on-enter.js";import{dispatchNativeEvent,dispatchNativeInputEvent,relayNativeEvent}from"../../../internal/native-event-relay.js";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{LYRA_DEFAULT_clear,LYRA_DEFAULT_collapse,LYRA_DEFAULT_date,LYRA_DEFAULT_details,LYRA_DEFAULT_fieldRequired,LYRA_DEFAULT_hidePassword,LYRA_DEFAULT_inputLabel,LYRA_DEFAULT_open,LYRA_DEFAULT_restore,LYRA_DEFAULT_search,LYRA_DEFAULT_select,LYRA_DEFAULT_showPassword,LYRA_DEFAULT_valueInvalid}from"../../../internal/default-strings.generated.js";const LENGTH_CONSTRAINED_TYPES=["text","password","email","search","tel","url"];class LyraInputBase extends LyraElement{}class LyraInput extends FormAssociated(LyraInputBase){static{this.defaultStrings={...super.defaultStrings,clear:LYRA_DEFAULT_clear,collapse:LYRA_DEFAULT_collapse,date:LYRA_DEFAULT_date,details:LYRA_DEFAULT_details,fieldRequired:LYRA_DEFAULT_fieldRequired,hidePassword:LYRA_DEFAULT_hidePassword,inputLabel:LYRA_DEFAULT_inputLabel,open:LYRA_DEFAULT_open,restore:LYRA_DEFAULT_restore,search:LYRA_DEFAULT_search,select:LYRA_DEFAULT_select,showPassword:LYRA_DEFAULT_showPassword,valueInvalid:LYRA_DEFAULT_valueInvalid}}static{this.styles=[LyraElement.styles,sizes,styles]}get value(){return super.value}set value(next){super.value=next??""}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=normalizeAutocorrect(next);this.requestUpdate()}get inputmode(){return this.inputMode}set inputmode(next){this.inputMode=next??""}get enterkeyhint(){return this.enterKeyHint}set enterkeyhint(next){this.enterKeyHint=next??""}get defaultValueAlias(){return this.defaultValue}set defaultValueAlias(next){this.defaultValue=next??""}get inputId(){return this.id||"input"}constructor(){super();this.type="text";this.size="m";this.appearance="outlined";this.filled=false;this.pill=false;this.placeholder="";this.clearable=false;this.withClear=false;this.readonly=false;this.label="";this.hint="";this.helpText="";this.withLabel=false;this.withHint=false;this.errorText="";this.accessibleLabel=null;this.autocomplete="";this.title="";this.autofocus=false;this.spellcheck=true;this.autocapitalize="";this.autocorrectValue=true;this.inputMode="";this.enterKeyHint="";this.passwordToggle=false;this.passwordVisible=false;this.withoutSpinButtons=false;this.noSpinButtons=false;this.touched=false;this.slotPresence=new SlotPresenceController(this);this.onInput=event=>{if(!this.inputEl)return;this.value=this.inputEl.value;relayNativeEvent(this,event);this.emit("lr-input",{value:this.value})};this.onChange=event=>{if(!this.inputEl)return;this.value=this.inputEl.value;relayNativeEvent(this,event);this.emit("lr-change",{value:this.value})};this.onFocus=event=>{relayNativeEvent(this,event);this.emit("lr-focus")};this.onBlur=event=>{if(!this.effectiveDisabled)this.touched=true;relayNativeEvent(this,event);this.emit("lr-blur")};this.onKeyDown=event=>{if(this.effectiveDisabled||this.readonly)return;submitOnEnter(this,event)};this.onTogglePasswordVisible=()=>{this.passwordVisible=!this.passwordVisible};this.onClear=()=>{if(this.effectiveDisabled||this.readonly||this.value==="")return;this.value="";if(this.inputEl)this.inputEl.value="";dispatchNativeInputEvent(this,{inputType:"deleteContentBackward"});this.emit("lr-input",{value:this.value});dispatchNativeEvent(this,"change");this.emit("lr-change",{value:this.value});this.emit("lr-clear");this.inputEl?.focus()};this.addEventListener("invalid",()=>{this.touched=true})}formResetCallback(){super.formResetCallback();this.touched=false}get input(){return this.inputEl??null}click(){if(!this.effectiveDisabled)this.inputEl?.click()}focus(options){if(!this.effectiveDisabled)this.inputEl?.focus(options)}blur(){this.inputEl?.blur()}select(){this.inputEl?.select()}get valueAsDate(){const native=this.inputEl;if(!native)return null;if(native.value!==this.value)native.value=this.value;return native.valueAsDate}set valueAsDate(next){const native=this.inputEl;if(!native)return;native.valueAsDate=next;this.value=native.value}get valueAsNumber(){const native=this.inputEl;if(!native)return Number.NaN;if(native.value!==this.value)native.value=this.value;return native.valueAsNumber}set valueAsNumber(next){const native=this.inputEl;if(!native)return;native.valueAsNumber=next;this.value=native.value}showPicker(){const native=this.inputEl;if(!native||this.effectiveDisabled||this.readonly)return;if(!("showPicker"in HTMLInputElement.prototype))return;try{native.showPicker()}catch{}}stepUp(steps=1){this.applyStep("up",steps)}stepDown(steps=1){this.applyStep("down",steps)}applyStep(direction,steps){const native=this.inputEl;if(!native||this.effectiveDisabled||this.readonly)return;const count=finiteCount(steps,1);if(count===0)return;try{if(direction==="up")native.stepUp(count);else native.stepDown(count)}catch{return}if(this.value!==native.value)this.value=native.value}get selectionStart(){return this.inputEl?.selectionStart??null}set selectionStart(value){if(this.inputEl)this.inputEl.selectionStart=value??0}get selectionEnd(){return this.inputEl?.selectionEnd??null}set selectionEnd(value){if(this.inputEl)this.inputEl.selectionEnd=value??0}setSelectionRange(selectionStart,selectionEnd,selectionDirection="none"){this.inputEl?.setSelectionRange(selectionStart,selectionEnd,selectionDirection)}setRangeText(replacement,start,end,selectMode="preserve"){const input=this.inputEl;if(!input)return;if(start===void 0||end===void 0){input.setRangeText(replacement)}else{input.setRangeText(replacement,start,end,selectMode)}this.value=input.value}updateValidity(){const native=this.inputEl;if(isBarredFromValidation(this,this.internals)){this[SET_ANCHORED_VALIDITY]({});return}if(!native){if(this.required&&this.value===""){this[SET_ANCHORED_VALIDITY]({valueMissing:true},this.localize("fieldRequired"))}else{this[SET_ANCHORED_VALIDITY]({})}return}if(native.value!==this.value)native.value=this.value;const sanitizedAway=this.value!==""&&native.value==="";const v=native.validity;const own=LENGTH_CONSTRAINED_TYPES.includes(this.type)?lengthViolations(this.value,this.minlength,this.maxlength):{tooShort:false,tooLong:false};const tooShort=v.tooShort||own.tooShort;const tooLong=v.tooLong||own.tooLong;if(v.valid&&!tooShort&&!tooLong){if(sanitizedAway){this[SET_ANCHORED_VALIDITY]({badInput:true},this.localize("valueInvalid"));return}this[SET_ANCHORED_VALIDITY]({});return}this[SET_ANCHORED_VALIDITY]({valueMissing:v.valueMissing,typeMismatch:v.typeMismatch,rangeUnderflow:v.rangeUnderflow,rangeOverflow:v.rangeOverflow,stepMismatch:v.stepMismatch,tooShort,tooLong,patternMismatch:v.patternMismatch,badInput:v.badInput},native.validationMessage||this.localize("valueInvalid"))}updated(changed){super.updated(changed);if(changed.has("value")){if(this.value==="")this.internals.states.add("blank");else this.internals.states.delete("blank")}if(changed.has("type")||changed.has("min")||changed.has("max")||changed.has("step")||changed.has("minlength")||changed.has("maxlength")||changed.has("pattern")||changed.has("readonly")){this.updateValidity()}}renderControls(){return nothing}get inputWrapperParts(){return"base form-control-input input-wrapper"}render(){const hasHint=this.slotPresence.has("hint")||this.slotPresence.has("help-text")||this.hint.length>0||this.helpText.length>0||this.withHint;const hasError=this.slotPresence.has("error")||this.errorText.length>0;const hasLabel=this.slotPresence.has("label")||this.label.length>0||this.withLabel;const describedBy=[hasError?"input-error":"",hasHint?"input-hint":""].filter(Boolean).join(" ");const isPassword=this.type==="password";const showPasswordToggle=isPassword&&this.passwordToggle;const nativeType=isPassword&&this.passwordVisible?"text":this.type;const canClear=(this.clearable||this.withClear)&&(this.type==="text"||this.type==="search")&&this.value!=="";return html`
2
2
  <div part="form-control">
3
- <label part="form-control-label" for="input" ?hidden=${!hasLabel}>
3
+ <label part="form-control-label" for=${this.inputId} ?hidden=${!hasLabel}>
4
4
  <span part="label">${this.label}<slot name="label"></slot></span>
5
5
  </label>
6
6
  <div part=${this.inputWrapperParts}>
@@ -12,9 +12,10 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
12
12
  <slot part="prefix" name="prefix"></slot>
13
13
  </span>
14
14
  <input
15
- id="input"
15
+ id=${this.inputId}
16
16
  part="input"
17
17
  type=${nativeType}
18
+ name=${this.name||nothing}
18
19
  placeholder=${this.placeholder}
19
20
  title=${this.title||nothing}
20
21
  aria-label=${this.accessibleLabel||(hasLabel?nothing:this.placeholder||this.localize("inputLabel"))}
@@ -2,6 +2,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
2
2
  :host {
3
3
  display: block;
4
4
  container-type: inline-size;
5
+ contain-intrinsic-inline-size: var(--lr-size-12rem);
5
6
  }
6
7
 
7
8
  [part~='form-control-label'] {
@@ -5,15 +5,10 @@ import{css}from"lit";const styles=css`
5
5
  group's own allocated width (a sidebar, a split pane, a dialog) instead of the
6
6
  viewport's — a group can be narrow on a wide screen and vice versa. */
7
7
  container-type: inline-size;
8
- /* Floors the host so a shrink-to-fit flex/grid parent (which gives inline-flex children a 0
9
- basis, not their content size, absent an explicit width) can't collapse it to ~0 -- a group
10
- with no explicit width must still render its buttons. NOTE: this can't be a content-based
11
- keyword (fit-content/max-content/auto) -- container-type implies inline-size containment on
12
- *this* box, and per the CSS Containment spec a size-contained box's content-dependent sizing
13
- resolves as if it had no content at all (verified in Chromium: fit-content collapsed to the
14
- same 0 this rule exists to prevent). Only a length/token floor survives containment, so this
15
- reuses the hit-area floor already used as a "smallest a control should ever be" minimum
16
- throughout the library instead of inventing a group-specific magic number. */
8
+ /* Size containment removes content-based intrinsic sizing. This compact fallback keeps an
9
+ unallocated group wide enough to lay out ordinary actions and lets its narrow query wrap
10
+ longer sets; the hit-area minimum remains the hard lower bound under tighter allocation. */
11
+ contain-intrinsic-inline-size: var(--lr-size-12rem);
17
12
  min-inline-size: var(--lr-icon-button-size);
18
13
  max-inline-size: 100%;
19
14
  vertical-align: middle;
@@ -3,6 +3,10 @@ import{css}from"lit";const styles=css`
3
3
  display: block;
4
4
  min-inline-size: 0;
5
5
  container-type: inline-size;
6
+ /* Inline-size containment deliberately removes content-based intrinsic sizing. Supply the
7
+ centered/shrink-to-fit fallback that lets a standalone card remain visible while definite
8
+ allocations (grid tracks, percentages, explicit inline-size) continue to win normally. */
9
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
6
10
  }
7
11
  [part="base"] {
8
12
  position: relative;
@@ -3,6 +3,7 @@ import{css}from"lit";const styles=css`
3
3
  display: block;
4
4
  min-inline-size: 0;
5
5
  container-type: inline-size;
6
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
6
7
  }
7
8
 
8
9
  [part~="base"] {
@@ -12,6 +12,7 @@ import{css}from"lit";const styles=css`
12
12
  responsive property. */
13
13
  :host([responsive]) {
14
14
  container-type: inline-size;
15
+ contain-intrinsic-inline-size: var(--lr-size-12rem);
15
16
  }
16
17
 
17
18
  [part='base'] {
@@ -5,6 +5,7 @@ import{css}from"lit";const styles=css`
5
5
  size (a dashboard-grid is commonly embedded in a panel of varying width, not the viewport)
6
6
  -- same convention as lr-button-group/lr-control-group's own container-query approach. */
7
7
  container-type: inline-size;
8
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
8
9
  min-inline-size: 0;
9
10
  }
10
11
 
@@ -10,6 +10,7 @@ import{css}from"lit";const styles=css`
10
10
  min-inline-size: 0;
11
11
  color: var(--lr-color-text);
12
12
  container-type: inline-size;
13
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
13
14
  }
14
15
 
15
16
  [part~='page'] {
@@ -13,6 +13,7 @@ import{css}from"lit";const styles=css`
13
13
  inset: 0;
14
14
  z-index: var(--lr-overlay-stack-index, var(--lr-layer-modal));
15
15
  container-type: inline-size;
16
+ contain-intrinsic-inline-size: var(--lr-size-20rem);
16
17
  padding-block-start: max(var(--lr-space-l), var(--lr-safe-area-top));
17
18
  padding-block-end: max(var(--lr-space-l), var(--lr-safe-area-bottom));
18
19
  padding-inline-start: max(var(--lr-space-l), var(--lr-safe-area-inline-start));
@@ -64,8 +64,8 @@ export interface MaplibreModule {
64
64
  /**
65
65
  * Lazily loads the optional peer dependency `maplibre-gl` once per page.
66
66
  * Resolves to `null` (with a one-time warning) if it isn't installed —
67
- * mirrors `<lr-flag>`'s peer-dependency pattern. Consumers must separately
68
- * import `maplibre-gl/dist/maplibre-gl.css`. MapLibre v6 consumers also configure its module-worker
69
- * URL for their bundler once they install the peer; v5's standard build includes its worker.
67
+ * mirrors `<lr-flag>`'s peer-dependency pattern. `<lr-map>` supplies the styles for MapLibre's
68
+ * generated DOM inside its shadow root. MapLibre v6 consumers also configure its module-worker URL
69
+ * for their bundler once they install the peer; v5's standard build includes its worker.
70
70
  */
71
71
  export declare function loadMaplibre(): Promise<MaplibreModule | null>;
@@ -1 +1 @@
1
- import{resolveOptionalPeerCapability,unwrapOptionalPeerDefault}from"../../../internal/optional-peer-capabilities.js";const MAP_METHODS=["getCenter","getZoom","setCenter","setZoom","resize","remove","on","once","setStyle","getSource","addSource","removeSource","getLayer","addLayer","removeLayer","setPaintProperty","queryRenderedFeatures"];const MARKER_METHODS=["setLngLat","setPopup","getPopup","addTo","remove"];const POPUP_METHODS=["setHTML","setText"];function isObjectLike(value){return(typeof value==="object"||typeof value==="function")&&value!==null}function isConstructor(value){if(typeof value!=="function")return false;try{Reflect.construct(Object,[],value);return true}catch{return false}}function missingConstructorCapability(module,name,methods){const Constructor=module[name];if(!isConstructor(Constructor))return name;const prototype=Constructor.prototype;if(!isObjectLike(prototype))return`${name}.prototype`;for(const method of methods){if(typeof prototype[method]!=="function")return`${name}.prototype.${method}`}return void 0}function missingMaplibreCapability(candidate){if(!isObjectLike(candidate))return"module namespace";return missingConstructorCapability(candidate,"Map",MAP_METHODS)??missingConstructorCapability(candidate,"Marker",MARKER_METHODS)??missingConstructorCapability(candidate,"Popup",POPUP_METHODS)}function isMaplibreModule(candidate){return missingMaplibreCapability(candidate)===void 0}function resolveMaplibreModule(value){const module=resolveOptionalPeerCapability(value,isMaplibreModule);if(module)return module;const candidate=unwrapOptionalPeerDefault(value);const missing=missingMaplibreCapability(candidate)??"module namespace";throw new Error(`Invalid optional peer \`maplibre-gl\`: missing or invalid \`${missing}\` capability.`)}let maplibre;async function loadMaplibreModule(importer=()=>import("maplibre-gl")){try{return resolveMaplibreModule(await importer())}catch(error){console.warn("<lr-map> needs the optional peer dependency `maplibre-gl` \u2014 install it with `pnpm add maplibre-gl` and import `maplibre-gl/dist/maplibre-gl.css` once in your app.",error);return null}}function loadMaplibre(){if(!maplibre){maplibre=loadMaplibreModule()}return maplibre}export{loadMaplibre,loadMaplibreModule};
1
+ import{resolveOptionalPeerCapability,unwrapOptionalPeerDefault}from"../../../internal/optional-peer-capabilities.js";const MAP_METHODS=["getCenter","getZoom","setCenter","setZoom","resize","remove","on","once","setStyle","getSource","addSource","removeSource","getLayer","addLayer","removeLayer","setPaintProperty","queryRenderedFeatures"];const MARKER_METHODS=["setLngLat","setPopup","getPopup","addTo","remove"];const POPUP_METHODS=["setHTML","setText"];function isObjectLike(value){return(typeof value==="object"||typeof value==="function")&&value!==null}function isConstructor(value){if(typeof value!=="function")return false;try{Reflect.construct(Object,[],value);return true}catch{return false}}function missingConstructorCapability(module,name,methods){const Constructor=module[name];if(!isConstructor(Constructor))return name;const prototype=Constructor.prototype;if(!isObjectLike(prototype))return`${name}.prototype`;for(const method of methods){if(typeof prototype[method]!=="function")return`${name}.prototype.${method}`}return void 0}function missingMaplibreCapability(candidate){if(!isObjectLike(candidate))return"module namespace";return missingConstructorCapability(candidate,"Map",MAP_METHODS)??missingConstructorCapability(candidate,"Marker",MARKER_METHODS)??missingConstructorCapability(candidate,"Popup",POPUP_METHODS)}function isMaplibreModule(candidate){return missingMaplibreCapability(candidate)===void 0}function resolveMaplibreModule(value){const module=resolveOptionalPeerCapability(value,isMaplibreModule);if(module)return module;const candidate=unwrapOptionalPeerDefault(value);const missing=missingMaplibreCapability(candidate)??"module namespace";throw new Error(`Invalid optional peer \`maplibre-gl\`: missing or invalid \`${missing}\` capability.`)}let maplibre;async function loadMaplibreModule(importer=()=>import("maplibre-gl")){try{return resolveMaplibreModule(await importer())}catch(error){console.warn("<lr-map> needs the optional peer dependency `maplibre-gl` \u2014 install it with `pnpm add maplibre-gl`.",error);return null}}function loadMaplibre(){if(!maplibre){maplibre=loadMaplibreModule()}return maplibre}export{loadMaplibre,loadMaplibreModule};
@@ -88,8 +88,9 @@ export interface LyraMapEventMap {
88
88
  * independent of `choropleth`'s field/stops color-interpolation), plus a peer-neutral
89
89
  * `map` getter for common imperative operations. Its runtime value is the underlying MapLibre
90
90
  * map, while its declaration stays independent of the optional peer. Requires `maplibre-gl`
91
- * v5 or v6 (consumers also import its CSS). MapLibre v6 is ESM-only, requires WebGL2, and needs
92
- * its module-worker URL configured once; v5's standard build includes its worker.
91
+ * v5 or v6; the component styles MapLibre's generated canvas, marker, popup, and control DOM
92
+ * inside its shadow root. MapLibre v6 is ESM-only, requires WebGL2, and needs its module-worker
93
+ * URL configured once; v5's standard build includes its worker.
93
94
  *
94
95
  * The underlying `maplibregl.Map` — and the WebGL context it opens — isn't
95
96
  * constructed until this element is first visible in the viewport (tracked