slippers-ui 3.1.2 → 3.1.3

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