@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.
Files changed (199) hide show
  1. package/README.md +50 -0
  2. package/dist/AccordionSummary-B4zooGpd.js +831 -0
  3. package/dist/ButtonBase-pxtIu13Q.js +866 -0
  4. package/dist/DateTimePicker-DJSOr5wM.js +4653 -0
  5. package/dist/ListContext-DOVwHqy-.js +180 -0
  6. package/dist/MenuItem-yBaT3_db.js +470 -0
  7. package/dist/Paper-COvYqxZa.js +522 -0
  8. package/dist/Tabs-D3lJRumZ.js +1085 -0
  9. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  10. package/dist/assets/index.css +1 -0
  11. package/dist/assets/index10.css +1 -0
  12. package/dist/assets/index11.css +1 -0
  13. package/dist/assets/index12.css +1 -0
  14. package/dist/assets/index13.css +1 -0
  15. package/dist/assets/index14.css +1 -0
  16. package/dist/assets/index15.css +1 -0
  17. package/dist/assets/index16.css +1 -0
  18. package/dist/assets/index17.css +1 -0
  19. package/dist/assets/index18.css +1 -0
  20. package/dist/assets/index19.css +1 -0
  21. package/dist/assets/index2.css +1 -0
  22. package/dist/assets/index20.css +1 -0
  23. package/dist/assets/index21.css +1 -0
  24. package/dist/assets/index22.css +1 -0
  25. package/dist/assets/index23.css +1 -0
  26. package/dist/assets/index24.css +1 -0
  27. package/dist/assets/index25.css +1 -0
  28. package/dist/assets/index26.css +1 -0
  29. package/dist/assets/index27.css +1 -0
  30. package/dist/assets/index3.css +1 -0
  31. package/dist/assets/index4.css +1 -0
  32. package/dist/assets/index5.css +1 -0
  33. package/dist/assets/index6.css +1 -0
  34. package/dist/assets/index7.css +1 -0
  35. package/dist/assets/index8.css +1 -0
  36. package/dist/assets/index9.css +1 -0
  37. package/dist/browser-DxfwT6rn.js +656 -0
  38. package/dist/components/Button/index.d.ts +28 -0
  39. package/dist/components/Button/index.js +18 -0
  40. package/dist/components/Button/index.test.d.ts +1 -0
  41. package/dist/components/Button/index.test.js +23 -0
  42. package/dist/components/Card/index.d.ts +16 -0
  43. package/dist/components/Card/index.js +37 -0
  44. package/dist/components/Card/index.test.d.ts +1 -0
  45. package/dist/components/Card/index.test.js +35 -0
  46. package/dist/components/CustomLink/index.d.ts +11 -0
  47. package/dist/components/CustomLink/index.js +1670 -0
  48. package/dist/components/CustomLink/index.test.d.ts +1 -0
  49. package/dist/components/CustomLink/index.test.js +40 -0
  50. package/dist/components/DataTable/index.d.ts +28 -0
  51. package/dist/components/DataTable/index.js +137 -0
  52. package/dist/components/DataTable/index.test.d.ts +1 -0
  53. package/dist/components/DataTable/index.test.js +3010 -0
  54. package/dist/components/DatePickerController/index.d.ts +16 -0
  55. package/dist/components/DatePickerController/index.js +83 -0
  56. package/dist/components/DatePickerController/index.test.d.ts +1 -0
  57. package/dist/components/DatePickerController/index.test.js +24 -0
  58. package/dist/components/ErrorMessage/index.d.ts +5 -0
  59. package/dist/components/ErrorMessage/index.js +11 -0
  60. package/dist/components/ErrorMessage/index.test.d.ts +1 -0
  61. package/dist/components/ErrorMessage/index.test.js +17 -0
  62. package/dist/components/EvseStateLabel/index.d.ts +5 -0
  63. package/dist/components/EvseStateLabel/index.js +36 -0
  64. package/dist/components/FlexButtons/index.d.ts +9 -0
  65. package/dist/components/FlexButtons/index.js +13 -0
  66. package/dist/components/Form/index.d.ts +8 -0
  67. package/dist/components/Form/index.js +11 -0
  68. package/dist/components/Form/index.test.d.ts +1 -0
  69. package/dist/components/Form/index.test.js +25 -0
  70. package/dist/components/FormItem/index.d.ts +9 -0
  71. package/dist/components/FormItem/index.js +19 -0
  72. package/dist/components/FormItem/index.test.d.ts +1 -0
  73. package/dist/components/FormItem/index.test.js +15 -0
  74. package/dist/components/FormTitle/index.d.ts +5 -0
  75. package/dist/components/FormTitle/index.js +11 -0
  76. package/dist/components/FormTitle/index.test.d.ts +1 -0
  77. package/dist/components/FormTitle/index.test.js +15 -0
  78. package/dist/components/Input/index.d.ts +15 -0
  79. package/dist/components/Input/index.js +39 -0
  80. package/dist/components/Input/index.test.d.ts +1 -0
  81. package/dist/components/Input/index.test.js +39 -0
  82. package/dist/components/InputController/index.d.ts +20 -0
  83. package/dist/components/InputController/index.js +81 -0
  84. package/dist/components/InputController/index.test.d.ts +1 -0
  85. package/dist/components/InputController/index.test.js +56 -0
  86. package/dist/components/InputGroup/index.d.ts +7 -0
  87. package/dist/components/InputGroup/index.js +11 -0
  88. package/dist/components/InputGroup/index.test.d.ts +1 -0
  89. package/dist/components/InputGroup/index.test.js +15 -0
  90. package/dist/components/Label/index.d.ts +7 -0
  91. package/dist/components/Label/index.js +14 -0
  92. package/dist/components/Label/index.test.d.ts +1 -0
  93. package/dist/components/Label/index.test.js +25 -0
  94. package/dist/components/LabeledContent/index.d.ts +15 -0
  95. package/dist/components/LabeledContent/index.js +28 -0
  96. package/dist/components/LabeledContent/index.test.d.ts +1 -0
  97. package/dist/components/LabeledContent/index.test.js +19 -0
  98. package/dist/components/LoadingOverlay/index.d.ts +2 -0
  99. package/dist/components/LoadingOverlay/index.js +134 -0
  100. package/dist/components/LoadingOverlay/index.test.d.ts +1 -0
  101. package/dist/components/LoadingOverlay/index.test.js +12 -0
  102. package/dist/components/Map/index.d.ts +8 -0
  103. package/dist/components/Map/index.js +6575 -0
  104. package/dist/components/MaxWidthContainer/index.d.ts +13 -0
  105. package/dist/components/MaxWidthContainer/index.js +15 -0
  106. package/dist/components/MaxWidthContainer/index.test.d.ts +1 -0
  107. package/dist/components/MaxWidthContainer/index.test.js +24 -0
  108. package/dist/components/NumericFieldController/index.d.ts +53 -0
  109. package/dist/components/NumericFieldController/index.js +620 -0
  110. package/dist/components/NumericFieldController/index.test.d.ts +1 -0
  111. package/dist/components/NumericFieldController/index.test.js +24 -0
  112. package/dist/components/OfflineLabel/index.d.ts +5 -0
  113. package/dist/components/OfflineLabel/index.js +34 -0
  114. package/dist/components/PageSizeSelector/index.d.ts +15 -0
  115. package/dist/components/PageSizeSelector/index.js +43 -0
  116. package/dist/components/Pagination/index.d.ts +9 -0
  117. package/dist/components/Pagination/index.js +7 -0
  118. package/dist/components/Pagination/index.test.d.ts +1 -0
  119. package/dist/components/Pagination/index.test.js +34 -0
  120. package/dist/components/PasswordInputController/index.d.ts +17 -0
  121. package/dist/components/PasswordInputController/index.js +78 -0
  122. package/dist/components/PasswordInputController/index.test.d.ts +1 -0
  123. package/dist/components/PasswordInputController/index.test.js +37 -0
  124. package/dist/components/RadioButton/index.d.ts +13 -0
  125. package/dist/components/RadioButton/index.js +7 -0
  126. package/dist/components/RadioButton/index.test.d.ts +1 -0
  127. package/dist/components/RadioButton/index.test.js +38 -0
  128. package/dist/components/RadioGroupController/index.d.ts +15 -0
  129. package/dist/components/RadioGroupController/index.js +48 -0
  130. package/dist/components/RadioGroupController/index.test.d.ts +1 -0
  131. package/dist/components/RadioGroupController/index.test.js +48 -0
  132. package/dist/components/RangeDatePicker/index.d.ts +14 -0
  133. package/dist/components/RangeDatePicker/index.js +1594 -0
  134. package/dist/components/RangeDatePickerController/index.d.ts +21 -0
  135. package/dist/components/RangeDatePickerController/index.js +123 -0
  136. package/dist/components/RangeDatePickerController/index.test.d.ts +1 -0
  137. package/dist/components/RangeDatePickerController/index.test.js +24 -0
  138. package/dist/components/ReportCard/index.d.ts +12 -0
  139. package/dist/components/ReportCard/index.js +18 -0
  140. package/dist/components/ReportCard/index.test.d.ts +1 -0
  141. package/dist/components/ReportCard/index.test.js +27 -0
  142. package/dist/components/ReportChart/index.d.ts +22 -0
  143. package/dist/components/ReportChart/index.js +23101 -0
  144. package/dist/components/ScrollableDialog/index.d.ts +19 -0
  145. package/dist/components/ScrollableDialog/index.js +42 -0
  146. package/dist/components/ScrollableDialog/index.test.d.ts +1 -0
  147. package/dist/components/ScrollableDialog/index.test.js +59 -0
  148. package/dist/components/SearchForm/index.d.ts +13 -0
  149. package/dist/components/SearchForm/index.js +86 -0
  150. package/dist/components/SelectBox/index.d.ts +18 -0
  151. package/dist/components/SelectBox/index.js +7 -0
  152. package/dist/components/SelectBox/index.test.d.ts +1 -0
  153. package/dist/components/SelectBox/index.test.js +34 -0
  154. package/dist/components/SelectBoxController/index.d.ts +20 -0
  155. package/dist/components/SelectBoxController/index.js +87 -0
  156. package/dist/components/SelectBoxController/index.test.d.ts +1 -0
  157. package/dist/components/SelectBoxController/index.test.js +52 -0
  158. package/dist/components/SubMenu/index.d.ts +22 -0
  159. package/dist/components/SubMenu/index.js +278 -0
  160. package/dist/components/SubMenu/index.test.d.ts +1 -0
  161. package/dist/components/SubMenu/index.test.js +41 -0
  162. package/dist/components/Tabs/index.d.ts +21 -0
  163. package/dist/components/Tabs/index.js +100 -0
  164. package/dist/components/Tabs/index.test.d.ts +1 -0
  165. package/dist/components/Tabs/index.test.js +24 -0
  166. package/dist/components/Textarea/index.d.ts +18 -0
  167. package/dist/components/Textarea/index.js +34 -0
  168. package/dist/components/Textarea/index.test.d.ts +1 -0
  169. package/dist/components/Textarea/index.test.js +25 -0
  170. package/dist/components/ToggleButton/index.d.ts +16 -0
  171. package/dist/components/ToggleButton/index.js +39 -0
  172. package/dist/components/ToggleButton/index.test.d.ts +1 -0
  173. package/dist/components/ToggleButton/index.test.js +49 -0
  174. package/dist/constants/datetime.d.ts +2 -0
  175. package/dist/constants/datetime.js +5 -0
  176. package/dist/createSvgIcon-B53UOwxg.js +183 -0
  177. package/dist/createSvgIcon-Dj8zNxRS.js +72 -0
  178. package/dist/index-BLPOOjNr.js +184 -0
  179. package/dist/index-BOjtnFU5.js +34 -0
  180. package/dist/index-Bs3JCwgu.js +689 -0
  181. package/dist/index-CICI7n5Y.js +19688 -0
  182. package/dist/index-CQDJfJT1.js +50 -0
  183. package/dist/index-C_i0-R5C.js +393 -0
  184. package/dist/index-DWRHnq8_.js +42 -0
  185. package/dist/index-Di2gTfPF.js +25175 -0
  186. package/dist/index-VF82hRp0.js +2522 -0
  187. package/dist/index-kvi6aotO.js +39 -0
  188. package/dist/index.d.ts +38 -0
  189. package/dist/index.esm-ChwJSgnF.js +1052 -0
  190. package/dist/index.js +77 -0
  191. package/dist/isEqual-BBhdD79C.js +667 -0
  192. package/dist/mergeSlotProps-J197zKan.js +63 -0
  193. package/dist/react.esm-C8amP77L.js +11182 -0
  194. package/dist/styled-CWju4EfZ.js +2702 -0
  195. package/dist/unsupportedProp-DZaWZqWQ.js +30 -0
  196. package/dist/useControlled-BQCJRJNJ.js +64 -0
  197. package/dist/useIsFocusVisible-BxB-Hdhb.js +124 -0
  198. package/dist/useSlotProps-Bh7akxXV.js +33 -0
  199. package/package.json +360 -0
@@ -0,0 +1,21 @@
1
+ import { Control, FieldValues, UseFormSetValue } from 'react-hook-form';
2
+
3
+ export type RangeDatePickerControllerInfo = {
4
+ name: string;
5
+ defaultValue?: string | undefined | null;
6
+ };
7
+ type Props = {
8
+ control: Control;
9
+ fromDateInfo: RangeDatePickerControllerInfo;
10
+ toDateInfo: RangeDatePickerControllerInfo;
11
+ dateFormat: string;
12
+ setValue: UseFormSetValue<FieldValues>;
13
+ };
14
+ /**
15
+ * Date,DateTimeをを選択できるコンポーネント
16
+ * dateFormatに合わせてpickerViewを生成します。
17
+ * @param props
18
+ * @returns
19
+ */
20
+ export declare const RangeDatePickerController: (props: Props) => import("react/jsx-runtime").JSX.Element;
21
+ export default RangeDatePickerController;
@@ -0,0 +1,123 @@
1
+ import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
+ import { r as x, _ as D, t as M, s as C, a as l, L as T, A as j, j as P, p as V } from "../../index-CICI7n5Y.js";
3
+ import { C as h } from "../../index.esm-ChwJSgnF.js";
4
+ import { DATETIME_FORMAT as A } from "../../constants/datetime.js";
5
+ import { j as B, D as g } from "../../DateTimePicker-DJSOr5wM.js";
6
+ import '../../assets/index19.css';function F(c, t) {
7
+ if (x(2, arguments), D(t) !== "object" || t === null)
8
+ throw new RangeError("values parameter must be an object");
9
+ var r = M(c);
10
+ return isNaN(r.getTime()) ? /* @__PURE__ */ new Date(NaN) : (t.year != null && r.setFullYear(t.year), t.month != null && (r = C(r, t.month)), t.date != null && r.setDate(l(t.date)), t.hours != null && r.setHours(l(t.hours)), t.minutes != null && r.setMinutes(l(t.minutes)), t.seconds != null && r.setSeconds(l(t.seconds)), t.milliseconds != null && r.setMilliseconds(l(t.milliseconds)), r);
11
+ }
12
+ const _ = "_rangeContainer_17n2w_1", N = {
13
+ rangeContainer: _
14
+ }, I = (c) => {
15
+ const { control: t, fromDateInfo: r, toDateInfo: u, dateFormat: n, setValue: d } = c, m = (e, o) => {
16
+ const a = e ? e instanceof Date ? e : typeof e == "string" ? V(e, n, /* @__PURE__ */ new Date()) : null : null;
17
+ return typeof e == "string" && d(o.name, a), a;
18
+ }, f = (e, o) => {
19
+ d(o.name, e ?? o.defaultValue, {
20
+ shouldDirty: !0
21
+ });
22
+ }, p = (() => {
23
+ const e = [];
24
+ return n.includes("yyyy") && e.push("year"), n.includes("MM") && e.push("month"), n.includes("dd") && e.push("day"), n.includes("HH") && e.push("hours"), n.includes("mm") && e.push("minutes"), n.includes("ss") && e.push("seconds"), e;
25
+ })();
26
+ return /* @__PURE__ */ i(
27
+ T,
28
+ {
29
+ dateAdapter: j,
30
+ adapterLocale: P,
31
+ localeText: B.components.MuiLocalizationProvider.defaultProps.localeText,
32
+ children: /* @__PURE__ */ y("div", { className: N.rangeContainer, children: [
33
+ /* @__PURE__ */ i(
34
+ h,
35
+ {
36
+ control: t,
37
+ name: r.name,
38
+ defaultValue: r.defaultValue,
39
+ render: ({ field: e, fieldState: o }) => {
40
+ var a;
41
+ return /* @__PURE__ */ i(
42
+ g,
43
+ {
44
+ ...e,
45
+ format: n,
46
+ views: p,
47
+ sx: {
48
+ ".MuiButtonBase-root": {
49
+ padding: 0.5
50
+ }
51
+ },
52
+ value: m(e.value, r),
53
+ onChange: (s) => {
54
+ f(s, r);
55
+ },
56
+ slotProps: {
57
+ textField: {
58
+ error: !!o.error,
59
+ helperText: (a = o.error) == null ? void 0 : a.message
60
+ },
61
+ // NOTE: clearボタンが文字を隠していまうのでとりあえずcalendar内のもので代用
62
+ // field: {
63
+ // clearable: true,
64
+ // },
65
+ actionBar: { actions: ["clear"] }
66
+ }
67
+ }
68
+ );
69
+ }
70
+ }
71
+ ),
72
+ "~",
73
+ /* @__PURE__ */ i(
74
+ h,
75
+ {
76
+ control: t,
77
+ name: u.name,
78
+ defaultValue: u.defaultValue,
79
+ render: ({ field: e, fieldState: o }) => {
80
+ var a;
81
+ return /* @__PURE__ */ i(
82
+ g,
83
+ {
84
+ ...e,
85
+ format: n,
86
+ views: p,
87
+ sx: {
88
+ ".MuiButtonBase-root": {
89
+ padding: 0.5
90
+ }
91
+ },
92
+ value: m(e.value, u),
93
+ onChange: (s) => {
94
+ n === A && s !== null && !e.value && (s = F(s, {
95
+ hours: 23,
96
+ minutes: 59,
97
+ seconds: 59
98
+ })), f(s, u);
99
+ },
100
+ slotProps: {
101
+ textField: {
102
+ error: !!o.error,
103
+ helperText: (a = o.error) == null ? void 0 : a.message
104
+ },
105
+ // NOTE: clearボタンが文字を隠していまうのでとりあえずcalendar内のもので代用
106
+ // field: {
107
+ // clearable: true,
108
+ // },
109
+ actionBar: { actions: ["clear"] }
110
+ }
111
+ }
112
+ );
113
+ }
114
+ }
115
+ )
116
+ ] })
117
+ }
118
+ );
119
+ };
120
+ export {
121
+ I as RangeDatePickerController,
122
+ I as default
123
+ };
@@ -0,0 +1,24 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { r as s, a as c, s as e } from "../../react.esm-C8amP77L.js";
3
+ import { u as l } from "../../index.esm-ChwJSgnF.js";
4
+ import { RangeDatePickerController as m } from "./index.js";
5
+ describe("RangeDatePickerController component", () => {
6
+ it("renders date pickers with correct default values", () => {
7
+ const { result: t } = s(() => l()), o = t.current.control;
8
+ c(
9
+ /* @__PURE__ */ n(
10
+ m,
11
+ {
12
+ control: o,
13
+ fromDateInfo: { name: "fromDate", defaultValue: "2024-03-01" },
14
+ toDateInfo: { name: "toDate", defaultValue: "2024-03-15" },
15
+ dateFormat: "yyyy-MM-dd",
16
+ setValue: () => {
17
+ }
18
+ }
19
+ )
20
+ );
21
+ const r = e.getByDisplayValue("2024-03-01"), a = e.getByDisplayValue("2024-03-15");
22
+ expect(r).toBeInTheDocument(), expect(a).toBeInTheDocument();
23
+ });
24
+ });
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type Props = {
4
+ value: string | ReactNode;
5
+ label: string | ReactNode;
6
+ };
7
+ /**
8
+ * ダッシュボード用のレポート表示(値の直接表示)用のカードです。
9
+ * 項目名と値のみを表示します。
10
+ */
11
+ export declare const ReportCard: (props: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export default ReportCard;
@@ -0,0 +1,18 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import { Card as l, Box as p, Grid as c } from "@mui/material";
3
+ import '../../assets/index3.css';const d = "_reportCard_wox0s_1", n = "_reportBox_wox0s_8", x = "_reportLabel_wox0s_14", _ = "_reportValue_wox0s_17", e = {
4
+ reportCard: d,
5
+ reportBox: n,
6
+ reportLabel: x,
7
+ reportValue: _
8
+ }, u = (o) => {
9
+ const { value: t, label: a } = o;
10
+ return /* @__PURE__ */ r(l, { className: e.reportCard, children: /* @__PURE__ */ r(p, { className: e.reportBox, children: /* @__PURE__ */ s(c, { children: [
11
+ /* @__PURE__ */ r("div", { className: e.reportValue, children: t }),
12
+ /* @__PURE__ */ r("div", { className: e.reportLabel, children: a })
13
+ ] }) }) });
14
+ };
15
+ export {
16
+ u as ReportCard,
17
+ u as default
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Typography as r } from "@mui/material";
3
+ import { a as l, s as t } from "../../react.esm-C8amP77L.js";
4
+ import { ReportCard as a } from "./index.js";
5
+ describe("ReportCard component", () => {
6
+ it("renders ReportCard component with given label string and value string", async () => {
7
+ l(/* @__PURE__ */ e(a, { value: "値", label: "ラベル" }));
8
+ const n = t.getByText("値");
9
+ expect(n).toBeInTheDocument();
10
+ const o = t.getByText("ラベル");
11
+ expect(o).toBeInTheDocument();
12
+ }), it("renders ReportCard component with given label element and value element", async () => {
13
+ l(
14
+ /* @__PURE__ */ e(
15
+ a,
16
+ {
17
+ value: /* @__PURE__ */ e(r, { children: "値" }),
18
+ label: /* @__PURE__ */ e(r, { children: "ラベル" })
19
+ }
20
+ )
21
+ );
22
+ const n = t.getByText("値");
23
+ expect(n).toBeInTheDocument();
24
+ const o = t.getByText("ラベル");
25
+ expect(o).toBeInTheDocument();
26
+ });
27
+ });
@@ -0,0 +1,22 @@
1
+ type Props = {
2
+ dataList: unknown[];
3
+ title: string;
4
+ xLabel: string;
5
+ yLabel: string;
6
+ labelKey: string;
7
+ valueKey: string;
8
+ borderColor: string;
9
+ chartMargin?: ChartMargin;
10
+ tooltipFormatter?: CustomToolTipFormatter;
11
+ isLoading?: boolean;
12
+ };
13
+ type ChartMargin = {
14
+ top: number;
15
+ right: number;
16
+ bottom: number;
17
+ left: number;
18
+ };
19
+ type CustomToolTipFormatter = (value: unknown, label: string) => string[];
20
+ export declare const ReportChartRe: (props: Props) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const ReportChart: (props: Props) => import("react/jsx-runtime").JSX.Element;
22
+ export default ReportChart;