@clearstory/drywall-react 4.1.3 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/{AdapterDayjs-CI-cczs8.js → AdapterDayjs-B-aQ7t7H.js} +1 -1
- package/dist/{Datepicker-5EuKlnxP.js → Datepicker-BvCR9LUk.js} +1 -1
- package/dist/components/AutocompleteControl/AutocompleteControl.d.ts +5 -1
- package/dist/components/AutocompleteControl/AutocompleteControl.js +70 -24
- package/dist/components/AutocompleteControl/index.js +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/index.js +2 -2
- package/dist/components/DatepickerControl/DatepickerControl.d.ts +5 -1
- package/dist/components/DatepickerControl/DatepickerControl.js +120 -24
- package/dist/components/DatepickerControl/index.js +1 -1
- package/dist/components/DialogClose/DialogClose.d.ts +1 -1
- package/dist/components/DialogClose/DialogClose.js +2 -17
- package/dist/components/FormSublabel/FormSublabel.d.ts +2 -2
- package/dist/components/FormSublabel/FormSublabel.js +8 -23
- package/dist/components/FormSublabel/index.js +2 -2
- package/dist/components/InputControl/InputControl.d.ts +5 -1
- package/dist/components/InputControl/InputControl.js +88 -24
- package/dist/components/InputControl/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +614 -22
- package/dist/components/NumberInput/index.js +1 -1
- package/dist/components/NumberInputControl/NumberInputControl.d.ts +5 -1
- package/dist/components/NumberInputControl/NumberInputControl.js +86 -24
- package/dist/components/NumberInputControl/index.js +1 -1
- package/dist/components/SelectControl/SelectControl.d.ts +5 -1
- package/dist/components/SelectControl/SelectControl.js +90 -24
- package/dist/components/SelectControl/index.js +1 -1
- package/dist/eslint-config/index.d.ts +5 -0
- package/dist/eslint-config/index.js +29 -0
- package/dist/eslint-config/no-system-props.d.ts +3 -0
- package/dist/eslint-config/no-system-props.js +284 -0
- package/dist/eslint-config/no-system-props.test.d.ts +1 -0
- package/dist/main.js +449 -443
- package/package.json +2 -2
- package/dist/SelectControl-JlfR4Ddv.js +0 -1043
package/README.md
CHANGED
|
@@ -35,3 +35,13 @@ function App() {
|
|
|
35
35
|
|
|
36
36
|
export default App;
|
|
37
37
|
```
|
|
38
|
+
|
|
39
|
+
## ESLint Rules
|
|
40
|
+
|
|
41
|
+
This library includes custom ESLint rules to help enforce best practices. Add to your `eslint.config.js`:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import drywallReact from "@clearstory/drywall-react/eslint-config";
|
|
45
|
+
|
|
46
|
+
export default [drywallReact];
|
|
47
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as gt } from "./index-CFunVsti.js";
|
|
2
2
|
import { g as Q } from "./index-CyAhC1RZ.js";
|
|
3
|
-
import { w as Dt } from "./Datepicker-
|
|
3
|
+
import { w as Dt } from "./Datepicker-BvCR9LUk.js";
|
|
4
4
|
var tt = { exports: {} }, $t = tt.exports, ht;
|
|
5
5
|
function Tt() {
|
|
6
6
|
return ht || (ht = 1, (function(W, t) {
|
|
@@ -10481,7 +10481,7 @@ process.env.NODE_ENV !== "production" && (An.propTypes = {
|
|
|
10481
10481
|
const hc = q("div", {
|
|
10482
10482
|
name: "DateField",
|
|
10483
10483
|
slot: "Root",
|
|
10484
|
-
shouldForwardProp: (e) => e !== "error" && e !== "disabled"
|
|
10484
|
+
shouldForwardProp: (e) => e !== "error" && e !== "disabled" && e !== "slotProps" && e !== "inputRef"
|
|
10485
10485
|
})(({ theme: e, error: n, color: o = "primary", disabled: r }) => {
|
|
10486
10486
|
const s = n ? e.vars?.palette.error.main : o && e.vars?.palette[o]?.main, a = n ? e.vars?.palette.error.light : o && e.vars?.palette[o]?.light;
|
|
10487
10487
|
return {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ReactNode, DOMAttributes, ElementType, Ref, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlProps } from '../FormControl';
|
|
3
|
+
import { FormHelperTextProps } from '../FormHelperText';
|
|
4
|
+
import { FormLabelProps } from '../FormLabel';
|
|
5
|
+
import { FormSublabelProps } from '../FormSublabel';
|
|
6
|
+
import { AutocompleteProps } from '../Autocomplete';
|
|
3
7
|
type DOMEventHandlers = keyof DOMAttributes<HTMLElement>;
|
|
4
8
|
export interface AutocompleteControlProps<Value, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false, ChipComponent extends ElementType = "div"> extends Omit<AutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>, "ref" | "slotProps"> {
|
|
5
9
|
helperText?: ReactNode;
|
|
@@ -1,30 +1,76 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as F } from "react";
|
|
3
|
+
import { FormSublabel as I } from "../FormSublabel/FormSublabel.js";
|
|
4
|
+
import { A as y } from "../../Autocomplete-FWamSgvx.js";
|
|
5
|
+
import { useId as g } from "../../hooks/useId.js";
|
|
4
6
|
import "../../icons/ClearstoryIcon.js";
|
|
5
7
|
import "../../icons/InternalOnlyIcon.js";
|
|
6
8
|
import "../../icons/MoneyBucketIcon.js";
|
|
7
9
|
import "../../icons/MoreCircleOutlineIcon.js";
|
|
8
|
-
import "../../Info-Cykl51qM.js";
|
|
9
|
-
import "../../
|
|
10
|
-
import "../../
|
|
11
|
-
import {
|
|
12
|
-
import "../../
|
|
13
|
-
import "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
import { I as A } from "../../Info-Cykl51qM.js";
|
|
11
|
+
import { F as C } from "../../FormControl-SJ7nmkLi.js";
|
|
12
|
+
import { B as T } from "../../Box-CRpDZJO_.js";
|
|
13
|
+
import { F as w } from "../../FormLabel-Cq6v8zn0.js";
|
|
14
|
+
import { T as B } from "../../Tooltip-D_k6EcdK.js";
|
|
15
|
+
import { F as $ } from "../../FormHelperText-Dh36nlW5.js";
|
|
16
|
+
function j(n, c) {
|
|
17
|
+
const {
|
|
18
|
+
disabled: m,
|
|
19
|
+
error: p,
|
|
20
|
+
helperText: l,
|
|
21
|
+
id: b,
|
|
22
|
+
label: f,
|
|
23
|
+
required: h,
|
|
24
|
+
slotProps: r,
|
|
25
|
+
sublabel: a,
|
|
26
|
+
tooltip: s,
|
|
27
|
+
...e
|
|
28
|
+
} = n, u = g("autocomplete"), i = b || u, t = l ? `${i}-helper` : void 0;
|
|
29
|
+
return /* @__PURE__ */ d(C, { disabled: m, error: p, ...r?.root, children: [
|
|
30
|
+
/* @__PURE__ */ d(
|
|
31
|
+
T,
|
|
32
|
+
{
|
|
33
|
+
sx: {
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
display: "flex",
|
|
36
|
+
gap: "0.25rem"
|
|
37
|
+
},
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ o(w, { htmlFor: i, required: h, ...r?.label, children: f }),
|
|
40
|
+
s && /* @__PURE__ */ o(B, { title: s, arrow: !0, children: /* @__PURE__ */ o(
|
|
41
|
+
A,
|
|
42
|
+
{
|
|
43
|
+
sx: ({ vars: x }) => ({
|
|
44
|
+
color: x?.palette.text.secondary,
|
|
45
|
+
marginBlockEnd: "3px",
|
|
46
|
+
height: "1rem",
|
|
47
|
+
width: "1rem"
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
a && /* @__PURE__ */ o(I, { ...r?.sublabel, children: a }),
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
y,
|
|
57
|
+
{
|
|
58
|
+
disabled: m,
|
|
59
|
+
ref: c,
|
|
60
|
+
error: p,
|
|
61
|
+
id: i,
|
|
62
|
+
"aria-describedby": t ? e["aria-describedby"] ? `${e["aria-describedby"]} ${t}` : t : e["aria-describedby"],
|
|
63
|
+
slotProps: r?.autocomplete,
|
|
64
|
+
...e
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
l && /* @__PURE__ */ o($, { id: t, ...r?.helperText, children: l })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
const P = F(
|
|
71
|
+
j
|
|
72
|
+
);
|
|
73
|
+
P.displayName = "AutocompleteControl";
|
|
28
74
|
export {
|
|
29
|
-
|
|
75
|
+
P as AutocompleteControl
|
|
30
76
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { D, D as f } from "../../Datepicker-
|
|
3
|
+
import { D, D as f } from "../../Datepicker-BvCR9LUk.js";
|
|
4
4
|
import "../../styled-SBTDGe0C.js";
|
|
5
5
|
import "../../InputAdornment-BZDlmn1r.js";
|
|
6
6
|
import "../../useForkRef-9kN4DArm.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as e, a as r, b as i, D as t, L as l, M as o, P as d, e as C, d as c, f as D, D as k, g as n, j as p, i as P, p as y, h as f } from "../../Datepicker-
|
|
2
|
-
import { A as b } from "../../AdapterDayjs-
|
|
1
|
+
import { c as e, a as r, b as i, D as t, L as l, M as o, P as d, e as C, d as c, f as D, D as k, g as n, j as p, i as P, p as y, h as f } from "../../Datepicker-BvCR9LUk.js";
|
|
2
|
+
import { A as b } from "../../AdapterDayjs-B-aQ7t7H.js";
|
|
3
3
|
export {
|
|
4
4
|
b as AdapterDayjs,
|
|
5
5
|
e as DateCalendar,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DOMAttributes, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import { FormControlProps, FormLabelProps, FormHelperTextProps, FormSublabelProps, DatepickerProps } from '../../main';
|
|
3
2
|
import { Dayjs } from 'dayjs';
|
|
3
|
+
import { DatepickerProps } from '../Datepicker';
|
|
4
|
+
import { FormControlProps } from '../FormControl';
|
|
5
|
+
import { FormHelperTextProps } from '../FormHelperText';
|
|
6
|
+
import { FormLabelProps } from '../FormLabel';
|
|
7
|
+
import { FormSublabelProps } from '../FormSublabel';
|
|
4
8
|
type DOMEventHandlers = keyof DOMAttributes<HTMLElement>;
|
|
5
9
|
export interface DatepickerControlProps {
|
|
6
10
|
value?: Dayjs | null;
|
|
@@ -1,30 +1,126 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N } from "react";
|
|
3
|
+
import { D as R } from "../../Datepicker-BvCR9LUk.js";
|
|
4
|
+
import { FormSublabel as S } from "../FormSublabel/FormSublabel.js";
|
|
5
|
+
import { useId as q } from "../../hooks/useId.js";
|
|
4
6
|
import "../../icons/ClearstoryIcon.js";
|
|
5
7
|
import "../../icons/InternalOnlyIcon.js";
|
|
6
8
|
import "../../icons/MoneyBucketIcon.js";
|
|
7
9
|
import "../../icons/MoreCircleOutlineIcon.js";
|
|
8
|
-
import "../../Info-Cykl51qM.js";
|
|
9
|
-
import "../../
|
|
10
|
-
import "../../
|
|
11
|
-
import {
|
|
12
|
-
import "../../
|
|
13
|
-
import "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
import { I as z } from "../../Info-Cykl51qM.js";
|
|
11
|
+
import { F as A } from "../../FormControl-SJ7nmkLi.js";
|
|
12
|
+
import { B as G } from "../../Box-CRpDZJO_.js";
|
|
13
|
+
import { F as J } from "../../FormLabel-Cq6v8zn0.js";
|
|
14
|
+
import { T as K } from "../../Tooltip-D_k6EcdK.js";
|
|
15
|
+
import { F as M } from "../../FormHelperText-Dh36nlW5.js";
|
|
16
|
+
const O = N(
|
|
17
|
+
({
|
|
18
|
+
disabled: m = !1,
|
|
19
|
+
error: a = !1,
|
|
20
|
+
fullWidth: p,
|
|
21
|
+
helperText: i,
|
|
22
|
+
label: t,
|
|
23
|
+
required: f = !1,
|
|
24
|
+
slotProps: e = {},
|
|
25
|
+
sublabel: n,
|
|
26
|
+
tooltip: d,
|
|
27
|
+
name: s,
|
|
28
|
+
value: h,
|
|
29
|
+
onChange: x,
|
|
30
|
+
onAccept: F,
|
|
31
|
+
onClose: I,
|
|
32
|
+
onOpen: k,
|
|
33
|
+
format: g,
|
|
34
|
+
views: y,
|
|
35
|
+
openTo: D,
|
|
36
|
+
disableFuture: b,
|
|
37
|
+
disablePast: w,
|
|
38
|
+
minDate: u,
|
|
39
|
+
maxDate: B,
|
|
40
|
+
closeOnSelect: C,
|
|
41
|
+
readOnly: $,
|
|
42
|
+
clearable: j,
|
|
43
|
+
reduceAnimations: T,
|
|
44
|
+
...v
|
|
45
|
+
}, E) => {
|
|
46
|
+
const H = q("datepicker"), o = s || H, c = i ? `${o}-helper` : void 0;
|
|
47
|
+
return /* @__PURE__ */ l(
|
|
48
|
+
A,
|
|
49
|
+
{
|
|
50
|
+
disabled: m,
|
|
51
|
+
error: a,
|
|
52
|
+
fullWidth: p,
|
|
53
|
+
...e.root,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ l(
|
|
56
|
+
G,
|
|
57
|
+
{
|
|
58
|
+
sx: {
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
display: "flex",
|
|
61
|
+
gap: "0.25rem"
|
|
62
|
+
},
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ r(J, { htmlFor: o, required: f, ...e.label, children: t }),
|
|
65
|
+
d && /* @__PURE__ */ r(K, { title: d, arrow: !0, children: /* @__PURE__ */ r(
|
|
66
|
+
z,
|
|
67
|
+
{
|
|
68
|
+
sx: ({ vars: L }) => ({
|
|
69
|
+
color: L?.palette.text.secondary,
|
|
70
|
+
marginBlockEnd: "3px",
|
|
71
|
+
height: "1rem",
|
|
72
|
+
width: "1rem"
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
n && /* @__PURE__ */ r(S, { ...e.sublabel, children: n }),
|
|
80
|
+
/* @__PURE__ */ r(
|
|
81
|
+
R,
|
|
82
|
+
{
|
|
83
|
+
ref: E,
|
|
84
|
+
disabled: m,
|
|
85
|
+
name: o,
|
|
86
|
+
value: h,
|
|
87
|
+
onChange: x,
|
|
88
|
+
onAccept: F,
|
|
89
|
+
onClose: I,
|
|
90
|
+
onOpen: k,
|
|
91
|
+
format: g,
|
|
92
|
+
views: y,
|
|
93
|
+
openTo: D,
|
|
94
|
+
disableFuture: b,
|
|
95
|
+
disablePast: w,
|
|
96
|
+
minDate: u,
|
|
97
|
+
maxDate: B,
|
|
98
|
+
closeOnSelect: C,
|
|
99
|
+
readOnly: $,
|
|
100
|
+
clearable: j,
|
|
101
|
+
reduceAnimations: T,
|
|
102
|
+
error: a,
|
|
103
|
+
slotProps: {
|
|
104
|
+
field: {
|
|
105
|
+
id: o,
|
|
106
|
+
"aria-describedby": c,
|
|
107
|
+
...p && { sx: { width: "100%" } }
|
|
108
|
+
},
|
|
109
|
+
popper: {
|
|
110
|
+
"aria-label": `Date picker${typeof t == "string" && ` for ${t}`}`
|
|
111
|
+
},
|
|
112
|
+
...e?.datepicker
|
|
113
|
+
},
|
|
114
|
+
...v
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
i && /* @__PURE__ */ r(M, { id: c, ...e.helperText, children: i })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
O.displayName = "DatepickerControl";
|
|
28
124
|
export {
|
|
29
|
-
|
|
125
|
+
O as DatepickerControl
|
|
30
126
|
};
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import "../../icons/ClearstoryIcon.js";
|
|
4
3
|
import "../../icons/InternalOnlyIcon.js";
|
|
5
4
|
import "../../icons/MoneyBucketIcon.js";
|
|
6
5
|
import "../../icons/MoreCircleOutlineIcon.js";
|
|
7
6
|
import { C as i } from "../../Close-DeDd1tSW.js";
|
|
8
|
-
import "../../theme/index.js";
|
|
9
|
-
import "../../Autocomplete-FWamSgvx.js";
|
|
10
|
-
import "../../SelectControl-JlfR4Ddv.js";
|
|
11
|
-
import "../../Datepicker-5EuKlnxP.js";
|
|
12
|
-
import "../DescriptionDetails/DescriptionDetails.js";
|
|
13
|
-
import "../DescriptionList/DescriptionList.js";
|
|
14
|
-
import "../DescriptionList/DescriptionListContext.js";
|
|
15
|
-
import "../DescriptionTerm/DescriptionTerm.js";
|
|
16
|
-
import "../Input/Input.js";
|
|
17
|
-
import "../Select/Select.js";
|
|
18
|
-
import "../../theme/internal.js";
|
|
19
|
-
import "../ToastContainer/ToastContainer.js";
|
|
20
|
-
import "../ToastContainer/ToastLabelContext.js";
|
|
21
|
-
import "../../index-SzwnPTHF.js";
|
|
22
7
|
import { I as m } from "../../IconButton-RfVV5QBc.js";
|
|
23
|
-
const
|
|
8
|
+
const f = ({ sx: o, ...t }) => /* @__PURE__ */ r(
|
|
24
9
|
m,
|
|
25
10
|
{
|
|
26
11
|
sx: [
|
|
@@ -36,5 +21,5 @@ const q = ({ sx: o, ...t }) => /* @__PURE__ */ r(
|
|
|
36
21
|
}
|
|
37
22
|
);
|
|
38
23
|
export {
|
|
39
|
-
|
|
24
|
+
f as DialogClose
|
|
40
25
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FormHelperTextProps } from '
|
|
1
|
+
import { FormHelperTextProps } from '../FormHelperText';
|
|
2
2
|
import { StyledComponent } from '@emotion/styled';
|
|
3
3
|
import { FormHelperTextOwnProps, Theme } from '@mui/material';
|
|
4
4
|
import { CommonProps } from '@mui/material/OverridableComponent';
|
|
5
5
|
import { DetailedHTMLProps, HTMLAttributes } from 'react';
|
|
6
6
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
7
7
|
export type FormSublabelProps = FormHelperTextProps;
|
|
8
|
-
export declare const FormSublabel: StyledComponent< FormHelperTextOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "classes" | "children" | "className" | "style" | "error" | "disabled" | "margin" | "required" | "sx" | "variant" | "
|
|
8
|
+
export declare const FormSublabel: StyledComponent< FormHelperTextOwnProps & CommonProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "classes" | "children" | "className" | "style" | "error" | "disabled" | "margin" | "required" | "sx" | "variant" | "filled" | "focused"> & MUIStyledCommonProps<Theme> & {
|
|
9
9
|
component?: React.ElementType;
|
|
10
10
|
}, {}, {}>;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "../../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { F as q } from "../../SelectControl-JlfR4Ddv.js";
|
|
9
|
-
import "../../Datepicker-5EuKlnxP.js";
|
|
10
|
-
import "../DescriptionDetails/DescriptionDetails.js";
|
|
11
|
-
import "../DescriptionList/DescriptionList.js";
|
|
12
|
-
import "../DescriptionList/DescriptionListContext.js";
|
|
13
|
-
import "../DescriptionTerm/DescriptionTerm.js";
|
|
14
|
-
import "react/jsx-runtime";
|
|
15
|
-
import "../Input/Input.js";
|
|
16
|
-
import "../Select/Select.js";
|
|
17
|
-
import "../../theme/internal.js";
|
|
18
|
-
import "../ToastContainer/ToastContainer.js";
|
|
19
|
-
import "../ToastContainer/ToastLabelContext.js";
|
|
20
|
-
import "../../index-SzwnPTHF.js";
|
|
21
|
-
import "../../styled-SBTDGe0C.js";
|
|
22
|
-
import "../../FormHelperText-Dh36nlW5.js";
|
|
1
|
+
import { s as r } from "../../styled-SBTDGe0C.js";
|
|
2
|
+
import { F as o } from "../../FormHelperText-Dh36nlW5.js";
|
|
3
|
+
const a = r(o)(() => ({
|
|
4
|
+
marginBlockStart: 0,
|
|
5
|
+
marginBlockEnd: "3px",
|
|
6
|
+
marginInline: 0
|
|
7
|
+
}));
|
|
23
8
|
export {
|
|
24
|
-
|
|
9
|
+
a as FormSublabel
|
|
25
10
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { DOMAttributes, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FormControlProps } from '../FormControl';
|
|
3
|
+
import { FormHelperTextProps } from '../FormHelperText';
|
|
4
|
+
import { FormLabelProps } from '../FormLabel';
|
|
5
|
+
import { FormSublabelProps } from '../FormSublabel';
|
|
6
|
+
import { InputProps } from '../Input';
|
|
3
7
|
type DOMEventHandlers = keyof DOMAttributes<HTMLElement>;
|
|
4
8
|
export interface InputControlProps extends Omit<InputProps, "ref" | "slotProps"> {
|
|
5
9
|
helperText?: ReactNode;
|
|
@@ -1,30 +1,94 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { FormSublabel as F } from "../FormSublabel/FormSublabel.js";
|
|
4
|
+
import { Input as y } from "../Input/Input.js";
|
|
5
|
+
import { useId as g } from "../../hooks/useId.js";
|
|
4
6
|
import "../../icons/ClearstoryIcon.js";
|
|
5
7
|
import "../../icons/InternalOnlyIcon.js";
|
|
6
8
|
import "../../icons/MoneyBucketIcon.js";
|
|
7
9
|
import "../../icons/MoreCircleOutlineIcon.js";
|
|
8
|
-
import "../../Info-Cykl51qM.js";
|
|
9
|
-
import "../../
|
|
10
|
-
import "../../
|
|
11
|
-
import {
|
|
12
|
-
import "../../
|
|
13
|
-
import "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
10
|
+
import { I as w } from "../../Info-Cykl51qM.js";
|
|
11
|
+
import { F as B } from "../../FormControl-SJ7nmkLi.js";
|
|
12
|
+
import { B as C } from "../../Box-CRpDZJO_.js";
|
|
13
|
+
import { F as $ } from "../../FormLabel-Cq6v8zn0.js";
|
|
14
|
+
import { T as j } from "../../Tooltip-D_k6EcdK.js";
|
|
15
|
+
import { F as T } from "../../FormHelperText-Dh36nlW5.js";
|
|
16
|
+
const k = u(
|
|
17
|
+
({
|
|
18
|
+
disabled: a,
|
|
19
|
+
error: n,
|
|
20
|
+
fullWidth: d,
|
|
21
|
+
helperText: m,
|
|
22
|
+
id: f,
|
|
23
|
+
label: s,
|
|
24
|
+
required: b,
|
|
25
|
+
slotProps: o,
|
|
26
|
+
sublabel: p,
|
|
27
|
+
tooltip: l,
|
|
28
|
+
...i
|
|
29
|
+
}, I) => {
|
|
30
|
+
const h = g("input"), t = f || h, e = m ? `${t}-helper` : void 0;
|
|
31
|
+
return /* @__PURE__ */ c(
|
|
32
|
+
B,
|
|
33
|
+
{
|
|
34
|
+
disabled: a,
|
|
35
|
+
error: n,
|
|
36
|
+
fullWidth: d,
|
|
37
|
+
...o?.root,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ c(
|
|
40
|
+
C,
|
|
41
|
+
{
|
|
42
|
+
sx: {
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
display: "flex",
|
|
45
|
+
gap: "0.25rem"
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
$,
|
|
50
|
+
{
|
|
51
|
+
htmlFor: t,
|
|
52
|
+
required: b,
|
|
53
|
+
...o?.label,
|
|
54
|
+
children: s
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
l && /* @__PURE__ */ r(j, { title: l, arrow: !0, children: /* @__PURE__ */ r(
|
|
58
|
+
w,
|
|
59
|
+
{
|
|
60
|
+
sx: ({ vars: x }) => ({
|
|
61
|
+
color: x?.palette.text.secondary,
|
|
62
|
+
marginBlockEnd: "3px",
|
|
63
|
+
height: "1rem",
|
|
64
|
+
width: "1rem"
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
) })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
p && /* @__PURE__ */ r(F, { ...o?.sublabel, children: p }),
|
|
72
|
+
/* @__PURE__ */ r(
|
|
73
|
+
y,
|
|
74
|
+
{
|
|
75
|
+
ref: I,
|
|
76
|
+
disabled: a,
|
|
77
|
+
error: n,
|
|
78
|
+
fullWidth: d,
|
|
79
|
+
id: t,
|
|
80
|
+
"aria-describedby": e ? i["aria-describedby"] ? `${i["aria-describedby"]} ${e}` : e : i["aria-describedby"],
|
|
81
|
+
slotProps: o?.input,
|
|
82
|
+
...i
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
m && /* @__PURE__ */ r(T, { id: e, ...o?.helperText, children: m })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
k.displayName = "InputControl";
|
|
28
92
|
export {
|
|
29
|
-
|
|
93
|
+
k as InputControl
|
|
30
94
|
};
|