@turquoisehealth/pit-viper 2.122.0 → 2.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/package.json +43 -13
  2. package/pv-components/dist/stats/vue/base/stats.html +4949 -0
  3. package/pv-components/dist/stats/vue/visualizations/stats.html +4949 -0
  4. package/pv-components/dist/stats/web/pv-accordion-stats.html +4949 -0
  5. package/pv-components/dist/stats/web/pv-action-bar-stats.html +4949 -0
  6. package/pv-components/dist/stats/web/pv-ai-button-stats.html +4949 -0
  7. package/pv-components/dist/stats/web/pv-avatar-group-stats.html +4949 -0
  8. package/pv-components/dist/stats/web/pv-avatar-stats.html +4949 -0
  9. package/pv-components/dist/stats/web/pv-banner-stats.html +4949 -0
  10. package/pv-components/dist/stats/web/pv-breadcrumbs-stats.html +4949 -0
  11. package/pv-components/dist/stats/web/pv-button-stats.html +4949 -0
  12. package/pv-components/dist/stats/web/pv-card-stats.html +4949 -0
  13. package/pv-components/dist/stats/web/pv-checkbox-stats.html +4949 -0
  14. package/pv-components/dist/stats/web/pv-company-label-stats.html +4949 -0
  15. package/pv-components/dist/stats/web/pv-company-logo-stats.html +4949 -0
  16. package/pv-components/dist/stats/web/pv-company-tag-stats.html +4949 -0
  17. package/pv-components/dist/stats/web/pv-counter-badge-stats.html +4949 -0
  18. package/pv-components/dist/stats/web/pv-date-picker-stats.html +4949 -0
  19. package/pv-components/dist/stats/web/pv-date-time-stats.html +4949 -0
  20. package/pv-components/dist/stats/web/pv-distribution-bar-stats.html +4949 -0
  21. package/pv-components/dist/stats/web/pv-drawer-stats.html +4949 -0
  22. package/pv-components/dist/stats/web/pv-dropdown-stats.html +4949 -0
  23. package/pv-components/dist/stats/web/pv-expandable-content-stats.html +4949 -0
  24. package/pv-components/dist/stats/web/pv-ghost-input-stats.html +4949 -0
  25. package/pv-components/dist/stats/web/pv-icon-stats.html +4949 -0
  26. package/pv-components/dist/stats/web/pv-input-stats.html +4949 -0
  27. package/pv-components/dist/stats/web/pv-insight-card-stats.html +4949 -0
  28. package/pv-components/dist/stats/web/pv-modal-stats.html +4949 -0
  29. package/pv-components/dist/stats/web/pv-multi-select-button-stats.html +4949 -0
  30. package/pv-components/dist/stats/web/pv-pagination-stats.html +4949 -0
  31. package/pv-components/dist/stats/web/pv-pill-stats.html +4949 -0
  32. package/pv-components/dist/stats/web/pv-popover-menu-stats.html +4949 -0
  33. package/pv-components/dist/stats/web/pv-popover-stats.html +4949 -0
  34. package/pv-components/dist/stats/web/pv-popover-v2-stats.html +4949 -0
  35. package/pv-components/dist/stats/web/pv-progress-bar-stats.html +4949 -0
  36. package/pv-components/dist/stats/web/pv-rating-stats.html +4949 -0
  37. package/pv-components/dist/stats/web/pv-release-badge-stats.html +4949 -0
  38. package/pv-components/dist/stats/web/pv-search-input-stats.html +4949 -0
  39. package/pv-components/dist/stats/web/pv-segmented-control-stats.html +4949 -0
  40. package/pv-components/dist/stats/web/pv-select-button-stats.html +4949 -0
  41. package/pv-components/dist/stats/web/pv-selectable-card-stats.html +4949 -0
  42. package/pv-components/dist/stats/web/pv-side-panel-stats.html +4949 -0
  43. package/pv-components/dist/stats/web/pv-skeleton-stats.html +4949 -0
  44. package/pv-components/dist/stats/web/pv-spinner-stats.html +4949 -0
  45. package/pv-components/dist/stats/web/pv-sprite-stats.html +4949 -0
  46. package/pv-components/dist/stats/web/pv-suggestion-tag-stats.html +4949 -0
  47. package/pv-components/dist/stats/web/pv-switch-stats.html +4949 -0
  48. package/pv-components/dist/stats/web/pv-tab-list-stats.html +4949 -0
  49. package/pv-components/dist/stats/web/pv-tabs-stats.html +4949 -0
  50. package/pv-components/dist/stats/web/pv-tag-stats.html +4949 -0
  51. package/pv-components/dist/stats/web/pv-text-area-stats.html +4949 -0
  52. package/pv-components/dist/stats/web/pv-toast-stats.html +4949 -0
  53. package/pv-components/dist/stats/web/pv-toggle-button-stats.html +4949 -0
  54. package/pv-components/dist/stats/web/pv-toggle-group-stats.html +4949 -0
  55. package/pv-components/dist/stats/web/pv-tooltip-stats.html +4949 -0
  56. package/pv-components/dist/stats/web/pv-tooltip-v2-stats.html +4949 -0
  57. package/pv-components/dist/stats/web/pv-tree-stats.html +4949 -0
  58. package/pv-components/dist/stats/web/pv-widget-stats.html +4949 -0
  59. package/pv-components/dist/vue/base/pv-components-base.mjs +4862 -11539
  60. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +4751 -11704
  61. package/pv-components/dist/web/components/pv-accordion/pv-accordion.js +265 -0
  62. package/pv-components/dist/web/components/pv-action-bar/pv-action-bar.js +134 -0
  63. package/pv-components/dist/web/components/pv-ai-button/pv-ai-button.js +225 -0
  64. package/pv-components/dist/web/components/pv-avatar/pv-avatar.js +164 -0
  65. package/pv-components/dist/web/components/pv-avatar-group/pv-avatar-group.js +170 -0
  66. package/pv-components/dist/web/components/pv-banner/pv-banner.js +224 -0
  67. package/pv-components/dist/web/components/pv-breadcrumbs/pv-breadcrumbs.js +160 -0
  68. package/pv-components/dist/web/components/pv-button/pv-button.js +242 -0
  69. package/pv-components/dist/web/components/pv-card/pv-card.js +148 -0
  70. package/pv-components/dist/web/components/pv-checkbox/pv-checkbox.js +145 -0
  71. package/pv-components/dist/web/components/pv-company-label/pv-company-label.js +221 -0
  72. package/pv-components/dist/web/components/pv-company-logo/pv-company-logo.js +192 -0
  73. package/pv-components/dist/web/components/pv-company-tag/pv-company-tag.js +274 -0
  74. package/pv-components/dist/web/components/pv-counter-badge/pv-counter-badge.js +157 -0
  75. package/pv-components/dist/web/components/pv-date-picker/pv-date-picker.js +7550 -0
  76. package/pv-components/dist/web/components/pv-date-time/pv-date-time.js +645 -0
  77. package/pv-components/dist/web/components/pv-distribution-bar/pv-distribution-bar.js +177 -0
  78. package/pv-components/dist/web/components/pv-drawer/pv-drawer.js +556 -0
  79. package/pv-components/dist/web/components/pv-dropdown/pv-dropdown.js +1792 -0
  80. package/pv-components/dist/web/components/pv-expandable-content/pv-expandable-content.js +304 -0
  81. package/pv-components/dist/web/components/pv-ghost-input/pv-ghost-input.js +320 -0
  82. package/pv-components/dist/web/components/pv-icon/pv-icon.js +150 -0
  83. package/pv-components/dist/web/components/pv-input/pv-input.js +191 -0
  84. package/pv-components/dist/web/components/pv-insight-card/pv-insight-card.js +363 -0
  85. package/pv-components/dist/web/components/pv-modal/pv-modal.js +186 -0
  86. package/pv-components/dist/web/components/pv-multi-select-button/pv-multi-select-button.js +2821 -0
  87. package/pv-components/dist/web/components/pv-pagination/pv-pagination.js +355 -0
  88. package/pv-components/dist/web/components/pv-pill/pv-pill.js +229 -0
  89. package/pv-components/dist/web/components/pv-popover/pv-popover.js +1485 -0
  90. package/pv-components/dist/web/components/pv-popover-menu/pv-popover-menu.js +1507 -0
  91. package/pv-components/dist/web/components/pv-popover-v2/pv-popover-v2.js +1489 -0
  92. package/pv-components/dist/web/components/pv-progress-bar/pv-progress-bar.js +156 -0
  93. package/pv-components/dist/web/components/pv-rating/pv-rating.js +146 -0
  94. package/pv-components/dist/web/components/pv-release-badge/pv-release-badge.js +142 -0
  95. package/pv-components/dist/web/components/pv-search-input/pv-search-input.js +238 -0
  96. package/pv-components/dist/web/components/pv-segmented-control/pv-segmented-control.js +214 -0
  97. package/pv-components/dist/web/components/pv-select-button/pv-select-button.js +2633 -0
  98. package/pv-components/dist/web/components/pv-selectable-card/pv-selectable-card.js +153 -0
  99. package/pv-components/dist/web/components/pv-side-panel/pv-side-panel.js +148 -0
  100. package/pv-components/dist/web/components/pv-skeleton/pv-skeleton.js +1593 -0
  101. package/pv-components/dist/web/components/pv-spinner/pv-spinner.js +151 -0
  102. package/pv-components/dist/web/components/pv-sprite/pv-sprite.js +150 -0
  103. package/pv-components/dist/web/components/pv-suggestion-tag/pv-suggestion-tag.js +195 -0
  104. package/pv-components/dist/web/components/pv-switch/pv-switch.js +162 -0
  105. package/pv-components/dist/web/components/pv-tab-list/pv-tab-list.js +168 -0
  106. package/pv-components/dist/web/components/pv-tabs/pv-tabs.js +248 -0
  107. package/pv-components/dist/web/components/pv-tag/pv-tag.js +210 -0
  108. package/pv-components/dist/web/components/pv-text-area/pv-text-area.js +188 -0
  109. package/pv-components/dist/web/components/pv-toast/pv-toast.js +292 -0
  110. package/pv-components/dist/web/components/pv-toggle-button/pv-toggle-button.js +208 -0
  111. package/pv-components/dist/web/components/pv-toggle-group/pv-toggle-group.js +7395 -0
  112. package/pv-components/dist/web/components/pv-tooltip/pv-tooltip.js +158 -0
  113. package/pv-components/dist/web/components/pv-tooltip-v2/pv-tooltip-v2.js +7325 -0
  114. package/pv-components/dist/web/components/pv-tree/pv-tree.js +5107 -0
  115. package/pv-components/dist/web/components/pv-widget/pv-widget.js +159 -0
  116. package/pv-components/dist/web/pv-components.iife.js +46 -46
  117. package/pv-components/dist/web/vue.runtime.esm-browser.prod.js +7 -0
  118. package/pv-components/dist/vue/base/pv-components-base.js +0 -1555
  119. package/pv-components/dist/vue/base/pv-components-base.umd.js +0 -1555
  120. package/pv-components/dist/vue/visualizations/pv-components-visualizations.js +0 -185
  121. package/pv-components/dist/vue/visualizations/pv-components-visualizations.umd.js +0 -185
@@ -0,0 +1,304 @@
1
+ import { ref as C, getCurrentInstance as A, defineComponent as b, computed as v, createElementBlock as m, openBlock as c, normalizeClass as g, createElementVNode as w, normalizeStyle as P, createBlock as y, Fragment as k, createCommentVNode as _, toDisplayString as $, createVNode as z, renderSlot as O, defineCustomElement as B } from "vue";
2
+ function j() {
3
+ const e = C(!1), t = A()?.root || {};
4
+ return "isCE" in t && t.isCE === !0 && (e.value = !0), e;
5
+ }
6
+ const N = [void 0, 10, 12, 20, 24, 32, 64], T = ["xlink:href"], E = /* @__PURE__ */ b({
7
+ __name: "PvIcon",
8
+ props: {
9
+ name: { type: String },
10
+ size: { type: null }
11
+ },
12
+ setup(e) {
13
+ const n = e, t = j(), s = C(null), r = v(() => ({
14
+ "pv-icon": !0,
15
+ [`pv-icon-${n.size}`]: N.includes(n.size)
16
+ })), a = v(() => t.value && s.value ? `${s.value}#${n.name}` : `#${n.name}`);
17
+ return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (s.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (u, o) => (c(), m(
18
+ "svg",
19
+ {
20
+ "data-testid": "pv-icon",
21
+ "aria-hidden": "true",
22
+ class: g(r.value)
23
+ },
24
+ [
25
+ w("use", { "xlink:href": a.value }, null, 8, T)
26
+ ],
27
+ 2
28
+ /* CLASS */
29
+ ));
30
+ }
31
+ }), L = /* @__PURE__ */ b({
32
+ __name: "PvSpinner",
33
+ props: {
34
+ variant: { default: "primary", type: String },
35
+ size: { default: "lg", type: String }
36
+ },
37
+ setup(e) {
38
+ const n = {
39
+ xs: "0.75rem",
40
+ sm: "1rem",
41
+ md: "1.25rem",
42
+ lg: "1.5rem",
43
+ xl: "2rem"
44
+ }, t = {
45
+ primary: "pv-spinner",
46
+ dark: "pv-spinner-dark",
47
+ white: "pv-spinner-light"
48
+ };
49
+ return (s, r) => (c(), m(
50
+ "div",
51
+ {
52
+ "data-testid": "pv-spinner",
53
+ class: g(t[e.variant]),
54
+ style: P({ "--size": n[e.size] })
55
+ },
56
+ null,
57
+ 6
58
+ /* CLASS, STYLE */
59
+ ));
60
+ }
61
+ }), x = {
62
+ md: "pv-button-small",
63
+ lg: void 0,
64
+ xl: "pv-button-large"
65
+ }, M = (e) => e == null || !x.hasOwnProperty(e) ? null : x[e] || null, R = ["disabled"], V = {
66
+ key: 1,
67
+ "data-testid": "pv-button-label"
68
+ }, D = /* @__PURE__ */ b({
69
+ __name: "PvButton",
70
+ props: {
71
+ variant: { default: "primary", type: String },
72
+ disabled: { type: Boolean, default: !1 },
73
+ size: { default: "lg", type: String },
74
+ loading: { type: Boolean, default: !1 },
75
+ label: { type: String },
76
+ leftIcon: { type: String },
77
+ rightIcon: { type: String },
78
+ inverse: { type: Boolean, default: !1 }
79
+ },
80
+ setup(e) {
81
+ const n = ["ghost"], t = e, s = v(() => {
82
+ const r = [];
83
+ t.inverse && n.includes(t.variant) ? r.push(`pv-button-${t.variant}-inverse`) : r.push(`pv-button-${t.variant}`);
84
+ const a = M(t.size);
85
+ return a && r.push(a), r;
86
+ });
87
+ return (r, a) => (c(), m("button", {
88
+ type: "button",
89
+ class: g(s.value),
90
+ disabled: e.disabled,
91
+ "data-testid": "pv-button"
92
+ }, [
93
+ e.loading ? (c(), y(L, {
94
+ key: 0,
95
+ size: "sm"
96
+ })) : (c(), m(
97
+ k,
98
+ { key: 1 },
99
+ [
100
+ e.leftIcon ? (c(), y(E, {
101
+ key: 0,
102
+ name: e.leftIcon,
103
+ "data-testid": "pv-button-left-icon"
104
+ }, null, 8, ["name"])) : _("v-if", !0),
105
+ e.label ? (c(), m(
106
+ "span",
107
+ V,
108
+ $(e.label),
109
+ 1
110
+ /* TEXT */
111
+ )) : _("v-if", !0),
112
+ e.rightIcon ? (c(), y(E, {
113
+ key: 2,
114
+ name: e.rightIcon,
115
+ "data-testid": "pv-button-right-icon"
116
+ }, null, 8, ["name"])) : _("v-if", !0)
117
+ ],
118
+ 64
119
+ /* STABLE_FRAGMENT */
120
+ ))
121
+ ], 10, R));
122
+ }
123
+ }), W = /* @__PURE__ */ b({
124
+ __name: "PvExpandableContent",
125
+ props: {
126
+ lines: { default: 4, type: Number },
127
+ size: { default: "md", type: String },
128
+ variant: { default: "primary", type: String },
129
+ defaultOpen: { type: Boolean, default: !1 }
130
+ },
131
+ setup(e) {
132
+ const n = {
133
+ none: "0",
134
+ xs: "4px",
135
+ sm: "8px",
136
+ md: "12px",
137
+ lg: "16px"
138
+ }, t = e, s = C(t.defaultOpen), r = () => {
139
+ s.value = !s.value;
140
+ }, a = v(() => ({
141
+ "--lines": s.value ? "none" : t.lines,
142
+ "max-height": s.value ? "100vh" : `${t.lines * 1.5}em`
143
+ }));
144
+ return (u, o) => (c(), m(
145
+ "div",
146
+ {
147
+ class: g([
148
+ "pv-inset-square expandable-content",
149
+ {
150
+ "pv-surface-accent": e.variant === "ghost"
151
+ }
152
+ ]),
153
+ style: P({ "--inset-size": n[e.size] })
154
+ },
155
+ [
156
+ w(
157
+ "p",
158
+ {
159
+ class: "pv-line-clamp pv-text-body-md pv-stack-8",
160
+ style: P(a.value)
161
+ },
162
+ [
163
+ O(u.$slots, "default", {}, void 0, !0)
164
+ ],
165
+ 4
166
+ /* STYLE */
167
+ ),
168
+ z(D, {
169
+ label: s.value ? "Show Less" : "Show More",
170
+ variant: "ghost",
171
+ size: "md",
172
+ onClick: r,
173
+ "left-icon": s.value ? "chevron-up" : "chevron-down"
174
+ }, null, 8, ["label", "left-icon"])
175
+ ],
176
+ 6
177
+ /* CLASS, STYLE */
178
+ ));
179
+ }
180
+ }), H = ".expandable-content[data-v-2f840307]{border-radius:.5rem}.expandable-content .pv-line-clamp[data-v-2f840307]{transition:max-height .3s ease-in-out}", G = (e, n) => {
181
+ const t = e.__vccOpts || e;
182
+ for (const [s, r] of n)
183
+ t[s] = r;
184
+ return t;
185
+ }, q = /* @__PURE__ */ G(W, [["styles", [H]], ["__scopeId", "data-v-2f840307"]]), J = /* @__PURE__ */ new Set(["PvIcon", "PvPopoverMenu", "PvPopover"]);
186
+ function U(e) {
187
+ return !J.has(e);
188
+ }
189
+ function S(e, n) {
190
+ const t = document.querySelector('link[href*="' + n + '"]');
191
+ if (!e.shadowRoot)
192
+ return !1;
193
+ if (t && e.shadowRoot) {
194
+ const s = t.href;
195
+ if (e.shadowRoot.querySelector(`link[href="${s}"]`))
196
+ return;
197
+ const r = document.createElement("link");
198
+ return r.rel = "stylesheet", r.href = s, e.shadowRoot.prepend(r), !0;
199
+ }
200
+ return !1;
201
+ }
202
+ function Z(e) {
203
+ if (!S(e, "pit-viper-v2")) {
204
+ if (S(e, "pit-viper")) {
205
+ S(e, "pit-viper-v2-scoped");
206
+ return;
207
+ }
208
+ console.warn(
209
+ "No global styles found for Pit Viper components. Make sure to include pit-viper.css or pit-viper-v2.css in your project."
210
+ );
211
+ }
212
+ }
213
+ const F = (e) => ({ shadowRoot: U(e) });
214
+ function K(e, n) {
215
+ return n === null ? !1 : n === "" || n === "true" ? !0 : (n === "false" || console.warn(
216
+ `Invalid boolean attribute value for "${e}": "${n}". Expected "true", "false", or empty string.`
217
+ ), !1);
218
+ }
219
+ function Q(e, n) {
220
+ const t = Number(n);
221
+ return isNaN(t) && console.warn(`Invalid number attribute value for "${e}": "${n}". Expected a valid number.`), t;
222
+ }
223
+ function X(e) {
224
+ const n = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = (e.__vccOpts || e).props;
225
+ return a && typeof a == "object" && Object.entries(a).forEach(([u, o]) => {
226
+ o === Boolean || o && o.type === Boolean ? n.add(u) : o === Number || o && o.type === Number ? t.add(u) : (o === Object || o === Array || o && (o.type === Object || o.type === Array)) && s.add(u);
227
+ }), { booleanProps: n, numberProps: t, jsonProps: s };
228
+ }
229
+ function I(e, n) {
230
+ try {
231
+ return JSON.parse(n);
232
+ } catch (t) {
233
+ return console.warn(
234
+ `Invalid JSON attribute value for "${e}": "${n}". Error: ${t instanceof Error ? t.message : String(t)}`
235
+ ), null;
236
+ }
237
+ }
238
+ function Y(e) {
239
+ const n = e.__name || e.name;
240
+ if (!n)
241
+ throw new Error("Component must have a __name or name property");
242
+ const t = B(e, F(n)), { booleanProps: s, numberProps: r, jsonProps: a } = X(e);
243
+ class u extends t {
244
+ _hiddenInput = null;
245
+ constructor() {
246
+ super(), this._parseAttributes();
247
+ }
248
+ disconnectedCallback() {
249
+ this._hiddenInput?.remove(), super.disconnectedCallback?.();
250
+ }
251
+ /**
252
+ * Update the hidden input value
253
+ * Call this from the Vue component to sync form value
254
+ */
255
+ setHiddenInputValue(p) {
256
+ this._hiddenInput && (this._hiddenInput.value = p ?? "");
257
+ }
258
+ _parseAttributes() {
259
+ s.forEach((i) => {
260
+ const l = this.getAttribute(i);
261
+ this[i] = K(i, l);
262
+ }), r.forEach((i) => {
263
+ const l = this.getAttribute(i);
264
+ l !== null && (this[i] = Q(i, l));
265
+ }), a.forEach((i) => {
266
+ const l = this.getAttribute(i);
267
+ if (l !== null) {
268
+ const d = I(i, l);
269
+ d !== null && (this[i] = d);
270
+ }
271
+ });
272
+ const p = this.getAttribute("data-json-props");
273
+ p && p.split(",").map((l) => l.trim()).filter(Boolean).forEach((l) => {
274
+ const d = l.replace(/-([a-z])/g, (f) => f[1].toUpperCase());
275
+ let h = this.getAttribute(l);
276
+ if (h === null) {
277
+ const f = d.replace(/([A-Z])/g, "-$1").toLowerCase();
278
+ h = this.getAttribute(f);
279
+ }
280
+ if (h !== null && !this[d]) {
281
+ const f = I(d, h);
282
+ f !== null && (this[d] = f);
283
+ }
284
+ });
285
+ }
286
+ connectedCallback() {
287
+ this._parseAttributes(), super.connectedCallback?.(), Z(this);
288
+ const p = this.getAttribute("name");
289
+ p && (this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = p, this.after(this._hiddenInput));
290
+ }
291
+ }
292
+ return u;
293
+ }
294
+ function ee(e) {
295
+ return e.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
296
+ }
297
+ function te(e) {
298
+ const n = e.__name || e.name;
299
+ if (!n)
300
+ throw new Error("Component must have a __name or name property");
301
+ const t = ee(n), s = Y(e);
302
+ customElements.get(t) || customElements.define(t, s);
303
+ }
304
+ te(q);
@@ -0,0 +1,320 @@
1
+ import { ref as S, getCurrentInstance as w, defineComponent as g, computed as _, createElementBlock as m, openBlock as p, normalizeClass as P, createElementVNode as x, normalizeStyle as $, createBlock as v, Fragment as A, createCommentVNode as b, toDisplayString as k, mergeModels as B, useTemplateRef as T, useModel as z, onMounted as O, watch as j, renderSlot as M, withDirectives as N, mergeProps as R, vModelText as V, defineCustomElement as W } from "vue";
2
+ function D() {
3
+ const t = S(!1), n = w()?.root || {};
4
+ return "isCE" in n && n.isCE === !0 && (t.value = !0), t;
5
+ }
6
+ const L = [void 0, 10, 12, 20, 24, 32, 64], G = ["xlink:href"], C = /* @__PURE__ */ g({
7
+ __name: "PvIcon",
8
+ props: {
9
+ name: { type: String },
10
+ size: { type: null }
11
+ },
12
+ setup(t) {
13
+ const e = t, n = D(), a = S(null), s = _(() => ({
14
+ "pv-icon": !0,
15
+ [`pv-icon-${e.size}`]: L.includes(e.size)
16
+ })), o = _(() => n.value && a.value ? `${a.value}#${e.name}` : `#${e.name}`);
17
+ return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (a.value = globalThis.__PV_GLOBAL_SPRITE_PATH__), (d, l) => (p(), m(
18
+ "svg",
19
+ {
20
+ "data-testid": "pv-icon",
21
+ "aria-hidden": "true",
22
+ class: P(s.value)
23
+ },
24
+ [
25
+ x("use", { "xlink:href": o.value }, null, 8, G)
26
+ ],
27
+ 2
28
+ /* CLASS */
29
+ ));
30
+ }
31
+ }), H = /* @__PURE__ */ g({
32
+ __name: "PvSpinner",
33
+ props: {
34
+ variant: { default: "primary", type: String },
35
+ size: { default: "lg", type: String }
36
+ },
37
+ setup(t) {
38
+ const e = {
39
+ xs: "0.75rem",
40
+ sm: "1rem",
41
+ md: "1.25rem",
42
+ lg: "1.5rem",
43
+ xl: "2rem"
44
+ }, n = {
45
+ primary: "pv-spinner",
46
+ dark: "pv-spinner-dark",
47
+ white: "pv-spinner-light"
48
+ };
49
+ return (a, s) => (p(), m(
50
+ "div",
51
+ {
52
+ "data-testid": "pv-spinner",
53
+ class: P(n[t.variant]),
54
+ style: $({ "--size": e[t.size] })
55
+ },
56
+ null,
57
+ 6
58
+ /* CLASS, STYLE */
59
+ ));
60
+ }
61
+ }), E = {
62
+ md: "pv-button-small",
63
+ lg: void 0,
64
+ xl: "pv-button-large"
65
+ }, J = (t) => t == null || !E.hasOwnProperty(t) ? null : E[t] || null, U = ["disabled"], q = {
66
+ key: 1,
67
+ "data-testid": "pv-button-label"
68
+ }, F = /* @__PURE__ */ g({
69
+ __name: "PvButton",
70
+ props: {
71
+ variant: { default: "primary", type: String },
72
+ disabled: { type: Boolean, default: !1 },
73
+ size: { default: "lg", type: String },
74
+ loading: { type: Boolean, default: !1 },
75
+ label: { type: String },
76
+ leftIcon: { type: String },
77
+ rightIcon: { type: String },
78
+ inverse: { type: Boolean, default: !1 }
79
+ },
80
+ setup(t) {
81
+ const e = ["ghost"], n = t, a = _(() => {
82
+ const s = [];
83
+ n.inverse && e.includes(n.variant) ? s.push(`pv-button-${n.variant}-inverse`) : s.push(`pv-button-${n.variant}`);
84
+ const o = J(n.size);
85
+ return o && s.push(o), s;
86
+ });
87
+ return (s, o) => (p(), m("button", {
88
+ type: "button",
89
+ class: P(a.value),
90
+ disabled: t.disabled,
91
+ "data-testid": "pv-button"
92
+ }, [
93
+ t.loading ? (p(), v(H, {
94
+ key: 0,
95
+ size: "sm"
96
+ })) : (p(), m(
97
+ A,
98
+ { key: 1 },
99
+ [
100
+ t.leftIcon ? (p(), v(C, {
101
+ key: 0,
102
+ name: t.leftIcon,
103
+ "data-testid": "pv-button-left-icon"
104
+ }, null, 8, ["name"])) : b("v-if", !0),
105
+ t.label ? (p(), m(
106
+ "span",
107
+ q,
108
+ k(t.label),
109
+ 1
110
+ /* TEXT */
111
+ )) : b("v-if", !0),
112
+ t.rightIcon ? (p(), v(C, {
113
+ key: 2,
114
+ name: t.rightIcon,
115
+ "data-testid": "pv-button-right-icon"
116
+ }, null, 8, ["name"])) : b("v-if", !0)
117
+ ],
118
+ 64
119
+ /* STABLE_FRAGMENT */
120
+ ))
121
+ ], 10, U));
122
+ }
123
+ }), Z = ["data-style"], K = ["placeholder", "disabled", "name"], Q = /* @__PURE__ */ g({
124
+ __name: "PvGhostInput",
125
+ props: /* @__PURE__ */ B({
126
+ variant: { default: "h1", type: null },
127
+ placeholder: { type: String },
128
+ disabled: { type: Boolean },
129
+ showEditIcon: { type: Boolean }
130
+ }, {
131
+ modelValue: {},
132
+ modelModifiers: {}
133
+ }),
134
+ emits: ["update:modelValue"],
135
+ setup(t) {
136
+ const e = T("inputRef"), n = {
137
+ h1: "ghost-input-h1",
138
+ h2: "ghost-input-h2",
139
+ h3: "ghost-input-h3",
140
+ h4: "ghost-input-h4",
141
+ "text-lg": "ghost-input-text-large",
142
+ "text-md": "ghost-input-text-medium",
143
+ "text-sm": "ghost-input-text-small",
144
+ caption: "ghost-input-caption"
145
+ }, a = {
146
+ h1: "h1",
147
+ h2: "h2",
148
+ h3: "h3",
149
+ h4: "h4",
150
+ "text-sm": "text-small",
151
+ "text-md": "text-medium",
152
+ "text-lg": "text-large",
153
+ caption: "caption"
154
+ }, s = t, o = z(t, "modelValue"), d = S(0), l = () => {
155
+ e.value?.focus();
156
+ };
157
+ O(() => {
158
+ o.value && o.value.length > 0 ? c(o.value) : s.placeholder ? c(s.placeholder) : d.value = 240;
159
+ }), j(
160
+ () => o.value,
161
+ () => {
162
+ o.value && o.value.length > 0 ? c(o.value) : s.placeholder ? c(s.placeholder) : d.value = 240;
163
+ }
164
+ );
165
+ const c = (i) => {
166
+ if (!e.value) return;
167
+ const u = document.createElement("canvas").getContext("2d");
168
+ if (!u) return;
169
+ const h = getComputedStyle(e.value);
170
+ u.font = `${h.fontWeight} ${h.fontSize} ${h.fontFamily}`, d.value = u.measureText(i).width + 10;
171
+ };
172
+ return (i, r) => (p(), m("div", {
173
+ class: "pv-ghost-input pv-full-width",
174
+ "data-testid": "pv-ghost-input",
175
+ "data-style": a[t.variant]
176
+ }, [
177
+ M(i.$slots, "action"),
178
+ N(x("input", R({
179
+ ref_key: "inputRef",
180
+ ref: e
181
+ }, s, {
182
+ "onUpdate:modelValue": r[0] || (r[0] = (u) => o.value = u),
183
+ type: "text",
184
+ style: {
185
+ width: d.value + "px"
186
+ },
187
+ placeholder: t.placeholder,
188
+ disabled: t.disabled,
189
+ name: n[t.variant]
190
+ }), null, 16, K), [
191
+ [V, o.value]
192
+ ]),
193
+ t.showEditIcon ? (p(), v(F, {
194
+ key: 0,
195
+ "left-icon": "edit",
196
+ variant: "ghost",
197
+ onClick: l
198
+ })) : b("v-if", !0)
199
+ ], 8, Z));
200
+ }
201
+ }), X = /* @__PURE__ */ new Set(["PvIcon", "PvPopoverMenu", "PvPopover"]);
202
+ function Y(t) {
203
+ return !X.has(t);
204
+ }
205
+ function y(t, e) {
206
+ const n = document.querySelector('link[href*="' + e + '"]');
207
+ if (!t.shadowRoot)
208
+ return !1;
209
+ if (n && t.shadowRoot) {
210
+ const a = n.href;
211
+ if (t.shadowRoot.querySelector(`link[href="${a}"]`))
212
+ return;
213
+ const s = document.createElement("link");
214
+ return s.rel = "stylesheet", s.href = a, t.shadowRoot.prepend(s), !0;
215
+ }
216
+ return !1;
217
+ }
218
+ function tt(t) {
219
+ if (!y(t, "pit-viper-v2")) {
220
+ if (y(t, "pit-viper")) {
221
+ y(t, "pit-viper-v2-scoped");
222
+ return;
223
+ }
224
+ console.warn(
225
+ "No global styles found for Pit Viper components. Make sure to include pit-viper.css or pit-viper-v2.css in your project."
226
+ );
227
+ }
228
+ }
229
+ const et = (t) => ({ shadowRoot: Y(t) });
230
+ function nt(t, e) {
231
+ return e === null ? !1 : e === "" || e === "true" ? !0 : (e === "false" || console.warn(
232
+ `Invalid boolean attribute value for "${t}": "${e}". Expected "true", "false", or empty string.`
233
+ ), !1);
234
+ }
235
+ function st(t, e) {
236
+ const n = Number(e);
237
+ return isNaN(n) && console.warn(`Invalid number attribute value for "${t}": "${e}". Expected a valid number.`), n;
238
+ }
239
+ function ot(t) {
240
+ const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = (t.__vccOpts || t).props;
241
+ return o && typeof o == "object" && Object.entries(o).forEach(([d, l]) => {
242
+ l === Boolean || l && l.type === Boolean ? e.add(d) : l === Number || l && l.type === Number ? n.add(d) : (l === Object || l === Array || l && (l.type === Object || l.type === Array)) && a.add(d);
243
+ }), { booleanProps: e, numberProps: n, jsonProps: a };
244
+ }
245
+ function I(t, e) {
246
+ try {
247
+ return JSON.parse(e);
248
+ } catch (n) {
249
+ return console.warn(
250
+ `Invalid JSON attribute value for "${t}": "${e}". Error: ${n instanceof Error ? n.message : String(n)}`
251
+ ), null;
252
+ }
253
+ }
254
+ function at(t) {
255
+ const e = t.__name || t.name;
256
+ if (!e)
257
+ throw new Error("Component must have a __name or name property");
258
+ const n = W(t, et(e)), { booleanProps: a, numberProps: s, jsonProps: o } = ot(t);
259
+ class d extends n {
260
+ _hiddenInput = null;
261
+ constructor() {
262
+ super(), this._parseAttributes();
263
+ }
264
+ disconnectedCallback() {
265
+ this._hiddenInput?.remove(), super.disconnectedCallback?.();
266
+ }
267
+ /**
268
+ * Update the hidden input value
269
+ * Call this from the Vue component to sync form value
270
+ */
271
+ setHiddenInputValue(c) {
272
+ this._hiddenInput && (this._hiddenInput.value = c ?? "");
273
+ }
274
+ _parseAttributes() {
275
+ a.forEach((i) => {
276
+ const r = this.getAttribute(i);
277
+ this[i] = nt(i, r);
278
+ }), s.forEach((i) => {
279
+ const r = this.getAttribute(i);
280
+ r !== null && (this[i] = st(i, r));
281
+ }), o.forEach((i) => {
282
+ const r = this.getAttribute(i);
283
+ if (r !== null) {
284
+ const u = I(i, r);
285
+ u !== null && (this[i] = u);
286
+ }
287
+ });
288
+ const c = this.getAttribute("data-json-props");
289
+ c && c.split(",").map((r) => r.trim()).filter(Boolean).forEach((r) => {
290
+ const u = r.replace(/-([a-z])/g, (f) => f[1].toUpperCase());
291
+ let h = this.getAttribute(r);
292
+ if (h === null) {
293
+ const f = u.replace(/([A-Z])/g, "-$1").toLowerCase();
294
+ h = this.getAttribute(f);
295
+ }
296
+ if (h !== null && !this[u]) {
297
+ const f = I(u, h);
298
+ f !== null && (this[u] = f);
299
+ }
300
+ });
301
+ }
302
+ connectedCallback() {
303
+ this._parseAttributes(), super.connectedCallback?.(), tt(this);
304
+ const c = this.getAttribute("name");
305
+ c && (this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = c, this.after(this._hiddenInput));
306
+ }
307
+ }
308
+ return d;
309
+ }
310
+ function it(t) {
311
+ return t.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
312
+ }
313
+ function rt(t) {
314
+ const e = t.__name || t.name;
315
+ if (!e)
316
+ throw new Error("Component must have a __name or name property");
317
+ const n = it(e), a = at(t);
318
+ customElements.get(n) || customElements.define(n, a);
319
+ }
320
+ rt(Q);