rei-kit 0.17.2 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BOaGB7Aw.js";
2
- import { Fragment, Teleport, Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useId, useModel, watch, withCtx, withModifiers } from "vue";
2
+ import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeClass, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, useId, useModel, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
3
3
  import { RouterLink } from "vue-router";
4
4
  //#region src/web/BaseAccordion.vue?vue&type=script&setup=true&lang.ts
5
- var _hoisted_1$2 = { class: "rk-accordion" };
6
- var _hoisted_2$2 = [
5
+ var _hoisted_1$7 = { class: "rk-accordion" };
6
+ var _hoisted_2$7 = [
7
7
  "aria-expanded",
8
8
  "aria-controls",
9
9
  "onClick"
10
10
  ];
11
- var _hoisted_3$1 = { class: "rk-accordion-title" };
12
- var _hoisted_4$1 = {
11
+ var _hoisted_3$5 = { class: "rk-accordion-title" };
12
+ var _hoisted_4$4 = {
13
13
  class: "rk-accordion-mark",
14
14
  "aria-hidden": "true"
15
15
  };
16
- var _hoisted_5$1 = ["id"];
17
- var _hoisted_6$1 = { class: "rk-accordion-clip" };
16
+ var _hoisted_5$3 = ["id"];
17
+ var _hoisted_6$2 = { class: "rk-accordion-clip" };
18
18
  //#endregion
19
19
  //#region src/web/BaseAccordion.vue
20
20
  var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
@@ -36,7 +36,7 @@ var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
36
36
  else open.value = __props.multiple ? [...open.value, key] : [key];
37
37
  }
38
38
  return (_ctx, _cache) => {
39
- return openBlock(), createElementBlock("ul", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
39
+ return openBlock(), createElementBlock("ul", _hoisted_1$7, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
40
40
  return openBlock(), createElementBlock("li", {
41
41
  key: item.key,
42
42
  class: "rk-accordion-item"
@@ -47,26 +47,115 @@ var BaseAccordion_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @
47
47
  "aria-expanded": isOpen(item.key),
48
48
  "aria-controls": `${unref(uid)}-${item.key}`,
49
49
  onClick: ($event) => toggle(item.key)
50
- }, [createElementVNode("span", _hoisted_3$1, toDisplayString(item.title), 1), createElementVNode("span", _hoisted_4$1, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "rk-accordion-bar" }, null, -1)), createElementVNode("span", { class: normalizeClass(["rk-accordion-bar rk-accordion-bar-turn", { "is-open": isOpen(item.key) }]) }, null, 2)])], 8, _hoisted_2$2)]),
50
+ }, [createElementVNode("span", _hoisted_3$5, [renderSlot(_ctx.$slots, "title", {
51
+ item,
52
+ open: isOpen(item.key)
53
+ }, () => [createTextVNode(toDisplayString(item.title), 1)], true)]), createElementVNode("span", _hoisted_4$4, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "rk-accordion-bar" }, null, -1)), createElementVNode("span", { class: normalizeClass(["rk-accordion-bar rk-accordion-bar-turn", { "is-open": isOpen(item.key) }]) }, null, 2)])], 8, _hoisted_2$7)]),
51
54
  _: 2
52
55
  }, 1024)), createElementVNode("div", {
53
56
  id: `${unref(uid)}-${item.key}`,
54
57
  class: normalizeClass(["rk-accordion-panel", { "is-open": isOpen(item.key) }])
55
- }, [createElementVNode("div", _hoisted_6$1, [createElementVNode("div", { class: normalizeClass(["rk-accordion-body", { "is-open": isOpen(item.key) }]) }, [renderSlot(_ctx.$slots, "default", {
58
+ }, [createElementVNode("div", _hoisted_6$2, [createElementVNode("div", { class: normalizeClass(["rk-accordion-body", { "is-open": isOpen(item.key) }]) }, [renderSlot(_ctx.$slots, "default", {
56
59
  item,
57
60
  open: isOpen(item.key)
58
- }, void 0, true)], 2)])], 10, _hoisted_5$1)]);
61
+ }, void 0, true)], 2)])], 10, _hoisted_5$3)]);
59
62
  }), 128))]);
60
63
  };
61
64
  }
62
- }), [["__scopeId", "data-v-00091812"]]);
65
+ }), [["__scopeId", "data-v-d7bddb65"]]);
66
+ //#endregion
67
+ //#region src/web/BaseBreadcrumb.vue?vue&type=script&setup=true&lang.ts
68
+ var _hoisted_1$6 = ["aria-label"];
69
+ var _hoisted_2$6 = { class: "rk-crumbs" };
70
+ var _hoisted_3$4 = {
71
+ key: 1,
72
+ class: "rk-crumb-current",
73
+ "aria-current": "page"
74
+ };
75
+ var _hoisted_4$3 = {
76
+ key: 2,
77
+ class: "rk-crumb-sep",
78
+ "aria-hidden": "true"
79
+ };
80
+ //#endregion
81
+ //#region src/web/BaseBreadcrumb.vue
82
+ var BaseBreadcrumb_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
83
+ __name: "BaseBreadcrumb",
84
+ props: {
85
+ items: {},
86
+ label: { default: "" }
87
+ },
88
+ setup(__props) {
89
+ return (_ctx, _cache) => {
90
+ return openBlock(), createElementBlock("nav", { "aria-label": __props.label || void 0 }, [createElementVNode("ol", _hoisted_2$6, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
91
+ return openBlock(), createElementBlock("li", {
92
+ key: item.label,
93
+ class: "rk-crumb"
94
+ }, [item.to ? (openBlock(), createBlock(unref(RouterLink), {
95
+ key: 0,
96
+ to: item.to,
97
+ class: "rk-crumb-link"
98
+ }, {
99
+ default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
100
+ _: 2
101
+ }, 1032, ["to"])) : (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(item.label), 1)), index < __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$3, "/")) : createCommentVNode("", true)]);
102
+ }), 128))])], 8, _hoisted_1$6);
103
+ };
104
+ }
105
+ }), [["__scopeId", "data-v-85ee4b4e"]]);
106
+ //#endregion
107
+ //#region src/web/BaseDisclosure.vue?vue&type=script&setup=true&lang.ts
108
+ var _hoisted_1$5 = { class: "rk-disclosure" };
109
+ var _hoisted_2$5 = ["aria-expanded", "aria-controls"];
110
+ var _hoisted_3$3 = { class: "rk-disclosure-title" };
111
+ var _hoisted_4$2 = {
112
+ class: "rk-disclosure-mark",
113
+ "aria-hidden": "true"
114
+ };
115
+ var _hoisted_5$2 = ["id"];
116
+ var _hoisted_6$1 = { class: "rk-disclosure-clip" };
117
+ //#endregion
118
+ //#region src/web/BaseDisclosure.vue
119
+ var BaseDisclosure_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
120
+ __name: "BaseDisclosure",
121
+ props: /*@__PURE__*/ mergeModels({
122
+ title: {},
123
+ headingLevel: { default: 3 }
124
+ }, {
125
+ "modelValue": {
126
+ type: Boolean,
127
+ default: false
128
+ },
129
+ "modelModifiers": {}
130
+ }),
131
+ emits: ["update:modelValue"],
132
+ setup(__props) {
133
+ const open = useModel(__props, "modelValue");
134
+ const id = useId();
135
+ return (_ctx, _cache) => {
136
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [(openBlock(), createBlock(resolveDynamicComponent(`h${__props.headingLevel}`), null, {
137
+ default: withCtx(() => [createElementVNode("button", {
138
+ type: "button",
139
+ class: "rk-disclosure-control",
140
+ "aria-expanded": open.value,
141
+ "aria-controls": unref(id),
142
+ onClick: _cache[0] || (_cache[0] = ($event) => open.value = !open.value)
143
+ }, [createElementVNode("span", _hoisted_3$3, [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(__props.title), 1)], true)]), createElementVNode("span", _hoisted_4$2, [_cache[1] || (_cache[1] = createElementVNode("span", { class: "rk-disclosure-bar" }, null, -1)), createElementVNode("span", { class: normalizeClass(["rk-disclosure-bar rk-disclosure-turn", { "is-open": open.value }]) }, null, 2)])], 8, _hoisted_2$5)]),
144
+ _: 3
145
+ })), createElementVNode("div", {
146
+ id: unref(id),
147
+ class: normalizeClass(["rk-disclosure-panel", { "is-open": open.value }])
148
+ }, [createElementVNode("div", _hoisted_6$1, [createElementVNode("div", { class: normalizeClass(["rk-disclosure-body", { "is-open": open.value }]) }, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 2)])], 10, _hoisted_5$2)]);
149
+ };
150
+ }
151
+ }), [["__scopeId", "data-v-d32ee03c"]]);
63
152
  //#endregion
64
153
  //#region src/web/BaseModal.vue?vue&type=script&setup=true&lang.ts
65
- var _hoisted_1$1 = ["role", "aria-label"];
66
- var _hoisted_2$1 = { class: "rk-modal-head" };
67
- var _hoisted_3 = { class: "rk-modal-title" };
68
- var _hoisted_4 = ["aria-label"];
69
- var _hoisted_5 = { class: "rk-modal-body" };
154
+ var _hoisted_1$4 = ["role", "aria-label"];
155
+ var _hoisted_2$4 = { class: "rk-modal-head" };
156
+ var _hoisted_3$2 = { class: "rk-modal-title" };
157
+ var _hoisted_4$1 = ["aria-label"];
158
+ var _hoisted_5$1 = { class: "rk-modal-body" };
70
159
  var _hoisted_6 = {
71
160
  key: 0,
72
161
  class: "rk-modal-actions"
@@ -180,7 +269,7 @@ var BaseModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
180
269
  "aria-label": __props.title,
181
270
  tabindex: "-1"
182
271
  }, [
183
- createElementVNode("div", _hoisted_2$1, [createElementVNode("h2", _hoisted_3, toDisplayString(__props.title), 1), __props.dismissible ? (openBlock(), createElementBlock("button", {
272
+ createElementVNode("div", _hoisted_2$4, [createElementVNode("h2", _hoisted_3$2, toDisplayString(__props.title), 1), __props.dismissible ? (openBlock(), createElementBlock("button", {
184
273
  key: 0,
185
274
  type: "button",
186
275
  class: "rk-modal-close",
@@ -194,16 +283,219 @@ var BaseModal_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
194
283
  }, [createElementVNode("path", {
195
284
  d: "M18 6 6 18M6 6l12 12",
196
285
  "stroke-linecap": "round"
197
- })], -1)])], 8, _hoisted_4)) : createCommentVNode("", true)]),
198
- createElementVNode("div", _hoisted_5, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
286
+ })], -1)])], 8, _hoisted_4$1)) : createCommentVNode("", true)]),
287
+ createElementVNode("div", _hoisted_5$1, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]),
199
288
  _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "actions", {}, void 0, true)])) : createCommentVNode("", true)
200
- ], 8, _hoisted_1$1)], 32)) : createCommentVNode("", true)]),
289
+ ], 8, _hoisted_1$4)], 32)) : createCommentVNode("", true)]),
201
290
  _: 3
202
291
  })]);
203
292
  };
204
293
  }
205
294
  }), [["__scopeId", "data-v-e092f731"]]);
206
295
  //#endregion
296
+ //#region src/web/BasePagination.vue?vue&type=script&setup=true&lang.ts
297
+ var _hoisted_1$3 = ["aria-label"];
298
+ var _hoisted_2$3 = ["disabled", "aria-label"];
299
+ var _hoisted_3$1 = {
300
+ key: 0,
301
+ class: "rk-pager-gap",
302
+ "aria-hidden": "true"
303
+ };
304
+ var _hoisted_4 = ["aria-current", "onClick"];
305
+ var _hoisted_5 = ["disabled", "aria-label"];
306
+ /**
307
+ * Moving between pages of a list.
308
+ *
309
+ * A `nav` of buttons rather than links, because this component does not know
310
+ * whether the app pages by route, by query or in memory. It emits a number and
311
+ * the app decides what that means.
312
+ *
313
+ * ## The ellipsis
314
+ *
315
+ * Every page number is unusable past about a dozen, and cutting to
316
+ * "1 … 7 8 9 … 40" is what every list does. The window is a fixed size around
317
+ * the current page and the first and last are always present, so the control
318
+ * never changes width as you move through it — a row of numbers that reflows
319
+ * under the pointer is a row you have to re-aim at.
320
+ *
321
+ * The gap is a `<span>`, not a disabled button: it is not a control, and
322
+ * announcing it as one gives a screen reader something to try to press.
323
+ */
324
+ var GAP = "gap";
325
+ //#endregion
326
+ //#region src/web/BasePagination.vue
327
+ var BasePagination_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
328
+ __name: "BasePagination",
329
+ props: {
330
+ page: {},
331
+ pages: {},
332
+ siblings: { default: 1 },
333
+ label: { default: "" },
334
+ previousLabel: {},
335
+ nextLabel: {}
336
+ },
337
+ emits: ["change"],
338
+ setup(__props, { emit: __emit }) {
339
+ const emit = __emit;
340
+ const slots = computed(() => {
341
+ if (__props.pages <= 1) return [1];
342
+ const first = 1;
343
+ const last = __props.pages;
344
+ if (__props.pages <= __props.siblings * 2 + 5) return Array.from({ length: __props.pages }, (_, i) => i + 1);
345
+ const from = Math.max(2, __props.page - __props.siblings);
346
+ const to = Math.min(last - 1, __props.page + __props.siblings);
347
+ const out = [first];
348
+ if (from > 2) out.push(GAP);
349
+ for (let n = from; n <= to; n++) out.push(n);
350
+ if (to < last - 1) out.push(GAP);
351
+ if (last > first) out.push(last);
352
+ return out;
353
+ });
354
+ const go = (next) => {
355
+ if (next >= 1 && next <= __props.pages && next !== __props.page) emit("change", next);
356
+ };
357
+ return (_ctx, _cache) => {
358
+ return openBlock(), createElementBlock("nav", {
359
+ class: "rk-pager",
360
+ "aria-label": __props.label || void 0
361
+ }, [
362
+ createElementVNode("button", {
363
+ type: "button",
364
+ class: "rk-pager-step",
365
+ disabled: __props.page <= 1,
366
+ "aria-label": __props.previousLabel,
367
+ onClick: _cache[0] || (_cache[0] = ($event) => go(__props.page - 1))
368
+ }, " ‹ ", 8, _hoisted_2$3),
369
+ (openBlock(true), createElementBlock(Fragment, null, renderList(slots.value, (slot, index) => {
370
+ return openBlock(), createElementBlock(Fragment, { key: `${slot}-${index}` }, [slot === "gap" ? (openBlock(), createElementBlock("span", _hoisted_3$1, "…")) : (openBlock(), createElementBlock("button", {
371
+ key: 1,
372
+ type: "button",
373
+ class: normalizeClass(["rk-pager-page", { "is-active": slot === __props.page }]),
374
+ "aria-current": slot === __props.page ? "page" : void 0,
375
+ onClick: ($event) => go(slot)
376
+ }, toDisplayString(slot), 11, _hoisted_4))], 64);
377
+ }), 128)),
378
+ createElementVNode("button", {
379
+ type: "button",
380
+ class: "rk-pager-step",
381
+ disabled: __props.page >= __props.pages,
382
+ "aria-label": __props.nextLabel,
383
+ onClick: _cache[1] || (_cache[1] = ($event) => go(__props.page + 1))
384
+ }, " › ", 8, _hoisted_5)
385
+ ], 8, _hoisted_1$3);
386
+ };
387
+ }
388
+ }), [["__scopeId", "data-v-cc4bbb58"]]);
389
+ //#endregion
390
+ //#region src/web/BaseTabs.vue?vue&type=script&setup=true&lang.ts
391
+ var _hoisted_1$2 = ["aria-label"];
392
+ var _hoisted_2$2 = [
393
+ "id",
394
+ "aria-selected",
395
+ "aria-controls",
396
+ "tabindex",
397
+ "onClick"
398
+ ];
399
+ var _hoisted_3 = ["id", "aria-labelledby"];
400
+ //#endregion
401
+ //#region src/web/BaseTabs.vue
402
+ var BaseTabs_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
403
+ __name: "BaseTabs",
404
+ props: /*@__PURE__*/ mergeModels({
405
+ items: {},
406
+ label: { default: "" }
407
+ }, {
408
+ "modelValue": { required: true },
409
+ "modelModifiers": {}
410
+ }),
411
+ emits: ["update:modelValue"],
412
+ setup(__props) {
413
+ const active = useModel(__props, "modelValue");
414
+ const uid = useId();
415
+ const tabs = ref([]);
416
+ const tabId = (key) => `${uid}-tab-${key}`;
417
+ const panelId = (key) => `${uid}-panel-${key}`;
418
+ function select(key, focus = false) {
419
+ active.value = key;
420
+ if (!focus) return;
421
+ const index = __props.items.findIndex((item) => item.key === key);
422
+ requestAnimationFrame(() => tabs.value[index]?.focus());
423
+ }
424
+ function onKeydown(event) {
425
+ const index = __props.items.findIndex((item) => item.key === active.value);
426
+ if (index < 0) return;
427
+ const last = __props.items.length - 1;
428
+ let next;
429
+ if (event.key === "ArrowRight") next = index === last ? 0 : index + 1;
430
+ else if (event.key === "ArrowLeft") next = index === 0 ? last : index - 1;
431
+ else if (event.key === "Home") next = 0;
432
+ else if (event.key === "End") next = last;
433
+ else return;
434
+ event.preventDefault();
435
+ const item = __props.items[next];
436
+ if (item) select(item.key, true);
437
+ }
438
+ return (_ctx, _cache) => {
439
+ return openBlock(), createElementBlock("div", null, [createElementVNode("div", {
440
+ class: "rk-tabs",
441
+ role: "tablist",
442
+ "aria-label": __props.label || void 0,
443
+ onKeydown
444
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
445
+ return openBlock(), createElementBlock("button", {
446
+ key: item.key,
447
+ ref_for: true,
448
+ ref_key: "tabs",
449
+ ref: tabs,
450
+ type: "button",
451
+ role: "tab",
452
+ class: normalizeClass(["rk-tab", { "is-active": item.key === active.value }]),
453
+ id: tabId(item.key),
454
+ "aria-selected": item.key === active.value,
455
+ "aria-controls": panelId(item.key),
456
+ tabindex: item.key === active.value ? 0 : -1,
457
+ onClick: ($event) => select(item.key)
458
+ }, toDisplayString(item.label), 11, _hoisted_2$2);
459
+ }), 128))], 40, _hoisted_1$2), (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
460
+ return withDirectives((openBlock(), createElementBlock("div", {
461
+ key: item.key,
462
+ role: "tabpanel",
463
+ class: "rk-tabpanel",
464
+ id: panelId(item.key),
465
+ "aria-labelledby": tabId(item.key),
466
+ tabindex: "0"
467
+ }, [renderSlot(_ctx.$slots, "default", {
468
+ item,
469
+ active: active.value
470
+ }, void 0, true)], 8, _hoisted_3)), [[vShow, item.key === active.value]]);
471
+ }), 128))]);
472
+ };
473
+ }
474
+ }), [["__scopeId", "data-v-b854e7f5"]]);
475
+ //#endregion
476
+ //#region src/web/BaseTooltip.vue?vue&type=script&setup=true&lang.ts
477
+ var _hoisted_1$1 = { class: "rk-tip" };
478
+ var _hoisted_2$1 = ["id"];
479
+ //#endregion
480
+ //#region src/web/BaseTooltip.vue
481
+ var BaseTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
482
+ __name: "BaseTooltip",
483
+ props: {
484
+ label: {},
485
+ placement: { default: "top" }
486
+ },
487
+ setup(__props) {
488
+ const id = useId();
489
+ return (_ctx, _cache) => {
490
+ return openBlock(), createElementBlock("span", _hoisted_1$1, [renderSlot(_ctx.$slots, "default", { describedBy: unref(id) }, void 0, true), createElementVNode("span", {
491
+ id: unref(id),
492
+ role: "tooltip",
493
+ class: normalizeClass(["rk-tip-bubble", `is-${__props.placement}`])
494
+ }, toDisplayString(__props.label), 11, _hoisted_2$1)]);
495
+ };
496
+ }
497
+ }), [["__scopeId", "data-v-3ed61bd4"]]);
498
+ //#endregion
207
499
  //#region src/web/NavLinks.vue?vue&type=script&setup=true&lang.ts
208
500
  var _hoisted_1 = ["aria-label"];
209
501
  var _hoisted_2 = { class: "rk-nav-inner" };
@@ -240,6 +532,6 @@ var NavLinks_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
240
532
  }
241
533
  }), [["__scopeId", "data-v-5e640548"]]);
242
534
  //#endregion
243
- export { BaseAccordion_default as BaseAccordion, BaseModal_default as BaseModal, NavLinks_default as NavLinks };
535
+ export { BaseAccordion_default as BaseAccordion, BaseBreadcrumb_default as BaseBreadcrumb, BaseDisclosure_default as BaseDisclosure, BaseModal_default as BaseModal, BasePagination_default as BasePagination, BaseTabs_default as BaseTabs, BaseTooltip_default as BaseTooltip, NavLinks_default as NavLinks };
244
536
 
245
537
  //# sourceMappingURL=web.js.map