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.
- package/dist/components/_internal/FeedbackIcon.cjs +1 -1
- package/dist/components/_internal/FeedbackIcon.js +18 -23
- package/dist/components/_internal/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +1 -0
- package/dist/components/data-display/Card/Card.cjs +1 -1
- package/dist/components/data-display/Card/Card.js +30 -25
- package/dist/components/data-display/Card/styled-values.cjs +2 -0
- package/dist/components/data-display/Card/styled-values.d.ts +18 -0
- package/dist/components/data-display/Card/styled-values.js +21 -0
- package/dist/components/feedback/Alert/Alert.cjs +1 -1
- package/dist/components/feedback/Alert/Alert.d.ts +11 -4
- package/dist/components/feedback/Alert/Alert.js +1 -1
- package/dist/components/feedback/Result/Result.cjs +1 -1
- package/dist/components/feedback/Result/Result.js +39 -37
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.d.ts +10 -1
- package/dist/components/form/Dropzone/Dropzone.js +40 -40
- package/dist/components/form/Fieldset/Fieldset.cjs +1 -1
- package/dist/components/form/Fieldset/Fieldset.d.ts +9 -2
- package/dist/components/form/Fieldset/Fieldset.js +1 -1
- package/dist/components/form/Fieldset/fieldset.module.cjs +1 -1
- package/dist/components/form/Fieldset/fieldset.module.js +4 -3
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.d.ts +10 -1
- package/dist/components/form/FileUpload/FileUpload.js +49 -45
- package/dist/components/form/Input/Input.cjs +1 -1
- package/dist/components/form/Input/Input.d.ts +6 -0
- package/dist/components/form/Input/Input.js +65 -63
- package/dist/components/form/InputBase/InputBase.cjs +1 -1
- package/dist/components/form/InputBase/InputBase.d.ts +9 -1
- package/dist/components/form/InputBase/InputBase.js +31 -25
- package/dist/components/form/InputBase/input-base.module.cjs +1 -1
- package/dist/components/form/InputBase/input-base.module.js +9 -7
- package/dist/components/form/OtpInput/OtpInput.cjs +1 -1
- package/dist/components/form/OtpInput/OtpInput.d.ts +16 -2
- package/dist/components/form/OtpInput/OtpInput.js +53 -54
- package/dist/components/form/SegmentedControl/segmented-control.module.cjs +1 -1
- package/dist/components/form/SegmentedControl/segmented-control.module.js +1 -1
- package/dist/components/media/Icon/Icon.cjs +1 -1
- package/dist/components/media/Icon/Icon.d.ts +9 -4
- package/dist/components/media/Icon/Icon.js +27 -11
- package/dist/components/media/Icon/icon.module.cjs +1 -1
- package/dist/components/media/Icon/icon.module.js +10 -10
- package/dist/components/media/Image/Image.cjs +1 -1
- package/dist/components/media/Image/Image.js +1 -1
- package/dist/components/typography/Code/code.module.cjs +1 -1
- package/dist/components/typography/Code/code.module.js +1 -1
- package/dist/components/typography/Text/Text.cjs +1 -1
- package/dist/components/typography/Text/Text.d.ts +24 -0
- package/dist/components/typography/Text/Text.js +10 -10
- package/dist/components/typography/Text/text.module.cjs +1 -1
- package/dist/components/typography/Text/text.module.js +12 -10
- package/dist/llms-full.txt +68 -6
- package/dist/llms.txt +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/warn-unstyled-value.cjs +2 -0
- package/dist/utilities/warn-unstyled-value.d.ts +17 -0
- package/dist/utilities/warn-unstyled-value.js +4 -0
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- 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 =
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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 (!
|
|
25
|
-
let e = [...
|
|
26
|
-
e[t - 1] = "",
|
|
27
|
-
} else if (
|
|
28
|
-
let e = [...
|
|
29
|
-
e[t] = "",
|
|
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(),
|
|
32
|
-
},
|
|
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 = [...
|
|
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
|
-
}),
|
|
36
|
+
}), O(n), F(n);
|
|
38
37
|
let r = Math.min(t.length, i - 1);
|
|
39
|
-
|
|
40
|
-
},
|
|
38
|
+
j.current[r]?.focus();
|
|
39
|
+
}, z = x ? e : "div";
|
|
41
40
|
return /* @__PURE__ */ l(n, {
|
|
42
|
-
label:
|
|
43
|
-
error:
|
|
44
|
-
required:
|
|
45
|
-
layout:
|
|
46
|
-
labelId:
|
|
47
|
-
htmlFor:
|
|
48
|
-
errorId:
|
|
49
|
-
className: c(
|
|
50
|
-
children: /* @__PURE__ */ u(
|
|
51
|
-
className: c("wim-otp-input", r.root,
|
|
52
|
-
ref:
|
|
53
|
-
...
|
|
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,
|
|
54
|
+
className: c(r.container, m && r.disabled),
|
|
56
55
|
role: "group",
|
|
57
|
-
"aria-labelledby":
|
|
56
|
+
"aria-labelledby": N,
|
|
58
57
|
"data-testid": "otp-input-container",
|
|
59
|
-
"data-disabled":
|
|
58
|
+
"data-disabled": m,
|
|
60
59
|
children: Array.from({ length: i }).map((e, t) => /* @__PURE__ */ l("input", {
|
|
61
|
-
id: t === 0 ?
|
|
60
|
+
id: t === 0 ? M : void 0,
|
|
62
61
|
ref: (e) => {
|
|
63
|
-
|
|
62
|
+
j.current[t] = e;
|
|
64
63
|
},
|
|
65
64
|
"data-testid": "otp-input",
|
|
66
|
-
className: c(r.input,
|
|
65
|
+
className: c(r.input, h && r.danger, m && r.disabled),
|
|
67
66
|
type: "text",
|
|
68
67
|
maxLength: 1,
|
|
69
|
-
value:
|
|
70
|
-
onChange: (e) =>
|
|
71
|
-
onKeyDown: (e) =>
|
|
72
|
-
onPaste:
|
|
73
|
-
disabled:
|
|
74
|
-
"aria-label":
|
|
75
|
-
"aria-invalid":
|
|
76
|
-
"aria-describedby":
|
|
77
|
-
"aria-required":
|
|
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
|
-
}) }),
|
|
78
|
+
}) }), C]
|
|
80
79
|
})
|
|
81
80
|
});
|
|
82
81
|
});
|
|
83
|
-
|
|
82
|
+
f.displayName = "OtpInput";
|
|
84
83
|
//#endregion
|
|
85
|
-
export {
|
|
84
|
+
export { f as OtpInput, f as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
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 = "
|
|
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"),
|
|
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
|
-
/**
|
|
14
|
-
|
|
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 "
|
|
3
|
-
import
|
|
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
|
|
6
|
-
import { jsx as
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 {
|
|
32
|
+
export { s as Icon };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
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 = "
|
|
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-
|
|
6
|
-
"size-sm": "_size-
|
|
7
|
-
"size-md": "_size-
|
|
8
|
-
"size-lg": "_size-
|
|
9
|
-
"size-xl": "_size-
|
|
10
|
-
"size-2xl": "_size-
|
|
11
|
-
"size-3xl": "_size-
|
|
12
|
-
"size-4xl": "_size-
|
|
13
|
-
"size-5xl": "_size-
|
|
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:`
|
|
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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var 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,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`,
|
|
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",
|
|
10
|
-
let
|
|
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:
|
|
13
|
-
}) : /* @__PURE__ */ l(t, { children:
|
|
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:
|
|
23
|
-
className: c("wim-text", o.root, o[u], p === "bold" && o.bold, h === "italic" && o.italic,
|
|
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:
|
|
25
|
+
color: E ? void 0 : n(f),
|
|
26
26
|
fontSize: r(u),
|
|
27
27
|
lineHeight: a(m),
|
|
28
28
|
fontWeight: i(p),
|
|
29
|
-
...
|
|
29
|
+
...b
|
|
30
30
|
},
|
|
31
|
-
...
|
|
32
|
-
children:
|
|
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=`
|
|
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 = "
|
|
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-
|
|
11
|
-
"normal-jpan": "_normal-
|
|
12
|
-
"tight-jpan": "_tight-
|
|
13
|
-
"loose-latn": "_loose-
|
|
14
|
-
"normal-latn": "_normal-
|
|
15
|
-
"tight-latn": "_tight-
|
|
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-
|
|
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,
|
|
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 };
|