@octoguide/mui-ui-toolkit 0.1.0 → 0.3.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 +0 -84
- package/dist/index.d.mts +32 -5
- package/dist/index.d.ts +32 -5
- package/dist/index.js +62 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -26,7 +26,17 @@ var defaultTheme = {
|
|
|
26
26
|
border: "#C5CFE0",
|
|
27
27
|
borderFocus: "#1565C0",
|
|
28
28
|
overlayLight: "rgba(255, 255, 255, 0.8)",
|
|
29
|
-
overlayDark: "rgba(0, 0, 0, 0.12)"
|
|
29
|
+
overlayDark: "rgba(0, 0, 0, 0.12)",
|
|
30
|
+
overlayLight60: "rgba(255, 255, 255, 0.6)",
|
|
31
|
+
overlayLight70: "rgba(255, 255, 255, 0.7)",
|
|
32
|
+
overlayLight75: "rgba(255, 255, 255, 0.75)",
|
|
33
|
+
overlayLight85: "rgba(255, 255, 255, 0.85)",
|
|
34
|
+
colorRed: "#FF5630",
|
|
35
|
+
colorAmber: "#FFAB00",
|
|
36
|
+
colorOrange: "#FF8B00",
|
|
37
|
+
colorGreen: "#36B37E",
|
|
38
|
+
colorBlue: "#0065FF",
|
|
39
|
+
colorGrey: "#6B778C"
|
|
30
40
|
},
|
|
31
41
|
typography: {
|
|
32
42
|
fontFamilyBase: '"Source Sans Pro", sans-serif',
|
|
@@ -46,6 +56,8 @@ var defaultTheme = {
|
|
|
46
56
|
// 22px
|
|
47
57
|
fontSize3xl: "1.75rem",
|
|
48
58
|
// 28px
|
|
59
|
+
fontSize4xl: "2.25rem",
|
|
60
|
+
// 36px
|
|
49
61
|
// ── Weights (identical across all themes) ─────────────────────────────
|
|
50
62
|
fontWeightLight: 300,
|
|
51
63
|
fontWeightRegular: 400,
|
|
@@ -106,6 +118,12 @@ var defaultTheme = {
|
|
|
106
118
|
tooltip: 700
|
|
107
119
|
},
|
|
108
120
|
components: {
|
|
121
|
+
footer: {
|
|
122
|
+
background: "#003c8f",
|
|
123
|
+
textColor: "rgba(255, 255, 255, 0.7)",
|
|
124
|
+
linkColor: "rgba(255, 255, 255, 0.7)",
|
|
125
|
+
linkHoverColor: "#ffffff"
|
|
126
|
+
},
|
|
109
127
|
button: {
|
|
110
128
|
// Sizes & paddings (identical across themes)
|
|
111
129
|
paddingX: "12px",
|
|
@@ -1162,11 +1180,17 @@ var CardActions = MuiCardActions;
|
|
|
1162
1180
|
Card.displayName = "ToolkitCard";
|
|
1163
1181
|
|
|
1164
1182
|
// src/components/TextField/TextField.tsx
|
|
1183
|
+
import React, { useState } from "react";
|
|
1165
1184
|
import {
|
|
1166
|
-
TextField as MuiTextField
|
|
1185
|
+
TextField as MuiTextField,
|
|
1186
|
+
InputAdornment,
|
|
1187
|
+
IconButton,
|
|
1188
|
+
SvgIcon as SvgIcon2
|
|
1167
1189
|
} from "@mui/material";
|
|
1168
1190
|
import { styled as styled3 } from "@mui/material/styles";
|
|
1169
1191
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1192
|
+
var VisibilityIcon = /* @__PURE__ */ jsx5(SvgIcon2, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { fill: "currentColor", d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3" }) });
|
|
1193
|
+
var VisibilityOffIcon = /* @__PURE__ */ jsx5(SvgIcon2, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { fill: "currentColor", d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75C21.27 5.61 17 2.5 12 2.5c-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 5.13 11.35 5 12 5M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27M7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01" }) });
|
|
1170
1194
|
var StyledTextField = styled3(MuiTextField)(({ theme }) => ({
|
|
1171
1195
|
// Transition on the entire field when focus changes
|
|
1172
1196
|
"& .MuiOutlinedInput-root": {
|
|
@@ -1176,38 +1200,55 @@ var StyledTextField = styled3(MuiTextField)(({ theme }) => ({
|
|
|
1176
1200
|
}
|
|
1177
1201
|
}
|
|
1178
1202
|
}));
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1203
|
+
var TextField = React.forwardRef(
|
|
1204
|
+
function TextField2({ error, FormHelperTextProps, inputProps, label, showPasswordToggle, type, slotProps, ...props }, ref) {
|
|
1205
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
1206
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1207
|
+
if (!label && !props["aria-label"] && !props["aria-labelledby"] && !inputProps?.["aria-label"] && !inputProps?.["aria-labelledby"]) {
|
|
1208
|
+
console.warn("[ToolkitTextField] Missing accessible label. Provide `label`, `aria-label`, or `aria-labelledby`.");
|
|
1209
|
+
}
|
|
1183
1210
|
}
|
|
1211
|
+
const resolvedType = showPasswordToggle && type === "password" ? showPassword ? "text" : "password" : type;
|
|
1212
|
+
const toggleAdornment = showPasswordToggle && type === "password" ? /* @__PURE__ */ jsx5(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx5(
|
|
1213
|
+
IconButton,
|
|
1214
|
+
{
|
|
1215
|
+
"aria-label": showPassword ? "Hide password" : "Show password",
|
|
1216
|
+
onClick: () => setShowPassword((prev) => !prev),
|
|
1217
|
+
edge: "end",
|
|
1218
|
+
children: showPassword ? VisibilityOffIcon : VisibilityIcon
|
|
1219
|
+
}
|
|
1220
|
+
) }) : null;
|
|
1221
|
+
const mergedSlotProps = toggleAdornment ? { ...slotProps, input: { endAdornment: toggleAdornment, ...slotProps?.input } } : slotProps;
|
|
1222
|
+
return /* @__PURE__ */ jsx5(
|
|
1223
|
+
StyledTextField,
|
|
1224
|
+
{
|
|
1225
|
+
fullWidth: true,
|
|
1226
|
+
variant: "outlined",
|
|
1227
|
+
label,
|
|
1228
|
+
error,
|
|
1229
|
+
type: resolvedType,
|
|
1230
|
+
inputRef: ref,
|
|
1231
|
+
inputProps,
|
|
1232
|
+
slotProps: mergedSlotProps,
|
|
1233
|
+
FormHelperTextProps: error ? { role: "alert", ...FormHelperTextProps } : FormHelperTextProps,
|
|
1234
|
+
...props
|
|
1235
|
+
}
|
|
1236
|
+
);
|
|
1184
1237
|
}
|
|
1185
|
-
|
|
1186
|
-
StyledTextField,
|
|
1187
|
-
{
|
|
1188
|
-
fullWidth: true,
|
|
1189
|
-
variant: "outlined",
|
|
1190
|
-
label,
|
|
1191
|
-
error,
|
|
1192
|
-
inputProps,
|
|
1193
|
-
FormHelperTextProps: error ? { role: "alert", ...FormHelperTextProps } : FormHelperTextProps,
|
|
1194
|
-
...props
|
|
1195
|
-
}
|
|
1196
|
-
);
|
|
1197
|
-
}
|
|
1238
|
+
);
|
|
1198
1239
|
TextField.displayName = "ToolkitTextField";
|
|
1199
1240
|
|
|
1200
1241
|
// src/components/Alert/Alert.tsx
|
|
1201
1242
|
import {
|
|
1202
1243
|
Alert as MuiAlert,
|
|
1203
1244
|
AlertTitle as MuiAlertTitle,
|
|
1204
|
-
SvgIcon as
|
|
1245
|
+
SvgIcon as SvgIcon3
|
|
1205
1246
|
} from "@mui/material";
|
|
1206
1247
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1207
|
-
var InfoIcon = /* @__PURE__ */ jsx6(
|
|
1208
|
-
var SuccessIcon = /* @__PURE__ */ jsx6(
|
|
1209
|
-
var WarningIcon = /* @__PURE__ */ jsx6(
|
|
1210
|
-
var ErrorIcon = /* @__PURE__ */ jsx6(
|
|
1248
|
+
var InfoIcon = /* @__PURE__ */ jsx6(SvgIcon3, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { fill: "currentColor", fillRule: "evenodd", d: "M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10m-10 5.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2", clipRule: "evenodd" }) });
|
|
1249
|
+
var SuccessIcon = /* @__PURE__ */ jsx6(SvgIcon3, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { fill: "currentColor", fillRule: "evenodd", d: "M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2s10 4.477 10 10m-5.97-3.03a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 0 1-1.06 0l-2-2a.75.75 0 1 1 1.06-1.06l1.47 1.47l2.235-2.235L14.97 8.97a.75.75 0 0 1 1.06 0", clipRule: "evenodd" }) });
|
|
1250
|
+
var WarningIcon = /* @__PURE__ */ jsx6(SvgIcon3, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { fill: "currentColor", fillRule: "evenodd", d: "M5.312 10.762C8.23 5.587 9.689 3 12 3c2.31 0 3.77 2.587 6.688 7.762l.364.644c2.425 4.3 3.638 6.45 2.542 8.022S17.786 21 12.364 21h-.728c-5.422 0-8.134 0-9.23-1.572s.117-3.722 2.542-8.022zM12 7.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V8a.75.75 0 0 1 .75-.75M12 17a1 1 0 1 0 0-2a1 1 0 0 0 0 2", clipRule: "evenodd" }) });
|
|
1251
|
+
var ErrorIcon = /* @__PURE__ */ jsx6(SvgIcon3, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { fill: "currentColor", fillRule: "evenodd", d: "M7.843 3.802C9.872 2.601 10.886 2 12 2c1.114 0 2.128.6 4.157 1.802l.686.406c2.029 1.202 3.043 1.803 3.6 2.792c.557.99.557 2.19.557 4.594v.812c0 2.403 0 3.605-.557 4.594c-.557.99-1.571 1.59-3.6 2.791l-.686.407C14.128 21.399 13.114 22 12 22c-1.114 0-2.128-.6-4.157-1.802l-.686-.407c-2.029-1.2-3.043-1.802-3.6-2.791C3 16.01 3 14.81 3 12.406v-.812C3 9.19 3 7.989 3.557 7c.557-.99 1.571-1.59 3.6-2.792zM13 16a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-1-9.75a.75.75 0 0 1 .75.75v6a.75.75 0 0 1-1.5 0V7a.75.75 0 0 1 .75-.75", clipRule: "evenodd" }) });
|
|
1211
1252
|
var defaultIconMapping = {
|
|
1212
1253
|
info: InfoIcon,
|
|
1213
1254
|
success: SuccessIcon,
|
|
@@ -1307,7 +1348,7 @@ function ToggleButtonGroup(props) {
|
|
|
1307
1348
|
ToggleButtonGroup.displayName = "ToolkitToggleButtonGroup";
|
|
1308
1349
|
|
|
1309
1350
|
// src/components/DatePicker/DatePicker.tsx
|
|
1310
|
-
import { useState } from "react";
|
|
1351
|
+
import { useState as useState2 } from "react";
|
|
1311
1352
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
1312
1353
|
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
1313
1354
|
import {
|
|
@@ -1363,7 +1404,7 @@ import DialogContent from "@mui/material/DialogContent";
|
|
|
1363
1404
|
import DialogActions from "@mui/material/DialogActions";
|
|
1364
1405
|
import Button2 from "@mui/material/Button";
|
|
1365
1406
|
import Box from "@mui/material/Box";
|
|
1366
|
-
import
|
|
1407
|
+
import TextField3 from "@mui/material/TextField";
|
|
1367
1408
|
import { styled as styled6 } from "@mui/material/styles";
|
|
1368
1409
|
import { Fragment, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1369
1410
|
function DateLocalizationProvider({ children }) {
|
|
@@ -1446,8 +1487,8 @@ function DateRangePickerInput({
|
|
|
1446
1487
|
endLabel = "End date",
|
|
1447
1488
|
buttonLabel = "Click me!"
|
|
1448
1489
|
}) {
|
|
1449
|
-
const [open, setOpen] =
|
|
1450
|
-
const [draft, setDraft] =
|
|
1490
|
+
const [open, setOpen] = useState2(false);
|
|
1491
|
+
const [draft, setDraft] = useState2(value);
|
|
1451
1492
|
const handleOpen = () => {
|
|
1452
1493
|
setDraft(value);
|
|
1453
1494
|
setOpen(true);
|
|
@@ -1493,9 +1534,9 @@ function DateRangePickerCalendar({
|
|
|
1493
1534
|
onChange,
|
|
1494
1535
|
buttonLabel = "Click me!"
|
|
1495
1536
|
}) {
|
|
1496
|
-
const [open, setOpen] =
|
|
1497
|
-
const [draft, setDraft] =
|
|
1498
|
-
const [selecting, setSelecting] =
|
|
1537
|
+
const [open, setOpen] = useState2(false);
|
|
1538
|
+
const [draft, setDraft] = useState2(value);
|
|
1539
|
+
const [selecting, setSelecting] = useState2("start");
|
|
1499
1540
|
const handleOpen = () => {
|
|
1500
1541
|
setDraft(value);
|
|
1501
1542
|
setSelecting("start");
|
|
@@ -1519,7 +1560,7 @@ function DateRangePickerCalendar({
|
|
|
1519
1560
|
/* @__PURE__ */ jsxs2(Dialog, { open, onClose: handleCancel, children: [
|
|
1520
1561
|
/* @__PURE__ */ jsxs2(DialogContent, { sx: { p: 1 }, children: [
|
|
1521
1562
|
/* @__PURE__ */ jsx10(Box, { sx: { mb: 1, px: 1 }, children: /* @__PURE__ */ jsx10(
|
|
1522
|
-
|
|
1563
|
+
TextField3,
|
|
1523
1564
|
{
|
|
1524
1565
|
size: "small",
|
|
1525
1566
|
label: "Selecting",
|