welcome-ui 10.1.6 → 10.1.7

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/Window.js CHANGED
@@ -3,13 +3,15 @@ import './Window.css';
3
3
  import { jsx as r, jsxs as _ } from "react/jsx-runtime";
4
4
  import { c as d } from "./index-PAaZGbyz.js";
5
5
  import { f as b } from "./forwardRefWithAs-8eP3ZN15.js";
6
- import { forwardRef as l, useState as W } from "react";
7
- import { T as v, a as $, b as B } from "./tab-panel-j7xVgkpE.js";
6
+ import { forwardRef as l, useState as B } from "react";
7
+ import { T as g, a as j, b as A } from "./tab-panel-j7xVgkpE.js";
8
+ import { b as S } from "./Q3KUZPD7-CfUCRwV-.js";
9
+ import { Badge as H } from "./Badge.js";
8
10
  import { Icon as m } from "./Icon.js";
9
- import { Text as h } from "./Text.js";
10
- const g = "_root_1r7a4_2", j = "_header_1r7a4_11", A = "_media_1r7a4_125", c = {
11
- root: g,
12
- header: j,
11
+ import { Text as u } from "./Text.js";
12
+ const I = "_root_1r7a4_2", P = "_header_1r7a4_11", R = "_media_1r7a4_125", c = {
13
+ root: I,
14
+ header: P,
13
15
  "header-title": "_header-title_1r7a4_25",
14
16
  "header-tabs": "_header-tabs_1r7a4_31",
15
17
  "header-tab-item": "_header-tab-item_1r7a4_35",
@@ -17,122 +19,126 @@ const g = "_root_1r7a4_2", j = "_header_1r7a4_11", A = "_media_1r7a4_125", c = {
17
19
  "header-close-button": "_header-close-button_1r7a4_100",
18
20
  "header-actions": "_header-actions_1r7a4_118",
19
21
  "tab-panel": "_tab-panel_1r7a4_122",
20
- media: A,
22
+ media: R,
21
23
  "box-text": "_box-text_1r7a4_126",
22
24
  "size-xl": "_size-xl_1r7a4_141",
23
25
  "size-lg": "_size-lg_1r7a4_145",
24
26
  "size-md": "_size-md_1r7a4_149",
25
27
  "size-sm": "_size-sm_1r7a4_153",
26
28
  "size-xs": "_size-xs_1r7a4_157"
27
- }, H = d(c), u = l(
28
- ({ children: t, className: a, size: e = "md", ...s }, o) => /* @__PURE__ */ r("div", { className: H("body", `size-${e}`, a), ref: o, ...s, children: t })
29
+ }, k = d(c), h = l(
30
+ ({ children: t, className: e, size: a = "md", ...s }, o) => /* @__PURE__ */ r("div", { className: k("body", `size-${a}`, e), ref: o, ...s, children: t })
29
31
  );
30
- u.displayName = "Window.Body";
31
- const P = d(c), x = l(
32
- ({ children: t, className: a, ...e }, s) => /* @__PURE__ */ r("div", { className: P("box-text", a), ref: s, ...e, children: t })
32
+ h.displayName = "Window.Body";
33
+ const L = d(c), p = l(
34
+ ({ children: t, className: e, ...a }, s) => /* @__PURE__ */ r("div", { className: L("box-text", e), ref: s, ...a, children: t })
33
35
  );
34
- x.displayName = "Window.BoxText";
35
- const n = d(c), p = ({
36
+ p.displayName = "Window.BoxText";
37
+ const n = d(c), x = ({
36
38
  "aria-label": t,
37
- className: a,
38
- icon: e,
39
+ className: e,
40
+ icon: a,
39
41
  onClick: s,
40
42
  ...o
41
43
  }) => /* @__PURE__ */ r(
42
44
  "button",
43
45
  {
44
46
  "aria-label": t,
45
- className: n("header-action-button", a),
47
+ className: n("header-action-button", e),
46
48
  onClick: s,
47
49
  type: "button",
48
50
  ...o,
49
- children: /* @__PURE__ */ r(m, { name: e })
51
+ children: /* @__PURE__ */ r(m, { name: a })
50
52
  }
51
53
  ), w = ({
52
54
  as: t,
53
- className: a,
54
- onClick: e
55
+ className: e,
56
+ onClick: a
55
57
  }) => /* @__PURE__ */ r(
56
- p,
58
+ x,
57
59
  {
58
60
  "aria-label": "Close window",
59
61
  as: t,
60
- className: n("header-close-button", a),
62
+ className: n("header-close-button", e),
61
63
  icon: "times",
62
- onClick: e
64
+ onClick: a
63
65
  }
64
- ), R = ({ children: t, store: a }) => /* @__PURE__ */ r($, { className: n("header-tabs"), store: a, children: t }), k = b(
65
- ({ as: t, children: a, icon: e, id: s, store: o, ...i }, T) => /* @__PURE__ */ _(
66
- v,
67
- {
68
- className: n("header-tab-item"),
69
- id: s,
70
- ref: T,
71
- render: t ? /* @__PURE__ */ r(t, {}) : void 0,
72
- store: o,
73
- ...i,
74
- children: [
75
- e ? /* @__PURE__ */ r(m, { name: e }) : null,
76
- /* @__PURE__ */ r(h, { variant: "label-sm", children: a })
77
- ]
78
- },
79
- s
80
- )
81
- ), I = ({ children: t, isClosable: a = !1, onClose: e }) => {
66
+ ), M = ({ children: t, store: e }) => /* @__PURE__ */ r(j, { className: n("header-tabs"), store: e, children: t }), O = b(
67
+ ({ as: t, badge: e, children: a, icon: s, id: o, store: i, ...T }, v) => {
68
+ const { selectedId: W } = S(i), $ = W === o;
69
+ return /* @__PURE__ */ _(
70
+ g,
71
+ {
72
+ className: n("header-tab-item"),
73
+ id: o,
74
+ ref: v,
75
+ render: t ? /* @__PURE__ */ r(t, {}) : void 0,
76
+ store: i,
77
+ ...T,
78
+ children: [
79
+ s ? /* @__PURE__ */ r(m, { name: s }) : null,
80
+ /* @__PURE__ */ r(u, { variant: "label-sm", children: a }),
81
+ e ? /* @__PURE__ */ r(H, { variant: $ ? "neutral" : "warm", children: e }) : null
82
+ ]
83
+ },
84
+ o
85
+ );
86
+ }
87
+ ), E = ({ children: t, isClosable: e = !1, onClose: a }) => {
82
88
  const s = () => {
83
- e == null || e();
89
+ a == null || a();
84
90
  };
85
91
  return /* @__PURE__ */ _("div", { className: n("header-actions"), children: [
86
92
  t,
87
- a ? /* @__PURE__ */ r(w, { onClick: s }) : null
93
+ e ? /* @__PURE__ */ r(w, { onClick: s }) : null
88
94
  ] });
89
- }, L = ({ isExpandable: t = !1, onExpandChange: a }) => {
90
- const [e, s] = W(!1), o = () => {
91
- const i = !e;
92
- s(i), a == null || a(i);
95
+ }, q = ({ isExpandable: t = !1, onExpandChange: e }) => {
96
+ const [a, s] = B(!1), o = () => {
97
+ const i = !a;
98
+ s(i), e == null || e(i);
93
99
  };
94
100
  return /* @__PURE__ */ r("div", { className: n("header-actions"), children: t ? /* @__PURE__ */ r(
95
101
  "button",
96
102
  {
97
- "aria-expanded": e,
98
- "aria-label": e ? "Collapse window" : "Expand window",
103
+ "aria-expanded": a,
104
+ "aria-label": a ? "Collapse window" : "Expand window",
99
105
  className: n("header-action-button"),
100
106
  onClick: o,
101
107
  type: "button",
102
- children: /* @__PURE__ */ r(m, { name: e ? "compress-alt" : "arrow-resize-diagonal" })
108
+ children: /* @__PURE__ */ r(m, { name: a ? "compress-alt" : "arrow-resize-diagonal" })
103
109
  }
104
110
  ) : null });
105
- }, M = ({ as: t, className: a, title: e }) => /* @__PURE__ */ r(h, { as: t, className: n("header-title", a), variant: "body-md-strong", children: e }), N = l(
106
- ({ children: t, className: a, ...e }, s) => /* @__PURE__ */ r("header", { className: n("header", a), ref: s, ...e, children: t })
111
+ }, D = ({ as: t, className: e, title: a }) => /* @__PURE__ */ r(u, { as: t, className: n("header-title", e), variant: "body-md-strong", children: a }), N = l(
112
+ ({ children: t, className: e, ...a }, s) => /* @__PURE__ */ r("header", { className: n("header", e), ref: s, ...a, children: t })
107
113
  );
108
114
  N.displayName = "Window.Header";
109
- const O = Object.assign(N, {
110
- Button: p,
115
+ const F = Object.assign(N, {
116
+ Button: x,
111
117
  CloseButton: w,
112
- LeftActions: L,
113
- RightActions: I,
114
- Tab: k,
115
- Tabs: R,
116
- Title: M
117
- }), S = d(c), f = l(
118
- ({ children: t, className: a, ...e }, s) => /* @__PURE__ */ r("div", { className: S("media", a), ref: s, ...e, children: t })
118
+ LeftActions: q,
119
+ RightActions: E,
120
+ Tab: O,
121
+ Tabs: M,
122
+ Title: D
123
+ }), G = d(c), f = l(
124
+ ({ children: t, className: e, ...a }, s) => /* @__PURE__ */ r("div", { className: G("media", e), ref: s, ...a, children: t })
119
125
  );
120
126
  f.displayName = "Window.Media";
121
- const E = d(c), y = l(
122
- ({ children: t, store: a, tabId: e, ...s }, o) => /* @__PURE__ */ r(B, { className: E("tab-panel"), ref: o, store: a, tabId: e, ...s, children: t })
127
+ const J = d(c), y = l(
128
+ ({ children: t, store: e, tabId: a, ...s }, o) => /* @__PURE__ */ r(A, { className: J("tab-panel"), ref: o, store: e, tabId: a, ...s, children: t })
123
129
  );
124
130
  y.displayName = "Window.TabPanel";
125
- const q = d(c), z = b(
126
- ({ as: t = "div", children: a, className: e, role: s = "region", ...o }, i) => /* @__PURE__ */ r(t, { className: q("root", e), ref: i, role: s, ...o, children: a })
131
+ const K = d(c), z = b(
132
+ ({ as: t = "div", children: e, className: a, role: s = "region", ...o }, i) => /* @__PURE__ */ r(t, { className: K("root", a), ref: i, role: s, ...o, children: e })
127
133
  );
128
134
  z.displayName = "Window";
129
- const V = Object.assign(z, {
130
- Body: u,
131
- BoxText: x,
132
- Header: O,
135
+ const te = Object.assign(z, {
136
+ Body: h,
137
+ BoxText: p,
138
+ Header: F,
133
139
  Media: f,
134
140
  TabPanel: y
135
141
  });
136
142
  export {
137
- V as Window
143
+ te as Window
138
144
  };
@@ -24,6 +24,7 @@ export interface HeaderRightActionsOptions {
24
24
  }
25
25
  export type HeaderRightActionsProps = MergeProps<PropsWithChildren<HTMLAttributes<HTMLDivElement>>, HeaderRightActionsOptions>;
26
26
  export type HeaderTabItem = TabProps & {
27
+ badge?: number | React.ReactElement | string;
27
28
  icon?: IconName;
28
29
  id: string;
29
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "10.1.6",
3
+ "version": "10.1.7",
4
4
  "description": "Customizable design system with react, typescript, tailwindcss and ariakit.",
5
5
  "files": [
6
6
  "dist"