wimui 0.6.0 → 0.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.
Files changed (61) hide show
  1. package/dist/components/_internal/FeedbackIcon.cjs +1 -1
  2. package/dist/components/_internal/FeedbackIcon.js +18 -23
  3. package/dist/components/_internal/FieldLabelContent.cjs +1 -1
  4. package/dist/components/_internal/FieldLabelContent.js +1 -0
  5. package/dist/components/data-display/Card/Card.cjs +1 -1
  6. package/dist/components/data-display/Card/Card.js +30 -25
  7. package/dist/components/data-display/Card/styled-values.cjs +2 -0
  8. package/dist/components/data-display/Card/styled-values.d.ts +18 -0
  9. package/dist/components/data-display/Card/styled-values.js +21 -0
  10. package/dist/components/feedback/Alert/Alert.cjs +1 -1
  11. package/dist/components/feedback/Alert/Alert.d.ts +11 -4
  12. package/dist/components/feedback/Alert/Alert.js +1 -1
  13. package/dist/components/feedback/Result/Result.cjs +1 -1
  14. package/dist/components/feedback/Result/Result.js +39 -37
  15. package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
  16. package/dist/components/form/Dropzone/Dropzone.d.ts +10 -1
  17. package/dist/components/form/Dropzone/Dropzone.js +40 -40
  18. package/dist/components/form/Fieldset/Fieldset.cjs +1 -1
  19. package/dist/components/form/Fieldset/Fieldset.d.ts +9 -2
  20. package/dist/components/form/Fieldset/Fieldset.js +1 -1
  21. package/dist/components/form/Fieldset/fieldset.module.cjs +1 -1
  22. package/dist/components/form/Fieldset/fieldset.module.js +4 -3
  23. package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
  24. package/dist/components/form/FileUpload/FileUpload.d.ts +10 -1
  25. package/dist/components/form/FileUpload/FileUpload.js +49 -45
  26. package/dist/components/form/Input/Input.cjs +1 -1
  27. package/dist/components/form/Input/Input.d.ts +6 -0
  28. package/dist/components/form/Input/Input.js +65 -63
  29. package/dist/components/form/InputBase/InputBase.cjs +1 -1
  30. package/dist/components/form/InputBase/InputBase.d.ts +9 -1
  31. package/dist/components/form/InputBase/InputBase.js +31 -25
  32. package/dist/components/form/InputBase/input-base.module.cjs +1 -1
  33. package/dist/components/form/InputBase/input-base.module.js +9 -7
  34. package/dist/components/form/OtpInput/OtpInput.cjs +1 -1
  35. package/dist/components/form/OtpInput/OtpInput.d.ts +16 -2
  36. package/dist/components/form/OtpInput/OtpInput.js +53 -54
  37. package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
  38. package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
  39. package/dist/components/media/Icon/Icon.cjs +1 -1
  40. package/dist/components/media/Icon/Icon.d.ts +9 -4
  41. package/dist/components/media/Icon/Icon.js +27 -11
  42. package/dist/components/media/Icon/icon.module.cjs +1 -1
  43. package/dist/components/media/Icon/icon.module.js +10 -10
  44. package/dist/components/media/Image/Image.cjs +1 -1
  45. package/dist/components/media/Image/Image.js +1 -1
  46. package/dist/components/typography/Code/code.module.cjs +1 -1
  47. package/dist/components/typography/Code/code.module.js +1 -1
  48. package/dist/components/typography/Text/Text.cjs +1 -1
  49. package/dist/components/typography/Text/Text.d.ts +24 -0
  50. package/dist/components/typography/Text/Text.js +10 -10
  51. package/dist/components/typography/Text/text.module.cjs +1 -1
  52. package/dist/components/typography/Text/text.module.js +12 -10
  53. package/dist/llms-full.txt +68 -6
  54. package/dist/llms.txt +1 -1
  55. package/dist/styles.css +1 -1
  56. package/dist/utilities/warn-unstyled-value.cjs +2 -0
  57. package/dist/utilities/warn-unstyled-value.d.ts +17 -0
  58. package/dist/utilities/warn-unstyled-value.js +4 -0
  59. package/dist/wimui.umd.css +1 -1
  60. package/dist/wimui.umd.js +5 -5
  61. package/package.json +1 -1
@@ -6,80 +6,79 @@ import { forwardRef as i, useId as a, useRef as o, useState as s } from "react";
6
6
  import c from "classnames";
7
7
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region src/components/form/OtpInput/OtpInput.tsx
9
- var d = i(({ length: i = 6, value: d = "", onChange: f, disabled: p = !1, error: m, required: h, label: g, layout: _, className: v, labels: y = {}, asChild: b = !1, fullWidth: x = !1, children: S, ...C }, w) => {
10
- let { digitAriaLabel: T = (e) => `Digit ${e}` } = y, [E, D] = s(Array(i).fill("")), [O, k] = s(d), A = o([]), j = `wim-otp-input-${a()}`, M = g ? `${j}-label` : void 0, N = m ? `${j}-error` : void 0;
11
- if (d !== O) {
12
- k(d);
13
- let e = d.split("").slice(0, i);
14
- D(Array(i).fill("").map((t, n) => e[n] || ""));
15
- }
16
- let P = (e) => {
9
+ var d = (e, t) => {
10
+ let n = e.split("").slice(0, t);
11
+ return Array(t).fill("").map((e, t) => n[t] ?? "");
12
+ }, f = i(({ length: i = 6, value: f = "", onChange: p, disabled: m = !1, error: h, required: g, label: _, layout: v, className: y, labels: b = {}, asChild: x = !1, fullWidth: S = !1, children: C, ...w }, T) => {
13
+ let { digitAriaLabel: E = (e) => `Digit ${e}` } = b, [D, O] = s(() => d(f, i)), [k, A] = s(f), j = o([]), M = `wim-otp-input-${a()}`, N = _ ? `${M}-label` : void 0, P = h ? `${M}-error` : void 0;
14
+ f !== k && (A(f), O(d(f, i)));
15
+ let F = (e) => {
17
16
  let t = e.join("");
18
- f && f(t);
19
- }, F = (e, t) => {
20
- let n = e.target.value.slice(-1), r = [...E];
21
- r[t] = n, D(r), P(r), n && t < i - 1 && A.current[t + 1]?.focus();
17
+ p && p(t);
22
18
  }, I = (e, t) => {
19
+ let n = e.target.value.slice(-1), r = [...D];
20
+ r[t] = n, O(r), F(r), n && t < i - 1 && j.current[t + 1]?.focus();
21
+ }, L = (e, t) => {
23
22
  if (e.key === "Backspace") {
24
- if (!E[t] && t > 0) {
25
- let e = [...E];
26
- e[t - 1] = "", D(e), P(e), A.current[t - 1]?.focus();
27
- } else if (E[t]) {
28
- let e = [...E];
29
- e[t] = "", D(e), P(e);
23
+ if (!D[t] && t > 0) {
24
+ let e = [...D];
25
+ e[t - 1] = "", O(e), F(e), j.current[t - 1]?.focus();
26
+ } else if (D[t]) {
27
+ let e = [...D];
28
+ e[t] = "", O(e), F(e);
30
29
  }
31
- } else e.key === "ArrowLeft" && t > 0 ? (e.preventDefault(), A.current[t - 1]?.focus()) : e.key === "ArrowRight" && t < i - 1 && (e.preventDefault(), A.current[t + 1]?.focus());
32
- }, L = (e) => {
30
+ } else e.key === "ArrowLeft" && t > 0 ? (e.preventDefault(), j.current[t - 1]?.focus()) : e.key === "ArrowRight" && t < i - 1 && (e.preventDefault(), j.current[t + 1]?.focus());
31
+ }, R = (e) => {
33
32
  e.preventDefault();
34
- let t = e.clipboardData.getData("text").slice(0, i).split(""), n = [...E];
33
+ let t = e.clipboardData.getData("text").slice(0, i).split(""), n = [...D];
35
34
  t.forEach((e, t) => {
36
35
  t < i && (n[t] = e);
37
- }), D(n), P(n);
36
+ }), O(n), F(n);
38
37
  let r = Math.min(t.length, i - 1);
39
- A.current[r]?.focus();
40
- }, R = b ? e : "div";
38
+ j.current[r]?.focus();
39
+ }, z = x ? e : "div";
41
40
  return /* @__PURE__ */ l(n, {
42
- label: g,
43
- error: m,
44
- required: h,
45
- layout: _,
46
- labelId: M,
47
- htmlFor: j,
48
- errorId: N,
49
- className: c(v, x && r.fullWidth),
50
- children: /* @__PURE__ */ u(R, {
51
- className: c("wim-otp-input", r.root, x && r.fullWidth),
52
- ref: w,
53
- ...C,
41
+ label: _,
42
+ error: h,
43
+ required: g,
44
+ layout: v,
45
+ labelId: N,
46
+ htmlFor: M,
47
+ errorId: P,
48
+ className: c(y, S && r.fullWidth),
49
+ children: /* @__PURE__ */ u(z, {
50
+ className: c("wim-otp-input", r.root, S && r.fullWidth),
51
+ ref: T,
52
+ ...w,
54
53
  children: [/* @__PURE__ */ l(t, { children: /* @__PURE__ */ l("div", {
55
- className: c(r.container, p && r.disabled),
54
+ className: c(r.container, m && r.disabled),
56
55
  role: "group",
57
- "aria-labelledby": M,
56
+ "aria-labelledby": N,
58
57
  "data-testid": "otp-input-container",
59
- "data-disabled": p,
58
+ "data-disabled": m,
60
59
  children: Array.from({ length: i }).map((e, t) => /* @__PURE__ */ l("input", {
61
- id: t === 0 ? j : void 0,
60
+ id: t === 0 ? M : void 0,
62
61
  ref: (e) => {
63
- A.current[t] = e;
62
+ j.current[t] = e;
64
63
  },
65
64
  "data-testid": "otp-input",
66
- className: c(r.input, m && r.danger, p && r.disabled),
65
+ className: c(r.input, h && r.danger, m && r.disabled),
67
66
  type: "text",
68
67
  maxLength: 1,
69
- value: E[t],
70
- onChange: (e) => F(e, t),
71
- onKeyDown: (e) => I(e, t),
72
- onPaste: L,
73
- disabled: p,
74
- "aria-label": T(t + 1),
75
- "aria-invalid": m ? "true" : "false",
76
- "aria-describedby": N,
77
- "aria-required": h ? "true" : void 0
68
+ value: D[t],
69
+ onChange: (e) => I(e, t),
70
+ onKeyDown: (e) => L(e, t),
71
+ onPaste: R,
72
+ disabled: m,
73
+ "aria-label": E(t + 1),
74
+ "aria-invalid": h ? "true" : "false",
75
+ "aria-describedby": P,
76
+ "aria-required": g ? "true" : void 0
78
77
  }, t))
79
- }) }), S]
78
+ }) }), C]
80
79
  })
81
80
  });
82
81
  });
83
- d.displayName = "OtpInput";
82
+ f.displayName = "OtpInput";
84
83
  //#endregion
85
- export { d as OtpInput, d as default };
84
+ export { f as OtpInput, f as default };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_kpg4k_22`,t=`_fullWidth_kpg4k_36`,n=`_danger_kpg4k_13`,r=`_sm_kpg4k_43`,i=`_item_kpg4k_46`,a=`_iconOnly_kpg4k_51`,o=`_icon_kpg4k_51`,s=`_md_kpg4k_61`,c=`_lg_kpg4k_79`,l=`_slider_kpg4k_97`,u=`_ready_kpg4k_111`,d=`_active_kpg4k_148`,f=`_label_kpg4k_155`,p={root:e,fullWidth:t,danger:n,sm:r,item:i,iconOnly:a,icon:o,md:s,lg:c,slider:l,ready:u,active:d,label:f};exports.active=d,exports.danger=n,exports.default=p,exports.fullWidth=t,exports.icon=o,exports.iconOnly=a,exports.item=i,exports.label=f,exports.lg=c,exports.md=s,exports.ready=u,exports.root=e,exports.slider=l,exports.sm=r;
2
+ var e=`_root_o619x_22`,t=`_fullWidth_o619x_37`,n=`_danger_o619x_13`,r=`_sm_o619x_44`,i=`_item_o619x_47`,a=`_iconOnly_o619x_52`,o=`_icon_o619x_52`,s=`_md_o619x_62`,c=`_lg_o619x_80`,l=`_slider_o619x_98`,u=`_ready_o619x_112`,d=`_active_o619x_149`,f=`_label_o619x_156`,p={root:e,fullWidth:t,danger:n,sm:r,item:i,iconOnly:a,icon:o,md:s,lg:c,slider:l,ready:u,active:d,label:f};exports.active=d,exports.danger=n,exports.default=p,exports.fullWidth=t,exports.icon=o,exports.iconOnly=a,exports.item=i,exports.label=f,exports.lg=c,exports.md=s,exports.ready=u,exports.root=e,exports.slider=l,exports.sm=r;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  //#region src/components/form/SegmentedControl/segmented-control.module.scss
3
- var e = "_root_kpg4k_22", t = "_fullWidth_kpg4k_36", n = "_danger_kpg4k_13", r = "_sm_kpg4k_43", i = "_item_kpg4k_46", a = "_iconOnly_kpg4k_51", o = "_icon_kpg4k_51", s = "_md_kpg4k_61", c = "_lg_kpg4k_79", l = "_slider_kpg4k_97", u = "_ready_kpg4k_111", d = "_active_kpg4k_148", f = "_label_kpg4k_155", p = {
3
+ var e = "_root_o619x_22", t = "_fullWidth_o619x_37", n = "_danger_o619x_13", r = "_sm_o619x_44", i = "_item_o619x_47", a = "_iconOnly_o619x_52", o = "_icon_o619x_52", s = "_md_o619x_62", c = "_lg_o619x_80", l = "_slider_o619x_98", u = "_ready_o619x_112", d = "_active_o619x_149", f = "_label_o619x_156", p = {
4
4
  root: e,
5
5
  fullWidth: t,
6
6
  danger: n,
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./icon.module.cjs"),n=require("../../../icon/registry.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("classnames");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({name:e,component:r,size:o=`md`,color:s,spin:c,className:l,...u})=>{let d=r||(e?n.registeredIcons[e]:null);return d?(0,a.jsx)(d,{className:(0,i.default)(`wim-icon`,t.default.root,o&&t.default[`size-${o}`],s&&t.default[s],(c||e&&(e===`LoadingIcon`||e===`SpinnerIcon`))&&t.default.loading,l),...u}):(e&&n.warnUnregisteredIcon(e),null)};exports.Icon=o;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utilities/style-utils.cjs"),n=require("./icon.module.cjs"),r=require("../../../icon/registry.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=[`danger`,`success`,`warning`,`info`,`primary`,`secondary`,`tertiary`,`disabled`],c=({name:e,component:i,size:c=`md`,color:l,spin:u,className:d,style:f,...p})=>{let m=i||(e?r.registeredIcons[e]:null);if(!m)return e&&r.warnUnregisteredIcon(e),null;let h=typeof l==`string`&&s.includes(l);return(0,o.jsx)(m,{style:!h&&l?{color:t.getColorValue(l),...f}:f,className:(0,a.default)(`wim-icon`,n.default.root,c&&n.default[`size-${c}`],h&&n.default[l],(u||e&&(e===`LoadingIcon`||e===`SpinnerIcon`))&&n.default.loading,d),...p})};exports.Icon=c;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { ComponentSize } from '../../../types/tokens';
2
+ import { ComponentSize, WimColor } from '../../../types/tokens';
3
3
  import { IconName } from '../../../icon';
4
4
  type IconProps = Omit<React.SVGProps<SVGSVGElement>, "name"> & {
5
5
  /** Icon name. Requires `import "wimui/icons"` once at the app entry to register icons. */
@@ -10,8 +10,13 @@ type IconProps = Omit<React.SVGProps<SVGSVGElement>, "name"> & {
10
10
  size?: ComponentSize;
11
11
  /** Apply the loading rotation animation */
12
12
  spin?: boolean;
13
- /** Semantic color of the icon */
14
- color?: "danger" | "success" | "warning" | "info" | "primary" | "secondary" | "tertiary" | "disabled";
13
+ /**
14
+ * Colour of the icon. Takes the semantic names `"danger"`, `"success"`,
15
+ * `"warning"`, `"info"`, `"primary"`, `"secondary"`, `"tertiary"`,
16
+ * `"disabled"` — and, like `Text`, any design token colour name such as
17
+ * `"text-tertiary"`, or any CSS colour value.
18
+ */
19
+ color?: WimColor;
15
20
  };
16
- export declare const Icon: ({ name, component, size, color, spin, className, ...props }: IconProps) => React.JSX.Element | null;
21
+ export declare const Icon: ({ name, component, size, color, spin, className, style, ...props }: IconProps) => React.JSX.Element | null;
17
22
  export {};
@@ -1,16 +1,32 @@
1
1
  "use client";
2
- import e from "./icon.module.js";
3
- import { registeredIcons as t, warnUnregisteredIcon as n } from "../../../icon/registry.js";
2
+ import { getColorValue as e } from "../../../utilities/style-utils.js";
3
+ import t from "./icon.module.js";
4
+ import { registeredIcons as n, warnUnregisteredIcon as r } from "../../../icon/registry.js";
4
5
  import "react";
5
- import r from "classnames";
6
- import { jsx as i } from "react/jsx-runtime";
6
+ import i from "classnames";
7
+ import { jsx as a } from "react/jsx-runtime";
7
8
  //#region src/components/media/Icon/Icon.tsx
8
- var a = ({ name: a, component: o, size: s = "md", color: c, spin: l, className: u, ...d }) => {
9
- let f = o || (a ? t[a] : null);
10
- return f ? /* @__PURE__ */ i(f, {
11
- className: r("wim-icon", e.root, s && e[`size-${s}`], c && e[c], (l || a && (a === "LoadingIcon" || a === "SpinnerIcon")) && e.loading, u),
12
- ...d
13
- }) : (a && n(a), null);
9
+ var o = [
10
+ "danger",
11
+ "success",
12
+ "warning",
13
+ "info",
14
+ "primary",
15
+ "secondary",
16
+ "tertiary",
17
+ "disabled"
18
+ ], s = ({ name: s, component: c, size: l = "md", color: u, spin: d, className: f, style: p, ...m }) => {
19
+ let h = c || (s ? n[s] : null);
20
+ if (!h) return s && r(s), null;
21
+ let g = typeof u == "string" && o.includes(u);
22
+ return /* @__PURE__ */ a(h, {
23
+ style: !g && u ? {
24
+ color: e(u),
25
+ ...p
26
+ } : p,
27
+ className: i("wim-icon", t.root, l && t[`size-${l}`], g && t[u], (d || s && (s === "LoadingIcon" || s === "SpinnerIcon")) && t.loading, f),
28
+ ...m
29
+ });
14
30
  };
15
31
  //#endregion
16
- export { a as Icon };
32
+ export { s as Icon };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_1ccaa_3`,t=`_danger_1ccaa_62`,n=`_success_1ccaa_65`,r=`_warning_1ccaa_68`,i=`_primary_1ccaa_71`,a=`_secondary_1ccaa_74`,o=`_tertiary_1ccaa_77`,s=`_disabled_1ccaa_80`,c=`_info_1ccaa_83`,l=`_loading_1ccaa_86`,u=`_rotate_1ccaa_1`,d={root:e,"size-xs":`_size-xs_1ccaa_35`,"size-sm":`_size-sm_1ccaa_38`,"size-md":`_size-md_1ccaa_41`,"size-lg":`_size-lg_1ccaa_44`,"size-xl":`_size-xl_1ccaa_47`,"size-2xl":`_size-2xl_1ccaa_50`,"size-3xl":`_size-3xl_1ccaa_53`,"size-4xl":`_size-4xl_1ccaa_56`,"size-5xl":`_size-5xl_1ccaa_59`,danger:t,success:n,warning:r,primary:i,secondary:a,tertiary:o,disabled:s,info:c,loading:l,rotate:u};exports.danger=t,exports.default=d,exports.disabled=s,exports.info=c,exports.loading=l,exports.primary=i,exports.root=e,exports.rotate=u,exports.secondary=a,exports.success=n,exports.tertiary=o,exports.warning=r;
2
+ var e=`_root_1kkcf_3`,t=`_danger_1kkcf_62`,n=`_success_1kkcf_65`,r=`_warning_1kkcf_68`,i=`_primary_1kkcf_71`,a=`_secondary_1kkcf_74`,o=`_tertiary_1kkcf_77`,s=`_disabled_1kkcf_80`,c=`_info_1kkcf_83`,l=`_loading_1kkcf_86`,u=`_rotate_1kkcf_1`,d={root:e,"size-xs":`_size-xs_1kkcf_35`,"size-sm":`_size-sm_1kkcf_38`,"size-md":`_size-md_1kkcf_41`,"size-lg":`_size-lg_1kkcf_44`,"size-xl":`_size-xl_1kkcf_47`,"size-2xl":`_size-2xl_1kkcf_50`,"size-3xl":`_size-3xl_1kkcf_53`,"size-4xl":`_size-4xl_1kkcf_56`,"size-5xl":`_size-5xl_1kkcf_59`,danger:t,success:n,warning:r,primary:i,secondary:a,tertiary:o,disabled:s,info:c,loading:l,rotate:u};exports.danger=t,exports.default=d,exports.disabled=s,exports.info=c,exports.loading=l,exports.primary=i,exports.root=e,exports.rotate=u,exports.secondary=a,exports.success=n,exports.tertiary=o,exports.warning=r;
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  //#region src/components/media/Icon/icon.module.scss
3
- var e = "_root_1ccaa_3", t = "_danger_1ccaa_62", n = "_success_1ccaa_65", r = "_warning_1ccaa_68", i = "_primary_1ccaa_71", a = "_secondary_1ccaa_74", o = "_tertiary_1ccaa_77", s = "_disabled_1ccaa_80", c = "_info_1ccaa_83", l = "_loading_1ccaa_86", u = "_rotate_1ccaa_1", d = {
3
+ var e = "_root_1kkcf_3", t = "_danger_1kkcf_62", n = "_success_1kkcf_65", r = "_warning_1kkcf_68", i = "_primary_1kkcf_71", a = "_secondary_1kkcf_74", o = "_tertiary_1kkcf_77", s = "_disabled_1kkcf_80", c = "_info_1kkcf_83", l = "_loading_1kkcf_86", u = "_rotate_1kkcf_1", d = {
4
4
  root: e,
5
- "size-xs": "_size-xs_1ccaa_35",
6
- "size-sm": "_size-sm_1ccaa_38",
7
- "size-md": "_size-md_1ccaa_41",
8
- "size-lg": "_size-lg_1ccaa_44",
9
- "size-xl": "_size-xl_1ccaa_47",
10
- "size-2xl": "_size-2xl_1ccaa_50",
11
- "size-3xl": "_size-3xl_1ccaa_53",
12
- "size-4xl": "_size-4xl_1ccaa_56",
13
- "size-5xl": "_size-5xl_1ccaa_59",
5
+ "size-xs": "_size-xs_1kkcf_35",
6
+ "size-sm": "_size-sm_1kkcf_38",
7
+ "size-md": "_size-md_1kkcf_41",
8
+ "size-lg": "_size-lg_1kkcf_44",
9
+ "size-xl": "_size-xl_1kkcf_47",
10
+ "size-2xl": "_size-2xl_1kkcf_50",
11
+ "size-3xl": "_size-3xl_1kkcf_53",
12
+ "size-4xl": "_size-4xl_1kkcf_56",
13
+ "size-5xl": "_size-5xl_1kkcf_59",
14
14
  danger: t,
15
15
  success: n,
16
16
  warning: r,
@@ -4,4 +4,4 @@ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i
4
4
  ${e.g-t.g} 0 0 0 ${t.g}
5
5
  ${e.b-t.b} 0 0 0 ${t.b}
6
6
  0 0 0 1 0
7
- `},[T]),Q={width:`100%`,height:f||`auto`,objectFit:g,...I},$=p===`none`?null:i.default[`radius${p.charAt(0).toUpperCase()+p.slice(1)}`];return(0,s.jsxs)(`figure`,{ref:B,className:(0,o.default)(`wim-image`,i.default.root,F),"data-testid":`image-root`,style:{maxWidth:d||`100%`,width:`100%`,...X,...G},onMouseMove:J,onMouseLeave:Y,children:[T&&(0,s.jsx)(`svg`,{style:{position:`absolute`,width:0,height:0},children:(0,s.jsx)(`filter`,{id:q,colorInterpolationFilters:`sRGB`,children:(0,s.jsx)(`feColorMatrix`,{type:`matrix`,values:Z||``})})}),(0,s.jsxs)(`div`,{className:(0,o.default)(i.default.inner,$,m&&i.default.shadow,h&&i.default.border,(x||S)&&i.default.hasBackdrop,w&&w!==`none`&&i.default.hasNoise,E&&i.default.hasOverlay,D&&i.default.zoomable,k&&i.default.fadeIn,k&&V&&i.default.isLoaded,W&&k&&i.default.loading),style:f===void 0?void 0:{height:f},"data-testid":`image-inner`,children:[H&&!R&&(0,s.jsx)(`img`,{src:e,alt:c,onLoad:U,onError:()=>z(!0),className:(0,o.default)(i.default.image,(y||b||T)&&i.default.hasFilter),style:Q,loading:_,fetchPriority:N?`high`:void 0,"data-testid":`image-element`,...L}),R&&(0,s.jsx)(`div`,{className:i.default.fallback,"data-testid":`image-fallback`,children:P||(0,s.jsxs)(`div`,{className:i.default.defaultFallback,children:[(0,s.jsx)(n.Icon,{component:t.default,size:`lg`,color:`secondary`}),c&&(0,s.jsx)(`span`,{className:i.default.fallbackText,children:c})]})})]}),v&&(0,s.jsx)(`figcaption`,{className:i.default.caption,"data-testid":`image-caption`,children:v})]})};exports.Image=d;
7
+ `},[T]),Q={width:`100%`,height:f||`auto`,objectFit:g,...I},$=p===`none`?null:i.default[`radius${p.charAt(0).toUpperCase()+p.slice(1)}`];return(0,s.jsxs)(`figure`,{ref:B,className:(0,o.default)(`wim-image`,i.default.root,F),"data-testid":`image-root`,style:{maxWidth:d||`100%`,width:`100%`,...X,...G},onMouseMove:J,onMouseLeave:Y,children:[T&&(0,s.jsx)(`svg`,{style:{position:`absolute`,width:0,height:0},children:(0,s.jsx)(`filter`,{id:q,colorInterpolationFilters:`sRGB`,children:(0,s.jsx)(`feColorMatrix`,{type:`matrix`,values:Z||``})})}),(0,s.jsxs)(`div`,{className:(0,o.default)(i.default.inner,$,m&&i.default.shadow,h&&i.default.border,(x||S)&&i.default.hasBackdrop,w&&w!==`none`&&i.default.hasNoise,E&&i.default.hasOverlay,D&&i.default.zoomable,k&&i.default.fadeIn,k&&V&&i.default.isLoaded,W&&k&&i.default.loading),style:f===void 0?void 0:{height:f},"data-testid":`image-inner`,children:[H&&!R&&(0,s.jsx)(`img`,{src:e,alt:c,onLoad:U,onError:()=>z(!0),className:(0,o.default)(i.default.image,(y||b||T)&&i.default.hasFilter),style:Q,loading:_,fetchPriority:N?`high`:void 0,"data-testid":`image-element`,...L}),R&&(0,s.jsx)(`div`,{className:i.default.fallback,"data-testid":`image-fallback`,children:P||(0,s.jsxs)(`div`,{className:i.default.defaultFallback,children:[(0,s.jsx)(n.Icon,{component:t.default,size:`lg`,color:`tertiary`}),c&&(0,s.jsx)(`span`,{className:i.default.fallbackText,children:c})]})})]}),v&&(0,s.jsx)(`figcaption`,{className:i.default.caption,"data-testid":`image-caption`,children:v})]})};exports.Image=d;
@@ -210,7 +210,7 @@ var c = (e, t) => {
210
210
  children: [/* @__PURE__ */ o(t, {
211
211
  component: e,
212
212
  size: "lg",
213
- color: "secondary"
213
+ color: "tertiary"
214
214
  }), d && /* @__PURE__ */ o("span", {
215
215
  className: r.fallbackText,
216
216
  children: d
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_3r8s2_2`,t=`_inline_3r8s2_8`,n=`_block_3r8s2_13`,r={root:e,inline:t,block:n};exports.block=n,exports.default=r,exports.inline=t,exports.root=e;
2
+ var e=`_root_1qdym_2`,t=`_inline_1qdym_8`,n=`_block_1qdym_16`,r={root:e,inline:t,block:n};exports.block=n,exports.default=r,exports.inline=t,exports.root=e;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  //#region src/components/typography/Code/code.module.scss
3
- var e = "_root_3r8s2_2", t = "_inline_3r8s2_8", n = "_block_3r8s2_13", r = {
3
+ var e = "_root_1qdym_2", t = "_inline_1qdym_8", n = "_block_1qdym_16", r = {
4
4
  root: e,
5
5
  inline: t,
6
6
  block: n
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/style-utils.cjs"),r=require("./text.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({asChild:e=!1,size:i=`md`,content:s,color:c,weight:l=`normal`,lineHeight:u,fontStyle:d=`normal`,decoration:f=`none`,className:p,style:m,children:h,...g},_)=>{let v=e?h:s??h,y=!e&&f!==`none`?(0,o.jsx)(`span`,{className:r.default[f],children:(0,o.jsx)(t.Slottable,{children:v})}):(0,o.jsx)(t.Slottable,{children:v}),b=typeof c==`string`&&[`danger`,`primary`,`success`,`warning`,`info`,`secondary`].includes(c);return(0,o.jsx)(e?t.Root:`p`,{ref:_,className:(0,a.default)(`wim-text`,r.default.root,r.default[i],l===`bold`&&r.default.bold,d===`italic`&&r.default.italic,b&&r.default[c],e&&f!==`none`&&r.default[f],p),style:{color:b?void 0:n.getColorValue(c),fontSize:n.getFontSizeValue(i),lineHeight:n.getLineHeightValue(u),fontWeight:n.getFontWeightValue(l),...m},...g,children:y})});s.displayName=`Text`,exports.Text=s;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/style-utils.cjs"),r=require("./text.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=i.default.forwardRef(({asChild:e=!1,size:i=`md`,content:s,color:c,weight:l=`normal`,lineHeight:u,fontStyle:d=`normal`,decoration:f=`none`,nowrap:p=!1,truncate:m=!1,className:h,style:g,children:_,...v},y)=>{let b=e?_:s??_,x=!e&&f!==`none`?(0,o.jsx)(`span`,{className:r.default[f],children:(0,o.jsx)(t.Slottable,{children:b})}):(0,o.jsx)(t.Slottable,{children:b}),S=typeof c==`string`&&[`danger`,`primary`,`success`,`warning`,`info`,`secondary`].includes(c);return(0,o.jsx)(e?t.Root:`p`,{ref:y,className:(0,a.default)(`wim-text`,r.default.root,r.default[i],l===`bold`&&r.default.bold,d===`italic`&&r.default.italic,S&&r.default[c],e&&f!==`none`&&r.default[f],(p||m)&&r.default.nowrap,m&&r.default.truncate,h),style:{color:S?void 0:n.getColorValue(c),fontSize:n.getFontSizeValue(i),lineHeight:n.getLineHeightValue(u),fontWeight:n.getFontWeightValue(l),...g},...v,children:x})});s.displayName=`Text`,exports.Text=s;
@@ -33,6 +33,18 @@ export type TextProps = Omit<React.ComponentPropsWithoutRef<"p">, "content"> & {
33
33
  * @default "none"
34
34
  */
35
35
  decoration?: "line-through" | "underline" | "highlight" | "none";
36
+ /**
37
+ * Keep the text on one line instead of wrapping. Overflow is left visible —
38
+ * use `truncate` to clip it with an ellipsis.
39
+ * @default false
40
+ */
41
+ nowrap?: boolean;
42
+ /**
43
+ * Keep the text on one line and clip the overflow with an ellipsis.
44
+ * Implies `nowrap`.
45
+ * @default false
46
+ */
47
+ truncate?: boolean;
36
48
  /**
37
49
  * Content of the text. Alternative to children (children take precedence only with asChild).
38
50
  */
@@ -71,6 +83,18 @@ export declare const Text: React.ForwardRefExoticComponent<Omit<Omit<React.Detai
71
83
  * @default "none"
72
84
  */
73
85
  decoration?: "line-through" | "underline" | "highlight" | "none";
86
+ /**
87
+ * Keep the text on one line instead of wrapping. Overflow is left visible —
88
+ * use `truncate` to clip it with an ellipsis.
89
+ * @default false
90
+ */
91
+ nowrap?: boolean;
92
+ /**
93
+ * Keep the text on one line and clip the overflow with an ellipsis.
94
+ * Implies `nowrap`.
95
+ * @default false
96
+ */
97
+ truncate?: boolean;
74
98
  /**
75
99
  * Content of the text. Alternative to children (children take precedence only with asChild).
76
100
  */
@@ -6,11 +6,11 @@ import s from "react";
6
6
  import c from "classnames";
7
7
  import { jsx as l } from "react/jsx-runtime";
8
8
  //#region src/components/typography/Text/Text.tsx
9
- var u = s.forwardRef(({ asChild: s = !1, size: u = "md", content: d, color: f, weight: p = "normal", lineHeight: m, fontStyle: h = "normal", decoration: g = "none", className: _, style: v, children: y, ...b }, x) => {
10
- let S = s ? y : d ?? y, C = !s && g !== "none" ? /* @__PURE__ */ l("span", {
9
+ var u = s.forwardRef(({ asChild: s = !1, size: u = "md", content: d, color: f, weight: p = "normal", lineHeight: m, fontStyle: h = "normal", decoration: g = "none", nowrap: _ = !1, truncate: v = !1, className: y, style: b, children: x, ...S }, C) => {
10
+ let w = s ? x : d ?? x, T = !s && g !== "none" ? /* @__PURE__ */ l("span", {
11
11
  className: o[g],
12
- children: /* @__PURE__ */ l(t, { children: S })
13
- }) : /* @__PURE__ */ l(t, { children: S }), w = typeof f == "string" && [
12
+ children: /* @__PURE__ */ l(t, { children: w })
13
+ }) : /* @__PURE__ */ l(t, { children: w }), E = typeof f == "string" && [
14
14
  "danger",
15
15
  "primary",
16
16
  "success",
@@ -19,17 +19,17 @@ var u = s.forwardRef(({ asChild: s = !1, size: u = "md", content: d, color: f, w
19
19
  "secondary"
20
20
  ].includes(f);
21
21
  return /* @__PURE__ */ l(s ? e : "p", {
22
- ref: x,
23
- className: c("wim-text", o.root, o[u], p === "bold" && o.bold, h === "italic" && o.italic, w && o[f], s && g !== "none" && o[g], _),
22
+ ref: C,
23
+ className: c("wim-text", o.root, o[u], p === "bold" && o.bold, h === "italic" && o.italic, E && o[f], s && g !== "none" && o[g], (_ || v) && o.nowrap, v && o.truncate, y),
24
24
  style: {
25
- color: w ? void 0 : n(f),
25
+ color: E ? void 0 : n(f),
26
26
  fontSize: r(u),
27
27
  lineHeight: a(m),
28
28
  fontWeight: i(p),
29
- ...v
29
+ ...b
30
30
  },
31
- ...b,
32
- children: C
31
+ ...S,
32
+ children: T
33
33
  });
34
34
  });
35
35
  u.displayName = "Text";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- var e=`_root_1u78b_2`,t=`_xl_1u78b_6`,n=`_lg_1u78b_9`,r=`_md_1u78b_12`,i=`_sm_1u78b_15`,a=`_xs_1u78b_18`,o=`_bold_1u78b_39`,s=`_italic_1u78b_42`,c=`_underline_1u78b_48`,l=`_highlight_1u78b_53`,u=`_danger_1u78b_56`,d=`_primary_1u78b_59`,f=`_success_1u78b_62`,p=`_warning_1u78b_65`,m=`_info_1u78b_68`,h=`_secondary_1u78b_71`,g={root:e,xl:t,lg:n,md:r,sm:i,xs:a,"loose-jpan":`_loose-jpan_1u78b_21`,"normal-jpan":`_normal-jpan_1u78b_24`,"tight-jpan":`_tight-jpan_1u78b_27`,"loose-latn":`_loose-latn_1u78b_30`,"normal-latn":`_normal-latn_1u78b_33`,"tight-latn":`_tight-latn_1u78b_36`,bold:o,italic:s,"line-through":`_line-through_1u78b_45`,underline:c,highlight:l,danger:u,primary:d,success:f,warning:p,info:m,secondary:h};exports.bold=o,exports.danger=u,exports.default=g,exports.highlight=l,exports.info=m,exports.italic=s,exports.lg=n,exports.md=r,exports.primary=d,exports.root=e,exports.secondary=h,exports.sm=i,exports.success=f,exports.underline=c,exports.warning=p,exports.xl=t,exports.xs=a;
2
+ var e=`_root_19651_2`,t=`_xl_19651_6`,n=`_lg_19651_9`,r=`_md_19651_12`,i=`_sm_19651_15`,a=`_xs_19651_18`,o=`_bold_19651_39`,s=`_italic_19651_42`,c=`_underline_19651_48`,l=`_highlight_19651_53`,u=`_danger_19651_56`,d=`_primary_19651_59`,f=`_success_19651_62`,p=`_warning_19651_65`,m=`_info_19651_68`,h=`_secondary_19651_71`,g=`_nowrap_19651_74`,_=`_truncate_19651_79`,v={root:e,xl:t,lg:n,md:r,sm:i,xs:a,"loose-jpan":`_loose-jpan_19651_21`,"normal-jpan":`_normal-jpan_19651_24`,"tight-jpan":`_tight-jpan_19651_27`,"loose-latn":`_loose-latn_19651_30`,"normal-latn":`_normal-latn_19651_33`,"tight-latn":`_tight-latn_19651_36`,bold:o,italic:s,"line-through":`_line-through_19651_45`,underline:c,highlight:l,danger:u,primary:d,success:f,warning:p,info:m,secondary:h,nowrap:g,truncate:_};exports.bold=o,exports.danger=u,exports.default=v,exports.highlight=l,exports.info=m,exports.italic=s,exports.lg=n,exports.md=r,exports.nowrap=g,exports.primary=d,exports.root=e,exports.secondary=h,exports.sm=i,exports.success=f,exports.truncate=_,exports.underline=c,exports.warning=p,exports.xl=t,exports.xs=a;
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  //#region src/components/typography/Text/text.module.scss
3
- var e = "_root_1u78b_2", t = "_xl_1u78b_6", n = "_lg_1u78b_9", r = "_md_1u78b_12", i = "_sm_1u78b_15", a = "_xs_1u78b_18", o = "_bold_1u78b_39", s = "_italic_1u78b_42", c = "_underline_1u78b_48", l = "_highlight_1u78b_53", u = "_danger_1u78b_56", d = "_primary_1u78b_59", f = "_success_1u78b_62", p = "_warning_1u78b_65", m = "_info_1u78b_68", h = "_secondary_1u78b_71", g = {
3
+ var e = "_root_19651_2", t = "_xl_19651_6", n = "_lg_19651_9", r = "_md_19651_12", i = "_sm_19651_15", a = "_xs_19651_18", o = "_bold_19651_39", s = "_italic_19651_42", c = "_underline_19651_48", l = "_highlight_19651_53", u = "_danger_19651_56", d = "_primary_19651_59", f = "_success_19651_62", p = "_warning_19651_65", m = "_info_19651_68", h = "_secondary_19651_71", g = "_nowrap_19651_74", _ = "_truncate_19651_79", v = {
4
4
  root: e,
5
5
  xl: t,
6
6
  lg: n,
7
7
  md: r,
8
8
  sm: i,
9
9
  xs: a,
10
- "loose-jpan": "_loose-jpan_1u78b_21",
11
- "normal-jpan": "_normal-jpan_1u78b_24",
12
- "tight-jpan": "_tight-jpan_1u78b_27",
13
- "loose-latn": "_loose-latn_1u78b_30",
14
- "normal-latn": "_normal-latn_1u78b_33",
15
- "tight-latn": "_tight-latn_1u78b_36",
10
+ "loose-jpan": "_loose-jpan_19651_21",
11
+ "normal-jpan": "_normal-jpan_19651_24",
12
+ "tight-jpan": "_tight-jpan_19651_27",
13
+ "loose-latn": "_loose-latn_19651_30",
14
+ "normal-latn": "_normal-latn_19651_33",
15
+ "tight-latn": "_tight-latn_19651_36",
16
16
  bold: o,
17
17
  italic: s,
18
- "line-through": "_line-through_1u78b_45",
18
+ "line-through": "_line-through_19651_45",
19
19
  underline: c,
20
20
  highlight: l,
21
21
  danger: u,
@@ -23,7 +23,9 @@ var e = "_root_1u78b_2", t = "_xl_1u78b_6", n = "_lg_1u78b_9", r = "_md_1u78b_12
23
23
  success: f,
24
24
  warning: p,
25
25
  info: m,
26
- secondary: h
26
+ secondary: h,
27
+ nowrap: g,
28
+ truncate: _
27
29
  };
28
30
  //#endregion
29
- export { o as bold, u as danger, g as default, l as highlight, m as info, s as italic, n as lg, r as md, d as primary, e as root, h as secondary, i as sm, f as success, c as underline, p as warning, t as xl, a as xs };
31
+ export { o as bold, u as danger, v as default, l as highlight, m as info, s as italic, n as lg, r as md, g as nowrap, d as primary, e as root, h as secondary, i as sm, f as success, _ as truncate, c as underline, p as warning, t as xl, a as xs };