@ed.yakovich/example-component-library-equipment-summary 1.0.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.
Files changed (52) hide show
  1. package/dist/component/context/index.js +10 -0
  2. package/dist/component/index.js +6 -0
  3. package/dist/component/types/index.js +1 -0
  4. package/dist/index-0d8e0844-BJzWsYCM.js +7403 -0
  5. package/dist/index-DxRZ6prf.js +29198 -0
  6. package/dist/index-b30029d4-hGeLy_--.js +12 -0
  7. package/dist/index-e6818ded-r_t6ryaW.js +57 -0
  8. package/dist/index.esm-322571ff-D1REhsOg.js +41 -0
  9. package/dist/lib/component/context/index.d.ts +10 -0
  10. package/dist/lib/component/index.d.ts +2 -0
  11. package/dist/lib/component/types/index.d.ts +14 -0
  12. package/dist/lib/main.d.ts +3 -0
  13. package/dist/main.js +6 -0
  14. package/dist/prism-accordion.entry-BxELizsS.js +51 -0
  15. package/dist/prism-avatar_2.entry-DNiQeemV.js +68 -0
  16. package/dist/prism-badge.entry-BZ3qPCmg.js +58 -0
  17. package/dist/prism-banner.entry-CQFUsFct.js +82 -0
  18. package/dist/prism-breadcrumb.entry-D3f9eccN.js +33 -0
  19. package/dist/prism-button_2.entry-BeBH5mn0.js +110 -0
  20. package/dist/prism-card.entry-BtruBogB.js +119 -0
  21. package/dist/prism-carousel.entry-DGsHMWMm.js +3111 -0
  22. package/dist/prism-checkbox-group.entry-8qXingIs.js +62 -0
  23. package/dist/prism-checkbox.entry-BgBJyUsA.js +99 -0
  24. package/dist/prism-data-table.entry-BqDb3MTy.js +10475 -0
  25. package/dist/prism-datepicker.entry-D_TgrYQo.js +249 -0
  26. package/dist/prism-form.entry-DtZpPyt1.js +42 -0
  27. package/dist/prism-grid.entry-B09w_u17.js +28 -0
  28. package/dist/prism-header.entry-Dg1LLjAa.js +202 -0
  29. package/dist/prism-hero.entry-CxCl08Ny.js +23 -0
  30. package/dist/prism-icon_2.entry-C9c3WUVv.js +118 -0
  31. package/dist/prism-image.entry-LtD_rMcm.js +38 -0
  32. package/dist/prism-input-file.entry-wHvgU7qk.js +119 -0
  33. package/dist/prism-input-otp.entry-DslD9N9q.js +63 -0
  34. package/dist/prism-input-text.entry-DXD4hb3c.js +228 -0
  35. package/dist/prism-input-textarea.entry-BKa_ksFS.js +140 -0
  36. package/dist/prism-layout.entry-DCsBmhx4.js +20 -0
  37. package/dist/prism-lineitem.entry-BM1G7KrG.js +44 -0
  38. package/dist/prism-menu.entry-BOHwsSEF.js +231 -0
  39. package/dist/prism-modal.entry-lNtEVneh.js +94 -0
  40. package/dist/prism-pagination.entry-CquOlgO0.js +60 -0
  41. package/dist/prism-popover.entry-46M1LmDp.js +1013 -0
  42. package/dist/prism-popper.entry-Dva30zBQ.js +959 -0
  43. package/dist/prism-progress.entry-DMMVFWhO.js +79 -0
  44. package/dist/prism-radio-group.entry-CMbyeNEC.js +66 -0
  45. package/dist/prism-radio.entry-8eXYAxvv.js +101 -0
  46. package/dist/prism-select.entry-u6Q0TwuA.js +230 -0
  47. package/dist/prism-switch.entry-B0Fg-f-f.js +95 -0
  48. package/dist/prism-tab.entry-Cb1TgCNq.js +20 -0
  49. package/dist/prism-tabs.entry-C8aDT5py.js +70 -0
  50. package/dist/prism-tooltip.entry-BRIs8zP0.js +52 -0
  51. package/dist/prism-typeahead.entry-DPz5X3J9.js +1234 -0
  52. package/package.json +49 -0
@@ -0,0 +1,79 @@
1
+ import { r as b, h as i, F as m, H as p } from "./index-DxRZ6prf.js";
2
+ import { m as w } from "./index-e6818ded-r_t6ryaW.js";
3
+ import { d as v } from "./index-0d8e0844-BJzWsYCM.js";
4
+ /*!
5
+ * Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
6
+ */
7
+ const f = ":host{align-items:center;display:flex}.wrap{width:100%}.line{--tw-bg-opacity:1;--shadow-color:var(--material-neutral2-base-shadow);background-color:rgb(var(--background-color-material-neutral2-base)/var(--tw-bg-opacity));border-radius:var(--border-radius-xsmall,2px);height:.25rem;margin-right:.5rem;overflow:hidden;position:relative}.progress-value{bottom:0;left:0;position:absolute;top:0;transform-origin:left;transition:transform .2s ease-in;width:100%}.base-track{stroke:rgb(var(--background-color-material-neutral2-base))}.circular{align-items:center;display:flex;height:100%;justify-content:center;margin-left:auto;margin-right:auto;position:relative;width:100%}.circle{overflow:visible;position:absolute;z-index:0}.circular .value{z-index:10}.theme1{--tw-bg-opacity:1;--shadow-color:var(--fill-theme1-base-shadow);background-color:rgb(var(--background-color-fill-theme1-base)/var(--tw-bg-opacity))}.stroke-theme1{--tw-text-opacity:1;color:rgb(var(--text-color-theme1-base)/var(--tw-text-opacity))}.caution{--tw-bg-opacity:1;--shadow-color:var(--fill-caution-base-shadow);background-color:rgb(var(--background-color-fill-caution-base)/var(--tw-bg-opacity))}.stroke-caution{--tw-text-opacity:1;color:rgb(var(--text-color-caution-base)/var(--tw-text-opacity))}.info{--tw-bg-opacity:1;--shadow-color:var(--fill-info-base-shadow);background-color:rgb(var(--background-color-fill-info-base)/var(--tw-bg-opacity))}.stroke-info{--tw-text-opacity:1;color:rgb(var(--text-color-info-base)/var(--tw-text-opacity))}.neutral{--tw-bg-opacity:1;--shadow-color:var(--fill-neutral-base-shadow);background-color:rgb(var(--background-color-fill-neutral-base)/var(--tw-bg-opacity))}.stroke-neutral{--tw-text-opacity:1;color:rgb(var(--text-color-neutral-base)/var(--tw-text-opacity))}.neutral2{--tw-bg-opacity:1;background-color:rgb(var(--background-color-fill-neutral2-base)/var(--tw-bg-opacity))}.stroke-neutral2{--tw-text-opacity:1;color:rgb(var(--text-color-neutral2-base)/var(--tw-text-opacity))}.negative{--tw-bg-opacity:1;--shadow-color:var(--fill-negative-base-shadow);background-color:rgb(var(--background-color-fill-negative-base)/var(--tw-bg-opacity))}.stroke-negative{--tw-text-opacity:1;color:rgb(var(--text-color-negative-base)/var(--tw-text-opacity))}.positive{--tw-bg-opacity:1;--shadow-color:var(--fill-positive-base-shadow);background-color:rgb(var(--background-color-fill-positive-base)/var(--tw-bg-opacity))}.stroke-positive{--tw-text-opacity:1;color:rgb(var(--text-color-positive-base)/var(--tw-text-opacity))}@media (prefers-reduced-motion){.progress-value{transition:none}}.sr-use-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}", x = f, k = class {
8
+ constructor(a) {
9
+ b(this, a), this._transform = (t) => {
10
+ let e = t - 100;
11
+ return this.variant === "line" ? `translateX(${e}%)` : `translateX(${Math.abs(0)})`;
12
+ }, this._feedback = (t) => this.secondsElapsed >= 0 ? v.format(v.addSeconds(/* @__PURE__ */ new Date(0), this.duration - this.secondsElapsed), "mm:ss") : `${t}%`, this._circularSizeConversion = (t) => {
13
+ switch (t) {
14
+ case "sm":
15
+ this.size = 96, this.strokeWidth = 4, this.textSize = "heading1";
16
+ break;
17
+ case "md":
18
+ this.size = 136, this.strokeWidth = 6, this.textSize = "display2";
19
+ break;
20
+ case "lg":
21
+ this.size = 206, this.strokeWidth = 8, this.textSize = "display1";
22
+ break;
23
+ default:
24
+ this.size = 96, this.strokeWidth = 4, this.textSize = "heading1";
25
+ break;
26
+ }
27
+ }, this._countDown = () => {
28
+ if (this.duration >= 0) {
29
+ const t = () => {
30
+ this.secondsElapsed = Math.floor((Date.now() - this.startTime) / 1e3), this.value = Math.floor(100 / this.duration * this.secondsElapsed), Date.now() - this.startTime < this.duration * 1e3 ? setTimeout(t.bind(this), 1e3) : this.value = 100;
31
+ };
32
+ t();
33
+ }
34
+ }, this._between = (t, e) => this.value >= t && this.value <= e, this._getMultiRangeObject = (t) => this.multitoneRange.find((e) => e.name === t), this.value = 0, this.variant = "line", this.label = void 0, this.tone = "theme1", this.circularSize = "sm", this.duration = void 0, this.with = "value", this.multitone = !1, this.multitoneRange = [
35
+ {
36
+ name: "low",
37
+ min: 0,
38
+ max: 25
39
+ },
40
+ {
41
+ name: "medium",
42
+ min: 26,
43
+ max: 74
44
+ },
45
+ {
46
+ name: "high",
47
+ min: 75,
48
+ max: 100
49
+ }
50
+ ];
51
+ }
52
+ watchSize() {
53
+ this._circularSizeConversion(this.circularSize);
54
+ }
55
+ watchMultitone() {
56
+ this.multitone === !1 && (this.tone = this.tone);
57
+ }
58
+ connectedCallback() {
59
+ w("prism-progress"), this.variant === "circular" && (this._circularSizeConversion(this.circularSize), this.startTime = Date.now(), this._countDown());
60
+ }
61
+ render() {
62
+ var a, t, e, s, r, o, l, n;
63
+ const h = () => this._feedback(this.value).length ? this._feedback(this.value) : i("slot", null), g = `0 0 ${this.size} ${this.size}`, c = (this.size - this.strokeWidth) / 2, u = c * Math.PI * 2, d = this.value * u / 100;
64
+ return this.multitone && this.multitoneRange ? (this._between((a = this._getMultiRangeObject("low")) === null || a === void 0 ? void 0 : a.min, (t = this._getMultiRangeObject("low")) === null || t === void 0 ? void 0 : t.max) && (this.tone = "negative"), this._between((e = this._getMultiRangeObject("medium")) === null || e === void 0 ? void 0 : e.min, (s = this._getMultiRangeObject("medium")) === null || s === void 0 ? void 0 : s.max) && (this.tone = "caution"), this._between((r = this._getMultiRangeObject("high")) === null || r === void 0 ? void 0 : r.min, (o = this._getMultiRangeObject("high")) === null || o === void 0 ? void 0 : o.max) && (this.tone = "positive"), (l = this._getMultiRangeObject("full")) === null || l === void 0 || l.min, !((n = this._getMultiRangeObject("full")) === null || n === void 0) && n.max && (this.tone = this.tone)) : this.tone = this.tone, i(p, null, i("div", { class: "wrap", style: {
65
+ width: this.variant === "circular" ? `${this.size}px` : null,
66
+ height: this.variant === "circular" ? `${this.size}px` : null
67
+ } }, i("div", { class: { [this.variant]: !0 }, role: "progressbar", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.value, "aria-valuetext": `${this.value.toString()}% Complete` }, this.variant === "line" && i("div", { class: { "progress-value": !0, [this.tone]: !0, [`type-${this.variant}`]: !0 }, style: { transform: this._transform(this.value) } }), this.variant === "circular" && i(m, null, i("svg", { class: { [`stroke-${this.tone}`]: !0, circle: !0 }, width: this.size, height: this.size, viewBox: g }, i("circle", { class: "base-track", fill: "none", stroke: "#ccc", cx: this.size / 2, cy: this.size / 2, r: c, "stroke-width": `${this.strokeWidth}px` }), i("circle", { fill: "none", stroke: "currentColor", cx: this.size / 2, cy: this.size / 2, r: c, "stroke-width": `${this.strokeWidth}px`, transform: `rotate(-90 ${this.size / 2} ${this.size / 2})`, "stroke-dasharray": `${[d, u - d]}`, "stroke-dashoffset": "0px", "stroke-linecap": "round", style: { transition: "all 0.5s ease-in-out" } })), i("prism-text", { display: this.textSize, class: { value: !0, "sr-use-only": this.with === "none" } }, i(h, null))))), this.variant === "line" && i("prism-text", { display: "body1", class: { value: !0, "sr-use-only": this.with === "none" } }, i(h, null)));
68
+ }
69
+ static get watchers() {
70
+ return {
71
+ circularSize: ["watchSize"],
72
+ multitone: ["watchMultitone"]
73
+ };
74
+ }
75
+ };
76
+ k.style = x;
77
+ export {
78
+ k as prism_progress
79
+ };
@@ -0,0 +1,66 @@
1
+ import { r as o, c as d, h as e, H as n, g as c } from "./index-DxRZ6prf.js";
2
+ import { g as l, m as p } from "./index-e6818ded-r_t6ryaW.js";
3
+ import { A as g } from "./index-b30029d4-hGeLy_--.js";
4
+ /*!
5
+ * Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
6
+ */
7
+ const h = ".sc-prism-radio-group-h{--fieldset-padding:0.375rem;--legend-color:rgb(var(--text-color-neutral-base))}.screen-reader-text.sc-prism-radio-group{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}fieldset.sc-prism-radio-group{border-color:var(--border-color-transparent,transparent);border-style:solid;border-width:2px;margin:0;padding:var(--fieldset-padding);transition:border-color .2s}.layout-inline.sc-prism-radio-group{display:flex}.legend-container.sc-prism-radio-group{margin:0}.legend.sc-prism-radio-group{--tw-text-opacity:1;color:rgb(var(--text-color-neutral-base)/var(--tw-text-opacity));margin-bottom:.25rem}.layout-inline.sc-prism-radio-group-s>prism-radio,.layout-inline .sc-prism-radio-group-s>prism-radio{--radio-margin-top:0;--radio-margin-bottom:0}.layout-inline.sc-prism-radio-group-s>prism-radio,.layout-inline.sc-prism-radio-group-s>prism-radio:not(:first-child),.layout-inline .sc-prism-radio-group-s>prism-radio:not(:first-child){margin-left:1.5rem}.layout-stacked.sc-prism-radio-group-s>prism-radio:first-child,.layout-stacked .sc-prism-radio-group-s>prism-radio:first-child{--radio-margin-top:0}.invalid.sc-prism-radio-group{--tw-border-opacity:1;border-color:rgb(var(--border-color-stroke-negative-base)/var(--tw-border-opacity));border-style:solid;border-width:2px}.invalid-message.sc-prism-radio-group{--tw-text-opacity:1;color:rgb(var(--text-color-negative-base)/var(--tw-text-opacity));display:block}.hint-container.sc-prism-radio-group{align-items:center;display:flex;margin-top:.25rem}.hint-container.sc-prism-radio-group>.sc-prism-radio-group:not([hidden])~.sc-prism-radio-group:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}@media (prefers-reduced-motion:reduce){fieldset.sc-prism-radio-group{transition:none}}", m = h, u = class {
8
+ constructor(t) {
9
+ o(this, t), this.prismChange = d(this, "prismChange", 7), this.prismConnected = d(this, "prismConnected", 7), this.uid = l(), this.radios = this.el.getElementsByTagName("prism-radio"), this.prismId = `prism-radio-group-${this.uid}`, this.legend = void 0, this.showLegend = !0, this.invalid = !1, this.value = void 0, this.loading = !1, this.invalidMessage = "Please choose from one of the options", this.layout = "inline", this.required = !1, this.legendTypeSize = "body1", this.hintId = `${this.prismId}-hint`;
10
+ }
11
+ onRadioSelect(t) {
12
+ const i = t.detail;
13
+ if (i.name === "radio-changed") {
14
+ Array.from(this.radios).map((a) => {
15
+ a.setAttribute("loading", String(this.loading)), this.invalid = a.invalid, a.checked && i.id !== a.getAttribute("prism-id") && a.removeAttribute("checked");
16
+ });
17
+ const r = i.target;
18
+ this.prismChange.emit({
19
+ name: "radio-group-changed",
20
+ checked: r.checked,
21
+ group: r.name,
22
+ id: r.id,
23
+ invalid: r.invalid,
24
+ loading: r.loading,
25
+ target: r,
26
+ value: r.value
27
+ });
28
+ }
29
+ }
30
+ /**
31
+ * Listen to Reset Events
32
+ */
33
+ handleReset() {
34
+ Array.from(this.radios).map((i) => {
35
+ i.checked = !1;
36
+ });
37
+ }
38
+ /** Component Added to DOM */
39
+ connectedCallback() {
40
+ Array.from(this.radios).forEach((i) => {
41
+ if (i.setAttribute("loading", String(this.loading)), i.value === this.value && (i.checked = !0), i.hasAttribute("aria-describedby")) {
42
+ let s = i.getAttribute("aria-describedby");
43
+ i.setAttribute("aria-describedby", `${this.hintId} ${s}`);
44
+ } else
45
+ i.setAttribute("aria-describedby", this.hintId);
46
+ }), this.prismConnected.emit({ name: "prism-radio-group-connected", id: this.prismId, required: this.required }), p("prism-radio-group");
47
+ }
48
+ componentDidUpdate() {
49
+ Array.from(this.radios).forEach((i) => {
50
+ i.setAttribute("loading", String(this.loading));
51
+ });
52
+ }
53
+ render() {
54
+ return e(n, { key: "bd9808f1dde2817d4c7f9a6521813692dd53a07d" }, e("fieldset", { key: "69d6cefbb0923cb8e9d22d3125667f59e0451a2d", id: this.prismId, class: { invalid: this.invalid }, role: "radiogroup", "aria-required": this.required.toString(), "aria-invalid": this.invalid.toString() }, e("legend", { key: "2ddbb4cb569449058263e0bde0aeb71e42c21af0", class: {
55
+ "legend-container": !0,
56
+ "screen-reader-text": !this.showLegend || this.legend === ""
57
+ } }, e("prism-text", { key: "3dcb600819870fffcc31b712acf17fce49adc840", class: "legend", tag: "span", display: this.legendTypeSize }, this.legend), this.required && e(g, { key: "0432d4848af93e0dab21fd190d1bf6f41c600397" })), e("section", { key: "d961c4151d638cba5c71c7792ecc7756b845c9c9", class: { [`layout-${this.layout}`]: !0 } }, e("slot", { key: "4d7490f37cc708ca2a983d3bda9aa5cd13bd7022" })), e("span", { key: "11e81eb37d8a405d81559eb0a463404b6c91aa43", "aria-live": "polite", id: this.hintId }, this.invalid && e("span", { key: "4511ec404db31387d99672ce9941ff8b3458534d", class: "hint-container" }, this.invalid && e("prism-icon", { key: "a0ac63aba1753e1a8a88732496c637e41dcdb090", theme: "fill", size: "xs", tone: "negative", name: "alert" }), e("prism-text", { key: "44296d8c10912277bf2ecea69a99b5b64d2232fd", class: "invalid-message", display: "caption" }, this.invalidMessage)))));
58
+ }
59
+ get el() {
60
+ return c(this);
61
+ }
62
+ };
63
+ u.style = m;
64
+ export {
65
+ u as prism_radio_group
66
+ };
@@ -0,0 +1,101 @@
1
+ import { r as s, c as a, h as e, H as o, g as d } from "./index-DxRZ6prf.js";
2
+ import { g as c, m as n } from "./index-e6818ded-r_t6ryaW.js";
3
+ import { A as l } from "./index-b30029d4-hGeLy_--.js";
4
+ /*!
5
+ * Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
6
+ */
7
+ const p = '.sr-input.sc-prism-radio{margin:0;opacity:0;overflow:hidden;padding:0;position:absolute!important;visibility:visible}.sc-prism-radio-h{--display:block;--radio-margin-top:1rem;--radio-margin-bottom:1rem;display:var(--display);margin-bottom:var(--radio-margin-bottom);margin-top:var(--radio-margin-top);position:relative;width:auto}.screen-reader-text.sc-prism-radio{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.label.sc-prism-radio{-moz-column-gap:1rem;column-gap:1rem;display:grid;grid-template-areas:"radio label" "radio hint";grid-template-columns:-webkit-max-content 1fr;grid-template-columns:max-content 1fr;grid-template-rows:1fr}.no-visual.label.sc-prism-radio{gap:0}.label.right.sc-prism-radio{grid-template-areas:"label radio" "hint radio"}.label.sc-prism-radio:hover{cursor:pointer}.input[disabled].sc-prism-radio:hover,.label.disabled.sc-prism-radio:hover{cursor:not-allowed}.label-text.sc-prism-radio{--tw-text-opacity:1;color:rgb(var(--text-color-neutral-base)/var(--tw-text-opacity));grid-area:label}.label-text.sc-prism-radio,.radio.sc-prism-radio{display:inline-block;vertical-align:middle}.radio.sc-prism-radio{--tw-bg-opacity:1;--shadow-color:var(--material-neutral-base-shadow);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-inset:inset;--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-neutral2-base)/var(--tw-ring-opacity));background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));border-radius:50%;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000);box-sizing:initial;flex-shrink:0;grid-area:radio;height:1.5rem;pointer-events:none;position:relative;text-align:center;transition:all .2s ease-in;transition-property:border-width,border-color,box-shadow;width:1.5rem}.radio.sc-prism-radio:before{inset:0;position:absolute;transition-duration:.2s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,1,1);z-index:0}.radio.sc-prism-radio:after,.radio.sc-prism-radio:before{border-radius:50%;content:"";display:block}.radio.sc-prism-radio:after{background-color:var(--background-color-transparent,transparent);bottom:.3125rem;height:.875rem;left:.3125rem;position:relative;right:.3125rem;top:.3125rem;transition:all .2s ease-in;transition-property:outline,background;width:.875rem}.input.sc-prism-radio{border-radius:50%;border-style:solid;border-width:2px;cursor:pointer;height:1.5rem;left:2px;margin:0;opacity:0;overflow:hidden;padding:0;position:absolute;top:2px;visibility:visible;width:1.5rem}.checked.sc-prism-radio{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-theme1-base)/var(--tw-ring-opacity));box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.checked.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-theme1-base-shadow);background-color:rgb(var(--background-color-fill-theme1-base)/var(--tw-bg-opacity))}.sc-prism-radio-h:focus-within .sc-prism-radio:not(.loading) .radio.sc-prism-radio{outline-color:var(--outline-color-neutral2-focus,#35353b);outline-offset:2px;outline-style:solid;outline-width:1px}.sc-prism-radio-h:focus-within .sc-prism-radio:not(.loading) .checked.sc-prism-radio{outline-color:var(--outline-color-theme1-focus,#3d1881)}.sc-prism-radio-h:focus-within .sc-prism-radio:not(.loading) .checked.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-theme1-focus-shadow);background-color:rgb(var(--background-color-fill-theme1-focus)/var(--tw-bg-opacity))}.input.sc-prism-radio:hover+.label.sc-prism-radio:not(.disabled) .radio.sc-prism-radio,.label.sc-prism-radio:not(.disabled):hover .radio.sc-prism-radio{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-neutral-hover)/var(--tw-ring-opacity))}.input.sc-prism-radio:hover+.label.sc-prism-radio:not(.disabled) .checked.sc-prism-radio:after,.label.sc-prism-radio:not(.disabled):hover .checked.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-theme1-hover-shadow);background-color:rgb(var(--background-color-fill-theme1-hover)/var(--tw-bg-opacity))}.input.sc-prism-radio:hover+.label.sc-prism-radio:not(.disabled) .checked.sc-prism-radio,.label.sc-prism-radio:not(.disabled):hover .checked.sc-prism-radio{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-theme1-hover)/var(--tw-ring-opacity))}.sc-prism-radio-h:focus-within .label.sc-prism-radio .checked.invalid.sc-prism-radio,.sc-prism-radio-h:focus-within .label.sc-prism-radio .invalid.sc-prism-radio{outline-color:var(--outline-color-negative-focus,#8f002f)}.sc-prism-radio-h:focus-within .label.sc-prism-radio .checked.invalid.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-negative-focus-shadow);background-color:rgb(var(--background-color-fill-negative-focus)/var(--tw-bg-opacity))}.input.sc-prism-radio:hover+.label.sc-prism-radio:not(.disabled) .invalid.sc-prism-radio,.label.sc-prism-radio:not(.disabled):hover .invalid.sc-prism-radio{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-negative-hover)/var(--tw-ring-opacity))}.input.sc-prism-radio:hover+.label.sc-prism-radio:not(.disabled) .checked.invalid.sc-prism-radio:after,.label.sc-prism-radio:not(.disabled):hover .checked.invalid.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-negative-hover-shadow);background-color:rgb(var(--background-color-fill-negative-hover)/var(--tw-bg-opacity))}.invalid.sc-prism-radio{--tw-ring-opacity:1;--tw-ring-color:rgb(var(--ring-color-stroke-negative-base)/var(--tw-ring-opacity))}.checked.invalid.sc-prism-radio:after{--tw-bg-opacity:1;--shadow-color:var(--fill-negative-base-shadow);background-color:rgb(var(--background-color-fill-negative-base)/var(--tw-bg-opacity))}.disabled.sc-prism-radio{cursor:not-allowed;opacity:var(--opacity-inactive,.3)}.hint-container.sc-prism-radio{align-items:center;display:flex;margin-top:.25rem}.hint-container.sc-prism-radio>.sc-prism-radio:not([hidden])~.sc-prism-radio:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.hint-text.sc-prism-radio{display:block;text-align:left}.invalid-text.sc-prism-radio{--tw-text-opacity:1;color:rgb(var(--text-color-negative-base)/var(--tw-text-opacity))}.loading.sc-prism-radio{cursor:wait;pointer-events:none}.loading.sc-prism-radio .radio.sc-prism-radio{--tw-ring-opacity:var(--opacity-inactive,0.3)}.loading.sc-prism-radio .radio.sc-prism-radio:after{--tw-bg-opacity:var(--background-opacity-inactive,0.3)}.loading-spinner.sc-prism-radio{--tw-border-opacity:var(--border-opacity-inactive,0.3);--tw-text-opacity:1;align-items:center;color:rgb(var(--text-color-neutral2-base)/var(--tw-text-opacity));display:flex;inset:0;justify-content:center;position:absolute;z-index:10}.checked.sc-prism-radio .loading-spinner.sc-prism-radio{--tw-text-opacity:1;color:rgb(var(--text-color-theme1-base)/var(--tw-text-opacity))}@media (prefers-reduced-motion:reduce){.radio.sc-prism-radio,.radio.sc-prism-radio:after,.radio.sc-prism-radio:before{transition:none}}', h = p, m = class {
8
+ constructor(r) {
9
+ s(this, r), this.prismChange = a(this, "prismChange", 7), this.prismInput = a(this, "prismInput", 7), this.prismRadioElement = a(this, "prismRadioElement", 7), this.prismBlur = a(this, "prismBlur", 7), this.prismFocus = a(this, "prismFocus", 7), this.uid = c(), this.isDirty = !1, this._supressAsterisk = !1, this.prismId = `prism-radio-${this.uid}`, this.name = this.prismId, this.label = this.name.charAt(0).toUpperCase() + this.name.replace(/-/g, " ").substring(1), this.checked = !1, this.required = !1, this.disabled = !1, this.loading = !1, this.hideLabel = !1, this.hideInvalid = !1, this.hint = void 0, this.invalid = !1, this.invalidMessage = "This field is required", this.ariaDescribedby = "", this.value = void 0, this.alignment = "left", this.hintId = `${this.prismId}-hint`, this.describedBy = void 0;
10
+ }
11
+ /**
12
+ * Listen for Prism Connected Event
13
+ */
14
+ onConnected(r) {
15
+ let i = r.detail.id, t = this.el.closest("prism-radio-group").querySelector("fieldset").id;
16
+ i === t && r.detail.name === "prism-radio-group-connected" && r.detail.required === !0 && (this._supressAsterisk = !0);
17
+ }
18
+ /**
19
+ * @description Public: Set Focus on Input
20
+ */
21
+ async setFocus() {
22
+ this.element && this.element.focus();
23
+ }
24
+ /** @internal */
25
+ onCheckValidity(r) {
26
+ r.preventDefault();
27
+ const i = r.currentTarget, t = i.closest("prism-radio-group");
28
+ t ? t.setAttribute("invalid", !0) : (this.invalid = !i.validity.valid, this.describedBy = `${this.hintId} ${this.ariaDescribedby}`.trim()), this.prismInput.emit({ name: "check-validity", value: i.value, target: i, reason: i.validity });
29
+ }
30
+ // Emit onChange of Value Event
31
+ /** @internal */
32
+ valueChanged(r) {
33
+ var i;
34
+ (i = this.el) === null || i === void 0 || i.setAttribute("value", r.target.value), this.prismChange.emit({ name: "value-changed", value: r.target.value });
35
+ }
36
+ // Native Event Handling
37
+ /** @internal */
38
+ inputChanged(r) {
39
+ this.isDirty = !0, this.describedBy = `${this.hintId} ${this.ariaDescribedby}`.trim();
40
+ let i = r.currentTarget;
41
+ this.checked = i.checked, this.invalid = !i.validity.valid, this.prismInput.emit({
42
+ name: "radio-changed",
43
+ id: i.id,
44
+ group: this.name,
45
+ checked: this.checked,
46
+ invalid: this.invalid,
47
+ target: i
48
+ });
49
+ }
50
+ // Input has focus or blurred
51
+ /** @internal */
52
+ inputState(r) {
53
+ let i = r.currentTarget;
54
+ switch (r.type) {
55
+ case "blur":
56
+ this.isDirty && (this.invalid = !i.validity.valid), this.prismBlur.emit({
57
+ name: "input-blurred",
58
+ checked: this.checked,
59
+ type: "checkbox",
60
+ value: i.value,
61
+ target: i
62
+ });
63
+ break;
64
+ case "focus":
65
+ this.prismFocus.emit({
66
+ name: "input-focused",
67
+ checked: this.checked,
68
+ type: "checkbox",
69
+ value: i.value,
70
+ target: i
71
+ });
72
+ }
73
+ }
74
+ /**
75
+ * Listen to Keydown Events
76
+ */
77
+ /** @internal */
78
+ inputKeyDown(r) {
79
+ this.loading && (r.key === "ArrowUp" || r.key === "ArrowDown" || r.key === "ArrowLeft" || r.key === "ArrowRight") && r.preventDefault();
80
+ }
81
+ connectedCallback() {
82
+ this.describedBy = this.hint ? `${this.hintId} ${this.ariaDescribedby}`.trim() : this.ariaDescribedby, n("prism-radio");
83
+ }
84
+ render() {
85
+ const r = this.invalid;
86
+ return e(o, { key: "7ac3bfbc93eea9a5714eee5a1f84a287121047e6" }, e("input", { key: "3d5236732c00600dd6d4e7efa893368d45c9684d", onInput: (i) => this.inputChanged(i), onInvalid: (i) => this.onCheckValidity(i), onChange: (i) => this.valueChanged(i), onBlur: (i) => this.inputState(i), onFocus: (i) => this.inputState(i), onKeyDown: (i) => this.inputKeyDown(i), ref: (i) => this.element = i, checked: this.checked, id: this.prismId, name: this.name, type: "radio", disabled: this.disabled, required: this.required, "aria-describedby": this.describedBy ? this.describedBy : !1, value: this.value, class: { input: !0, loading: this.loading } }), e("label", { key: "ea7f622c38fa242d8e9b1ae41a66256acc190e7e", class: { label: !0, disabled: this.disabled, loading: this.loading, [this.alignment]: !0, "no-visual": this.hideLabel }, htmlFor: this.prismId }, e("span", { key: "7c2598ea9d2f78bc08362a6931085f17f2dffec6", class: { radio: !0, checked: this.checked, invalid: this.invalid } }, this.loading && e("span", { key: "ed26129c60f4951e44cce1eba7e488b2666b357e", class: "loading-spinner" }, e("prism-loading", { key: "4c593159c118cf3151a89b5e9d8d76fe3541f473", type: "spinner", "spinner-size": "xs" }))), e("prism-text", { key: "ceb413379d35308926f1078523ee95b04a28b847", display: "body1", class: { "label-text": !0, "screen-reader-text": this.hideLabel } }, this.label, this.required && !this._supressAsterisk && e(l, { key: "5e6f47838a0361ebdfa5f2a11cfde15e388b0ddd" })), this.hint && e("prism-text", { key: "08a04acc21766b10450b832a62f63d0199676d8e", display: "caption", priority: "secondary", class: { "hint-text": !0, "screen-reader-text": this.hideLabel } }, this.hint)), e("span", { key: "1ff04325136c7e1f9b645d5d48751c8d07a62655", "aria-live": "polite", id: this.hintId }, r && e("span", { key: "fb3aee60263782c399d73fc33097598755a9a1be", class: {
87
+ "hint-container": !0,
88
+ "screen-reader-text": this.invalid && this.hideInvalid
89
+ } }, this.invalid && e("prism-icon", { key: "1f55d5decff5a8a4e4c352836176d0085de83b6a", theme: "fill", slot: "icon-trailing", size: "xs", tone: "negative", name: "alert" }), e("prism-text", { key: "1ef1a080f45365dcc168eb08c7106be1eb707ebc", class: {
90
+ "invalid-text": this.invalid,
91
+ "hint-text": !0
92
+ }, display: "caption" }, this.invalidMessage))));
93
+ }
94
+ get el() {
95
+ return d(this);
96
+ }
97
+ };
98
+ m.style = h;
99
+ export {
100
+ m as prism_radio
101
+ };
@@ -0,0 +1,230 @@
1
+ import { r as g, c as h, h as i, F as f, H as y, g as x } from "./index-DxRZ6prf.js";
2
+ import { r as w } from "./index.esm-322571ff-D1REhsOg.js";
3
+ import { g as k, m as S } from "./index-e6818ded-r_t6ryaW.js";
4
+ import { A as C } from "./index-b30029d4-hGeLy_--.js";
5
+ /*!
6
+ * Copyright (c) 2025 Comcast. Prism UI - v7.32.2 - made with ❤️ in Philadelphia
7
+ */
8
+ const _ = '.text-body1.sc-prism-select{--text-body1-leading:var(--text-body1-line-height);--text-body1-family:var(--text-family-default);font-family:var(--text-body1-family);font-size:var(--text-body1-size);font-weight:var(--text-body1-weight);letter-spacing:var(--text-body1-letter-spacing);line-height:var(--text-body1-leading);text-transform:var(--text-body1-text-transform)}.text-callout2.sc-prism-select{--text-callout2-leading:var(--text-callout2-line-height);--text-callout2-family:var(--text-family-brand);font-family:var(--text-callout2-family);font-size:var(--text-callout2-size);font-weight:var(--text-callout2-weight);letter-spacing:var(--text-callout2-letter-spacing);line-height:var(--text-callout2-leading);text-transform:var(--text-callout2-text-transform)}.sc-prism-select-h{--select-margin-top:1rem;--select-margin-bottom:1rem;--select-padding-contained:1rem 3.5rem 1rem 1rem;--select-padding-minimal:0.75rem 1.5rem 0.5rem 0;--prism-select-results-height:50vh;display:block;margin-bottom:var(--select-margin-bottom,1rem);margin-top:var(--select-margin-top,1rem);position:relative;width:100%}.screen-reader-text.sc-prism-select{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.label-text.sc-prism-select{--tw-text-opacity:1;color:rgb(var(--text-color-neutral-base)/var(--tw-text-opacity));cursor:pointer;display:inline-block;margin-bottom:.25rem}@media (prefers-reduced-motion){.select.sc-prism-select{transition:none}}.select.sc-prism-select{--text-body1-leading:var(--text-body1-line-height);--text-body1-family:var(--text-family-default);--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--shadow-color:var(--material-neutral2-base-shadow);-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:rgb(var(--background-color-material-neutral2-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral-base)/var(--tw-border-opacity));border-radius:var(--border-radius-small,4px);border-style:solid;border-width:1px;box-sizing:border-box;color:rgb(var(--text-color-neutral-base)/var(--tw-text-opacity));display:block;font-family:var(--text-body1-family);font-family:inherit;font-size:var(--text-body1-size);font-weight:var(--text-body1-weight);letter-spacing:var(--text-body1-letter-spacing);line-height:var(--text-body1-leading);outline:2px solid transparent;outline-offset:2px;padding:var(--select-padding-contained);text-align:left;text-transform:var(--text-body1-text-transform);transition:all .2s ease-in-out;width:100%}.select.with-leading-icon.sc-prism-select{padding-left:3rem}.minimal.sc-prism-select-h .select.sc-prism-select{--tw-border-opacity:1;background-color:var(--background-color-transparent,transparent);border-color:rgb(var(--border-color-stroke-neutral2-base)/var(--tw-border-opacity));border-radius:var(--border-radius-none,0);border-style:solid;border-width:0 0 1px;padding:var(--select-padding-minimal)}.minimal.sc-prism-select-h .select.with-leading-icon.sc-prism-select{padding-left:2rem}.select.sc-prism-select:invalid{--tw-text-opacity:1;color:rgb(var(--text-color-neutral2-base)/var(--tw-text-opacity))}.select.sc-prism-select:focus{border-color:var(--border-color-transparent,transparent);outline:2px solid rgb(var(--border-color-stroke-theme1-base));outline-offset:0}.minimal.sc-prism-select-h .select.sc-prism-select:focus{--tw-border-opacity:1;border-bottom-width:2px;border-color:rgb(var(--border-color-stroke-theme1-base)/var(--tw-border-opacity));outline:2px solid transparent;outline-offset:2px}.hint-text.sc-prism-select{display:block;text-align:left}.invalid-text.sc-prism-select{--tw-text-opacity:1;color:rgb(var(--text-color-negative-base)/var(--tw-text-opacity))}.disabled.sc-prism-select{cursor:not-allowed;opacity:var(--opacity-inactive,.3)}.invalid.sc-prism-select{--tw-border-opacity:1;border-color:rgb(var(--border-color-stroke-negative-base)/var(--tw-border-opacity))}.invalid.sc-prism-select:focus{outline-color:rgb(var(--border-color-stroke-negative-base))}.minimal.sc-prism-select-h .invalid.sc-prism-select,.minimal.sc-prism-select-h .invalid.sc-prism-select:focus{--tw-border-opacity:1;border-color:rgb(var(--border-color-stroke-negative-base)/var(--tw-border-opacity))}.valid.sc-prism-select{--tw-border-opacity:1;border-color:rgb(var(--border-color-stroke-positive-base)/var(--tw-border-opacity))}.valid.sc-prism-select:focus{outline-color:rgb(var(--border-color-stroke-positive-base))}.minimal.sc-prism-select-h .valid.sc-prism-select,.minimal.sc-prism-select-h .valid.sc-prism-select:focus{--tw-border-opacity:1;border-color:rgb(var(--border-color-stroke-positive-base)/var(--tw-border-opacity))}.select-container.sc-prism-select{align-items:center;display:flex;position:relative}.arrow.sc-prism-select{pointer-events:none;position:absolute;right:1.5rem;z-index:10}.minimal.sc-prism-select-h .arrow.sc-prism-select{right:0}.arrow.hidden.sc-prism-select{display:none}.hint-container.sc-prism-select{align-items:center;display:flex;margin-top:.25rem}.hint-container.sc-prism-select>.sc-prism-select:not([hidden])~.sc-prism-select:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.result.sc-prism-select{--text-body1-leading:var(--text-body1-line-height);--text-body1-family:var(--text-family-default);align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--background-color-transparent,transparent);border-style:none;-moz-column-gap:1rem;column-gap:1rem;cursor:pointer;display:flex;font-family:var(--text-body1-family);font-size:var(--text-body1-size);font-weight:var(--text-body1-weight);justify-content:space-between;letter-spacing:var(--text-body1-letter-spacing);line-height:var(--text-body1-leading);padding:1rem;text-align:left;text-transform:var(--text-body1-text-transform);transition:background-color .2s ease-in-out;width:100%}.result.sc-prism-select .selected-icon.sc-prism-select{--tw-text-opacity:1;color:rgb(var(--text-color-theme1-base)/var(--tw-text-opacity))}.result.sc-prism-select:focus{outline-color:var(--outline-color-theme1-base,#5a23b9);outline-offset:-3px;outline-style:solid;outline-width:2px}.result.sc-prism-select:focus,.result.sc-prism-select:hover{--tw-bg-opacity:1;--shadow-color:var(--material-neutral-hover-shadow);background-color:rgb(var(--background-color-material-neutral-hover)/var(--tw-bg-opacity))}.result.sc-prism-select:hover{--prism-text-priority:1}.result.sc-prism-select:active{--tw-bg-opacity:1;--shadow-color:var(--material-neutral-down-shadow);background-color:rgb(var(--background-color-material-neutral-down)/var(--tw-bg-opacity))}.result.selected.sc-prism-select{--tw-bg-opacity:1;--shadow-color:var(--material-theme1-base-shadow);--prism-text-priority:1;background-color:rgb(var(--background-color-material-theme1-base)/var(--tw-bg-opacity))}.result.selected.sc-prism-select:active,.result.selected.sc-prism-select:focus,.result.selected.sc-prism-select:hover{--tw-bg-opacity:1;--shadow-color:var(--material-theme1-hover-shadow);background-color:rgb(var(--background-color-material-theme1-hover)/var(--tw-bg-opacity))}.result.selected.sc-prism-select:focus .selected-icon.sc-prism-select{--tw-text-opacity:1;color:rgb(var(--text-color-theme1-focus)/var(--tw-text-opacity))}.result.sc-prism-select:disabled{cursor:not-allowed}.result-group-label.sc-prism-select{--text-callout2-leading:var(--text-callout2-line-height);--text-callout2-family:var(--text-family-brand);--tw-text-opacity:0.6;font-family:var(--text-callout2-family);font-size:var(--text-callout2-size);font-weight:var(--text-callout2-weight);letter-spacing:var(--text-callout2-letter-spacing);line-height:var(--text-callout2-leading);padding:1rem;text-transform:var(--text-callout2-text-transform)}.results.sc-prism-select{--tw-border-opacity:1;--tw-border-opacity:var(--border-opacity-tertiary,0.15);--tw-bg-opacity:1;--shadow-color:var(--material-neutral-base-shadow);background-color:rgb(var(--background-color-material-neutral-base)/var(--tw-bg-opacity));border-color:rgb(var(--border-color-stroke-neutral-base)/var(--tw-border-opacity));border-style:solid;border-width:1px;display:none;left:0;margin-top:.25rem;overflow:auto;position:absolute;top:0;width:100%;z-index:500}.arrow.results.sc-prism-select{display:none}.results.sc-prism-select{--tw-shadow:0px 4px 8px -4px var(--shadow-color);--tw-shadow-colored:0px 4px 8px -4px var(--tw-shadow-color);border-radius:var(--border-radius-medium,8px);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);max-height:var(--prism-select-results-height)}.results.open.sc-prism-select{display:block}.selection-content.sc-prism-select{-moz-column-gap:.5rem;column-gap:.5rem;display:grid;flex:1 1 auto;grid-template-areas:"title badge" "description badge";grid-template-columns:-webkit-max-content;grid-template-columns:max-content;grid-template-rows:auto}.selection-content.sc-prism-select .selection-title.sc-prism-select{grid-area:title;place-self:start}.selection-content.sc-prism-select .selection-description.sc-prism-select{grid-area:description;place-self:start}.selection-content.sc-prism-select .selection-attributes.sc-prism-select{grid-area:badge;place-self:center;justify-self:start}.results-container.sc-prism-select{position:relative}.announcement.sc-prism-select{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.count-badge.sc-prism-select{margin-right:.25rem}.sc-prism-select-s>[css-slot=asset-leading]{left:1rem;position:absolute;z-index:1}.sc-prism-select-h.minimal.sc-prism-select-s>[css-slot=asset-leading],.sc-prism-select-h.minimal .sc-prism-select-s>[css-slot=asset-leading]{left:0}', O = _, E = class {
9
+ constructor(l) {
10
+ g(this, l), this.prismChange = h(this, "prismChange", 7), this.prismInput = h(this, "prismInput", 7), this.prismBlur = h(this, "prismBlur", 7), this.prismFocus = h(this, "prismFocus", 7), this.prismWatch = h(this, "prismWatch", 7), this.uid = k(), this.isDirty = !1, this.debounceDelay = 500, this.appearFrom = "bottom", this._hostTag = "prism-select", this._setResultsPosition = (t) => {
11
+ let s = window.innerHeight / 2;
12
+ this.appearFrom === "top" && s > t.top && (this.resultsPosition = "bottom"), this.appearFrom === "bottom" && s < t.bottom && (this.resultsPosition = "top"), this.hostHeight = `${t.height}px`;
13
+ }, this._setInitialValue = () => {
14
+ var t;
15
+ if (!this.customOptions) {
16
+ this.customOptions = this.options;
17
+ const s = (t = this.customOptions) === null || t === void 0 ? void 0 : t.find((r) => r.value === "" || r.selected === !0);
18
+ s && !this.native && (this.value = s.display);
19
+ }
20
+ }, this.slots = {
21
+ "asset-leading": !1
22
+ }, this.filterSelectedOptions = (t) => t.reduce((s, r) => (r.selected ? s.push(r) : r.children && (s = [...s, ...this.filterSelectedOptions(r.children)]), s), []), this._clearAllSelectedOptions = () => {
23
+ this.customOptions.forEach((t) => {
24
+ var s;
25
+ t.selected = t.selected = !1, (s = t.children) === null || s === void 0 || s.forEach((r) => {
26
+ r.selected = r.selected = !1;
27
+ });
28
+ });
29
+ }, this._updateCustomSelections = (t) => {
30
+ this.customOptions.map((s) => {
31
+ var r;
32
+ s.value === "" && (this.totalCustomOptions === 0 || this.totalCustomOptions === void 0) && (s.selected = !1), s.value === t && (s.selected = s.selected === void 0 ? !0 : !s.selected), (r = s.children) === null || r === void 0 || r.map((d) => {
33
+ d.value === t && (d.selected = d.selected === void 0 ? !0 : !d.selected);
34
+ });
35
+ });
36
+ }, this._setMultipleValues = () => {
37
+ if (this.multiple) {
38
+ if (this.hiddenValue = this.filterSelectedOptions(this.customOptions).map((t) => t.value).join(","), this.totalCustomOptions = this.hiddenValue !== "" ? this.hiddenValue.split(",").length : 0, this.totalCustomOptions <= 0) {
39
+ let t = this.customOptions.find((s) => s.value === "");
40
+ this.value = t.display, t.selected = !0, this.pseudoSelect.value = t.value;
41
+ } else
42
+ this.value = `Selected ${this.totalCustomOptions > 1 ? "options" : "option"}`, this.pseudoSelect.value = this.value;
43
+ this.liveMessage = `${this.totalCustomOptions} ${this.value}`;
44
+ }
45
+ }, this.selectOption = (t) => {
46
+ let s = t.currentTarget;
47
+ s.dataset.value === "" && this._clearAllSelectedOptions(), this.multiple || (this.pseudoSelect.value = s.dataset.value, this.value = s.dataset.value === "" ? s.dataset.display : s.dataset.value, this.nonNativeSingleValue = s.dataset.display || s.dataset.value, this.displayResults = !1, this._clearAllSelectedOptions(), this.pseudoSelect.focus()), this._updateCustomSelections(s.dataset.value), this._setMultipleValues(), this.prismChange.emit({
48
+ name: "value-changed",
49
+ value: this.multiple ? this.hiddenValue : this.value,
50
+ data: this.customOptions,
51
+ multiple: this.multiple
52
+ });
53
+ }, this.onBlur = (t) => {
54
+ t.target.closest(this.el.tagName.toLowerCase()) !== this.el && (this.displayResults = !1);
55
+ }, this.openCustomOptions = (t) => {
56
+ this.displayResults = !this.displayResults;
57
+ }, this.inputKeyListeners = (t) => {
58
+ switch (t.key) {
59
+ case "ArrowDown":
60
+ t.preventDefault(), this.resultsElement && this.resultsElement.querySelectorAll("button")[0].focus();
61
+ break;
62
+ case "Escape":
63
+ this.displayResults = !1;
64
+ break;
65
+ }
66
+ }, this.resultsKeyListeners = (t) => {
67
+ var s, r, d, e, o, n;
68
+ let a = t.currentTarget, p = this.resultsElement.querySelectorAll("button"), m = p[0], v = p[p.length - 1];
69
+ switch (t.key) {
70
+ case "ArrowDown":
71
+ switch (t.preventDefault(), (s = a.nextElementSibling) === null || s === void 0 ? void 0 : s.role) {
72
+ case "option":
73
+ (r = a.nextElementSibling) === null || r === void 0 || r.focus();
74
+ break;
75
+ case "group":
76
+ let c = a.nextElementSibling.querySelector('[role="option"]');
77
+ c == null || c.focus();
78
+ break;
79
+ default:
80
+ let u = (d = a.closest('[role="group"]')) === null || d === void 0 ? void 0 : d.nextElementSibling;
81
+ u ? u.focus() : m.focus();
82
+ break;
83
+ }
84
+ break;
85
+ case "ArrowUp":
86
+ switch (t.preventDefault(), (e = a.previousElementSibling) === null || e === void 0 ? void 0 : e.role) {
87
+ case "option":
88
+ (o = a.previousElementSibling) === null || o === void 0 || o.focus();
89
+ break;
90
+ case "group":
91
+ let c = a.previousElementSibling.querySelectorAll('[role="option"]'), u = c[c.length - 1];
92
+ u == null || u.focus();
93
+ break;
94
+ default:
95
+ let b = (n = a.closest('[role="group"]')) === null || n === void 0 ? void 0 : n.previousElementSibling;
96
+ b ? b.focus() : v.focus();
97
+ break;
98
+ }
99
+ break;
100
+ case "Home":
101
+ m.focus();
102
+ break;
103
+ case "End":
104
+ v.focus();
105
+ break;
106
+ case "Escape":
107
+ this.displayResults = !1, this.pseudoSelect.focus();
108
+ break;
109
+ }
110
+ }, this.prismId = `prism-select-${this.uid}`, this.name = this.uid, this.label = this.name.charAt(0).toUpperCase() + this.name.replace(/-/g, " ").substring(1), this.required = !1, this.disabled = !1, this.hideLabel = !1, this.hideInvalid = !1, this.hint = void 0, this.multiple = !1, this.invalid = !1, this.invalidMessage = "This field is required", this.ariaDescribedby = "", this.value = void 0, this.options = void 0, this.readonly = !1, this.autoComplete = "off", this.variant = "contained", this.native = !0, this.describedBy = void 0, this.hintId = `${this.prismId}-hint`, this.valid = !1, this.hostHeight = "83", this.resultsPosition = "bottom", this.displayResults = !1, this.customOptions = void 0, this.selectedOptions = [], this.hiddenValue = void 0, this.liveMessage = void 0, this.totalCustomOptions = void 0, this.nonNativeSingleValue = void 0;
111
+ }
112
+ /**
113
+ * @description Public: Set Focus on Input
114
+ */
115
+ async setFocus() {
116
+ this.element && this.element.focus(), this.native || this.pseudoSelect.focus();
117
+ }
118
+ // Watch for changes to the form value
119
+ emitHiddenValue(l, t) {
120
+ l !== t && this.prismWatch.emit({
121
+ name: "multi-results-updated",
122
+ value: this.hiddenValue
123
+ });
124
+ }
125
+ // Watch for changes to options
126
+ setCustomOptions(l, t) {
127
+ this.native || this._setInitialValue();
128
+ }
129
+ onSubmit(l) {
130
+ !this.native && l.type === "submit" && this.pseudoSelect.ariaRequired === "true" && (this.invalid = this.pseudoSelect.value === "");
131
+ }
132
+ // Emit onChange of Value Event
133
+ /** @internal */
134
+ valueChanged(l) {
135
+ let t = [];
136
+ Array.from(l.target.selectedOptions).forEach((s) => t.push(s.value)), this.value = t.join(","), this.prismChange.emit({ name: "value-changed", value: this.value });
137
+ }
138
+ // Native Event Handling
139
+ /** @internal */
140
+ inputChanged(l) {
141
+ this.isDirty = !0;
142
+ let t = l.currentTarget;
143
+ this.prismInput.emit({
144
+ name: "input-changed",
145
+ id: t.id,
146
+ invalid: this.invalid,
147
+ target: t
148
+ });
149
+ }
150
+ /** @internal */
151
+ onCheckValidity(l) {
152
+ l.preventDefault();
153
+ const t = l.currentTarget;
154
+ this.invalid = !t.validity.valid, this.valid = t.validity.valid, this.describedBy = `${this.hintId} ${this.ariaDescribedby}`.trim(), this.prismInput.emit({ name: "check-validity", value: t.value, target: t, reason: t.validity });
155
+ }
156
+ // Input has focus or blurred
157
+ /** @internal */
158
+ inputState(l) {
159
+ let t = l.currentTarget;
160
+ switch (l.type) {
161
+ case "blur":
162
+ this.isDirty && (this.invalid = !t.validity.valid, this.valid = t.validity.valid), this.prismBlur.emit({ name: "input-blurred", value: t.value, target: t });
163
+ break;
164
+ case "focus":
165
+ this.prismFocus.emit({ name: "input-focused", value: t.value, target: t });
166
+ }
167
+ }
168
+ connectedCallback() {
169
+ this.el.querySelector('[slot="asset-leading"]') && (this.el.querySelector('[slot="asset-leading"]').setAttribute("css-slot", "asset-leading"), this.slots["asset-leading"] = !0), this.describedBy = this.hint ? `${this.hintId} ${this.ariaDescribedby}` : this.ariaDescribedby, this.native || (document.addEventListener("mousedown", this.onBlur), document.addEventListener("keyup", this.onBlur), this.appearFrom ? this.resultsPosition = this.appearFrom : window.addEventListener("resize", w(() => {
170
+ this._setResultsPosition(this.el.getBoundingClientRect());
171
+ }, this.debounceDelay)), this._setInitialValue()), S("prism-select");
172
+ }
173
+ disconnectedCallback() {
174
+ document.removeEventListener("mousedown", this.onBlur);
175
+ }
176
+ componentDidLoad() {
177
+ this._hostDimensions = this.el.getBoundingClientRect();
178
+ }
179
+ componentWillRender() {
180
+ this._hostDimensions && this._setResultsPosition(this._hostDimensions);
181
+ }
182
+ componentDidRender() {
183
+ var l;
184
+ this.displayResults && !this.native && this.resultsElement && !this.multiple && ((l = this.resultsElement.querySelector('[aria-selected="true"]')) === null || l === void 0 || l.focus()), !this.native && this.multiple && this._setMultipleValues();
185
+ }
186
+ render() {
187
+ var l, t;
188
+ const s = this.invalid || this.hint, r = (e) => {
189
+ let o = e.selected;
190
+ const n = !!(e != null && e.icon) || !!(e != null && e.iconPath);
191
+ return i("button", { role: "option", type: "button", "aria-selected": o == null ? void 0 : o.toString(), key: e.value, "data-value": e.value, "data-display": e.display, value: e.display || e.value, name: e.display || e.value, hidden: e.hidden, disabled: e.disabled, onClick: (a) => this.selectOption(a), onKeyDown: (a) => this.resultsKeyListeners(a), class: { result: !0, selected: o } }, n && i("prism-icon", { class: e == null ? void 0 : e.iconCss, tone: "custom", "aria-hidden": "true", role: "presentation", label: e == null ? void 0 : e.iconLabel, theme: (e == null ? void 0 : e.iconTheme) || "fill", name: e == null ? void 0 : e.icon, path: e == null ? void 0 : e.iconPath }), i("span", { class: "selection-content" }, i("span", { class: "selection-title" }, e.display || e.value), (e == null ? void 0 : e.description) && i("prism-text", { display: "body2", priority: "secondary", class: "selection-description" }, e == null ? void 0 : e.description), (e == null ? void 0 : e.badge) && i("prism-badge", { tone: e.selected ? "theme1" : "neutral2", label: e == null ? void 0 : e.badgeLabel, class: "selection-attributes", priority: "high" }, e == null ? void 0 : e.badge)), o && i("prism-icon", { class: { "checked-icon": !0, "selected-icon": o, hide: !o }, tone: "custom", name: "check", role: "presentation", "aria-hidden": "true" }));
192
+ }, d = !this.native && !this.nonNativeSingleValue;
193
+ return i(y, { value: this.value, class: { [this.variant]: !0 } }, this.multiple && !this.native && i("div", { class: "announcement", "aria-live": "polite", "aria-atomic": "true" }, this.liveMessage), i("label", { id: `labelfor-${this.prismId}`, htmlFor: this.prismId }, i("prism-text", { tag: "span", display: "caption", class: { "label-text": !0, "screen-reader-text": this.hideLabel } }, this.label, this.required && i(C, null))), i("div", { class: "select-container" }, i("slot", { name: "asset-leading" }), this.native ? i("select", { autoComplete: this.autoComplete, multiple: this.multiple, onChange: (e) => this.valueChanged(e), onInput: (e) => this.inputChanged(e), onInvalid: (e) => this.onCheckValidity(e), onBlur: (e) => this.inputState(e), onFocus: (e) => this.inputState(e), id: this.prismId, ref: (e) => this.element = e, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid.toString(), "aria-required": this.required.toString(), "aria-describedby": this.describedBy ? this.describedBy : !1, class: {
194
+ select: !0,
195
+ "with-leading-icon": this.slots["asset-leading"],
196
+ disabled: this.disabled,
197
+ invalid: this.invalid,
198
+ valid: this.valid
199
+ } }, (l = this.options) === null || l === void 0 ? void 0 : l.map((e) => {
200
+ var o;
201
+ let n = (o = this.value) === null || o === void 0 ? void 0 : o.split(",");
202
+ return e.label ? i("optgroup", { label: e.label }, e.children.map((a) => i("option", { selected: a.selected || (n == null ? void 0 : n.includes(a.value)), key: a.value, value: a.value, hidden: a.hidden, disabled: a.disabled }, a.display || a.value))) : i("option", { selected: e.selected || (n == null ? void 0 : n.includes(e.value)), key: e.value, value: e.value, hidden: e.hidden, disabled: e.disabled }, e.display || e.value);
203
+ }), i("slot", { name: "option" })) : i("button", { type: "button", onClick: (e) => this.openCustomOptions(e), onKeyDown: (e) => this.inputKeyListeners(e), "aria-controls": `custom-selections-${this.prismId}`, "aria-expanded": this.displayResults.toString(), "aria-haspopup": "listbox", "aria-labelledby": `labelfor-${this.prismId} trigger-${this.prismId}`, id: `trigger-${this.prismId}`, name: this.name, disabled: this.disabled, ref: (e) => this.pseudoSelect = e, "aria-describedby": this.describedBy ? this.describedBy : !1, class: {
204
+ select: !0,
205
+ "with-leading-icon": this.slots["asset-leading"],
206
+ disabled: this.disabled,
207
+ invalid: this.invalid,
208
+ valid: this.valid
209
+ } }, i(f, null, this.multiple && this.totalCustomOptions >= 1 && i("prism-badge", { class: "count-badge", tone: "theme1", size: "sm" }, this.totalCustomOptions), d ? this.value : this.multiple ? this.value : this.nonNativeSingleValue)), i("prism-icon", { role: "presentation", "aria-hidden": "true", class: { arrow: !0 }, style: { "--icon-color": "inherit" }, theme: "fill", size: "sm", name: this.displayResults ? "caret_up_button" : "caret_down_button" })), !this.native && i("section", { style: { "--bottom": this.hostHeight }, class: { "results-container": !0 }, ref: (e) => this.resultsContainerElement = e }, i("section", { role: "listbox", "aria-multiselectable": this.multiple ? "true" : void 0, id: `custom-selections-${this.prismId}`, tabindex: "-1", class: { results: !0, open: this.displayResults, [this.resultsPosition]: !0 }, ref: (e) => this.resultsElement = e }, (t = this.customOptions) === null || t === void 0 ? void 0 : t.map((e, o) => {
210
+ if (e.label && e.children) {
211
+ let n = `${e.label.replaceAll(" ", "-").toLowerCase()}-group`;
212
+ return i("div", { key: o, role: "group", "aria-labelledby": n }, i("div", { class: "result-group-label", "aria-hidden": "true", id: n }, e.label), e.children.map((a) => i(r, Object.assign({}, a))));
213
+ } else
214
+ return i(r, Object.assign({}, e));
215
+ }))), i("span", { "aria-live": "polite", id: this.hintId }, s && i("span", { class: { "hint-container": !0, "screen-reader-text": this.invalid && this.hideInvalid } }, this.invalid && i("prism-icon", { theme: "fill", slot: "icon-trailing", size: "xs", tone: "negative", name: "alert" }), i("prism-text", { class: { "invalid-text": this.invalid, "hint-text": !0 }, display: "caption" }, this.invalid ? this.invalidMessage : this.hint))), !this.native && !this.multiple && i("input", { type: "hidden", name: this.name, value: this.value }), this.multiple && i("input", { type: "hidden", name: this.name, value: this.hiddenValue }));
216
+ }
217
+ get el() {
218
+ return x(this);
219
+ }
220
+ static get watchers() {
221
+ return {
222
+ hiddenValue: ["emitHiddenValue"],
223
+ options: ["setCustomOptions"]
224
+ };
225
+ }
226
+ };
227
+ E.style = O;
228
+ export {
229
+ E as prism_select
230
+ };