welcome-ui 10.6.10 → 10.7.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.
- package/dist/Tabs.css +1 -1
- package/dist/Tabs.js +161 -147
- package/dist/types/components/Tabs/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/Tabs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.
|
|
1
|
+
@layer components{._root_393s0_2{display:flex;align-items:center;transition-property:background-color,border-color,color,box-shadow,outline;transition-timing-function:ease-in-out;cursor:pointer;border-radius:var(--radius-md);transition-duration:var(--duration-medium);font-weight:var(--font-weight-medium);gap:var(--tabGap);max-height:var(--tabItemMaxHeight);padding-block:var(--tabPaddingBlock);padding-inline:var(--tabPaddingInline);font-size:var(--tabFontSize);background-color:var(--tabItemBackgroundColor, var(--tab-color-background-unchecked-default));color:var(--tabItemTextColor, var(--tab-color-text-unchecked-default));box-shadow:inset 0 0 0 var(--tabItemBorderSize, var(--tab-border-width-unchecked)) var(--tabItemBorderColor, var(--tab-color-border-unchecked-default)),var(--tabItemBoxShadow, var(--elevation-10))}._root_393s0_2:focus:not(._dashed_393s0_23,._root_393s0_2[aria-selected=true]){outline:none!important;--tabItemTextColor: var(--tab-color-text-unchecked-pressed);--tabItemBackgroundColor: var(--tab-color-background-unchecked-pressed);--tabItemBorderColor: var(--tab-color-border-unchecked-pressed)}._root_393s0_2[aria-selected=true]{--tabItemTextColor: var(--tab-color-text-checked-default);--tabItemBackgroundColor: var(--tab-color-background-checked-default);--tabItemBorderColor: var(--tab-color-border-checked-default);--tabItemBorderSize: var(--tab-border-width-checked)}._root_393s0_2[aria-selected=true]:hover{--tabItemTextColor: var(--tab-color-text-checked-hover);--tabItemBackgroundColor: var(--tab-color-background-checked-hover);--tabItemBorderColor: var(--tab-color-border-checked-hover);--tabItemBorderSize: var(--tab-border-width-checked);--tabItemBoxShadow: var(--elevation-20)}._root_393s0_2._dashed_393s0_23{--tabItemBackgroundColor: var(--color-background-transparent-white-none);--tabItemBorderColor: var( --color-background-transparent-white-none );--tabItemDashedBorderSize: var(--tab-border-width-unchecked);outline-style:dashed;outline-color:var(--tab-color-border-dashed-default);outline-width:var(--tabItemDashedBorderSize);outline-offset:calc(var(--tabItemDashedBorderSize) * -1);--tabItemTextColor: var(--tab-color-text-dashed-default)}._root_393s0_2._dashed_393s0_23:focus-visible:not([aria-disabled=true]){outline-color:var(--tab-color-border-dashed-pressed);--tabItemDashedBorderSize: var(--tab-border-width-checked)}._root_393s0_2._dashed_393s0_23:active:not([aria-disabled=true]){outline-color:var(--tab-color-border-dashed-pressed)}._root_393s0_2._dashed_393s0_23[aria-selected=true]{outline-color:var(--tab-color-border-checked-default);--tabItemDashedBorderSize: var(--tab-border-width-checked);--tabItemTextColor: var(--tab-color-text-checked-default);--tabItemBackgroundColor: var(--tab-color-background-checked-default)}._root_393s0_2._dashed_393s0_23[aria-selected=true]:hover{outline-color:var(--tab-color-border-checked-hover);--tabItemBorderColor: var( --color-background-transparent-white-none );--tabItemDashedBorderSize: var(--tab-border-width-checked);--tabItemBackgroundColor: var(--tab-color-background-checked-hover)}._root_393s0_2._dashed_393s0_23:hover{outline-color:var(--tab-color-border-dashed-hover);--tabItemBackgroundColor: var(--tab-color-background-unchecked-hover);--tabItemBoxShadow: var(--elevation-20)}._root_393s0_2[aria-disabled=true]{cursor:not-allowed;--tabItemTextColor: var(--button-color-text-secondary-main-disabled);background:repeating-linear-gradient(-45deg,transparent,transparent 2.4px,color-mix(in srgb,var(--color-neutral-50) 12%,transparent) 2.4px,color-mix(in srgb,var(--color-neutral-50) 12%,transparent) 4.3px),var(--button-color-background-secondary-main-disabled)}._root_393s0_2:hover:not([aria-selected=true],[aria-disabled=true],._dashed_393s0_23){--tabItemTextColor: var(--tab-color-text-unchecked-hover);--tabItemBackgroundColor: var(--tab-color-background-unchecked-hover);--tabItemBorderColor: var(--tab-color-border-unchecked-hover);--tabItemBoxShadow: var(--elevation-20)}._root_393s0_2._orientation-vertical_393s0_91{width:100%}._content_393s0_94{display:flex;flex:1;align-items:center;gap:var(--tabGap);min-width:0}._content_393s0_94 ._icon_393s0_101{display:flex;flex-shrink:0}._size-lg_393s0_105{--tabItemMaxHeight: var(--tab-size-max-height-lg);--tabPaddingBlock: var(--tab-padding-block-lg);--tabPaddingInline: var(--tab-padding-inline-lg);--tabFontSize: var(--font-size-sm);--tabGap: var(--tab-gap-content-lg)}._size-md_393s0_112{--tabItemMaxHeight: var(--tab-size-max-height-md);--tabPaddingBlock: var(--tab-padding-block-md);--tabPaddingInline: var(--tab-padding-inline-md);--tabFontSize: var(--font-size-xs);--tabGap: var(--tab-gap-content-md)}._folder-icon_393s0_122{color:var(--tabIconColor)}._folder-icon-blue_393s0_125{--tabIconColor: var(--color-background-accent-blue-primary)}._folder-icon-blue-active_393s0_128{--tabIconColor: var(--color-background-accent-blue-strong)}._folder-icon-green_393s0_131{--tabIconColor: var(--color-background-accent-green-primary)}._folder-icon-green-active_393s0_134{--tabIconColor: var(--color-background-accent-green-strong)}._folder-icon-orange_393s0_137{--tabIconColor: var(--color-background-accent-orange-primary)}._folder-icon-orange-active_393s0_140{--tabIconColor: var(--color-background-accent-orange-strong)}._folder-icon-pink_393s0_143{--tabIconColor: var(--color-background-accent-pink-primary)}._folder-icon-pink-active_393s0_146{--tabIconColor: var(--color-background-accent-pink-strong)}._folder-icon-teal_393s0_149{--tabIconColor: var(--color-background-accent-teal-primary)}._folder-icon-teal-active_393s0_152{--tabIconColor: var(--color-background-accent-teal-strong)}._folder-icon-violet_393s0_155{--tabIconColor: var(--color-background-accent-violet-primary)}._folder-icon-violet-active_393s0_158{--tabIconColor: var(--color-background-accent-violet-strong)}._folder-icon-warm_393s0_161{--tabIconColor: var(--color-background-warm-stronger)}._folder-icon-warm-active_393s0_164{--tabIconColor: var(--color-beige-60)}._tab-list_393s0_170{display:flex;align-items:center;gap:var(--tabsGap, 0)}._tab-list_393s0_170._size-lg_393s0_105{--tabsGap: var(--tab-gap-content-lg)}._tab-list_393s0_170._size-md_393s0_112{--tabsGap: var(--tab-gap-content-md)}._tab-list_393s0_170._orientation-vertical_393s0_91{flex-direction:column;align-items:stretch;--tabsGap: var(--tab-gap-content-lg)}}
|
package/dist/Tabs.js
CHANGED
|
@@ -6,19 +6,19 @@ import { a as D } from "./combobox-context-COdkPD-I.js";
|
|
|
6
6
|
import { u as G } from "./composite-store-BbsZpdXc.js";
|
|
7
7
|
import { P as H, b as J } from "./popover-context-B2YQ_e3N.js";
|
|
8
8
|
import { C as Q, a as X, c as Y, m as Z } from "./composite-item-CzuZunbi.js";
|
|
9
|
-
import { b as ee, w as
|
|
9
|
+
import { b as ee, w as I, V as N, ab as te, x as V } from "./D5lwkpmX-BTxFdaqc.js";
|
|
10
10
|
import z, { createContext as $, useMemo as oe, forwardRef as B } from "react";
|
|
11
|
-
import { m as
|
|
11
|
+
import { m as se, o as F, c as ne, s as k, d as f, g as re, a as j, b as M, u as q } from "./index-B0vSTNCB.js";
|
|
12
12
|
import { c as P } from "./index-B6iGEm-i.js";
|
|
13
|
-
import { Badge as
|
|
13
|
+
import { Badge as ae } from "./Badge.js";
|
|
14
14
|
import { f as ie } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
15
15
|
import { Icon as le } from "./Icon.js";
|
|
16
16
|
const ce = ee([J, X], [H, Q]), de = ce.useContext;
|
|
17
17
|
$(!1);
|
|
18
18
|
$(null);
|
|
19
19
|
function ue(e) {
|
|
20
|
-
var
|
|
21
|
-
const o = (
|
|
20
|
+
var n;
|
|
21
|
+
const o = (n = e[0]) == null ? void 0 : n.element;
|
|
22
22
|
if (!o) return;
|
|
23
23
|
const t = te(o);
|
|
24
24
|
if (t)
|
|
@@ -28,16 +28,16 @@ function me(e, o) {
|
|
|
28
28
|
if (o != null)
|
|
29
29
|
return e.find((t) => t.id === o);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function S(e) {
|
|
32
32
|
return !(!e || e.disabled || e.dimmed);
|
|
33
33
|
}
|
|
34
34
|
function fe() {
|
|
35
35
|
const e = Z(), o = /* @__PURE__ */ new Map();
|
|
36
|
-
return
|
|
36
|
+
return f(e, ["items"], (t) => {
|
|
37
37
|
o.clear();
|
|
38
|
-
for (const
|
|
39
|
-
const { tabId: i } =
|
|
40
|
-
i != null && (o.has(i) || o.set(i,
|
|
38
|
+
for (const n of t.items) {
|
|
39
|
+
const { tabId: i } = n;
|
|
40
|
+
i != null && (o.has(i) || o.set(i, n));
|
|
41
41
|
}
|
|
42
42
|
}), {
|
|
43
43
|
panels: e,
|
|
@@ -45,7 +45,7 @@ function fe() {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
function be({ composite: e, combobox: o, ...t } = {}) {
|
|
48
|
-
const
|
|
48
|
+
const n = [
|
|
49
49
|
"items",
|
|
50
50
|
"renderedItems",
|
|
51
51
|
"moves",
|
|
@@ -59,106 +59,106 @@ function be({ composite: e, combobox: o, ...t } = {}) {
|
|
|
59
59
|
"focusShift",
|
|
60
60
|
"focusWrap",
|
|
61
61
|
"selectOnMove"
|
|
62
|
-
], i =
|
|
62
|
+
], i = se(t.store, F(e, n), F(o, n)), s = i == null ? void 0 : i.getState(), m = Y({
|
|
63
63
|
...t,
|
|
64
64
|
store: i,
|
|
65
|
-
compositeElementInFocusOrder:
|
|
66
|
-
orientation:
|
|
67
|
-
focusLoop:
|
|
68
|
-
}), { panels:
|
|
69
|
-
...
|
|
70
|
-
selectedId:
|
|
71
|
-
selectOnMove:
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
const { activeId:
|
|
75
|
-
if (!l || !
|
|
76
|
-
const
|
|
77
|
-
|
|
65
|
+
compositeElementInFocusOrder: I(t.compositeElementInFocusOrder, t.includesBaseElement, s == null ? void 0 : s.compositeElementInFocusOrder, s == null ? void 0 : s.includesBaseElement, !1),
|
|
66
|
+
orientation: I(t.orientation, s == null ? void 0 : s.orientation, "horizontal"),
|
|
67
|
+
focusLoop: I(t.focusLoop, s == null ? void 0 : s.focusLoop, !0)
|
|
68
|
+
}), { panels: b, panel: h } = fe(), w = {
|
|
69
|
+
...m.getState(),
|
|
70
|
+
selectedId: I(t.selectedId, s == null ? void 0 : s.selectedId, t.defaultSelectedId),
|
|
71
|
+
selectOnMove: I(t.selectOnMove, s == null ? void 0 : s.selectOnMove, !0)
|
|
72
|
+
}, r = ne(w, m, i);
|
|
73
|
+
k(r, () => f(r, ["moves"], () => {
|
|
74
|
+
const { activeId: a, selectOnMove: l } = r.getState();
|
|
75
|
+
if (!l || !a) return;
|
|
76
|
+
const c = m.item(a);
|
|
77
|
+
S(c) && r.setState("selectedId", c.id);
|
|
78
78
|
}));
|
|
79
|
-
let p = !1,
|
|
80
|
-
|
|
81
|
-
if (p && (p = !1,
|
|
82
|
-
const { activeId:
|
|
83
|
-
if (
|
|
84
|
-
const u = ue(d),
|
|
85
|
-
if (u && x
|
|
86
|
-
|
|
79
|
+
let p = !1, v;
|
|
80
|
+
k(r, () => (p = !1, re(r, ["selectedId"], (a, l) => {
|
|
81
|
+
if (p && (p = !1, a.selectedId === v) || e && a.selectedId === l.selectedId) return;
|
|
82
|
+
const { activeId: c, renderedItems: d } = r.getState();
|
|
83
|
+
if (c === a.selectedId) return;
|
|
84
|
+
const u = ue(d), x = me(d, a.selectedId);
|
|
85
|
+
if (u && S(x)) {
|
|
86
|
+
m.move(x.id);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
}))),
|
|
91
|
-
if (
|
|
92
|
-
const { activeId: l, renderedItems:
|
|
93
|
-
if (
|
|
89
|
+
r.setState("activeId", a.selectedId);
|
|
90
|
+
}))), k(r, () => f(r, ["selectedId", "renderedItems"], (a) => {
|
|
91
|
+
if (a.selectedId !== void 0) return;
|
|
92
|
+
const { activeId: l, renderedItems: c } = r.getState(), d = m.item(l);
|
|
93
|
+
if (S(d)) r.setState("selectedId", d.id);
|
|
94
94
|
else {
|
|
95
|
-
const u =
|
|
96
|
-
|
|
95
|
+
const u = c.find(S);
|
|
96
|
+
r.setState("selectedId", u == null ? void 0 : u.id);
|
|
97
97
|
}
|
|
98
|
-
})),
|
|
99
|
-
const l =
|
|
98
|
+
})), k(r, () => f(r, ["renderedItems"], (a) => {
|
|
99
|
+
const l = a.renderedItems;
|
|
100
100
|
if (l.length)
|
|
101
|
-
return b
|
|
102
|
-
const d =
|
|
103
|
-
d.some((u) => !u.tabId) && d.forEach((u,
|
|
101
|
+
return f(b, ["renderedItems"], (c) => {
|
|
102
|
+
const d = c.renderedItems;
|
|
103
|
+
d.some((u) => !u.tabId) && d.forEach((u, x) => {
|
|
104
104
|
if (u.tabId) return;
|
|
105
|
-
const C = l[
|
|
106
|
-
C &&
|
|
105
|
+
const C = l[x];
|
|
106
|
+
C && b.renderItem({
|
|
107
107
|
...u,
|
|
108
108
|
tabId: C.id
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
}));
|
|
113
|
-
let
|
|
114
|
-
return
|
|
115
|
-
const
|
|
116
|
-
|
|
113
|
+
let _ = null;
|
|
114
|
+
return k(r, () => {
|
|
115
|
+
const a = () => {
|
|
116
|
+
_ = r.getState().selectedId;
|
|
117
117
|
}, l = () => {
|
|
118
|
-
const { selectedId: u } =
|
|
119
|
-
u !==
|
|
120
|
-
},
|
|
121
|
-
if (e && !
|
|
118
|
+
const { selectedId: u } = r.getState();
|
|
119
|
+
u !== _ && (p = !0, v = _, r.setState("selectedId", _));
|
|
120
|
+
}, c = !!e && "setSelectedValue" in e, d = c ? e : o;
|
|
121
|
+
if (e && !c && "setSelectElement" in e) return N(f(e, ["value"], a), f(e, ["mounted"], l));
|
|
122
122
|
if (d)
|
|
123
|
-
return N(
|
|
123
|
+
return N(f(d, ["selectedValue"], a), f(d, ["mounted"], l));
|
|
124
124
|
}), {
|
|
125
|
-
...
|
|
126
|
-
...
|
|
127
|
-
panels:
|
|
128
|
-
panel:
|
|
129
|
-
setSelectedId: (
|
|
130
|
-
select: (
|
|
131
|
-
|
|
125
|
+
...m,
|
|
126
|
+
...r,
|
|
127
|
+
panels: b,
|
|
128
|
+
panel: h,
|
|
129
|
+
setSelectedId: (a) => r.setState("selectedId", a),
|
|
130
|
+
select: (a) => {
|
|
131
|
+
r.setState("selectedId", a), m.move(a);
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
135
|
+
function ge(e, o, t) {
|
|
136
|
+
V(o, [
|
|
137
137
|
t.composite,
|
|
138
138
|
t.combobox,
|
|
139
139
|
o
|
|
140
140
|
]);
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const [i,
|
|
144
|
-
return
|
|
145
|
-
...
|
|
141
|
+
const n = G(e, o, t);
|
|
142
|
+
M(n, t, "selectedId", "setSelectedId"), M(n, t, "selectOnMove");
|
|
143
|
+
const [i, s] = j(() => n.panels, {});
|
|
144
|
+
return V(s, [n, s]), Object.assign(oe(() => ({
|
|
145
|
+
...n,
|
|
146
146
|
panels: i
|
|
147
|
-
}), [
|
|
147
|
+
}), [n, i]), {
|
|
148
148
|
composite: t.composite,
|
|
149
149
|
combobox: t.combobox
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const o = D(), t = de() || o,
|
|
152
|
+
function Xe(e = {}) {
|
|
153
|
+
const o = D(), t = de() || o, n = {
|
|
154
154
|
...e,
|
|
155
155
|
composite: e.composite !== void 0 ? e.composite : t,
|
|
156
156
|
combobox: e.combobox !== void 0 ? e.combobox : o
|
|
157
|
-
}, [i,
|
|
158
|
-
return
|
|
157
|
+
}, [i, s] = j(be, n);
|
|
158
|
+
return ge(i, s, n);
|
|
159
159
|
}
|
|
160
160
|
const y = z.createContext(null);
|
|
161
|
-
function
|
|
161
|
+
function he() {
|
|
162
162
|
const e = z.useContext(y);
|
|
163
163
|
return (e == null ? void 0 : e.orientation) ?? "horizontal";
|
|
164
164
|
}
|
|
@@ -166,30 +166,31 @@ function pe() {
|
|
|
166
166
|
const e = z.useContext(y);
|
|
167
167
|
return (e == null ? void 0 : e.size) || "lg";
|
|
168
168
|
}
|
|
169
|
-
const ve = "
|
|
169
|
+
const ve = "_root_393s0_2", _e = "_dashed_393s0_23", Ie = "_content_393s0_94", ke = "_icon_393s0_101", E = {
|
|
170
170
|
root: ve,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
"size-
|
|
176
|
-
"
|
|
177
|
-
"folder-icon
|
|
178
|
-
"folder-icon-blue
|
|
179
|
-
"folder-icon-
|
|
180
|
-
"folder-icon-green
|
|
181
|
-
"folder-icon-
|
|
182
|
-
"folder-icon-orange
|
|
183
|
-
"folder-icon-
|
|
184
|
-
"folder-icon-pink
|
|
185
|
-
"folder-icon-
|
|
186
|
-
"folder-icon-teal
|
|
187
|
-
"folder-icon-
|
|
188
|
-
"folder-icon-violet
|
|
189
|
-
"folder-icon-
|
|
190
|
-
"folder-icon-warm
|
|
191
|
-
"
|
|
192
|
-
|
|
171
|
+
dashed: _e,
|
|
172
|
+
"orientation-vertical": "_orientation-vertical_393s0_91",
|
|
173
|
+
content: Ie,
|
|
174
|
+
icon: ke,
|
|
175
|
+
"size-lg": "_size-lg_393s0_105",
|
|
176
|
+
"size-md": "_size-md_393s0_112",
|
|
177
|
+
"folder-icon": "_folder-icon_393s0_122",
|
|
178
|
+
"folder-icon-blue": "_folder-icon-blue_393s0_125",
|
|
179
|
+
"folder-icon-blue-active": "_folder-icon-blue-active_393s0_128",
|
|
180
|
+
"folder-icon-green": "_folder-icon-green_393s0_131",
|
|
181
|
+
"folder-icon-green-active": "_folder-icon-green-active_393s0_134",
|
|
182
|
+
"folder-icon-orange": "_folder-icon-orange_393s0_137",
|
|
183
|
+
"folder-icon-orange-active": "_folder-icon-orange-active_393s0_140",
|
|
184
|
+
"folder-icon-pink": "_folder-icon-pink_393s0_143",
|
|
185
|
+
"folder-icon-pink-active": "_folder-icon-pink-active_393s0_146",
|
|
186
|
+
"folder-icon-teal": "_folder-icon-teal_393s0_149",
|
|
187
|
+
"folder-icon-teal-active": "_folder-icon-teal-active_393s0_152",
|
|
188
|
+
"folder-icon-violet": "_folder-icon-violet_393s0_155",
|
|
189
|
+
"folder-icon-violet-active": "_folder-icon-violet-active_393s0_158",
|
|
190
|
+
"folder-icon-warm": "_folder-icon-warm_393s0_161",
|
|
191
|
+
"folder-icon-warm-active": "_folder-icon-warm-active_393s0_164",
|
|
192
|
+
"tab-list": "_tab-list_393s0_170"
|
|
193
|
+
}, we = [
|
|
193
194
|
"angle-left-b",
|
|
194
195
|
"angle-right-b",
|
|
195
196
|
"angle-up",
|
|
@@ -206,7 +207,7 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
206
207
|
"angle-double-right",
|
|
207
208
|
"angle-left",
|
|
208
209
|
"angle-right"
|
|
209
|
-
],
|
|
210
|
+
], xe = [
|
|
210
211
|
"asterisk",
|
|
211
212
|
"info-circle",
|
|
212
213
|
"chart-line",
|
|
@@ -262,13 +263,13 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
262
263
|
"share",
|
|
263
264
|
"bulk",
|
|
264
265
|
"bulk-active"
|
|
265
|
-
],
|
|
266
|
+
], Se = [
|
|
266
267
|
"chat",
|
|
267
268
|
"chat-bubble-user",
|
|
268
269
|
"comment",
|
|
269
270
|
"comment-alt-lines",
|
|
270
271
|
"comment-chart-line"
|
|
271
|
-
],
|
|
272
|
+
], Te = [
|
|
272
273
|
"music",
|
|
273
274
|
"rocket",
|
|
274
275
|
"file-alt",
|
|
@@ -357,7 +358,7 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
357
358
|
"plug",
|
|
358
359
|
"hourglass",
|
|
359
360
|
"focus-target"
|
|
360
|
-
],
|
|
361
|
+
], ze = [
|
|
361
362
|
"play",
|
|
362
363
|
"play-solid",
|
|
363
364
|
"stop-circle-solid",
|
|
@@ -387,7 +388,7 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
387
388
|
"volume-up",
|
|
388
389
|
"volume-mute",
|
|
389
390
|
"closed-captioning"
|
|
390
|
-
],
|
|
391
|
+
], Pe = [
|
|
391
392
|
"icons",
|
|
392
393
|
"package",
|
|
393
394
|
"basketball",
|
|
@@ -463,14 +464,14 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
463
464
|
"redo",
|
|
464
465
|
"play",
|
|
465
466
|
"ban"
|
|
466
|
-
],
|
|
467
|
+
], ye = [
|
|
467
468
|
"folder",
|
|
468
469
|
"folder-open",
|
|
469
470
|
"folder-full",
|
|
470
471
|
"folder-plus",
|
|
471
472
|
"file",
|
|
472
473
|
"image"
|
|
473
|
-
],
|
|
474
|
+
], Ee = [
|
|
474
475
|
"bold",
|
|
475
476
|
"arrow",
|
|
476
477
|
"brackets-curly",
|
|
@@ -496,7 +497,7 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
496
497
|
// (not unicons, original creation)
|
|
497
498
|
"font",
|
|
498
499
|
"underline"
|
|
499
|
-
],
|
|
500
|
+
], Ce = [
|
|
500
501
|
"behance",
|
|
501
502
|
"dribbble",
|
|
502
503
|
"facebook",
|
|
@@ -523,62 +524,75 @@ const ve = "_root_2romh_2", _e = "_content_2romh_61", Ie = "_icon_2romh_68", E =
|
|
|
523
524
|
// (not unicons)
|
|
524
525
|
"medium"
|
|
525
526
|
// (not unicons)
|
|
526
|
-
],
|
|
527
|
-
...we,
|
|
528
|
-
...ke,
|
|
529
|
-
...Ee,
|
|
527
|
+
], Oe = ["symbol", "wttj"], Ne = ["flag-fr", "flag-en", "flag-us"], Ve = [
|
|
530
528
|
...xe,
|
|
531
|
-
...
|
|
532
|
-
...
|
|
533
|
-
...ye,
|
|
529
|
+
...we,
|
|
530
|
+
...Ce,
|
|
534
531
|
...Se,
|
|
532
|
+
...ye,
|
|
533
|
+
...Ne,
|
|
534
|
+
...Ee,
|
|
535
535
|
...Te,
|
|
536
|
-
...
|
|
537
|
-
...
|
|
538
|
-
|
|
539
|
-
|
|
536
|
+
...ze,
|
|
537
|
+
...Oe,
|
|
538
|
+
...Pe
|
|
539
|
+
], Fe = (e) => Ve.includes(e), Me = P(E);
|
|
540
|
+
function $e({
|
|
540
541
|
icon: e,
|
|
541
542
|
iconColor: o,
|
|
542
543
|
isActive: t,
|
|
543
|
-
size:
|
|
544
|
+
size: n
|
|
544
545
|
}) {
|
|
545
546
|
return e ? typeof e != "string" || !Fe(e) ? e : /* @__PURE__ */ g(
|
|
546
547
|
le,
|
|
547
548
|
{
|
|
548
549
|
className: o ? Me("folder-icon", `folder-icon-${o}${t ? "-active" : ""}`) : void 0,
|
|
549
550
|
name: e,
|
|
550
|
-
size:
|
|
551
|
+
size: n
|
|
551
552
|
}
|
|
552
553
|
) : null;
|
|
553
554
|
}
|
|
554
555
|
const T = P(E), L = ie(
|
|
555
|
-
({
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
556
|
+
({
|
|
557
|
+
as: e,
|
|
558
|
+
badge: o,
|
|
559
|
+
badgeVariant: t,
|
|
560
|
+
children: n,
|
|
561
|
+
className: i,
|
|
562
|
+
dashed: s,
|
|
563
|
+
icon: m,
|
|
564
|
+
iconColor: b = "violet",
|
|
565
|
+
id: h,
|
|
566
|
+
store: w,
|
|
567
|
+
...r
|
|
568
|
+
}, p) => {
|
|
569
|
+
const v = pe(), _ = he(), { selectedId: a } = q(w), l = a === h, c = $e({
|
|
570
|
+
icon: m,
|
|
571
|
+
iconColor: b,
|
|
572
|
+
isActive: l,
|
|
573
|
+
size: v
|
|
574
|
+
}), d = l ? "neutral" : t || "warm";
|
|
562
575
|
return /* @__PURE__ */ O(
|
|
563
576
|
W,
|
|
564
577
|
{
|
|
565
578
|
className: T(
|
|
566
579
|
"root",
|
|
567
|
-
`size-${
|
|
568
|
-
|
|
569
|
-
|
|
580
|
+
`size-${v}`,
|
|
581
|
+
_ === "vertical" && "orientation-vertical",
|
|
582
|
+
s && "dashed",
|
|
583
|
+
i
|
|
570
584
|
),
|
|
571
|
-
id:
|
|
572
|
-
ref:
|
|
585
|
+
id: h,
|
|
586
|
+
ref: p,
|
|
573
587
|
render: e ? /* @__PURE__ */ g(e, {}) : void 0,
|
|
574
|
-
store:
|
|
575
|
-
...
|
|
588
|
+
store: w,
|
|
589
|
+
...r,
|
|
576
590
|
children: [
|
|
577
591
|
/* @__PURE__ */ O("span", { className: T("content"), children: [
|
|
578
|
-
|
|
579
|
-
|
|
592
|
+
c ? /* @__PURE__ */ g("span", { className: T("icon"), children: c }) : null,
|
|
593
|
+
n
|
|
580
594
|
] }),
|
|
581
|
-
o ? /* @__PURE__ */ g(
|
|
595
|
+
o ? /* @__PURE__ */ g(ae, { size: v, variant: d, children: o }) : null
|
|
582
596
|
]
|
|
583
597
|
}
|
|
584
598
|
);
|
|
@@ -587,26 +601,26 @@ const T = P(E), L = ie(
|
|
|
587
601
|
L.displayName = "Tabs.Tab";
|
|
588
602
|
const A = B(({ children: e, ...o }, t) => /* @__PURE__ */ g(K, { ref: t, ...o, children: e }));
|
|
589
603
|
A.displayName = "Tabs.Panel";
|
|
590
|
-
const
|
|
591
|
-
({ children: e, className: o, size: t = "lg", store:
|
|
592
|
-
const { orientation:
|
|
604
|
+
const Be = P(E), R = B(
|
|
605
|
+
({ children: e, className: o, size: t = "lg", store: n, ...i }, s) => {
|
|
606
|
+
const { orientation: m } = q(n), b = m === "vertical", h = b ? "vertical" : "horizontal";
|
|
593
607
|
return /* @__PURE__ */ g(
|
|
594
608
|
U,
|
|
595
609
|
{
|
|
596
|
-
className:
|
|
597
|
-
ref:
|
|
598
|
-
store:
|
|
610
|
+
className: Be("tab-list", `size-${t}`, b && "orientation-vertical", o),
|
|
611
|
+
ref: s,
|
|
612
|
+
store: n,
|
|
599
613
|
...i,
|
|
600
|
-
children: /* @__PURE__ */ g(y.Provider, { value: { orientation:
|
|
614
|
+
children: /* @__PURE__ */ g(y.Provider, { value: { orientation: h, size: t }, children: e })
|
|
601
615
|
}
|
|
602
616
|
);
|
|
603
617
|
}
|
|
604
618
|
);
|
|
605
619
|
R.displayName = "Tabs";
|
|
606
|
-
const
|
|
620
|
+
const Ye = Object.assign(R, { Panel: A, Tab: L });
|
|
607
621
|
export {
|
|
608
|
-
|
|
622
|
+
Ye as Tabs,
|
|
609
623
|
R as TabsComponent,
|
|
610
624
|
E as tabsClasses,
|
|
611
|
-
|
|
625
|
+
Xe as useTab
|
|
612
626
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TabPanelProps as AriakitTabPanelProps, TabStore, TabStoreProps } from '@ariakit/react';
|
|
2
2
|
import { IconName } from '../Icon/types';
|
|
3
|
+
import { BadgeProps } from '../Badge/types';
|
|
3
4
|
import { UseTab } from './index';
|
|
4
5
|
export type Size = 'lg' | 'md';
|
|
5
6
|
export type TabListProps = {
|
|
@@ -10,8 +11,10 @@ export type TabListProps = {
|
|
|
10
11
|
};
|
|
11
12
|
export interface TabOptions {
|
|
12
13
|
badge?: number | string;
|
|
14
|
+
badgeVariant?: BadgeProps['variant'];
|
|
13
15
|
children: React.ReactNode;
|
|
14
16
|
className?: string;
|
|
17
|
+
dashed?: boolean;
|
|
15
18
|
icon?: IconName | React.ReactNode;
|
|
16
19
|
iconColor?: 'blue' | 'green' | 'orange' | 'pink' | 'teal' | 'violet' | 'warm';
|
|
17
20
|
id?: string;
|