@sikka/hawa 0.11.17-next → 0.11.19-next

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
@@ -466,6 +466,7 @@ type DataTableProps<DataProps = {}> = {
466
466
  direction?: "rtl" | "ltr";
467
467
  columns: ColumnDef<DataProps>[];
468
468
  data: DataProps[];
469
+ itemsPerPage?: any[];
469
470
  showCount?: boolean;
470
471
  condensed?: boolean;
471
472
  isLoading?: boolean;
@@ -1036,8 +1037,7 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
1036
1037
  loginText?: string;
1037
1038
  };
1038
1039
  type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
1039
- fullNameLabel: string;
1040
- fullNamePlaceholder: string;
1040
+ fullName: BaseInputType;
1041
1041
  email?: TextInputType;
1042
1042
  username?: UsernameInputType;
1043
1043
  password?: PasswordInputType;
@@ -1053,6 +1053,23 @@ type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
1053
1053
  registerText: string;
1054
1054
  loginText: string;
1055
1055
  };
1056
+ type ResetPasswordTextsTypes = {
1057
+ email: TextInputType;
1058
+ emailSentText: string;
1059
+ registerText: string;
1060
+ resetPassword: string;
1061
+ dontHaveAccount: string;
1062
+ headTitle?: string;
1063
+ headDescription?: string;
1064
+ };
1065
+ type NewPasswordTextsTypes = {
1066
+ password?: PasswordInputType;
1067
+ confirm?: ConfirmInputType;
1068
+ updatePassword: string;
1069
+ passwordChanged: string;
1070
+ dontHaveAccount?: string;
1071
+ registerText?: string;
1072
+ };
1056
1073
 
1057
1074
  type LoginFormTypes = {
1058
1075
  texts?: LoginFormTextsTypes;
@@ -1224,20 +1241,7 @@ type NewPasswordTypes = {
1224
1241
  headless?: boolean;
1225
1242
  allowRegister?: boolean;
1226
1243
  passwordChanged: any;
1227
- texts: {
1228
- passwordPlaceholder: string;
1229
- passwordRequired: string;
1230
- passwordLabel: string;
1231
- passwordMatchError: string;
1232
- passwordTooShort: string;
1233
- updatePassword: string;
1234
- passwordChanged: string;
1235
- confirmPasswordPlaceholder: string;
1236
- confirmPasswordLabel: string;
1237
- confirmPasswordRequired: string;
1238
- dontHaveAccount?: string;
1239
- registerText?: string;
1240
- };
1244
+ texts: NewPasswordTextsTypes;
1241
1245
  };
1242
1246
  declare const NewPasswordForm: FC<NewPasswordTypes>;
1243
1247
 
@@ -1248,25 +1252,11 @@ type ResetPasswordType = {
1248
1252
  headless?: boolean;
1249
1253
  allowRegister?: boolean;
1250
1254
  direction?: "rtl" | "ltr";
1251
- texts?: {
1252
- emailLabel: string;
1253
- emailPlaceholder: string;
1254
- emailRequired: string;
1255
- emailInvalid: string;
1256
- emailSentText: string;
1257
- registerText: string;
1258
- resetPassword: string;
1259
- dontHaveAccount: string;
1260
- headTitle?: string;
1261
- headDescription?: string;
1262
- };
1255
+ texts?: ResetPasswordTextsTypes;
1263
1256
  };
1264
1257
  declare const ResetPasswordForm: FC<ResetPasswordType>;
1265
1258
 
1266
1259
  type TConfirmation = {
1267
- showError?: any;
1268
- errorTitle?: any;
1269
- errorText?: any;
1270
1260
  texts?: {
1271
1261
  checkYourPhone?: string;
1272
1262
  weSentCode?: string;
@@ -1279,6 +1269,9 @@ type TConfirmation = {
1279
1269
  confirm?: string;
1280
1270
  cancel?: string;
1281
1271
  };
1272
+ showError?: any;
1273
+ errorTitle?: any;
1274
+ errorText?: any;
1282
1275
  phoneNumber?: string;
1283
1276
  handleConfirm?: any;
1284
1277
  };
package/dist/index.d.ts CHANGED
@@ -466,6 +466,7 @@ type DataTableProps<DataProps = {}> = {
466
466
  direction?: "rtl" | "ltr";
467
467
  columns: ColumnDef<DataProps>[];
468
468
  data: DataProps[];
469
+ itemsPerPage?: any[];
469
470
  showCount?: boolean;
470
471
  condensed?: boolean;
471
472
  isLoading?: boolean;
@@ -1036,8 +1037,7 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
1036
1037
  loginText?: string;
1037
1038
  };
1038
1039
  type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
1039
- fullNameLabel: string;
1040
- fullNamePlaceholder: string;
1040
+ fullName: BaseInputType;
1041
1041
  email?: TextInputType;
1042
1042
  username?: UsernameInputType;
1043
1043
  password?: PasswordInputType;
@@ -1053,6 +1053,23 @@ type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
1053
1053
  registerText: string;
1054
1054
  loginText: string;
1055
1055
  };
1056
+ type ResetPasswordTextsTypes = {
1057
+ email: TextInputType;
1058
+ emailSentText: string;
1059
+ registerText: string;
1060
+ resetPassword: string;
1061
+ dontHaveAccount: string;
1062
+ headTitle?: string;
1063
+ headDescription?: string;
1064
+ };
1065
+ type NewPasswordTextsTypes = {
1066
+ password?: PasswordInputType;
1067
+ confirm?: ConfirmInputType;
1068
+ updatePassword: string;
1069
+ passwordChanged: string;
1070
+ dontHaveAccount?: string;
1071
+ registerText?: string;
1072
+ };
1056
1073
 
1057
1074
  type LoginFormTypes = {
1058
1075
  texts?: LoginFormTextsTypes;
@@ -1224,20 +1241,7 @@ type NewPasswordTypes = {
1224
1241
  headless?: boolean;
1225
1242
  allowRegister?: boolean;
1226
1243
  passwordChanged: any;
1227
- texts: {
1228
- passwordPlaceholder: string;
1229
- passwordRequired: string;
1230
- passwordLabel: string;
1231
- passwordMatchError: string;
1232
- passwordTooShort: string;
1233
- updatePassword: string;
1234
- passwordChanged: string;
1235
- confirmPasswordPlaceholder: string;
1236
- confirmPasswordLabel: string;
1237
- confirmPasswordRequired: string;
1238
- dontHaveAccount?: string;
1239
- registerText?: string;
1240
- };
1244
+ texts: NewPasswordTextsTypes;
1241
1245
  };
1242
1246
  declare const NewPasswordForm: FC<NewPasswordTypes>;
1243
1247
 
@@ -1248,25 +1252,11 @@ type ResetPasswordType = {
1248
1252
  headless?: boolean;
1249
1253
  allowRegister?: boolean;
1250
1254
  direction?: "rtl" | "ltr";
1251
- texts?: {
1252
- emailLabel: string;
1253
- emailPlaceholder: string;
1254
- emailRequired: string;
1255
- emailInvalid: string;
1256
- emailSentText: string;
1257
- registerText: string;
1258
- resetPassword: string;
1259
- dontHaveAccount: string;
1260
- headTitle?: string;
1261
- headDescription?: string;
1262
- };
1255
+ texts?: ResetPasswordTextsTypes;
1263
1256
  };
1264
1257
  declare const ResetPasswordForm: FC<ResetPasswordType>;
1265
1258
 
1266
1259
  type TConfirmation = {
1267
- showError?: any;
1268
- errorTitle?: any;
1269
- errorText?: any;
1270
1260
  texts?: {
1271
1261
  checkYourPhone?: string;
1272
1262
  weSentCode?: string;
@@ -1279,6 +1269,9 @@ type TConfirmation = {
1279
1269
  confirm?: string;
1280
1270
  cancel?: string;
1281
1271
  };
1272
+ showError?: any;
1273
+ errorTitle?: any;
1274
+ errorText?: any;
1282
1275
  phoneNumber?: string;
1283
1276
  handleConfirm?: any;
1284
1277
  };
package/dist/index.js CHANGED
@@ -5086,7 +5086,7 @@ var DataTable = function(_param) {
5086
5086
  "columns",
5087
5087
  "data"
5088
5088
  ]);
5089
- var _props_texts, _table_getRowModel_rows, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8, _props_texts9, _props_texts10;
5089
+ var _props_texts, _props_itemsPerPage, _props_texts1, _table_getRowModel_rows, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6;
5090
5090
  var _React38_useState = _sliced_to_array(React38.useState([
5091
5091
  {
5092
5092
  id: props.defaultSort || "",
@@ -5121,12 +5121,19 @@ var DataTable = function(_param) {
5121
5121
  expanded: expanded
5122
5122
  }
5123
5123
  });
5124
+ var pageText = ((_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.page) || "page";
5125
+ var itemsPerPageOptions = (_props_itemsPerPage = props.itemsPerPage) === null || _props_itemsPerPage === void 0 ? void 0 : _props_itemsPerPage.map(function(item) {
5126
+ return {
5127
+ label: "".concat(item, " / ").concat(pageText),
5128
+ value: item
5129
+ };
5130
+ });
5124
5131
  return /* @__PURE__ */ React38.createElement("div", {
5125
5132
  className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4"
5126
5133
  }, /* @__PURE__ */ React38.createElement("div", {
5127
5134
  className: "hawa-flex hawa-items-center"
5128
5135
  }, /* @__PURE__ */ React38.createElement(Input, {
5129
- placeholder: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.searchPlaceholder,
5136
+ placeholder: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.searchPlaceholder,
5130
5137
  value: globalFilter !== null && globalFilter !== void 0 ? globalFilter : "",
5131
5138
  onChange: function(event) {
5132
5139
  return setGlobalFilter(event.target.value);
@@ -5164,38 +5171,38 @@ var DataTable = function(_param) {
5164
5171
  }) : /* @__PURE__ */ React38.createElement(TableRow, null, /* @__PURE__ */ React38.createElement(TableCell, {
5165
5172
  colSpan: columns.length,
5166
5173
  className: "hawa-h-24 hawa-text-center"
5167
- }, (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.noData))))), /* @__PURE__ */ React38.createElement("div", {
5174
+ }, (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.noData))))), /* @__PURE__ */ React38.createElement("div", {
5168
5175
  className: "hawa-flex hawa-items-center hawa-justify-between"
5169
5176
  }, !props.showCount && /* @__PURE__ */ React38.createElement("div", {
5170
5177
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground"
5171
5178
  }), props.showCount && /* @__PURE__ */ React38.createElement("div", {
5172
5179
  className: "text-sm text-muted-foreground",
5173
5180
  dir: props.direction
5174
- }, /* @__PURE__ */ React38.createElement("span", null, (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.total), " ", /* @__PURE__ */ React38.createElement("span", null, table.getFilteredRowModel().rows.length)), table.getPageCount() !== 0 && /* @__PURE__ */ React38.createElement("div", {
5181
+ }, /* @__PURE__ */ React38.createElement("span", null, (_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.total), " ", /* @__PURE__ */ React38.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())), table.getPageCount() !== 0 && /* @__PURE__ */ React38.createElement("div", {
5175
5182
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 "
5176
5183
  }, /* @__PURE__ */ React38.createElement(DropdownMenu, {
5177
5184
  size: "sm",
5178
- width: "parent",
5185
+ width: "sm",
5179
5186
  direction: props.direction,
5180
- items: [
5187
+ items: itemsPerPageOptions || [
5181
5188
  {
5182
- label: "10 / ".concat((_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.page),
5189
+ label: "10 / ".concat(pageText),
5183
5190
  value: 10
5184
5191
  },
5185
5192
  {
5186
- label: "20 / ".concat((_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.page),
5193
+ label: "20 / ".concat(pageText),
5187
5194
  value: 20
5188
5195
  },
5189
5196
  {
5190
- label: "30 / ".concat((_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.page),
5197
+ label: "30 / ".concat(pageText),
5191
5198
  value: 30
5192
5199
  },
5193
5200
  {
5194
- label: "40 / ".concat((_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.page),
5201
+ label: "40 / ".concat(pageText),
5195
5202
  value: 40
5196
5203
  },
5197
5204
  {
5198
- label: "50 / ".concat((_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.page),
5205
+ label: "50 / ".concat(pageText),
5199
5206
  value: 50
5200
5207
  }
5201
5208
  ],
@@ -5203,7 +5210,7 @@ var DataTable = function(_param) {
5203
5210
  variant: "outline",
5204
5211
  size: "icon",
5205
5212
  className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 "
5206
- }, "".concat(table.getState().pagination.pageSize, " / ").concat((_props_texts8 = props.texts) === null || _props_texts8 === void 0 ? void 0 : _props_texts8.page)),
5213
+ }, "".concat(table.getState().pagination.pageSize, " / ").concat((_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.page)),
5207
5214
  onItemSelect: function(e) {
5208
5215
  return table.setPageSize(Number(e));
5209
5216
  }
@@ -5211,13 +5218,14 @@ var DataTable = function(_param) {
5211
5218
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm "
5212
5219
  }, /* @__PURE__ */ React38.createElement("span", {
5213
5220
  className: "hawa-flex hawa-items-center hawa-gap-1"
5214
- }, /* @__PURE__ */ React38.createElement("div", null, (_props_texts9 = props.texts) === null || _props_texts9 === void 0 ? void 0 : _props_texts9.page), /* @__PURE__ */ React38.createElement("div", {
5221
+ }, /* @__PURE__ */ React38.createElement("div", null, (_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.page), /* @__PURE__ */ React38.createElement("div", {
5215
5222
  className: "hawa-flex hawa-flex-row hawa-gap-1"
5216
5223
  }, /* @__PURE__ */ React38.createElement("span", {
5217
5224
  className: "hawa-font-bold"
5218
- }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React38.createElement("span", null, (_props_texts10 = props.texts) === null || _props_texts10 === void 0 ? void 0 : _props_texts10.of), /* @__PURE__ */ React38.createElement("span", {
5225
+ }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React38.createElement("span", null, (_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.of), /* @__PURE__ */ React38.createElement("span", {
5219
5226
  className: "hawa-font-bold"
5220
5227
  }, table.getPageCount())))), /* @__PURE__ */ React38.createElement(Button, {
5228
+ "aria-label": "Previous Table Page",
5221
5229
  variant: "outline",
5222
5230
  size: "smallIcon",
5223
5231
  onClick: function() {
@@ -5237,6 +5245,7 @@ var DataTable = function(_param) {
5237
5245
  fillRule: "evenodd",
5238
5246
  d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
5239
5247
  }))), /* @__PURE__ */ React38.createElement(Button, {
5248
+ "aria-label": "Next Table Page",
5240
5249
  variant: "outline",
5241
5250
  size: "smallIcon",
5242
5251
  onClick: function() {
@@ -5246,12 +5255,12 @@ var DataTable = function(_param) {
5246
5255
  className: cn(props.direction === "rtl" && "hawa-rotate-180")
5247
5256
  }, /* @__PURE__ */ React38.createElement("svg", {
5248
5257
  "aria-label": "Chevron Right Icon",
5249
- stroke: "currentColor",
5250
5258
  fill: "currentColor",
5251
- strokeWidth: "0",
5252
- viewBox: "0 0 16 16",
5259
+ stroke: "currentColor",
5260
+ width: "1em",
5253
5261
  height: "1em",
5254
- width: "1em"
5262
+ strokeWidth: "0",
5263
+ viewBox: "0 0 16 16"
5255
5264
  }, /* @__PURE__ */ React38.createElement("path", {
5256
5265
  fillRule: "evenodd",
5257
5266
  d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"
@@ -7385,11 +7394,11 @@ var RegisterForm = function(_param) {
7385
7394
  name: "fullName",
7386
7395
  render: function(param) {
7387
7396
  var field = param.field;
7388
- var _formState_errors_fullName;
7397
+ var _texts_fullName, _texts_fullName1, _formState_errors_fullName;
7389
7398
  return /* @__PURE__ */ import_react39.default.createElement(Input, _object_spread({
7390
7399
  width: "full",
7391
- label: texts === null || texts === void 0 ? void 0 : texts.fullNameLabel,
7392
- placeholder: texts === null || texts === void 0 ? void 0 : texts.fullNamePlaceholder,
7400
+ label: texts === null || texts === void 0 ? void 0 : (_texts_fullName = texts.fullName) === null || _texts_fullName === void 0 ? void 0 : _texts_fullName.label,
7401
+ placeholder: texts === null || texts === void 0 ? void 0 : (_texts_fullName1 = texts.fullName) === null || _texts_fullName1 === void 0 ? void 0 : _texts_fullName1.placeholder,
7393
7402
  helperText: (_formState_errors_fullName = formState.errors.fullName) === null || _formState_errors_fullName === void 0 ? void 0 : _formState_errors_fullName.message
7394
7403
  }, field));
7395
7404
  }
@@ -7691,25 +7700,26 @@ var NewPasswordForm = function(_param) {
7691
7700
  var texts = _param.texts, props = _object_without_properties(_param, [
7692
7701
  "texts"
7693
7702
  ]);
7703
+ var _texts_password, _texts_password1, _texts_password2, _texts_confirm, _texts_password3, _texts_confirm1, _texts_confirm2;
7694
7704
  var formSchema = z3.object({
7695
7705
  password: z3.string({
7696
- required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
7706
+ required_error: texts === null || texts === void 0 ? void 0 : (_texts_password = texts.password) === null || _texts_password === void 0 ? void 0 : _texts_password.required
7697
7707
  }).min(1, {
7698
- message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
7708
+ message: texts === null || texts === void 0 ? void 0 : (_texts_password1 = texts.password) === null || _texts_password1 === void 0 ? void 0 : _texts_password1.required
7699
7709
  }).min(8, {
7700
- message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
7710
+ message: texts === null || texts === void 0 ? void 0 : (_texts_password2 = texts.password) === null || _texts_password2 === void 0 ? void 0 : _texts_password2.tooShort
7701
7711
  }),
7702
7712
  confirm_password: z3.string({
7703
- required_error: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordRequired
7713
+ required_error: texts === null || texts === void 0 ? void 0 : (_texts_confirm = texts.confirm) === null || _texts_confirm === void 0 ? void 0 : _texts_confirm.required
7704
7714
  }).refine(function(value) {
7705
7715
  return value !== "";
7706
7716
  }, {
7707
- message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
7717
+ message: texts === null || texts === void 0 ? void 0 : (_texts_password3 = texts.password) === null || _texts_password3 === void 0 ? void 0 : _texts_password3.required
7708
7718
  })
7709
7719
  }).refine(function(data) {
7710
7720
  return data.password === data.confirm_password;
7711
7721
  }, {
7712
- message: "Passwords don't match",
7722
+ message: texts === null || texts === void 0 ? void 0 : (_texts_confirm1 = texts.confirm) === null || _texts_confirm1 === void 0 ? void 0 : _texts_confirm1.dontMatch,
7713
7723
  path: [
7714
7724
  "confirm_password"
7715
7725
  ]
@@ -7722,7 +7732,7 @@ var NewPasswordForm = function(_param) {
7722
7732
  return /* @__PURE__ */ import_react42.default.createElement(Card, {
7723
7733
  dir: props.direction
7724
7734
  }, matchError && /* @__PURE__ */ import_react42.default.createElement(Alert, {
7725
- text: texts === null || texts === void 0 ? void 0 : texts.passwordMatchError,
7735
+ text: texts === null || texts === void 0 ? void 0 : (_texts_confirm2 = texts.confirm) === null || _texts_confirm2 === void 0 ? void 0 : _texts_confirm2.dontMatch,
7726
7736
  severity: "error"
7727
7737
  }), props.passwordChanged ? /* @__PURE__ */ import_react42.default.createElement(CardContent, {
7728
7738
  headless: true
@@ -7745,13 +7755,13 @@ var NewPasswordForm = function(_param) {
7745
7755
  name: "password",
7746
7756
  render: function(param) {
7747
7757
  var field = param.field;
7748
- var _formState_errors_password;
7758
+ var _texts_password, _texts_password1, _formState_errors_password;
7749
7759
  return /* @__PURE__ */ import_react42.default.createElement(Input, _object_spread({
7750
7760
  width: "full",
7751
7761
  type: "password",
7752
7762
  autoComplete: "new-password",
7753
- label: texts === null || texts === void 0 ? void 0 : texts.passwordLabel,
7754
- placeholder: texts === null || texts === void 0 ? void 0 : texts.passwordPlaceholder,
7763
+ label: texts === null || texts === void 0 ? void 0 : (_texts_password = texts.password) === null || _texts_password === void 0 ? void 0 : _texts_password.label,
7764
+ placeholder: texts === null || texts === void 0 ? void 0 : (_texts_password1 = texts.password) === null || _texts_password1 === void 0 ? void 0 : _texts_password1.placeholder,
7755
7765
  helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
7756
7766
  }, field));
7757
7767
  }
@@ -7760,13 +7770,13 @@ var NewPasswordForm = function(_param) {
7760
7770
  name: "confirm_password",
7761
7771
  render: function(param) {
7762
7772
  var field = param.field;
7763
- var _formState_errors_confirm_password;
7773
+ var _texts_confirm, _texts_confirm1, _formState_errors_confirm_password;
7764
7774
  return /* @__PURE__ */ import_react42.default.createElement(Input, _object_spread({
7765
7775
  width: "full",
7766
7776
  type: "password",
7767
7777
  autoComplete: "new-password",
7768
- label: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordLabel,
7769
- placeholder: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordPlaceholder,
7778
+ label: texts === null || texts === void 0 ? void 0 : (_texts_confirm = texts.confirm) === null || _texts_confirm === void 0 ? void 0 : _texts_confirm.label,
7779
+ placeholder: texts === null || texts === void 0 ? void 0 : (_texts_confirm1 = texts.confirm) === null || _texts_confirm1 === void 0 ? void 0 : _texts_confirm1.placeholder,
7770
7780
  helperText: (_formState_errors_confirm_password = formState.errors.confirm_password) === null || _formState_errors_confirm_password === void 0 ? void 0 : _formState_errors_confirm_password.message
7771
7781
  }, field));
7772
7782
  }
@@ -7788,14 +7798,14 @@ var import_react_hook_form4 = require("react-hook-form");
7788
7798
  var import_zod4 = require("@hookform/resolvers/zod");
7789
7799
  var z4 = __toESM(require("zod"));
7790
7800
  var ResetPasswordForm = function(props) {
7791
- var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8;
7801
+ var _props_texts_email, _props_texts, _props_texts_email1, _props_texts1, _props_texts_email2, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8;
7792
7802
  var formSchema = z4.object({
7793
7803
  email: z4.string({
7794
- required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.emailRequired
7804
+ required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : (_props_texts_email = _props_texts.email) === null || _props_texts_email === void 0 ? void 0 : _props_texts_email.required
7795
7805
  }).email({
7796
- message: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.emailInvalid
7806
+ message: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : (_props_texts_email1 = _props_texts1.email) === null || _props_texts_email1 === void 0 ? void 0 : _props_texts_email1.invalid
7797
7807
  }).min(1, {
7798
- message: (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.emailRequired
7808
+ message: (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : (_props_texts_email2 = _props_texts2.email) === null || _props_texts_email2 === void 0 ? void 0 : _props_texts_email2.required
7799
7809
  })
7800
7810
  });
7801
7811
  var _ref = (0, import_react_hook_form4.useForm)({
@@ -7820,12 +7830,12 @@ var ResetPasswordForm = function(props) {
7820
7830
  name: "email",
7821
7831
  render: function(param) {
7822
7832
  var field = param.field;
7823
- var _props_texts, _formState_errors_email, _props_texts1;
7833
+ var _props_texts_email, _props_texts, _formState_errors_email, _props_texts_email1, _props_texts1;
7824
7834
  return /* @__PURE__ */ import_react43.default.createElement(Input, _object_spread({
7825
7835
  width: "full",
7826
- label: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.emailLabel,
7836
+ label: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : (_props_texts_email = _props_texts.email) === null || _props_texts_email === void 0 ? void 0 : _props_texts_email.label,
7827
7837
  helperText: (_formState_errors_email = formState.errors.email) === null || _formState_errors_email === void 0 ? void 0 : _formState_errors_email.message,
7828
- placeholder: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.emailPlaceholder
7838
+ placeholder: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : (_props_texts_email1 = _props_texts1.email) === null || _props_texts_email1 === void 0 ? void 0 : _props_texts_email1.placeholder
7829
7839
  }, field));
7830
7840
  }
7831
7841
  })), /* @__PURE__ */ import_react43.default.createElement(CardFooter, {
package/dist/index.mjs CHANGED
@@ -4748,10 +4748,7 @@ var DataTable = ({
4748
4748
  ...props
4749
4749
  }) => {
4750
4750
  const [sorting, setSorting] = React38.useState([
4751
- {
4752
- id: props.defaultSort || "",
4753
- desc: false
4754
- }
4751
+ { id: props.defaultSort || "", desc: false }
4755
4752
  ]);
4756
4753
  const [columnFilters, setColumnFilters] = React38.useState(
4757
4754
  []
@@ -4783,6 +4780,11 @@ var DataTable = ({
4783
4780
  expanded
4784
4781
  }
4785
4782
  });
4783
+ const pageText = props.texts?.page || "page";
4784
+ const itemsPerPageOptions = props.itemsPerPage?.map((item) => ({
4785
+ label: `${item} / ${pageText}`,
4786
+ value: item
4787
+ }));
4786
4788
  return /* @__PURE__ */ React38.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React38.createElement("div", { className: "hawa-flex hawa-items-center" }, /* @__PURE__ */ React38.createElement(
4787
4789
  Input,
4788
4790
  {
@@ -4840,19 +4842,19 @@ var DataTable = ({
4840
4842
  },
4841
4843
  /* @__PURE__ */ React38.createElement("span", null, props.texts?.total),
4842
4844
  " ",
4843
- /* @__PURE__ */ React38.createElement("span", null, table.getFilteredRowModel().rows.length)
4845
+ /* @__PURE__ */ React38.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
4844
4846
  ), table.getPageCount() !== 0 && /* @__PURE__ */ React38.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, /* @__PURE__ */ React38.createElement(
4845
4847
  DropdownMenu,
4846
4848
  {
4847
4849
  size: "sm",
4848
- width: "parent",
4850
+ width: "sm",
4849
4851
  direction: props.direction,
4850
- items: [
4851
- { label: `10 / ${props.texts?.page}`, value: 10 },
4852
- { label: `20 / ${props.texts?.page}`, value: 20 },
4853
- { label: `30 / ${props.texts?.page}`, value: 30 },
4854
- { label: `40 / ${props.texts?.page}`, value: 40 },
4855
- { label: `50 / ${props.texts?.page}`, value: 50 }
4852
+ items: itemsPerPageOptions || [
4853
+ { label: `10 / ${pageText}`, value: 10 },
4854
+ { label: `20 / ${pageText}`, value: 20 },
4855
+ { label: `30 / ${pageText}`, value: 30 },
4856
+ { label: `40 / ${pageText}`, value: 40 },
4857
+ { label: `50 / ${pageText}`, value: 50 }
4856
4858
  ],
4857
4859
  trigger: /* @__PURE__ */ React38.createElement(
4858
4860
  Button,
@@ -4868,6 +4870,7 @@ var DataTable = ({
4868
4870
  ), /* @__PURE__ */ React38.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm " }, /* @__PURE__ */ React38.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React38.createElement("div", null, props.texts?.page), /* @__PURE__ */ React38.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React38.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React38.createElement("span", null, props.texts?.of), /* @__PURE__ */ React38.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React38.createElement(
4869
4871
  Button,
4870
4872
  {
4873
+ "aria-label": "Previous Table Page",
4871
4874
  variant: "outline",
4872
4875
  size: "smallIcon",
4873
4876
  onClick: () => table.previousPage(),
@@ -4896,6 +4899,7 @@ var DataTable = ({
4896
4899
  ), /* @__PURE__ */ React38.createElement(
4897
4900
  Button,
4898
4901
  {
4902
+ "aria-label": "Next Table Page",
4899
4903
  variant: "outline",
4900
4904
  size: "smallIcon",
4901
4905
  onClick: () => table.nextPage(),
@@ -4906,12 +4910,12 @@ var DataTable = ({
4906
4910
  "svg",
4907
4911
  {
4908
4912
  "aria-label": "Chevron Right Icon",
4909
- stroke: "currentColor",
4910
4913
  fill: "currentColor",
4911
- strokeWidth: "0",
4912
- viewBox: "0 0 16 16",
4914
+ stroke: "currentColor",
4915
+ width: "1em",
4913
4916
  height: "1em",
4914
- width: "1em"
4917
+ strokeWidth: "0",
4918
+ viewBox: "0 0 16 16"
4915
4919
  },
4916
4920
  /* @__PURE__ */ React38.createElement(
4917
4921
  "path",
@@ -7313,8 +7317,8 @@ var RegisterForm = ({ texts, ...props }) => {
7313
7317
  Input,
7314
7318
  {
7315
7319
  width: "full",
7316
- label: texts?.fullNameLabel,
7317
- placeholder: texts?.fullNamePlaceholder,
7320
+ label: texts?.fullName?.label,
7321
+ placeholder: texts?.fullName?.placeholder,
7318
7322
  helperText: formState.errors.fullName?.message,
7319
7323
  ...field
7320
7324
  }
@@ -7649,19 +7653,19 @@ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
7649
7653
  import * as z3 from "zod";
7650
7654
  var NewPasswordForm = ({ texts, ...props }) => {
7651
7655
  const formSchema = z3.object({
7652
- password: z3.string({ required_error: texts?.passwordRequired }).min(1, { message: texts?.passwordRequired }).min(8, { message: texts?.passwordTooShort }),
7653
- confirm_password: z3.string({ required_error: texts?.confirmPasswordRequired }).refine((value) => value !== "", {
7654
- message: texts?.passwordRequired
7656
+ password: z3.string({ required_error: texts?.password?.required }).min(1, { message: texts?.password?.required }).min(8, { message: texts?.password?.tooShort }),
7657
+ confirm_password: z3.string({ required_error: texts?.confirm?.required }).refine((value) => value !== "", {
7658
+ message: texts?.password?.required
7655
7659
  })
7656
7660
  }).refine((data) => data.password === data.confirm_password, {
7657
- message: "Passwords don't match",
7661
+ message: texts?.confirm?.dontMatch,
7658
7662
  path: ["confirm_password"]
7659
7663
  });
7660
7664
  const { handleSubmit, control, formState } = useForm3({
7661
7665
  resolver: zodResolver3(formSchema)
7662
7666
  });
7663
7667
  const [matchError, setMatchError] = useState24(false);
7664
- return /* @__PURE__ */ React66.createElement(Card, { dir: props.direction }, matchError && /* @__PURE__ */ React66.createElement(Alert, { text: texts?.passwordMatchError, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React66.createElement(CardContent, { headless: true }, /* @__PURE__ */ React66.createElement("div", { className: "hawa-text-center" }, texts?.passwordChanged)) : /* @__PURE__ */ React66.createElement(
7668
+ return /* @__PURE__ */ React66.createElement(Card, { dir: props.direction }, matchError && /* @__PURE__ */ React66.createElement(Alert, { text: texts?.confirm?.dontMatch, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React66.createElement(CardContent, { headless: true }, /* @__PURE__ */ React66.createElement("div", { className: "hawa-text-center" }, texts?.passwordChanged)) : /* @__PURE__ */ React66.createElement(
7665
7669
  "form",
7666
7670
  {
7667
7671
  noValidate: true,
@@ -7693,8 +7697,8 @@ var NewPasswordForm = ({ texts, ...props }) => {
7693
7697
  width: "full",
7694
7698
  type: "password",
7695
7699
  autoComplete: "new-password",
7696
- label: texts?.passwordLabel,
7697
- placeholder: texts?.passwordPlaceholder,
7700
+ label: texts?.password?.label,
7701
+ placeholder: texts?.password?.placeholder,
7698
7702
  helperText: formState.errors.password?.message,
7699
7703
  ...field
7700
7704
  }
@@ -7712,8 +7716,8 @@ var NewPasswordForm = ({ texts, ...props }) => {
7712
7716
  width: "full",
7713
7717
  type: "password",
7714
7718
  autoComplete: "new-password",
7715
- label: texts?.confirmPasswordLabel,
7716
- placeholder: texts?.confirmPasswordPlaceholder,
7719
+ label: texts?.confirm?.label,
7720
+ placeholder: texts?.confirm?.placeholder,
7717
7721
  helperText: formState.errors.confirm_password?.message,
7718
7722
  ...field
7719
7723
  }
@@ -7739,7 +7743,7 @@ import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
7739
7743
  import * as z4 from "zod";
7740
7744
  var ResetPasswordForm = (props) => {
7741
7745
  const formSchema = z4.object({
7742
- email: z4.string({ required_error: props.texts?.emailRequired }).email({ message: props.texts?.emailInvalid }).min(1, { message: props.texts?.emailRequired })
7746
+ email: z4.string({ required_error: props.texts?.email?.required }).email({ message: props.texts?.email?.invalid }).min(1, { message: props.texts?.email?.required })
7743
7747
  });
7744
7748
  const { handleSubmit, control, formState } = useForm4({
7745
7749
  resolver: zodResolver4(formSchema)
@@ -7765,9 +7769,9 @@ var ResetPasswordForm = (props) => {
7765
7769
  Input,
7766
7770
  {
7767
7771
  width: "full",
7768
- label: props.texts?.emailLabel,
7772
+ label: props.texts?.email?.label,
7769
7773
  helperText: formState.errors.email?.message,
7770
- placeholder: props.texts?.emailPlaceholder,
7774
+ placeholder: props.texts?.email?.placeholder,
7771
7775
  ...field
7772
7776
  }
7773
7777
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.11.17-next",
3
+ "version": "0.11.19-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {