@pine-ds/core 3.15.1 → 3.15.2-dev.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.
Files changed (29) hide show
  1. package/components/pds-dropdown-menu-item.js +3 -3
  2. package/components/pds-dropdown-menu-item.js.map +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +1 -1
  5. package/dist/cjs/pds-dropdown-menu-item.entry.cjs.js.map +1 -1
  6. package/dist/cjs/pine-core.cjs.js +1 -1
  7. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +3 -3
  8. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js.map +1 -1
  9. package/dist/docs.json +3 -3
  10. package/dist/esm/loader.js +1 -1
  11. package/dist/esm/pds-dropdown-menu-item.entry.js +1 -1
  12. package/dist/esm/pds-dropdown-menu-item.entry.js.map +1 -1
  13. package/dist/esm/pine-core.js +1 -1
  14. package/dist/esm-es5/loader.js +1 -1
  15. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  16. package/dist/esm-es5/pds-dropdown-menu-item.entry.js.map +1 -1
  17. package/dist/esm-es5/pine-core.js +1 -1
  18. package/dist/pine-core/{p-795e1727.entry.js → p-56cf3af8.entry.js} +2 -2
  19. package/dist/pine-core/{p-ef56bc80.system.entry.js → p-5f552640.system.entry.js} +2 -2
  20. package/dist/pine-core/p-JAVnELnm.system.js +1 -1
  21. package/dist/pine-core/p-anXbtQm4.system.js.map +1 -0
  22. package/dist/pine-core/pds-dropdown-menu-item.entry.esm.js.map +1 -1
  23. package/dist/pine-core/pine-core.esm.js +1 -1
  24. package/hydrate/index.js +4 -4
  25. package/hydrate/index.mjs +4 -4
  26. package/package.json +2 -2
  27. package/dist/pine-core/p-DgtQU13G.system.js.map +0 -1
  28. /package/dist/pine-core/{p-795e1727.entry.js.map → p-56cf3af8.entry.js.map} +0 -0
  29. /package/dist/pine-core/{p-ef56bc80.system.entry.js.map → p-5f552640.system.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"p-DgtQU13G.system.js","sources":["src/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.scss?tag=pds-dropdown-menu-item&encapsulation=shadow","src/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.tsx"],"sourcesContent":[":host {\n cursor: pointer;\n display: flex;\n width: 100%; /* Ensure the host takes full width */\n}\n\n/* Make the disabled styles more specific and add !important to ensure they apply */\n:host(.is-disabled) {\n cursor: not-allowed !important;\n opacity: 0.5 !important;\n\n .pds-dropdown-menu-item__content {\n cursor: not-allowed !important;\n pointer-events: none !important;\n }\n}\n\n.pds-dropdown-menu-item__content {\n align-items: center;\n appearance: none;\n background: transparent;\n border: 0;\n border-radius: var(--pine-dimension-xs);\n color: var(--pine-color-text);\n display: flex;\n flex-grow: 1; /* Make it grow to fill available space */\n font: var(--pine-typography-body-medium);\n gap: var(--pine-dimension-xs);\n margin: calc(var(--pine-border-width) + 2px);\n padding: var(--pine-dimension-xs);\n text-align: start; /* Ensure text aligns properly */\n width: 100%; /* Ensure full width */\n\n &:hover {\n background-color: var(--pine-color-background-muted);\n color: var(--pine-color-text-hover);\n }\n\n /* Focus styles applied via class + browser focus */\n &:focus,\n &:focus-visible,\n &.has-focus {\n outline: var(--pine-outline-focus);\n outline-offset: var(--pine-border-width);\n }\n\n}\n\n:host(.destructive) {\n .pds-dropdown-menu-item__content {\n align-items: center;\n color: var(--pine-color-danger);\n\n &:hover {\n background-color: var(--pine-color-danger-disabled);\n color: var(--pine-color-danger-hover);\n }\n\n &:focus,\n &:focus-visible,\n &.has-focus {\n background-color: var(--pine-color-danger-disabled);\n outline: var(--pine-outline-focus-danger);\n outline-offset: var(--pine-border-width);\n }\n }\n}\n\n/* Remove outline on contained links using the custom property */\npds-link::part(link):focus,\npds-link::part(link):focus-visible {\n box-shadow: none;\n outline: none;\n}\n\npds-link::part(link) {\n display: block;\n margin: calc(var(--pine-dimension-xs) * -1);\n padding: var(--pine-dimension-xs);\n text-decoration: none;\n width: calc(100% + var(--pine-dimension-xs) * 2);\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport type { BasePdsProps } from '@utils/interfaces';\n\n@Component({\n tag: 'pds-dropdown-menu-item',\n styleUrl: 'pds-dropdown-menu-item.scss',\n shadow: true,\n})\nexport class PdsDropdownMenuItem implements BasePdsProps {\n @Element() host: HTMLPdsDropdownMenuItemElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * It determines whether or not the dropdown-item is destructive.\n * @defaultValue false\n */\n @Prop() destructive: boolean = false;\n\n /**\n * It determines whether or not the dropdown-item is disabled.\n * @defaultValue false\n */\n @Prop() disabled: boolean = false;\n\n\n /**\n * If provided, renders the dropdown-item as an anchor (`<a>`) element instead of a button.\n */\n @Prop() href: string | undefined;\n\n /**\n * Determines whether the link should open in a new tab and display an external icon.\n * This is a simpler alternative to using `target=\"_blank\"` for the common case.\n * @defaultValue false\n */\n @Prop() external: boolean = false;\n\n /**\n * Specifies where to open the linked document when href is provided.\n * Takes precedence over the `external` prop if both are set.\n * Only applies when href is set.\n * @defaultValue undefined\n */\n @Prop() target?: '_blank' | '_self' | '_parent' | '_top';\n\n /**\n * Emitted when the dropdown-item is clicked.\n *\n */\n @Event() pdsClick: EventEmitter<{itemIndex: number, item: HTMLPdsDropdownMenuItemElement, content: string}>;\n\n /**\n * Trigger the click event\n */\n @Method()\n async clickItem() {\n this.handleClick();\n };\n\n\n private handleClick() {\n // Filter only pds-dropdown-menu-item elements and find the index of the current item\n const menuItems = Array.from(this.host.parentNode.children).filter(\n (child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item'\n );\n const itemIndex = menuItems.indexOf(this.host);\n\n // Get the text content from the slotted content\n const content = this.host.textContent?.trim() || '';\n\n this.pdsClick.emit({\n itemIndex,\n item: this.host,\n content\n });\n }\n\n @State() hasFocus: boolean = false;\n\n private handleFocus = () => {\n this.hasFocus = true;\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n }\n\n private renderElement() {\n if (this.href !== undefined) {\n return (\n <pds-link\n href={this.disabled ? null : this.href}\n external={this.external}\n target={this.target}\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </pds-link>\n );\n }\n\n return (\n <button\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n type=\"button\"\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </button>\n );\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Handle keyboard events\n if (!this.disabled && (event.key === 'Enter')) {\n // Only prevent default for button elements or Space key\n // For links with Enter key, we want the default navigation behavior\n if (!this.href) {\n event.preventDefault();\n }\n this.handleClick();\n }\n }\n\n render() {\n return (\n <Host id={this.componentId}\n class={{ 'is-disabled': this.disabled, 'destructive': !this.disabled && this.destructive }}\n onClick={() => !this.disabled && this.handleClick()}\n role=\"none\"\n tabIndex={-1}\n aria-disabled={this.disabled ? 'true' : null}\n >\n {this.renderElement()}\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;MAAA,MAAM,sBAAsB,GAAG,67DAA67D;;YCQ/8D,mBAAmB,qCAAA,MAAA;MALhC,IAAA,WAAA,CAAA,OAAA,EAAA;;;MAaE;;;MAGG;MACK,QAAA,IAAW,CAAA,WAAA,GAAY,KAAK;MAEpC;;;MAGG;MAC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