slippers-ui 3.1.3 → 3.1.5-alpha

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.
@@ -1,142 +1,142 @@
1
- import { defineComponent as y, computed as p, openBlock as a, createElementBlock as o, mergeProps as w, renderSlot as d, normalizeClass as u, createElementVNode as r, createBlock as B, resolveDynamicComponent as E, normalizeStyle as M, withCtx as V, createCommentVNode as O, ref as b, onMounted as q, onUnmounted as R, createVNode as D, unref as S, Fragment as C, renderList as I, withModifiers as N, toDisplayString as z } from "vue";
2
- import { _, C as T, a as j } from "./chunks/ChevronLgUp-BwtjsOWr.js";
3
- const x = ["href"], A = /* @__PURE__ */ y({
1
+ import { defineComponent as m, computed as d, openBlock as n, createElementBlock as o, mergeProps as k, renderSlot as l, normalizeClass as r, createElementVNode as p, createBlock as S, resolveDynamicComponent as N, normalizeStyle as z, withCtx as I, createCommentVNode as w, ref as b, onMounted as C, onUnmounted as B, Fragment as M, renderList as q, withModifiers as A, toDisplayString as E } from "vue";
2
+ import { _ } from "./chunks/_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const V = ["href"], x = /* @__PURE__ */ m({
4
4
  __name: "SlpButton",
5
5
  props: {
6
6
  disabled: { type: Boolean },
7
7
  variant: {},
8
8
  href: {}
9
9
  },
10
- setup(c) {
11
- const e = c, v = p(() => e.disabled ?? !1), n = p(() => e.variant ?? "primary");
12
- p(() => e.href ?? "");
13
- const s = p(() => {
14
- let t = [`slp-btn-${n.value}`];
15
- return v.value && t.push("slp-btn-disabled"), t.join(" ");
10
+ setup(i) {
11
+ const s = i, c = d(() => s.disabled ?? !1), a = d(() => s.variant ?? "primary");
12
+ d(() => s.href ?? "");
13
+ const e = d(() => {
14
+ let t = [`slp-btn-${a.value}`];
15
+ return c.value && t.push("slp-btn-disabled"), t.join(" ");
16
16
  });
17
- return (t, i) => e.href ? (a(), o("a", w({ key: 0 }, t.$attrs, {
18
- class: ["slp-btn", s.value],
19
- href: e.href
17
+ return (t, f) => s.href ? (n(), o("a", k({ key: 0 }, t.$attrs, {
18
+ class: ["slp-btn", e.value],
19
+ href: s.href
20
20
  }), [
21
- d(t.$slots, "default", {}, void 0, !0)
22
- ], 16, x)) : (a(), o("button", w({ key: 1 }, t.$attrs, {
23
- class: ["slp-btn", s.value],
21
+ l(t.$slots, "default", {}, void 0, !0)
22
+ ], 16, V)) : (n(), o("button", k({ key: 1 }, t.$attrs, {
23
+ class: ["slp-btn", e.value],
24
24
  type: "button"
25
25
  }), [
26
- d(t.$slots, "default", {}, void 0, !0)
26
+ l(t.$slots, "default", {}, void 0, !0)
27
27
  ], 16));
28
28
  }
29
- }), ve = /* @__PURE__ */ _(A, [["__scopeId", "data-v-56e2df5f"]]), H = /* @__PURE__ */ y({
29
+ }), ne = /* @__PURE__ */ _(x, [["__scopeId", "data-v-56e2df5f"]]), O = /* @__PURE__ */ m({
30
30
  __name: "SlpColumn",
31
31
  props: {
32
32
  cols: {},
33
33
  size: {}
34
34
  },
35
- setup(c) {
36
- const e = c, v = p(() => e.cols ?? null), n = p(() => e.size ?? "md"), s = p(() => v.value ? `slp-col-${n.value}-${v.value}` : `slp-col-${n.value}`);
37
- return (t, i) => (a(), o("div", {
38
- class: u(s.value)
35
+ setup(i) {
36
+ const s = i, c = d(() => s.cols ?? null), a = d(() => s.size ?? "md"), e = d(() => c.value ? `slp-col-${a.value}-${c.value}` : `slp-col-${a.value}`);
37
+ return (t, f) => (n(), o("div", {
38
+ class: r(e.value)
39
39
  }, [
40
- d(t.$slots, "default", {}, void 0, !0)
40
+ l(t.$slots, "default", {}, void 0, !0)
41
41
  ], 2));
42
42
  }
43
- }), fe = /* @__PURE__ */ _(H, [["__scopeId", "data-v-00b68f22"]]), U = {
43
+ }), oe = /* @__PURE__ */ _(O, [["__scopeId", "data-v-00b68f22"]]), T = {
44
44
  key: 0,
45
45
  class: "slp-full-light-purple-background"
46
- }, W = {
46
+ }, j = {
47
47
  key: 1,
48
48
  class: "slp-charcoal-grey-background"
49
- }, F = {
49
+ }, R = {
50
50
  key: 2,
51
51
  class: "slp-gradient-background"
52
- }, J = {
52
+ }, D = {
53
53
  key: 3,
54
54
  class: "slp-full-gradient-background"
55
- }, P = {
55
+ }, H = {
56
56
  key: 4,
57
57
  class: "slp-full-charcoal-background"
58
- }, G = {
58
+ }, L = {
59
59
  key: 5,
60
60
  class: "slp-partial-charcoal-background"
61
- }, K = {
61
+ }, U = {
62
62
  key: 6,
63
63
  class: "slp-half-grey-background"
64
- }, Q = {
64
+ }, W = {
65
65
  key: 7,
66
66
  class: "slp-partial-white-background"
67
- }, X = {
67
+ }, F = {
68
68
  key: 8,
69
69
  class: "slp-partial-grey-background"
70
- }, Y = /* @__PURE__ */ y({
70
+ }, P = /* @__PURE__ */ m({
71
71
  __name: "SlpContainer",
72
72
  props: {
73
73
  fluid: { type: Boolean },
74
74
  variant: {}
75
75
  },
76
- setup(c) {
77
- const e = c, v = p(() => e.fluid ?? !1), n = p(() => e.variant ?? "white"), s = p(() => v.value ? "fluid" : "");
78
- return (t, i) => n.value === "light-purple-100" ? (a(), o("div", U, [
79
- r("div", {
80
- class: u(["slp-container", s.value])
76
+ setup(i) {
77
+ const s = i, c = d(() => s.fluid ?? !1), a = d(() => s.variant ?? "white"), e = d(() => c.value ? "fluid" : "");
78
+ return (t, f) => a.value === "light-purple-100" ? (n(), o("div", T, [
79
+ p("div", {
80
+ class: r(["slp-container", e.value])
81
81
  }, [
82
- d(t.$slots, "default", {}, void 0, !0)
82
+ l(t.$slots, "default", {}, void 0, !0)
83
83
  ], 2)
84
- ])) : n.value === "grey-100" ? (a(), o("div", W, [
85
- r("div", {
86
- class: u(["slp-container", s.value])
84
+ ])) : a.value === "grey-100" ? (n(), o("div", j, [
85
+ p("div", {
86
+ class: r(["slp-container", e.value])
87
87
  }, [
88
- d(t.$slots, "default", {}, void 0, !0)
88
+ l(t.$slots, "default", {}, void 0, !0)
89
89
  ], 2)
90
- ])) : n.value === "gradient" ? (a(), o("div", F, [
91
- r("div", {
92
- class: u(["slp-container", s.value])
90
+ ])) : a.value === "gradient" ? (n(), o("div", R, [
91
+ p("div", {
92
+ class: r(["slp-container", e.value])
93
93
  }, [
94
- d(t.$slots, "default", {}, void 0, !0)
94
+ l(t.$slots, "default", {}, void 0, !0)
95
95
  ], 2)
96
- ])) : n.value === "gradient-full" ? (a(), o("div", J, [
97
- r("div", {
98
- class: u(["slp-container", s.value])
96
+ ])) : a.value === "gradient-full" ? (n(), o("div", D, [
97
+ p("div", {
98
+ class: r(["slp-container", e.value])
99
99
  }, [
100
- d(t.$slots, "default", {}, void 0, !0)
100
+ l(t.$slots, "default", {}, void 0, !0)
101
101
  ], 2)
102
- ])) : n.value === "charcoal-100" ? (a(), o("div", P, [
103
- r("div", {
104
- class: u(["slp-container", s.value])
102
+ ])) : a.value === "charcoal-100" ? (n(), o("div", H, [
103
+ p("div", {
104
+ class: r(["slp-container", e.value])
105
105
  }, [
106
- d(t.$slots, "default", {}, void 0, !0)
106
+ l(t.$slots, "default", {}, void 0, !0)
107
107
  ], 2)
108
- ])) : n.value === "charcoal-75" ? (a(), o("div", G, [
109
- r("div", {
110
- class: u(["slp-container", s.value])
108
+ ])) : a.value === "charcoal-75" ? (n(), o("div", L, [
109
+ p("div", {
110
+ class: r(["slp-container", e.value])
111
111
  }, [
112
- d(t.$slots, "default", {}, void 0, !0)
112
+ l(t.$slots, "default", {}, void 0, !0)
113
113
  ], 2)
114
- ])) : n.value === "grey-50" ? (a(), o("div", K, [
115
- r("div", {
116
- class: u(["slp-container", s.value])
114
+ ])) : a.value === "grey-50" ? (n(), o("div", U, [
115
+ p("div", {
116
+ class: r(["slp-container", e.value])
117
117
  }, [
118
- d(t.$slots, "default", {}, void 0, !0)
118
+ l(t.$slots, "default", {}, void 0, !0)
119
119
  ], 2)
120
- ])) : n.value === "white-75" ? (a(), o("div", Q, [
121
- r("div", {
122
- class: u(["slp-container", s.value])
120
+ ])) : a.value === "white-75" ? (n(), o("div", W, [
121
+ p("div", {
122
+ class: r(["slp-container", e.value])
123
123
  }, [
124
- d(t.$slots, "default", {}, void 0, !0)
124
+ l(t.$slots, "default", {}, void 0, !0)
125
125
  ], 2)
126
- ])) : n.value === "grey-75" ? (a(), o("div", X, [
127
- r("div", {
128
- class: u(["slp-container", s.value])
126
+ ])) : a.value === "grey-75" ? (n(), o("div", F, [
127
+ p("div", {
128
+ class: r(["slp-container", e.value])
129
129
  }, [
130
- d(t.$slots, "default", {}, void 0, !0)
130
+ l(t.$slots, "default", {}, void 0, !0)
131
131
  ], 2)
132
- ])) : (a(), o("div", {
132
+ ])) : (n(), o("div", {
133
133
  key: 9,
134
- class: u(["slp-container", s.value])
134
+ class: r(["slp-container", e.value])
135
135
  }, [
136
- d(t.$slots, "default", {}, void 0, !0)
136
+ l(t.$slots, "default", {}, void 0, !0)
137
137
  ], 2));
138
138
  }
139
- }), ge = /* @__PURE__ */ _(Y, [["__scopeId", "data-v-67a0761e"]]), Z = /* @__PURE__ */ y({
139
+ }), le = /* @__PURE__ */ _(P, [["__scopeId", "data-v-67a0761e"]]), G = /* @__PURE__ */ m({
140
140
  __name: "SlpIcon",
141
141
  props: {
142
142
  size: {
@@ -155,47 +155,47 @@ const x = ["href"], A = /* @__PURE__ */ y({
155
155
  required: !0
156
156
  }
157
157
  },
158
- setup(c) {
159
- const e = c, v = p(() => {
160
- const s = ["slp-icon"];
161
- return typeof e.size == "string" && isNaN(Number(e.size)) && s.push(`slp-icon--size-${e.size}`), e.color && !e.color.startsWith("#") && s.push(`slp-icon--color-${e.color}`), s;
162
- }), n = p(() => {
158
+ setup(i) {
159
+ const s = i, c = d(() => {
160
+ const e = ["slp-icon"];
161
+ return typeof s.size == "string" && isNaN(Number(s.size)) && e.push(`slp-icon--size-${s.size}`), s.color && !s.color.startsWith("#") && e.push(`slp-icon--color-${s.color}`), e;
162
+ }), a = d(() => {
163
163
  var t;
164
- const s = {};
165
- if ((t = e.color) != null && t.startsWith("#") && (s.color = e.color, s.fill = e.color), typeof e.size == "number" || !isNaN(Number(e.size))) {
166
- const i = typeof e.size == "number" ? e.size : Number(e.size);
167
- s.width = `${i}px`, s.height = `${i}px`;
164
+ const e = {};
165
+ if ((t = s.color) != null && t.startsWith("#") && (e.color = s.color, e.fill = s.color), typeof s.size == "number" || !isNaN(Number(s.size))) {
166
+ const f = typeof s.size == "number" ? s.size : Number(s.size);
167
+ e.width = `${f}px`, e.height = `${f}px`;
168
168
  }
169
- return s;
169
+ return e;
170
170
  });
171
- return (s, t) => {
172
- var i, f;
173
- return a(), B(E(c.icon), {
174
- class: u(["slp-icon", v.value]),
175
- style: M(n.value),
171
+ return (e, t) => {
172
+ var f, g;
173
+ return n(), S(N(i.icon), {
174
+ class: r(["slp-icon", c.value]),
175
+ style: z(a.value),
176
176
  role: "img",
177
177
  "aria-hidden": "true",
178
- "data-icon-name": ((f = (i = c.icon) == null ? void 0 : i.__docgenInfo) == null ? void 0 : f.displayName) || ""
178
+ "data-icon-name": ((g = (f = i.icon) == null ? void 0 : f.__docgenInfo) == null ? void 0 : g.displayName) || ""
179
179
  }, null, 8, ["class", "style", "data-icon-name"]);
180
180
  };
181
181
  }
182
- }), ee = /* @__PURE__ */ _(Z, [["__scopeId", "data-v-b82aeda9"]]), se = {}, te = { class: "slp-row" };
183
- function ne(c, e) {
184
- return a(), o("div", te, [
185
- d(c.$slots, "default", {}, void 0, !0)
182
+ }), ie = /* @__PURE__ */ _(G, [["__scopeId", "data-v-b82aeda9"]]), J = {}, K = { class: "slp-row" };
183
+ function Q(i, s) {
184
+ return n(), o("div", K, [
185
+ l(i.$slots, "default", {}, void 0, !0)
186
186
  ]);
187
187
  }
188
- const he = /* @__PURE__ */ _(se, [["render", ne], ["__scopeId", "data-v-adc8d02f"]]), ae = {
188
+ const re = /* @__PURE__ */ _(J, [["render", Q], ["__scopeId", "data-v-adc8d02f"]]), X = {
189
189
  key: 0,
190
190
  class: "arrow-symbol"
191
- }, oe = /* @__PURE__ */ y({
191
+ }, Y = /* @__PURE__ */ m({
192
192
  __name: "SlpTypography",
193
193
  props: {
194
194
  variant: {},
195
195
  tag: {}
196
196
  },
197
- setup(c) {
198
- const e = [
197
+ setup(i) {
198
+ const s = [
199
199
  "display1",
200
200
  "heading1",
201
201
  "heading2",
@@ -217,21 +217,18 @@ const he = /* @__PURE__ */ _(se, [["render", ne], ["__scopeId", "data-v-adc8d02f
217
217
  "arrow",
218
218
  "quotes",
219
219
  "emphasis"
220
- ], v = ["span", "h1", "h2", "h3", "h4", "p", "div"], n = c, s = p(() => e.includes(n.variant || "") ? n.variant : "body1"), t = p(() => v.includes(n.tag || "") ? n.tag : "span"), i = p(() => `slp-text-${s.value}`);
221
- return (f, k) => (a(), B(E(t.value), {
222
- class: u(i.value)
220
+ ], c = ["span", "h1", "h2", "h3", "h4", "p", "div"], a = i, e = d(() => s.includes(a.variant || "") ? a.variant : "body1"), t = d(() => c.includes(a.tag || "") ? a.tag : "span"), f = d(() => `slp-text-${e.value}`);
221
+ return (g, h) => (n(), S(N(t.value), {
222
+ class: r(f.value)
223
223
  }, {
224
- default: V(() => [
225
- d(f.$slots, "default", {}, void 0, !0),
226
- s.value === "arrow" ? (a(), o("span", ae, "→")) : O("", !0)
224
+ default: I(() => [
225
+ l(g.$slots, "default", {}, void 0, !0),
226
+ e.value === "arrow" ? (n(), o("span", X, "→")) : w("", !0)
227
227
  ]),
228
228
  _: 3
229
229
  }, 8, ["class"]));
230
230
  }
231
- }), _e = /* @__PURE__ */ _(oe, [["__scopeId", "data-v-fba90f83"]]), le = {
232
- key: 0,
233
- class: "dropdown-menu"
234
- }, ie = ["onClick"], re = { class: "side-navigation" }, de = ["data-ga-name", "onClick"], ce = /* @__PURE__ */ y({
231
+ }), de = /* @__PURE__ */ _(Y, [["__scopeId", "data-v-fba90f83"]]), Z = { class: "side-navigation" }, ee = ["data-ga-name", "onClick"], te = /* @__PURE__ */ m({
235
232
  __name: "SlpSideNavigation",
236
233
  props: {
237
234
  position: {
@@ -241,106 +238,79 @@ const he = /* @__PURE__ */ _(se, [["render", ne], ["__scopeId", "data-v-adc8d02f
241
238
  darkMode: {
242
239
  type: Boolean,
243
240
  default: !1
244
- },
245
- navigationItems: {
246
- type: Array,
247
- required: !0
248
241
  }
249
242
  },
250
- setup(c) {
251
- const e = c, v = b(null), n = (h) => {
252
- v.value && !v.value.contains(h.target) && (f.value = !1);
253
- }, s = b(null), t = b(null);
254
- let i = null;
255
- const f = b(!1), k = (h) => {
256
- const g = document.getElementById(h);
257
- g && g.scrollIntoView({ behavior: "smooth" }), f.value = !1;
258
- }, L = () => {
259
- if (!t.value) return;
260
- const h = e.navigationItems.map((l) => document.getElementById(l.id)).filter((l) => l !== null), g = (window.innerHeight - 140 - 1) * -1;
261
- i = new IntersectionObserver(
262
- (l) => {
263
- l.forEach((m) => {
264
- if (m.isIntersecting) {
265
- const $ = m.target.getAttribute("id");
266
- $ && (s.value = $);
243
+ setup(i) {
244
+ const s = i, c = b(null), a = b([]), e = b(null);
245
+ let t = null;
246
+ const f = (h) => {
247
+ const y = document.getElementById(h);
248
+ y && y.scrollIntoView({ behavior: "smooth" });
249
+ }, g = () => {
250
+ if (!e.value) return;
251
+ const h = e.value.querySelectorAll("h1, h2, h3, h4, h5, h6");
252
+ a.value = Array.from(h).map((u) => {
253
+ var v;
254
+ return {
255
+ id: u.getAttribute("id") || "",
256
+ text: ((v = u.textContent) == null ? void 0 : v.trim()) || "Untitled"
257
+ };
258
+ });
259
+ const y = (window.innerHeight - 140 - 1) * -1;
260
+ t = new IntersectionObserver(
261
+ (u) => {
262
+ u.forEach((v) => {
263
+ if (v.isIntersecting) {
264
+ const $ = v.target.getAttribute("id");
265
+ $ && (c.value = $);
267
266
  }
268
267
  });
269
268
  },
270
269
  {
271
- rootMargin: `-120px 0px ${g}px 0px`,
272
- threshold: Array.from({ length: 99 }, (l, m) => (m + 2) / 100)
270
+ rootMargin: `-120px 0px ${y}px 0px`,
271
+ threshold: Array.from({ length: 99 }, (u, v) => (v + 2) / 100)
273
272
  }
274
- ), h.forEach((l) => i == null ? void 0 : i.observe(l));
273
+ ), h.forEach((u) => t == null ? void 0 : t.observe(u));
275
274
  };
276
- return q(() => {
277
- L(), document.addEventListener("click", n);
278
- }), R(() => {
279
- i && i.disconnect(), document.removeEventListener("click", n);
280
- }), (h, g) => (a(), o("div", {
281
- class: u(["side-navigation-layout", `side-navigation-layout--${e.position}`, { "side-navigation--dark": e.darkMode }])
275
+ return C(() => {
276
+ g();
277
+ }), B(() => {
278
+ t && t.disconnect();
279
+ }), (h, y) => (n(), o("div", {
280
+ class: r(["side-navigation-layout", `side-navigation-layout--${s.position}`, { "side-navigation--dark": s.darkMode }])
282
281
  }, [
283
- r("div", {
284
- ref_key: "dropdownRef",
285
- ref: v,
286
- class: "side-navigation-dropdown"
287
- }, [
288
- r("button", {
289
- class: "dropdown-toggle",
290
- onClick: g[0] || (g[0] = (l) => f.value = !f.value)
291
- }, [
292
- g[1] || (g[1] = r("span", null, "Jump to a section", -1)),
293
- D(ee, {
294
- icon: f.value ? S(T) : S(j),
295
- color: "black",
296
- size: "sm"
297
- }, null, 8, ["icon"])
298
- ]),
299
- f.value ? (a(), o("ul", le, [
300
- (a(!0), o(C, null, I(e.navigationItems, (l) => (a(), o("li", {
301
- key: l.id,
302
- class: "dropdown-item"
303
- }, [
304
- r("a", {
305
- href: "#",
306
- class: "dropdown-link",
307
- onClick: N((m) => k(l.id), ["prevent"])
308
- }, z(l.text), 9, ie)
309
- ]))), 128))
310
- ])) : O("", !0)
311
- ], 512),
312
- r("nav", re, [
313
- r("ul", null, [
314
- (a(!0), o(C, null, I(e.navigationItems, (l) => (a(), o("li", {
315
- key: l.id,
282
+ p("nav", Z, [
283
+ p("ul", null, [
284
+ (n(!0), o(M, null, q(a.value, (u) => (n(), o("li", {
285
+ key: u.id,
316
286
  class: "side-navigation__item"
317
287
  }, [
318
- r("a", {
288
+ p("a", {
319
289
  href: "#",
320
- class: u(["side-navigation__link", { "side-navigation__link--active": s.value === l.id }]),
321
- "data-ga-name": l.text,
290
+ class: r(["side-navigation__link", { "side-navigation__link--active": c.value === u.id }]),
291
+ "data-ga-name": u.text,
322
292
  "data-ga-location": "side anchor",
323
- onClick: N((m) => k(l.id), ["prevent"])
324
- }, z(l.text), 11, de)
293
+ onClick: A((v) => f(u.id), ["prevent"])
294
+ }, E(u.text), 11, ee)
325
295
  ]))), 128))
326
296
  ])
327
297
  ]),
328
- r("div", {
298
+ p("div", {
329
299
  ref_key: "slotContentRef",
330
- ref: t,
300
+ ref: e,
331
301
  class: "side-navigation-content"
332
302
  }, [
333
- d(h.$slots, "default", {}, void 0, !0)
303
+ l(h.$slots, "default", {}, void 0, !0)
334
304
  ], 512)
335
305
  ], 2));
336
306
  }
337
- }), me = /* @__PURE__ */ _(ce, [["__scopeId", "data-v-bb14a48b"]]);
307
+ }), ce = /* @__PURE__ */ _(te, [["__scopeId", "data-v-c76509f9"]]);
338
308
  export {
339
- ve as SlpButton,
340
- fe as SlpColumn,
341
- ge as SlpContainer,
342
- ee as SlpIcon,
343
- he as SlpRow,
344
- me as SlpSideNavigation,
345
- _e as SlpTypography
309
+ ne as SlpButton,
310
+ oe as SlpColumn,
311
+ le as SlpContainer,
312
+ ie as SlpIcon,
313
+ re as SlpRow,
314
+ ce as SlpSideNavigation,
315
+ de as SlpTypography
346
316
  };