@pine-ds/core 3.20.0 → 3.21.1
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.
- package/components/pds-accordion.js +4 -3
- package/components/pds-accordion.js.map +1 -1
- package/components/pds-combobox.js +10 -2
- package/components/pds-combobox.js.map +1 -1
- package/dist/cjs/pds-accordion.cjs.entry.js +3 -2
- package/dist/cjs/pds-accordion.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +10 -2
- package/dist/cjs/pds-combobox.entry.cjs.js.map +1 -1
- package/dist/collection/components/pds-accordion/pds-accordion.js +20 -2
- package/dist/collection/components/pds-accordion/pds-accordion.js.map +1 -1
- package/dist/collection/components/pds-combobox/pds-combobox.js +10 -2
- package/dist/collection/components/pds-combobox/pds-combobox.js.map +1 -1
- package/dist/docs.json +17 -2
- package/dist/esm/pds-accordion.entry.js +4 -3
- package/dist/esm/pds-accordion.entry.js.map +1 -1
- package/dist/esm/pds-combobox.entry.js +10 -2
- package/dist/esm/pds-combobox.entry.js.map +1 -1
- package/dist/esm-es5/pds-accordion.entry.js +1 -1
- package/dist/esm-es5/pds-accordion.entry.js.map +1 -1
- package/dist/esm-es5/pds-combobox.entry.js +1 -1
- package/dist/esm-es5/pds-combobox.entry.js.map +1 -1
- package/dist/pine-core/p-1d82417a.entry.js +2 -0
- package/dist/pine-core/p-1d82417a.entry.js.map +1 -0
- package/dist/pine-core/{p-c301925f.system.entry.js → p-25255ab8.system.entry.js} +2 -2
- package/dist/pine-core/{p-c301925f.system.entry.js.map → p-25255ab8.system.entry.js.map} +1 -1
- package/dist/pine-core/{p-5dbbb2be.entry.js → p-44035cf4.entry.js} +3 -3
- package/dist/pine-core/{p-5dbbb2be.entry.js.map → p-44035cf4.entry.js.map} +1 -1
- package/dist/pine-core/p-DQCerqxZ.system.js.map +1 -0
- package/dist/pine-core/p-DqO0Rc5m.system.js.map +1 -0
- package/dist/pine-core/p-JAVnELnm.system.js +1 -1
- package/dist/pine-core/p-abb72971.system.entry.js +2 -0
- package/dist/pine-core/p-abb72971.system.entry.js.map +1 -0
- package/dist/pine-core/pds-accordion.entry.esm.js.map +1 -1
- package/dist/pine-core/pds-combobox.entry.esm.js.map +1 -1
- package/dist/pine-core/pine-core.esm.js +1 -1
- package/dist/types/components/pds-accordion/pds-accordion.d.ts +5 -0
- package/dist/types/components.d.ts +19 -0
- package/dist/vscode.html-data.json +1 -1
- package/hydrate/index.js +13 -4
- package/hydrate/index.mjs +13 -4
- package/package.json +2 -2
- package/dist/pine-core/p-5e879622.entry.js +0 -2
- package/dist/pine-core/p-5e879622.entry.js.map +0 -1
- package/dist/pine-core/p-6e92e120.system.entry.js +0 -2
- package/dist/pine-core/p-6e92e120.system.entry.js.map +0 -1
- package/dist/pine-core/p-B3xx1u93.system.js.map +0 -1
- package/dist/pine-core/p-BAp8Xlyt.system.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pds-accordion.entry.js","sources":["src/components/pds-accordion/pds-accordion.scss?tag=pds-accordion&encapsulation=shadow","src/components/pds-accordion/pds-accordion.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\ndetails {\n --number-animation-transform-timing: 200ms;\n\n border-radius: var(--pine-dimension-xs);\n\n pds-icon {\n transform: scaleY(1);\n }\n}\n\n/* stylelint-disable-next-line */\ndetails[open] {\n background-color: var(--pine-color-background-container);\n\n summary {\n color: var(--pine-color-text-active);\n font-weight: var(--pine-font-weight-semi-bold);\n\n pds-icon {\n transform: scaleY(-1);\n }\n }\n}\n\nsummary {\n background-color: var(--pine-color-background-container);\n border-radius: var(--pine-dimension-xs);\n color: var(--pine-color-text-muted);\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size-body-md);\n font-weight: var(--pine-font-weight-medium);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding-block: calc(var(--pine-dimension-2xs) * 1.5);\n padding-inline-end: var(--pine-dimension-2xs);\n padding-inline-start: var(--pine-dimension-xs);\n\n // Removes marker on Firefox/Chrome\n /* stylelint-disable-next-line */\n align-items: center;\n display: flex;\n\n // Removes marker on Safari\n &::-webkit-details-marker {\n display: none;\n }\n\n &:hover {\n background: var(--pine-color-background-container-hover);\n color: var(--pine-color-text);\n cursor: pointer;\n }\n\n &:focus-visible {\n outline: var(--pine-outline-focus);\n position: relative;\n }\n\n pds-icon {\n margin-inline-start: auto;\n }\n}\n\n.pds-accordion__body {\n padding-block-end: calc(var(--pine-dimension-sm) + 2);\n padding-inline: calc(var(--pine-dimension-2xs) * 1.5);\n}\n","import { Component, h, Host, Prop, Watch } from '@stencil/core';\nimport { downSmall } from '@pine-ds/icons/icons';\n\n/**\n * @part accordion-body - Accordion body styles.\n * @part accordion-button - Accordion button/trigger styles.\n * @part accordion-icon - Accordion icon styles.\n * @slot (default) - Accordion body content.\n * @slot label - Accordion trigger button content.\n */\n@Component({\n tag: 'pds-accordion',\n styleUrls: ['pds-accordion.scss'],\n shadow: true,\n})\nexport class PdsAccordion {\n private detailsEl: HTMLDetailsElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n * @defaultValue null\n */\n @Prop() componentId: string;\n\n /**\n * Can be used to manually set the open state of the accordion.\n * @defaultValue false\n */\n @Prop({\n attribute: 'open',\n mutable: true,\n reflect: true,\n }) isOpen: boolean = false;\n\n @Watch('isOpen')\n handleOpenState(newValue: boolean) {\n this.
|
|
1
|
+
{"version":3,"file":"pds-accordion.entry.js","sources":["src/components/pds-accordion/pds-accordion.scss?tag=pds-accordion&encapsulation=shadow","src/components/pds-accordion/pds-accordion.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\ndetails {\n --number-animation-transform-timing: 200ms;\n\n border-radius: var(--pine-dimension-xs);\n\n pds-icon {\n transform: scaleY(1);\n }\n}\n\n/* stylelint-disable-next-line */\ndetails[open] {\n background-color: var(--pine-color-background-container);\n\n summary {\n color: var(--pine-color-text-active);\n font-weight: var(--pine-font-weight-semi-bold);\n\n pds-icon {\n transform: scaleY(-1);\n }\n }\n}\n\nsummary {\n background-color: var(--pine-color-background-container);\n border-radius: var(--pine-dimension-xs);\n color: var(--pine-color-text-muted);\n font-family: var(--pine-font-family-body);\n font-size: var(--pine-font-size-body-md);\n font-weight: var(--pine-font-weight-medium);\n letter-spacing: var(--pine-letter-spacing);\n line-height: var(--pine-line-height-body);\n padding-block: calc(var(--pine-dimension-2xs) * 1.5);\n padding-inline-end: var(--pine-dimension-2xs);\n padding-inline-start: var(--pine-dimension-xs);\n\n // Removes marker on Firefox/Chrome\n /* stylelint-disable-next-line */\n align-items: center;\n display: flex;\n\n // Removes marker on Safari\n &::-webkit-details-marker {\n display: none;\n }\n\n &:hover {\n background: var(--pine-color-background-container-hover);\n color: var(--pine-color-text);\n cursor: pointer;\n }\n\n &:focus-visible {\n outline: var(--pine-outline-focus);\n position: relative;\n }\n\n pds-icon {\n margin-inline-start: auto;\n }\n}\n\n.pds-accordion__body {\n padding-block-end: calc(var(--pine-dimension-sm) + 2);\n padding-inline: calc(var(--pine-dimension-2xs) * 1.5);\n}\n","import { Component, Event, EventEmitter, h, Host, Prop, Watch } from '@stencil/core';\nimport { downSmall } from '@pine-ds/icons/icons';\n\n/**\n * @part accordion-body - Accordion body styles.\n * @part accordion-button - Accordion button/trigger styles.\n * @part accordion-icon - Accordion icon styles.\n * @slot (default) - Accordion body content.\n * @slot label - Accordion trigger button content.\n */\n@Component({\n tag: 'pds-accordion',\n styleUrls: ['pds-accordion.scss'],\n shadow: true,\n})\nexport class PdsAccordion {\n private detailsEl: HTMLDetailsElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n * @defaultValue null\n */\n @Prop() componentId: string;\n\n /**\n * Can be used to manually set the open state of the accordion.\n * @defaultValue false\n */\n @Prop({\n attribute: 'open',\n mutable: true,\n reflect: true,\n }) isOpen: boolean = false;\n\n /**\n * Emitted when the accordion open state changes.\n */\n @Event() pdsAccordionToggle: EventEmitter<boolean>;\n\n @Watch('isOpen')\n handleOpenState(newValue: boolean) {\n this.pdsAccordionToggle.emit(newValue);\n }\n\n private handleToggle = () => {\n this.isOpen = this.detailsEl.open;\n };\n\n private getOpenAttribute = () => {\n if (this.isOpen !== false) {\n return { open: true };\n }\n return '';\n };\n\n componentDidLoad() {\n this.detailsEl.addEventListener('toggle', this.handleToggle);\n }\n\n render() {\n return (\n <Host class=\"pds-accordion\" id={this.componentId}>\n <details {...this.getOpenAttribute()} ref={(el) => (this.detailsEl = el as HTMLDetailsElement)}>\n <summary part=\"accordion-button\">\n <slot name=\"label\">Details</slot>\n <pds-icon icon={downSmall} part=\"accordion-icon\" />\n </summary>\n <div part=\"accordion-body\" class=\"pds-accordion__body\">\n <slot />\n </div>\n </details>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG,miDAAmiD;;MCe9iD,YAAY,GAAA,MAAA;AALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAcE;;;AAGG;AAKA,QAAA,IAAM,CAAA,MAAA,GAAY,KAAK;AAYlB,QAAA,IAAY,CAAA,YAAA,GAAG,MAAK;YAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI;AACnC,SAAC;AAEO,QAAA,IAAgB,CAAA,gBAAA,GAAG,MAAK;AAC9B,YAAA,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,EAAE;AACzB,gBAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;;AAEvB,YAAA,OAAO,EAAE;AACX,SAAC;AAqBF;AAlCC,IAAA,eAAe,CAAC,QAAiB,EAAA;AAC/B,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC;;IAcxC,gBAAgB,GAAA;QACd,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC;;IAG9D,MAAM,GAAA;AACJ,QAAA,QACE,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAC,eAAe,EAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAA,EAC9C,CAAA,CAAA,SAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAa,IAAI,CAAC,gBAAgB,EAAE,EAAE,EAAA,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAwB,CAAC,EAAA,CAAA,EAC5F,CAAS,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,kBAAkB,EAAA,EAC9B,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,OAAO,EAAe,EAAA,SAAA,CAAA,EACjC,CAAU,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,gBAAgB,GAAG,CAC3C,EACV,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,IAAI,EAAC,gBAAgB,EAAC,KAAK,EAAC,qBAAqB,EAAA,EACpD,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAQ,CACJ,CACE,CACL;;;;;;;;;;"}
|
|
@@ -2004,6 +2004,14 @@ const PdsCombobox = class {
|
|
|
2004
2004
|
this.optionEls.push(optionEl);
|
|
2005
2005
|
this.allItems.push(optionEl);
|
|
2006
2006
|
});
|
|
2007
|
+
// Re-apply preselection if a value is set but no option has been selected yet.
|
|
2008
|
+
// This handles the case where `value` is set before async options have loaded.
|
|
2009
|
+
if (this.value && !this.selectedOption) {
|
|
2010
|
+
const matchingOption = this.optionEls.find(opt => opt.value === this.value);
|
|
2011
|
+
if (matchingOption) {
|
|
2012
|
+
this.setSelectedOption(matchingOption);
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2007
2015
|
this.filterOptions();
|
|
2008
2016
|
}
|
|
2009
2017
|
updateOptions() {
|
|
@@ -2616,10 +2624,10 @@ const PdsCombobox = class {
|
|
|
2616
2624
|
}
|
|
2617
2625
|
render() {
|
|
2618
2626
|
const triggerClass = `pds-combobox__button-trigger pds-combobox__button-trigger--${this.triggerVariant}`;
|
|
2619
|
-
return (h(Host, { key: '
|
|
2627
|
+
return (h(Host, { key: '8972918e55f8c0fba10399d963a49ab31b49eeae' }, h("div", { key: '5f5782e3fb83c7ff3fea2d4344324d888110b8fc', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.label && (h("label", { key: '286cab5baba38486c7e661384f0b5a6a38976891', htmlFor: this.componentId, class: "pds-combobox__label" }, h("span", { key: '3ccb30ead595d633bfe3ce624c99f9483c0d6265', class: this.hideLabel ? 'visually-hidden' : '' }, this.label))), this.trigger === 'input' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
|
|
2620
2628
|
this.inputEl = el;
|
|
2621
2629
|
this.triggerEl = el;
|
|
2622
|
-
}, class: "pds-combobox__input", type: "text", role: "combobox", "aria-autocomplete": "list", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: "combobox", "aria-haspopup": "listbox", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: "combobox", "aria-haspopup": "listbox", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), h("div", { key: '
|
|
2630
|
+
}, class: "pds-combobox__input", type: "text", role: "combobox", "aria-autocomplete": "list", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, value: this.displayText, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onClick: this.handleInputClick, onKeyDown: this.handleKeyDown, autocomplete: "off", part: "input" }), h("pds-icon", { icon: "enlarge", "aria-hidden": "true", class: "pds-combobox__input-icon" }))) : this.trigger === 'chip' ? (h("div", { class: this.getChipTriggerClass(), style: { width: this.triggerWidth }, role: "combobox", "aria-haspopup": "listbox", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "chip-trigger" }, this.renderChipTriggerContent())) : (h("div", { class: triggerClass, style: { width: this.triggerWidth }, role: "combobox", "aria-haspopup": "listbox", "aria-controls": "pds-combobox-listbox", "aria-activedescendant": this.isOpen && this.highlightedIndex >= 0 ? `pds-combobox-option-${this.highlightedIndex}` : undefined, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', "aria-label": this.hideLabel ? this.label : undefined, id: this.componentId, tabIndex: this.disabled ? -1 : 0, onClick: this.onButtonTriggerClick, "data-layout": this.customTriggerContent, onKeyDown: this.onButtonTriggerKeyDown, onKeyUp: this.onButtonTriggerKeyUp, ref: el => (this.triggerEl = el), part: "button-trigger" }, this.renderButtonTriggerContent())), h("div", { key: '02597d696490153015a5d41190598f24fa1b034e', style: { display: 'none' } }, h("slot", { key: '3bb35ff0c7cdde0cb3c4c0eeb9fc4879fcef62c6', onSlotchange: () => this.updateOptions() })), this.renderDropdown())));
|
|
2623
2631
|
}
|
|
2624
2632
|
static get formAssociated() { return true; }
|
|
2625
2633
|
get el() { return getElement(this); }
|