@jigowatts/jigowatts-ui 0.0.1-12
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 +50 -0
- package/dist/AccordionSummary-B4zooGpd.js +831 -0
- package/dist/ButtonBase-pxtIu13Q.js +866 -0
- package/dist/DateTimePicker-DJSOr5wM.js +4653 -0
- package/dist/ListContext-DOVwHqy-.js +180 -0
- package/dist/MenuItem-yBaT3_db.js +470 -0
- package/dist/Paper-COvYqxZa.js +522 -0
- package/dist/Tabs-D3lJRumZ.js +1085 -0
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/browser-DxfwT6rn.js +656 -0
- package/dist/components/Button/index.d.ts +28 -0
- package/dist/components/Button/index.js +18 -0
- package/dist/components/Button/index.test.d.ts +1 -0
- package/dist/components/Button/index.test.js +23 -0
- package/dist/components/Card/index.d.ts +16 -0
- package/dist/components/Card/index.js +37 -0
- package/dist/components/Card/index.test.d.ts +1 -0
- package/dist/components/Card/index.test.js +35 -0
- package/dist/components/CustomLink/index.d.ts +11 -0
- package/dist/components/CustomLink/index.js +1670 -0
- package/dist/components/CustomLink/index.test.d.ts +1 -0
- package/dist/components/CustomLink/index.test.js +40 -0
- package/dist/components/DataTable/index.d.ts +28 -0
- package/dist/components/DataTable/index.js +137 -0
- package/dist/components/DataTable/index.test.d.ts +1 -0
- package/dist/components/DataTable/index.test.js +3010 -0
- package/dist/components/DatePickerController/index.d.ts +16 -0
- package/dist/components/DatePickerController/index.js +83 -0
- package/dist/components/DatePickerController/index.test.d.ts +1 -0
- package/dist/components/DatePickerController/index.test.js +24 -0
- package/dist/components/ErrorMessage/index.d.ts +5 -0
- package/dist/components/ErrorMessage/index.js +11 -0
- package/dist/components/ErrorMessage/index.test.d.ts +1 -0
- package/dist/components/ErrorMessage/index.test.js +17 -0
- package/dist/components/EvseStateLabel/index.d.ts +5 -0
- package/dist/components/EvseStateLabel/index.js +36 -0
- package/dist/components/FlexButtons/index.d.ts +9 -0
- package/dist/components/FlexButtons/index.js +13 -0
- package/dist/components/Form/index.d.ts +8 -0
- package/dist/components/Form/index.js +11 -0
- package/dist/components/Form/index.test.d.ts +1 -0
- package/dist/components/Form/index.test.js +25 -0
- package/dist/components/FormItem/index.d.ts +9 -0
- package/dist/components/FormItem/index.js +19 -0
- package/dist/components/FormItem/index.test.d.ts +1 -0
- package/dist/components/FormItem/index.test.js +15 -0
- package/dist/components/FormTitle/index.d.ts +5 -0
- package/dist/components/FormTitle/index.js +11 -0
- package/dist/components/FormTitle/index.test.d.ts +1 -0
- package/dist/components/FormTitle/index.test.js +15 -0
- package/dist/components/Input/index.d.ts +15 -0
- package/dist/components/Input/index.js +39 -0
- package/dist/components/Input/index.test.d.ts +1 -0
- package/dist/components/Input/index.test.js +39 -0
- package/dist/components/InputController/index.d.ts +20 -0
- package/dist/components/InputController/index.js +81 -0
- package/dist/components/InputController/index.test.d.ts +1 -0
- package/dist/components/InputController/index.test.js +56 -0
- package/dist/components/InputGroup/index.d.ts +7 -0
- package/dist/components/InputGroup/index.js +11 -0
- package/dist/components/InputGroup/index.test.d.ts +1 -0
- package/dist/components/InputGroup/index.test.js +15 -0
- package/dist/components/Label/index.d.ts +7 -0
- package/dist/components/Label/index.js +14 -0
- package/dist/components/Label/index.test.d.ts +1 -0
- package/dist/components/Label/index.test.js +25 -0
- package/dist/components/LabeledContent/index.d.ts +15 -0
- package/dist/components/LabeledContent/index.js +28 -0
- package/dist/components/LabeledContent/index.test.d.ts +1 -0
- package/dist/components/LabeledContent/index.test.js +19 -0
- package/dist/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/components/LoadingOverlay/index.js +134 -0
- package/dist/components/LoadingOverlay/index.test.d.ts +1 -0
- package/dist/components/LoadingOverlay/index.test.js +12 -0
- package/dist/components/Map/index.d.ts +8 -0
- package/dist/components/Map/index.js +6575 -0
- package/dist/components/MaxWidthContainer/index.d.ts +13 -0
- package/dist/components/MaxWidthContainer/index.js +15 -0
- package/dist/components/MaxWidthContainer/index.test.d.ts +1 -0
- package/dist/components/MaxWidthContainer/index.test.js +24 -0
- package/dist/components/NumericFieldController/index.d.ts +53 -0
- package/dist/components/NumericFieldController/index.js +620 -0
- package/dist/components/NumericFieldController/index.test.d.ts +1 -0
- package/dist/components/NumericFieldController/index.test.js +24 -0
- package/dist/components/OfflineLabel/index.d.ts +5 -0
- package/dist/components/OfflineLabel/index.js +34 -0
- package/dist/components/PageSizeSelector/index.d.ts +15 -0
- package/dist/components/PageSizeSelector/index.js +43 -0
- package/dist/components/Pagination/index.d.ts +9 -0
- package/dist/components/Pagination/index.js +7 -0
- package/dist/components/Pagination/index.test.d.ts +1 -0
- package/dist/components/Pagination/index.test.js +34 -0
- package/dist/components/PasswordInputController/index.d.ts +17 -0
- package/dist/components/PasswordInputController/index.js +78 -0
- package/dist/components/PasswordInputController/index.test.d.ts +1 -0
- package/dist/components/PasswordInputController/index.test.js +37 -0
- package/dist/components/RadioButton/index.d.ts +13 -0
- package/dist/components/RadioButton/index.js +7 -0
- package/dist/components/RadioButton/index.test.d.ts +1 -0
- package/dist/components/RadioButton/index.test.js +38 -0
- package/dist/components/RadioGroupController/index.d.ts +15 -0
- package/dist/components/RadioGroupController/index.js +48 -0
- package/dist/components/RadioGroupController/index.test.d.ts +1 -0
- package/dist/components/RadioGroupController/index.test.js +48 -0
- package/dist/components/RangeDatePicker/index.d.ts +14 -0
- package/dist/components/RangeDatePicker/index.js +1594 -0
- package/dist/components/RangeDatePickerController/index.d.ts +21 -0
- package/dist/components/RangeDatePickerController/index.js +123 -0
- package/dist/components/RangeDatePickerController/index.test.d.ts +1 -0
- package/dist/components/RangeDatePickerController/index.test.js +24 -0
- package/dist/components/ReportCard/index.d.ts +12 -0
- package/dist/components/ReportCard/index.js +18 -0
- package/dist/components/ReportCard/index.test.d.ts +1 -0
- package/dist/components/ReportCard/index.test.js +27 -0
- package/dist/components/ReportChart/index.d.ts +22 -0
- package/dist/components/ReportChart/index.js +23101 -0
- package/dist/components/ScrollableDialog/index.d.ts +19 -0
- package/dist/components/ScrollableDialog/index.js +42 -0
- package/dist/components/ScrollableDialog/index.test.d.ts +1 -0
- package/dist/components/ScrollableDialog/index.test.js +59 -0
- package/dist/components/SearchForm/index.d.ts +13 -0
- package/dist/components/SearchForm/index.js +86 -0
- package/dist/components/SelectBox/index.d.ts +18 -0
- package/dist/components/SelectBox/index.js +7 -0
- package/dist/components/SelectBox/index.test.d.ts +1 -0
- package/dist/components/SelectBox/index.test.js +34 -0
- package/dist/components/SelectBoxController/index.d.ts +20 -0
- package/dist/components/SelectBoxController/index.js +87 -0
- package/dist/components/SelectBoxController/index.test.d.ts +1 -0
- package/dist/components/SelectBoxController/index.test.js +52 -0
- package/dist/components/SubMenu/index.d.ts +22 -0
- package/dist/components/SubMenu/index.js +278 -0
- package/dist/components/SubMenu/index.test.d.ts +1 -0
- package/dist/components/SubMenu/index.test.js +41 -0
- package/dist/components/Tabs/index.d.ts +21 -0
- package/dist/components/Tabs/index.js +100 -0
- package/dist/components/Tabs/index.test.d.ts +1 -0
- package/dist/components/Tabs/index.test.js +24 -0
- package/dist/components/Textarea/index.d.ts +18 -0
- package/dist/components/Textarea/index.js +34 -0
- package/dist/components/Textarea/index.test.d.ts +1 -0
- package/dist/components/Textarea/index.test.js +25 -0
- package/dist/components/ToggleButton/index.d.ts +16 -0
- package/dist/components/ToggleButton/index.js +39 -0
- package/dist/components/ToggleButton/index.test.d.ts +1 -0
- package/dist/components/ToggleButton/index.test.js +49 -0
- package/dist/constants/datetime.d.ts +2 -0
- package/dist/constants/datetime.js +5 -0
- package/dist/createSvgIcon-B53UOwxg.js +183 -0
- package/dist/createSvgIcon-Dj8zNxRS.js +72 -0
- package/dist/index-BLPOOjNr.js +184 -0
- package/dist/index-BOjtnFU5.js +34 -0
- package/dist/index-Bs3JCwgu.js +689 -0
- package/dist/index-CICI7n5Y.js +19688 -0
- package/dist/index-CQDJfJT1.js +50 -0
- package/dist/index-C_i0-R5C.js +393 -0
- package/dist/index-DWRHnq8_.js +42 -0
- package/dist/index-Di2gTfPF.js +25175 -0
- package/dist/index-VF82hRp0.js +2522 -0
- package/dist/index-kvi6aotO.js +39 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.esm-ChwJSgnF.js +1052 -0
- package/dist/index.js +77 -0
- package/dist/isEqual-BBhdD79C.js +667 -0
- package/dist/mergeSlotProps-J197zKan.js +63 -0
- package/dist/react.esm-C8amP77L.js +11182 -0
- package/dist/styled-CWju4EfZ.js +2702 -0
- package/dist/unsupportedProp-DZaWZqWQ.js +30 -0
- package/dist/useControlled-BQCJRJNJ.js +64 -0
- package/dist/useIsFocusVisible-BxB-Hdhb.js +124 -0
- package/dist/useSlotProps-Bh7akxXV.js +33 -0
- package/package.json +360 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { jsx as l, jsxs as h, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { useState as _, Fragment as $ } from "react";
|
|
4
|
+
import { Button as w, Menu as F } from "@mui/material";
|
|
5
|
+
import { g as W, l as v, a as B, M as D, D as U } from "../../MenuItem-yBaT3_db.js";
|
|
6
|
+
import { s as C, a as p, u as P, _ as N, c as j } from "../../styled-CWju4EfZ.js";
|
|
7
|
+
import { c as k, P as o } from "../../index-Bs3JCwgu.js";
|
|
8
|
+
import { L as O, T as g } from "../../ListContext-DOVwHqy-.js";
|
|
9
|
+
const z = ["className"], V = (s) => {
|
|
10
|
+
const {
|
|
11
|
+
alignItems: e,
|
|
12
|
+
classes: r
|
|
13
|
+
} = s;
|
|
14
|
+
return j({
|
|
15
|
+
root: ["root", e === "flex-start" && "alignItemsFlexStart"]
|
|
16
|
+
}, W, r);
|
|
17
|
+
}, A = C("div", {
|
|
18
|
+
name: "MuiListItemIcon",
|
|
19
|
+
slot: "Root",
|
|
20
|
+
overridesResolver: (s, e) => {
|
|
21
|
+
const {
|
|
22
|
+
ownerState: r
|
|
23
|
+
} = s;
|
|
24
|
+
return [e.root, r.alignItems === "flex-start" && e.alignItemsFlexStart];
|
|
25
|
+
}
|
|
26
|
+
})(({
|
|
27
|
+
theme: s,
|
|
28
|
+
ownerState: e
|
|
29
|
+
}) => p({
|
|
30
|
+
minWidth: 56,
|
|
31
|
+
color: (s.vars || s).palette.action.active,
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
display: "inline-flex"
|
|
34
|
+
}, e.alignItems === "flex-start" && {
|
|
35
|
+
marginTop: 8
|
|
36
|
+
})), M = /* @__PURE__ */ x.forwardRef(function(e, r) {
|
|
37
|
+
const n = P({
|
|
38
|
+
props: e,
|
|
39
|
+
name: "MuiListItemIcon"
|
|
40
|
+
}), {
|
|
41
|
+
className: i
|
|
42
|
+
} = n, a = N(n, z), c = x.useContext(O), d = p({}, n, {
|
|
43
|
+
alignItems: c.alignItems
|
|
44
|
+
}), y = V(d);
|
|
45
|
+
return /* @__PURE__ */ l(A, p({
|
|
46
|
+
className: k(y.root, i),
|
|
47
|
+
ownerState: d,
|
|
48
|
+
ref: r
|
|
49
|
+
}, a));
|
|
50
|
+
});
|
|
51
|
+
process.env.NODE_ENV !== "production" && (M.propTypes = {
|
|
52
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
53
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
54
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
55
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
56
|
+
/**
|
|
57
|
+
* The content of the component, normally `Icon`, `SvgIcon`,
|
|
58
|
+
* or a `@mui/icons-material` SVG icon element.
|
|
59
|
+
*/
|
|
60
|
+
children: o.node,
|
|
61
|
+
/**
|
|
62
|
+
* Override or extend the styles applied to the component.
|
|
63
|
+
*/
|
|
64
|
+
classes: o.object,
|
|
65
|
+
/**
|
|
66
|
+
* @ignore
|
|
67
|
+
*/
|
|
68
|
+
className: o.string,
|
|
69
|
+
/**
|
|
70
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
71
|
+
*/
|
|
72
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
73
|
+
});
|
|
74
|
+
const q = M, G = ["children", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"], H = (s) => {
|
|
75
|
+
const {
|
|
76
|
+
classes: e,
|
|
77
|
+
inset: r,
|
|
78
|
+
primary: n,
|
|
79
|
+
secondary: i,
|
|
80
|
+
dense: a
|
|
81
|
+
} = s;
|
|
82
|
+
return j({
|
|
83
|
+
root: ["root", r && "inset", a && "dense", n && i && "multiline"],
|
|
84
|
+
primary: ["primary"],
|
|
85
|
+
secondary: ["secondary"]
|
|
86
|
+
}, B, e);
|
|
87
|
+
}, J = C("div", {
|
|
88
|
+
name: "MuiListItemText",
|
|
89
|
+
slot: "Root",
|
|
90
|
+
overridesResolver: (s, e) => {
|
|
91
|
+
const {
|
|
92
|
+
ownerState: r
|
|
93
|
+
} = s;
|
|
94
|
+
return [{
|
|
95
|
+
[`& .${v.primary}`]: e.primary
|
|
96
|
+
}, {
|
|
97
|
+
[`& .${v.secondary}`]: e.secondary
|
|
98
|
+
}, e.root, r.inset && e.inset, r.primary && r.secondary && e.multiline, r.dense && e.dense];
|
|
99
|
+
}
|
|
100
|
+
})(({
|
|
101
|
+
ownerState: s
|
|
102
|
+
}) => p({
|
|
103
|
+
flex: "1 1 auto",
|
|
104
|
+
minWidth: 0,
|
|
105
|
+
marginTop: 4,
|
|
106
|
+
marginBottom: 4
|
|
107
|
+
}, s.primary && s.secondary && {
|
|
108
|
+
marginTop: 6,
|
|
109
|
+
marginBottom: 6
|
|
110
|
+
}, s.inset && {
|
|
111
|
+
paddingLeft: 56
|
|
112
|
+
})), R = /* @__PURE__ */ x.forwardRef(function(e, r) {
|
|
113
|
+
const n = P({
|
|
114
|
+
props: e,
|
|
115
|
+
name: "MuiListItemText"
|
|
116
|
+
}), {
|
|
117
|
+
children: i,
|
|
118
|
+
className: a,
|
|
119
|
+
disableTypography: c = !1,
|
|
120
|
+
inset: d = !1,
|
|
121
|
+
primary: y,
|
|
122
|
+
primaryTypographyProps: t,
|
|
123
|
+
secondary: m,
|
|
124
|
+
secondaryTypographyProps: I
|
|
125
|
+
} = n, S = N(n, G), {
|
|
126
|
+
dense: b
|
|
127
|
+
} = x.useContext(O);
|
|
128
|
+
let u = y ?? i, f = m;
|
|
129
|
+
const L = p({}, n, {
|
|
130
|
+
disableTypography: c,
|
|
131
|
+
inset: d,
|
|
132
|
+
primary: !!u,
|
|
133
|
+
secondary: !!f,
|
|
134
|
+
dense: b
|
|
135
|
+
}), T = H(L);
|
|
136
|
+
return u != null && u.type !== g && !c && (u = /* @__PURE__ */ l(g, p({
|
|
137
|
+
variant: b ? "body2" : "body1",
|
|
138
|
+
className: T.primary,
|
|
139
|
+
component: t != null && t.variant ? void 0 : "span",
|
|
140
|
+
display: "block"
|
|
141
|
+
}, t, {
|
|
142
|
+
children: u
|
|
143
|
+
}))), f != null && f.type !== g && !c && (f = /* @__PURE__ */ l(g, p({
|
|
144
|
+
variant: "body2",
|
|
145
|
+
className: T.secondary,
|
|
146
|
+
color: "text.secondary",
|
|
147
|
+
display: "block"
|
|
148
|
+
}, I, {
|
|
149
|
+
children: f
|
|
150
|
+
}))), /* @__PURE__ */ h(J, p({
|
|
151
|
+
className: k(T.root, a),
|
|
152
|
+
ownerState: L,
|
|
153
|
+
ref: r
|
|
154
|
+
}, S, {
|
|
155
|
+
children: [u, f]
|
|
156
|
+
}));
|
|
157
|
+
});
|
|
158
|
+
process.env.NODE_ENV !== "production" && (R.propTypes = {
|
|
159
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
160
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
161
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
162
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
163
|
+
/**
|
|
164
|
+
* Alias for the `primary` prop.
|
|
165
|
+
*/
|
|
166
|
+
children: o.node,
|
|
167
|
+
/**
|
|
168
|
+
* Override or extend the styles applied to the component.
|
|
169
|
+
*/
|
|
170
|
+
classes: o.object,
|
|
171
|
+
/**
|
|
172
|
+
* @ignore
|
|
173
|
+
*/
|
|
174
|
+
className: o.string,
|
|
175
|
+
/**
|
|
176
|
+
* If `true`, the children won't be wrapped by a Typography component.
|
|
177
|
+
* This can be useful to render an alternative Typography variant by wrapping
|
|
178
|
+
* the `children` (or `primary`) text, and optional `secondary` text
|
|
179
|
+
* with the Typography component.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
disableTypography: o.bool,
|
|
183
|
+
/**
|
|
184
|
+
* If `true`, the children are indented.
|
|
185
|
+
* This should be used if there is no left avatar or left icon.
|
|
186
|
+
* @default false
|
|
187
|
+
*/
|
|
188
|
+
inset: o.bool,
|
|
189
|
+
/**
|
|
190
|
+
* The main content element.
|
|
191
|
+
*/
|
|
192
|
+
primary: o.node,
|
|
193
|
+
/**
|
|
194
|
+
* These props will be forwarded to the primary typography component
|
|
195
|
+
* (as long as disableTypography is not `true`).
|
|
196
|
+
*/
|
|
197
|
+
primaryTypographyProps: o.object,
|
|
198
|
+
/**
|
|
199
|
+
* The secondary content element.
|
|
200
|
+
*/
|
|
201
|
+
secondary: o.node,
|
|
202
|
+
/**
|
|
203
|
+
* These props will be forwarded to the secondary typography component
|
|
204
|
+
* (as long as disableTypography is not `true`).
|
|
205
|
+
*/
|
|
206
|
+
secondaryTypographyProps: o.object,
|
|
207
|
+
/**
|
|
208
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
209
|
+
*/
|
|
210
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
211
|
+
});
|
|
212
|
+
const K = R, so = (s) => {
|
|
213
|
+
const { menuItems: e, buttonElement: r } = s, [n, i] = _(null), a = !!n, c = (t) => {
|
|
214
|
+
t.stopPropagation(), i(t.currentTarget);
|
|
215
|
+
}, d = (t) => {
|
|
216
|
+
t.stopPropagation(), i(null);
|
|
217
|
+
}, y = (t, m) => {
|
|
218
|
+
t.stopPropagation(), m.onClick && m.onClick(t), m.closeWhenClick !== !1 && d(t);
|
|
219
|
+
};
|
|
220
|
+
return /* @__PURE__ */ h(E, { children: [
|
|
221
|
+
/* @__PURE__ */ h(
|
|
222
|
+
w,
|
|
223
|
+
{
|
|
224
|
+
id: "fade-button",
|
|
225
|
+
"aria-controls": a ? "fade-menu" : void 0,
|
|
226
|
+
"aria-haspopup": "true",
|
|
227
|
+
"aria-expanded": a ? "true" : void 0,
|
|
228
|
+
onClick: c,
|
|
229
|
+
color: "inherit",
|
|
230
|
+
children: [
|
|
231
|
+
r,
|
|
232
|
+
" "
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ l(
|
|
237
|
+
F,
|
|
238
|
+
{
|
|
239
|
+
id: "fade-menu",
|
|
240
|
+
MenuListProps: {
|
|
241
|
+
"aria-labelledby": "fade-button"
|
|
242
|
+
},
|
|
243
|
+
anchorEl: n,
|
|
244
|
+
open: a,
|
|
245
|
+
onClose: d,
|
|
246
|
+
anchorOrigin: {
|
|
247
|
+
vertical: "bottom",
|
|
248
|
+
horizontal: "right"
|
|
249
|
+
},
|
|
250
|
+
transformOrigin: {
|
|
251
|
+
vertical: "top",
|
|
252
|
+
horizontal: "right"
|
|
253
|
+
},
|
|
254
|
+
children: e.map((t, m) => /* @__PURE__ */ h($, { children: [
|
|
255
|
+
/* @__PURE__ */ h(
|
|
256
|
+
D,
|
|
257
|
+
{
|
|
258
|
+
onClick: (I) => {
|
|
259
|
+
y(I, t);
|
|
260
|
+
},
|
|
261
|
+
sx: { minWidth: 200 },
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ l(q, { children: t.icon }),
|
|
264
|
+
/* @__PURE__ */ l(K, { children: t.title }),
|
|
265
|
+
t.shortcut && /* @__PURE__ */ l(g, { variant: "body2", color: "text.secondary", children: t.shortcut })
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
t.separatorLine && /* @__PURE__ */ l(U, {})
|
|
270
|
+
] }, m))
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] });
|
|
274
|
+
};
|
|
275
|
+
export {
|
|
276
|
+
so as SubMenu,
|
|
277
|
+
so as default
|
|
278
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { a as r, s as e, f as t } from "../../react.esm-C8amP77L.js";
|
|
3
|
+
import { SubMenu as k } from "./index.js";
|
|
4
|
+
describe("SubMenu component", () => {
|
|
5
|
+
test("renders SubMenu component with given menu items and button element", () => {
|
|
6
|
+
const o = jest.fn(), u = jest.fn(), l = jest.fn();
|
|
7
|
+
r(/* @__PURE__ */ n(k, { menuItems: [
|
|
8
|
+
{
|
|
9
|
+
icon: /* @__PURE__ */ n("span", { children: "Icon 1" }),
|
|
10
|
+
title: "Menu 1",
|
|
11
|
+
onClick: o,
|
|
12
|
+
closeWhenClick: !0
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
icon: /* @__PURE__ */ n("span", { children: "Icon 2" }),
|
|
16
|
+
title: "Menu 2",
|
|
17
|
+
onClick: u
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
icon: /* @__PURE__ */ n("span", { children: "Icon 3" }),
|
|
21
|
+
title: "Menu 3",
|
|
22
|
+
onClick: l,
|
|
23
|
+
closeWhenClick: !1
|
|
24
|
+
}
|
|
25
|
+
], buttonElement: /* @__PURE__ */ n("button", { children: "Menu Button" }) }));
|
|
26
|
+
const c = e.getByText("Menu Button");
|
|
27
|
+
t.click(c);
|
|
28
|
+
const i = e.getByText("Menu 1");
|
|
29
|
+
t.click(i), expect(o).toHaveBeenCalled(), setTimeout(() => {
|
|
30
|
+
expect(e.queryByText("Menu 1")).toBeNull();
|
|
31
|
+
}, 0), t.click(c);
|
|
32
|
+
const s = e.getByText("Menu 2");
|
|
33
|
+
t.click(s), expect(u).toHaveBeenCalled(), setTimeout(() => {
|
|
34
|
+
expect(e.queryByText("Menu 2")).toBeNull();
|
|
35
|
+
}, 0), t.click(c);
|
|
36
|
+
const m = e.getByText("Menu 3");
|
|
37
|
+
t.click(m), expect(l).toHaveBeenCalled(), setTimeout(() => {
|
|
38
|
+
expect(e.queryByText("Menu 3")).not.toBeNull();
|
|
39
|
+
}, 0);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type TabItem = {
|
|
3
|
+
/** タブの識別値 */
|
|
4
|
+
value: string;
|
|
5
|
+
/** 表示名 */
|
|
6
|
+
label: string;
|
|
7
|
+
/** 表示アイコン example:
|
|
8
|
+
* <PhoneIcon sx={{ fontSize: 20 }} />
|
|
9
|
+
*/
|
|
10
|
+
icon?: React.ReactElement;
|
|
11
|
+
};
|
|
12
|
+
type Props = {
|
|
13
|
+
/** タブアイテム情報*/
|
|
14
|
+
items: TabItem[];
|
|
15
|
+
/** 現在選択中のvalue state管理 */
|
|
16
|
+
value: string;
|
|
17
|
+
/** 選択中のTabが変更された時のhandler */
|
|
18
|
+
handleChange: (event: React.SyntheticEvent, newValue: string) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const Tabs: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default Tabs;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { styled as d } from "@mui/material";
|
|
3
|
+
import { M as T, T as y } from "../../Tabs-D3lJRumZ.js";
|
|
4
|
+
import { c as C, P as e } from "../../index-Bs3JCwgu.js";
|
|
5
|
+
import { f as N, h as g, j as B, e as M, _ as v, a as P, b as S, k as _, T as j, C as w } from "../../styled-CWju4EfZ.js";
|
|
6
|
+
import * as E from "react";
|
|
7
|
+
const I = ["className", "component"];
|
|
8
|
+
function O(o = {}) {
|
|
9
|
+
const {
|
|
10
|
+
themeId: t,
|
|
11
|
+
defaultTheme: c,
|
|
12
|
+
defaultClassName: n = "MuiBox-root",
|
|
13
|
+
generateClassName: a
|
|
14
|
+
} = o, u = N("div", {
|
|
15
|
+
shouldForwardProp: (r) => r !== "theme" && r !== "sx" && r !== "as"
|
|
16
|
+
})(g);
|
|
17
|
+
return /* @__PURE__ */ E.forwardRef(function(p, f) {
|
|
18
|
+
const l = B(c), i = M(p), {
|
|
19
|
+
className: x,
|
|
20
|
+
component: b = "div"
|
|
21
|
+
} = i, h = v(i, I);
|
|
22
|
+
return /* @__PURE__ */ s(u, P({
|
|
23
|
+
as: b,
|
|
24
|
+
ref: f,
|
|
25
|
+
className: C(x, a ? a(n) : n),
|
|
26
|
+
theme: t && l[t] || l
|
|
27
|
+
}, h));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const k = S("MuiBox", ["root"]), R = k, $ = _(), m = O({
|
|
31
|
+
themeId: j,
|
|
32
|
+
defaultTheme: $,
|
|
33
|
+
defaultClassName: R.root,
|
|
34
|
+
generateClassName: w.generate
|
|
35
|
+
});
|
|
36
|
+
process.env.NODE_ENV !== "production" && (m.propTypes = {
|
|
37
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
38
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
39
|
+
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
40
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
41
|
+
/**
|
|
42
|
+
* @ignore
|
|
43
|
+
*/
|
|
44
|
+
children: e.node,
|
|
45
|
+
/**
|
|
46
|
+
* The component used for the root node.
|
|
47
|
+
* Either a string to use a HTML element or a component.
|
|
48
|
+
*/
|
|
49
|
+
component: e.elementType,
|
|
50
|
+
/**
|
|
51
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
52
|
+
*/
|
|
53
|
+
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
54
|
+
});
|
|
55
|
+
const D = m, F = d((o) => /* @__PURE__ */ s(
|
|
56
|
+
T,
|
|
57
|
+
{
|
|
58
|
+
...o,
|
|
59
|
+
"aria-label": "wrapped tabs",
|
|
60
|
+
TabIndicatorProps: { children: /* @__PURE__ */ s("span", { className: "MuiTabs-indicatorSpan" }) }
|
|
61
|
+
}
|
|
62
|
+
))({
|
|
63
|
+
"& .MuiTabs-indicator": {
|
|
64
|
+
display: "flex",
|
|
65
|
+
justifyContent: "center",
|
|
66
|
+
backgroundColor: "transparent"
|
|
67
|
+
},
|
|
68
|
+
"& .MuiTabs-indicatorSpan": {
|
|
69
|
+
width: "100%",
|
|
70
|
+
backgroundColor: "#6672e8"
|
|
71
|
+
}
|
|
72
|
+
}), W = d((o) => /* @__PURE__ */ s(y, { ...o, iconPosition: "start" }))(({}) => ({
|
|
73
|
+
"&.Mui-selected": {
|
|
74
|
+
color: "#000",
|
|
75
|
+
fontWeight: "800"
|
|
76
|
+
}
|
|
77
|
+
})), z = (o) => {
|
|
78
|
+
const { items: t, value: c, handleChange: n } = o;
|
|
79
|
+
return /* @__PURE__ */ s(D, { sx: { width: "100%" }, children: /* @__PURE__ */ s(
|
|
80
|
+
F,
|
|
81
|
+
{
|
|
82
|
+
value: c,
|
|
83
|
+
onChange: n,
|
|
84
|
+
"aria-label": "wrapped tabs",
|
|
85
|
+
children: t.map((a) => /* @__PURE__ */ s(
|
|
86
|
+
W,
|
|
87
|
+
{
|
|
88
|
+
icon: a.icon,
|
|
89
|
+
label: a.label,
|
|
90
|
+
value: a.value
|
|
91
|
+
},
|
|
92
|
+
a.value
|
|
93
|
+
))
|
|
94
|
+
}
|
|
95
|
+
) });
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
z as Tabs,
|
|
99
|
+
z as default
|
|
100
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { a as o, f as c } from "../../react.esm-C8amP77L.js";
|
|
3
|
+
import { Tabs as b } from "./index.js";
|
|
4
|
+
import "../../index-VF82hRp0.js";
|
|
5
|
+
describe("Tabs Component", () => {
|
|
6
|
+
const e = jest.fn(), a = [
|
|
7
|
+
{ value: "tab1", label: "Tab 1" },
|
|
8
|
+
{ value: "tab2", label: "Tab 2" },
|
|
9
|
+
{ value: "tab3", label: "Tab 3" }
|
|
10
|
+
];
|
|
11
|
+
it("renders the tabs correctly", () => {
|
|
12
|
+
const { getByText: t } = o(
|
|
13
|
+
/* @__PURE__ */ n(b, { items: a, value: "tab1", handleChange: e })
|
|
14
|
+
);
|
|
15
|
+
a.forEach((l) => {
|
|
16
|
+
expect(t(l.label)).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
}), it("calls handleChange with the right value when a tab is clicked", () => {
|
|
19
|
+
const { getByText: t } = o(
|
|
20
|
+
/* @__PURE__ */ n(b, { items: a, value: "tab1", handleChange: e })
|
|
21
|
+
), l = t("Tab 2");
|
|
22
|
+
c.click(l), expect(e).toHaveBeenCalled(), expect(e).toHaveBeenCalledWith(expect.anything(), "tab2");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UseFormRegisterReturn } from 'react-hook-form';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
id?: string;
|
|
5
|
+
register?: UseFormRegisterReturn;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
rows?: number;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const TextArea: {
|
|
12
|
+
(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
defaultProps: {
|
|
14
|
+
rows: number;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default TextArea;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../index-DWRHnq8_.js";
|
|
3
|
+
import '../../assets/index.css';const d = "_inputContainer_qfvgb_1", g = "_textArea_qfvgb_8", f = "_error_qfvgb_22", m = "_errorMessage_qfvgb_26", e = {
|
|
4
|
+
inputContainer: d,
|
|
5
|
+
textArea: g,
|
|
6
|
+
error: f,
|
|
7
|
+
errorMessage: m
|
|
8
|
+
}, p = (t) => {
|
|
9
|
+
const { id: a, register: o, placeholder: n, rows: i, errorMessage: r, disabled: l } = t;
|
|
10
|
+
return /* @__PURE__ */ c("div", { className: e.inputContainer, children: [
|
|
11
|
+
/* @__PURE__ */ s(
|
|
12
|
+
"textarea",
|
|
13
|
+
{
|
|
14
|
+
id: a,
|
|
15
|
+
...o,
|
|
16
|
+
className: _(e.textArea, {
|
|
17
|
+
[e.error]: r
|
|
18
|
+
}),
|
|
19
|
+
placeholder: n,
|
|
20
|
+
rows: i,
|
|
21
|
+
disabled: l
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
r && /* @__PURE__ */ s("small", { className: e.errorMessage, children: r })
|
|
25
|
+
] });
|
|
26
|
+
};
|
|
27
|
+
p.defaultProps = {
|
|
28
|
+
rows: 3,
|
|
29
|
+
disabled: !1
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
p as TextArea,
|
|
33
|
+
p as default
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { a as o, s as a } from "../../react.esm-C8amP77L.js";
|
|
3
|
+
import { j as i } from "../../index-Di2gTfPF.js";
|
|
4
|
+
import { TextArea as r } from "./index.js";
|
|
5
|
+
describe("TextArea component", () => {
|
|
6
|
+
const c = "testTextArea", s = "Test Placeholder", n = "Test Error";
|
|
7
|
+
it("renders the textarea with the provided properties", () => {
|
|
8
|
+
o(/* @__PURE__ */ t(r, { id: c, placeholder: s, rows: 4 }));
|
|
9
|
+
const e = a.getByPlaceholderText(s);
|
|
10
|
+
expect(e).toBeInTheDocument(), expect(e.tagName).toBe("TEXTAREA"), expect(e.getAttribute("rows")).toBe("4");
|
|
11
|
+
}), it("renders the error message when provided", () => {
|
|
12
|
+
o(/* @__PURE__ */ t(r, { errorMessage: n }));
|
|
13
|
+
const e = a.getByText(n);
|
|
14
|
+
expect(e).toBeInTheDocument();
|
|
15
|
+
}), it("does not render the error message when not provided", () => {
|
|
16
|
+
o(/* @__PURE__ */ t(r, {}));
|
|
17
|
+
const e = a.queryByText(n);
|
|
18
|
+
expect(e).not.toBeInTheDocument();
|
|
19
|
+
}), it("should be accessible", async () => {
|
|
20
|
+
const { container: e } = o(
|
|
21
|
+
/* @__PURE__ */ t(r, { id: c, placeholder: s, rows: 4 })
|
|
22
|
+
), x = await i.axe(e);
|
|
23
|
+
expect.extend(i.toHaveNoViolations), expect(x).toHaveNoViolations();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, PathValue } from 'react-hook-form';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type Option<T extends FieldValues> = {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
value: PathValue<T, FieldPath<T>>;
|
|
7
|
+
};
|
|
8
|
+
type Props<T extends FieldValues> = {
|
|
9
|
+
control: Control<T>;
|
|
10
|
+
name: FieldPath<T>;
|
|
11
|
+
defaultValue: PathValue<T, FieldPath<T>>;
|
|
12
|
+
options: Option<T>[];
|
|
13
|
+
onChange?: (event: React.MouseEvent<HTMLElement>, value: unknown) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const ToggleButtonController: <T extends FieldValues>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default ToggleButtonController;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as p, ToggleButtonGroup as d, ToggleButton as h, FormHelperText as v } from "@mui/material";
|
|
3
|
+
import { C as x } from "../../index.esm-ChwJSgnF.js";
|
|
4
|
+
const B = (u) => {
|
|
5
|
+
const { control: i, name: m, defaultValue: c, options: g, onChange: o } = u;
|
|
6
|
+
return /* @__PURE__ */ l(
|
|
7
|
+
x,
|
|
8
|
+
{
|
|
9
|
+
control: i,
|
|
10
|
+
name: m,
|
|
11
|
+
defaultValue: c,
|
|
12
|
+
render: ({ field: t, fieldState: n }) => {
|
|
13
|
+
var a;
|
|
14
|
+
return /* @__PURE__ */ s(p, { error: n.invalid, children: [
|
|
15
|
+
/* @__PURE__ */ l(
|
|
16
|
+
d,
|
|
17
|
+
{
|
|
18
|
+
exclusive: !0,
|
|
19
|
+
...t,
|
|
20
|
+
onChange: (r, e) => {
|
|
21
|
+
e && (t.onChange(e), o == null || o(r, e));
|
|
22
|
+
},
|
|
23
|
+
children: g.map((r) => /* @__PURE__ */ s(h, { value: r.value, children: [
|
|
24
|
+
" ",
|
|
25
|
+
r.label,
|
|
26
|
+
" "
|
|
27
|
+
] }, r.value))
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ l(v, { children: (a = n.error) == null ? void 0 : a.message })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
B as ToggleButtonController,
|
|
38
|
+
B as default
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { r as i, a as c, s as p } from "../../react.esm-C8amP77L.js";
|
|
3
|
+
import { u } from "../../index.esm-ChwJSgnF.js";
|
|
4
|
+
import { ToggleButtonController as m } from "./index.js";
|
|
5
|
+
describe("ToggleButtonController component", () => {
|
|
6
|
+
it("renders select box with options and correct default value", () => {
|
|
7
|
+
const { result: l } = i(() => u()), { control: s } = l.current, a = "TestToggle", e = [
|
|
8
|
+
{ label: "Option 1", value: "option1" },
|
|
9
|
+
{ label: "Option 2", value: "option2" },
|
|
10
|
+
{ label: "Option 3", value: "option3" }
|
|
11
|
+
], t = ["option2"];
|
|
12
|
+
c(
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
m,
|
|
15
|
+
{
|
|
16
|
+
control: s,
|
|
17
|
+
name: a,
|
|
18
|
+
options: e,
|
|
19
|
+
defaultValue: t
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
), t.forEach((n) => {
|
|
23
|
+
const o = e.find((d) => d.value === n);
|
|
24
|
+
o && expect(p.getByText(o.label)).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
}), it("renders select box with options and correct default value for single select", () => {
|
|
27
|
+
const { result: l } = i(() => u()), { control: s } = l.current, a = "TestToggle", e = [
|
|
28
|
+
{ label: "Option 1", value: "option1" },
|
|
29
|
+
{ label: "Option 2", value: "option2" },
|
|
30
|
+
{ label: "Option 3", value: "option3" }
|
|
31
|
+
], t = "option2";
|
|
32
|
+
c(
|
|
33
|
+
/* @__PURE__ */ r(
|
|
34
|
+
m,
|
|
35
|
+
{
|
|
36
|
+
control: s,
|
|
37
|
+
name: a,
|
|
38
|
+
options: e,
|
|
39
|
+
defaultValue: t
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
const n = e.find((o) => o.value === t);
|
|
44
|
+
if (n) {
|
|
45
|
+
const o = p.getByText(n.label);
|
|
46
|
+
expect(o).toBeInTheDocument();
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|