welcome-ui 10.0.0 → 10.0.2

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/Alert.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import './Alert.css';
3
3
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
4
- import m, { forwardRef as E, Children as g, cloneElement as u } from "react";
5
- import { CloseButton as R } from "./CloseButton.js";
6
- import { Icon as V } from "./Icon.js";
4
+ import m, { forwardRef as R, Children as g, cloneElement as u } from "react";
5
+ import { CloseButton as V } from "./CloseButton.js";
6
+ import { Icon as I } from "./Icon.js";
7
7
  import { Text as A } from "./Text.js";
8
8
  import { c as b } from "./index-PAaZGbyz.js";
9
9
  import { Button as h } from "./Button.js";
10
10
  import { f as x } from "./forwardRefWithAs-8eP3ZN15.js";
11
- const I = "_root_3i41g_2", O = "_content_3i41g_21", B = {
12
- root: I,
11
+ const O = "_root_3i41g_2", z = "_content_3i41g_21", B = {
12
+ root: O,
13
13
  "size-md": "_size-md_3i41g_18",
14
14
  "content-actions": "_content-actions_3i41g_21",
15
15
  "without-title": "_without-title_3i41g_24",
@@ -21,7 +21,7 @@ const I = "_root_3i41g_2", O = "_content_3i41g_21", B = {
21
21
  "variant-success": "_variant-success_3i41g_49",
22
22
  "variant-warning": "_variant-warning_3i41g_54",
23
23
  "full-width": "_full-width_3i41g_59",
24
- content: O,
24
+ content: z,
25
25
  "content-text": "_content-text_3i41g_71",
26
26
  "title-close-button": "_title-close-button_3i41g_88",
27
27
  "title-with-icon": "_title-with-icon_3i41g_91",
@@ -32,49 +32,59 @@ const I = "_root_3i41g_2", O = "_content_3i41g_21", B = {
32
32
  "icon-wrapper-warning": "_icon-wrapper-warning_3i41g_125",
33
33
  "icon-wrapper-ai": "_icon-wrapper-ai_3i41g_129"
34
34
  }, f = x(
35
- ({ variant: n = "primary", ...r }, i) => /* @__PURE__ */ a(h, { className: "shrink-0 w-fit", ref: i, variant: n, ...r })
35
+ ({ variant: n = "primary", ...r }, e) => /* @__PURE__ */ a(h, { className: "shrink-0 w-fit", ref: e, variant: n, ...r })
36
36
  ), w = x(
37
- ({ variant: n = "secondary", ...r }, i) => /* @__PURE__ */ a(h, { className: "shrink-0 w-fit", ref: i, variant: n, ...r })
37
+ ({ variant: n = "secondary", ...r }, e) => /* @__PURE__ */ a(h, { className: "shrink-0 w-fit", ref: e, variant: n, ...r })
38
38
  );
39
39
  f.displayName = "Alert.Button";
40
40
  w.displayName = "Alert.SecondaryButton";
41
- const z = b(B), _ = ({ children: n, hasCloseButton: r, ...i }) => /* @__PURE__ */ a(A, { as: "span", className: z(r && "title-close-button"), ...i, children: n });
41
+ const F = b(B), _ = ({ children: n, hasCloseButton: r, ...e }) => /* @__PURE__ */ a(A, { as: "span", className: F(r && "title-close-button"), ...e, children: n });
42
42
  _.displayName = "Alert.Title";
43
- const o = b(B), F = {
43
+ const o = b(B), M = {
44
44
  ai: "sparkles",
45
45
  brand: "lightbulb-alt",
46
46
  danger: "exclamation-octagon",
47
47
  info: "info-circle",
48
48
  success: "check-circle",
49
49
  warning: "exclamation-triangle"
50
- }, $ = E(
51
- ({ children: n, className: r, cta: i, handleClose: p, isFullWidth: k, size: s = "md", variant: c = "brand", ...T }, C) => {
52
- const S = c === "ai", d = g.toArray(n).some((e) => m.isValidElement(e) ? e.type === _ : !1), y = /* @__PURE__ */ a("div", { className: o("icon-wrapper", `icon-wrapper-${c}`), children: /* @__PURE__ */ a(V, { name: F[c] }) }), j = g.toArray(n).map((e, t) => e.type === _ ? /* @__PURE__ */ l("div", { className: o("title-with-icon"), children: [
50
+ }, $ = R(
51
+ ({
52
+ children: n,
53
+ className: r,
54
+ cta: e,
55
+ handleClose: p,
56
+ icon: k,
57
+ isFullWidth: T,
58
+ size: s = "md",
59
+ variant: c = "brand",
60
+ ...C
61
+ }, E) => {
62
+ const S = c === "ai", d = g.toArray(n).some((i) => m.isValidElement(i) ? i.type === _ : !1), y = /* @__PURE__ */ a("div", { className: o("icon-wrapper", `icon-wrapper-${c}`), children: /* @__PURE__ */ a(I, { name: k || M[c] }) }), j = g.toArray(n).map((i, t) => i.type === _ ? /* @__PURE__ */ l("div", { className: o("title-with-icon"), children: [
53
63
  y,
54
- u(e, {
64
+ u(i, {
55
65
  hasCloseButton: !!p,
56
66
  variant: `body-${s}-strong`
57
67
  })
58
- ] }, `alert-title-${t}`) : e), v = (e) => g.toArray(e).flatMap((t) => m.isValidElement(t) && t.type === m.Fragment ? v(t.props.children) : t.type === f ? u(t, {
68
+ ] }, `alert-title-${t}`) : i), v = (i) => g.toArray(i).flatMap((t) => m.isValidElement(t) && t.type === m.Fragment ? v(t.props.children) : t.type === f ? u(t, {
59
69
  size: s,
60
70
  variant: S ? "primary-ai" : void 0
61
71
  }) : t.type === w ? u(t, {
62
72
  size: s
63
- }) : t), N = !!i && v(i);
73
+ }) : t), N = !!e && v(e);
64
74
  return /* @__PURE__ */ l(
65
75
  "div",
66
76
  {
67
77
  className: o(
68
78
  "root",
69
- k && "full-width",
79
+ T && "full-width",
70
80
  `size-${s}`,
71
81
  c && `variant-${c}`,
72
82
  r
73
83
  ),
74
- ref: C,
75
- ...T,
84
+ ref: E,
85
+ ...C,
76
86
  children: [
77
- !!p && /* @__PURE__ */ a(R, { className: o("close-button"), onClick: p }),
87
+ !!p && /* @__PURE__ */ a(V, { className: o("close-button"), onClick: p }),
78
88
  /* @__PURE__ */ l("div", { className: o("content"), children: [
79
89
  /* @__PURE__ */ l(
80
90
  A,
@@ -96,12 +106,12 @@ const o = b(B), F = {
96
106
  }
97
107
  );
98
108
  $.displayName = "Alert";
99
- const L = Object.assign($, {
109
+ const P = Object.assign($, {
100
110
  Button: f,
101
111
  SecondaryButton: w,
102
112
  Title: _
103
113
  });
104
114
  export {
105
- L as Alert,
106
- F as ICON
115
+ P as Alert,
116
+ M as ICON
107
117
  };
package/dist/Field.css CHANGED
@@ -1 +1 @@
1
- @layer components{._root_17n7f_2{display:grid;grid-template-areas:"label" "input";width:100%}._root_17n7f_2:has(._label_17n7f_7):has(._hint_17n7f_7){grid-template-areas:"label" "input" "hint"}._root_17n7f_2:not(:has(._label_17n7f_7)):has(._hint_17n7f_7){grid-template-areas:"input" "hint"}._root_17n7f_2:not(._inline_17n7f_13) ._hint_17n7f_7{margin-top:var(--field-gap-assistive)}._root_17n7f_2:not(._inline_17n7f_13) ._label_17n7f_7{margin-bottom:var(--field-gap-label)}._root_17n7f_2 .field-input{align-self:center;grid-area:input}._root_17n7f_2 .field-input.date-picker-wrapper{justify-self:start}._inline_17n7f_13{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--field-gap-assistive);grid-column-gap:var(--field-gap-label)}._inline_17n7f_13:has(._label_17n7f_7):has(._hint_17n7f_7){grid-template-areas:"input label" ". hint"}._inline_17n7f_13:not(:has(._label_17n7f_7)):has(._hint_17n7f_7){grid-template-areas:"input ." ". hint"}._label_17n7f_7{grid-area:label}._hint_17n7f_7{grid-area:hint}._hint-max-length_17n7f_45{justify-self:end}._visuallyHidden_17n7f_48{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}
1
+ @layer components{._root_1sq1k_2{display:grid;grid-template-areas:"label" "input";width:100%;height:fit-content}._root_1sq1k_2:has(._label_1sq1k_8):has(._hint_1sq1k_8){grid-template-areas:"label" "input" "hint"}._root_1sq1k_2:not(:has(._label_1sq1k_8)):has(._hint_1sq1k_8){grid-template-areas:"input" "hint"}._root_1sq1k_2:not(._inline_1sq1k_14) ._hint_1sq1k_8{margin-top:var(--field-gap-assistive)}._root_1sq1k_2:not(._inline_1sq1k_14) ._label_1sq1k_8{margin-bottom:var(--field-gap-label)}._root_1sq1k_2 .field-input{align-self:center;grid-area:input}._root_1sq1k_2 .field-input.date-picker-wrapper{justify-self:start}._inline_1sq1k_14{grid-template-areas:"input label";grid-template-columns:min-content 1fr;height:fit-content;grid-row-gap:var(--field-gap-assistive);grid-column-gap:var(--field-gap-label)}._inline_1sq1k_14:has(._label_1sq1k_8):has(._hint_1sq1k_8){grid-template-areas:"input label" ". hint"}._inline_1sq1k_14:not(:has(._label_1sq1k_8)):has(._hint_1sq1k_8){grid-template-areas:"input ." ". hint"}._label_1sq1k_8{grid-area:label}._hint_1sq1k_8{grid-area:hint}._hint-max-length_1sq1k_46{justify-self:end}._visuallyHidden_1sq1k_49{border:0!important;clip:rect(0 0 0 0)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}}
package/dist/Field.js CHANGED
@@ -1,58 +1,58 @@
1
1
  "use client";
2
2
  import './Field.css';
3
- import { jsxs as $, jsx as f } from "react/jsx-runtime";
4
- import { createContext as q, useMemo as A, useId as L, useContext as M } from "react";
5
- import { Hint as R } from "./Hint.js";
6
- import { Label as S } from "./Label.js";
7
- import { c as T } from "./index-PAaZGbyz.js";
8
- import { f as W } from "./forwardRefWithAs-8eP3ZN15.js";
9
- const k = "_root_17n7f_2", z = "_label_17n7f_7", E = "_hint_17n7f_7", G = "_inline_17n7f_13", J = "_visuallyHidden_17n7f_48", K = {
10
- root: k,
3
+ import { jsxs as w, jsx as b } from "react/jsx-runtime";
4
+ import { createContext as C, useMemo as $, useId as A, useContext as L } from "react";
5
+ import { Hint as M } from "./Hint.js";
6
+ import { Label as R } from "./Label.js";
7
+ import { c as S } from "./index-PAaZGbyz.js";
8
+ import { f as T } from "./forwardRefWithAs-8eP3ZN15.js";
9
+ const W = "_root_1sq1k_2", z = "_label_1sq1k_8", E = "_hint_1sq1k_8", G = "_inline_1sq1k_14", J = "_visuallyHidden_1sq1k_49", K = {
10
+ root: W,
11
11
  label: z,
12
12
  hint: E,
13
13
  inline: G,
14
- "hint-max-length": "_hint-max-length_17n7f_45",
14
+ "hint-max-length": "_hint-max-length_1sq1k_46",
15
15
  visuallyHidden: J
16
- }, b = T(K), y = q({
17
- getInputProps: (n) => n,
16
+ }, h = S(K), y = C({
17
+ getInputProps: (i) => i,
18
18
  hintID: "",
19
19
  labelID: "",
20
20
  variant: void 0
21
21
  });
22
- function h(n) {
23
- const s = L();
24
- return n || s;
22
+ function _(i) {
23
+ const o = A();
24
+ return i || o;
25
25
  }
26
26
  function P() {
27
- return M(y);
27
+ return L(y);
28
28
  }
29
- const O = W((n, s) => {
29
+ const O = T((i, o) => {
30
30
  const {
31
31
  children: I,
32
32
  className: p,
33
33
  disabled: d,
34
- error: _,
34
+ error: f,
35
35
  hideLabel: g,
36
36
  hint: D,
37
37
  hintProps: t,
38
38
  id: N,
39
- inline: F,
40
- label: H,
39
+ inline: q,
40
+ label: F,
41
41
  labelProps: a,
42
42
  maxLength: e,
43
43
  required: c,
44
44
  success: v,
45
45
  warning: x,
46
- ...j
47
- } = n, i = _ ? "danger" : v ? "success" : x ? "warning" : void 0, l = _ ?? x ?? v ?? D ?? (e ? `${new Intl.NumberFormat().format(e.count)} / ${new Intl.NumberFormat().format(e.max)}` : void 0), r = h(a == null ? void 0 : a.id), o = h(t == null ? void 0 : t.id), m = h(N), B = A(
46
+ ...k
47
+ } = i, n = f ? "danger" : v ? "success" : x ? "warning" : void 0, l = f ?? x ?? v ?? D ?? (e ? `${new Intl.NumberFormat().format(e.count)} / ${new Intl.NumberFormat().format(e.max)}` : void 0), r = _(a == null ? void 0 : a.id), s = _(t == null ? void 0 : t.id), m = _(N), H = $(
48
48
  () => ({
49
49
  getInputProps(u) {
50
- const w = [u["aria-describedby"], l && o].filter(Boolean).join(" ") || void 0, C = [u["aria-labelledby"], r].filter(Boolean).join(" ");
50
+ const j = [u["aria-describedby"], l && s].filter(Boolean).join(" ") || void 0, B = [u["aria-labelledby"], r].filter(Boolean).join(" ");
51
51
  return {
52
52
  ...u,
53
- "aria-describedby": w,
54
- "aria-invalid": i === "danger" ? !0 : void 0,
55
- "aria-labelledby": C,
53
+ "aria-describedby": j,
54
+ "aria-invalid": n === "danger" ? !0 : void 0,
55
+ "aria-labelledby": B,
56
56
  disabled: d,
57
57
  id: m,
58
58
  /**
@@ -62,33 +62,33 @@ const O = W((n, s) => {
62
62
  required: c
63
63
  };
64
64
  },
65
- hintID: o,
65
+ hintID: s,
66
66
  labelID: r,
67
- variant: i
67
+ variant: n
68
68
  }),
69
- [o, r, i, l, d, m, e == null ? void 0 : e.max, c]
69
+ [s, r, n, l, d, m, e == null ? void 0 : e.max, c]
70
70
  );
71
- return /* @__PURE__ */ $("div", { ref: s, ...j, className: b("root", F && "inline", p), children: [
72
- /* @__PURE__ */ f(
73
- S,
71
+ return /* @__PURE__ */ w("div", { ref: o, ...k, className: h("root", q && "inline", p), children: [
72
+ /* @__PURE__ */ b(
73
+ R,
74
74
  {
75
- className: b("label", g && "visuallyHidden"),
75
+ className: h("label", g && "visuallyHidden"),
76
76
  disabled: d,
77
77
  htmlFor: m,
78
78
  id: r,
79
79
  required: c,
80
- variant: i,
80
+ variant: n,
81
81
  ...a,
82
- children: H
82
+ children: F
83
83
  }
84
84
  ),
85
- /* @__PURE__ */ f(y.Provider, { value: B, children: I }),
86
- l ? /* @__PURE__ */ f(
87
- R,
85
+ /* @__PURE__ */ b(y.Provider, { value: H, children: I }),
86
+ l ? /* @__PURE__ */ b(
87
+ M,
88
88
  {
89
- className: b("hint", !!e && "hint-max-length"),
90
- id: o,
91
- variant: i,
89
+ className: h("hint", !!e && "hint-max-length"),
90
+ id: s,
91
+ variant: n,
92
92
  ...t,
93
93
  children: l
94
94
  }
@@ -99,6 +99,6 @@ O.displayName = "Field";
99
99
  export {
100
100
  O as Field,
101
101
  y as FieldContext,
102
- h as useDefaultID,
102
+ _ as useDefaultID,
103
103
  P as useField
104
104
  };