@turquoisehealth/pit-viper 2.122.0 → 2.122.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) 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/components/base/PvButton/helpers.d.ts +1 -0
  60. package/pv-components/dist/vue/base/components/base/PvMenu/PvMenuControlPanel.vue.d.ts +6 -0
  61. package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/PvMultiSelectButton.vue.d.ts +206 -289
  62. package/pv-components/dist/vue/base/components/base/PvMultiSelectButton/types.d.ts +31 -0
  63. package/pv-components/dist/vue/base/components/base/PvPopoverV2/PvPopoverV2.vue.d.ts +0 -1
  64. package/pv-components/dist/vue/base/components/base/PvPopoverV2/types.d.ts +6 -1
  65. package/pv-components/dist/vue/base/components/base/PvSelectButton/PvSelectButton.vue.d.ts +20 -177
  66. package/pv-components/dist/vue/base/components/base/PvSelectButton/PvSelectButtonTrigger/PvSelectButtonTrigger.vue.d.ts +4 -9
  67. package/pv-components/dist/vue/base/pv-components-base.mjs +4943 -11629
  68. package/pv-components/dist/vue/visualizations/pv-components-visualizations.mjs +4791 -10741
  69. package/pv-components/dist/web/components/pv-accordion/pv-accordion.js +265 -0
  70. package/pv-components/dist/web/components/pv-action-bar/pv-action-bar.js +134 -0
  71. package/pv-components/dist/web/components/pv-ai-button/pv-ai-button.js +225 -0
  72. package/pv-components/dist/web/components/pv-avatar/pv-avatar.js +164 -0
  73. package/pv-components/dist/web/components/pv-avatar-group/pv-avatar-group.js +170 -0
  74. package/pv-components/dist/web/components/pv-banner/pv-banner.js +224 -0
  75. package/pv-components/dist/web/components/pv-breadcrumbs/pv-breadcrumbs.js +160 -0
  76. package/pv-components/dist/web/components/pv-button/pv-button.js +242 -0
  77. package/pv-components/dist/web/components/pv-card/pv-card.js +148 -0
  78. package/pv-components/dist/web/components/pv-checkbox/pv-checkbox.js +145 -0
  79. package/pv-components/dist/web/components/pv-company-label/pv-company-label.js +221 -0
  80. package/pv-components/dist/web/components/pv-company-logo/pv-company-logo.js +192 -0
  81. package/pv-components/dist/web/components/pv-company-tag/pv-company-tag.js +274 -0
  82. package/pv-components/dist/web/components/pv-counter-badge/pv-counter-badge.js +157 -0
  83. package/pv-components/dist/web/components/pv-date-picker/pv-date-picker.js +7550 -0
  84. package/pv-components/dist/web/components/pv-date-time/pv-date-time.js +645 -0
  85. package/pv-components/dist/web/components/pv-distribution-bar/pv-distribution-bar.js +177 -0
  86. package/pv-components/dist/web/components/pv-drawer/pv-drawer.js +556 -0
  87. package/pv-components/dist/web/components/pv-dropdown/pv-dropdown.js +1792 -0
  88. package/pv-components/dist/web/components/pv-expandable-content/pv-expandable-content.js +304 -0
  89. package/pv-components/dist/web/components/pv-ghost-input/pv-ghost-input.js +320 -0
  90. package/pv-components/dist/web/components/pv-icon/pv-icon.js +150 -0
  91. package/pv-components/dist/web/components/pv-input/pv-input.js +191 -0
  92. package/pv-components/dist/web/components/pv-insight-card/pv-insight-card.js +363 -0
  93. package/pv-components/dist/web/components/pv-modal/pv-modal.js +186 -0
  94. package/pv-components/dist/web/components/pv-multi-select-button/pv-multi-select-button.js +8326 -0
  95. package/pv-components/dist/web/components/pv-pagination/pv-pagination.js +355 -0
  96. package/pv-components/dist/web/components/pv-pill/pv-pill.js +229 -0
  97. package/pv-components/dist/web/components/pv-popover/pv-popover.js +1485 -0
  98. package/pv-components/dist/web/components/pv-popover-menu/pv-popover-menu.js +1507 -0
  99. package/pv-components/dist/web/components/pv-popover-v2/pv-popover-v2.js +1573 -0
  100. package/pv-components/dist/web/components/pv-progress-bar/pv-progress-bar.js +156 -0
  101. package/pv-components/dist/web/components/pv-rating/pv-rating.js +146 -0
  102. package/pv-components/dist/web/components/pv-release-badge/pv-release-badge.js +142 -0
  103. package/pv-components/dist/web/components/pv-search-input/pv-search-input.js +238 -0
  104. package/pv-components/dist/web/components/pv-segmented-control/pv-segmented-control.js +214 -0
  105. package/pv-components/dist/web/components/pv-select-button/pv-select-button.js +8093 -0
  106. package/pv-components/dist/web/components/pv-selectable-card/pv-selectable-card.js +153 -0
  107. package/pv-components/dist/web/components/pv-side-panel/pv-side-panel.js +148 -0
  108. package/pv-components/dist/web/components/pv-skeleton/pv-skeleton.js +1593 -0
  109. package/pv-components/dist/web/components/pv-spinner/pv-spinner.js +151 -0
  110. package/pv-components/dist/web/components/pv-sprite/pv-sprite.js +150 -0
  111. package/pv-components/dist/web/components/pv-suggestion-tag/pv-suggestion-tag.js +195 -0
  112. package/pv-components/dist/web/components/pv-switch/pv-switch.js +162 -0
  113. package/pv-components/dist/web/components/pv-tab-list/pv-tab-list.js +168 -0
  114. package/pv-components/dist/web/components/pv-tabs/pv-tabs.js +248 -0
  115. package/pv-components/dist/web/components/pv-tag/pv-tag.js +210 -0
  116. package/pv-components/dist/web/components/pv-text-area/pv-text-area.js +188 -0
  117. package/pv-components/dist/web/components/pv-toast/pv-toast.js +292 -0
  118. package/pv-components/dist/web/components/pv-toggle-button/pv-toggle-button.js +208 -0
  119. package/pv-components/dist/web/components/pv-toggle-group/pv-toggle-group.js +7479 -0
  120. package/pv-components/dist/web/components/pv-tooltip/pv-tooltip.js +158 -0
  121. package/pv-components/dist/web/components/pv-tooltip-v2/pv-tooltip-v2.js +7409 -0
  122. package/pv-components/dist/web/components/pv-tree/pv-tree.js +5107 -0
  123. package/pv-components/dist/web/components/pv-widget/pv-widget.js +159 -0
  124. package/pv-components/dist/web/pv-components.iife.js +50 -50
  125. package/pv-components/dist/web/vue.runtime.esm-browser.prod.js +7 -0
  126. package/pv-components/dist/vue/base/pv-components-base.js +0 -1555
  127. package/pv-components/dist/vue/base/pv-components-base.umd.js +0 -1555
  128. package/pv-components/dist/vue/visualizations/pv-components-visualizations.js +0 -185
  129. 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), n = A()?.root || {};
4
+ return "isCE" in n && n.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 t = e, n = j(), s = C(null), r = v(() => ({
14
+ "pv-icon": !0,
15
+ [`pv-icon-${t.size}`]: N.includes(t.size)
16
+ })), l = v(() => n.value && s.value ? `${s.value}#${t.name}` : `#${t.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": l.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 t = {
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 (s, r) => (c(), m(
50
+ "div",
51
+ {
52
+ "data-testid": "pv-spinner",
53
+ class: g(n[e.variant]),
54
+ style: P({ "--size": t[e.size] })
55
+ },
56
+ null,
57
+ 6
58
+ /* CLASS, STYLE */
59
+ ));
60
+ }
61
+ }), M = ["ghost"], x = {
62
+ md: "pv-button-small",
63
+ lg: void 0,
64
+ xl: "pv-button-large"
65
+ }, R = (e) => e == null || !x.hasOwnProperty(e) ? null : x[e] || null, V = ["disabled"], D = {
66
+ key: 1,
67
+ "data-testid": "pv-button-label"
68
+ }, W = /* @__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 t = e, n = v(() => {
82
+ const s = [];
83
+ t.inverse && M.includes(t.variant) ? s.push(`pv-button-${t.variant}-inverse`) : s.push(`pv-button-${t.variant}`);
84
+ const r = R(t.size);
85
+ return r && s.push(r), s;
86
+ });
87
+ return (s, r) => (c(), m("button", {
88
+ type: "button",
89
+ class: g(n.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
+ D,
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, V));
122
+ }
123
+ }), H = /* @__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 t = {
133
+ none: "0",
134
+ xs: "4px",
135
+ sm: "8px",
136
+ md: "12px",
137
+ lg: "16px"
138
+ }, n = e, s = C(n.defaultOpen), r = () => {
139
+ s.value = !s.value;
140
+ }, l = v(() => ({
141
+ "--lines": s.value ? "none" : n.lines,
142
+ "max-height": s.value ? "100vh" : `${n.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": t[e.size] })
154
+ },
155
+ [
156
+ w(
157
+ "p",
158
+ {
159
+ class: "pv-line-clamp pv-text-body-md pv-stack-8",
160
+ style: P(l.value)
161
+ },
162
+ [
163
+ O(u.$slots, "default", {}, void 0, !0)
164
+ ],
165
+ 4
166
+ /* STYLE */
167
+ ),
168
+ z(W, {
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
+ }), G = ".expandable-content[data-v-2f840307]{border-radius:.5rem}.expandable-content .pv-line-clamp[data-v-2f840307]{transition:max-height .3s ease-in-out}", q = (e, t) => {
181
+ const n = e.__vccOpts || e;
182
+ for (const [s, r] of t)
183
+ n[s] = r;
184
+ return n;
185
+ }, J = /* @__PURE__ */ q(H, [["styles", [G]], ["__scopeId", "data-v-2f840307"]]), U = /* @__PURE__ */ new Set(["PvIcon", "PvPopoverMenu", "PvPopover"]);
186
+ function Z(e) {
187
+ return !U.has(e);
188
+ }
189
+ function S(e, t) {
190
+ const n = document.querySelector('link[href*="' + t + '"]');
191
+ if (!e.shadowRoot)
192
+ return !1;
193
+ if (n && e.shadowRoot) {
194
+ const s = n.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 F(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 K = (e) => ({ shadowRoot: Z(e) });
214
+ function Q(e, t) {
215
+ return t === null ? !1 : t === "" || t === "true" ? !0 : (t === "false" || console.warn(
216
+ `Invalid boolean attribute value for "${e}": "${t}". Expected "true", "false", or empty string.`
217
+ ), !1);
218
+ }
219
+ function X(e, t) {
220
+ const n = Number(t);
221
+ return isNaN(n) && console.warn(`Invalid number attribute value for "${e}": "${t}". Expected a valid number.`), n;
222
+ }
223
+ function Y(e) {
224
+ const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), l = (e.__vccOpts || e).props;
225
+ return l && typeof l == "object" && Object.entries(l).forEach(([u, o]) => {
226
+ o === Boolean || o && o.type === Boolean ? t.add(u) : o === Number || o && o.type === Number ? n.add(u) : (o === Object || o === Array || o && (o.type === Object || o.type === Array)) && s.add(u);
227
+ }), { booleanProps: t, numberProps: n, jsonProps: s };
228
+ }
229
+ function I(e, t) {
230
+ try {
231
+ return JSON.parse(t);
232
+ } catch (n) {
233
+ return console.warn(
234
+ `Invalid JSON attribute value for "${e}": "${t}". Error: ${n instanceof Error ? n.message : String(n)}`
235
+ ), null;
236
+ }
237
+ }
238
+ function ee(e) {
239
+ const t = e.__name || e.name;
240
+ if (!t)
241
+ throw new Error("Component must have a __name or name property");
242
+ const n = B(e, K(t)), { booleanProps: s, numberProps: r, jsonProps: l } = Y(e);
243
+ class u extends n {
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((a) => {
260
+ const i = this.getAttribute(a);
261
+ this[a] = Q(a, i);
262
+ }), r.forEach((a) => {
263
+ const i = this.getAttribute(a);
264
+ i !== null && (this[a] = X(a, i));
265
+ }), l.forEach((a) => {
266
+ const i = this.getAttribute(a);
267
+ if (i !== null) {
268
+ const d = I(a, i);
269
+ d !== null && (this[a] = d);
270
+ }
271
+ });
272
+ const p = this.getAttribute("data-json-props");
273
+ p && p.split(",").map((i) => i.trim()).filter(Boolean).forEach((i) => {
274
+ const d = i.replace(/-([a-z])/g, (f) => f[1].toUpperCase());
275
+ let h = this.getAttribute(i);
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?.(), F(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 te(e) {
295
+ return e.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
296
+ }
297
+ function ne(e) {
298
+ const t = e.__name || e.name;
299
+ if (!t)
300
+ throw new Error("Component must have a __name or name property");
301
+ const n = te(t), s = ee(e);
302
+ customElements.get(n) || customElements.define(n, s);
303
+ }
304
+ ne(J);
@@ -0,0 +1,320 @@
1
+ import { ref as S, getCurrentInstance as w, defineComponent as b, computed as _, createElementBlock as m, openBlock as p, normalizeClass as P, createElementVNode as x, normalizeStyle as $, createBlock as v, Fragment as A, createCommentVNode as g, 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__ */ b({
7
+ __name: "PvIcon",
8
+ props: {
9
+ name: { type: String },
10
+ size: { type: null }
11
+ },
12
+ setup(t) {
13
+ const e = t, n = D(), s = S(null), o = _(() => ({
14
+ "pv-icon": !0,
15
+ [`pv-icon-${e.size}`]: L.includes(e.size)
16
+ })), a = _(() => n.value && s.value ? `${s.value}#${e.name}` : `#${e.name}`);
17
+ return globalThis.__PV_GLOBAL_SPRITE_PATH__ && (s.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(o.value)
23
+ },
24
+ [
25
+ x("use", { "xlink:href": a.value }, null, 8, G)
26
+ ],
27
+ 2
28
+ /* CLASS */
29
+ ));
30
+ }
31
+ }), H = /* @__PURE__ */ b({
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 (s, o) => (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
+ }), J = ["ghost"], E = {
62
+ md: "pv-button-small",
63
+ lg: void 0,
64
+ xl: "pv-button-large"
65
+ }, U = (t) => t == null || !E.hasOwnProperty(t) ? null : E[t] || null, q = ["disabled"], F = {
66
+ key: 1,
67
+ "data-testid": "pv-button-label"
68
+ }, Z = /* @__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(t) {
81
+ const e = t, n = _(() => {
82
+ const s = [];
83
+ e.inverse && J.includes(e.variant) ? s.push(`pv-button-${e.variant}-inverse`) : s.push(`pv-button-${e.variant}`);
84
+ const o = U(e.size);
85
+ return o && s.push(o), s;
86
+ });
87
+ return (s, o) => (p(), m("button", {
88
+ type: "button",
89
+ class: P(n.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"])) : g("v-if", !0),
105
+ t.label ? (p(), m(
106
+ "span",
107
+ F,
108
+ k(t.label),
109
+ 1
110
+ /* TEXT */
111
+ )) : g("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"])) : g("v-if", !0)
117
+ ],
118
+ 64
119
+ /* STABLE_FRAGMENT */
120
+ ))
121
+ ], 10, q));
122
+ }
123
+ }), K = ["data-style"], Q = ["placeholder", "disabled", "name"], X = /* @__PURE__ */ b({
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
+ }, s = {
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
+ }, o = t, a = z(t, "modelValue"), d = S(0), l = () => {
155
+ e.value?.focus();
156
+ };
157
+ O(() => {
158
+ a.value && a.value.length > 0 ? c(a.value) : o.placeholder ? c(o.placeholder) : d.value = 240;
159
+ }), j(
160
+ () => a.value,
161
+ () => {
162
+ a.value && a.value.length > 0 ? c(a.value) : o.placeholder ? c(o.placeholder) : d.value = 240;
163
+ }
164
+ );
165
+ const c = (r) => {
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(r).width + 10;
171
+ };
172
+ return (r, i) => (p(), m("div", {
173
+ class: "pv-ghost-input pv-full-width",
174
+ "data-testid": "pv-ghost-input",
175
+ "data-style": s[t.variant]
176
+ }, [
177
+ M(r.$slots, "action"),
178
+ N(x("input", R({
179
+ ref_key: "inputRef",
180
+ ref: e
181
+ }, o, {
182
+ "onUpdate:modelValue": i[0] || (i[0] = (u) => a.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, Q), [
191
+ [V, a.value]
192
+ ]),
193
+ t.showEditIcon ? (p(), v(Z, {
194
+ key: 0,
195
+ "left-icon": "edit",
196
+ variant: "ghost",
197
+ onClick: l
198
+ })) : g("v-if", !0)
199
+ ], 8, K));
200
+ }
201
+ }), Y = /* @__PURE__ */ new Set(["PvIcon", "PvPopoverMenu", "PvPopover"]);
202
+ function tt(t) {
203
+ return !Y.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 s = n.href;
211
+ if (t.shadowRoot.querySelector(`link[href="${s}"]`))
212
+ return;
213
+ const o = document.createElement("link");
214
+ return o.rel = "stylesheet", o.href = s, t.shadowRoot.prepend(o), !0;
215
+ }
216
+ return !1;
217
+ }
218
+ function et(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 nt = (t) => ({ shadowRoot: tt(t) });
230
+ function st(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 ot(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 at(t) {
240
+ const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = (t.__vccOpts || t).props;
241
+ return a && typeof a == "object" && Object.entries(a).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)) && s.add(d);
243
+ }), { booleanProps: e, numberProps: n, jsonProps: s };
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 rt(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, nt(e)), { booleanProps: s, numberProps: o, jsonProps: a } = at(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
+ s.forEach((r) => {
276
+ const i = this.getAttribute(r);
277
+ this[r] = st(r, i);
278
+ }), o.forEach((r) => {
279
+ const i = this.getAttribute(r);
280
+ i !== null && (this[r] = ot(r, i));
281
+ }), a.forEach((r) => {
282
+ const i = this.getAttribute(r);
283
+ if (i !== null) {
284
+ const u = I(r, i);
285
+ u !== null && (this[r] = u);
286
+ }
287
+ });
288
+ const c = this.getAttribute("data-json-props");
289
+ c && c.split(",").map((i) => i.trim()).filter(Boolean).forEach((i) => {
290
+ const u = i.replace(/-([a-z])/g, (f) => f[1].toUpperCase());
291
+ let h = this.getAttribute(i);
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?.(), et(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 lt(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), s = rt(t);
318
+ customElements.get(n) || customElements.define(n, s);
319
+ }
320
+ lt(X);