wimui 0.6.1 → 0.8.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/FieldLabelContent.cjs +1 -1
- package/dist/components/_internal/FieldLabelContent.js +1 -0
- package/dist/components/_internal/field-label-content.module.cjs +1 -1
- package/dist/components/_internal/field-label-content.module.js +1 -1
- 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 +2 -2
- 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 +27 -27
- 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.d.ts +16 -2
- 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/Legend/Legend.cjs +1 -1
- package/dist/components/typography/Legend/Legend.d.ts +32 -2
- package/dist/components/typography/Legend/Legend.js +15 -10
- package/dist/components/typography/Legend/legend.module.cjs +1 -1
- package/dist/components/typography/Legend/legend.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 +74 -8
- package/dist/llms.txt +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +20 -13
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +40 -29
- 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 +23 -23
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../i18n/useWimTranslation.cjs"),n=require("../data-display/Badge/Badge.cjs"),r=require("./field-label-content.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({label:e,required:i=!1,requiredLabel:o,showOptional:s=!1,optionalLabel:c,className:l})=>{let{t:u}=t.useWimTranslation(`form`),d=o??u(`form.required`),f=c??u(`form.optional`);return(0,a.jsxs)(`div`,{className:l,children:[(0,a.jsx)(`span`,{className:r.default.text,children:e}),i?(0,a.jsx)(n.Badge,{intent:`danger`,size:`sm`,className:r.default.badge,"aria-hidden":`true`,children:d}):s&&(0,a.jsx)(n.Badge,{intent:`neutral`,size:`sm`,className:r.default.badge,"aria-hidden":`true`,children:f})]})};exports.FieldLabelContent=o;
|
|
2
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../i18n/useWimTranslation.cjs"),n=require("../data-display/Badge/Badge.cjs"),r=require("./field-label-content.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=({label:e,required:i=!1,requiredLabel:o,showOptional:s=!1,optionalLabel:c,className:l})=>{let{t:u}=t.useWimTranslation(`form`),d=o??u(`form.required`),f=c??u(`form.optional`);return(0,a.jsxs)(`div`,{className:l,children:[(0,a.jsx)(`span`,{className:r.default.text,children:e}),i?(0,a.jsx)(n.Badge,{intent:`danger`,variant:`subtle`,size:`sm`,className:r.default.badge,"aria-hidden":`true`,children:d}):s&&(0,a.jsx)(n.Badge,{intent:`neutral`,size:`sm`,className:r.default.badge,"aria-hidden":`true`,children:f})]})};exports.FieldLabelContent=o;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_text_1ojtz_2`,t=`_badge_1ojtz_5`,n={text:e,badge:t};exports.badge=t,exports.default=n,exports.text=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("./card.module.cjs");let
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../utilities/warn-unstyled-value.cjs"),r=require("./styled-values.cjs"),i=require("./card.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=a.default.forwardRef(({asChild:e=!1,variant:a=`elevated`,padding:c=`md`,radius:l=`lg`,interactive:u=!1,className:d,children:f,...p},m)=>{let h=e?t.Root:`div`;return r.CARD_STYLED_PADDING.includes(c)||n.warnUnstyledValue(`Card`,`padding`,c,r.CARD_STYLED_PADDING),r.CARD_STYLED_RADIUS.includes(l)||n.warnUnstyledValue(`Card`,`radius`,l,r.CARD_STYLED_RADIUS),(0,s.jsx)(h,{ref:m,className:(0,o.default)(`wim-card`,i.default.root,i.default[a],i.default[`padding-${c}`],i.default[`radius-${l}`],u&&i.default.interactive,d),...p,children:f})});c.displayName=`Card`;var l=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.header,e),...n,children:t}),u=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.body,e),...n,children:t}),d=({className:e,children:t,...n})=>(0,s.jsx)(`div`,{className:(0,o.default)(i.default.footer,e),...n,children:t});l.displayName=`Card.Header`,u.displayName=`Card.Body`,d.displayName=`Card.Footer`,c.Header=l,c.Body=u,c.Footer=d,exports.Card=c,exports.default=c,exports.CardBody=u,exports.CardFooter=d,exports.CardHeader=l;
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import n from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: n
|
|
18
|
-
}), s = ({ className: e, children: n, ...a }) => /* @__PURE__ */ i("div", {
|
|
19
|
-
className: r(t.body, e),
|
|
20
|
-
...a,
|
|
21
|
-
children: n
|
|
22
|
-
}), c = ({ className: e, children: n, ...a }) => /* @__PURE__ */ i("div", {
|
|
23
|
-
className: r(t.footer, e),
|
|
24
|
-
...a,
|
|
25
|
-
children: n
|
|
3
|
+
import { warnUnstyledValue as t } from "../../../utilities/warn-unstyled-value.js";
|
|
4
|
+
import { CARD_STYLED_PADDING as n, CARD_STYLED_RADIUS as r } from "./styled-values.js";
|
|
5
|
+
import i from "./card.module.js";
|
|
6
|
+
import a from "react";
|
|
7
|
+
import o from "classnames";
|
|
8
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
+
var c = a.forwardRef(({ asChild: a = !1, variant: c = "elevated", padding: l = "md", radius: u = "lg", interactive: d = !1, className: f, children: p, ...m }, h) => {
|
|
10
|
+
let g = a ? e : "div";
|
|
11
|
+
return n.includes(l) || t("Card", "padding", l, n), r.includes(u) || t("Card", "radius", u, r), /* @__PURE__ */ s(g, {
|
|
12
|
+
ref: h,
|
|
13
|
+
className: o("wim-card", i.root, i[c], i[`padding-${l}`], i[`radius-${u}`], d && i.interactive, f),
|
|
14
|
+
...m,
|
|
15
|
+
children: p
|
|
16
|
+
});
|
|
26
17
|
});
|
|
27
|
-
|
|
18
|
+
c.displayName = "Card";
|
|
19
|
+
var l = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
20
|
+
className: o(i.header, e),
|
|
21
|
+
...n,
|
|
22
|
+
children: t
|
|
23
|
+
}), u = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
24
|
+
className: o(i.body, e),
|
|
25
|
+
...n,
|
|
26
|
+
children: t
|
|
27
|
+
}), d = ({ className: e, children: t, ...n }) => /* @__PURE__ */ s("div", {
|
|
28
|
+
className: o(i.footer, e),
|
|
29
|
+
...n,
|
|
30
|
+
children: t
|
|
31
|
+
});
|
|
32
|
+
l.displayName = "Card.Header", u.displayName = "Card.Body", d.displayName = "Card.Footer", c.Header = l, c.Body = u, c.Footer = d;
|
|
28
33
|
//#endregion
|
|
29
|
-
export {
|
|
34
|
+
export { c as Card, c as default, u as CardBody, d as CardFooter, l as CardHeader };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `padding` and `radius` values `card.module.scss` actually implements.
|
|
3
|
+
*
|
|
4
|
+
* `CardProps` types both as the whole `ComponentSize`, so everything outside
|
|
5
|
+
* these lists type-checks and then does nothing. Narrowing the types is the
|
|
6
|
+
* real fix and it is breaking, so it waits for 0.8.0 (T38); until then `Card`
|
|
7
|
+
* warns in development instead of failing in silence.
|
|
8
|
+
*
|
|
9
|
+
* Written out rather than read off the CSS module on purpose: under Vitest a
|
|
10
|
+
* CSS module is a proxy that answers every key, so a check derived from it
|
|
11
|
+
* could never be tested. `Card.unstyled-values.test.tsx` reads
|
|
12
|
+
* `card.module.scss` off disk and fails if either list stops matching it.
|
|
13
|
+
*
|
|
14
|
+
* Not re-exported from the barrel — `src/data-display-core.ts` does
|
|
15
|
+
* `export * from "./Card/Card"`, and these are implementation detail.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CARD_STYLED_PADDING: readonly ["none", "xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
18
|
+
export declare const CARD_STYLED_RADIUS: readonly ["none", "sm", "md", "lg", "xl", "2xl"];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/data-display/Card/styled-values.ts
|
|
3
|
+
var e = [
|
|
4
|
+
"none",
|
|
5
|
+
"xs",
|
|
6
|
+
"sm",
|
|
7
|
+
"md",
|
|
8
|
+
"lg",
|
|
9
|
+
"xl",
|
|
10
|
+
"2xl",
|
|
11
|
+
"3xl"
|
|
12
|
+
], t = [
|
|
13
|
+
"none",
|
|
14
|
+
"sm",
|
|
15
|
+
"md",
|
|
16
|
+
"lg",
|
|
17
|
+
"xl",
|
|
18
|
+
"2xl"
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as CARD_STYLED_PADDING, t as CARD_STYLED_RADIUS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/FeedbackIcon.cjs"),n=require("../../_internal/FeedbackCloseButton.cjs"),r=require("./alert.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=({title:e,titleTag:s=`
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../_internal/FeedbackIcon.cjs"),n=require("../../_internal/FeedbackCloseButton.cjs"),r=require("./alert.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=({title:e,titleTag:s=`div`,description:c,intent:l=`default`,icon:u,onClose:d,className:f,children:p,...m})=>{let[h,g]=i.default.useState(!0);if(!h)return null;let _=()=>{g(!1),d&&d()},v=u!==void 0||l===`success`||l===`warning`||l===`danger`||l===`info`;return(0,o.jsxs)(`div`,{className:(0,a.default)(`wim-alert`,r.default.root,r.default[l],f),role:`alert`,...m,children:[v&&(0,o.jsx)(`div`,{className:r.default.icon,children:(0,o.jsx)(t.FeedbackIcon,{intent:l,icon:u,size:`sm`})}),(0,o.jsxs)(`div`,{className:r.default.content,children:[e&&(0,o.jsx)(s,{className:r.default.title,children:e}),(c||p)&&(0,o.jsx)(`div`,{className:r.default.description,children:c||p})]}),(0,o.jsx)(n.FeedbackCloseButton,{onClose:d?_:void 0,className:r.default.close,size:`sm`})]})};exports.Alert=s;
|
|
@@ -6,10 +6,17 @@ type AlertProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
|
6
6
|
*/
|
|
7
7
|
title?: React.ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
* HTML tag used for the alert title
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* HTML tag used for the alert title.
|
|
10
|
+
*
|
|
11
|
+
* The default is a `div`: an alert is a notice, not a section of the
|
|
12
|
+
* document, so its title does not belong in the heading outline. Making it
|
|
13
|
+
* one also breaks `heading-order` as soon as the alert sits under anything
|
|
14
|
+
* other than an `h3`. Pass a heading only when the alert really does head a
|
|
15
|
+
* section of the page.
|
|
16
|
+
*
|
|
17
|
+
* @default "div"
|
|
18
|
+
*/
|
|
19
|
+
titleTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "p" | "strong" | "span";
|
|
13
20
|
/**
|
|
14
21
|
* Description text of the alert
|
|
15
22
|
*/
|
|
@@ -6,7 +6,7 @@ import r from "react";
|
|
|
6
6
|
import i from "classnames";
|
|
7
7
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/feedback/Alert/Alert.tsx
|
|
9
|
-
var s = ({ title: s, titleTag: c = "
|
|
9
|
+
var s = ({ title: s, titleTag: c = "div", description: l, intent: u = "default", icon: d, onClose: f, className: p, children: m, ...h }) => {
|
|
10
10
|
let [g, _] = r.useState(!0);
|
|
11
11
|
if (!g) return null;
|
|
12
12
|
let v = () => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../icon/alert-circle.cjs"),r=require("../../../icon/check.cjs"),i=require("../../../icon/circle.cjs"),a=require("../../../icon/info-circle.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./result.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=({intent:e,status:t,className:s})=>{if(t)return(0,u.jsx)(o.Icon,{component:n.default,color:`
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../icon/alert-circle.cjs"),r=require("../../../icon/check.cjs"),i=require("../../../icon/circle.cjs"),a=require("../../../icon/info-circle.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./result.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=({intent:e,status:t,className:s})=>{if(t)return(0,u.jsx)(o.Icon,{component:n.default,color:`tertiary`,className:s});switch(e){case`success`:return(0,u.jsx)(o.Icon,{component:r.default,color:`success`,className:s});case`danger`:return(0,u.jsx)(o.Icon,{component:n.default,color:`danger`,className:s});case`warning`:return(0,u.jsx)(o.Icon,{component:n.default,color:`warning`,className:s});case`info`:return(0,u.jsx)(o.Icon,{component:a.default,color:`info`,className:s});default:return(0,u.jsx)(o.Icon,{component:i.default,color:`tertiary`,className:s})}},f=({intent:e=`default`,status:n,title:r,description:i,extra:a,icon:o,className:c,children:f})=>(0,u.jsx)(t.InteractiveArea,{icon:o||(0,u.jsx)(d,{intent:e,status:n,className:s.default.icon}),title:r??void 0,description:i??void 0,actions:a,variant:`none`,bgVariant:`transparent`,className:(0,l.default)(`wim-result`,s.default.root,e&&s.default[e],n&&s.default[n],c),styles:{inner:s.default.inner,icon:s.default.icon,content:s.default.content},children:f});exports.Result=f;
|
|
@@ -13,7 +13,7 @@ import { jsx as c } from "react/jsx-runtime";
|
|
|
13
13
|
var l = ({ intent: e, status: o, className: s }) => {
|
|
14
14
|
if (o) return /* @__PURE__ */ c(a, {
|
|
15
15
|
component: t,
|
|
16
|
-
color: "
|
|
16
|
+
color: "tertiary",
|
|
17
17
|
className: s
|
|
18
18
|
});
|
|
19
19
|
switch (e) {
|
|
@@ -39,7 +39,7 @@ var l = ({ intent: e, status: o, className: s }) => {
|
|
|
39
39
|
});
|
|
40
40
|
default: return /* @__PURE__ */ c(a, {
|
|
41
41
|
component: r,
|
|
42
|
-
color: "
|
|
42
|
+
color: "tertiary",
|
|
43
43
|
className: s
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("./dropzone.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({label:e,description:l,accept:u,multiple:d=!1,disabled:f=!1,
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../layout/InteractiveArea/InteractiveArea.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../media/Icon/Icon.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("./dropzone.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({label:e,description:l,accept:u,multiple:d=!1,disabled:f=!1,value:p,onChange:m,className:h,iconName:g=`UploadIcon`,error:_,required:v,layout:y=`vertical`,size:b=`md`})=>{let{t:x}=n.useWimTranslation(`form`),S=l??x(`dropzone.description`),C=`wim-dropzone-${o.default.useId()}`,w=e?`${C}-label`:void 0,T=_?`${C}-error`:void 0,E=(0,o.useRef)(null),[D,O]=(0,o.useState)(!1),[k,A]=(0,o.useState)(null),j=()=>{f||E.current?.click()},M=e=>{e.preventDefault(),!f&&O(!0)},N=()=>{O(!1)},P=e=>{if(e.preventDefault(),O(!1),f)return;let t=e.dataTransfer.files;A(t),m&&m(t)},F=e=>{let t=e.target.files;A(t),m&&m(t)},I=p===void 0?k?Array.from(k).map(e=>e.name):[]:p;return(0,c.jsxs)(i.FieldTemplate,{label:e,error:_,required:v,layout:y,labelId:w,errorId:T,className:(0,s.default)(`wim-dropzone`,a.default.container,h),children:[(0,c.jsx)(`input`,{type:`file`,ref:E,accept:u,multiple:d,disabled:f,onChange:F,style:{display:`none`},"aria-hidden":`true`,tabIndex:-1}),(0,c.jsx)(t.InteractiveArea,{className:a.default.dropzone,size:b,isDragging:D,disabled:f,isClickable:!f,onClick:j,onDragOver:M,onDragLeave:N,onDrop:P,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&j()},"aria-labelledby":w,"aria-describedby":T,"aria-required":v,"aria-invalid":!!_,icon:g&&(0,c.jsx)(r.Icon,{name:g,color:f?`disabled`:`primary`}),description:S,children:I.length>0?(0,c.jsx)(`div`,{className:a.default.fileList,children:I.map((e,t)=>(0,c.jsx)(`span`,{className:a.default.fileName,children:e},t))}):null})]})};exports.Dropzone=l;
|
|
@@ -12,6 +12,15 @@ type DropzoneProps = {
|
|
|
12
12
|
multiple?: boolean;
|
|
13
13
|
/** Whether the component is disabled. */
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Names of the files the area should list — typically ones that already
|
|
17
|
+
* exist on the server, from an earlier session or an earlier step.
|
|
18
|
+
*
|
|
19
|
+
* Controlled: while this is set, it is what the area lists, and dropping or
|
|
20
|
+
* picking a file only fires `onChange`. Pass the new names back to show
|
|
21
|
+
* them. Leave it undefined to let the area track its own selection.
|
|
22
|
+
*/
|
|
23
|
+
value?: string[];
|
|
15
24
|
/** Callback when files are selected. */
|
|
16
25
|
onChange?: (files: FileList | null) => void;
|
|
17
26
|
/** Additional class names. */
|
|
@@ -30,5 +39,5 @@ type DropzoneProps = {
|
|
|
30
39
|
/**
|
|
31
40
|
* Component for uploading files by drag and drop or by clicking.
|
|
32
41
|
*/
|
|
33
|
-
export declare const Dropzone: ({ label, description, accept, multiple, disabled, onChange, className, iconName, error, required, layout, size, }: DropzoneProps) => React.JSX.Element;
|
|
42
|
+
export declare const Dropzone: ({ label, description, accept, multiple, disabled, value, onChange, className, iconName, error, required, layout, size, }: DropzoneProps) => React.JSX.Element;
|
|
34
43
|
export {};
|
|
@@ -8,66 +8,66 @@ import a, { useRef as o, useState as s } from "react";
|
|
|
8
8
|
import c from "classnames";
|
|
9
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/form/Dropzone/Dropzone.tsx
|
|
11
|
-
var d = ({ label: d, description: f, accept: p, multiple: m = !1, disabled: h = !1,
|
|
12
|
-
let { t:
|
|
13
|
-
h ||
|
|
14
|
-
}
|
|
11
|
+
var d = ({ label: d, description: f, accept: p, multiple: m = !1, disabled: h = !1, value: g, onChange: _, className: v, iconName: y = "UploadIcon", error: b, required: x, layout: S = "vertical", size: C = "md" }) => {
|
|
12
|
+
let { t: w } = t("form"), T = f ?? w("dropzone.description"), E = `wim-dropzone-${a.useId()}`, D = d ? `${E}-label` : void 0, O = b ? `${E}-error` : void 0, k = o(null), [A, j] = s(!1), [M, N] = s(null), P = () => {
|
|
13
|
+
h || k.current?.click();
|
|
14
|
+
}, F = (e) => {
|
|
15
|
+
e.preventDefault(), !h && j(!0);
|
|
16
|
+
}, I = () => {
|
|
17
|
+
j(!1);
|
|
18
|
+
}, L = (e) => {
|
|
19
|
+
if (e.preventDefault(), j(!1), h) return;
|
|
20
|
+
let t = e.dataTransfer.files;
|
|
21
|
+
N(t), _ && _(t);
|
|
22
|
+
}, R = (e) => {
|
|
23
|
+
let t = e.target.files;
|
|
24
|
+
N(t), _ && _(t);
|
|
25
|
+
}, z = g === void 0 ? M ? Array.from(M).map((e) => e.name) : [] : g;
|
|
15
26
|
return /* @__PURE__ */ u(r, {
|
|
16
27
|
label: d,
|
|
17
|
-
error:
|
|
18
|
-
required:
|
|
19
|
-
layout:
|
|
20
|
-
labelId:
|
|
21
|
-
errorId:
|
|
22
|
-
className: c("wim-dropzone", i.container,
|
|
28
|
+
error: b,
|
|
29
|
+
required: x,
|
|
30
|
+
layout: S,
|
|
31
|
+
labelId: D,
|
|
32
|
+
errorId: O,
|
|
33
|
+
className: c("wim-dropzone", i.container, v),
|
|
23
34
|
children: [/* @__PURE__ */ l("input", {
|
|
24
35
|
type: "file",
|
|
25
|
-
ref:
|
|
36
|
+
ref: k,
|
|
26
37
|
accept: p,
|
|
27
38
|
multiple: m,
|
|
28
39
|
disabled: h,
|
|
29
|
-
onChange:
|
|
30
|
-
let t = e.target.files;
|
|
31
|
-
M(t), g && g(t);
|
|
32
|
-
},
|
|
40
|
+
onChange: R,
|
|
33
41
|
style: { display: "none" },
|
|
34
42
|
"aria-hidden": "true",
|
|
35
43
|
tabIndex: -1
|
|
36
44
|
}), /* @__PURE__ */ l(e, {
|
|
37
45
|
className: i.dropzone,
|
|
38
|
-
size:
|
|
39
|
-
isDragging:
|
|
46
|
+
size: C,
|
|
47
|
+
isDragging: A,
|
|
40
48
|
disabled: h,
|
|
41
49
|
isClickable: !h,
|
|
42
|
-
onClick:
|
|
43
|
-
onDragOver:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onDragLeave: () => {
|
|
47
|
-
A(!1);
|
|
48
|
-
},
|
|
49
|
-
onDrop: (e) => {
|
|
50
|
-
if (e.preventDefault(), A(!1), h) return;
|
|
51
|
-
let t = e.dataTransfer.files;
|
|
52
|
-
M(t), g && g(t);
|
|
53
|
-
},
|
|
50
|
+
onClick: P,
|
|
51
|
+
onDragOver: F,
|
|
52
|
+
onDragLeave: I,
|
|
53
|
+
onDrop: L,
|
|
54
54
|
onKeyDown: (e) => {
|
|
55
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
55
|
+
(e.key === "Enter" || e.key === " ") && P();
|
|
56
56
|
},
|
|
57
|
-
"aria-labelledby":
|
|
58
|
-
"aria-describedby":
|
|
59
|
-
"aria-required":
|
|
60
|
-
"aria-invalid": !!
|
|
61
|
-
icon:
|
|
62
|
-
name:
|
|
57
|
+
"aria-labelledby": D,
|
|
58
|
+
"aria-describedby": O,
|
|
59
|
+
"aria-required": x,
|
|
60
|
+
"aria-invalid": !!b,
|
|
61
|
+
icon: y && /* @__PURE__ */ l(n, {
|
|
62
|
+
name: y,
|
|
63
63
|
color: h ? "disabled" : "primary"
|
|
64
64
|
}),
|
|
65
|
-
description:
|
|
66
|
-
children:
|
|
65
|
+
description: T,
|
|
66
|
+
children: z.length > 0 ? /* @__PURE__ */ l("div", {
|
|
67
67
|
className: i.fileList,
|
|
68
|
-
children:
|
|
68
|
+
children: z.map((e, t) => /* @__PURE__ */ l("span", {
|
|
69
69
|
className: i.fileName,
|
|
70
|
-
children: e
|
|
70
|
+
children: e
|
|
71
71
|
}, t))
|
|
72
72
|
}) : null
|
|
73
73
|
})]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./fieldset.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({children:e,disabled:n=!1,variant:a=`default`,className:o,...s})=>(0,i.jsx)(`fieldset`,{className:(0,r.default)(`wim-fieldset`,t.default.root,a===`full-width`&&t.default.fullWidth,o),disabled:n,...s,children:e});exports.Fieldset=a;
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./fieldset.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({children:e,disabled:n=!1,variant:a=`default`,className:o,...s})=>(0,i.jsx)(`fieldset`,{className:(0,r.default)(`wim-fieldset`,t.default.root,a===`full-width`&&t.default.fullWidth,a===`plain`&&t.default.plain,o),disabled:n,...s,children:e});exports.Fieldset=a;
|
|
@@ -4,8 +4,15 @@ type FieldsetProps = React.ComponentPropsWithoutRef<"fieldset"> & {
|
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
/** Whether all contained form elements are disabled */
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Visual variant of the fieldset.
|
|
9
|
+
*
|
|
10
|
+
* `plain` drops the frame and padding and keeps only the grouping — use it
|
|
11
|
+
* inside a `Card` or any surface that already draws a border, where a framed
|
|
12
|
+
* fieldset would put a box inside a box. The `<fieldset>` and its `<legend>`
|
|
13
|
+
* still do their job for assistive technology.
|
|
14
|
+
*/
|
|
15
|
+
variant?: "default" | "full-width" | "plain";
|
|
9
16
|
/** Additional class names */
|
|
10
17
|
className?: string;
|
|
11
18
|
};
|
|
@@ -5,7 +5,7 @@ import t from "classnames";
|
|
|
5
5
|
import { jsx as n } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/form/Fieldset/Fieldset.tsx
|
|
7
7
|
var r = ({ children: r, disabled: i = !1, variant: a = "default", className: o, ...s }) => /* @__PURE__ */ n("fieldset", {
|
|
8
|
-
className: t("wim-fieldset", e.root, a === "full-width" && e.fullWidth, o),
|
|
8
|
+
className: t("wim-fieldset", e.root, a === "full-width" && e.fullWidth, a === "plain" && e.plain, o),
|
|
9
9
|
disabled: i,
|
|
10
10
|
...s,
|
|
11
11
|
children: r
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var e=`
|
|
2
|
+
var e=`_root_1uiyp_2`,t=`_fullWidth_1uiyp_12`,n=`_plain_1uiyp_15`,r={root:e,fullWidth:t,plain:n};exports.default=r,exports.fullWidth=t,exports.plain=n,exports.root=e;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
//#region src/components/form/Fieldset/fieldset.module.scss
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_root_1uiyp_2", t = "_fullWidth_1uiyp_12", n = "_plain_1uiyp_15", r = {
|
|
4
4
|
root: e,
|
|
5
|
-
fullWidth: t
|
|
5
|
+
fullWidth: t,
|
|
6
|
+
plain: n
|
|
6
7
|
};
|
|
7
8
|
//#endregion
|
|
8
|
-
export {
|
|
9
|
+
export { r as default, t as fullWidth, n as plain, e as root };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),r=require("../Button/Button.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("./file-upload.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({label:e,buttonLabel:l,noFileLabel:u,accept:d,multiple:f=!1,disabled:p=!1,
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../layout/VisuallyHidden/VisuallyHidden.cjs"),r=require("../Button/Button.cjs"),i=require("../FieldTemplate/FieldTemplate.cjs"),a=require("./file-upload.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=({label:e,buttonLabel:l,noFileLabel:u,accept:d,multiple:f=!1,disabled:p=!1,value:m,onChange:h,className:g,iconName:_,iconPosition:v,size:y=`md`,error:b,required:x,layout:S=`vertical`})=>{let{t:C}=t.useWimTranslation(`form`),w=`wim-fileupload-${o.default.useId()}`,T=e?`${w}-label`:void 0,E=b?`${w}-error`:void 0,D=x?`${w}-required`:void 0,O=[E,D].filter(Boolean).join(` `)||void 0,k=(0,o.useRef)(null),[A,j]=(0,o.useState)(null),M=()=>{k.current?.click()},N=e=>{let t=e.target.files;j(t),h&&h(t)},P=m===void 0?A?Array.from(A).map(e=>e.name):[]:m,F=P.length>0?P.join(`, `):u??C(`fileupload.no_file`);return(0,c.jsx)(i.FieldTemplate,{label:e,error:b,required:x,layout:S,labelId:T,errorId:E,className:(0,s.default)(`wim-file-upload`,a.default.root,a.default[y],g),children:(0,c.jsxs)(`div`,{className:a.default.controls,children:[(0,c.jsx)(`input`,{type:`file`,ref:k,accept:d,multiple:f,disabled:p,onChange:N,className:a.default.input,"aria-hidden":`true`,tabIndex:-1}),(0,c.jsx)(r.Button,{onClick:M,disabled:p,variant:`outline`,icon:_,iconPosition:v,size:y,"aria-labelledby":T,"aria-describedby":O,"aria-invalid":b?!0:void 0,children:l??C(`fileupload.button`)}),x&&(0,c.jsx)(n.VisuallyHidden,{id:D,children:C(`form.required`)}),(0,c.jsx)(`span`,{className:(0,s.default)(a.default.fileNames,a.default[y],p&&a.default.disabled),"aria-disabled":p||void 0,children:F})]})})};exports.FileUpload=l;
|
|
@@ -14,6 +14,15 @@ type FileUploadProps = {
|
|
|
14
14
|
multiple?: boolean;
|
|
15
15
|
/** Whether the component is disabled */
|
|
16
16
|
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Names of the files the field should show — typically ones that already
|
|
19
|
+
* exist on the server, from an earlier session or an earlier step.
|
|
20
|
+
*
|
|
21
|
+
* Controlled: while this is set, it is what the field displays, and picking
|
|
22
|
+
* a file only fires `onChange`. Pass the new names back to show them. Leave
|
|
23
|
+
* it undefined to let the field track its own selection.
|
|
24
|
+
*/
|
|
25
|
+
value?: string[];
|
|
17
26
|
/** Callback when files are selected */
|
|
18
27
|
onChange?: (files: FileList | null) => void;
|
|
19
28
|
/** Additional class names */
|
|
@@ -34,5 +43,5 @@ type FileUploadProps = {
|
|
|
34
43
|
/**
|
|
35
44
|
* Component for selecting and uploading files.
|
|
36
45
|
*/
|
|
37
|
-
export declare const FileUpload: ({ label, buttonLabel, noFileLabel, accept, multiple, disabled, onChange, className, iconName, iconPosition, size, error, required, layout, }: FileUploadProps) => React.JSX.Element;
|
|
46
|
+
export declare const FileUpload: ({ label, buttonLabel, noFileLabel, accept, multiple, disabled, value, onChange, className, iconName, iconPosition, size, error, required, layout, }: FileUploadProps) => React.JSX.Element;
|
|
38
47
|
export {};
|
|
@@ -8,55 +8,55 @@ import a, { useRef as o, useState as s } from "react";
|
|
|
8
8
|
import c from "classnames";
|
|
9
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/form/FileUpload/FileUpload.tsx
|
|
11
|
-
var d = ({ label: d, buttonLabel: f, noFileLabel: p, accept: m, multiple: h = !1, disabled: g = !1,
|
|
12
|
-
let { t:
|
|
13
|
-
|
|
14
|
-
},
|
|
11
|
+
var d = ({ label: d, buttonLabel: f, noFileLabel: p, accept: m, multiple: h = !1, disabled: g = !1, value: _, onChange: v, className: y, iconName: b, iconPosition: x, size: S = "md", error: C, required: w, layout: T = "vertical" }) => {
|
|
12
|
+
let { t: E } = e("form"), D = `wim-fileupload-${a.useId()}`, O = d ? `${D}-label` : void 0, k = C ? `${D}-error` : void 0, A = w ? `${D}-required` : void 0, j = [k, A].filter(Boolean).join(" ") || void 0, M = o(null), [N, P] = s(null), F = () => {
|
|
13
|
+
M.current?.click();
|
|
14
|
+
}, I = (e) => {
|
|
15
15
|
let t = e.target.files;
|
|
16
|
-
|
|
17
|
-
},
|
|
16
|
+
P(t), v && v(t);
|
|
17
|
+
}, L = _ === void 0 ? N ? Array.from(N).map((e) => e.name) : [] : _, R = L.length > 0 ? L.join(", ") : p ?? E("fileupload.no_file");
|
|
18
18
|
return /* @__PURE__ */ l(r, {
|
|
19
19
|
label: d,
|
|
20
|
-
error:
|
|
21
|
-
required:
|
|
22
|
-
layout:
|
|
23
|
-
labelId:
|
|
24
|
-
errorId:
|
|
25
|
-
className: c("wim-file-upload", i.root, i[
|
|
20
|
+
error: C,
|
|
21
|
+
required: w,
|
|
22
|
+
layout: T,
|
|
23
|
+
labelId: O,
|
|
24
|
+
errorId: k,
|
|
25
|
+
className: c("wim-file-upload", i.root, i[S], y),
|
|
26
26
|
children: /* @__PURE__ */ u("div", {
|
|
27
27
|
className: i.controls,
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ l("input", {
|
|
30
30
|
type: "file",
|
|
31
|
-
ref:
|
|
31
|
+
ref: M,
|
|
32
32
|
accept: m,
|
|
33
33
|
multiple: h,
|
|
34
34
|
disabled: g,
|
|
35
|
-
onChange:
|
|
35
|
+
onChange: I,
|
|
36
36
|
className: i.input,
|
|
37
37
|
"aria-hidden": "true",
|
|
38
38
|
tabIndex: -1
|
|
39
39
|
}),
|
|
40
40
|
/* @__PURE__ */ l(n, {
|
|
41
|
-
onClick:
|
|
41
|
+
onClick: F,
|
|
42
42
|
disabled: g,
|
|
43
43
|
variant: "outline",
|
|
44
|
-
icon:
|
|
45
|
-
iconPosition:
|
|
46
|
-
size:
|
|
47
|
-
"aria-labelledby":
|
|
48
|
-
"aria-describedby":
|
|
49
|
-
"aria-invalid":
|
|
50
|
-
children: f ??
|
|
44
|
+
icon: b,
|
|
45
|
+
iconPosition: x,
|
|
46
|
+
size: S,
|
|
47
|
+
"aria-labelledby": O,
|
|
48
|
+
"aria-describedby": j,
|
|
49
|
+
"aria-invalid": C ? !0 : void 0,
|
|
50
|
+
children: f ?? E("fileupload.button")
|
|
51
51
|
}),
|
|
52
|
-
|
|
53
|
-
id:
|
|
54
|
-
children:
|
|
52
|
+
w && /* @__PURE__ */ l(t, {
|
|
53
|
+
id: A,
|
|
54
|
+
children: E("form.required")
|
|
55
55
|
}),
|
|
56
56
|
/* @__PURE__ */ l("span", {
|
|
57
|
-
className: c(i.fileNames, i[
|
|
57
|
+
className: c(i.fileNames, i[S], g && i.disabled),
|
|
58
58
|
"aria-disabled": g || void 0,
|
|
59
|
-
children:
|
|
59
|
+
children: R
|
|
60
60
|
})
|
|
61
61
|
]
|
|
62
62
|
})
|
|
@@ -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("../../../i18n/useWimTranslation.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),ee=require("../../../hooks/useMergedRef.cjs"),te=require("../InputBase/InputBase.cjs"),ne=require("../FieldTemplate/FieldTemplate.cjs"),r=require("./input.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=(0,i.forwardRef)(({intent:e=`default`,variant:s=`outline`,fullWidth:c=!1,className:re,disabled:ie,leftIcon:ae,rightIcon:l,leftIconColor:oe,rightIconColor:se,onLeftIconClick:u,onRightIconClick:d,allowClear:f=!1,showPasswordToggle:p=!0,rightIconClassName:m,rightIconRotated:ce,width:h,value:g,defaultValue:le,onChange:_,type:v,label:y,error:b,required:x,layout:S,id:C,inputClassName:w,showPasswordAriaLabel:T,hidePasswordAriaLabel:E,rightIconAriaLabel:D,suffix:O,styles:k,asChild:A=!1,children:j,...M},N)=>{let{t:P}=n.useWimTranslation(`common`),F=T??P(`a11y.show_password`),I=E??P(`a11y.hide_password`),L=D??P(`a11y.right_icon_action`),[R,z]=(0,i.useState)(le??``),[B,V]=(0,i.useState)(!1),H=(0,i.useRef)(null),U=ee.useMergedRef(N,H),W=g!==void 0,G=W?g:R,K=ie,ue=e=>{W||z(e.target.value),_?.(e)},de=()=>{let e=H.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;t?(t.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0}))):(W||z(``),_&&(e.value=``,_({target:e,currentTarget:e}))),W||z(``)},q=()=>{V(e=>!e)},fe=v===`password`&&p,J=[];fe&&J.push({name:B?`EyeOffIcon`:`EyeIcon`,onClick:e=>q(),ariaLabel:B?I:F}),l&&(J.some(e=>e.name===l)||J.push({name:l,onClick:d,color:se,ariaLabel:L,className:m,rotated:ce}));let pe=v===`password`&&B?`text`:v,Y=b?`danger`:e,me=(0,i.useId)(),X=C||`wim-input-${me}`,Z=b?`${X}-error`:void 0,Q=O!=null&&O!==``?`${X}-suffix`:void 0,he=[Z,Q].filter(Boolean).join(` `)||void 0,$=y?`${X}-label`:void 0;return(0,o.jsx)(ne.FieldTemplate,{label:y,error:b,required:x,layout:S,labelId:$,htmlFor:X,errorId:Z,className:re,children:(0,o.jsx)(te.InputBase,{intent:Y,variant:s,fullWidth:c,width:h,disabled:K,leftIcon:ae,leftIconColor:oe,onLeftIconClick:u,rightIcons:J,suffix:O,suffixId:Q,allowClear:f,hasValue:!!G,onClear:de,styles:k,children:(0,o.jsx)(A?t.Root:`input`,{id:X,ref:U,className:(0,a.default)(`wim-input`,r.default.root,r.default[Y],K&&r.default.disabled,r.default[s],w),disabled:K,value:G,onChange:ue,type:pe,"aria-invalid":Y===`danger`,"aria-describedby":he,"aria-labelledby":y?$:void 0,"aria-required":x,...M,children:A?(0,o.jsx)(t.Slottable,{children:j}):null})})})});s.displayName=`Input`,exports.Input=s,exports.default=s;
|
|
@@ -47,6 +47,12 @@ export interface InputProps extends Omit<React.ComponentPropsWithoutRef<"input">
|
|
|
47
47
|
hidePasswordAriaLabel?: string;
|
|
48
48
|
/** Aria label for the right icon button */
|
|
49
49
|
rightIconAriaLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Static text shown after the field, inside the same shell — a unit such as
|
|
52
|
+
* `kg`, `%` or `円`. It is announced with the field via `aria-describedby`,
|
|
53
|
+
* so the unit does not have to be repeated in the label.
|
|
54
|
+
*/
|
|
55
|
+
suffix?: React.ReactNode;
|
|
50
56
|
/** Custom styles for internal parts */
|
|
51
57
|
styles?: React.ComponentProps<typeof InputBase>["styles"];
|
|
52
58
|
/** Whether to render as a child element. */
|