@reni-corp/reni-2c-ui 0.4.12 → 0.4.13

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,4 +1,33 @@
1
- import { pushScopeId as Kt, popScopeId as Jt, defineComponent as Re, nextTick as Ue, ref as R, createApp as Qt, h as Zt, resolveComponent as me, openBlock as Y, createBlock as ze, mergeProps as _t, withCtx as Te, createVNode as St, normalizeClass as Ye, createElementBlock as ge, toDisplayString as eo, renderSlot as Pe, normalizeProps as to, guardReactiveProps as oo, withKeys as no, normalizeStyle as De, createElementVNode as ie, Fragment as io, createCommentVNode as tt, withScopeId as so, onMounted as Tt, unref as ro, getCurrentScope as lo, onScopeDispose as ao, getCurrentInstance as Xe, isRef as co, toRef as uo, readonly as po, customRef as ho, watch as we, computed as ee, reactive as ot, watchEffect as fo } from "vue";
1
+ import { ref as R, pushScopeId as Kt, popScopeId as Jt, defineComponent as Re, nextTick as Ue, createApp as Qt, h as Zt, resolveComponent as me, openBlock as Y, createBlock as ze, mergeProps as _t, withCtx as Te, createVNode as St, normalizeClass as Ye, createElementBlock as ge, toDisplayString as eo, renderSlot as Pe, normalizeProps as to, guardReactiveProps as oo, withKeys as no, normalizeStyle as De, createElementVNode as ie, Fragment as io, createCommentVNode as tt, withScopeId as so, onMounted as Tt, unref as ro, getCurrentScope as lo, onScopeDispose as ao, getCurrentInstance as Xe, isRef as co, toRef as uo, readonly as po, customRef as ho, watch as we, computed as ee, reactive as ot, watchEffect as fo } from "vue";
2
+ function Hn(e = 5e3) {
3
+ const t = R([]);
4
+ let o = 1;
5
+ return {
6
+ notifications: t,
7
+ addNotification: (s) => {
8
+ const r = { ...s, id: o++ };
9
+ t.value.push(r), setTimeout(() => {
10
+ const l = t.value.indexOf(r);
11
+ l !== -1 && t.value.splice(l, 1);
12
+ }, e);
13
+ },
14
+ removeNotificationById: (s) => {
15
+ const r = t.value.findIndex(
16
+ (l) => l.id === s
17
+ );
18
+ r !== -1 && t.value.splice(r, 1);
19
+ }
20
+ };
21
+ }
22
+ function Mn() {
23
+ const e = R(0);
24
+ return {
25
+ tabIndex: e,
26
+ updateTabIndex: (o) => {
27
+ e.value = o;
28
+ }
29
+ };
30
+ }
2
31
  const mo = ["top", "right", "bottom", "left"], nt = ["start", "end"], it = /* @__PURE__ */ mo.reduce((e, t) => e.concat(t, t + "-" + nt[0], t + "-" + nt[1]), []), ve = Math.min, ne = Math.max, go = {
3
32
  left: "right",
4
33
  right: "left",
@@ -616,7 +645,7 @@ let be;
616
645
  function Nt() {
617
646
  if (be) return be;
618
647
  const e = navigator.userAgentData;
619
- return e && Array.isArray(e.brands) ? (be = e.brands.map((t) => t.brand + "/" + t.version).join(" "), be) : navigator.userAgent;
648
+ return e && Array.isArray(e.brands) ? (be = e.brands.map(((t) => t.brand + "/" + t.version)).join(" "), be) : navigator.userAgent;
620
649
  }
621
650
  function q(e) {
622
651
  return e instanceof D(e).HTMLElement;
@@ -639,10 +668,10 @@ function ko(e) {
639
668
  }
640
669
  function Ve(e) {
641
670
  const t = /firefox/i.test(Nt()), o = V(e), n = o.backdropFilter || o.WebkitBackdropFilter;
642
- return o.transform !== "none" || o.perspective !== "none" || !!n && n !== "none" || t && o.willChange === "filter" || t && !!o.filter && o.filter !== "none" || ["transform", "perspective"].some((i) => o.willChange.includes(i)) || ["paint", "layout", "strict", "content"].some((i) => {
671
+ return o.transform !== "none" || o.perspective !== "none" || !!n && n !== "none" || t && o.willChange === "filter" || t && !!o.filter && o.filter !== "none" || ["transform", "perspective"].some(((i) => o.willChange.includes(i))) || ["paint", "layout", "strict", "content"].some(((i) => {
643
672
  const s = o.contain;
644
673
  return s != null && s.includes(i);
645
- });
674
+ }));
646
675
  }
647
676
  function Rt() {
648
677
  return !/^((?!chrome|android).)*safari/i.test(Nt());
@@ -704,7 +733,7 @@ function Ne(e, t) {
704
733
  return i ? t.concat(s, s.visualViewport || [], Le(n) ? n : []) : t.concat(n, Ne(n));
705
734
  }
706
735
  function dt(e, t, o) {
707
- return t === "viewport" ? ue(function(n, i) {
736
+ return t === "viewport" ? ue((function(n, i) {
708
737
  const s = D(n), r = Z(n), l = s.visualViewport;
709
738
  let p = r.clientWidth, u = r.clientHeight, c = 0, a = 0;
710
739
  if (l) {
@@ -713,15 +742,15 @@ function dt(e, t, o) {
713
742
  (d || !d && i === "fixed") && (c = l.offsetLeft, a = l.offsetTop);
714
743
  }
715
744
  return { width: p, height: u, x: c, y: a };
716
- }(e, o)) : Q(t) ? ue(function(n, i) {
745
+ })(e, o)) : Q(t) ? ue((function(n, i) {
717
746
  const s = ye(n, !0, i === "fixed"), r = s.top + n.clientTop, l = s.left + n.clientLeft, p = q(n) ? ae(n) : { x: 1, y: 1 };
718
747
  return { width: n.clientWidth * p.x, height: n.clientHeight * p.y, x: l * p.x, y: r * p.y };
719
- }(t, o)) : ue(function(n) {
748
+ })(t, o)) : ue((function(n) {
720
749
  const i = Z(n), s = ke(n), r = n.ownerDocument.body, l = pe(i.scrollWidth, i.clientWidth, r.scrollWidth, r.clientWidth), p = pe(i.scrollHeight, i.clientHeight, r.scrollHeight, r.clientHeight);
721
750
  let u = -s.scrollLeft + kt(n);
722
751
  const c = -s.scrollTop;
723
752
  return V(r).direction === "rtl" && (u += pe(i.clientWidth, r.clientWidth) - l), { width: l, height: p, x: u, y: c };
724
- }(Z(e)));
753
+ })(Z(e)));
725
754
  }
726
755
  function ut(e) {
727
756
  return q(e) && V(e).position !== "fixed" ? e.offsetParent : null;
@@ -730,14 +759,14 @@ function pt(e) {
730
759
  const t = D(e);
731
760
  let o = ut(e);
732
761
  for (; o && ko(o) && V(o).position === "static"; ) o = ut(o);
733
- return o && (te(o) === "html" || te(o) === "body" && V(o).position === "static" && !Ve(o)) ? t : o || function(n) {
762
+ return o && (te(o) === "html" || te(o) === "body" && V(o).position === "static" && !Ve(o)) ? t : o || (function(n) {
734
763
  let i = $e(n);
735
764
  for (; q(i) && !Qe(i); ) {
736
765
  if (Ve(i)) return i;
737
766
  i = $e(i);
738
767
  }
739
768
  return null;
740
- }(e) || t;
769
+ })(e) || t;
741
770
  }
742
771
  function Ho(e, t, o) {
743
772
  const n = q(t), i = Z(t), s = ye(e, !0, o === "fixed", t);
@@ -751,21 +780,21 @@ function Ho(e, t, o) {
751
780
  }
752
781
  const Mo = { getClippingRect: function(e) {
753
782
  let { element: t, boundary: o, rootBoundary: n, strategy: i } = e;
754
- const s = o === "clippingAncestors" ? function(u, c) {
783
+ const s = o === "clippingAncestors" ? (function(u, c) {
755
784
  const a = c.get(u);
756
785
  if (a) return a;
757
- let d = Ne(u).filter((w) => Q(w) && te(w) !== "body"), h = null;
786
+ let d = Ne(u).filter(((w) => Q(w) && te(w) !== "body")), h = null;
758
787
  const f = V(u).position === "fixed";
759
788
  let m = f ? $e(u) : u;
760
789
  for (; Q(m) && !Qe(m); ) {
761
790
  const w = V(m), g = Ve(m);
762
- (f ? g || h : g || w.position !== "static" || !h || !["absolute", "fixed"].includes(h.position)) ? h = w : d = d.filter((v) => v !== m), m = $e(m);
791
+ (f ? g || h : g || w.position !== "static" || !h || !["absolute", "fixed"].includes(h.position)) ? h = w : d = d.filter(((v) => v !== m)), m = $e(m);
763
792
  }
764
793
  return c.set(u, d), d;
765
- }(t, this._c) : [].concat(o), r = [...s, n], l = r[0], p = r.reduce((u, c) => {
794
+ })(t, this._c) : [].concat(o), r = [...s, n], l = r[0], p = r.reduce(((u, c) => {
766
795
  const a = dt(t, c, i);
767
796
  return u.top = pe(a.top, u.top), u.right = at(a.right, u.right), u.bottom = at(a.bottom, u.bottom), u.left = pe(a.left, u.left), u;
768
- }, dt(t, l, i));
797
+ }), dt(t, l, i));
769
798
  return { width: p.right - p.left, height: p.bottom - p.top, x: p.left, y: p.top };
770
799
  }, convertOffsetParentRelativeRectToViewportRelativeRect: function(e) {
771
800
  let { rect: t, offsetParent: o, strategy: n } = e;
@@ -2257,7 +2286,7 @@ function $n(e) {
2257
2286
  }
2258
2287
  e.classList && e.classList.remove(Vt);
2259
2288
  }
2260
- const Hn = cn, We = typeof window < "u";
2289
+ const Dn = cn;
2261
2290
  function et(e) {
2262
2291
  return lo() ? (ao(e), !0) : !1;
2263
2292
  }
@@ -2270,7 +2299,7 @@ const xn = (e) => typeof e < "u", bn = Object.prototype.toString, _n = (e) => bn
2270
2299
  }, Sn = /* @__PURE__ */ Tn();
2271
2300
  function Tn() {
2272
2301
  var e, t;
2273
- return qt && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
2302
+ return qt && ((e = window?.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window?.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
2274
2303
  }
2275
2304
  function Gt(e, t) {
2276
2305
  function o(...n) {
@@ -2311,7 +2340,7 @@ function An(...e) {
2311
2340
  })), !p && !o && (o = setTimeout(() => n = !0, h)), n = !1, s);
2312
2341
  };
2313
2342
  }
2314
- const Mn = {
2343
+ const Bn = {
2315
2344
  mounted: "mounted"
2316
2345
  };
2317
2346
  function Cn(e, t) {
@@ -2324,7 +2353,7 @@ function Cn(e, t) {
2324
2353
  function On(e) {
2325
2354
  return Xe();
2326
2355
  }
2327
- function Dn(...e) {
2356
+ function Fn(...e) {
2328
2357
  if (e.length !== 1)
2329
2358
  return uo(...e);
2330
2359
  const t = e[0];
@@ -2348,7 +2377,7 @@ function Ut(e, t = !0, o) {
2348
2377
  function B(e) {
2349
2378
  var t;
2350
2379
  const o = k(e);
2351
- return (t = o == null ? void 0 : o.$el) != null ? t : o;
2380
+ return (t = o?.$el) != null ? t : o;
2352
2381
  }
2353
2382
  const le = qt ? window : void 0;
2354
2383
  function j(...e) {
@@ -2375,7 +2404,7 @@ function j(...e) {
2375
2404
  return et(u), u;
2376
2405
  }
2377
2406
  let xt = !1;
2378
- function Bn(e, t, o = {}) {
2407
+ function In(e, t, o = {}) {
2379
2408
  const { window: n = le, ignore: i = [], capture: s = !0, detectIframe: r = !1 } = o;
2380
2409
  if (!n)
2381
2410
  return W;
@@ -2407,7 +2436,7 @@ function Bn(e, t, o = {}) {
2407
2436
  setTimeout(() => {
2408
2437
  var h;
2409
2438
  const f = B(e);
2410
- ((h = n.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(f != null && f.contains(n.document.activeElement)) && t(d);
2439
+ ((h = n.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !f?.contains(n.document.activeElement) && t(d);
2411
2440
  }, 0);
2412
2441
  })
2413
2442
  ].filter(Boolean);
@@ -2437,14 +2466,14 @@ function de(e, t = {}) {
2437
2466
  p(), l(), i = void 0;
2438
2467
  }), s;
2439
2468
  }
2440
- const Fn = {
2469
+ const Wn = {
2441
2470
  sm: 640,
2442
2471
  md: 768,
2443
2472
  lg: 1024,
2444
2473
  xl: 1280,
2445
2474
  "2xl": 1536
2446
2475
  };
2447
- function In(e, t = {}) {
2476
+ function jn(e, t = {}) {
2448
2477
  function o(c, a) {
2449
2478
  let d = k(e[k(c)]);
2450
2479
  return a != null && (d = Cn(d, a)), typeof d == "number" && (d = `${d}px`), d;
@@ -2522,7 +2551,7 @@ function Ln(e, t, o = {}) {
2522
2551
  stop: c
2523
2552
  };
2524
2553
  }
2525
- function Wn(e, t = { width: 0, height: 0 }, o = {}) {
2554
+ function Vn(e, t = { width: 0, height: 0 }, o = {}) {
2526
2555
  const { window: n = le, box: i = "content-box" } = o, s = ee(() => {
2527
2556
  var a, d;
2528
2557
  return (d = (a = B(e)) == null ? void 0 : a.namespaceURI) == null ? void 0 : d.includes("svg");
@@ -2564,7 +2593,7 @@ function Wn(e, t = { width: 0, height: 0 }, o = {}) {
2564
2593
  };
2565
2594
  }
2566
2595
  const bt = 1;
2567
- function jn(e, t = {}) {
2596
+ function qn(e, t = {}) {
2568
2597
  const {
2569
2598
  throttle: o = 0,
2570
2599
  idle: n = 200,
@@ -2612,7 +2641,7 @@ function jn(e, t = {}) {
2612
2641
  left: (_ = k(y)) != null ? _ : h.value,
2613
2642
  behavior: k(p)
2614
2643
  });
2615
- const O = ((C = A == null ? void 0 : A.document) == null ? void 0 : C.documentElement) || (A == null ? void 0 : A.documentElement) || A;
2644
+ const O = ((C = A?.document) == null ? void 0 : C.documentElement) || A?.documentElement || A;
2616
2645
  h != null && (a.value = O.scrollLeft), f != null && (d.value = O.scrollTop);
2617
2646
  }
2618
2647
  const w = R(!1), g = ot({
@@ -2631,7 +2660,7 @@ function jn(e, t = {}) {
2631
2660
  var E;
2632
2661
  if (!u)
2633
2662
  return;
2634
- const P = ((E = y == null ? void 0 : y.document) == null ? void 0 : E.documentElement) || (y == null ? void 0 : y.documentElement) || B(y), { display: _, flexDirection: N } = getComputedStyle(P), C = P.scrollLeft;
2663
+ const P = ((E = y?.document) == null ? void 0 : E.documentElement) || y?.documentElement || B(y), { display: _, flexDirection: N } = getComputedStyle(P), C = P.scrollLeft;
2635
2664
  v.left = C < a.value, v.right = C > a.value;
2636
2665
  const A = Math.abs(C) <= (r.left || 0), O = Math.abs(C) + P.clientWidth >= P.scrollWidth - (r.right || 0) - bt;
2637
2666
  _ === "flex" && N === "row-reverse" ? (g.left = O, g.right = A) : (g.left = A, g.right = O), a.value = C;
@@ -2677,7 +2706,7 @@ function jn(e, t = {}) {
2677
2706
  }
2678
2707
  };
2679
2708
  }
2680
- function Vn(e, t, o, n = {}) {
2709
+ function Gn(e, t, o, n = {}) {
2681
2710
  var i, s, r;
2682
2711
  const {
2683
2712
  clone: l = !1,
@@ -2686,7 +2715,7 @@ function Vn(e, t, o, n = {}) {
2686
2715
  deep: c = !1,
2687
2716
  defaultValue: a,
2688
2717
  shouldEmit: d
2689
- } = n, h = Xe(), f = o || (h == null ? void 0 : h.emit) || ((i = h == null ? void 0 : h.$emit) == null ? void 0 : i.bind(h)) || ((r = (s = h == null ? void 0 : h.proxy) == null ? void 0 : s.$emit) == null ? void 0 : r.bind(h == null ? void 0 : h.proxy));
2718
+ } = n, h = Xe(), f = o || h?.emit || ((i = h?.$emit) == null ? void 0 : i.bind(h)) || ((r = (s = h?.proxy) == null ? void 0 : s.$emit) == null ? void 0 : r.bind(h?.proxy));
2690
2719
  let m = u;
2691
2720
  m = m || `update:${t.toString()}`;
2692
2721
  const w = ($) => l ? typeof l == "function" ? l($) : zn($) : $, g = () => xn(e[t]) ? w(e[t]) : a, v = ($) => {
@@ -2717,35 +2746,7 @@ function Vn(e, t, o, n = {}) {
2717
2746
  }
2718
2747
  });
2719
2748
  }
2720
- function qn(e = 5e3) {
2721
- const t = R([]);
2722
- let o = 1;
2723
- return {
2724
- notifications: t,
2725
- addNotification: (s) => {
2726
- const r = { ...s, id: o++ };
2727
- t.value.push(r), setTimeout(() => {
2728
- const l = t.value.indexOf(r);
2729
- l !== -1 && t.value.splice(l, 1);
2730
- }, e);
2731
- },
2732
- removeNotificationById: (s) => {
2733
- const r = t.value.findIndex(
2734
- (l) => l.id === s
2735
- );
2736
- r !== -1 && t.value.splice(r, 1);
2737
- }
2738
- };
2739
- }
2740
- function Gn() {
2741
- const e = R(0);
2742
- return {
2743
- tabIndex: e,
2744
- updateTabIndex: (o) => {
2745
- e.value = o;
2746
- }
2747
- };
2748
- }
2749
+ const We = typeof window < "u";
2749
2750
  function Un() {
2750
2751
  const e = (i) => new Promise((s) => setTimeout(s, i)), o = "RN-ui-tool-chip";
2751
2752
  return {
@@ -2822,13 +2823,13 @@ function Yn() {
2822
2823
  };
2823
2824
  }
2824
2825
  export {
2825
- Hn as W,
2826
- qn as a,
2827
- Gn as b,
2826
+ Dn as W,
2827
+ Hn as a,
2828
+ Mn as b,
2828
2829
  Un as c,
2829
- In as d,
2830
- Fn as e,
2831
- Mn as f,
2830
+ jn as d,
2831
+ Wn as e,
2832
+ Bn as f,
2832
2833
  En as g,
2833
2834
  Ut as h,
2834
2835
  We as i,
@@ -2837,13 +2838,13 @@ export {
2837
2838
  et as l,
2838
2839
  Nn as m,
2839
2840
  W as n,
2840
- Bn as o,
2841
- Dn as p,
2841
+ In as o,
2842
+ Fn as p,
2842
2843
  Sn as q,
2843
- Vn as r,
2844
- jn as s,
2844
+ Gn as r,
2845
+ qn as s,
2845
2846
  k as t,
2846
2847
  Yn as u,
2847
- Wn as v,
2848
+ Vn as v,
2848
2849
  Ln as w
2849
2850
  };
@@ -0,0 +1,66 @@
1
+ class c {
2
+ _value;
3
+ constructor(t) {
4
+ this._value = a(t), this.init();
5
+ }
6
+ init() {
7
+ }
8
+ get value() {
9
+ return this._value;
10
+ }
11
+ toString() {
12
+ return String(this.value);
13
+ }
14
+ toJSON() {
15
+ return this.value;
16
+ }
17
+ }
18
+ function a(r) {
19
+ return r instanceof c ? r.value : r;
20
+ }
21
+ const u = "ja-JP", o = "JPY";
22
+ class i extends c {
23
+ locale;
24
+ currency;
25
+ constructor(t, {
26
+ locale: e = u,
27
+ currency: s = o
28
+ } = {}) {
29
+ super(t), this.locale = e, this.currency = s;
30
+ }
31
+ toString() {
32
+ let e = new Intl.NumberFormat(this.locale, {
33
+ style: "currency",
34
+ currency: this.currency
35
+ }).format(this.value);
36
+ return this.currency === "JPY" && (e = e.replace(/\uFFE5|\u00A5/g, "¥")), e;
37
+ }
38
+ }
39
+ const l = "ja-JP";
40
+ class n extends c {
41
+ locale;
42
+ constructor(t, { locale: e = l } = {}) {
43
+ super(t), this.locale = e;
44
+ }
45
+ add(t) {
46
+ return new n(this.value + a(t));
47
+ }
48
+ subtract(t) {
49
+ return new n(this.value - a(t));
50
+ }
51
+ toString() {
52
+ return new Intl.NumberFormat(this.locale).format(this.value);
53
+ }
54
+ toPercentageString() {
55
+ return new Intl.NumberFormat(this.locale, {
56
+ style: "percent",
57
+ maximumSignificantDigits: 3
58
+ }).format(this.value);
59
+ }
60
+ }
61
+ export {
62
+ i as C,
63
+ n as N,
64
+ c as V,
65
+ a as g
66
+ };
@@ -1,4 +1,4 @@
1
- import { C as a, N as u } from "./valueObjects-CvF0zaqR.js";
1
+ import { C as a, N as u } from "./valueObjects-XKjx9Hu_.js";
2
2
  export {
3
3
  a as CurrencyValue,
4
4
  u as NumberValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reni-corp/reni-2c-ui",
3
- "version": "0.4.12",
3
+ "version": "0.4.13",
4
4
  "type": "module",
5
5
  "main": "./dist/script.umd.js",
6
6
  "module": "./dist/index.es.js",
@@ -96,7 +96,7 @@
96
96
  "@types/lz-string": "^1.5.0",
97
97
  "@typescript-eslint/eslint-plugin": "^8.8.1",
98
98
  "@typescript-eslint/parser": "^8.8.1",
99
- "@vitejs/plugin-vue": "^5.2.4",
99
+ "@vitejs/plugin-vue": "^6.0.7",
100
100
  "@vue/babel-plugin-jsx": "^1.1.5",
101
101
  "@vue/test-utils": "^2.4.6",
102
102
  "eslint": "^9.12.0",
@@ -116,7 +116,7 @@
116
116
  "prettier": "^3.3.3",
117
117
  "react": "^18.2.0",
118
118
  "react-dom": "^18.2.0",
119
- "rollup-plugin-visualizer": "^5.11.0",
119
+ "rollup-plugin-visualizer": "^7.0.1",
120
120
  "sass": "^1.66.1",
121
121
  "storybook": "^10.2.10",
122
122
  "stylelint": "^16.9.0",
@@ -127,9 +127,9 @@
127
127
  "stylelint-config-standard-scss": "^13.1.0",
128
128
  "stylelint-scss": "^6.11.1",
129
129
  "typescript": "^5.0.2",
130
- "vite": "^5.4.21",
130
+ "vite": "^7.3.1",
131
131
  "vite-plugin-dts": "^4.5.4",
132
- "vitest": "^4.0.18",
132
+ "vitest": "^4.1.7",
133
133
  "vue-eslint-parser": "^10.2.0",
134
134
  "vue-tsc": "^1.8.5"
135
135
  },
@@ -46,6 +46,15 @@ const meta: Meta<typeof AnnounceBar> = {
46
46
  dense: {
47
47
  control: 'boolean',
48
48
  },
49
+ icon: {
50
+ control: 'text',
51
+ },
52
+ // 自動生成されるスロット制御ボタンを非表示
53
+ body: { table: { disable: true } },
54
+ bodyText: {
55
+ control: 'text',
56
+ table: { category: 'slots' },
57
+ },
49
58
  },
50
59
  args: {
51
60
  title: 'title',
@@ -57,6 +66,8 @@ const meta: Meta<typeof AnnounceBar> = {
57
66
  url: '',
58
67
  isTargetBlank: false,
59
68
  dense: false,
69
+ icon: '',
70
+ bodyText: '',
60
71
  },
61
72
  render: (args) => ({
62
73
  components: { 'rn-announce-bar': AnnounceBar },
@@ -75,7 +86,11 @@ const meta: Meta<typeof AnnounceBar> = {
75
86
  :url=args.url
76
87
  :isTargetBlank=args.isTargetBlank
77
88
  :dense=args.dense
89
+ :icon=args.icon
78
90
  >
91
+ <template #body>
92
+ <span v-if="args.bodyText">{{ args.bodyText }}</span>
93
+ </template>
79
94
  </rn-announce-bar>
80
95
  </div>
81
96
  `,
@@ -83,7 +98,7 @@ const meta: Meta<typeof AnnounceBar> = {
83
98
  }
84
99
 
85
100
  export default meta
86
- type StoryArgs = AnnounceBarProps & { slotText: string }
101
+ type StoryArgs = AnnounceBarProps & { slotText: string; bodyText: string }
87
102
  type Story = StoryObj<StoryArgs>
88
103
  type OverridesStory = Omit<Story, 'argTypes'> & {
89
104
  argTypes?: Record<string, any>
@@ -136,3 +151,39 @@ export const 応用2: OverridesStory = {
136
151
  },
137
152
  },
138
153
  }
154
+
155
+ export const アイコン付きタイトル: OverridesStory = {
156
+ args: {
157
+ slotText: 'AnnounceBar',
158
+ icon: 'circle-info-outline',
159
+ },
160
+ argTypes: {
161
+ default: { table: { disable: true } },
162
+ },
163
+ parameters: {
164
+ docs: {
165
+ description: {
166
+ story:
167
+ 'iconプロップにアイコン名を渡すとタイトルの左側にアイコンが表示される。未指定または空文字の場合はアイコンが非表示になる。',
168
+ },
169
+ },
170
+ },
171
+ }
172
+
173
+ export const ボディスロット: OverridesStory = {
174
+ args: {
175
+ slotText: 'AnnounceBar',
176
+ bodyText: 'ボディエリアに任意のコンテンツを配置できます。',
177
+ },
178
+ argTypes: {
179
+ default: { table: { disable: true } },
180
+ },
181
+ parameters: {
182
+ docs: {
183
+ description: {
184
+ story:
185
+ 'bodyTextコントロールでボディの内容を変更できる。空欄にするとボディスロットが非表示になる。',
186
+ },
187
+ },
188
+ },
189
+ }
@@ -0,0 +1,144 @@
1
+ import { ref } from 'vue'
2
+ import type { Meta, StoryObj } from '@storybook/vue3-vite'
3
+ import SwipeConfirm, {
4
+ type SwipeConfirmProps,
5
+ } from '@/components/interactive/SwipeConfirm.vue'
6
+ import { Color } from '@/types'
7
+ import { ColorOptions } from '@/constants'
8
+
9
+ const meta: Meta<typeof SwipeConfirm> = {
10
+ title: 'Interactive/SwipeConfirm',
11
+ component: SwipeConfirm,
12
+ tags: ['autodocs'],
13
+ parameters: {
14
+ docs: {
15
+ description: {
16
+ component:
17
+ 'ハンドルを最後までスライドさせると確定するスワイプ確定バー。決済確定・申込確定・入場処理など、誤タップを避けたい「取り消しにくい確定操作」に利用する。確定は一方向(解除は親が v-model で制御)。',
18
+ },
19
+ },
20
+ },
21
+ argTypes: {
22
+ color: {
23
+ control: 'select',
24
+ options: Object.keys(ColorOptions) as Color[],
25
+ description: '確定時の塗り色',
26
+ },
27
+ label: { control: 'text', description: '未確定時のラベル' },
28
+ confirmedLabel: { control: 'text', description: '確定後のラベル' },
29
+ threshold: {
30
+ control: { type: 'range', min: 0.1, max: 1, step: 0.05 },
31
+ description: '確定とみなすドラッグ割合',
32
+ },
33
+ disabled: { control: 'boolean' },
34
+ reversed: { control: 'boolean', description: '180° 回転(向かい側操作向け)' },
35
+ },
36
+ args: {
37
+ label: 'スワイプでチェックイン',
38
+ confirmedLabel: '入場済み',
39
+ color: 'success',
40
+ threshold: 0.9,
41
+ disabled: false,
42
+ reversed: false,
43
+ },
44
+ render: (args) => ({
45
+ components: { 'rn-swipe-confirm': SwipeConfirm },
46
+ setup() {
47
+ const confirmed = ref(false)
48
+ return { args, confirmed }
49
+ },
50
+ template: /* html */ `
51
+ <div class='sb-canvas' style='max-width: 360px;'>
52
+ <rn-swipe-confirm
53
+ v-model:confirmed='confirmed'
54
+ :label='args.label'
55
+ :confirmedLabel='args.confirmedLabel'
56
+ :color='args.color'
57
+ :threshold='args.threshold'
58
+ :disabled='args.disabled'
59
+ :reversed='args.reversed'
60
+ @confirm="() => {}"
61
+ />
62
+ <p style='margin-top: 24px;'>confirmed:{{ confirmed }}</p>
63
+ </div>
64
+ `,
65
+ }),
66
+ }
67
+
68
+ export default meta
69
+ type StoryArgs = SwipeConfirmProps
70
+ type Story = StoryObj<StoryArgs>
71
+
72
+ export const 基本: Story = {
73
+ args: {},
74
+ }
75
+
76
+ export const 確定済み: Story = {
77
+ render: (args) => ({
78
+ components: { 'rn-swipe-confirm': SwipeConfirm },
79
+ setup() {
80
+ const confirmed = ref(true)
81
+ return { args, confirmed }
82
+ },
83
+ template: /* html */ `
84
+ <div class='sb-canvas' style='max-width: 360px;'>
85
+ <rn-swipe-confirm
86
+ v-model:confirmed='confirmed'
87
+ :label='args.label'
88
+ :confirmedLabel='args.confirmedLabel'
89
+ :color='args.color'
90
+ />
91
+ </div>
92
+ `,
93
+ }),
94
+ }
95
+
96
+ export const 無効: Story = {
97
+ args: { disabled: true },
98
+ }
99
+
100
+ export const 反転: Story = {
101
+ args: { reversed: true },
102
+ }
103
+
104
+ export const 一覧: Story = {
105
+ render: () => ({
106
+ components: { 'rn-swipe-confirm': SwipeConfirm },
107
+ setup() {
108
+ const a = ref(false)
109
+ const b = ref(true)
110
+ const c = ref(false)
111
+ const d = ref(false)
112
+ return { a, b, c, d }
113
+ },
114
+ template: /* html */ `
115
+ <div
116
+ class='sb-canvas'
117
+ style='display: flex; flex-direction: column; gap: 24px; max-width: 360px;'
118
+ >
119
+ <rn-swipe-confirm
120
+ v-model:confirmed='a'
121
+ label='スワイプでチェックイン'
122
+ confirmedLabel='入場済み'
123
+ />
124
+ <rn-swipe-confirm
125
+ v-model:confirmed='b'
126
+ label='スワイプでチェックイン'
127
+ confirmedLabel='入場済み'
128
+ />
129
+ <rn-swipe-confirm
130
+ v-model:confirmed='c'
131
+ label='スワイプで決済確定'
132
+ confirmedLabel='決済完了'
133
+ color='primary'
134
+ />
135
+ <rn-swipe-confirm
136
+ v-model:confirmed='d'
137
+ label='無効状態'
138
+ confirmedLabel='確定済み'
139
+ disabled
140
+ />
141
+ </div>
142
+ `,
143
+ }),
144
+ }