@material/web 2.4.1 → 2.4.2-nightly.563da62.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.
@@ -218,6 +218,10 @@ export class Field extends LitElement {
218
218
  if (wasFloating === shouldBeFloating) {
219
219
  return;
220
220
  }
221
+ const keyframes = this.getLabelKeyframes();
222
+ if (!keyframes.length) {
223
+ return;
224
+ }
221
225
  this.isAnimating = true;
222
226
  this.labelAnimation?.cancel();
223
227
  // Only one label is visible at a time for clearer text rendering.
@@ -232,7 +236,10 @@ export class Field extends LitElement {
232
236
  // Re-calculating the animation each time will prevent any visual glitches
233
237
  // from appearing.
234
238
  // TODO(b/241113345): use animation tokens
235
- this.labelAnimation = this.floatingLabelEl?.animate(this.getLabelKeyframes(), { duration: 150, easing: EASING.STANDARD });
239
+ this.labelAnimation = this.floatingLabelEl?.animate(keyframes, {
240
+ duration: 150,
241
+ easing: EASING.STANDARD,
242
+ });
236
243
  this.labelAnimation?.addEventListener('finish', () => {
237
244
  // At the end of the animation, update the visible label.
238
245
  this.isAnimating = false;
@@ -247,6 +254,10 @@ export class Field extends LitElement {
247
254
  const { x: restingX, y: restingY, height: restingHeight, } = restingLabelEl.getBoundingClientRect();
248
255
  const floatingScrollWidth = floatingLabelEl.scrollWidth;
249
256
  const restingScrollWidth = restingLabelEl.scrollWidth;
257
+ // If either label has no dimensions (e.g., display: none), skip animation
258
+ if (floatingScrollWidth === 0 || restingScrollWidth === 0) {
259
+ return [];
260
+ }
250
261
  // Scale by width ratio instead of font size since letter-spacing will scale
251
262
  // incorrectly. Using the width we can better approximate the adjusted
252
263
  // scale and compensate for tracking and overflow.
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GAEP,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,QAAQ,E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,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()}\n <slot name=\"container\"></slot>\n ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderStateLayer?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(),\n {duration: 150, easing: EASING.STANDARD},\n );\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GAEP,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,oCAAoC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAC/B,UAAK,GAAG,EAAE,CAAC;QAC8B,eAAU,GAAG,KAAK,CAAC;QAC7C,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;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I,EAAE,OAAO,EAAC,CAAC;uCAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAmB;AACH;IAAzC,QAAQ,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAC,CAAC;6CAAqB;AACzB;IAApC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;wCAAgB;AAC1B;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;oCAAY;AACX;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kCAAU;AAKgB;IAAlD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAC,CAAC;uCAAkB;AAKnB;IAAhD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC;qCAAgB;AAG/C;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC;qDACM;AAmBvC;IAAhB,KAAK,EAAE;0CAA6B;AAOpB;IAAhB,KAAK,EAAE;gDAAmC;AAC1B;IAAhB,KAAK,EAAE;iDAAoC;AAE3B;IADhB,KAAK,CAAC,iBAAiB,CAAC;8CAC6B;AACZ;IAAzC,KAAK,CAAC,gBAAgB,CAAC;6CAAsD;AACxC;IAArC,KAAK,CAAC,YAAY,CAAC;0CAAmD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n html,\n LitElement,\n nothing,\n PropertyValues,\n render,\n TemplateResult,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()}\n <slot name=\"container\"></slot>\n ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderStateLayer?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n const keyframes = this.getLabelKeyframes();\n if (!keyframes.length) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(keyframes, {\n duration: 150,\n easing: EASING.STANDARD,\n });\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // If either label has no dimensions (e.g., display: none), skip animation\n if (floatingScrollWidth === 0 || restingScrollWidth === 0) {\n return [];\n }\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
@@ -9,7 +9,7 @@
9
9
  @use 'sass:string';
10
10
  // go/keep-sorted end
11
11
  // go/keep-sorted start
12
- @use './string-ext';
12
+ @use '../../sass/ext/string_ext';
13
13
  // go/keep-sorted end
14
14
 
15
15
  /// Creates a custom property `var()` string.
@@ -51,7 +51,7 @@
51
51
  /// @param {String} $name - The name of the custom property.
52
52
  /// @return {String} The full valid CSS custom property variable name.
53
53
  @function create-name($name) {
54
- @if string-ext.has-prefix($name, '--') {
54
+ @if string_ext.starts-with($name, '--') {
55
55
  @return $name;
56
56
  }
57
57
 
@@ -173,7 +173,8 @@
173
173
  /// @return {Bool} True if the value is a custom property `var()` string, or
174
174
  /// false if not.
175
175
  @function _is-var-string($var) {
176
- @return meta.type-of($var) == 'string' and string-ext.has-prefix($var, 'var(');
176
+ @return meta.type-of($var) == 'string' and
177
+ string_ext.starts-with($var, 'var(');
177
178
  }
178
179
 
179
180
  /// Parses a `var()` string into a Map with `name` and `fallback` keys. This
@@ -197,14 +198,15 @@
197
198
  }
198
199
 
199
200
  // Remove function name and parens
200
- $var: string-ext.trim($var, 'var(', ')');
201
+ $var: string_ext.replace-start($var, 'var(', '');
202
+ $var: string_ext.replace-end($var, ')', '');
201
203
 
202
- $name: string-ext.trim-repeating($var, ' ');
204
+ $name: string_ext.trim($var);
203
205
  $fallback: null;
204
206
  $comma: string.index($var, ',');
205
207
  @if $comma != null {
206
- $name: string-ext.trim-repeating(string.slice($var, 1, $comma - 1), ' ');
207
- $fallback: string-ext.trim-repeating(string.slice($var, $comma + 1), ' ');
208
+ $name: string_ext.trim(string.slice($var, 1, $comma - 1));
209
+ $fallback: string_ext.trim(string.slice($var, $comma + 1));
208
210
  @if _is-var-string($fallback) {
209
211
  $fallback: _parse($fallback);
210
212
  @if $fallback == null {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@material/web",
3
- "version": "2.4.1",
3
+ "version": "2.4.2-nightly.563da62.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -0,0 +1,82 @@
1
+ //
2
+ // Copyright 2025 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ // Utility assert functions that throw errors.
7
+
8
+ // go/keep-sorted start by_regex='(.+) prefix_order=sass:
9
+ @use 'sass:meta';
10
+ @use 'throw';
11
+ @use 'type';
12
+ // go/keep-sorted end
13
+
14
+ /// Asserts that the argument is a specific type. If it is, the argument is
15
+ /// returned, otherwise an error is thrown.
16
+ ///
17
+ /// @example scss
18
+ /// @mixin multiply($a, $b) {
19
+ /// $a: assert.is-type($a, 'number');
20
+ /// $b: assert.is-type($b, 'number');
21
+ /// @return $a * $b;
22
+ /// }
23
+ ///
24
+ /// @function is-empty($value) {
25
+ /// $value: assert.is-type(
26
+ /// $value,
27
+ /// 'list|map|null',
28
+ /// $message: '$value must be a list, map, or null',
29
+ /// $source: 'is-empty'
30
+ /// );
31
+ /// @return $value and list.length($value) == 0;
32
+ /// }
33
+ ///
34
+ /// @param {*} $arg - The argument to check.
35
+ /// @param {string} $type - The string type to assert the argument matches.
36
+ /// Multiple types may be separated by '|'.
37
+ /// @param {string} $message - Optional custom error message.
38
+ /// @param {string} $source - Optional source of the error message.
39
+ /// @return {*} The argument if it matches the type string.
40
+ /// @throw Error if the argument does not match the type string.
41
+ @function is-type(
42
+ $arg,
43
+ $type,
44
+ $message: 'Argument must be type #{meta.inspect($type)}. $arg: #{meta.inspect($arg)}',
45
+ $source: 'assert.is-type'
46
+ ) {
47
+ @if type.matches($arg, $type) {
48
+ @return $arg;
49
+ }
50
+ @return throw.error($message, $source);
51
+ }
52
+
53
+ /// Asserts that the argument is a specific type. If it is, the argument is
54
+ /// returned, otherwise an error is thrown.
55
+ ///
56
+ /// @example scss
57
+ /// @function get-or-throw($map, $key) {
58
+ /// @return assert.not-type(
59
+ /// map.get($map, $key),
60
+ /// 'null',
61
+ /// $message: 'Key must be in the map'
62
+ /// );
63
+ /// }
64
+ ///
65
+ /// @param {*} $arg - The argument to check.
66
+ /// @param {string} $type - The string type to assert the argument does not
67
+ /// match. Multiple types may be separated by '|'.
68
+ /// @param {string} $message - Optional custom error message.
69
+ /// @param {string} $source - Optional source of the error message.
70
+ /// @return {*} The argument if it does not match the type string.
71
+ /// @throw Error if the argument matches the type string.
72
+ @function not-type(
73
+ $arg,
74
+ $type,
75
+ $message: 'Argument may not be type #{meta.inspect($type)}. $arg: #{meta.inspect($arg)}',
76
+ $source: 'assert.not-type'
77
+ ) {
78
+ @if type.matches($arg, $type) {
79
+ @return throw.error($message, $source);
80
+ }
81
+ @return $arg;
82
+ }
@@ -0,0 +1,153 @@
1
+ //
2
+ // Copyright 2021 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ // Extensions to the go/sass:string built-in module.
7
+
8
+ // go/keep-sorted start by_regex='(.+) prefix_order=sass:
9
+ @use 'sass:list';
10
+ @use 'sass:string';
11
+ // go/keep-sorted end
12
+
13
+ /// Checks if a string starts with a given prefix.
14
+ ///
15
+ /// @example scss
16
+ /// @debug string_ext.starts-with('var(--foo)', 'var('); // true
17
+ ///
18
+ /// @param {string} $string - The string to test.
19
+ /// @param {string} $prefix - The prefix to check.
20
+ /// @return {boolean} True if the string starts with the given prefix.
21
+ @function starts-with($string, $prefix) {
22
+ @return string.slice($string, 1, string.length($prefix)) == $prefix;
23
+ }
24
+
25
+ /// Checks if a string ends with a given suffix.
26
+ ///
27
+ /// @example scss
28
+ /// @debug string_ext.ends-with('var(--foo)', ')'); // true
29
+ ///
30
+ /// @param {string} $string - The string to test.
31
+ /// @param {string} $suffix - The suffix to check.
32
+ /// @return {boolean} True if the string ends with the given suffix.
33
+ @function ends-with($string, $suffix) {
34
+ @return string.slice($string, -1 * string.length($suffix)) == $suffix;
35
+ }
36
+
37
+ /// Trims leading whitespace from the start of a string.
38
+ ///
39
+ /// @example scss
40
+ /// @debug string_ext.trim-start(' foo bar '); // "foo bar "
41
+ ///
42
+ /// @param {string} $string - The string to trim.
43
+ /// @return {string} The string with whitespace trimmed from the start.
44
+ @function trim-start($string) {
45
+ @while starts-with($string, ' ') {
46
+ $string: replace-start($string, ' ', '');
47
+ }
48
+
49
+ @return $string;
50
+ }
51
+
52
+ /// Trims trailing whitespace from the end of a string.
53
+ ///
54
+ /// @example scss
55
+ /// @debug string_ext.trim-end(' foo bar '); // " foo bar"
56
+ ///
57
+ /// @param {string} $string - The string to trim.
58
+ /// @return {string} The string with trailing whitespace trimmed from the end.
59
+ @function trim-end($string) {
60
+ @while ends-with($string, ' ') {
61
+ $string: replace-end($string, ' ', '');
62
+ }
63
+
64
+ @return $string;
65
+ }
66
+
67
+ /// Trims leading and trailing whitespace from a string.
68
+ ///
69
+ /// @example scss
70
+ /// @debug string_ext.trim(' foo bar '); // "foo bar"
71
+ ///
72
+ /// @param {string} $string - The string to trim.
73
+ /// @return {string} The string with leading and trailing whitespace trimmed.
74
+ @function trim($string) {
75
+ @return trim-start(trim-end($string));
76
+ }
77
+
78
+ /// Returns a new string with the first match of a pattern replaced by a given
79
+ /// string.
80
+ ///
81
+ /// @example scss
82
+ /// @debug string_ext.replace('foo bar baz', 'bar', 'quux'); // "foo quux baz"
83
+ ///
84
+ /// @param {string} $string - The string to be searched.
85
+ /// @param {string} $pattern - The pattern to search for.
86
+ /// @param {string} $replacement - The value to replace the pattern.
87
+ /// @return {string} The string with the first match of pattern replaced by the
88
+ /// replacement or the initial string itself.
89
+ @function replace($string, $pattern, $replacement) {
90
+ $pattern-index: string.index($string, $pattern);
91
+ @if not $pattern-index {
92
+ @return $string;
93
+ }
94
+
95
+ $before: string.slice($string, 1, $pattern-index - 1);
96
+ $after: string.slice($string, string.length($pattern) + $pattern-index);
97
+
98
+ @return $before + $replacement + $after;
99
+ }
100
+
101
+ /// Returns a new string with all matches of a pattern replaced by a given
102
+ /// string.
103
+ ///
104
+ /// @example scss
105
+ /// @debug string_ext.replace-all('foo bar baz', 'ba', 'qua'); // "foo quar quaz"
106
+ ///
107
+ /// @param {string} $string - The string to be searched.
108
+ /// @param {string} $pattern - The pattern to search for.
109
+ /// @param {string} $replacement - The value to replace the pattern.
110
+ /// @return {string} The string with all matches of pattern replaced by the
111
+ /// replacement or the initial string itself.
112
+ @function replace-all($string, $pattern, $replacement) {
113
+ @while string.index($string, $pattern) {
114
+ $string: replace($string, $pattern, $replacement);
115
+ }
116
+
117
+ @return $string;
118
+ }
119
+
120
+ /// Returns a new string that replaces a prefix at the start of the string.
121
+ ///
122
+ /// @example scss
123
+ /// @debug string_ext.replace-start('var(--foo)', 'var(', ''); // "--foo)"
124
+ ///
125
+ /// @param {string} $string - The string to be searched.
126
+ /// @param {string} $prefix - The prefix string to replace.
127
+ /// @param {string} $replacement - The value to replace the prefix.
128
+ /// @return {string} The string with the prefix replaced.
129
+ @function replace-start($string, $prefix, $replacement) {
130
+ @if starts-with($string, $prefix) {
131
+ $string: $replacement + string.slice($string, string.length($prefix) + 1);
132
+ }
133
+
134
+ @return $string;
135
+ }
136
+
137
+ /// Returns a new string that replaces a suffix at the end of the string.
138
+ ///
139
+ /// @example scss
140
+ /// @debug string_ext.replace-end('var(--foo)', ')', ''); // "var(--foo"
141
+ ///
142
+ /// @param {string} $string - The string to be searched.
143
+ /// @param {string} $suffix - The suffix string to replace.
144
+ /// @param {string} $replacement - The value to replace the suffix.
145
+ /// @return {string} The string with the suffix trimmed from the end.
146
+ @function replace-end($string, $suffix, $replacement) {
147
+ @if ends-with($string, $suffix) {
148
+ $string: string.slice($string, 1, -1 * string.length($suffix) - 1) +
149
+ $replacement;
150
+ }
151
+
152
+ @return $string;
153
+ }
@@ -0,0 +1,83 @@
1
+ //
2
+ // Copyright 2025 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ // Utilities for `sass-true` errors, to support testing error behavior.
7
+
8
+ // go/keep-sorted start by_regex='(.+) prefix_order=sass:
9
+ @use 'sass:meta';
10
+ @use 'sass:string';
11
+ // go/keep-sorted end
12
+
13
+ @forward 'true' show error;
14
+
15
+ /// Returns false if none of the given values are error strings, or returns an
16
+ /// error string if any value has an error.
17
+ ///
18
+ /// This is used to support testing error behavior with `sass-true`, since
19
+ /// `@error` messages cannot be caught at build time.
20
+ ///
21
+ /// @example scss
22
+ /// // A function that may return an "ERROR:" string in a test.
23
+ /// @function get-value($map, $key) {
24
+ /// @if meta.type-of($map) != 'map' {
25
+ /// // Identical to `@error 'ERROR: Arg is not a map'` outside of tests.
26
+ /// @return throw.error('Arg is not a map');
27
+ /// }
28
+ /// @return map.get($map, $key);
29
+ /// }
30
+ ///
31
+ /// // A function that needs to handle potential errors from other functions.
32
+ /// @function mix-primary-on-surface($values) {
33
+ /// $primary: get-value($values, 'primary');
34
+ /// $surface: get-value($values, 'surface');
35
+ /// $error: throw.get-error($primary, $secondary);
36
+ /// @if $error {
37
+ /// // Return early to guard logic against additional errors since
38
+ /// // $primary or $secondary may be a string instead of a color.
39
+ /// @return $error;
40
+ /// }
41
+ ///
42
+ /// @return color.mix($primary, $surface, 10%);
43
+ /// }
44
+ ///
45
+ /// Note: `throw.error()` and `throw.get-error()` are only useful when testing
46
+ /// error behavior using `sass-true`. If you are not testing a function, use
47
+ /// `@error` instead.
48
+ ///
49
+ /// @example scss
50
+ /// // In a `sass-true` test, `throw.get-error()` can be used to assert that
51
+ /// // an error is thrown.
52
+ /// @use 'true' as test with ($catch-errors: true);
53
+ ///
54
+ /// @include test.describe('module.get-value()') {
55
+ /// @include test.it('throws an error if the value is not a map') {
56
+ /// $result: module.get-value('not a map', 'primary');
57
+ /// @include test.assert-truthy(throw.get-error($result), '$result is an error');
58
+ /// }
59
+ /// }
60
+ ///
61
+ /// @param {*} $error - The value to check.
62
+ /// @param {list} $errors - Additional values to check. Useful for checking
63
+ /// multiple errors at the same time.
64
+ /// @return {string|boolean} The error string if any value is an error, or false
65
+ /// otherwise.
66
+ @function get-error($error, $errors...) {
67
+ @if _is-error($error) {
68
+ @return $error;
69
+ }
70
+
71
+ @each $additional-error in $errors {
72
+ @if _is-error($additional-error) {
73
+ @return $additional-error;
74
+ }
75
+ }
76
+
77
+ @return false;
78
+ }
79
+
80
+ @function _is-error($error) {
81
+ @return (meta.type-of($error) == 'string') and
82
+ (string.index($error, 'ERROR') == 1);
83
+ }
@@ -0,0 +1,66 @@
1
+ //
2
+ // Copyright 2025 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ // Utilities for Sass type checking.
7
+
8
+ // go/keep-sorted start by_regex='(.+) prefix_order=sass:
9
+ @use 'sass:meta';
10
+ @use 'sass:string';
11
+ @use 'throw';
12
+ // go/keep-sorted end
13
+
14
+ /// Returns true if the given value matches the provided type string.
15
+ ///
16
+ /// The type string supports multiple types separated by `|`, such as
17
+ /// `'string|null'`. Type options are any values returned by `meta.type-of()`.
18
+ ///
19
+ /// @example scss
20
+ /// @function is-empty($value) {
21
+ /// @if type.matches($value, 'list|map') {
22
+ /// @return list.length($value) == 0;
23
+ /// }
24
+ /// @if type.matches($value, 'string') {
25
+ /// @return $value == '';
26
+ /// }
27
+ /// @return type.matches($value, 'null');
28
+ /// }
29
+ ///
30
+ /// @param {*} $value - The value to check the type of.
31
+ /// @param {string} $type-string - The type to check. May be multiple types
32
+ /// separated by `|`.
33
+ /// @return {boolean} True if the value matches the type string.
34
+ @function matches($value, $type-string) {
35
+ @if meta.type-of($type-string) != 'string' or $type-string == '' {
36
+ @return throw.error(
37
+ '$type-string must be a non-empty string',
38
+ $source: 'type.matches'
39
+ );
40
+ }
41
+ @if string.index($type-string, ' ') {
42
+ @return throw.error(
43
+ '$type-string may not contain spaces',
44
+ $source: 'type.matches'
45
+ );
46
+ }
47
+ @if string.index($type-string, 'boolean') {
48
+ @return throw.error(
49
+ 'Use "bool" instead of "boolean"',
50
+ $source: 'type.matches'
51
+ );
52
+ }
53
+
54
+ $value-type: meta.type-of($value);
55
+ @if $value-type == $type-string {
56
+ @return true;
57
+ }
58
+
59
+ @each $type in string.split($type-string, '|') {
60
+ @if $value-type == $type {
61
+ @return true;
62
+ }
63
+ }
64
+
65
+ @return false;
66
+ }
@@ -0,0 +1 @@
1
+ /*# sourceMappingURL=tests.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":[],"names":[],"mappings":"","file":"tests.css"}
@@ -0,0 +1,15 @@
1
+ //
2
+ // Copyright 2021 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ @use 'true' as test with (
7
+ $catch-errors: true
8
+ );
9
+
10
+ // go/keep-sorted start
11
+ @use 'assert_test';
12
+ @use 'string_ext_test';
13
+ @use 'throw_test';
14
+ @use 'type_test';
15
+ // go/keep-sorted end
@@ -121,6 +121,7 @@ $_md-sys-shape: tokens.md-sys-shape-values();
121
121
  pointer-events: none;
122
122
  // ensure scrolling is prevented on mobile.
123
123
  touch-action: none;
124
+ user-select: none;
124
125
  }
125
126
 
126
127
  .track,
@@ -1 +1 @@
1
- :host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:"";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:"";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}/*# sourceMappingURL=slider-styles.css.map */
1
+ :host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none;user-select:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:"";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:"";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}/*# sourceMappingURL=slider-styles.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["_slider.scss","../../elevation/internal/_elevation.scss","../../ripple/internal/_ripple.scss"],"names":[],"mappings":"AA6DE,MAEI,owHAIF,qBACA,mBACA,iBAEA,oBACA,sBACA,sBCnDE,wGD6DJ,cACE,YACA,YACA,WAGF,aACE,0BAIF,+BACE,OACE,uBAOJ,kBACE,8CClFE,wDD2FJ,WACE,OACA,aACA,mBACA,kBACA,oCAEA,oBAEA,kBAGF,kBAEE,kBACA,QACA,aACA,mBAIF,kEAKE,kBACA,WAKA,mBAHiB,0EAIjB,iBAJiB,0EAOjB,gGAOF,kCAEE,yCACA,2CAGF,eACE,wCAGF,mBACE,+SAKF,iCAGE,8FAIA,iDAIF,gCAEE,uCACA,yCACA,iXAGF,cACE,sCAGF,kBACE,2SAMF,uBACE,iXAGF,2BACE,iXAGF,gCACE,+CAGF,qCACE,+SAWF,uBACE,kBACA,gBACA,iBACA,gDAGF,sBACE,kBACA,gBACA,iBAGF,iBACE,kBACA,oBACA,kBACA,qDACA,uEAIF,QACE,kBACA,oCACA,qCACA,mCACA,aACA,qBACA,mBAGF,WACE,kBACA,6BACA,2BACA,mCACA,gCAGF,6BACE,yCAGF,gIAEE,sCAIF,2DACE,sCAIA,kLAEE,wCAKF,gEAEE,kGAIF,gCACE,iGAKJ,cACE,0DAEF,YACE,wDAIF,OACE,kBACA,sBACA,aACA,YACA,qBACA,mBACA,sDAEA,+BACA,oCACA,kCACA,2CACA,sCAEA,qBACA,+CACA,8CACA,yCACA,sDAEA,+BACA,mBAKF,4FAGE,mBAGF,6BAEE,kBACA,cACA,WACA,mBAIF,eAGE,YADgB,uCAEhB,WAFgB,uCAGhB,gDACA,wBAIF,cACE,UACA,sBAIF,cACE,UAOF,kBACE,UACA,0CACA,kBACA,sBAEA,YACA,WACA,SACA,yBACA,eACA,oBACA,gBAGF,wBACE,aAGF,gCACE,wBAGF,mBACE,gBAGF,uBACE,wBACA,gBAEA,iCACA,iCACA,UACA,UAgGF,gCAEE,yFAGA,mHAIA,0CAGF,yCACE,qDAbF,kCAEE,yFAGA,qHAIA,0CAGF,2CACE,qDAvGF,mBACE,gBACA,oCACA,qCACA,oBACA,UACA,UAgBF,oBACE,wLAIF,6BACE,wLAIF,kBACE,+KAIF,2BACE,+KAGF,OACE,UAIF,QEtbI,oPFicJ,UACE,kBACA,gCACA","file":"slider-styles.css"}
1
+ {"version":3,"sourceRoot":"","sources":["_slider.scss","../../elevation/internal/_elevation.scss","../../ripple/internal/_ripple.scss"],"names":[],"mappings":"AA6DE,MAEI,owHAIF,qBACA,mBACA,iBAEA,oBACA,sBACA,sBCnDE,wGD6DJ,cACE,YACA,YACA,WAGF,aACE,0BAIF,+BACE,OACE,uBAOJ,kBACE,8CClFE,wDD2FJ,WACE,OACA,aACA,mBACA,kBACA,oCAEA,oBAEA,kBACA,iBAGF,kBAEE,kBACA,QACA,aACA,mBAIF,kEAKE,kBACA,WAKA,mBAHiB,0EAIjB,iBAJiB,0EAOjB,gGAOF,kCAEE,yCACA,2CAGF,eACE,wCAGF,mBACE,+SAKF,iCAGE,8FAIA,iDAIF,gCAEE,uCACA,yCACA,iXAGF,cACE,sCAGF,kBACE,2SAMF,uBACE,iXAGF,2BACE,iXAGF,gCACE,+CAGF,qCACE,+SAWF,uBACE,kBACA,gBACA,iBACA,gDAGF,sBACE,kBACA,gBACA,iBAGF,iBACE,kBACA,oBACA,kBACA,qDACA,uEAIF,QACE,kBACA,oCACA,qCACA,mCACA,aACA,qBACA,mBAGF,WACE,kBACA,6BACA,2BACA,mCACA,gCAGF,6BACE,yCAGF,gIAEE,sCAIF,2DACE,sCAIA,kLAEE,wCAKF,gEAEE,kGAIF,gCACE,iGAKJ,cACE,0DAEF,YACE,wDAIF,OACE,kBACA,sBACA,aACA,YACA,qBACA,mBACA,sDAEA,+BACA,oCACA,kCACA,2CACA,sCAEA,qBACA,+CACA,8CACA,yCACA,sDAEA,+BACA,mBAKF,4FAGE,mBAGF,6BAEE,kBACA,cACA,WACA,mBAIF,eAGE,YADgB,uCAEhB,WAFgB,uCAGhB,gDACA,wBAIF,cACE,UACA,sBAIF,cACE,UAOF,kBACE,UACA,0CACA,kBACA,sBAEA,YACA,WACA,SACA,yBACA,eACA,oBACA,gBAGF,wBACE,aAGF,gCACE,wBAGF,mBACE,gBAGF,uBACE,wBACA,gBAEA,iCACA,iCACA,UACA,UAgGF,gCAEE,yFAGA,mHAIA,0CAGF,yCACE,qDAbF,kCAEE,yFAGA,qHAIA,0CAGF,2CACE,qDAvGF,mBACE,gBACA,oCACA,qCACA,oBACA,UACA,UAgBF,oBACE,wLAIF,6BACE,wLAIF,kBACE,+KAIF,2BACE,+KAGF,OACE,UAIF,QEvbI,oPFkcJ,UACE,kBACA,gCACA","file":"slider-styles.css"}
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // Generated stylesheet for ./slider/internal/slider-styles.css.
7
7
  import { css } from 'lit';
8
- export const styles = css `:host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:"";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:"";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}
8
+ export const styles = css `:host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none;user-select:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:"";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:"";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}
9
9
  `;
10
10
  //# sourceMappingURL=slider-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider-styles.js","sourceRoot":"","sources":["slider-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,gEAAgE;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./slider/internal/slider-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:\"\";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:\"\";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}\n`;\n"]}
1
+ {"version":3,"file":"slider-styles.js","sourceRoot":"","sources":["slider-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,gEAAgE;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./slider/internal/slider-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, var(--md-sys-shape-corner-full, 9999px));--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, var(--md-sys-shape-corner-full, 9999px));--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, var(--md-sys-shape-corner-full, 9999px));--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-slider-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-slider-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-slider-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-slider-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-weight: var(--md-slider-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_start-fraction: 0;--_end-fraction: 0;--_tick-count: 0;display:inline-flex;vertical-align:middle;min-inline-size:200px;--md-elevation-level: var(--_handle-elevation);--md-elevation-shadow-color: var(--_handle-shadow-color)}md-focus-ring{height:48px;inset:unset;width:48px}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level: var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none;user-select:none}.track,.tickmarks{position:absolute;inset:0;display:flex;align-items:center}.track::before,.tickmarks::before,.track::after,.tickmarks::after{position:absolute;content:\"\";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--_tick-count)) 100%}.track::before,.tickmarks::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape)}.track::before{background:var(--_inactive-track-color)}.tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background:var(--_disabled-inactive-track-color)}.track::after,.tickmarks::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)))}.track::after{background:var(--_active-track-color)}.tickmarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}.tickmarks:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--_start-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--_start-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--_end-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--_end-fraction))))}:host([disabled]) .track::after{background:var(--_disabled-active-track-color)}:host([disabled]) .tickmarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--_start-fraction));inline-size:calc(100%*(var(--_end-fraction) - var(--_start-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:flex;place-content:center;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.end:focus~.handleContainerPadded .handle.end>.handleNub,input.start:focus~.handleContainerPadded .handle.start>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.end:active~.handleContainerPadded .handle.end>.handleNub,:host(:not([disabled])) input.start:active~.handleContainerPadded .handle.start>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{outline:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.onTop.isOverlapping .handleNub{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.start{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle.end{inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:flex;padding:4px;place-content:center;place-items:center;border-radius:var(--md-sys-shape-corner-full, 9999px);color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label,:where(:has(input:active)) .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:\"\";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_handle-height);inline-size:var(--_handle-width);opacity:0;z-index:2}input.end::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_end-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.end:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}input.start::-webkit-slider-thumb{--_track-and-knob-padding: calc( (var(--_state-layer-size) - var(--_handle-width)) / 2 );--_x-translate: calc( var(--_track-and-knob-padding) - 2 * var(--_start-fraction) * var(--_track-and-knob-padding) );transform:translateX(var(--_x-translate))}input.start:dir(rtl)::-webkit-slider-thumb{transform:translateX(calc(-1 * var(--_x-translate)))}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.start{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))) 0 0)}.ranged input.start:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2))))}.ranged input.end{clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)))}.ranged input.end:dir(rtl){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--_start-fraction) + (var(--_end-fraction) - var(--_start-fraction)) / 2)) 0 0)}.onTop{z-index:1}.handle{--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-ripple{border-radius:50%;height:var(--_state-layer-size);width:var(--_state-layer-size)}\n`;\n"]}
@@ -10,7 +10,6 @@
10
10
  // go/keep-sorted start
11
11
  @use '../../elevation/elevation';
12
12
  @use '../../focus/focus-ring';
13
- @use '../../internal/sass/string-ext';
14
13
  @use '../../ripple/ripple';
15
14
  @use '../../tokens';
16
15
  // go/keep-sorted end
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["_tab.scss","../../ripple/internal/_ripple.scss","../../elevation/internal/_elevation.scss","../../focus/internal/_focus-ring.scss"],"names":[],"mappings":"AAkBE,MACE,oBACA,mBACA,uBACA,aACA,eACA,kBACA,0CACA,sBACA,iBACA,oCACA,kCACA,2CACA,sCACA,+BACA,UCZE,oPCCA,kDF8BJ,cG7BI,2BHqCJ,8BACE,0DAGF,gBACE,mCACA,WACA,QACA,kBACA,WAGF,uCAGE,8DACA,0DACA,sDACA,0DAGF,SACE,kBACA,sBACA,oBACA,mBACA,mBACA,uBACA,gCACA,QAGF,WACE,kBACA,sBACA,WACA,6BACA,0CACA,6CACA,uCACA,iBAEA,UAIF,uBACE,oBACA,kBACA,2BACA,kBACA,yBACA,4BACA,wBACA,yBAGF,cACE,qCACA,eAGF,qCACE,+BAGF,cACE,qCAGF,qCACE,+BAGF,eACE,uCAGF,sCACE,iCAIF,2BACE,UAEF,gBACE,sCC9HE,gRD0IJ,uCACE,gCAIF,sBACE,4CAGF,6CACE,sCAGF,sBACE,4CAGF,6CACE,sCAGF,uBACE,8CAGF,8CACE,wCAGF,mBAEE,mBAGF,8BACE,WACE","file":"tab-styles.css"}
1
+ {"version":3,"sourceRoot":"","sources":["_tab.scss","../../ripple/internal/_ripple.scss","../../elevation/internal/_elevation.scss","../../focus/internal/_focus-ring.scss"],"names":[],"mappings":"AAiBE,MACE,oBACA,mBACA,uBACA,aACA,eACA,kBACA,0CACA,sBACA,iBACA,oCACA,kCACA,2CACA,sCACA,+BACA,UCXE,oPCCA,kDF6BJ,cG5BI,2BHoCJ,8BACE,0DAGF,gBACE,mCACA,WACA,QACA,kBACA,WAGF,uCAGE,8DACA,0DACA,sDACA,0DAGF,SACE,kBACA,sBACA,oBACA,mBACA,mBACA,uBACA,gCACA,QAGF,WACE,kBACA,sBACA,WACA,6BACA,0CACA,6CACA,uCACA,iBAEA,UAIF,uBACE,oBACA,kBACA,2BACA,kBACA,yBACA,4BACA,wBACA,yBAGF,cACE,qCACA,eAGF,qCACE,+BAGF,cACE,qCAGF,qCACE,+BAGF,eACE,uCAGF,sCACE,iCAIF,2BACE,UAEF,gBACE,sCC7HE,gRDyIJ,uCACE,gCAIF,sBACE,4CAGF,6CACE,sCAGF,sBACE,4CAGF,6CACE,sCAGF,uBACE,8CAGF,8CACE,wCAGF,mBAEE,mBAGF,8BACE,WACE","file":"tab-styles.css"}
@@ -1,195 +0,0 @@
1
- //
2
- // Copyright 2021 Google LLC
3
- // SPDX-License-Identifier: Apache-2.0
4
- //
5
-
6
- // go/keep-sorted start
7
- @use 'sass:list';
8
- @use 'sass:string';
9
- // go/keep-sorted end
10
-
11
- /// Checks if a string starts with a given prefix.
12
- ///
13
- /// @example - scss
14
- /// @debug has-prefix('var(--foo)', 'var('); // true
15
- ///
16
- /// @param {String} $string - The string to test.
17
- /// @param {String} $prefix - The prefix to check.
18
- /// @return {Boolean} True if the string starts with the given prefix.
19
- @function has-prefix($string, $prefix) {
20
- @return string.slice($string, 1, string.length($prefix)) == $prefix;
21
- }
22
-
23
- /// Checks if a string ends with a given suffix.
24
- ///
25
- /// @example - scss
26
- /// @debug has-suffix('var(--foo)', ')'); // true
27
- ///
28
- /// @param {String} $string - The string to test.
29
- /// @param {String} $suffix - The suffix to check.
30
- /// @return {Boolean} True if the string ends with the given suffix.
31
- @function has-suffix($string, $suffix) {
32
- @return string.slice($string, -1 * string.length($suffix)) == $suffix;
33
- }
34
-
35
- /// Trims a repeating prefix from the start of a string.
36
- ///
37
- /// @example - scss
38
- /// @debug trim-repeating-prefix(' foo bar ', ' '); // "foo bar "
39
- ///
40
- /// @param {String} $string - The string to trim.
41
- /// @param {String} $prefix - The repeating prefix string to trim.
42
- /// @return {String} The string with the prefix trimmed from the start.
43
- @function trim-repeating-prefix($string, $prefix) {
44
- @while has-prefix($string, $prefix) {
45
- $string: trim-prefix($string, $prefix);
46
- }
47
-
48
- @return $string;
49
- }
50
-
51
- /// Trims a prefix from the start of a string.
52
- ///
53
- /// @example - scss
54
- /// @debug trim-prefix('var(--foo)', 'var('); // "--foo)"
55
- ///
56
- /// @param {String} $string - The string to trim.
57
- /// @param {String} $prefix - The prefix string to trim.
58
- /// @return {String} The string with the prefix trimmed from the start.
59
- @function trim-prefix($string, $prefix) {
60
- @if has-prefix($string, $prefix) {
61
- $string: string.slice($string, string.length($prefix) + 1);
62
- }
63
-
64
- @return $string;
65
- }
66
-
67
- /// Trims a repeating suffix from the end of a string.
68
- ///
69
- /// @example - scss
70
- /// @debug trim-repeating-suffix(' foo bar ', ' '); // " foo bar"
71
- /// @debug trim-repeating-suffix('var(--foo)', ')'); // "var(--foo"
72
- ///
73
- /// @param {String} $string - The string to trim.
74
- /// @param {String} $suffix - The repeating suffix string to trim.
75
- /// @return {String} The string with the suffix trimmed from the end.
76
- @function trim-repeating-suffix($string, $suffix) {
77
- @while has-suffix($string, $suffix) {
78
- $string: trim-suffix($string, $suffix);
79
- }
80
-
81
- @return $string;
82
- }
83
-
84
- /// Trims a suffix from the end of a string.
85
- ///
86
- /// @example - scss
87
- /// @debug trim-suffix('var(--foo)', ')'); // "var(--foo"
88
- ///
89
- /// @param {String} $string - The string to trim.
90
- /// @param {String} $suffix - The suffix string to trim.
91
- /// @return {String} The string with the suffix trimmed from the end.
92
- @function trim-suffix($string, $suffix) {
93
- @if has-suffix($string, $suffix) {
94
- $string: string.slice($string, 1, -1 * string.length($suffix) - 1);
95
- }
96
-
97
- @return $string;
98
- }
99
-
100
- /// Trims a repeating prefix and suffix from the start and end of a string.
101
- ///
102
- /// If a suffix is not provided, the prefix is used as the suffix to trim.
103
- ///
104
- /// @example - scss
105
- /// @debug trim-repeating(' foo bar ', ' '); // "foo bar"
106
- ///
107
- /// @param {String} $string - The string to trim.
108
- /// @param {String} $prefix - The repeating prefix string to trim.
109
- /// @param {String} $suffix [$prefix] - The repeating suffix string to trim.
110
- /// @return {String} The string with the prefix and suffix trimmed.
111
- @function trim-repeating($string, $prefix, $suffix: $prefix) {
112
- @return trim-repeating-prefix(
113
- trim-repeating-suffix($string, $suffix),
114
- $prefix
115
- );
116
- }
117
-
118
- /// Trims a prefix and suffix from the start and end of a string.
119
- ///
120
- /// If a suffix is not provided, the prefix is used as the suffix to trim.
121
- ///
122
- /// @example - scss
123
- /// @debug trim('var(--foo)', 'var(', ')'); // "--foo"
124
- ///
125
- /// @param {String} $string - The string to trim.
126
- /// @param {String} $prefix - The prefix string to trim.
127
- /// @param {String} $suffix [$prefix] - The suffix string to trim.
128
- /// @return {String} The string with the prefix and suffix trimmed.
129
- @function trim($string, $prefix, $suffix: $prefix) {
130
- @return trim-prefix(trim-suffix($string, $suffix), $prefix);
131
- }
132
-
133
- /// Returns a new string with the first match of a pattern replaced by a
134
- /// replacement.
135
- ///
136
- /// @example - scss
137
- /// @debug trim('foo bar baz', 'bar', 'quux'); // "foo quux baz"
138
- ///
139
- /// @param {String} $string - The string to be searched.
140
- /// @param {String} $pattern - The pattern to search for.
141
- /// @param {String} $replacement - The value to replace the pattern.
142
- /// @return {String} The string with the first match of pattern replaced by the
143
- /// replacement or the initial string itself.
144
- @function replace($string, $pattern, $replacement) {
145
- $pattern-index: string.index($string, $pattern);
146
- @if not $pattern-index {
147
- @return $string;
148
- }
149
-
150
- $before: string.slice($string, 1, $pattern-index - 1);
151
- $after: string.slice($string, string.length($pattern) + $pattern-index);
152
-
153
- @return $before + $replacement + $after;
154
- }
155
-
156
- /// Divides a string into an ordered list of substrings.
157
- ///
158
- /// @example - scss
159
- /// @debug split("1px 2px 3px 4px"); // (1px 2px 3px 4px)
160
- /// @debug split("1px, 2px, 3px, 4px"); // (1px 2px 3px 4px)
161
- /// @debug split("1px/2px/3px/4px"); // (1px 2px 3px 4px)
162
- ///
163
- /// @param {String} $str - The string to split
164
- /// @return {List} The list of substrings
165
- @function split($str) {
166
- $list: ();
167
- $item: '';
168
- // list separator precedence is comma, slash, space
169
- $separator: ' ';
170
- @if string.index($str, ',') {
171
- $separator: ',';
172
- } @else if string.index($str, '/') {
173
- $separator: '/';
174
- }
175
- @for $i from 1 through string.length($str) {
176
- $chr: string.slice($str, $i, $i);
177
- @if $chr == $separator {
178
- @if $item != '' {
179
- // remove surrounding whitespace
180
- $item: string.unquote(trim($item, ' '));
181
- $list: list.append($list, $item);
182
- }
183
- $item: '';
184
- } @else {
185
- $item: $item + $chr;
186
- }
187
- }
188
- // append final item
189
- @if $item != '' {
190
- // remove surrounding whitespace
191
- $item: string.unquote(trim($item, ' '));
192
- $list: list.append($list, $item);
193
- }
194
- @return $list;
195
- }