@octoguide/mui-ui-toolkit 0.9.0 → 0.10.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/dist/index.mjs CHANGED
@@ -3845,66 +3845,20 @@ function Toggle({
3845
3845
  }
3846
3846
  Toggle.displayName = "ToolkitToggle";
3847
3847
 
3848
- // src/components/Table/Table.tsx
3849
- import {
3850
- Table as MuiTable,
3851
- TableHead as MuiTableHead,
3852
- TableBody as MuiTableBody,
3853
- TableRow as MuiTableRow,
3854
- TableCell as MuiTableCell,
3855
- TableContainer as MuiTableContainer,
3856
- TablePagination as MuiTablePagination,
3857
- TableSortLabel as MuiTableSortLabel
3858
- } from "@mui/material";
3859
- import { styled as styled23 } from "@mui/material/styles";
3860
- import { jsx as jsx28 } from "react/jsx-runtime";
3861
- var StyledTableContainer = styled23(MuiTableContainer)(() => ({
3862
- overflowX: "auto"
3863
- }));
3864
- var StyledHeadCell = styled23(MuiTableCell)(({ theme }) => ({
3865
- fontWeight: theme.tokens.components.table.headerFontWeight,
3866
- backgroundColor: theme.tokens.components.table.headerBackground,
3867
- borderBottomWidth: theme.tokens.components.table.borderWidth,
3868
- borderBottomColor: theme.tokens.components.table.borderColor
3869
- }));
3870
- function Table(props) {
3871
- return /* @__PURE__ */ jsx28(MuiTable, { ...props });
3872
- }
3873
- function TableHead(props) {
3874
- return /* @__PURE__ */ jsx28(MuiTableHead, { ...props });
3875
- }
3876
- function TableBody(props) {
3877
- return /* @__PURE__ */ jsx28(MuiTableBody, { ...props });
3878
- }
3879
- function TableRow(props) {
3880
- return /* @__PURE__ */ jsx28(MuiTableRow, { ...props });
3881
- }
3882
- function TableCell(props) {
3883
- return /* @__PURE__ */ jsx28(MuiTableCell, { ...props });
3884
- }
3885
- function TableHeadCell(props) {
3886
- return /* @__PURE__ */ jsx28(StyledHeadCell, { component: "th", scope: "col", ...props });
3887
- }
3888
- function TableContainer(props) {
3889
- return /* @__PURE__ */ jsx28(StyledTableContainer, { ...props });
3890
- }
3891
- var TablePagination = MuiTablePagination;
3892
- var TableSortLabel = MuiTableSortLabel;
3893
- Table.displayName = "ToolkitTable";
3894
- TableHead.displayName = "ToolkitTableHead";
3895
- TableBody.displayName = "ToolkitTableBody";
3896
- TableRow.displayName = "ToolkitTableRow";
3897
- TableCell.displayName = "ToolkitTableCell";
3898
- TableHeadCell.displayName = "ToolkitTableHeadCell";
3899
- TableContainer.displayName = "ToolkitTableContainer";
3848
+ // src/components/Toast/Toast.tsx
3849
+ import React26 from "react";
3850
+ import CheckIcon from "@mui/icons-material/Check";
3851
+ import CloseIcon from "@mui/icons-material/Close";
3852
+ import InfoIcon2 from "@mui/icons-material/Info";
3853
+ import WarningIcon2 from "@mui/icons-material/Warning";
3900
3854
 
3901
3855
  // src/foundation/H1/H1.tsx
3902
3856
  import React13 from "react";
3903
3857
  import { Typography } from "@mui/material";
3904
- import { jsx as jsx29 } from "react/jsx-runtime";
3858
+ import { jsx as jsx28 } from "react/jsx-runtime";
3905
3859
  var H1 = React13.forwardRef(
3906
3860
  function H12({ color = "text.primary", children, ...props }, ref) {
3907
- return /* @__PURE__ */ jsx29(Typography, { ref, variant: "h1", color, ...props, children });
3861
+ return /* @__PURE__ */ jsx28(Typography, { ref, variant: "h1", color, ...props, children });
3908
3862
  }
3909
3863
  );
3910
3864
  H1.displayName = "ToolkitH1";
@@ -3912,10 +3866,10 @@ H1.displayName = "ToolkitH1";
3912
3866
  // src/foundation/H2/H2.tsx
3913
3867
  import React14 from "react";
3914
3868
  import { Typography as Typography2 } from "@mui/material";
3915
- import { jsx as jsx30 } from "react/jsx-runtime";
3869
+ import { jsx as jsx29 } from "react/jsx-runtime";
3916
3870
  var H2 = React14.forwardRef(
3917
3871
  function H22({ color = "text.primary", children, ...props }, ref) {
3918
- return /* @__PURE__ */ jsx30(Typography2, { ref, variant: "h2", color, ...props, children });
3872
+ return /* @__PURE__ */ jsx29(Typography2, { ref, variant: "h2", color, ...props, children });
3919
3873
  }
3920
3874
  );
3921
3875
  H2.displayName = "ToolkitH2";
@@ -3923,10 +3877,10 @@ H2.displayName = "ToolkitH2";
3923
3877
  // src/foundation/H3/H3.tsx
3924
3878
  import React15 from "react";
3925
3879
  import { Typography as Typography3 } from "@mui/material";
3926
- import { jsx as jsx31 } from "react/jsx-runtime";
3880
+ import { jsx as jsx30 } from "react/jsx-runtime";
3927
3881
  var H3 = React15.forwardRef(
3928
3882
  function H32({ color = "text.primary", children, ...props }, ref) {
3929
- return /* @__PURE__ */ jsx31(Typography3, { ref, variant: "h3", color, ...props, children });
3883
+ return /* @__PURE__ */ jsx30(Typography3, { ref, variant: "h3", color, ...props, children });
3930
3884
  }
3931
3885
  );
3932
3886
  H3.displayName = "ToolkitH3";
@@ -3934,10 +3888,10 @@ H3.displayName = "ToolkitH3";
3934
3888
  // src/foundation/H4/H4.tsx
3935
3889
  import React16 from "react";
3936
3890
  import { Typography as Typography4 } from "@mui/material";
3937
- import { jsx as jsx32 } from "react/jsx-runtime";
3891
+ import { jsx as jsx31 } from "react/jsx-runtime";
3938
3892
  var H4 = React16.forwardRef(
3939
3893
  function H42({ color = "text.primary", children, ...props }, ref) {
3940
- return /* @__PURE__ */ jsx32(Typography4, { ref, variant: "h4", color, ...props, children });
3894
+ return /* @__PURE__ */ jsx31(Typography4, { ref, variant: "h4", color, ...props, children });
3941
3895
  }
3942
3896
  );
3943
3897
  H4.displayName = "ToolkitH4";
@@ -3945,10 +3899,10 @@ H4.displayName = "ToolkitH4";
3945
3899
  // src/foundation/H5/H5.tsx
3946
3900
  import React17 from "react";
3947
3901
  import { Typography as Typography5 } from "@mui/material";
3948
- import { jsx as jsx33 } from "react/jsx-runtime";
3902
+ import { jsx as jsx32 } from "react/jsx-runtime";
3949
3903
  var H5 = React17.forwardRef(
3950
3904
  function H52({ color = "text.primary", children, ...props }, ref) {
3951
- return /* @__PURE__ */ jsx33(Typography5, { ref, variant: "h5", color, ...props, children });
3905
+ return /* @__PURE__ */ jsx32(Typography5, { ref, variant: "h5", color, ...props, children });
3952
3906
  }
3953
3907
  );
3954
3908
  H5.displayName = "ToolkitH5";
@@ -3956,10 +3910,10 @@ H5.displayName = "ToolkitH5";
3956
3910
  // src/foundation/H6/H6.tsx
3957
3911
  import React18 from "react";
3958
3912
  import { Typography as Typography6 } from "@mui/material";
3959
- import { jsx as jsx34 } from "react/jsx-runtime";
3913
+ import { jsx as jsx33 } from "react/jsx-runtime";
3960
3914
  var H6 = React18.forwardRef(
3961
3915
  function H62({ color = "text.primary", children, ...props }, ref) {
3962
- return /* @__PURE__ */ jsx34(Typography6, { ref, variant: "h6", color, ...props, children });
3916
+ return /* @__PURE__ */ jsx33(Typography6, { ref, variant: "h6", color, ...props, children });
3963
3917
  }
3964
3918
  );
3965
3919
  H6.displayName = "ToolkitH6";
@@ -3967,10 +3921,10 @@ H6.displayName = "ToolkitH6";
3967
3921
  // src/foundation/Subtitle1/Subtitle1.tsx
3968
3922
  import React19 from "react";
3969
3923
  import { Typography as Typography7 } from "@mui/material";
3970
- import { jsx as jsx35 } from "react/jsx-runtime";
3924
+ import { jsx as jsx34 } from "react/jsx-runtime";
3971
3925
  var Subtitle1 = React19.forwardRef(
3972
3926
  function Subtitle12({ color = "text.primary", children, ...props }, ref) {
3973
- return /* @__PURE__ */ jsx35(Typography7, { ref, variant: "subtitle1", color, ...props, children });
3927
+ return /* @__PURE__ */ jsx34(Typography7, { ref, variant: "subtitle1", color, ...props, children });
3974
3928
  }
3975
3929
  );
3976
3930
  Subtitle1.displayName = "ToolkitSubtitle1";
@@ -3978,10 +3932,10 @@ Subtitle1.displayName = "ToolkitSubtitle1";
3978
3932
  // src/foundation/Subtitle2/Subtitle2.tsx
3979
3933
  import React20 from "react";
3980
3934
  import { Typography as Typography8 } from "@mui/material";
3981
- import { jsx as jsx36 } from "react/jsx-runtime";
3935
+ import { jsx as jsx35 } from "react/jsx-runtime";
3982
3936
  var Subtitle2 = React20.forwardRef(
3983
3937
  function Subtitle22({ color = "text.primary", children, ...props }, ref) {
3984
- return /* @__PURE__ */ jsx36(Typography8, { ref, variant: "subtitle2", color, ...props, children });
3938
+ return /* @__PURE__ */ jsx35(Typography8, { ref, variant: "subtitle2", color, ...props, children });
3985
3939
  }
3986
3940
  );
3987
3941
  Subtitle2.displayName = "ToolkitSubtitle2";
@@ -3989,10 +3943,10 @@ Subtitle2.displayName = "ToolkitSubtitle2";
3989
3943
  // src/foundation/Body1/Body1.tsx
3990
3944
  import React21 from "react";
3991
3945
  import { Typography as Typography9 } from "@mui/material";
3992
- import { jsx as jsx37 } from "react/jsx-runtime";
3946
+ import { jsx as jsx36 } from "react/jsx-runtime";
3993
3947
  var Body1 = React21.forwardRef(
3994
3948
  function Body12({ color = "text.primary", children, ...props }, ref) {
3995
- return /* @__PURE__ */ jsx37(Typography9, { ref, variant: "body1", color, ...props, children });
3949
+ return /* @__PURE__ */ jsx36(Typography9, { ref, variant: "body1", color, ...props, children });
3996
3950
  }
3997
3951
  );
3998
3952
  Body1.displayName = "ToolkitBody1";
@@ -4000,10 +3954,10 @@ Body1.displayName = "ToolkitBody1";
4000
3954
  // src/foundation/Body2/Body2.tsx
4001
3955
  import React22 from "react";
4002
3956
  import { Typography as Typography10 } from "@mui/material";
4003
- import { jsx as jsx38 } from "react/jsx-runtime";
3957
+ import { jsx as jsx37 } from "react/jsx-runtime";
4004
3958
  var Body2 = React22.forwardRef(
4005
3959
  function Body22({ color = "text.primary", children, ...props }, ref) {
4006
- return /* @__PURE__ */ jsx38(Typography10, { ref, variant: "body2", color, ...props, children });
3960
+ return /* @__PURE__ */ jsx37(Typography10, { ref, variant: "body2", color, ...props, children });
4007
3961
  }
4008
3962
  );
4009
3963
  Body2.displayName = "ToolkitBody2";
@@ -4011,10 +3965,10 @@ Body2.displayName = "ToolkitBody2";
4011
3965
  // src/foundation/Caption/Caption.tsx
4012
3966
  import React23 from "react";
4013
3967
  import { Typography as Typography11 } from "@mui/material";
4014
- import { jsx as jsx39 } from "react/jsx-runtime";
3968
+ import { jsx as jsx38 } from "react/jsx-runtime";
4015
3969
  var Caption = React23.forwardRef(
4016
3970
  function Caption2({ color = "text.primary", children, ...props }, ref) {
4017
- return /* @__PURE__ */ jsx39(Typography11, { ref, variant: "caption", color, ...props, children });
3971
+ return /* @__PURE__ */ jsx38(Typography11, { ref, variant: "caption", color, ...props, children });
4018
3972
  }
4019
3973
  );
4020
3974
  Caption.displayName = "ToolkitCaption";
@@ -4022,10 +3976,10 @@ Caption.displayName = "ToolkitCaption";
4022
3976
  // src/foundation/Overline/Overline.tsx
4023
3977
  import React24 from "react";
4024
3978
  import { Typography as Typography12 } from "@mui/material";
4025
- import { jsx as jsx40 } from "react/jsx-runtime";
3979
+ import { jsx as jsx39 } from "react/jsx-runtime";
4026
3980
  var Overline = React24.forwardRef(
4027
3981
  function Overline2({ color = "text.primary", children, ...props }, ref) {
4028
- return /* @__PURE__ */ jsx40(Typography12, { ref, variant: "overline", color, ...props, children });
3982
+ return /* @__PURE__ */ jsx39(Typography12, { ref, variant: "overline", color, ...props, children });
4029
3983
  }
4030
3984
  );
4031
3985
  Overline.displayName = "ToolkitOverline";
@@ -4033,13 +3987,182 @@ Overline.displayName = "ToolkitOverline";
4033
3987
  // src/foundation/TypographyButton/TypographyButton.tsx
4034
3988
  import React25 from "react";
4035
3989
  import { Typography as Typography13 } from "@mui/material";
4036
- import { jsx as jsx41 } from "react/jsx-runtime";
3990
+ import { jsx as jsx40 } from "react/jsx-runtime";
4037
3991
  var TypographyButton = React25.forwardRef(
4038
3992
  function TypographyButton2({ color = "text.primary", children, ...props }, ref) {
4039
- return /* @__PURE__ */ jsx41(Typography13, { ref, variant: "button", color, ...props, children });
3993
+ return /* @__PURE__ */ jsx40(Typography13, { ref, variant: "button", color, ...props, children });
4040
3994
  }
4041
3995
  );
4042
3996
  TypographyButton.displayName = "ToolkitTypographyButton";
3997
+
3998
+ // src/components/Toast/Toast.styles.tsx
3999
+ import { styled as styled23 } from "@mui/material/styles";
4000
+ import IconButton2 from "@mui/material/IconButton";
4001
+ var StyledToastRoot = styled23("div")(
4002
+ ({ theme, ownerState }) => {
4003
+ const bgMap = {
4004
+ success: theme.tokens.colors.success,
4005
+ warning: theme.tokens.colors.warning,
4006
+ error: theme.tokens.colors.error
4007
+ };
4008
+ const colorMap = {
4009
+ success: theme.palette.common.white,
4010
+ warning: theme.tokens.colors.textPrimary,
4011
+ error: theme.palette.common.white
4012
+ };
4013
+ return {
4014
+ position: "fixed",
4015
+ top: 0,
4016
+ left: 0,
4017
+ width: "100%",
4018
+ zIndex: theme.tokens.zIndex.toast,
4019
+ backgroundColor: bgMap[ownerState.variant],
4020
+ color: colorMap[ownerState.variant],
4021
+ WebkitFontSmoothing: "antialiased",
4022
+ boxSizing: "border-box"
4023
+ };
4024
+ }
4025
+ );
4026
+ var StyledToastInner = styled23("div")(({ theme }) => ({
4027
+ display: "flex",
4028
+ alignItems: "center",
4029
+ padding: `${theme.spacing(2.25)} ${theme.spacing(7)} ${theme.spacing(2.25)} ${theme.spacing(1.25)}`,
4030
+ [theme.breakpoints.up("md")]: {
4031
+ maxWidth: 800,
4032
+ padding: `${theme.spacing(2.25)} ${theme.spacing(13.75)}`,
4033
+ margin: "0 auto",
4034
+ justifyContent: "center"
4035
+ }
4036
+ }));
4037
+ var StyledToastIconWrapper = styled23("span")(({ theme }) => ({
4038
+ display: "flex",
4039
+ alignItems: "flex-start",
4040
+ marginRight: theme.spacing(1.25),
4041
+ flexShrink: 0,
4042
+ "& svg": {
4043
+ height: 28,
4044
+ width: 28
4045
+ }
4046
+ }));
4047
+ var StyledToastCloseButton = styled23(IconButton2)(({ theme, ownerState }) => ({
4048
+ position: "absolute",
4049
+ top: theme.spacing(1.25),
4050
+ right: theme.spacing(1.25),
4051
+ color: ownerState.variant === "warning" ? theme.tokens.colors.textPrimary : theme.palette.common.white,
4052
+ fontFamily: theme.tokens.typography.fontFamilyBase,
4053
+ fontSize: theme.tokens.typography.fontSizeLg,
4054
+ borderRadius: theme.tokens.borderRadius.md,
4055
+ "&:hover": {
4056
+ backgroundColor: "rgba(0,0,0,0.08)"
4057
+ }
4058
+ }));
4059
+
4060
+ // src/components/Toast/Toast.tsx
4061
+ import { jsx as jsx41, jsxs as jsxs15 } from "react/jsx-runtime";
4062
+ var defaultIconMap = {
4063
+ success: /* @__PURE__ */ jsx41(CheckIcon, {}),
4064
+ warning: /* @__PURE__ */ jsx41(InfoIcon2, {}),
4065
+ error: /* @__PURE__ */ jsx41(WarningIcon2, {})
4066
+ };
4067
+ var roleMap = {
4068
+ success: void 0,
4069
+ warning: "alert",
4070
+ error: "alert"
4071
+ };
4072
+ var Toast = React26.forwardRef(
4073
+ ({
4074
+ onClose,
4075
+ variant = "success",
4076
+ isVisible = false,
4077
+ icon,
4078
+ message,
4079
+ className,
4080
+ ...restProps
4081
+ }, ref) => {
4082
+ if (!isVisible) return null;
4083
+ const ownerState = { variant };
4084
+ return /* @__PURE__ */ jsxs15(
4085
+ StyledToastRoot,
4086
+ {
4087
+ ownerState,
4088
+ ref,
4089
+ className,
4090
+ role: roleMap[variant],
4091
+ ...getCleanProps(restProps),
4092
+ children: [
4093
+ /* @__PURE__ */ jsxs15(StyledToastInner, { children: [
4094
+ /* @__PURE__ */ jsx41(StyledToastIconWrapper, { "aria-hidden": "true", children: icon ?? defaultIconMap[variant] }),
4095
+ /* @__PURE__ */ jsx41(Body1, { component: "span", sx: { color: "inherit" }, children: message })
4096
+ ] }),
4097
+ /* @__PURE__ */ jsx41(
4098
+ StyledToastCloseButton,
4099
+ {
4100
+ ownerState,
4101
+ onClick: onClose,
4102
+ "aria-label": "Close notification",
4103
+ size: "small",
4104
+ children: /* @__PURE__ */ jsx41(CloseIcon, { fontSize: "small" })
4105
+ }
4106
+ )
4107
+ ]
4108
+ }
4109
+ );
4110
+ }
4111
+ );
4112
+ Toast.displayName = "ToolkitToast";
4113
+
4114
+ // src/components/Table/Table.tsx
4115
+ import {
4116
+ Table as MuiTable,
4117
+ TableHead as MuiTableHead,
4118
+ TableBody as MuiTableBody,
4119
+ TableRow as MuiTableRow,
4120
+ TableCell as MuiTableCell,
4121
+ TableContainer as MuiTableContainer,
4122
+ TablePagination as MuiTablePagination,
4123
+ TableSortLabel as MuiTableSortLabel
4124
+ } from "@mui/material";
4125
+ import { styled as styled24 } from "@mui/material/styles";
4126
+ import { jsx as jsx42 } from "react/jsx-runtime";
4127
+ var StyledTableContainer = styled24(MuiTableContainer)(() => ({
4128
+ overflowX: "auto"
4129
+ }));
4130
+ var StyledHeadCell = styled24(MuiTableCell)(({ theme }) => ({
4131
+ fontWeight: theme.tokens.components.table.headerFontWeight,
4132
+ backgroundColor: theme.tokens.components.table.headerBackground,
4133
+ borderBottomWidth: theme.tokens.components.table.borderWidth,
4134
+ borderBottomColor: theme.tokens.components.table.borderColor
4135
+ }));
4136
+ function Table(props) {
4137
+ return /* @__PURE__ */ jsx42(MuiTable, { ...props });
4138
+ }
4139
+ function TableHead(props) {
4140
+ return /* @__PURE__ */ jsx42(MuiTableHead, { ...props });
4141
+ }
4142
+ function TableBody(props) {
4143
+ return /* @__PURE__ */ jsx42(MuiTableBody, { ...props });
4144
+ }
4145
+ function TableRow(props) {
4146
+ return /* @__PURE__ */ jsx42(MuiTableRow, { ...props });
4147
+ }
4148
+ function TableCell(props) {
4149
+ return /* @__PURE__ */ jsx42(MuiTableCell, { ...props });
4150
+ }
4151
+ function TableHeadCell(props) {
4152
+ return /* @__PURE__ */ jsx42(StyledHeadCell, { component: "th", scope: "col", ...props });
4153
+ }
4154
+ function TableContainer(props) {
4155
+ return /* @__PURE__ */ jsx42(StyledTableContainer, { ...props });
4156
+ }
4157
+ var TablePagination = MuiTablePagination;
4158
+ var TableSortLabel = MuiTableSortLabel;
4159
+ Table.displayName = "ToolkitTable";
4160
+ TableHead.displayName = "ToolkitTableHead";
4161
+ TableBody.displayName = "ToolkitTableBody";
4162
+ TableRow.displayName = "ToolkitTableRow";
4163
+ TableCell.displayName = "ToolkitTableCell";
4164
+ TableHeadCell.displayName = "ToolkitTableHeadCell";
4165
+ TableContainer.displayName = "ToolkitTableContainer";
4043
4166
  export {
4044
4167
  ABNInput,
4045
4168
  Accordion,
@@ -4114,6 +4237,7 @@ export {
4114
4237
  TextField,
4115
4238
  TimeField,
4116
4239
  TimePicker,
4240
+ Toast,
4117
4241
  Toggle,
4118
4242
  ToggleButton,
4119
4243
  ToggleButtonGroup,