@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 CHANGED
@@ -145,87 +145,3 @@ Peer dependencies (install in your consuming app):
145
145
  ```bash
146
146
  yarn add @mui/material @emotion/react @emotion/styled react react-dom
147
147
  ```
148
-
149
- ## command used to create the foundational components
150
-
151
- nder the src/components/foundation folder i want to add
152
- wrapper objects for each of the following. these objects will
153
- live in their own component file. not 1 big file
154
- each component will extend the base typography component in the
155
- mui-design library
156
- H1
157
-
158
- <div class="css-1pjc7v5"><h1 class="MuiTypography-root
159
- MuiTypography-h1 css-p6re0n">How can you choose a
160
- typeface?</h1><pre class="MuiBox-root css-6cymt6">{
161
- "fontWeight": 800,
162
- "fontSize": "2.5rem (40px)",
163
- "lineHeight": 1.25,
164
- "@media (min-width:600px)": {
165
- "fontSize": "3.25rem (52px)"
166
- },
167
- "@media (min-width:900px)": {
168
- "fontSize": "3.625rem (58px)"
169
- },
170
- "@media (min-width:1200px)": {
171
- "fontSize": "4rem (64px)"
172
- }
173
- }</pre></div>
174
- ⎿ Interrupted · What should Claude do instead?
175
-
176
- [Image #2] (↑ to select)
177
- ─────────────────────────────────────────────────────────── ▪▪▪ ─
178
- ❯ under the src/components/foundation folder i want to add
179
- wrapper objects for each of the following. these objects will
180
- live in their own component file. not 1 big file
181
- each component will extend the base typography component in
182
- the mui-design library
183
- for each component i will give 2 lines for the name of the
184
- component and what to export it as, the div element that
185
- contains the component itself as it is used on a web page and
186
- the pre object that contains the styles for the component
187
- rules for each component
188
- always use the theme values rather than hardcoding values
189
- i.e fontweight:800, the 800 should come from the theme
190
- definition
191
- also create the storybook entry from the component entry i
192
- have provided above showing the component name, example text,
193
- and the styles from the pre section to show the styles that
194
- make up the component all on a card like this
195
-
196
- all the theme elements can be found in docs/theme.json which
197
- is a json object showing all the current default theme values
198
- H1
199
- [Pasted text #1 +13 lines]
200
- H2
201
- [Pasted text #3 +13 lines]
202
- H3
203
- [Pasted text #4 +13 lines]
204
- H4
205
- [Pasted text #5 +7 lines]
206
- H5
207
- [Pasted text #6 +7 lines]
208
- H6
209
- [Pasted text #7 +7 lines]
210
- Subtitle1
211
- [Pasted text #8 +4 lines]
212
- Subtitle2
213
- [Pasted text #9 +4 lines]
214
- Body1
215
- [Pasted text #10 +4 lines]
216
- Body2
217
- [Pasted text #11 +4 lines]
218
- Caption
219
- [Pasted text #12 +4 lines]
220
- Overline
221
- [Pasted text #13 +4 lines]
222
- Button
223
- [Pasted text #14 +4 lines]
224
- use the text.primary values from the theme palette object as
225
- the text colour and use the theme entry from the typeography
226
- object for each component
227
- for example H1 fontweight should come from the them value
228
- typography.h1.fontWeight
229
- at the end if you can add tests for each component
230
- build and check for completness
231
- i can use storybook to see if the components creation worked
package/dist/index.d.mts CHANGED
@@ -60,6 +60,16 @@ interface ColorTokens {
60
60
  borderFocus: string;
61
61
  overlayLight: string;
62
62
  overlayDark: string;
63
+ overlayLight60: string;
64
+ overlayLight70: string;
65
+ overlayLight75: string;
66
+ overlayLight85: string;
67
+ colorRed: string;
68
+ colorAmber: string;
69
+ colorOrange: string;
70
+ colorGreen: string;
71
+ colorBlue: string;
72
+ colorGrey: string;
63
73
  }
64
74
  interface TypographyTokens {
65
75
  fontFamilyBase: string;
@@ -71,6 +81,7 @@ interface TypographyTokens {
71
81
  fontSizeXl: string;
72
82
  fontSize2xl: string;
73
83
  fontSize3xl: string;
84
+ fontSize4xl: string;
74
85
  fontWeightLight: number;
75
86
  fontWeightRegular: number;
76
87
  fontWeightMedium: number;
@@ -128,7 +139,14 @@ interface ZIndexTokens {
128
139
  toast: number;
129
140
  tooltip: number;
130
141
  }
142
+ interface FooterTokens {
143
+ background: string;
144
+ textColor: string;
145
+ linkColor: string;
146
+ linkHoverColor: string;
147
+ }
131
148
  interface ComponentTokens {
149
+ footer: FooterTokens;
132
150
  button: {
133
151
  paddingX: string;
134
152
  paddingY: string;
@@ -412,11 +430,20 @@ declare const CardContent: _mui_material_OverridableComponent.OverridableCompone
412
430
  declare const CardHeader: _mui_material.OverridableCardHeader;
413
431
  declare const CardActions: typeof CardActions$1;
414
432
 
415
- type TextFieldProps = TextFieldProps$1;
416
- declare function TextField({ error, FormHelperTextProps, inputProps, label, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
417
- declare namespace TextField {
418
- var displayName: string;
419
- }
433
+ type TextFieldProps = TextFieldProps$1 & {
434
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
435
+ showPasswordToggle?: boolean;
436
+ };
437
+ declare const TextField: React.ForwardRefExoticComponent<(Omit<_mui_material.OutlinedTextFieldProps & {
438
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
439
+ showPasswordToggle?: boolean;
440
+ }, "ref"> | Omit<_mui_material.FilledTextFieldProps & {
441
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
442
+ showPasswordToggle?: boolean;
443
+ }, "ref"> | Omit<_mui_material.StandardTextFieldProps & {
444
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
445
+ showPasswordToggle?: boolean;
446
+ }, "ref">) & React.RefAttributes<HTMLInputElement>>;
420
447
 
421
448
  type AlertProps = AlertProps$1;
422
449
  type AlertTitleProps = AlertTitleProps$1;
package/dist/index.d.ts CHANGED
@@ -60,6 +60,16 @@ interface ColorTokens {
60
60
  borderFocus: string;
61
61
  overlayLight: string;
62
62
  overlayDark: string;
63
+ overlayLight60: string;
64
+ overlayLight70: string;
65
+ overlayLight75: string;
66
+ overlayLight85: string;
67
+ colorRed: string;
68
+ colorAmber: string;
69
+ colorOrange: string;
70
+ colorGreen: string;
71
+ colorBlue: string;
72
+ colorGrey: string;
63
73
  }
64
74
  interface TypographyTokens {
65
75
  fontFamilyBase: string;
@@ -71,6 +81,7 @@ interface TypographyTokens {
71
81
  fontSizeXl: string;
72
82
  fontSize2xl: string;
73
83
  fontSize3xl: string;
84
+ fontSize4xl: string;
74
85
  fontWeightLight: number;
75
86
  fontWeightRegular: number;
76
87
  fontWeightMedium: number;
@@ -128,7 +139,14 @@ interface ZIndexTokens {
128
139
  toast: number;
129
140
  tooltip: number;
130
141
  }
142
+ interface FooterTokens {
143
+ background: string;
144
+ textColor: string;
145
+ linkColor: string;
146
+ linkHoverColor: string;
147
+ }
131
148
  interface ComponentTokens {
149
+ footer: FooterTokens;
132
150
  button: {
133
151
  paddingX: string;
134
152
  paddingY: string;
@@ -412,11 +430,20 @@ declare const CardContent: _mui_material_OverridableComponent.OverridableCompone
412
430
  declare const CardHeader: _mui_material.OverridableCardHeader;
413
431
  declare const CardActions: typeof CardActions$1;
414
432
 
415
- type TextFieldProps = TextFieldProps$1;
416
- declare function TextField({ error, FormHelperTextProps, inputProps, label, ...props }: TextFieldProps): react_jsx_runtime.JSX.Element;
417
- declare namespace TextField {
418
- var displayName: string;
419
- }
433
+ type TextFieldProps = TextFieldProps$1 & {
434
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
435
+ showPasswordToggle?: boolean;
436
+ };
437
+ declare const TextField: React.ForwardRefExoticComponent<(Omit<_mui_material.OutlinedTextFieldProps & {
438
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
439
+ showPasswordToggle?: boolean;
440
+ }, "ref"> | Omit<_mui_material.FilledTextFieldProps & {
441
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
442
+ showPasswordToggle?: boolean;
443
+ }, "ref"> | Omit<_mui_material.StandardTextFieldProps & {
444
+ /** When true and type="password", renders a visibility toggle icon button as end adornment. */
445
+ showPasswordToggle?: boolean;
446
+ }, "ref">) & React.RefAttributes<HTMLInputElement>>;
420
447
 
421
448
  type AlertProps = AlertProps$1;
422
449
  type AlertTitleProps = AlertTitleProps$1;
package/dist/index.js CHANGED
@@ -116,7 +116,17 @@ var defaultTheme = {
116
116
  border: "#C5CFE0",
117
117
  borderFocus: "#1565C0",
118
118
  overlayLight: "rgba(255, 255, 255, 0.8)",
119
- overlayDark: "rgba(0, 0, 0, 0.12)"
119
+ overlayDark: "rgba(0, 0, 0, 0.12)",
120
+ overlayLight60: "rgba(255, 255, 255, 0.6)",
121
+ overlayLight70: "rgba(255, 255, 255, 0.7)",
122
+ overlayLight75: "rgba(255, 255, 255, 0.75)",
123
+ overlayLight85: "rgba(255, 255, 255, 0.85)",
124
+ colorRed: "#FF5630",
125
+ colorAmber: "#FFAB00",
126
+ colorOrange: "#FF8B00",
127
+ colorGreen: "#36B37E",
128
+ colorBlue: "#0065FF",
129
+ colorGrey: "#6B778C"
120
130
  },
121
131
  typography: {
122
132
  fontFamilyBase: '"Source Sans Pro", sans-serif',
@@ -136,6 +146,8 @@ var defaultTheme = {
136
146
  // 22px
137
147
  fontSize3xl: "1.75rem",
138
148
  // 28px
149
+ fontSize4xl: "2.25rem",
150
+ // 36px
139
151
  // ── Weights (identical across all themes) ─────────────────────────────
140
152
  fontWeightLight: 300,
141
153
  fontWeightRegular: 400,
@@ -196,6 +208,12 @@ var defaultTheme = {
196
208
  tooltip: 700
197
209
  },
198
210
  components: {
211
+ footer: {
212
+ background: "#003c8f",
213
+ textColor: "rgba(255, 255, 255, 0.7)",
214
+ linkColor: "rgba(255, 255, 255, 0.7)",
215
+ linkHoverColor: "#ffffff"
216
+ },
199
217
  button: {
200
218
  // Sizes & paddings (identical across themes)
201
219
  paddingX: "12px",
@@ -1245,9 +1263,12 @@ var CardActions = import_material4.CardActions;
1245
1263
  Card.displayName = "ToolkitCard";
1246
1264
 
1247
1265
  // src/components/TextField/TextField.tsx
1266
+ var import_react = __toESM(require("react"));
1248
1267
  var import_material5 = require("@mui/material");
1249
1268
  var import_styles4 = require("@mui/material/styles");
1250
1269
  var import_jsx_runtime5 = require("react/jsx-runtime");
1270
+ var VisibilityIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.SvgIcon, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }) });
1271
+ var VisibilityOffIcon = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.SvgIcon, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }) });
1251
1272
  var StyledTextField = (0, import_styles4.styled)(import_material5.TextField)(({ theme }) => ({
1252
1273
  // Transition on the entire field when focus changes
1253
1274
  "& .MuiOutlinedInput-root": {
@@ -1257,25 +1278,42 @@ var StyledTextField = (0, import_styles4.styled)(import_material5.TextField)(({
1257
1278
  }
1258
1279
  }
1259
1280
  }));
1260
- function TextField({ error, FormHelperTextProps, inputProps, label, ...props }) {
1261
- if (process.env.NODE_ENV !== "production") {
1262
- if (!label && !props["aria-label"] && !props["aria-labelledby"] && !inputProps?.["aria-label"] && !inputProps?.["aria-labelledby"]) {
1263
- console.warn("[ToolkitTextField] Missing accessible label. Provide `label`, `aria-label`, or `aria-labelledby`.");
1281
+ var TextField = import_react.default.forwardRef(
1282
+ function TextField2({ error, FormHelperTextProps, inputProps, label, showPasswordToggle, type, slotProps, ...props }, ref) {
1283
+ const [showPassword, setShowPassword] = (0, import_react.useState)(false);
1284
+ if (process.env.NODE_ENV !== "production") {
1285
+ if (!label && !props["aria-label"] && !props["aria-labelledby"] && !inputProps?.["aria-label"] && !inputProps?.["aria-labelledby"]) {
1286
+ console.warn("[ToolkitTextField] Missing accessible label. Provide `label`, `aria-label`, or `aria-labelledby`.");
1287
+ }
1264
1288
  }
1289
+ const resolvedType = showPasswordToggle && type === "password" ? showPassword ? "text" : "password" : type;
1290
+ const toggleAdornment = showPasswordToggle && type === "password" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.InputAdornment, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1291
+ import_material5.IconButton,
1292
+ {
1293
+ "aria-label": showPassword ? "Hide password" : "Show password",
1294
+ onClick: () => setShowPassword((prev) => !prev),
1295
+ edge: "end",
1296
+ children: showPassword ? VisibilityOffIcon : VisibilityIcon
1297
+ }
1298
+ ) }) : null;
1299
+ const mergedSlotProps = toggleAdornment ? { ...slotProps, input: { endAdornment: toggleAdornment, ...slotProps?.input } } : slotProps;
1300
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1301
+ StyledTextField,
1302
+ {
1303
+ fullWidth: true,
1304
+ variant: "outlined",
1305
+ label,
1306
+ error,
1307
+ type: resolvedType,
1308
+ inputRef: ref,
1309
+ inputProps,
1310
+ slotProps: mergedSlotProps,
1311
+ FormHelperTextProps: error ? { role: "alert", ...FormHelperTextProps } : FormHelperTextProps,
1312
+ ...props
1313
+ }
1314
+ );
1265
1315
  }
1266
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1267
- StyledTextField,
1268
- {
1269
- fullWidth: true,
1270
- variant: "outlined",
1271
- label,
1272
- error,
1273
- inputProps,
1274
- FormHelperTextProps: error ? { role: "alert", ...FormHelperTextProps } : FormHelperTextProps,
1275
- ...props
1276
- }
1277
- );
1278
- }
1316
+ );
1279
1317
  TextField.displayName = "ToolkitTextField";
1280
1318
 
1281
1319
  // src/components/Alert/Alert.tsx
@@ -1377,7 +1415,7 @@ function ToggleButtonGroup(props) {
1377
1415
  ToggleButtonGroup.displayName = "ToolkitToggleButtonGroup";
1378
1416
 
1379
1417
  // src/components/DatePicker/DatePicker.tsx
1380
- var import_react = require("react");
1418
+ var import_react2 = require("react");
1381
1419
  var import_AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
1382
1420
  var import_LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
1383
1421
  var import_DatePicker = require("@mui/x-date-pickers/DatePicker");
@@ -1484,8 +1522,8 @@ function DateRangePickerInput({
1484
1522
  endLabel = "End date",
1485
1523
  buttonLabel = "Click me!"
1486
1524
  }) {
1487
- const [open, setOpen] = (0, import_react.useState)(false);
1488
- const [draft, setDraft] = (0, import_react.useState)(value);
1525
+ const [open, setOpen] = (0, import_react2.useState)(false);
1526
+ const [draft, setDraft] = (0, import_react2.useState)(value);
1489
1527
  const handleOpen = () => {
1490
1528
  setDraft(value);
1491
1529
  setOpen(true);
@@ -1531,9 +1569,9 @@ function DateRangePickerCalendar({
1531
1569
  onChange,
1532
1570
  buttonLabel = "Click me!"
1533
1571
  }) {
1534
- const [open, setOpen] = (0, import_react.useState)(false);
1535
- const [draft, setDraft] = (0, import_react.useState)(value);
1536
- const [selecting, setSelecting] = (0, import_react.useState)("start");
1572
+ const [open, setOpen] = (0, import_react2.useState)(false);
1573
+ const [draft, setDraft] = (0, import_react2.useState)(value);
1574
+ const [selecting, setSelecting] = (0, import_react2.useState)("start");
1537
1575
  const handleOpen = () => {
1538
1576
  setDraft(value);
1539
1577
  setSelecting("start");