welcome-ui 7.1.1 → 7.2.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/README.md CHANGED
@@ -72,19 +72,13 @@ export default function Root() {
72
72
  yarn
73
73
  ```
74
74
 
75
- 2. Start a watch on all packages to rebuild them easily
75
+ 2. Start documentation website
76
76
 
77
77
  ```bash
78
78
  yarn start
79
79
  ```
80
80
 
81
- 3. Start documentation website
82
-
83
- ```bash
84
- yarn website
85
- ```
86
-
87
- 4. and go to http://localhost:3020
81
+ 3. and go to http://localhost:3020
88
82
 
89
83
  ## How to release
90
84
 
@@ -19,16 +19,16 @@ const w = r.div`
19
19
  ${o("accordions.icon")};
20
20
  transform: rotate3d(0);
21
21
  transition: medium;
22
- width: 24;
23
- height: 24;
22
+ width: 32;
23
+ height: 32;
24
24
  color: inherit;
25
25
  display: flex;
26
- border-radius: 12;
26
+ border-radius: 16;
27
27
 
28
28
  & *:first-child {
29
29
  margin: auto;
30
30
  }
31
- `, x = r(p)`
31
+ `, E = r(p)`
32
32
  ${o("accordions.title")};
33
33
  width: 100%;
34
34
  padding: ${o("accordions.padding")};
@@ -37,7 +37,7 @@ const w = r.div`
37
37
  display: flex;
38
38
  justify-content: space-between;
39
39
  align-items: center;
40
- gap: xxl;
40
+ gap: lg;
41
41
 
42
42
  &[aria-expanded='true'] {
43
43
  ${n} {
@@ -59,7 +59,7 @@ const w = r.div`
59
59
  color: inherit;
60
60
  }
61
61
  }
62
- `, E = r(f)`
62
+ `, v = r(f)`
63
63
  display: grid;
64
64
  grid-template-rows: 0fr;
65
65
  transition-property: grid-template-rows;
@@ -75,13 +75,13 @@ const w = r.div`
75
75
  &[data-enter] {
76
76
  grid-template-rows: 1fr;
77
77
  }
78
- `, v = r.div`
78
+ `, y = r.div`
79
79
  ${o("accordions.content")};
80
80
  padding: ${o("accordions.padding")};
81
81
  padding-top: 0;
82
82
  color: neutral-70;
83
83
  `, A = $(
84
- ({ children: i, dataTestId: e, icon: c = /* @__PURE__ */ t.createElement(h, null), store: a, title: d, ...s }, l) => /* @__PURE__ */ t.createElement(w, { "data-testid": e, ref: l, ...s }, /* @__PURE__ */ t.createElement(x, { "data-testid": e ? `${e}-title` : void 0, store: a }, d, /* @__PURE__ */ t.createElement(n, null, m(c, { size: "sm" }))), /* @__PURE__ */ t.createElement(E, { "data-testid": e ? `${e}-content` : void 0, store: a }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement(v, null, i))))
84
+ ({ children: i, dataTestId: e, icon: c = /* @__PURE__ */ t.createElement(h, null), store: a, title: d, ...s }, l) => /* @__PURE__ */ t.createElement(w, { "data-testid": e, ref: l, ...s }, /* @__PURE__ */ t.createElement(E, { "data-testid": e ? `${e}-title` : void 0, store: a }, d, /* @__PURE__ */ t.createElement(n, null, m(c, { size: "sm" }))), /* @__PURE__ */ t.createElement(v, { "data-testid": e ? `${e}-content` : void 0, store: a }, /* @__PURE__ */ t.createElement("div", null, /* @__PURE__ */ t.createElement(y, null, i))))
85
85
  );
86
86
  function j(i) {
87
87
  return g({ animated: !0, ...i });
package/dist/Alert.mjs CHANGED
@@ -1,91 +1,107 @@
1
1
  "use client";
2
- import r, { Children as E, cloneElement as i } from "react";
3
- import c, { css as m, th as l, system as B } from "@xstyled/styled-components";
2
+ import a, { Children as B, cloneElement as m } from "react";
3
+ import f, { css as c, th as o, system as w } from "@xstyled/styled-components";
4
4
  import { Text as D } from "./Text.mjs";
5
- import { VariantIcon as R } from "./VariantIcon.mjs";
6
- import { CloseButton as O } from "./CloseButton.mjs";
7
- import { Button as w } from "./Button.mjs";
8
- import { forwardRef as d } from "./System.mjs";
9
- import { Box as p } from "./Box.mjs";
10
- const $ = c.divBox`
5
+ import { VariantIcon as O } from "./VariantIcon.mjs";
6
+ import { CloseButton as h } from "./CloseButton.mjs";
7
+ import { Button as A } from "./Button.mjs";
8
+ import { forwardRef as $ } from "./System.mjs";
9
+ import { Box as E } from "./Box.mjs";
10
+ const d = f.divBox`
11
+ display: flex;
12
+ gap: md;
13
+ flex-direction: column;
14
+ justify-content: space-between;
15
+ align-items: flex-start;
11
16
  flex: 1;
12
- `, A = c(R)`
17
+ `, b = f(O)`
13
18
  position: absolute;
14
19
  align-self: flex-start;
15
- `, q = c.divBox(({ icon: e, isFullWidth: n, size: o, variant: s }) => m`
20
+ `, q = f.divBox(({ icon: n, isFullWidth: r, size: e, variant: s }) => c`
16
21
  position: relative;
17
22
  display: flex;
18
23
  align-items: flex-start;
19
24
  width: 100%;
20
- max-width: ${n ? "100%" : "max-content"};
21
- ${l("alerts.default")};
22
- ${l(`alerts.${s}`)};
23
- ${l(`alerts.sizes.${o}`)};
24
- ${B};
25
+ max-width: ${r ? "100%" : "max-content"};
26
+ ${o("alerts.default")};
27
+ ${o(`alerts.${s}`)};
28
+ ${o(`alerts.sizes.${e}`)};
29
+ ${w};
25
30
 
26
- ${e !== null && o === "sm" && m`
27
- ${$} {
28
- margin-left: calc(${l("icons.sm")} + ${l("space.md")});
31
+ ${n !== null && e === "sm" && c`
32
+ ${d} {
33
+ margin-left: calc(${o("icons.sm")} + ${o("space.md")});
29
34
  }
30
35
  `}
31
36
 
32
- ${e !== null && o === "md" && m`
33
- ${$} {
34
- margin-left: calc(${l("icons.md")} + ${l("space.lg")});
37
+ ${n !== null && e === "md" && c`
38
+ ${d} {
39
+ margin-left: calc(${o("icons.md")} + ${o("space.lg")});
40
+ gap: ${o("space.lg")};
41
+ font-size: ${o("fontSizes.md")};
35
42
  }
36
43
 
37
- ${A} {
44
+ ${b} {
38
45
  margin-top: -3;
39
46
  }
40
47
  `}
41
- `), F = c(D)(({ variant: e }) => m`
48
+ `), F = f(D)(({ variant: n }) => c`
42
49
  font-weight: medium;
43
- ${l("alerts.title.default")};
44
- ${l(`alerts.title.sizes.${e}`)};
45
- ${B};
46
- `), b = ({ children: e, dataTestId: n, variant: o }) => /* @__PURE__ */ r.createElement(F, { "data-testid": n, variant: o }, e), G = d(
50
+ ${o("alerts.title.default")};
51
+ ${o(`alerts.title.sizes.${n}`)};
52
+ ${w};
53
+ `), S = ({ children: n, dataTestId: r, variant: e }) => /* @__PURE__ */ a.createElement(F, { "data-testid": r, variant: e }, n), G = $(
47
54
  ({
48
- children: e,
49
- cta: n,
50
- dataTestId: o,
55
+ children: n,
56
+ cta: r,
57
+ dataTestId: e,
51
58
  handleClose: s,
52
- icon: f,
53
- isFullWidth: I,
54
- size: a = "sm",
55
- variant: u = "default",
56
- ...S
57
- }, _) => {
58
- const k = o ? `${o}-close-button` : void 0, T = u === "beige" ? "default" : u, V = E.toArray(e).map((t) => t.type === b ? i(t, { variant: a }) : t), x = (t) => {
59
+ icon: u,
60
+ isFullWidth: _,
61
+ size: l = "sm",
62
+ variant: i = "default",
63
+ ...k
64
+ }, v) => {
65
+ const T = e ? `${e}-close-button` : void 0, V = i === "beige" ? "default" : i, p = i === "ai", j = B.toArray(n).map((t) => t.type === S ? m(t, { variant: l }) : t), x = (t) => {
59
66
  var y;
60
67
  if (t) {
61
- if (t.type === v) return i(t, { size: a });
62
- if (t.type === C) return i(t, { size: a });
68
+ if (t.type === C)
69
+ return m(t, {
70
+ size: l,
71
+ ai: p,
72
+ variant: p ? "primary" : void 0
73
+ });
74
+ if (t.type === I)
75
+ return m(t, {
76
+ size: l,
77
+ ai: p
78
+ });
63
79
  if ((y = t.props) != null && y.children)
64
- return i(t, {
80
+ return m(t, {
65
81
  ...t.props,
66
- children: E.map(
82
+ children: B.map(
67
83
  t.props.children,
68
- (j) => x(j)
84
+ (R) => x(R)
69
85
  )
70
86
  });
71
87
  }
72
88
  return t;
73
- }, g = r.isValidElement(n) ? x(n) : n;
74
- return /* @__PURE__ */ r.createElement(
89
+ }, g = a.isValidElement(r) ? x(r) : r;
90
+ return /* @__PURE__ */ a.createElement(
75
91
  q,
76
92
  {
77
- "data-testid": o,
78
- icon: f,
79
- isFullWidth: I,
80
- ref: _,
81
- size: a,
82
- variant: u,
83
- ...S
93
+ "data-testid": e,
94
+ icon: u,
95
+ isFullWidth: _,
96
+ ref: v,
97
+ size: l,
98
+ variant: i,
99
+ ...k
84
100
  },
85
- !!s && /* @__PURE__ */ r.createElement(
86
- O,
101
+ !!s && /* @__PURE__ */ a.createElement(
102
+ h,
87
103
  {
88
- dataTestId: k,
104
+ dataTestId: T,
89
105
  onClick: s,
90
106
  position: "absolute",
91
107
  right: "sm",
@@ -93,27 +109,18 @@ const $ = c.divBox`
93
109
  top: "sm"
94
110
  }
95
111
  ),
96
- f !== null && /* @__PURE__ */ r.createElement(A, { icon: f, size: a, variant: T }),
97
- /* @__PURE__ */ r.createElement($, null, /* @__PURE__ */ r.createElement(
98
- p,
99
- {
100
- alignItems: "flex-start",
101
- display: "flex",
102
- flexDirection: "column",
103
- gap: "md",
104
- justifyContent: "space-between"
105
- },
106
- /* @__PURE__ */ r.createElement(p, { flex: 1 }, V),
107
- !!g && /* @__PURE__ */ r.createElement(p, { alignItems: "center", display: "flex", gap: "sm" }, g)
108
- ))
112
+ u !== null && /* @__PURE__ */ a.createElement(b, { icon: u, size: l, variant: V }),
113
+ /* @__PURE__ */ a.createElement(d, null, /* @__PURE__ */ a.createElement(E, { flex: 1 }, j), !!g && /* @__PURE__ */ a.createElement(E, { alignItems: "center", display: "flex", gap: "sm" }, g))
109
114
  );
110
115
  }
111
- ), v = d((e, n) => /* @__PURE__ */ r.createElement(w, { flexShrink: 0, ref: n, w: "fit-content", ...e, variant: "secondary" })), C = d(
112
- (e, n) => /* @__PURE__ */ r.createElement(w, { flexShrink: 0, ref: n, w: "fit-content", ...e, variant: "tertiary" })
116
+ ), C = $(
117
+ ({ variant: n = "secondary", ...r }, e) => /* @__PURE__ */ a.createElement(A, { flexShrink: 0, ref: e, w: "fit-content", ...r, variant: n })
118
+ ), I = $(
119
+ ({ variant: n = "tertiary", ...r }, e) => /* @__PURE__ */ a.createElement(A, { flexShrink: 0, ref: e, w: "fit-content", ...r, variant: n })
113
120
  ), U = Object.assign(G, {
114
- Title: b,
115
- Button: v,
116
- SecondaryButton: C
121
+ Title: S,
122
+ Button: C,
123
+ SecondaryButton: I
117
124
  });
118
125
  export {
119
126
  U as Alert
package/dist/Button.mjs CHANGED
@@ -1,21 +1,24 @@
1
1
  "use client";
2
2
  import r from "react";
3
- import h, { css as i, th as t, system as b } from "@xstyled/styled-components";
4
- import { B as p } from "./X5NMLKT6-uFSu0Lii.mjs";
5
- import { h as y } from "./hide-focus-rings-root-BNyva1yb.mjs";
6
- import { shouldForwardProp as w, forwardRef as g } from "./System.mjs";
7
- import { Loader as x } from "./Loader.mjs";
8
- import { Box as d } from "./Box.mjs";
9
- const B = (e, s = "square") => i`
10
- width: ${t(`buttons.sizes.${e}.height`)};
3
+ import h, { css as e, th as t, system as p } from "@xstyled/styled-components";
4
+ import { B as y } from "./X5NMLKT6-uFSu0Lii.mjs";
5
+ import { h as w } from "./hide-focus-rings-root-BNyva1yb.mjs";
6
+ import { shouldForwardProp as g, forwardRef as x } from "./System.mjs";
7
+ import { Loader as B } from "./Loader.mjs";
8
+ import { Box as c } from "./Box.mjs";
9
+ const E = (i, s = "square") => e`
10
+ width: ${t(`buttons.sizes.${i}.height`)};
11
11
  padding: 0;
12
- ${s === "circle" && i`
13
- border-radius: ${t(`buttons.sizes.${e}.height`)};
12
+ ${s === "circle" && e`
13
+ border-radius: ${t(`buttons.sizes.${i}.height`)};
14
14
  `};
15
- `, a = h(p).withConfig({ shouldForwardProp: w })(
16
- ({ danger: e, disabled: s, shape: l, size: n = "md", variant: o = "primary" }) => i`
15
+ `, d = h(y).withConfig({ shouldForwardProp: g })(
16
+ ({ ai: i, danger: s, disabled: u, shape: $, size: n = "md", variant: o = "primary" }) => e`
17
17
  ${t(`buttons.${o}`)};
18
- ${e && i`
18
+ ${i && e`
19
+ ${t(`buttons.ai.${o}`)};
20
+ `}
21
+ ${s && e`
19
22
  ${t(`buttons.danger.${o}`)};
20
23
  `}
21
24
  position: relative;
@@ -34,8 +37,8 @@ const B = (e, s = "square") => i`
34
37
  appearance: none;
35
38
  overflow: hidden;
36
39
  transition: medium;
37
- ${l && B(n, l)};
38
- ${b};
40
+ ${$ && E(n, $)};
41
+ ${p};
39
42
 
40
43
  & > svg.wui-icon,
41
44
  & > i.wui-icon-font {
@@ -57,25 +60,34 @@ const B = (e, s = "square") => i`
57
60
  margin-right: sm;
58
61
  }
59
62
 
60
- ${!s && i`
61
- [${y}] &:focus {
63
+ ${!u && e`
64
+ [${w}] &:focus {
62
65
  box-shadow: none;
63
66
  }
64
67
  &:focus {
65
68
  ${t(`buttons.focus.${o}`)};
66
- ${e && i`
69
+ ${i && e`
70
+ ${t(`buttons.focus.ai.${o}`)};
71
+ `}
72
+ ${s && e`
67
73
  ${t(`buttons.focus.danger.${o}`)};
68
74
  `}
69
75
  }
70
76
  &:hover {
71
77
  ${t(`buttons.hover.${o}`)};
72
- ${e && i`
78
+ ${i && e`
79
+ ${t(`buttons.hover.ai.${o}`)};
80
+ `}
81
+ ${s && e`
73
82
  ${t(`buttons.hover.danger.${o}`)};
74
83
  `}
75
84
  }
76
85
  &:active {
77
86
  ${t(`buttons.active.${o}`)};
78
- ${e && i`
87
+ ${i && e`
88
+ ${t(`buttons.active.ai.${o}`)};
89
+ `}
90
+ ${s && e`
79
91
  ${t(`buttons.active.danger.${o}`)};
80
92
  `}
81
93
  }
@@ -85,32 +97,34 @@ const B = (e, s = "square") => i`
85
97
  cursor: not-allowed;
86
98
  }
87
99
  `
88
- ), E = g(
100
+ ), _ = x(
89
101
  ({
90
- children: e,
91
- danger: s,
92
- dataTestId: l,
102
+ ai: i,
103
+ children: s,
104
+ danger: u,
105
+ dataTestId: $,
93
106
  disabled: n,
94
107
  isLoading: o,
95
- size: c = "md",
96
- variant: $ = "primary",
97
- ...m
98
- }, f) => {
99
- const u = n || o;
108
+ size: a = "md",
109
+ variant: m = "primary",
110
+ ...f
111
+ }, b) => {
112
+ const l = n || o;
100
113
  return /* @__PURE__ */ r.createElement(
101
- a,
114
+ d,
102
115
  {
103
- danger: s,
116
+ ai: i,
117
+ danger: u,
104
118
  "data-loading": o,
105
- "data-testid": l,
106
- disabled: u,
107
- ref: f,
108
- size: c,
109
- variant: u ? "disabled" : $,
110
- ...m
119
+ "data-testid": $,
120
+ disabled: l,
121
+ ref: b,
122
+ size: a,
123
+ variant: l ? "disabled" : m,
124
+ ...f
111
125
  },
112
126
  o && /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement(
113
- d,
127
+ c,
114
128
  {
115
129
  alignItems: "center",
116
130
  bottom: 0,
@@ -122,15 +136,15 @@ const B = (e, s = "square") => i`
122
136
  right: 0,
123
137
  top: 0
124
138
  },
125
- /* @__PURE__ */ r.createElement(x, { size: "xs" })
126
- ), /* @__PURE__ */ r.createElement(d, { opacity: "0" }, e)),
127
- !o && e
139
+ /* @__PURE__ */ r.createElement(B, { size: "xs" })
140
+ ), /* @__PURE__ */ r.createElement(c, { opacity: "0" }, s)),
141
+ !o && s
128
142
  );
129
143
  }
130
144
  );
131
- E.displayName = "Button";
132
- const S = a;
145
+ _.displayName = "Button";
146
+ const q = d;
133
147
  export {
134
- E as Button,
135
- S as StyledButton
148
+ _ as Button,
149
+ q as StyledButton
136
150
  };