@api-client/ui 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.cursor/rules/html-and-css-best-practices.mdc +63 -0
  2. package/.cursor/rules/lit-best-practices.mdc +78 -0
  3. package/.github/instructions/html-and-css-best-practices.instructions.md +70 -0
  4. package/.github/instructions/lit-best-practices.instructions.md +86 -0
  5. package/build/src/elements/currency/currency-picker.d.ts +10 -0
  6. package/build/src/elements/currency/currency-picker.d.ts.map +1 -0
  7. package/build/src/elements/currency/currency-picker.js +27 -0
  8. package/build/src/elements/currency/currency-picker.js.map +1 -0
  9. package/build/src/elements/currency/internals/Picker.d.ts +311 -0
  10. package/build/src/elements/currency/internals/Picker.d.ts.map +1 -0
  11. package/build/src/elements/currency/internals/Picker.js +857 -0
  12. package/build/src/elements/currency/internals/Picker.js.map +1 -0
  13. package/build/src/elements/currency/internals/Picker.styles.d.ts +3 -0
  14. package/build/src/elements/currency/internals/Picker.styles.d.ts.map +1 -0
  15. package/build/src/elements/currency/internals/Picker.styles.js +58 -0
  16. package/build/src/elements/currency/internals/Picker.styles.js.map +1 -0
  17. package/build/src/elements/highlight/MarkdownStyles.d.ts.map +1 -1
  18. package/build/src/elements/highlight/MarkdownStyles.js +0 -13
  19. package/build/src/elements/highlight/MarkdownStyles.js.map +1 -1
  20. package/build/src/elements/http/BodyEditor.d.ts +0 -13
  21. package/build/src/elements/http/BodyEditor.d.ts.map +1 -1
  22. package/build/src/elements/http/BodyEditor.js +0 -13
  23. package/build/src/elements/http/BodyEditor.js.map +1 -1
  24. package/build/src/elements/http/BodyTextEditor.d.ts +0 -13
  25. package/build/src/elements/http/BodyTextEditor.d.ts.map +1 -1
  26. package/build/src/elements/http/BodyTextEditor.js +0 -13
  27. package/build/src/elements/http/BodyTextEditor.js.map +1 -1
  28. package/build/src/elements/http/BodyUrlEncodedEditor.d.ts +0 -13
  29. package/build/src/elements/http/BodyUrlEncodedEditor.d.ts.map +1 -1
  30. package/build/src/elements/http/BodyUrlEncodedEditor.js +0 -13
  31. package/build/src/elements/http/BodyUrlEncodedEditor.js.map +1 -1
  32. package/build/src/elements/http/UrlInput.d.ts +0 -13
  33. package/build/src/elements/http/UrlInput.d.ts.map +1 -1
  34. package/build/src/elements/http/UrlInput.js +0 -13
  35. package/build/src/elements/http/UrlInput.js.map +1 -1
  36. package/build/src/index.d.ts +2 -0
  37. package/build/src/index.d.ts.map +1 -1
  38. package/build/src/index.js +2 -0
  39. package/build/src/index.js.map +1 -1
  40. package/build/src/md/button/internals/base.d.ts +1 -0
  41. package/build/src/md/button/internals/base.d.ts.map +1 -1
  42. package/build/src/md/button/internals/base.js +7 -0
  43. package/build/src/md/button/internals/base.js.map +1 -1
  44. package/build/src/md/button/internals/button.styles.js +1 -1
  45. package/build/src/md/button/internals/button.styles.js.map +1 -1
  46. package/build/src/md/date/internals/DateTime.d.ts +0 -13
  47. package/build/src/md/date/internals/DateTime.d.ts.map +1 -1
  48. package/build/src/md/date/internals/DateTime.js +0 -13
  49. package/build/src/md/date/internals/DateTime.js.map +1 -1
  50. package/build/src/md/date-picker/index.d.ts +13 -0
  51. package/build/src/md/date-picker/index.d.ts.map +1 -0
  52. package/build/src/md/date-picker/index.js +13 -0
  53. package/build/src/md/date-picker/index.js.map +1 -0
  54. package/build/src/md/date-picker/internals/DatePicker.styles.d.ts +4 -0
  55. package/build/src/md/date-picker/internals/DatePicker.styles.d.ts.map +1 -0
  56. package/build/src/md/date-picker/internals/DatePicker.styles.js +409 -0
  57. package/build/src/md/date-picker/internals/DatePicker.styles.js.map +1 -0
  58. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts +272 -0
  59. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts.map +1 -0
  60. package/build/src/md/date-picker/internals/DatePickerCalendar.js +1062 -0
  61. package/build/src/md/date-picker/internals/DatePickerCalendar.js.map +1 -0
  62. package/build/src/md/date-picker/internals/DatePickerUtils.d.ts +93 -0
  63. package/build/src/md/date-picker/internals/DatePickerUtils.d.ts.map +1 -0
  64. package/build/src/md/date-picker/internals/DatePickerUtils.js +221 -0
  65. package/build/src/md/date-picker/internals/DatePickerUtils.js.map +1 -0
  66. package/build/src/md/date-picker/ui-date-picker-input.d.ts +160 -0
  67. package/build/src/md/date-picker/ui-date-picker-input.d.ts.map +1 -0
  68. package/build/src/md/date-picker/ui-date-picker-input.js +464 -0
  69. package/build/src/md/date-picker/ui-date-picker-input.js.map +1 -0
  70. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts +178 -0
  71. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts.map +1 -0
  72. package/build/src/md/date-picker/ui-date-picker-modal-input.js +538 -0
  73. package/build/src/md/date-picker/ui-date-picker-modal-input.js.map +1 -0
  74. package/build/src/md/date-picker/ui-date-picker-modal.d.ts +156 -0
  75. package/build/src/md/date-picker/ui-date-picker-modal.d.ts.map +1 -0
  76. package/build/src/md/date-picker/ui-date-picker-modal.js +423 -0
  77. package/build/src/md/date-picker/ui-date-picker-modal.js.map +1 -0
  78. package/build/src/md/dialog/internals/Dialog.styles.d.ts.map +1 -1
  79. package/build/src/md/dialog/internals/Dialog.styles.js +1 -0
  80. package/build/src/md/dialog/internals/Dialog.styles.js.map +1 -1
  81. package/demo/elements/currency/index.html +91 -0
  82. package/demo/elements/currency/index.ts +272 -0
  83. package/demo/elements/har/har2.json +1 -1
  84. package/demo/elements/index.html +3 -0
  85. package/demo/md/date-picker/date-picker.ts +336 -0
  86. package/demo/md/date-picker/index.html +171 -0
  87. package/demo/md/index.html +2 -0
  88. package/package.json +1 -1
  89. package/src/elements/currency/currency-picker.ts +14 -0
  90. package/src/elements/currency/internals/Picker.styles.ts +58 -0
  91. package/src/elements/currency/internals/Picker.ts +846 -0
  92. package/src/elements/highlight/MarkdownStyles.ts +0 -13
  93. package/src/elements/http/BodyEditor.ts +0 -13
  94. package/src/elements/http/BodyTextEditor.ts +0 -13
  95. package/src/elements/http/BodyUrlEncodedEditor.ts +0 -13
  96. package/src/elements/http/UrlInput.ts +0 -13
  97. package/src/index.ts +17 -0
  98. package/src/md/button/internals/base.ts +7 -0
  99. package/src/md/button/internals/button.styles.ts +1 -1
  100. package/src/md/date/internals/DateTime.ts +0 -14
  101. package/src/md/date-picker/README.md +184 -0
  102. package/src/md/date-picker/index.ts +17 -0
  103. package/src/md/date-picker/internals/DatePicker.styles.ts +411 -0
  104. package/src/md/date-picker/internals/DatePickerCalendar.ts +1031 -0
  105. package/src/md/date-picker/internals/DatePickerUtils.ts +288 -0
  106. package/src/md/date-picker/ui-date-picker-input.ts +333 -0
  107. package/src/md/date-picker/ui-date-picker-modal-input.ts +440 -0
  108. package/src/md/date-picker/ui-date-picker-modal.ts +346 -0
  109. package/src/md/dialog/internals/Dialog.styles.ts +1 -0
  110. package/test/README.md +3 -2
  111. package/test/elements/currency/CurrencyPicker.accessibility.test.ts +328 -0
  112. package/test/elements/currency/CurrencyPicker.core.test.ts +318 -0
  113. package/test/elements/currency/CurrencyPicker.integration.test.ts +482 -0
  114. package/test/elements/currency/CurrencyPicker.test.ts +486 -0
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/md/button/internals/base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,OAAO,2BAA2B,CAAA;AAClC,OAAO,sCAAsC,CAAA;;sBAiBL,SAAS;;;;;;;;;;;;;;;;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,CAAC;;;AAlWH;;;;;;;;;;GAUG;AACH","sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { nanoid } from 'nanoid'\nimport { UiElement } from '../../UiElement.js'\nimport type { BeginPressConfig, EndPressConfig } from '../../../controllers/ActionController.js'\nimport { isDisabled, setDisabled } from '../../../lib/disabled.js'\nimport type UiRipple from '../../ripple/internals/ripple.js'\nimport { findElementInShadowRoots } from '../../../lib/Dom.js'\n\nimport '../../ripple/ui-ripple.js'\nimport '@material/web/focus/md-focus-ring.js'\n\nexport type ButtonType = 'submit' | 'reset' | 'button'\nexport type MdButtonShape = 'round' | 'square'\nexport type MdButtonSize = 'xs' | 's' | 'm' | 'l' | 'xl'\n\n/**\n * A material design button with M3 Expressive features - CSS-native implementation.\n *\n * @slot icon - A slot for the icon element\n * @slot - The default slot for the label\n * @attribute {string} form - The form associated with this element when the element is outside the form.\n * @fires {ToggleEvent} toggle - Fired when the `toggle` property is true and the button is clicked,\n * changing its selection state.\n * The event's `newState` and `oldState` properties (string values: 'selected' or\n * 'unselected') detail this selection change.\n */\nexport default class BaseButton extends UiElement {\n static readonly formAssociated = true\n\n #internals = this.attachInternals()\n\n /**\n * The form associated with this element\n * @attribute\n */\n get form(): HTMLFormElement | null | string {\n return this.#internals.form\n }\n\n get validity() {\n return this.#internals.validity\n }\n\n get validationMessage() {\n return this.#internals.validationMessage\n }\n\n get willValidate() {\n return this.#internals.willValidate\n }\n\n /**\n * The name of the button, submitted as a pair with the button's value as part of the form data.\n * @attribute\n */\n @property({ type: String }) accessor name: string | undefined\n\n #value?: string\n\n get value(): string | undefined {\n return this.#value\n }\n\n /**\n * Defines the value associated with the button's name when it's submitted with the form data.\n * @attribute\n */\n @property({ type: String })\n set value(value: string | undefined) {\n if (this.#value === value) {\n return\n }\n this.#value = value\n this.#internals?.setFormValue(value || null)\n }\n\n /**\n * Whether to render the icon at the inline end of the label rather than the inline start.\n * @attribute\n */\n @property({ type: Boolean, attribute: 'trailingicon', reflect: true }) accessor trailingIcon = false\n\n /**\n * The default behavior of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor type: ButtonType = 'button'\n\n /**\n * When set, the button is a toggle button.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor toggle = false\n\n /**\n * Indicates that the button is currently selected.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor selected = false\n\n /**\n * The shape of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor shape: MdButtonShape = 'round'\n\n /**\n * The size of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor size: MdButtonSize = 's'\n\n get disabled(): boolean {\n return isDisabled(this)\n }\n\n /**\n * When set, the button is in a disabled state.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n set disabled(value: boolean) {\n const old = isDisabled(this)\n setDisabled(this, value)\n this.requestUpdate('disabled', old)\n }\n\n @query('ui-ripple') protected accessor ripple!: UiRipple | null\n\n /**\n * Turns a `<ui-button>` element into a popover control button; takes the ID\n * of the popover element to control as its value.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor popoverTarget: string | undefined\n /**\n * Specifies the action to be performed on a popover element being controlled\n * by a control <ui-button>. Possible values are:\n *\n * - `hide` - The button will hide a shown popover. If you try to hide an already hidden popover,\n * no action will be taken.\n * - `show` - The button will show a hidden popover. If you try to show an already showing popover,\n * no action will be taken.\n * - `toggle` - The button will toggle a popover between showing and hidden. If the popover is hidden,\n * it will be shown; if the popover is showing, it will be hidden. If popoverTargetAction is omitted,\n * \"toggle\" is the default action that will be performed by the control button.\n */\n @property({ type: String, reflect: true }) accessor popoverTargetAction: string | undefined\n\n constructor() {\n super()\n this.actionController.cancelKeyboardEvents = true\n this.addEventListener('keydown', this.handleKeyDown.bind(this))\n this.addEventListener('keyup', this.handleKeyUp.bind(this))\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('pointerdown', this.handlePointerDown.bind(this))\n this.addEventListener('pointerup', this.handlePointerUp.bind(this))\n this.addEventListener('pointercancel', this.handlePointerCancel.bind(this))\n this.addEventListener('pointerleave', this.handlePointerLeave.bind(this))\n this.addEventListener('pointerenter', this.handlePointerEnter.bind(this))\n this.addEventListener('contextmenu', this.handleContextMenu.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button')\n }\n if (!this.hasAttribute('tabindex') && !this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('popoverTarget')) {\n this.setupPopoverTarget()\n }\n super.update(changedProperties)\n }\n\n protected override updated(cp: PropertyValues<this>): void {\n super.updated(cp)\n\n // If the button is disabled, remove the tabindex attribute\n if (cp.has('disabled')) {\n if (this.disabled) {\n this.removeAttribute('tabindex')\n } else if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n if (cp.has('toggle') || cp.has('selected')) {\n this.updatePressedState()\n }\n }\n\n protected updatePressedState(): void {\n if (this.toggle) {\n this.ariaPressed = String(this.selected)\n } else {\n this.selected = false\n this.removeAttribute('aria-pressed')\n }\n }\n\n checkValidity() {\n return this.#internals.checkValidity()\n }\n\n reportValidity() {\n return this.#internals.reportValidity()\n }\n\n protected override firstUpdated(): void {\n this.#internals?.setFormValue(this.value || null)\n }\n\n override beginPress(options: BeginPressConfig): void {\n super.beginPress(options)\n this.classList.add('pressed')\n this.ripple?.beginFocus()\n }\n\n override endPress(config: EndPressConfig): void {\n super.endPress(config)\n this.classList.remove('pressed')\n this.ripple?.endFocus()\n const { cancelled, reason } = config\n if (cancelled) {\n return\n }\n const allowedReasons = reason === 'enter' || reason === 'space'\n if (this.type === 'submit' && (!reason || allowedReasons)) {\n this.handleSubmit()\n } else if (allowedReasons) {\n this.click()\n }\n }\n\n override handleClick(e: MouseEvent): void {\n // Do not call super.handleClick() here, as it would call `endPress` again.\n if (this.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n\n if (this.toggle) {\n this.selected = !this.selected\n const e = new ToggleEvent('toggle', {\n bubbles: true,\n composed: true,\n newState: this.selected ? 'selected' : 'unselected',\n oldState: this.selected ? 'unselected' : 'selected',\n })\n this.dispatchEvent(e)\n }\n this.handlePopoverAction()\n this.endPress({ cancelled: false, actionData: { event: e } })\n }\n\n protected setupPopoverTarget(): void {\n const id = this.popoverTarget\n if (!id) {\n return\n }\n const element = findElementInShadowRoots(id, this)\n if (!element) {\n return\n }\n // A regular button first sets its value to the popover target ID,\n this.value = id\n // create an anchor association with the popover target\n if (!this.id) {\n this.id = nanoid()\n }\n const anchorName = `--anchor-${this.id}`\n this.style.setProperty('anchor-name', anchorName)\n element.style.setProperty('position-anchor', anchorName)\n this.setAttribute('aria-details', id)\n this.setAttribute('aria-controls', id)\n }\n\n /**\n * When the button has a popover target, this method toggles the popover\n * visibility by finding the element in the shadow roots and calling its\n * `togglePopover` method.\n */\n protected handlePopoverAction(): void {\n const id = this.popoverTarget\n if (!id) {\n return\n }\n const element = findElementInShadowRoots(id, this)\n if (!element) {\n return\n }\n const action = this.popoverTargetAction || 'toggle'\n if (action === 'hide') {\n element.hidePopover()\n } else if (action === 'show') {\n element.showPopover()\n } else {\n element.togglePopover()\n }\n element.focus()\n }\n\n protected handleSubmit(): void {\n const { name, value, type, disabled, form } = this\n if (!form || !type || disabled) {\n return\n }\n const typedForm = form as HTMLFormElement\n let button: HTMLButtonElement | undefined\n if (name || value) {\n button = document.createElement('button')\n if (name) {\n button.name = name\n }\n if (value) {\n button.value = value\n }\n button.type = type\n button.hidden = true\n typedForm.append(button)\n }\n try {\n typedForm.requestSubmit(button)\n } catch {\n // Ignore errors\n }\n if (button) {\n typedForm.removeChild(button)\n }\n }\n\n override handlePointerEnter(e: PointerEvent): void {\n super.handlePointerEnter(e)\n this.ripple?.beginHover(e)\n }\n\n override handlePointerLeave(e: PointerEvent): void {\n super.handlePointerLeave(e)\n this.ripple?.endHover()\n }\n\n protected override render(): TemplateResult {\n const { trailingIcon = false } = this\n const icon = this.renderIcon()\n\n return html`\n ${this.renderFocusRing()} ${this.renderRipple()} ${trailingIcon ? nothing : icon}\n <slot></slot>\n ${trailingIcon ? icon : nothing}\n `\n }\n\n protected renderIcon(): TemplateResult {\n return html`<slot name=\"icon\"></slot>`\n }\n\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring part=\"focus-ring\" class=\"focus-ring\" .control=\"${this as HTMLElement}\"></md-focus-ring>`\n }\n\n protected renderRipple(): TemplateResult {\n return html`<ui-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></ui-ripple>`\n }\n}\n"]}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/md/button/internals/base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,OAAO,2BAA2B,CAAA;AAClC,OAAO,sCAAsC,CAAA;;sBAiBL,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA5B,UAAW,SAAQ,WAAS;;;gCA6B9C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCAY1B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAa1B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gCAMrE,QAAQ,CAAC,EAAE,IAAI,EAAE,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ropertyValues, type TemplateResult } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { nanoid } from 'nanoid'\nimport { UiElement } from '../../UiElement.js'\nimport type { BeginPressConfig, EndPressConfig } from '../../../controllers/ActionController.js'\nimport { isDisabled, setDisabled } from '../../../lib/disabled.js'\nimport type UiRipple from '../../ripple/internals/ripple.js'\nimport { findElementInShadowRoots } from '../../../lib/Dom.js'\n\nimport '../../ripple/ui-ripple.js'\nimport '@material/web/focus/md-focus-ring.js'\n\nexport type ButtonType = 'submit' | 'reset' | 'button'\nexport type MdButtonShape = 'round' | 'square'\nexport type MdButtonSize = 'xs' | 's' | 'm' | 'l' | 'xl'\n\n/**\n * A material design button with M3 Expressive features - CSS-native implementation.\n *\n * @slot icon - A slot for the icon element\n * @slot - The default slot for the label\n * @attribute {string} form - The form associated with this element when the element is outside the form.\n * @fires {ToggleEvent} toggle - Fired when the `toggle` property is true and the button is clicked,\n * changing its selection state.\n * The event's `newState` and `oldState` properties (string values: 'selected' or\n * 'unselected') detail this selection change.\n */\nexport default class BaseButton extends UiElement {\n static readonly formAssociated = true\n\n #internals = this.attachInternals()\n\n /**\n * The form associated with this element\n * @attribute\n */\n get form(): HTMLFormElement | null | string {\n return this.#internals.form\n }\n\n get validity() {\n return this.#internals.validity\n }\n\n get validationMessage() {\n return this.#internals.validationMessage\n }\n\n get willValidate() {\n return this.#internals.willValidate\n }\n\n /**\n * The name of the button, submitted as a pair with the button's value as part of the form data.\n * @attribute\n */\n @property({ type: String }) accessor name: string | undefined\n\n #value?: string\n\n get value(): string | undefined {\n return this.#value\n }\n\n /**\n * Defines the value associated with the button's name when it's submitted with the form data.\n * @attribute\n */\n @property({ type: String })\n set value(value: string | undefined) {\n if (this.#value === value) {\n return\n }\n this.#value = value\n this.#internals?.setFormValue(value || null)\n }\n\n /**\n * Whether to render the icon at the inline end of the label rather than the inline start.\n * @attribute\n */\n @property({ type: Boolean, attribute: 'trailingicon', reflect: true }) accessor trailingIcon = false\n\n /**\n * The default behavior of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor type: ButtonType = 'button'\n\n /**\n * When set, the button is a toggle button.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor toggle = false\n\n /**\n * Indicates that the button is currently selected.\n * @attribute\n */\n @property({ type: Boolean, reflect: true }) accessor selected = false\n\n /**\n * The shape of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor shape: MdButtonShape = 'round'\n\n /**\n * The size of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor size: MdButtonSize = 's'\n\n get disabled(): boolean {\n return isDisabled(this)\n }\n\n /**\n * When set, the button is in a disabled state.\n * @attribute\n */\n @property({ reflect: true, type: Boolean })\n set disabled(value: boolean) {\n const old = isDisabled(this)\n setDisabled(this, value)\n this.requestUpdate('disabled', old)\n }\n\n @query('ui-ripple') protected accessor ripple!: UiRipple | null\n\n /**\n * Turns a `<ui-button>` element into a popover control button; takes the ID\n * of the popover element to control as its value.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor popoverTarget: string | undefined\n /**\n * Specifies the action to be performed on a popover element being controlled\n * by a control <ui-button>. Possible values are:\n *\n * - `hide` - The button will hide a shown popover. If you try to hide an already hidden popover,\n * no action will be taken.\n * - `show` - The button will show a hidden popover. If you try to show an already showing popover,\n * no action will be taken.\n * - `toggle` - The button will toggle a popover between showing and hidden. If the popover is hidden,\n * it will be shown; if the popover is showing, it will be hidden. If popoverTargetAction is omitted,\n * \"toggle\" is the default action that will be performed by the control button.\n */\n @property({ type: String, reflect: true }) accessor popoverTargetAction: string | undefined\n\n constructor() {\n super()\n this.actionController.cancelKeyboardEvents = true\n this.addEventListener('keydown', this.handleKeyDown.bind(this))\n this.addEventListener('keyup', this.handleKeyUp.bind(this))\n this.addEventListener('click', this.handleClick.bind(this))\n this.addEventListener('pointerdown', this.handlePointerDown.bind(this))\n this.addEventListener('pointerup', this.handlePointerUp.bind(this))\n this.addEventListener('pointercancel', this.handlePointerCancel.bind(this))\n this.addEventListener('pointerleave', this.handlePointerLeave.bind(this))\n this.addEventListener('pointerenter', this.handlePointerEnter.bind(this))\n this.addEventListener('contextmenu', this.handleContextMenu.bind(this))\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button')\n }\n if (!this.hasAttribute('tabindex') && !this.disabled) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n protected override update(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('popoverTarget')) {\n this.setupPopoverTarget()\n }\n super.update(changedProperties)\n }\n\n protected override updated(cp: PropertyValues<this>): void {\n super.updated(cp)\n\n // If the button is disabled, remove the tabindex attribute\n if (cp.has('disabled')) {\n if (this.disabled) {\n this.removeAttribute('tabindex')\n } else if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0')\n }\n }\n\n if (cp.has('toggle') || cp.has('selected')) {\n this.updatePressedState()\n }\n }\n\n protected updatePressedState(): void {\n if (this.toggle) {\n this.ariaPressed = String(this.selected)\n } else {\n this.selected = false\n this.removeAttribute('aria-pressed')\n }\n }\n\n checkValidity() {\n return this.#internals.checkValidity()\n }\n\n reportValidity() {\n return this.#internals.reportValidity()\n }\n\n protected override firstUpdated(): void {\n this.#internals?.setFormValue(this.value || null)\n }\n\n override beginPress(options: BeginPressConfig): void {\n super.beginPress(options)\n this.classList.add('pressed')\n this.ripple?.beginFocus()\n }\n\n override endPress(config: EndPressConfig): void {\n super.endPress(config)\n this.classList.remove('pressed')\n this.ripple?.endFocus()\n const { cancelled, reason } = config\n if (cancelled) {\n return\n }\n const allowedReasons = reason === 'enter' || reason === 'space'\n if (this.type === 'submit' && (!reason || allowedReasons)) {\n this.handleSubmit()\n } else if (this.type === 'reset' && (!reason || allowedReasons)) {\n this.handleReset()\n } else if (allowedReasons) {\n this.click()\n }\n }\n\n override handleClick(e: MouseEvent): void {\n // Do not call super.handleClick() here, as it would call `endPress` again.\n if (this.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n\n if (this.toggle) {\n this.selected = !this.selected\n const e = new ToggleEvent('toggle', {\n bubbles: true,\n composed: true,\n newState: this.selected ? 'selected' : 'unselected',\n oldState: this.selected ? 'unselected' : 'selected',\n })\n this.dispatchEvent(e)\n }\n this.handlePopoverAction()\n this.endPress({ cancelled: false, actionData: { event: e } })\n }\n\n protected setupPopoverTarget(): void {\n const id = this.popoverTarget\n if (!id) {\n return\n }\n const element = findElementInShadowRoots(id, this)\n if (!element) {\n return\n }\n // A regular button first sets its value to the popover target ID,\n this.value = id\n // create an anchor association with the popover target\n if (!this.id) {\n this.id = nanoid()\n }\n const anchorName = `--anchor-${this.id}`\n this.style.setProperty('anchor-name', anchorName)\n element.style.setProperty('position-anchor', anchorName)\n this.setAttribute('aria-details', id)\n this.setAttribute('aria-controls', id)\n }\n\n /**\n * When the button has a popover target, this method toggles the popover\n * visibility by finding the element in the shadow roots and calling its\n * `togglePopover` method.\n */\n protected handlePopoverAction(): void {\n const id = this.popoverTarget\n if (!id) {\n return\n }\n const element = findElementInShadowRoots(id, this)\n if (!element) {\n return\n }\n const action = this.popoverTargetAction || 'toggle'\n if (action === 'hide') {\n element.hidePopover()\n } else if (action === 'show') {\n element.showPopover()\n } else {\n element.togglePopover()\n }\n element.focus()\n }\n\n protected handleSubmit(): void {\n const { name, value, type, disabled, form } = this\n if (!form || !type || disabled) {\n return\n }\n const typedForm = form as HTMLFormElement\n let button: HTMLButtonElement | undefined\n if (name || value) {\n button = document.createElement('button')\n if (name) {\n button.name = name\n }\n if (value) {\n button.value = value\n }\n button.type = type\n button.hidden = true\n typedForm.append(button)\n }\n try {\n typedForm.requestSubmit(button)\n } catch {\n // Ignore errors\n }\n if (button) {\n typedForm.removeChild(button)\n }\n }\n\n protected handleReset(): void {\n const form = this.form as HTMLFormElement\n form?.reset()\n }\n\n override handlePointerEnter(e: PointerEvent): void {\n super.handlePointerEnter(e)\n this.ripple?.beginHover(e)\n }\n\n override handlePointerLeave(e: PointerEvent): void {\n super.handlePointerLeave(e)\n this.ripple?.endHover()\n }\n\n protected override render(): TemplateResult {\n const { trailingIcon = false } = this\n const icon = this.renderIcon()\n\n return html`\n ${this.renderFocusRing()} ${this.renderRipple()} ${trailingIcon ? nothing : icon}\n <slot></slot>\n ${trailingIcon ? icon : nothing}\n `\n }\n\n protected renderIcon(): TemplateResult {\n return html`<slot name=\"icon\"></slot>`\n }\n\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring part=\"focus-ring\" class=\"focus-ring\" .control=\"${this as HTMLElement}\"></md-focus-ring>`\n }\n\n protected renderRipple(): TemplateResult {\n return html`<ui-ripple class=\"ripple\" ?disabled=\"${this.disabled}\"></ui-ripple>`\n }\n}\n"]}
@@ -268,7 +268,7 @@ export default css `
268
268
 
269
269
  /* Outlined Button */
270
270
  :host([color='outlined']) {
271
- border: 1px var(--md-sys-color-outline-variant) solid;
271
+ border: 1px var(--md-button-outline-color, var(--md-sys-color-outline-variant)) solid;
272
272
  --_color: var(--md-sys-color-on-surface-variant);
273
273
  }
274
274
 
@@ -1 +1 @@
1
- {"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../../src/md/button/internals/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,qEAAqE;AACrE,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2TjB,CAAA","sourcesContent":["import { css } from 'lit'\n\n/* Material Design 3 Expressive Button - CSS-Native Implementation */\nexport default css`\n :host {\n all: unset;\n\n /* Layout and positioning */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n white-space: nowrap;\n\n /* Default sizing */\n min-height: 40px;\n min-width: 64px;\n padding-inline: 16px;\n gap: 8px;\n\n /* Typography from Material 3 tokens */\n font-family: var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, system-ui));\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n font-weight: var(--md-sys-typescale-label-large-weight, 500);\n line-height: var(--md-sys-typescale-label-large-height, 1.25);\n letter-spacing: var(--md-sys-typescale-label-large-tracking, 0.01em);\n\n --md-ripple-hover-state-layer-color: currentColor;\n --md-ripple-focus-state-layer-color: currentColor;\n --md-ripple-pressed-state-layer-color: currentColor;\n\n /* CSS custom property for pill radius - half of the button height */\n --_pill-radius: 20px;\n /* Default icon size */\n --_icon-size: var(--md-button-icon-size, 20px);\n --_background-color: transparent;\n --_color: inherit;\n --_shadow: var(--md-sys-elevation-0);\n\n border-end-end-radius: var(--ui-button-shape-end-end, var(--_pill-radius));\n border-end-start-radius: var(--ui-button-shape-end-start, var(--_pill-radius));\n border-start-end-radius: var(--ui-button-shape-start-end, var(--_pill-radius));\n border-start-start-radius: var(--ui-button-shape-start-start, var(--_pill-radius));\n background-color: var(--_background-color);\n color: var(--_color);\n box-shadow: var(--_shadow);\n\n /* Interaction styles */\n cursor: pointer;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n\n transition:\n background-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n color var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n box-shadow var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n /* Icon styling */\n ::slotted([slot='icon']) {\n flex-shrink: 0;\n width: var(--_icon-size);\n height: var(--_icon-size);\n font-size: var(--_icon-size);\n }\n\n /* Modern CSS: Container queries for responsive sizing */\n @container (min-width: 320px) {\n :host {\n min-width: 80px;\n }\n }\n\n .ripple {\n border-radius: inherit;\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n .ripple.activated {\n z-index: 1;\n }\n\n .focus-ring {\n --md-focus-ring-shape-end-end: var(--ui-button-shape-end-end, var(--_pill-radius));\n --md-focus-ring-shape-end-start: var(--ui-button-shape-end-start, var(--_pill-radius));\n --md-focus-ring-shape-start-end: var(--ui-button-shape-start-end, var(--_pill-radius));\n --md-focus-ring-shape-start-start: var(--ui-button-shape-start-start, var(--_pill-radius));\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n /* Disabled state */\n :host([disabled]) {\n background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);\n color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n box-shadow: none;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Size Variations */\n :host([size='xs']) {\n min-height: 32px;\n padding-inline: 12px;\n font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);\n gap: 6px;\n --_icon-size: 20px;\n }\n\n :host([size='s']) {\n min-height: 40px;\n padding-inline: 16px;\n --_icon-size: 20px;\n }\n\n :host([size='m']) {\n min-height: 56px;\n padding-inline: 24px;\n font-size: var(--md-sys-typescale-label-large-size, 1rem);\n gap: 10px;\n --_icon-size: 24px;\n }\n\n :host([size='l']) {\n min-height: 96px;\n padding-inline: 48px;\n font-size: var(--md-sys-typescale-title-medium-size, 1.125rem);\n gap: 12px;\n --_icon-size: 32px;\n }\n\n :host([size='xl']) {\n min-height: 136px;\n padding-inline: 64px;\n font-size: var(--md-sys-typescale-title-large-size, 1.375rem);\n gap: 16px;\n --_icon-size: 40px;\n }\n\n /* Pressed state is the same to all combinations of shape and size */\n :host([size='xs'].pressed),\n :host([size='s'].pressed) {\n --_pill-radius: 8px !important;\n }\n :host([size='m'].pressed) {\n --_pill-radius: 12px !important;\n }\n :host([size='xl'].pressed),\n :host([size='l'].pressed) {\n --_pill-radius: 16px !important;\n }\n\n /* Shape setup */\n /* For the round shape, we can't use the \"--md-sys-shape-corner-full\" value as it has a value of 999px and it would make animations impossible so see. */\n :host([toggle][selected][shape='square'][size='xs']),\n :host([shape='round'][size='xs']) {\n --_pill-radius: 16px; /* Half of 32px height */\n }\n :host([toggle][selected][shape='square'][size='s']),\n :host([shape='round'][size='s']) {\n --_pill-radius: 20px; /* Half of 40px height */\n }\n :host([toggle][selected][shape='square'][size='m']),\n :host([shape='round'][size='m']) {\n --_pill-radius: 28px; /* Half of 56px height */\n }\n :host([toggle][selected][shape='square'][size='l']),\n :host([shape='round'][size='l']) {\n --_pill-radius: 48px; /* Half of 96px height */\n }\n :host([toggle][selected][shape='square'][size='xl']),\n :host([shape='round'][size='xl']) {\n --_pill-radius: 68px; /* Half of 136px height */\n }\n\n :host([shape='square'][size='xs']),\n :host([shape='square'][size='s']) {\n --_pill-radius: var(--md-sys-shape-corner-medium);\n }\n\n :host([shape='square'][size='m']) {\n --_pill-radius: var(--md-sys-shape-corner-large);\n }\n\n :host([shape='square'][size='l']),\n :host([shape='square'][size='xl']) {\n --_pill-radius: var(--md-sys-shape-corner-extra-large);\n }\n\n /* Button Color Variants - Material 3 Expressive */\n\n /* Elevated Button */\n :host([color='elevated']) {\n --_background-color: var(--md-sys-color-surface-container-low);\n --_color: var(--md-sys-color-primary);\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='elevated'][toggle][selected]) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='elevated']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-2);\n }\n\n :host([color='elevated'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n --_shadow: var(--md-sys-elevation-0);\n }\n\n /* Filled Button */\n :host([color='filled']) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled'][toggle]) {\n --_background-color: var(--md-sys-color-surface-container);\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='filled'][toggle][selected]) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='filled'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Filled Tonal Button */\n :host([color='tonal']) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle]) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle][selected]) {\n --_background-color: var(--md-sys-color-secondary);\n --_color: var(--md-sys-color-on-secondary);\n }\n\n :host([color='tonal']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='tonal'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Outlined Button */\n :host([color='outlined']) {\n border: 1px var(--md-sys-color-outline-variant) solid;\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='outlined'][toggle][selected]) {\n --_background-color: var(--md-sys-color-inverse-surface);\n --_color: var(--md-sys-color-inverse-on-surface);\n }\n\n :host([color='outlined'][disabled]) {\n border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Text Button */\n :host([color='text']) {\n --_color: var(--md-sys-color-primary);\n }\n\n :host([color='text'][disabled]) {\n color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n :host([toggle][selected][shape='round']) {\n --_pill-radius: var(--md-sys-shape-corner-medium);\n }\n\n /* Preference-based animations */\n @media (prefers-reduced-motion: reduce) {\n :host {\n transition-duration: 0.01ms;\n animation-duration: 0.01ms;\n }\n }\n\n /* High contrast mode support */\n @media (prefers-contrast: high) {\n :host {\n border-width: 2px;\n }\n\n :host([color='text']),\n :host([color='outlined']) {\n border-width: 2px;\n border-style: solid;\n }\n }\n`\n"]}
1
+ {"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../../../../src/md/button/internals/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,qEAAqE;AACrE,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2TjB,CAAA","sourcesContent":["import { css } from 'lit'\n\n/* Material Design 3 Expressive Button - CSS-Native Implementation */\nexport default css`\n :host {\n all: unset;\n\n /* Layout and positioning */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n white-space: nowrap;\n\n /* Default sizing */\n min-height: 40px;\n min-width: 64px;\n padding-inline: 16px;\n gap: 8px;\n\n /* Typography from Material 3 tokens */\n font-family: var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, system-ui));\n font-size: var(--md-sys-typescale-label-large-size, 0.875rem);\n font-weight: var(--md-sys-typescale-label-large-weight, 500);\n line-height: var(--md-sys-typescale-label-large-height, 1.25);\n letter-spacing: var(--md-sys-typescale-label-large-tracking, 0.01em);\n\n --md-ripple-hover-state-layer-color: currentColor;\n --md-ripple-focus-state-layer-color: currentColor;\n --md-ripple-pressed-state-layer-color: currentColor;\n\n /* CSS custom property for pill radius - half of the button height */\n --_pill-radius: 20px;\n /* Default icon size */\n --_icon-size: var(--md-button-icon-size, 20px);\n --_background-color: transparent;\n --_color: inherit;\n --_shadow: var(--md-sys-elevation-0);\n\n border-end-end-radius: var(--ui-button-shape-end-end, var(--_pill-radius));\n border-end-start-radius: var(--ui-button-shape-end-start, var(--_pill-radius));\n border-start-end-radius: var(--ui-button-shape-start-end, var(--_pill-radius));\n border-start-start-radius: var(--ui-button-shape-start-start, var(--_pill-radius));\n background-color: var(--_background-color);\n color: var(--_color);\n box-shadow: var(--_shadow);\n\n /* Interaction styles */\n cursor: pointer;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n\n transition:\n background-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n color var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n box-shadow var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n /* Icon styling */\n ::slotted([slot='icon']) {\n flex-shrink: 0;\n width: var(--_icon-size);\n height: var(--_icon-size);\n font-size: var(--_icon-size);\n }\n\n /* Modern CSS: Container queries for responsive sizing */\n @container (min-width: 320px) {\n :host {\n min-width: 80px;\n }\n }\n\n .ripple {\n border-radius: inherit;\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n .ripple.activated {\n z-index: 1;\n }\n\n .focus-ring {\n --md-focus-ring-shape-end-end: var(--ui-button-shape-end-end, var(--_pill-radius));\n --md-focus-ring-shape-end-start: var(--ui-button-shape-end-start, var(--_pill-radius));\n --md-focus-ring-shape-start-end: var(--ui-button-shape-start-end, var(--_pill-radius));\n --md-focus-ring-shape-start-start: var(--ui-button-shape-start-start, var(--_pill-radius));\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n /* Disabled state */\n :host([disabled]) {\n background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);\n color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n box-shadow: none;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Size Variations */\n :host([size='xs']) {\n min-height: 32px;\n padding-inline: 12px;\n font-size: var(--md-sys-typescale-label-medium-size, 0.75rem);\n gap: 6px;\n --_icon-size: 20px;\n }\n\n :host([size='s']) {\n min-height: 40px;\n padding-inline: 16px;\n --_icon-size: 20px;\n }\n\n :host([size='m']) {\n min-height: 56px;\n padding-inline: 24px;\n font-size: var(--md-sys-typescale-label-large-size, 1rem);\n gap: 10px;\n --_icon-size: 24px;\n }\n\n :host([size='l']) {\n min-height: 96px;\n padding-inline: 48px;\n font-size: var(--md-sys-typescale-title-medium-size, 1.125rem);\n gap: 12px;\n --_icon-size: 32px;\n }\n\n :host([size='xl']) {\n min-height: 136px;\n padding-inline: 64px;\n font-size: var(--md-sys-typescale-title-large-size, 1.375rem);\n gap: 16px;\n --_icon-size: 40px;\n }\n\n /* Pressed state is the same to all combinations of shape and size */\n :host([size='xs'].pressed),\n :host([size='s'].pressed) {\n --_pill-radius: 8px !important;\n }\n :host([size='m'].pressed) {\n --_pill-radius: 12px !important;\n }\n :host([size='xl'].pressed),\n :host([size='l'].pressed) {\n --_pill-radius: 16px !important;\n }\n\n /* Shape setup */\n /* For the round shape, we can't use the \"--md-sys-shape-corner-full\" value as it has a value of 999px and it would make animations impossible so see. */\n :host([toggle][selected][shape='square'][size='xs']),\n :host([shape='round'][size='xs']) {\n --_pill-radius: 16px; /* Half of 32px height */\n }\n :host([toggle][selected][shape='square'][size='s']),\n :host([shape='round'][size='s']) {\n --_pill-radius: 20px; /* Half of 40px height */\n }\n :host([toggle][selected][shape='square'][size='m']),\n :host([shape='round'][size='m']) {\n --_pill-radius: 28px; /* Half of 56px height */\n }\n :host([toggle][selected][shape='square'][size='l']),\n :host([shape='round'][size='l']) {\n --_pill-radius: 48px; /* Half of 96px height */\n }\n :host([toggle][selected][shape='square'][size='xl']),\n :host([shape='round'][size='xl']) {\n --_pill-radius: 68px; /* Half of 136px height */\n }\n\n :host([shape='square'][size='xs']),\n :host([shape='square'][size='s']) {\n --_pill-radius: var(--md-sys-shape-corner-medium);\n }\n\n :host([shape='square'][size='m']) {\n --_pill-radius: var(--md-sys-shape-corner-large);\n }\n\n :host([shape='square'][size='l']),\n :host([shape='square'][size='xl']) {\n --_pill-radius: var(--md-sys-shape-corner-extra-large);\n }\n\n /* Button Color Variants - Material 3 Expressive */\n\n /* Elevated Button */\n :host([color='elevated']) {\n --_background-color: var(--md-sys-color-surface-container-low);\n --_color: var(--md-sys-color-primary);\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='elevated'][toggle][selected]) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='elevated']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-2);\n }\n\n :host([color='elevated'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n --_shadow: var(--md-sys-elevation-0);\n }\n\n /* Filled Button */\n :host([color='filled']) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled'][toggle]) {\n --_background-color: var(--md-sys-color-surface-container);\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='filled'][toggle][selected]) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='filled'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Filled Tonal Button */\n :host([color='tonal']) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle]) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle][selected]) {\n --_background-color: var(--md-sys-color-secondary);\n --_color: var(--md-sys-color-on-secondary);\n }\n\n :host([color='tonal']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='tonal'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Outlined Button */\n :host([color='outlined']) {\n border: 1px var(--md-button-outline-color, var(--md-sys-color-outline-variant)) solid;\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='outlined'][toggle][selected]) {\n --_background-color: var(--md-sys-color-inverse-surface);\n --_color: var(--md-sys-color-inverse-on-surface);\n }\n\n :host([color='outlined'][disabled]) {\n border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Text Button */\n :host([color='text']) {\n --_color: var(--md-sys-color-primary);\n }\n\n :host([color='text'][disabled]) {\n color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n :host([toggle][selected][shape='round']) {\n --_pill-radius: var(--md-sys-shape-corner-medium);\n }\n\n /* Preference-based animations */\n @media (prefers-reduced-motion: reduce) {\n :host {\n transition-duration: 0.01ms;\n animation-duration: 0.01ms;\n }\n }\n\n /* High contrast mode support */\n @media (prefers-contrast: high) {\n :host {\n border-width: 2px;\n }\n\n :host([color='text']),\n :host([color='outlined']) {\n border-width: 2px;\n border-style: solid;\n }\n }\n`\n"]}
@@ -1,16 +1,3 @@
1
- /**
2
- @license
3
- Copyright 2016 The Advanced REST client authors <arc@mulesoft.com>
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
- use this file except in compliance with the License. You may obtain a copy of
6
- the License at
7
- http://www.apache.org/licenses/LICENSE-2.0
8
- Unless required by applicable law or agreed to in writing, software
9
- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- License for the specific language governing permissions and limitations under
12
- the License.
13
- */
14
1
  export type DateTimeTextOptions = 'long' | 'short' | 'narrow';
15
2
  export type DateTimeNumberOptions = 'numeric' | '2-digit';
16
3
  export type DateTimeTimezoneOptions = 'long' | 'short';
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../../../../src/md/date/internals/DateTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC7D,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,CA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mBAAmB,GAAG,IAAI,EAMpC;IAED,OAAO,CAAC,WAAW,CAAuB;IAE1C;;;;OAIG;IACH,IAAI,MAAM,IAAI,OAAO,GAAG,IAAI,CAK3B;IAED;;;;OAIG;IACH,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,EAO3B;IAED,OAAO,CAAC,MAAM,CAAsC;IAEpD;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAKxC;IAED;;;;;;;OAOG;IACH,IAAI,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,EAOxC;IAED,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAiBhC;IAED,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAQhF;;;OAGG;IACH,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;IAoBrE,eAAe,IAAI,IAAI,CAAC,qBAAqB;IAsC7C;;OAEG;IACH,YAAY,IAAI,eAAe;IAU/B,YAAY,IAAI,IAAI;CAoBrB"}
@@ -1,16 +1,3 @@
1
- /**
2
- @license
3
- Copyright 2016 The Advanced REST client authors <arc@mulesoft.com>
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not
5
- use this file except in compliance with the License. You may obtain a copy of
6
- the License at
7
- http://www.apache.org/licenses/LICENSE-2.0
8
- Unless required by applicable law or agreed to in writing, software
9
- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
- License for the specific language governing permissions and limitations under
12
- the License.
13
- */
14
1
  /**
15
2
  * An element to display formatted date and time.
16
3
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../../src/md/date/internals/DateTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAOF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,MAAM,KAAK,kBAAkB;QAC3B,OAAO;YACL,SAAS;YACT,MAAM;YACN,MAAM;YACN,OAAO;YACP,KAAK;YACL,MAAM;YACN,QAAQ;YACR,QAAQ;YACR,SAAS;YACT,gBAAgB;YAChB,KAAK;YACL,WAAW;YACX,QAAQ;YACR,UAAU;SACX,CAAA;IACH,CAAC;IAES,SAAS,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAA;IAEzE;QACE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACrC,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,UAAwB,EAAE;YACpD,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,IAAI;YACnB,OAAO,EAAE,IAAI;SACd,CAAC,CAAA;QACF,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAA;IAC7B,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,YAAY,CAAC,YAAY,EAAG,IAAI,CAAC,UAAyB,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;IACpF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,OAAO,CAAC,CAAgB;QAC1B,IAAI,CAAC,EA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,OAAO,CAAA;IAChB,CAAC;IAED;;OAEG;IACH,YAAY;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,UAAwB,CAAA;QAC1C,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;YACrC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,OAAM;QACR,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;QAChC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QACjD,wBAAwB;QACxB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;YAChC,OAAM;QACR,CAAC;QACD,IAAI,OAAO,CAAA;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QACtC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACpE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;CACF","sourcesContent":["/**\n@license\nCopyright 2016 The Advanced REST client authors <arc@mulesoft.com>\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License. You may obtain a copy of\nthe License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n*/\n\nexport type DateTimeTextOptions = 'long' | 'short' | 'narrow'\nexport type DateTimeNumberOptions = 'numeric' | '2-digit'\nexport type DateTimeTimezoneOptions = 'long' | 'short'\nexport type DateTimeTextNumberOptions = DateTimeTextOptions | DateTimeNumberOptions\n\n/**\n * An element to display formatted date and time.\n *\n * The `date` property accepts Date object, Number as a timestamp or string\n * that will be parsed to the Date object.\n *\n * This element uses the `Intl` interface which is available in IE 11+ browsers.\n *\n * To format the date use [Intl.DateTimeFormat]\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)\n * interface options.\n *\n * The default value for each date-time component property is undefined,\n * but if all component properties are undefined, then year, month, and day\n * are assumed to be \"numeric\" (per spec).\n *\n * ### Example\n *\n * ```html\n * <date-time date=\"2010-12-10T11:50:45Z\" year=\"numeric\" month=\"narrow\" day=\"numeric\"></date-time>\n * ```\n *\n * The element provides accessibility by using the `time` element and setting\n * the `datetime` attribute on it.\n */\nexport default class DateTime extends HTMLElement {\n static get observedAttributes(): string[] {\n return [\n 'locales',\n 'date',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'weekday',\n 'time-zone-name',\n 'era',\n 'time-zone',\n 'hour12',\n 'itemprop',\n ]\n }\n\n protected _observer = new MutationObserver(() => this._mutationHandler())\n\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n }\n\n connectedCallback(): void {\n this._observer.observe(this.shadowRoot as ShadowRoot, {\n childList: true,\n characterData: true,\n subtree: true,\n })\n this._updateLabel()\n }\n\n disconnectedCallback(): void {\n this._observer.disconnect()\n }\n\n _mutationHandler(): void {\n this.setAttribute('aria-label', (this.shadowRoot as ShadowRoot).textContent || '')\n }\n\n /**\n * A string with a BCP 47 language tag, or an array of such strings.\n * For the general form and interpretation of the locales argument,\n * see the Intl page.\n * The following Unicode extension keys are allowed:\n * - nu - Numbering system. Possible values include: \"arab\", \"arabext\",\n * \"bali\", \"beng\", \"deva\", \"fullwide\", \"gujr\", \"guru\", \"hanidec\", \"khmr\",\n * \"knda\", \"laoo\", \"latn\", \"limb\", \"mlym\", \"mong\", \"mymr\", \"orya\",\n * \"tamldec\", \"telu\", \"thai\", \"tibt\".\n * - ca - Calendar. Possible values include: \"buddhist\", \"chinese\",\n * \"coptic\", \"ethioaa\", \"ethiopic\", \"gregory\", \"hebrew\", \"indian\",\n * \"islamic\", \"islamicc\", \"iso8601\", \"japanese\", \"persian\", \"roc\".\n * @attribute\n */\n get locales(): string | null {\n return this.getAttribute('locales')\n }\n\n /**\n * A string with a BCP 47 language tag, or an array of such strings.\n * For the general form and interpretation of the locales argument,\n * see the Intl page.\n * The following Unicode extension keys are allowed:\n * - nu - Numbering system. Possible values include: \"arab\", \"arabext\",\n * \"bali\", \"beng\", \"deva\", \"fullwide\", \"gujr\", \"guru\", \"hanidec\", \"khmr\",\n * \"knda\", \"laoo\", \"latn\", \"limb\", \"mlym\", \"mong\", \"mymr\", \"orya\",\n * \"tamldec\", \"telu\", \"thai\", \"tibt\".\n * - ca - Calendar. Possible values include: \"buddhist\", \"chinese\",\n * \"coptic\", \"ethioaa\", \"ethiopic\", \"gregory\", \"hebrew\", \"indian\",\n * \"islamic\", \"islamicc\", \"iso8601\", \"japanese\", \"persian\", \"roc\".\n */\n set locales(v: string | null) {\n if (v) {\n this.setAttribute('locales', v)\n } else {\n this.removeAttribute('locales')\n }\n }\n\n /**\n * The representation of the year.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get year(): DateTimeNumberOptions | null {\n return this.getAttribute('year') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the year.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set year(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('year', v)\n } else {\n this.removeAttribute('year')\n }\n }\n\n /**\n * The representation of the month.\n * Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get month(): DateTimeTextNumberOptions | null {\n return this.getAttribute('month') as DateTimeTextNumberOptions\n }\n\n /**\n * The representation of the month.\n * @param v Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\".\n */\n set month(v: DateTimeTextNumberOptions | null) {\n if (v) {\n this.setAttribute('month', v)\n } else {\n this.removeAttribute('month')\n }\n }\n\n /**\n * The representation of the day.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get day(): DateTimeNumberOptions | null {\n return this.getAttribute('day') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the day.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set day(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('day', v)\n } else {\n this.removeAttribute('day')\n }\n }\n\n /**\n * The representation of the hour.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get hour(): DateTimeNumberOptions | null {\n return this.getAttribute('hour') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the hour.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set hour(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('hour', v)\n } else {\n this.removeAttribute('hour')\n }\n }\n\n /**\n * The representation of the minute.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get minute(): DateTimeNumberOptions | null {\n return this.getAttribute('minute') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the minute.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set minute(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('minute', v)\n } else {\n this.removeAttribute('minute')\n }\n }\n\n /**\n * The representation of the second.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get second(): DateTimeNumberOptions | null {\n return this.getAttribute('second') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the second.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set second(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('second', v)\n } else {\n this.removeAttribute('second')\n }\n }\n\n /**\n * The representation of the weekday.\n * Possible values are \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get weekday(): DateTimeTextOptions | null {\n return this.getAttribute('weekday') as DateTimeTextOptions\n }\n\n /**\n * The representation of the weekday.\n * @param v Possible values are \"narrow\", \"short\", \"long\".\n */\n set weekday(v: DateTimeTextOptions | null) {\n if (v) {\n this.setAttribute('weekday', v)\n } else {\n this.removeAttribute('weekday')\n }\n }\n\n /**\n * The representation of the time zone name.\n *\n * Possible values are \"short\", \"long\".\n * @attribute\n */\n get timeZoneName(): DateTimeTimezoneOptions | null {\n return this.getAttribute('time-zone-name') as DateTimeTimezoneOptions\n }\n\n /**\n * The representation of the time zone name.\n *\n * @param v Possible values are \"short\", \"long\".\n */\n set timeZoneName(v: DateTimeTimezoneOptions | null) {\n if (v) {\n this.setAttribute('time-zone-name', v)\n } else {\n this.removeAttribute('time-zone-name')\n }\n }\n\n /**\n * The time zone to use. The only value implementations must recognize\n * is \"UTC\"; the default is the runtime's default time zone.\n * Implementations may also recognize the time zone names of the IANA\n * time zone database, such as \"Asia/Shanghai\", \"Asia/Kolkata\",\n * \"America/New_York\".\n * @attribute\n */\n get timeZone(): string | null {\n return this.getAttribute('time-zone')\n }\n\n /**\n * The time zone to use. The only value implementations must recognize\n * is \"UTC\"; the default is the runtime's default time zone.\n * Implementations may also recognize the time zone names of the IANA\n * time zone database, such as \"Asia/Shanghai\", \"Asia/Kolkata\",\n * \"America/New_York\".\n */\n set timeZone(v: string | null) {\n if (v) {\n this.setAttribute('time-zone', v)\n } else {\n this.removeAttribute('time-zone')\n }\n }\n\n /**\n * The representation of the era.\n *\n * Possible values are \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get era(): DateTimeTextOptions | null {\n return this.getAttribute('era') as DateTimeTextOptions\n }\n\n /**\n * The representation of the era.\n *\n * @param v Possible values are \"narrow\", \"short\", \"long\".\n */\n set era(v: DateTimeTextOptions | null) {\n if (v) {\n this.setAttribute('era', v)\n } else {\n this.removeAttribute('era')\n }\n }\n\n private __hour12set: boolean | null = null\n\n /**\n * Whether to use 12-hour time (as opposed to 24-hour time).\n * Possible values are `true` and `false`; the default is locale\n * dependent.\n */\n get hour12(): boolean | null {\n if (!this.hasAttribute('hour12') && !this.__hour12set) {\n return null\n }\n return this.hasAttribute('hour12')\n }\n\n /**\n * Whether to use 12-hour time (as opposed to 24-hour time).\n * Possible values are `true` and `false`; the default is locale\n * dependent.\n */\n set hour12(v: boolean | null) {\n this.__hour12set = true\n if (v) {\n this.setAttribute('hour12', '')\n } else {\n this.removeAttribute('hour12')\n }\n }\n\n private __date: Date | string | number | null = null\n\n /**\n * A date object to render.\n * It can be a `Date` object, number representing a timestamp\n * or valid date string. The argument is parsed by `Date` constructor\n * to produce the value.\n * @attribute\n */\n get date(): Date | string | number | null {\n if (this.__date) {\n return this.__date\n }\n return this.getAttribute('date')\n }\n\n /**\n * A date object to render.\n * It can be a `Date` object, number representing a timestamp\n * or valid date string. The argument is parsed by `Date` constructor\n * to produce the value.\n *\n * @param {Date|string|number} v The date to render\n */\n set date(v: Date | string | number | null) {\n this.__date = v\n if (typeof v === 'string') {\n this.setAttribute('date', v)\n } else {\n this._updateLabel()\n }\n }\n\n get itemprop(): string | null {\n return this._getTimeNode().getAttribute('itemprop')\n }\n\n set itemprop(value: string | null) {\n const old = this.itemprop\n if (old === value) {\n return\n }\n if (old && value === null) {\n // This setter moves attribute from this element to \"<time>\" element.\n // When the attribute is removed from this then it becomes null.\n return\n }\n const node = this._getTimeNode()\n if (value) {\n node.setAttribute('itemprop', value)\n this.removeAttribute('itemprop')\n } else {\n node.removeAttribute('itemprop')\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n if (name === 'itemprop') {\n this[name] = newValue\n return\n }\n this._updateLabel()\n }\n\n /**\n * Parses input `date` to a Date object.\n * @param date A date to parse\n */\n protected _getParsableDate(date: string | number | Date | null): Date {\n if (!date) {\n date = new Date()\n } else if (typeof date === 'string') {\n try {\n date = new Date(date)\n if (Number.isNaN(date.getDate())) {\n date = new Date()\n }\n } catch {\n date = new Date()\n }\n } else if (!Number.isNaN(date)) {\n date = new Date(date)\n } else if (!(date instanceof Date)) {\n date = new Date()\n }\n return date\n }\n\n _getIntlOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {}\n if (this.year) {\n options.year = this.year\n }\n if (this.month) {\n options.month = this.month\n }\n if (this.day) {\n options.day = this.day\n }\n if (this.hour) {\n options.hour = this.hour\n }\n if (this.minute) {\n options.minute = this.minute\n }\n if (this.second) {\n options.second = this.second\n }\n if (this.weekday) {\n options.weekday = this.weekday\n }\n if (this.era) {\n options.era = this.era\n }\n if (this.timeZoneName) {\n options.timeZoneName = this.timeZoneName\n }\n if (this.timeZone) {\n options.timeZone = this.timeZone\n }\n if (this.hour12 !== undefined && this.hour12 !== null) {\n options.hour12 = this.hour12\n }\n return options\n }\n\n /**\n * @returns A reference to a `<time>` element that is in the shadow DOM of this element.\n */\n _getTimeNode(): HTMLTimeElement {\n const root = this.shadowRoot as ShadowRoot\n let node = root.querySelector('time')\n if (!node) {\n node = document.createElement('time')\n root.appendChild(node)\n }\n return node\n }\n\n _updateLabel(): void {\n if (!this.parentElement) {\n return\n }\n const date = this._getParsableDate(this.date)\n const node = this._getTimeNode()\n node.setAttribute('datetime', date.toISOString())\n /* istanbul ignore if */\n if (typeof Intl === 'undefined') {\n node.innerText = date.toString()\n return\n }\n let locales\n if (this.locales) {\n locales = this.locales\n }\n const options = this._getIntlOptions()\n const value = new Intl.DateTimeFormat(locales, options).format(date)\n node.innerText = value\n }\n}\n"]}
1
+ {"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../../src/md/date/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A;QAC1C,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;YACrC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,OAAM;QACR,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;QAChC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;QACjD,wBAAwB;QACxB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;YAChC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;YAChC,OAAM;QACR,CAAC;QACD,IAAI,OAAO,CAAA;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QACxB,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QACtC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QACpE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;CACF","sourcesContent":["export type DateTimeTextOptions = 'long' | 'short' | 'narrow'\nexport type DateTimeNumberOptions = 'numeric' | '2-digit'\nexport type DateTimeTimezoneOptions = 'long' | 'short'\nexport type DateTimeTextNumberOptions = DateTimeTextOptions | DateTimeNumberOptions\n\n/**\n * An element to display formatted date and time.\n *\n * The `date` property accepts Date object, Number as a timestamp or string\n * that will be parsed to the Date object.\n *\n * This element uses the `Intl` interface which is available in IE 11+ browsers.\n *\n * To format the date use [Intl.DateTimeFormat]\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat)\n * interface options.\n *\n * The default value for each date-time component property is undefined,\n * but if all component properties are undefined, then year, month, and day\n * are assumed to be \"numeric\" (per spec).\n *\n * ### Example\n *\n * ```html\n * <date-time date=\"2010-12-10T11:50:45Z\" year=\"numeric\" month=\"narrow\" day=\"numeric\"></date-time>\n * ```\n *\n * The element provides accessibility by using the `time` element and setting\n * the `datetime` attribute on it.\n */\nexport default class DateTime extends HTMLElement {\n static get observedAttributes(): string[] {\n return [\n 'locales',\n 'date',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'weekday',\n 'time-zone-name',\n 'era',\n 'time-zone',\n 'hour12',\n 'itemprop',\n ]\n }\n\n protected _observer = new MutationObserver(() => this._mutationHandler())\n\n constructor() {\n super()\n this.attachShadow({ mode: 'open' })\n }\n\n connectedCallback(): void {\n this._observer.observe(this.shadowRoot as ShadowRoot, {\n childList: true,\n characterData: true,\n subtree: true,\n })\n this._updateLabel()\n }\n\n disconnectedCallback(): void {\n this._observer.disconnect()\n }\n\n _mutationHandler(): void {\n this.setAttribute('aria-label', (this.shadowRoot as ShadowRoot).textContent || '')\n }\n\n /**\n * A string with a BCP 47 language tag, or an array of such strings.\n * For the general form and interpretation of the locales argument,\n * see the Intl page.\n * The following Unicode extension keys are allowed:\n * - nu - Numbering system. Possible values include: \"arab\", \"arabext\",\n * \"bali\", \"beng\", \"deva\", \"fullwide\", \"gujr\", \"guru\", \"hanidec\", \"khmr\",\n * \"knda\", \"laoo\", \"latn\", \"limb\", \"mlym\", \"mong\", \"mymr\", \"orya\",\n * \"tamldec\", \"telu\", \"thai\", \"tibt\".\n * - ca - Calendar. Possible values include: \"buddhist\", \"chinese\",\n * \"coptic\", \"ethioaa\", \"ethiopic\", \"gregory\", \"hebrew\", \"indian\",\n * \"islamic\", \"islamicc\", \"iso8601\", \"japanese\", \"persian\", \"roc\".\n * @attribute\n */\n get locales(): string | null {\n return this.getAttribute('locales')\n }\n\n /**\n * A string with a BCP 47 language tag, or an array of such strings.\n * For the general form and interpretation of the locales argument,\n * see the Intl page.\n * The following Unicode extension keys are allowed:\n * - nu - Numbering system. Possible values include: \"arab\", \"arabext\",\n * \"bali\", \"beng\", \"deva\", \"fullwide\", \"gujr\", \"guru\", \"hanidec\", \"khmr\",\n * \"knda\", \"laoo\", \"latn\", \"limb\", \"mlym\", \"mong\", \"mymr\", \"orya\",\n * \"tamldec\", \"telu\", \"thai\", \"tibt\".\n * - ca - Calendar. Possible values include: \"buddhist\", \"chinese\",\n * \"coptic\", \"ethioaa\", \"ethiopic\", \"gregory\", \"hebrew\", \"indian\",\n * \"islamic\", \"islamicc\", \"iso8601\", \"japanese\", \"persian\", \"roc\".\n */\n set locales(v: string | null) {\n if (v) {\n this.setAttribute('locales', v)\n } else {\n this.removeAttribute('locales')\n }\n }\n\n /**\n * The representation of the year.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get year(): DateTimeNumberOptions | null {\n return this.getAttribute('year') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the year.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set year(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('year', v)\n } else {\n this.removeAttribute('year')\n }\n }\n\n /**\n * The representation of the month.\n * Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get month(): DateTimeTextNumberOptions | null {\n return this.getAttribute('month') as DateTimeTextNumberOptions\n }\n\n /**\n * The representation of the month.\n * @param v Possible values are \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\".\n */\n set month(v: DateTimeTextNumberOptions | null) {\n if (v) {\n this.setAttribute('month', v)\n } else {\n this.removeAttribute('month')\n }\n }\n\n /**\n * The representation of the day.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get day(): DateTimeNumberOptions | null {\n return this.getAttribute('day') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the day.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set day(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('day', v)\n } else {\n this.removeAttribute('day')\n }\n }\n\n /**\n * The representation of the hour.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get hour(): DateTimeNumberOptions | null {\n return this.getAttribute('hour') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the hour.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set hour(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('hour', v)\n } else {\n this.removeAttribute('hour')\n }\n }\n\n /**\n * The representation of the minute.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get minute(): DateTimeNumberOptions | null {\n return this.getAttribute('minute') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the minute.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set minute(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('minute', v)\n } else {\n this.removeAttribute('minute')\n }\n }\n\n /**\n * The representation of the second.\n * Possible values are \"numeric\", \"2-digit\".\n * @attribute\n */\n get second(): DateTimeNumberOptions | null {\n return this.getAttribute('second') as DateTimeNumberOptions\n }\n\n /**\n * The representation of the second.\n * @param v Possible values are \"numeric\", \"2-digit\".\n */\n set second(v: DateTimeNumberOptions | null) {\n if (v) {\n this.setAttribute('second', v)\n } else {\n this.removeAttribute('second')\n }\n }\n\n /**\n * The representation of the weekday.\n * Possible values are \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get weekday(): DateTimeTextOptions | null {\n return this.getAttribute('weekday') as DateTimeTextOptions\n }\n\n /**\n * The representation of the weekday.\n * @param v Possible values are \"narrow\", \"short\", \"long\".\n */\n set weekday(v: DateTimeTextOptions | null) {\n if (v) {\n this.setAttribute('weekday', v)\n } else {\n this.removeAttribute('weekday')\n }\n }\n\n /**\n * The representation of the time zone name.\n *\n * Possible values are \"short\", \"long\".\n * @attribute\n */\n get timeZoneName(): DateTimeTimezoneOptions | null {\n return this.getAttribute('time-zone-name') as DateTimeTimezoneOptions\n }\n\n /**\n * The representation of the time zone name.\n *\n * @param v Possible values are \"short\", \"long\".\n */\n set timeZoneName(v: DateTimeTimezoneOptions | null) {\n if (v) {\n this.setAttribute('time-zone-name', v)\n } else {\n this.removeAttribute('time-zone-name')\n }\n }\n\n /**\n * The time zone to use. The only value implementations must recognize\n * is \"UTC\"; the default is the runtime's default time zone.\n * Implementations may also recognize the time zone names of the IANA\n * time zone database, such as \"Asia/Shanghai\", \"Asia/Kolkata\",\n * \"America/New_York\".\n * @attribute\n */\n get timeZone(): string | null {\n return this.getAttribute('time-zone')\n }\n\n /**\n * The time zone to use. The only value implementations must recognize\n * is \"UTC\"; the default is the runtime's default time zone.\n * Implementations may also recognize the time zone names of the IANA\n * time zone database, such as \"Asia/Shanghai\", \"Asia/Kolkata\",\n * \"America/New_York\".\n */\n set timeZone(v: string | null) {\n if (v) {\n this.setAttribute('time-zone', v)\n } else {\n this.removeAttribute('time-zone')\n }\n }\n\n /**\n * The representation of the era.\n *\n * Possible values are \"narrow\", \"short\", \"long\".\n * @attribute\n */\n get era(): DateTimeTextOptions | null {\n return this.getAttribute('era') as DateTimeTextOptions\n }\n\n /**\n * The representation of the era.\n *\n * @param v Possible values are \"narrow\", \"short\", \"long\".\n */\n set era(v: DateTimeTextOptions | null) {\n if (v) {\n this.setAttribute('era', v)\n } else {\n this.removeAttribute('era')\n }\n }\n\n private __hour12set: boolean | null = null\n\n /**\n * Whether to use 12-hour time (as opposed to 24-hour time).\n * Possible values are `true` and `false`; the default is locale\n * dependent.\n */\n get hour12(): boolean | null {\n if (!this.hasAttribute('hour12') && !this.__hour12set) {\n return null\n }\n return this.hasAttribute('hour12')\n }\n\n /**\n * Whether to use 12-hour time (as opposed to 24-hour time).\n * Possible values are `true` and `false`; the default is locale\n * dependent.\n */\n set hour12(v: boolean | null) {\n this.__hour12set = true\n if (v) {\n this.setAttribute('hour12', '')\n } else {\n this.removeAttribute('hour12')\n }\n }\n\n private __date: Date | string | number | null = null\n\n /**\n * A date object to render.\n * It can be a `Date` object, number representing a timestamp\n * or valid date string. The argument is parsed by `Date` constructor\n * to produce the value.\n * @attribute\n */\n get date(): Date | string | number | null {\n if (this.__date) {\n return this.__date\n }\n return this.getAttribute('date')\n }\n\n /**\n * A date object to render.\n * It can be a `Date` object, number representing a timestamp\n * or valid date string. The argument is parsed by `Date` constructor\n * to produce the value.\n *\n * @param {Date|string|number} v The date to render\n */\n set date(v: Date | string | number | null) {\n this.__date = v\n if (typeof v === 'string') {\n this.setAttribute('date', v)\n } else {\n this._updateLabel()\n }\n }\n\n get itemprop(): string | null {\n return this._getTimeNode().getAttribute('itemprop')\n }\n\n set itemprop(value: string | null) {\n const old = this.itemprop\n if (old === value) {\n return\n }\n if (old && value === null) {\n // This setter moves attribute from this element to \"<time>\" element.\n // When the attribute is removed from this then it becomes null.\n return\n }\n const node = this._getTimeNode()\n if (value) {\n node.setAttribute('itemprop', value)\n this.removeAttribute('itemprop')\n } else {\n node.removeAttribute('itemprop')\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n if (name === 'itemprop') {\n this[name] = newValue\n return\n }\n this._updateLabel()\n }\n\n /**\n * Parses input `date` to a Date object.\n * @param date A date to parse\n */\n protected _getParsableDate(date: string | number | Date | null): Date {\n if (!date) {\n date = new Date()\n } else if (typeof date === 'string') {\n try {\n date = new Date(date)\n if (Number.isNaN(date.getDate())) {\n date = new Date()\n }\n } catch {\n date = new Date()\n }\n } else if (!Number.isNaN(date)) {\n date = new Date(date)\n } else if (!(date instanceof Date)) {\n date = new Date()\n }\n return date\n }\n\n _getIntlOptions(): Intl.DateTimeFormatOptions {\n const options: Intl.DateTimeFormatOptions = {}\n if (this.year) {\n options.year = this.year\n }\n if (this.month) {\n options.month = this.month\n }\n if (this.day) {\n options.day = this.day\n }\n if (this.hour) {\n options.hour = this.hour\n }\n if (this.minute) {\n options.minute = this.minute\n }\n if (this.second) {\n options.second = this.second\n }\n if (this.weekday) {\n options.weekday = this.weekday\n }\n if (this.era) {\n options.era = this.era\n }\n if (this.timeZoneName) {\n options.timeZoneName = this.timeZoneName\n }\n if (this.timeZone) {\n options.timeZone = this.timeZone\n }\n if (this.hour12 !== undefined && this.hour12 !== null) {\n options.hour12 = this.hour12\n }\n return options\n }\n\n /**\n * @returns A reference to a `<time>` element that is in the shadow DOM of this element.\n */\n _getTimeNode(): HTMLTimeElement {\n const root = this.shadowRoot as ShadowRoot\n let node = root.querySelector('time')\n if (!node) {\n node = document.createElement('time')\n root.appendChild(node)\n }\n return node\n }\n\n _updateLabel(): void {\n if (!this.parentElement) {\n return\n }\n const date = this._getParsableDate(this.date)\n const node = this._getTimeNode()\n node.setAttribute('datetime', date.toISOString())\n /* istanbul ignore if */\n if (typeof Intl === 'undefined') {\n node.innerText = date.toString()\n return\n }\n let locales\n if (this.locales) {\n locales = this.locales\n }\n const options = this._getIntlOptions()\n const value = new Intl.DateTimeFormat(locales, options).format(date)\n node.innerText = value\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ export { UiDatePickerCalendar } from './internals/DatePickerCalendar.js';
2
+ export { UiDatePickerInput } from './ui-date-picker-input.js';
3
+ export { UiDatePickerModal } from './ui-date-picker-modal.js';
4
+ export { UiDatePickerModalInput } from './ui-date-picker-modal-input.js';
5
+ export * from './internals/DatePickerUtils.js';
6
+ export type { DateSelectEvent, DateRangeSelectEvent } from './internals/DatePickerCalendar.js';
7
+ export type { ModalDatePickerChangeEvent } from './ui-date-picker-modal.js';
8
+ export type { ModalInputDatePickerChangeEvent } from './ui-date-picker-modal-input.js';
9
+ import './ui-date-picker-input.js';
10
+ import './ui-date-picker-modal.js';
11
+ import './ui-date-picker-modal-input.js';
12
+ import './internals/DatePickerCalendar.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/md/date-picker/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAGxE,cAAc,gCAAgC,CAAA;AAC9C,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC9F,YAAY,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAC3E,YAAY,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAA;AAGtF,OAAO,2BAA2B,CAAA;AAClC,OAAO,2BAA2B,CAAA;AAClC,OAAO,iCAAiC,CAAA;AACxC,OAAO,mCAAmC,CAAA"}
@@ -0,0 +1,13 @@
1
+ // Export main components
2
+ export { UiDatePickerCalendar } from './internals/DatePickerCalendar.js';
3
+ export { UiDatePickerInput } from './ui-date-picker-input.js';
4
+ export { UiDatePickerModal } from './ui-date-picker-modal.js';
5
+ export { UiDatePickerModalInput } from './ui-date-picker-modal-input.js';
6
+ // Export utilities and types
7
+ export * from './internals/DatePickerUtils.js';
8
+ // Import components for registration
9
+ import './ui-date-picker-input.js';
10
+ import './ui-date-picker-modal.js';
11
+ import './ui-date-picker-modal-input.js';
12
+ import './internals/DatePickerCalendar.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/md/date-picker/index.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAExE,6BAA6B;AAC7B,cAAc,gCAAgC,CAAA;AAK9C,qCAAqC;AACrC,OAAO,2BAA2B,CAAA;AAClC,OAAO,2BAA2B,CAAA;AAClC,OAAO,iCAAiC,CAAA;AACxC,OAAO,mCAAmC,CAAA","sourcesContent":["// Export main components\nexport { UiDatePickerCalendar } from './internals/DatePickerCalendar.js'\nexport { UiDatePickerInput } from './ui-date-picker-input.js'\nexport { UiDatePickerModal } from './ui-date-picker-modal.js'\nexport { UiDatePickerModalInput } from './ui-date-picker-modal-input.js'\n\n// Export utilities and types\nexport * from './internals/DatePickerUtils.js'\nexport type { DateSelectEvent, DateRangeSelectEvent } from './internals/DatePickerCalendar.js'\nexport type { ModalDatePickerChangeEvent } from './ui-date-picker-modal.js'\nexport type { ModalInputDatePickerChangeEvent } from './ui-date-picker-modal-input.js'\n\n// Import components for registration\nimport './ui-date-picker-input.js'\nimport './ui-date-picker-modal.js'\nimport './ui-date-picker-modal-input.js'\nimport './internals/DatePickerCalendar.js'\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const calendarStyles: import("lit").CSSResult;
2
+ export declare const inputStyles: import("lit").CSSResult;
3
+ export declare const modalStyles: import("lit").CSSResult;
4
+ //# sourceMappingURL=DatePicker.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/date-picker/internals/DatePicker.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBAyL1B,CAAA;AAED,eAAO,MAAM,WAAW,yBAmCvB,CAAA;AAED,eAAO,MAAM,WAAW,yBAwLvB,CAAA"}