gwan-design-system 0.1.8 → 0.1.10

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.d.mts CHANGED
@@ -115,7 +115,7 @@ interface IFilter {
115
115
  declare const FilterDropdown: FC<IFilter>;
116
116
 
117
117
  interface IInput {
118
- label: string;
118
+ label?: string;
119
119
  value: string;
120
120
  onChange: (value: string) => void;
121
121
  disabled?: boolean;
@@ -123,6 +123,7 @@ interface IInput {
123
123
  inputClassName?: string;
124
124
  required?: boolean;
125
125
  className?: string;
126
+ type?: string;
126
127
  }
127
128
  declare const Input: FC<IInput>;
128
129
 
@@ -147,6 +148,7 @@ interface IMenuItem {
147
148
  route: string;
148
149
  isActive: boolean;
149
150
  isDivider: boolean;
151
+ onClick?: () => void;
150
152
  }
151
153
  interface INavBar {
152
154
  menuItems: IMenuItem[];
@@ -161,6 +163,7 @@ interface INavBar {
161
163
  isCollapsed?: boolean;
162
164
  menuBackgroundColor?: string;
163
165
  className?: string;
166
+ menuItemTextClass?: string;
164
167
  }
165
168
  declare const NavBar: FC<INavBar>;
166
169
 
package/dist/index.d.ts CHANGED
@@ -115,7 +115,7 @@ interface IFilter {
115
115
  declare const FilterDropdown: FC<IFilter>;
116
116
 
117
117
  interface IInput {
118
- label: string;
118
+ label?: string;
119
119
  value: string;
120
120
  onChange: (value: string) => void;
121
121
  disabled?: boolean;
@@ -123,6 +123,7 @@ interface IInput {
123
123
  inputClassName?: string;
124
124
  required?: boolean;
125
125
  className?: string;
126
+ type?: string;
126
127
  }
127
128
  declare const Input: FC<IInput>;
128
129
 
@@ -147,6 +148,7 @@ interface IMenuItem {
147
148
  route: string;
148
149
  isActive: boolean;
149
150
  isDivider: boolean;
151
+ onClick?: () => void;
150
152
  }
151
153
  interface INavBar {
152
154
  menuItems: IMenuItem[];
@@ -161,6 +163,7 @@ interface INavBar {
161
163
  isCollapsed?: boolean;
162
164
  menuBackgroundColor?: string;
163
165
  className?: string;
166
+ menuItemTextClass?: string;
164
167
  }
165
168
  declare const NavBar: FC<INavBar>;
166
169
 
package/dist/index.js CHANGED
@@ -865,7 +865,7 @@ var FilterDropdown = ({ children, className = "" }) => {
865
865
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
866
866
  "div",
867
867
  {
868
- className: "flex flex-row gap-4 items-center w-fit border border-neutral-300 hover:border-neutral-400 group p-2 rounded-lg cursor-pointer",
868
+ className: "flex flex-row gap-4 items-center w-fit border border-neutral-300 hover:border-neutral-400 group p-[14px] rounded-lg cursor-pointer",
869
869
  onClick: () => setIsChildrenVisible(!isChildrenVisible),
870
870
  children: [
871
871
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "size-5 text-neutral-300 group-hover:text-neutral-400", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Filter, {}) }),
@@ -889,10 +889,11 @@ var Input = ({
889
889
  placeholder,
890
890
  inputClassName = "",
891
891
  required = false,
892
- className = ""
892
+ className = "",
893
+ type = "text"
893
894
  }) => {
894
895
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: `flex flex-col gap-1 relative ${className}`, children: [
895
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: label, className: "text-sm text-neutral-600 mb-2", children: `${label}${required ? " *" : ""}` }),
896
+ label && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("label", { htmlFor: label, className: "text-sm text-neutral-600 mb-2", children: `${label}${required ? " *" : ""}` }),
896
897
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
897
898
  "input",
898
899
  {
@@ -902,7 +903,8 @@ var Input = ({
902
903
  onChange: (e) => onChange(e.target.value),
903
904
  disabled,
904
905
  className: `border border-neutral-300 outline-none p-4 rounded-lg ${disabled ? "cursor-not-allowed" : "cursor-text"} text-sm w-full ${inputClassName}`,
905
- required
906
+ required,
907
+ type
906
908
  }
907
909
  )
908
910
  ] });
@@ -973,7 +975,8 @@ var NavBar = ({
973
975
  menuHeightClass = "h-[100vh]",
974
976
  isCollapsed = false,
975
977
  menuBackgroundColor = "bg-primary-100",
976
- className = ""
978
+ className = "",
979
+ menuItemTextClass = ""
977
980
  }) => {
978
981
  const router = (0, import_navigation.useRouter)();
979
982
  const [isActiveMenuItem, setIsActiveMenuItem] = (0, import_react8.useState)("");
@@ -1000,6 +1003,9 @@ var NavBar = ({
1000
1003
  }, [isMenuCollapsed]);
1001
1004
  const handleClick = (menu) => {
1002
1005
  setIsActiveMenuItem(menu.title);
1006
+ if (menu.onClick) {
1007
+ menu.onClick();
1008
+ }
1003
1009
  router.push(menu.route);
1004
1010
  };
1005
1011
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
@@ -1039,13 +1045,13 @@ var NavBar = ({
1039
1045
  "span",
1040
1046
  {
1041
1047
  onClick: () => setIsMenuCollapsed(!isMenuCollapsed),
1042
- className: `cursor-pointer w-8 h-8 rounded-full ${menuBackgroundColor} border border-neutral-300 absolute -right-8 flex items-center justify-center text-black`,
1048
+ className: `cursor-pointer w-8 h-8 rounded-full ${menuBackgroundColor} border border-neutral-50 absolute -right-8 flex items-center justify-center text-black`,
1043
1049
  children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "size-5", children: isMenuCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevRight, {}) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ChevLeft, {}) })
1044
1050
  }
1045
1051
  )
1046
1052
  ] })
1047
1053
  ] }),
1048
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "border-neutral-300 border-b" }),
1054
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "border-neutral-50 border-b" }),
1049
1055
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col gap-1", children: menuItems.map((item, index) => {
1050
1056
  if (!item.isDivider) {
1051
1057
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
@@ -1056,7 +1062,7 @@ var NavBar = ({
1056
1062
  onMouseEnter: () => setShowTooltip(index),
1057
1063
  onMouseLeave: () => setShowTooltip(null),
1058
1064
  children: [
1059
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-6 h-6 ml-1 relative", children: [
1065
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `w-6 h-6 ml-1 relative ${menuItemTextClass}`, children: [
1060
1066
  item.icon,
1061
1067
  isMenuCollapsed && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1062
1068
  tooltip_default,
@@ -1069,7 +1075,7 @@ var NavBar = ({
1069
1075
  }
1070
1076
  )
1071
1077
  ] }),
1072
- !isMenuItemsCollapsed && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-nowrap", children: item.title })
1078
+ !isMenuItemsCollapsed && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: `text-nowrap ${menuItemTextClass}`, children: item.title })
1073
1079
  ]
1074
1080
  },
1075
1081
  `menu_item_${index + 1}`
@@ -1078,7 +1084,7 @@ var NavBar = ({
1078
1084
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1079
1085
  "div",
1080
1086
  {
1081
- className: "border-neutral-300 border-b my-3"
1087
+ className: "border-neutral-50 border-b my-3"
1082
1088
  },
1083
1089
  `menu_item_${index + 1}`
1084
1090
  );