@pine-ds/core 3.24.4 → 3.25.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-alert.js +7 -1
- package/components/pds-alert.js.map +1 -1
- package/components/pds-combobox.js +45 -4
- package/components/pds-combobox.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pds-alert.cjs.entry.js +6 -1
- package/dist/cjs/pds-alert.entry.cjs.js.map +1 -1
- package/dist/cjs/pds-combobox.cjs.entry.js +45 -4
- package/dist/cjs/pds-combobox.entry.cjs.js.map +1 -1
- package/dist/cjs/pine-core.cjs.js +1 -1
- package/dist/collection/components/pds-alert/pds-alert.js +29 -1
- package/dist/collection/components/pds-alert/pds-alert.js.map +1 -1
- package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +19 -0
- package/dist/collection/components/pds-combobox/pds-combobox.js +46 -5
- package/dist/collection/components/pds-combobox/pds-combobox.js.map +1 -1
- package/dist/docs.json +31 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pds-alert.entry.js +6 -1
- package/dist/esm/pds-alert.entry.js.map +1 -1
- package/dist/esm/pds-combobox.entry.js +45 -4
- package/dist/esm/pds-combobox.entry.js.map +1 -1
- package/dist/esm/pine-core.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/pds-alert.entry.js +1 -1
- package/dist/esm-es5/pds-alert.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/esm-es5/pine-core.js +1 -1
- package/dist/pine-core/{p-af1dda3c.system.entry.js → p-200365ba.system.entry.js} +2 -2
- package/dist/pine-core/p-200365ba.system.entry.js.map +1 -0
- package/dist/pine-core/{p-3321448e.system.entry.js → p-4d2c4f5d.system.entry.js} +3 -3
- package/dist/pine-core/p-4d2c4f5d.system.entry.js.map +1 -0
- package/dist/pine-core/{p-1208f3f4.entry.js → p-57e36acc.entry.js} +2 -2
- package/dist/pine-core/p-57e36acc.entry.js.map +1 -0
- package/dist/pine-core/p-DA-RbdlV.system.js +1 -1
- package/dist/pine-core/p-DCcwKJEN.system.js.map +1 -0
- package/dist/pine-core/p-W82-XbRW.system.js.map +1 -0
- package/dist/pine-core/{p-c5e46981.entry.js → p-c16dc54e.entry.js} +2 -2
- package/dist/pine-core/p-c16dc54e.entry.js.map +1 -0
- package/dist/pine-core/pds-alert.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-alert/pds-alert.d.ts +5 -0
- package/dist/types/components/pds-combobox/pds-combobox.d.ts +14 -0
- package/dist/types/components.d.ts +12 -2
- package/dist/vscode.html-data.json +8 -1
- package/hydrate/index.js +52 -5
- package/hydrate/index.mjs +52 -5
- package/package.json +2 -2
- package/dist/pine-core/p-1208f3f4.entry.js.map +0 -1
- package/dist/pine-core/p-3321448e.system.entry.js.map +0 -1
- package/dist/pine-core/p-D0ED3Slj.system.js.map +0 -1
- package/dist/pine-core/p-DgpOLSbJ.system.js.map +0 -1
- package/dist/pine-core/p-af1dda3c.system.entry.js.map +0 -1
- package/dist/pine-core/p-c5e46981.entry.js.map +0 -1
package/components/pds-alert.js
CHANGED
|
@@ -24,6 +24,11 @@ const PdsAlert$1 = /*@__PURE__*/ proxyCustomElement(class PdsAlert extends HTMLE
|
|
|
24
24
|
* @defaultValue false
|
|
25
25
|
*/
|
|
26
26
|
this.dismissible = false;
|
|
27
|
+
/**
|
|
28
|
+
* If true, the leading icon is hidden.
|
|
29
|
+
* @defaultValue false
|
|
30
|
+
*/
|
|
31
|
+
this.hideIcon = false;
|
|
27
32
|
/**
|
|
28
33
|
* Sets the style variant of the alert.
|
|
29
34
|
* @defaultValue 'default'
|
|
@@ -59,7 +64,7 @@ const PdsAlert$1 = /*@__PURE__*/ proxyCustomElement(class PdsAlert extends HTMLE
|
|
|
59
64
|
};
|
|
60
65
|
// Get the icon name based on the current variant
|
|
61
66
|
const iconName = iconMap[this.variant] || iconMap.default;
|
|
62
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'fb36c6626a4b775971032936f3cc876d2471fc71', class: "pds-alert", id: this.componentId, variant: this.variant }, h("pds-box", { key: '5f80f68bfce168e11b9e83760b4a8d08b4a73b6b', class: `pds-alert__container pds-alert__container--${this.variant}`, "background-color": "var(--pds-alert-background)", "border-color": "var(--pds-alert-border-color)", "border-radius": "md", border: true, display: "block" }, h("pds-box", { key: '6047b04859a12d5dc48f263cdf66074a2a2940f1', gap: "sm", display: "flex" }, !this.hideIcon && (h("pds-icon", { key: '578a6932dd90984c21e797b8e57523ca29e9a723', class: `pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`, color: "var(--pds-alert-color-icon)", icon: iconName, size: "var(--pds-alert-icon-size)" })), h("pds-box", { key: 'abf825088987691dcf716937d2c0ad831e0f6bcf', class: "pds-alert__content-wrapper", direction: "column", gap: "xs", flex: "grow" }, this.heading && !this.small && (h("pds-text", { key: '539bda19f7b9e01192442a8895fa9439db56bd93', class: "pds-alert__heading", color: "var(--pds-alert-color-text)", size: "h5", tag: "h3", weight: "medium" }, this.heading)), this.renderContent()), this.dismissible && (h("button", { key: 'a233aabbc825584339cd1bcf7919db11b8a27479', class: "pds-alert__dismiss", type: "button", part: "dismiss", "aria-label": "Dismiss alert", onClick: this.handleCloseClick }, h("pds-icon", { key: '887a026480d80f407472e79cb1def7f691bd1a2d', icon: "remove", size: "var(--pds-alert-icon-size)", "aria-hidden": "true", color: "var(--pds-alert-color-dismiss)" })))))));
|
|
63
68
|
}
|
|
64
69
|
get el() { return this; }
|
|
65
70
|
static get style() { return pdsAlertTokensCss + pdsAlertCss; }
|
|
@@ -68,6 +73,7 @@ const PdsAlert$1 = /*@__PURE__*/ proxyCustomElement(class PdsAlert extends HTMLE
|
|
|
68
73
|
"heading": [1],
|
|
69
74
|
"small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C,KAAK,EAAC,gCAAgC,GAAG,CAC/G,CACV,CACO,CACF,CACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsAlert","__stencil_proxyCustomElement"],"sources":["src/components/pds-alert/pds-alert.tokens.scss?tag=pds-alert&encapsulation=shadow","src/components/pds-alert/pds-alert.scss?tag=pds-alert&encapsulation=shadow","src/components/pds-alert/pds-alert.tsx"],"sourcesContent":["@use '~@kajabi-ui/styles/dist/pine/components/pds-alert/pds-alert.tokens.css';\n",":host {\n // Context link colors for slotted pds-link components (default variant)\n --pds-context-link-color: var(--pine-alert-color-link);\n --pds-context-link-color-hover: var(--pine-alert-color-link-hover);\n\n display: block;\n line-height: 1;\n width: 100%;\n}\n\n:host([variant=\"danger\"]) {\n --pds-context-link-color: var(--pine-alert-color-danger-link);\n --pds-context-link-color-hover: var(--pine-alert-color-danger-link-hover);\n}\n\n:host([variant=\"info\"]) {\n --pds-context-link-color: var(--pine-alert-color-info-link);\n --pds-context-link-color-hover: var(--pine-alert-color-info-link-hover);\n}\n\n:host([variant=\"success\"]) {\n --pds-context-link-color: var(--pine-alert-color-success-link);\n --pds-context-link-color-hover: var(--pine-alert-color-success-link-hover);\n}\n\n:host([variant=\"warning\"]) {\n --pds-context-link-color: var(--pine-alert-color-warning-link);\n --pds-context-link-color-hover: var(--pine-alert-color-warning-link-hover);\n}\n\n.pds-alert__container {\n --pds-alert-icon-size: var(--pine-dimension-sm);\n --pds-alert-border-dismiss-outline: 2px solid var(--pds-alert-color-dismiss);\n\n --pds-alert-background: var(--pine-alert-color-background);\n --pds-alert-border-color: var(--pine-alert-color-border);\n --pds-alert-color-icon: var(--pine-alert-color-icon);\n --pds-alert-color-text: var(--pine-alert-color-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-dismiss-hover);\n\n padding: var(--pine-dimension-250);\n}\n\n.pds-alert__container--danger {\n --pds-alert-background: var(--pine-alert-color-danger-background);\n --pds-alert-border-color: var(--pine-alert-color-danger-border);\n --pds-alert-color-icon: var(--pine-alert-color-danger-icon);\n --pds-alert-color-text: var(--pine-alert-color-danger-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-danger-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-danger-dismiss-hover);\n}\n\n.pds-alert__container--info {\n --pds-alert-background: var(--pine-alert-color-info-background);\n --pds-alert-border-color: var(--pine-alert-color-info-border);\n --pds-alert-color-icon: var(--pine-alert-color-info-icon);\n --pds-alert-color-text: var(--pine-alert-color-info-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-info-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-info-dismiss-hover);\n}\n\n.pds-alert__container--success {\n --pds-alert-background: var(--pine-alert-color-success-background);\n --pds-alert-border-color: var(--pine-alert-color-success-border);\n --pds-alert-color-icon: var(--pine-alert-color-success-icon);\n --pds-alert-color-text: var(--pine-alert-color-success-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-success-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-success-dismiss-hover);\n}\n\n.pds-alert__container--warning {\n --pds-alert-background: var(--pine-alert-color-warning-background);\n --pds-alert-border-color: var(--pine-alert-color-warning-border);\n --pds-alert-color-icon: var(--pine-alert-color-warning-icon);\n --pds-alert-color-text: var(--pine-alert-color-warning-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-warning-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-warning-dismiss-hover);\n}\n\n.pds-alert__icon {\n margin-block-start: var(--pine-dimension-2xs);\n}\n\n.pds-alert__icon--small {\n margin-block-start: calc(var(--pine-dimension-2xs) / 2); // half the default icon margin\n}\n\n.pds-alert__content-wrapper {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n width: 100%;\n}\n\n.pds-alert__dismiss {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--pine-border-radius-full);\n cursor: pointer;\n display: flex;\n height: var(--pine-dimension-250);\n justify-content: center;\n padding: var(--pine-dimension-xs);\n width: var(--pine-dimension-250);\n}\n\n.pds-alert__dismiss:hover {\n background: var(--pds-alert-background-dismiss-hover);\n opacity: 0.8;\n}\n\n.pds-alert__dismiss:focus-visible {\n outline: var(--pds-alert-border-dismiss-outline);\n}\n\n.pds-alert__description--small {\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.pds-alert__actions {\n margin-block-start: var(--pine-dimension-sm);\n}\n\n.pds-alert__actions--small {\n flex-shrink: 0;\n margin-inline-start: auto;\n white-space: nowrap;\n}\n","import { Component, Host, h, Prop, Event, EventEmitter, Element, State } from '@stencil/core';\n\n/**\n * @slot actions - Slot for alert actions.\n * @part dismiss\n */\n\n@Component({\n tag: 'pds-alert',\n styleUrls: ['pds-alert.tokens.scss', 'pds-alert.scss'],\n shadow: true,\n})\nexport class PdsAlert {\n\n @Element() el: HTMLPdsAlertElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Text displayed as the heading of the alert.\n */\n @Prop() heading: string;\n\n /**\n * If true, the alert is displayed in a smaller size and description text is truncated. Heading is not displayed.\n */\n @Prop() small = false;\n\n /**\n * If true, shows the dismiss button. If false, the dismiss button is hidden.\n * @defaultValue false\n */\n @Prop() dismissible = false;\n\n /**\n * Sets the style variant of the alert.\n * @defaultValue 'default'\n */\n @Prop() variant: 'default' | 'danger' | 'info' | 'success' | 'warning' = 'default';\n\n /**\n * Event emitted when the dismiss button is clicked.\n */\n @Event() pdsAlertDismissClick: EventEmitter<void>;\n\n @State() hasActionsContent = false;\n\n private handleCloseClick = () => {\n this.pdsAlertDismissClick.emit();\n };\n\n componentWillRender() {\n // Check if the actions slot has any content.\n // If not, hide the actions container to prevent empty space.\n const actionsSlot = this.el.querySelector('[slot=\"actions\"]');\n this.hasActionsContent = !!actionsSlot;\n }\n\n private renderActions(isSmall: boolean) {\n return (\n <pds-box class={isSmall ? \"pds-alert__actions--small\" : \"pds-alert__actions\"} gap=\"sm\" flex={isSmall ? \"none\" : undefined} align-items={isSmall ? undefined : \"center\"}>\n <slot name=\"actions\"></slot>\n </pds-box>\n );\n }\n\n private renderContent() {\n if (this.small) {\n return (\n <pds-box display=\"flex\" gap=\"md\" align-items=\"center\">\n <pds-text\n truncate={this.small}\n class=\"pds-alert__description--small\"\n color=\"var(--pds-alert-color-text)\"\n tag=\"p\"\n >\n <slot></slot>\n </pds-text>\n {this.hasActionsContent && this.renderActions(true)}\n </pds-box>\n );\n }\n\n return (\n <div>\n <pds-text class=\"pds-alert__description\" color=\"var(--pds-alert-color-text)\" tag=\"p\">\n <slot></slot>\n </pds-text>\n {this.hasActionsContent && this.renderActions(false)}\n </div>\n );\n }\n\n render() {\n const iconMap = {\n danger: 'warning-filled',\n default: 'info-circle-filled',\n info: 'info-circle-filled',\n success: 'check-circle-filled',\n warning: 'info-circle-filled',\n };\n\n // Get the icon name based on the current variant\n const iconName = iconMap[this.variant] || iconMap.default;\n\n return (\n <Host class=\"pds-alert\" id={this.componentId} variant={this.variant}>\n <pds-box\n class={`pds-alert__container pds-alert__container--${this.variant}`}\n background-color=\"var(--pds-alert-background)\"\n border-color=\"var(--pds-alert-border-color)\"\n border-radius=\"md\"\n border\n display=\"block\"\n >\n <pds-box gap=\"sm\" display=\"flex\">\n <pds-icon\n class={`pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`}\n color=\"var(--pds-alert-color-icon)\"\n icon={iconName}\n size=\"var(--pds-alert-icon-size)\"\n />\n <pds-box class=\"pds-alert__content-wrapper\" direction=\"column\" gap=\"xs\" flex=\"grow\">\n {this.heading && !this.small && (\n <pds-text class=\"pds-alert__heading\" color=\"var(--pds-alert-color-text)\" size=\"h5\" tag=\"h3\" weight=\"medium\">\n {this.heading}\n </pds-text>\n )}\n\n {this.renderContent()}\n </pds-box>\n\n {this.dismissible && (\n <button class=\"pds-alert__dismiss\" type=\"button\" part=\"dismiss\" aria-label=\"Dismiss alert\" onClick={this.handleCloseClick}>\n <pds-icon icon=\"remove\" size=\"var(--pds-alert-icon-size)\" aria-hidden=\"true\" color=\"var(--pds-alert-color-dismiss)\" />\n </button>\n )}\n </pds-box>\n </pds-box>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"pds-alert.js","mappings":";;;;;AAAA,MAAM,iBAAiB,GAAG,6vJAA6vJ;;ACAvxJ,MAAM,WAAW,GAAG,6oIAA6oI;;MCYppIA,UAAQ,iBAAAC,kBAAA,CAAA,MAAA,QAAA,SAAA,WAAA,CAAA;AALrB,IAAA,WAAA,CAAA,YAAA,EAAA;;;;;;;AAmBE;;AAEG;AACK,QAAA,IAAK,CAAA,KAAA,GAAG,KAAK;AAErB;;;AAGG;AACK,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AAE3B;;;AAGG;AACK,QAAA,IAAQ,CAAA,QAAA,GAAG,KAAK;AAExB;;;AAGG;AACK,QAAA,IAAO,CAAA,OAAA,GAA0D,SAAS;AAOzE,QAAA,IAAiB,CAAA,iBAAA,GAAG,KAAK;AAE1B,QAAA,IAAgB,CAAA,gBAAA,GAAG,MAAK;AAC9B,YAAA,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE;AAClC,SAAC;AA+FF;IA7FC,mBAAmB,GAAA;;;QAGjB,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC;AAC7D,QAAA,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,WAAW;;AAGhC,IAAA,aAAa,CAAC,OAAgB,EAAA;QACpC,QACE,CAAS,CAAA,SAAA,EAAA,EAAA,KAAK,EAAE,OAAO,GAAG,2BAA2B,GAAG,oBAAoB,EAAE,GAAG,EAAC,IAAI,EAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,EAAe,aAAA,EAAA,OAAO,GAAG,SAAS,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AAC,gBAAgB,EAAA,EACvH,CAAU,CAAA,UAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,4BAA4B,iBAAa,MAAM,EAAC,KAAK,EAAC,gCAAgC,GAAG,CAC/G,CACV,CACO,CACF,CACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PdsAlert","__stencil_proxyCustomElement"],"sources":["src/components/pds-alert/pds-alert.tokens.scss?tag=pds-alert&encapsulation=shadow","src/components/pds-alert/pds-alert.scss?tag=pds-alert&encapsulation=shadow","src/components/pds-alert/pds-alert.tsx"],"sourcesContent":["@use '~@kajabi-ui/styles/dist/pine/components/pds-alert/pds-alert.tokens.css';\n",":host {\n // Context link colors for slotted pds-link components (default variant)\n --pds-context-link-color: var(--pine-alert-color-link);\n --pds-context-link-color-hover: var(--pine-alert-color-link-hover);\n\n display: block;\n line-height: 1;\n width: 100%;\n}\n\n:host([variant=\"danger\"]) {\n --pds-context-link-color: var(--pine-alert-color-danger-link);\n --pds-context-link-color-hover: var(--pine-alert-color-danger-link-hover);\n}\n\n:host([variant=\"info\"]) {\n --pds-context-link-color: var(--pine-alert-color-info-link);\n --pds-context-link-color-hover: var(--pine-alert-color-info-link-hover);\n}\n\n:host([variant=\"success\"]) {\n --pds-context-link-color: var(--pine-alert-color-success-link);\n --pds-context-link-color-hover: var(--pine-alert-color-success-link-hover);\n}\n\n:host([variant=\"warning\"]) {\n --pds-context-link-color: var(--pine-alert-color-warning-link);\n --pds-context-link-color-hover: var(--pine-alert-color-warning-link-hover);\n}\n\n.pds-alert__container {\n --pds-alert-icon-size: var(--pine-dimension-sm);\n --pds-alert-border-dismiss-outline: 2px solid var(--pds-alert-color-dismiss);\n\n --pds-alert-background: var(--pine-alert-color-background);\n --pds-alert-border-color: var(--pine-alert-color-border);\n --pds-alert-color-icon: var(--pine-alert-color-icon);\n --pds-alert-color-text: var(--pine-alert-color-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-dismiss-hover);\n\n padding: var(--pine-dimension-250);\n}\n\n.pds-alert__container--danger {\n --pds-alert-background: var(--pine-alert-color-danger-background);\n --pds-alert-border-color: var(--pine-alert-color-danger-border);\n --pds-alert-color-icon: var(--pine-alert-color-danger-icon);\n --pds-alert-color-text: var(--pine-alert-color-danger-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-danger-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-danger-dismiss-hover);\n}\n\n.pds-alert__container--info {\n --pds-alert-background: var(--pine-alert-color-info-background);\n --pds-alert-border-color: var(--pine-alert-color-info-border);\n --pds-alert-color-icon: var(--pine-alert-color-info-icon);\n --pds-alert-color-text: var(--pine-alert-color-info-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-info-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-info-dismiss-hover);\n}\n\n.pds-alert__container--success {\n --pds-alert-background: var(--pine-alert-color-success-background);\n --pds-alert-border-color: var(--pine-alert-color-success-border);\n --pds-alert-color-icon: var(--pine-alert-color-success-icon);\n --pds-alert-color-text: var(--pine-alert-color-success-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-success-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-success-dismiss-hover);\n}\n\n.pds-alert__container--warning {\n --pds-alert-background: var(--pine-alert-color-warning-background);\n --pds-alert-border-color: var(--pine-alert-color-warning-border);\n --pds-alert-color-icon: var(--pine-alert-color-warning-icon);\n --pds-alert-color-text: var(--pine-alert-color-warning-text);\n --pds-alert-color-dismiss: var(--pine-alert-color-warning-dismiss);\n --pds-alert-background-dismiss-hover: var(--pine-alert-color-warning-dismiss-hover);\n}\n\n.pds-alert__icon {\n margin-block-start: var(--pine-dimension-2xs);\n}\n\n.pds-alert__icon--small {\n margin-block-start: calc(var(--pine-dimension-2xs) / 2); // half the default icon margin\n}\n\n.pds-alert__content-wrapper {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n width: 100%;\n}\n\n.pds-alert__dismiss {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--pine-border-radius-full);\n cursor: pointer;\n display: flex;\n height: var(--pine-dimension-250);\n justify-content: center;\n padding: var(--pine-dimension-xs);\n width: var(--pine-dimension-250);\n}\n\n.pds-alert__dismiss:hover {\n background: var(--pds-alert-background-dismiss-hover);\n opacity: 0.8;\n}\n\n.pds-alert__dismiss:focus-visible {\n outline: var(--pds-alert-border-dismiss-outline);\n}\n\n.pds-alert__description--small {\n flex: 1 1 auto;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.pds-alert__actions {\n margin-block-start: var(--pine-dimension-sm);\n}\n\n.pds-alert__actions--small {\n flex-shrink: 0;\n margin-inline-start: auto;\n white-space: nowrap;\n}\n","import { Component, Host, h, Prop, Event, EventEmitter, Element, State } from '@stencil/core';\n\n/**\n * @slot actions - Slot for alert actions.\n * @part dismiss\n */\n\n@Component({\n tag: 'pds-alert',\n styleUrls: ['pds-alert.tokens.scss', 'pds-alert.scss'],\n shadow: true,\n})\nexport class PdsAlert {\n\n @Element() el: HTMLPdsAlertElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Text displayed as the heading of the alert.\n */\n @Prop() heading: string;\n\n /**\n * If true, the alert is displayed in a smaller size and description text is truncated. Heading is not displayed.\n */\n @Prop() small = false;\n\n /**\n * If true, shows the dismiss button. If false, the dismiss button is hidden.\n * @defaultValue false\n */\n @Prop() dismissible = false;\n\n /**\n * If true, the leading icon is hidden.\n * @defaultValue false\n */\n @Prop() hideIcon = false;\n\n /**\n * Sets the style variant of the alert.\n * @defaultValue 'default'\n */\n @Prop() variant: 'default' | 'danger' | 'info' | 'success' | 'warning' = 'default';\n\n /**\n * Event emitted when the dismiss button is clicked.\n */\n @Event() pdsAlertDismissClick: EventEmitter<void>;\n\n @State() hasActionsContent = false;\n\n private handleCloseClick = () => {\n this.pdsAlertDismissClick.emit();\n };\n\n componentWillRender() {\n // Check if the actions slot has any content.\n // If not, hide the actions container to prevent empty space.\n const actionsSlot = this.el.querySelector('[slot=\"actions\"]');\n this.hasActionsContent = !!actionsSlot;\n }\n\n private renderActions(isSmall: boolean) {\n return (\n <pds-box class={isSmall ? \"pds-alert__actions--small\" : \"pds-alert__actions\"} gap=\"sm\" flex={isSmall ? \"none\" : undefined} align-items={isSmall ? undefined : \"center\"}>\n <slot name=\"actions\"></slot>\n </pds-box>\n );\n }\n\n private renderContent() {\n if (this.small) {\n return (\n <pds-box display=\"flex\" gap=\"md\" align-items=\"center\">\n <pds-text\n truncate={this.small}\n class=\"pds-alert__description--small\"\n color=\"var(--pds-alert-color-text)\"\n tag=\"p\"\n >\n <slot></slot>\n </pds-text>\n {this.hasActionsContent && this.renderActions(true)}\n </pds-box>\n );\n }\n\n return (\n <div>\n <pds-text class=\"pds-alert__description\" color=\"var(--pds-alert-color-text)\" tag=\"p\">\n <slot></slot>\n </pds-text>\n {this.hasActionsContent && this.renderActions(false)}\n </div>\n );\n }\n\n render() {\n const iconMap = {\n danger: 'warning-filled',\n default: 'info-circle-filled',\n info: 'info-circle-filled',\n success: 'check-circle-filled',\n warning: 'info-circle-filled',\n };\n\n // Get the icon name based on the current variant\n const iconName = iconMap[this.variant] || iconMap.default;\n\n return (\n <Host class=\"pds-alert\" id={this.componentId} variant={this.variant}>\n <pds-box\n class={`pds-alert__container pds-alert__container--${this.variant}`}\n background-color=\"var(--pds-alert-background)\"\n border-color=\"var(--pds-alert-border-color)\"\n border-radius=\"md\"\n border\n display=\"block\"\n >\n <pds-box gap=\"sm\" display=\"flex\">\n {!this.hideIcon && (\n <pds-icon\n class={`pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`}\n color=\"var(--pds-alert-color-icon)\"\n icon={iconName}\n size=\"var(--pds-alert-icon-size)\"\n />\n )}\n <pds-box class=\"pds-alert__content-wrapper\" direction=\"column\" gap=\"xs\" flex=\"grow\">\n {this.heading && !this.small && (\n <pds-text class=\"pds-alert__heading\" color=\"var(--pds-alert-color-text)\" size=\"h5\" tag=\"h3\" weight=\"medium\">\n {this.heading}\n </pds-text>\n )}\n\n {this.renderContent()}\n </pds-box>\n\n {this.dismissible && (\n <button class=\"pds-alert__dismiss\" type=\"button\" part=\"dismiss\" aria-label=\"Dismiss alert\" onClick={this.handleCloseClick}>\n <pds-icon icon=\"remove\" size=\"var(--pds-alert-icon-size)\" aria-hidden=\"true\" color=\"var(--pds-alert-color-dismiss)\" />\n </button>\n )}\n </pds-box>\n </pds-box>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1440,6 +1440,8 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1440
1440
|
this.hideLabel = false;
|
|
1441
1441
|
/**
|
|
1442
1442
|
* Determines the combobox mode: 'filter' (filter options as you type) or 'select-only' (show all options).
|
|
1443
|
+
* In filter mode, reopening the menu while the input still shows the label of the selected option temporarily lists
|
|
1444
|
+
* all options until you type (so you can switch to a different choice without clearing the field first).
|
|
1443
1445
|
* @default 'filter'
|
|
1444
1446
|
*/
|
|
1445
1447
|
this.mode = 'filter';
|
|
@@ -1542,8 +1544,15 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1542
1544
|
this.optionEls = [];
|
|
1543
1545
|
this.allItems = [];
|
|
1544
1546
|
this.isUpdatingFromSelection = false;
|
|
1547
|
+
/**
|
|
1548
|
+
* In filter mode, after choosing an option the input still shows the label and would
|
|
1549
|
+
* otherwise filter the list to matching substrings only. While this flag is true,
|
|
1550
|
+
* the list shows every option until the user types (then normal filtering applies).
|
|
1551
|
+
*/
|
|
1552
|
+
this.expandFilterListWhileOpen = false;
|
|
1545
1553
|
this.handleInput = (e) => {
|
|
1546
1554
|
const target = e.target;
|
|
1555
|
+
this.clearExpandFilterList();
|
|
1547
1556
|
this.displayText = target.value;
|
|
1548
1557
|
this.isOpen = true;
|
|
1549
1558
|
this.filterOptions();
|
|
@@ -1559,19 +1568,26 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1559
1568
|
// Open dropdown when input is clicked (but not when tabbed into)
|
|
1560
1569
|
if (!this.isOpen) {
|
|
1561
1570
|
this.isOpen = true;
|
|
1571
|
+
this.prepareExpandFilterListOnOpen();
|
|
1562
1572
|
this.filterOptions();
|
|
1563
1573
|
// Trigger initial fetch if async and no options loaded yet
|
|
1564
1574
|
if (this.asyncUrl && this.internalOptions.length === 0) {
|
|
1565
1575
|
this.debouncedFetchAsyncOptions(this.displayText, 1);
|
|
1566
1576
|
}
|
|
1567
1577
|
this.setInitialHighlightedIndex();
|
|
1568
|
-
setTimeout(() =>
|
|
1578
|
+
setTimeout(() => {
|
|
1579
|
+
this.openDropdownPositioning();
|
|
1580
|
+
if (this.trigger === 'input' && this.expandFilterListWhileOpen && this.inputEl) {
|
|
1581
|
+
this.inputEl.select();
|
|
1582
|
+
}
|
|
1583
|
+
}, 0);
|
|
1569
1584
|
}
|
|
1570
1585
|
};
|
|
1571
1586
|
this.handleKeyDown = (e) => {
|
|
1572
1587
|
if (!this.isOpen && (e.key === 'ArrowDown' || e.key === 'ArrowUp' || (e.altKey && e.key === 'ArrowDown'))) {
|
|
1573
1588
|
e.preventDefault();
|
|
1574
1589
|
this.isOpen = true;
|
|
1590
|
+
this.prepareExpandFilterListOnOpen();
|
|
1575
1591
|
this.filterOptions();
|
|
1576
1592
|
// Set highlighted index immediately for testing
|
|
1577
1593
|
this.setInitialHighlightedIndex();
|
|
@@ -1664,6 +1680,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1664
1680
|
e.preventDefault();
|
|
1665
1681
|
this.isOpen = false;
|
|
1666
1682
|
this.highlightedIndex = -1;
|
|
1683
|
+
this.clearExpandFilterList();
|
|
1667
1684
|
this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
|
|
1668
1685
|
this.restoreFocusToTrigger();
|
|
1669
1686
|
break;
|
|
@@ -1671,6 +1688,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1671
1688
|
// Allow normal tab behavior to close dropdown and move focus
|
|
1672
1689
|
this.isOpen = false;
|
|
1673
1690
|
this.highlightedIndex = -1;
|
|
1691
|
+
this.clearExpandFilterList();
|
|
1674
1692
|
this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
|
|
1675
1693
|
break;
|
|
1676
1694
|
}
|
|
@@ -1702,6 +1720,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1702
1720
|
this.onButtonTriggerClick = () => {
|
|
1703
1721
|
this.isOpen = !this.isOpen;
|
|
1704
1722
|
if (this.isOpen) {
|
|
1723
|
+
this.prepareExpandFilterListOnOpen();
|
|
1705
1724
|
this.filterOptions();
|
|
1706
1725
|
// Trigger initial fetch if async and no options loaded yet
|
|
1707
1726
|
if (this.asyncUrl && this.internalOptions.length === 0) {
|
|
@@ -1715,6 +1734,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1715
1734
|
}
|
|
1716
1735
|
else {
|
|
1717
1736
|
// Reset navigation mode when closing
|
|
1737
|
+
this.clearExpandFilterList();
|
|
1718
1738
|
this.isArrowKeyNavigationMode = false;
|
|
1719
1739
|
}
|
|
1720
1740
|
};
|
|
@@ -1724,6 +1744,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1724
1744
|
e.preventDefault();
|
|
1725
1745
|
e.stopPropagation(); // Prevent the event from bubbling and triggering click
|
|
1726
1746
|
this.isOpen = true;
|
|
1747
|
+
this.prepareExpandFilterListOnOpen();
|
|
1727
1748
|
this.filterOptions();
|
|
1728
1749
|
// Set highlighted index immediately
|
|
1729
1750
|
this.setInitialHighlightedIndex();
|
|
@@ -1738,6 +1759,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1738
1759
|
if (this.isOpen) {
|
|
1739
1760
|
this.isOpen = false;
|
|
1740
1761
|
this.highlightedIndex = -1;
|
|
1762
|
+
this.clearExpandFilterList();
|
|
1741
1763
|
this.updateAriaActiveDescendant(); // Clear aria-activedescendant
|
|
1742
1764
|
this.restoreFocusToTrigger();
|
|
1743
1765
|
}
|
|
@@ -1765,6 +1787,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
1765
1787
|
if (!isRelatedTargetInCombobox && !isRelatedTargetInListbox) {
|
|
1766
1788
|
this.isOpen = false;
|
|
1767
1789
|
this.highlightedIndex = -1;
|
|
1790
|
+
this.clearExpandFilterList();
|
|
1768
1791
|
this.isArrowKeyNavigationMode = false; // Reset arrow-key navigation mode
|
|
1769
1792
|
this.updateAriaActiveDescendant(); // Clear aria-activedescendant
|
|
1770
1793
|
// If there's a selected option but the display text doesn't match, restore the selected option's display text
|
|
@@ -2162,7 +2185,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
2162
2185
|
if (this.allItems.length === 0 && this.optionEls.length > 0) {
|
|
2163
2186
|
this.allItems = [...this.optionEls];
|
|
2164
2187
|
}
|
|
2165
|
-
if (this.mode === 'select-only') {
|
|
2188
|
+
if (this.mode === 'select-only' || this.expandFilterListWhileOpen) {
|
|
2166
2189
|
this.filteredItems = [...this.allItems];
|
|
2167
2190
|
}
|
|
2168
2191
|
else {
|
|
@@ -2203,6 +2226,23 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
2203
2226
|
}
|
|
2204
2227
|
this.highlightedIndex = -1;
|
|
2205
2228
|
}
|
|
2229
|
+
clearExpandFilterList() {
|
|
2230
|
+
this.expandFilterListWhileOpen = false;
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* When reopening the dropdown in filter mode with the input still showing the
|
|
2234
|
+
* committed selection label, show the full option list until the user edits the query.
|
|
2235
|
+
*/
|
|
2236
|
+
prepareExpandFilterListOnOpen() {
|
|
2237
|
+
if (this.mode === 'filter' &&
|
|
2238
|
+
this.selectedOption &&
|
|
2239
|
+
this.displayText === this.getOptionLabel(this.selectedOption)) {
|
|
2240
|
+
this.expandFilterListWhileOpen = true;
|
|
2241
|
+
}
|
|
2242
|
+
else {
|
|
2243
|
+
this.expandFilterListWhileOpen = false;
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2206
2246
|
openDropdownPositioning() {
|
|
2207
2247
|
if (this.triggerEl && this.listboxEl) {
|
|
2208
2248
|
// Apply width and max-height BEFORE positioning calculations
|
|
@@ -2478,6 +2518,7 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
2478
2518
|
// The @Watch('selectedOption') will handle displayText, value, and form internals
|
|
2479
2519
|
this.setSelectedOption(option);
|
|
2480
2520
|
this.isOpen = false;
|
|
2521
|
+
this.clearExpandFilterList();
|
|
2481
2522
|
this.pdsComboboxChange.emit({ value: option.value });
|
|
2482
2523
|
}
|
|
2483
2524
|
renderDropdown() {
|
|
@@ -2636,10 +2677,10 @@ const PdsCombobox$1 = /*@__PURE__*/ proxyCustomElement(class PdsCombobox extends
|
|
|
2636
2677
|
]
|
|
2637
2678
|
.filter(Boolean)
|
|
2638
2679
|
.join(' ');
|
|
2639
|
-
return (h(Host, { key: '
|
|
2680
|
+
return (h(Host, { key: '28c9653028e7fd67ccd8361a84108fbe11b1303f' }, h("div", { key: 'd9a3d6c4d3ca1c6135501e702be8beeffcafdf0d', class: "pds-combobox", tabIndex: -1, onFocusout: this.onComboboxFocusOut, part: "combobox" }, this.label && !this.hideLabel && (h("label", { key: '8832180ca4ee60506d464115aff2503d3aeb6c52', htmlFor: this.componentId, class: "pds-combobox__label" }, this.label)), this.trigger === 'input' ? (h("div", { class: "pds-combobox__input-wrapper", style: { width: this.triggerWidth } }, h("input", { ref: el => {
|
|
2640
2681
|
this.inputEl = el;
|
|
2641
2682
|
this.triggerEl = el;
|
|
2642
|
-
}, 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: '
|
|
2683
|
+
}, 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: '3f2ac580f226fc9a0bf72539804d0b514a93f5b8', style: { display: 'none' } }, h("slot", { key: '075205fb4fed8d0e4aec43531593444c1ab8e1cd', onSlotchange: () => this.updateOptions() })), this.renderDropdown())));
|
|
2643
2684
|
}
|
|
2644
2685
|
static get formAssociated() { return true; }
|
|
2645
2686
|
get el() { return this; }
|