@sikka/hawa 0.40.1-next → 0.41.0-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.
Files changed (58) hide show
  1. package/dist/blocks/auth/index.js +87 -2
  2. package/dist/blocks/auth/index.mjs +91 -6
  3. package/dist/blocks/feedback/index.js +1 -2
  4. package/dist/blocks/feedback/index.mjs +6 -8
  5. package/dist/blocks/index.js +88 -4
  6. package/dist/blocks/index.mjs +3 -5
  7. package/dist/blocks/misc/index.mjs +5 -5
  8. package/dist/blocks/pricing/index.mjs +4 -4
  9. package/dist/checkbox/index.js +2 -2
  10. package/dist/checkbox/index.js.map +1 -1
  11. package/dist/checkbox/index.mjs +2 -2
  12. package/dist/checkbox/index.mjs.map +1 -1
  13. package/dist/{chunk-AJTYKC5R.mjs → chunk-4ZELUQQ7.mjs} +1 -1
  14. package/dist/{chunk-GN7EIDTE.mjs → chunk-55TPME67.mjs} +1 -1
  15. package/dist/{chunk-CTZRVSTI.mjs → chunk-F6SLF6DS.mjs} +1 -1
  16. package/dist/{chunk-QSEQS7DS.mjs → chunk-FJXDCBMQ.mjs} +3 -3
  17. package/dist/{chunk-CTNKKP2O.mjs → chunk-FK2C6C3B.mjs} +61 -61
  18. package/dist/{chunk-27G5FKOP.mjs → chunk-IS73LH5Y.mjs} +1 -1
  19. package/dist/{chunk-GU2DOJ7Q.mjs → chunk-JGP3PSJL.mjs} +85 -0
  20. package/dist/{chunk-QZIENYTE.mjs → chunk-NSMJTT6Y.mjs} +1 -1
  21. package/dist/{chunk-RT2Q3SH7.mjs → chunk-UHUOBAEP.mjs} +1 -1
  22. package/dist/{chunk-DYPGZ2IP.mjs → chunk-ZSX2KZ2D.mjs} +1 -1
  23. package/dist/dataTable/index.d.mts +6 -1
  24. package/dist/dataTable/index.d.ts +6 -1
  25. package/dist/dataTable/index.js +454 -240
  26. package/dist/dataTable/index.js.map +1 -1
  27. package/dist/dataTable/index.mjs +472 -258
  28. package/dist/dataTable/index.mjs.map +1 -1
  29. package/dist/docsLayout/index.js +85 -0
  30. package/dist/docsLayout/index.js.map +1 -1
  31. package/dist/docsLayout/index.mjs +85 -0
  32. package/dist/docsLayout/index.mjs.map +1 -1
  33. package/dist/elements/index.d.mts +11 -1
  34. package/dist/elements/index.d.ts +11 -1
  35. package/dist/elements/index.js +603 -440
  36. package/dist/elements/index.mjs +252 -174
  37. package/dist/index.css +27 -127
  38. package/dist/index.d.mts +11 -1
  39. package/dist/index.d.ts +11 -1
  40. package/dist/index.js +606 -444
  41. package/dist/index.mjs +700 -538
  42. package/dist/layout/index.js +85 -0
  43. package/dist/layout/index.mjs +2 -2
  44. package/dist/logos/index.d.mts +5 -0
  45. package/dist/logos/index.d.ts +5 -0
  46. package/dist/logos/index.js +85 -0
  47. package/dist/logos/index.js.map +1 -1
  48. package/dist/logos/index.mjs +85 -0
  49. package/dist/logos/index.mjs.map +1 -1
  50. package/dist/simpleTable/index.js +4 -4
  51. package/dist/simpleTable/index.js.map +1 -1
  52. package/dist/simpleTable/index.mjs +4 -4
  53. package/dist/simpleTable/index.mjs.map +1 -1
  54. package/dist/table/index.js +4 -4
  55. package/dist/table/index.js.map +1 -1
  56. package/dist/table/index.mjs +4 -4
  57. package/dist/table/index.mjs.map +1 -1
  58. package/package.json +1 -1
@@ -26,7 +26,7 @@ import {
26
26
  TabsList,
27
27
  TabsTrigger,
28
28
  Textarea
29
- } from "../chunk-QSEQS7DS.mjs";
29
+ } from "../chunk-FJXDCBMQ.mjs";
30
30
  import {
31
31
  useClipboard
32
32
  } from "../chunk-XCW5YNMS.mjs";
@@ -41,7 +41,7 @@ import {
41
41
  SheetPortal,
42
42
  SheetTitle,
43
43
  SheetTrigger
44
- } from "../chunk-27G5FKOP.mjs";
44
+ } from "../chunk-IS73LH5Y.mjs";
45
45
  import {
46
46
  Button,
47
47
  Card,
@@ -81,7 +81,7 @@ import {
81
81
  buttonVariants,
82
82
  calculateLuminance,
83
83
  cn
84
- } from "../chunk-GU2DOJ7Q.mjs";
84
+ } from "../chunk-JGP3PSJL.mjs";
85
85
  import {
86
86
  __require
87
87
  } from "../chunk-SYGWSBJL.mjs";
@@ -823,7 +823,7 @@ import {
823
823
 
824
824
  // elements/table/Table.tsx
825
825
  import * as React9 from "react";
826
- var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React9.createElement(
826
+ var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React9.createElement("div", { className: "hawa-relative hawa-w-full hawa-overflow-auto hawa-rounded hawa-border" }, /* @__PURE__ */ React9.createElement(
827
827
  "table",
828
828
  {
829
829
  ref,
@@ -845,12 +845,12 @@ var TableHead = React9.forwardRef(
845
845
  {
846
846
  ref,
847
847
  className: cn(
848
- "hawa-bg-muted/60 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground dark:hawa-bg-muted/40 [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
848
+ "hawa-bg-muted/60 hawa-text-nowrap hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground dark:hawa-bg-muted/40 [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
849
849
  dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
850
850
  condensed ? "hawa-h-8" : "hawa-h-12",
851
851
  clickable ? "hawa-px-1" : "hawa-px-4",
852
852
  //First and last columns
853
- clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
853
+ clickable ? "[&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
854
854
  //Columns in between
855
855
  className
856
856
  ),
@@ -900,7 +900,7 @@ var TableCell = React9.forwardRef(
900
900
  // enablePadding ? "hawa-p-4" : "hawa-p-0",
901
901
  // props.disablePadding ? "hawa-p-0" : "hawa-p-4",
902
902
  // props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4",
903
- "hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ",
903
+ "hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0",
904
904
  "[&:not(:last-child)&:not(:first-child)]:hawa-border-x",
905
905
  // "[&:not(:last-child)]:hawa-border-r",
906
906
  props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
@@ -939,11 +939,12 @@ var DataTable = ({
939
939
  paginationPosition = "bottom",
940
940
  translateFn,
941
941
  enableHideColumns,
942
+ enableSelection,
942
943
  enableSearch,
943
944
  enableGoTo,
944
945
  ...props
945
946
  }) => {
946
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
947
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
947
948
  const [sorting, setSorting] = React10.useState(
948
949
  props.defaultSort ? [{ id: props.defaultSort, desc: false }] : []
949
950
  );
@@ -957,9 +958,42 @@ var DataTable = ({
957
958
  return savedVisibility ? JSON.parse(savedVisibility) : {};
958
959
  });
959
960
  const [rowSelection, setRowSelection] = React10.useState({});
961
+ let mainColumns = enableSelection ? [
962
+ {
963
+ id: "select",
964
+ maxSize: 16,
965
+ minSize: 16,
966
+ size: 16,
967
+ header: ({ table: table2 }) => /* @__PURE__ */ React10.createElement(
968
+ Checkbox,
969
+ {
970
+ dir: props.direction,
971
+ id: "select_all",
972
+ "aria-label": "Select all",
973
+ className: props.direction === "rtl" ? "hawa-ms-4" : "hawa-me-0",
974
+ checked: table2.getIsAllPageRowsSelected() || table2.getIsSomePageRowsSelected() && "indeterminate",
975
+ onCheckedChange: (value) => table2.toggleAllPageRowsSelected(!!value)
976
+ }
977
+ ),
978
+ cell: ({ row }) => /* @__PURE__ */ React10.createElement(
979
+ Checkbox,
980
+ {
981
+ dir: props.direction,
982
+ id: "select_row",
983
+ className: props.direction === "rtl" ? "hawa-ms-4" : "hawa-me-4",
984
+ checked: row.getIsSelected(),
985
+ onCheckedChange: (value) => row.toggleSelected(!!value),
986
+ "aria-label": "Select row"
987
+ }
988
+ ),
989
+ enableSorting: false,
990
+ enableHiding: false
991
+ },
992
+ ...columns
993
+ ] : columns;
960
994
  const table = useReactTable({
961
995
  data,
962
- columns,
996
+ columns: mainColumns,
963
997
  onExpandedChange: setExpanded,
964
998
  getExpandedRowModel: getExpandedRowModel(),
965
999
  onGlobalFilterChange: setGlobalFilter,
@@ -1051,19 +1085,21 @@ var DataTable = ({
1051
1085
  /* @__PURE__ */ React10.createElement(
1052
1086
  "svg",
1053
1087
  {
1054
- "aria-label": "Chevron Down Icon",
1055
- xmlns: "http://www.w3.org/2000/svg",
1056
- width: "24",
1057
- height: "24",
1058
- viewBox: "0 0 24 24",
1088
+ width: "15",
1089
+ height: "15",
1090
+ viewBox: "0 0 15 15",
1059
1091
  fill: "none",
1060
- stroke: "currentColor",
1061
- strokeWidth: "2",
1062
- strokeLinecap: "round",
1063
- strokeLinejoin: "round",
1064
- className: "hawa-icon hawa-rotate-90"
1092
+ xmlns: "http://www.w3.org/2000/svg"
1065
1093
  },
1066
- /* @__PURE__ */ React10.createElement("path", { d: "m9 18 6-6-6-6" })
1094
+ /* @__PURE__ */ React10.createElement(
1095
+ "path",
1096
+ {
1097
+ d: "M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",
1098
+ fill: "currentColor",
1099
+ "fill-rule": "evenodd",
1100
+ "clip-rule": "evenodd"
1101
+ }
1102
+ )
1067
1103
  )
1068
1104
  )), /* @__PURE__ */ React10.createElement(
1069
1105
  DropdownMenuContent,
@@ -1088,7 +1124,7 @@ var DataTable = ({
1088
1124
  "div",
1089
1125
  {
1090
1126
  className: cn(
1091
- "hawa-flex hawa-w-full hawa-gap-4",
1127
+ "hawa-flex hawa-w-full hawa-gap-4",
1092
1128
  paginationPosition === "top" ? "hawa-flex-col-reverse" : "hawa-flex-col"
1093
1129
  )
1094
1130
  },
@@ -1098,12 +1134,14 @@ var DataTable = ({
1098
1134
  return /* @__PURE__ */ React10.createElement(
1099
1135
  TableHead,
1100
1136
  {
1137
+ key: header.id,
1101
1138
  dir: props.direction,
1102
1139
  condensed: props.condensed,
1103
1140
  clickable: Boolean(isSortable),
1104
- key: header.id,
1105
1141
  style: {
1106
- maxWidth: header.column.columnDef.maxSize
1142
+ maxWidth: `${header.column.columnDef.maxSize}px !important`,
1143
+ minWidth: `${header.column.columnDef.minSize}px !important`,
1144
+ width: `${header.column.columnDef.size}px !important`
1107
1145
  }
1108
1146
  },
1109
1147
  header.isPlaceholder ? null : flexRender(
@@ -1122,12 +1160,14 @@ var DataTable = ({
1122
1160
  return /* @__PURE__ */ React10.createElement(
1123
1161
  TableCell,
1124
1162
  {
1163
+ key: cell.id,
1164
+ dir: props.direction,
1125
1165
  style: {
1126
- maxWidth: cell.column.columnDef.maxSize
1166
+ maxWidth: `${cell.column.columnDef.maxSize}px !important`,
1167
+ minWidth: `${cell.column.columnDef.minSize}px !important`,
1168
+ width: `${cell.column.columnDef.size}px !important`
1127
1169
  },
1128
- dir: props.direction,
1129
- padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding,
1130
- key: cell.id
1170
+ padding: props.condensed ? "condensed" : (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.padding
1131
1171
  },
1132
1172
  flexRender(
1133
1173
  cell.column.columnDef.cell,
@@ -1143,169 +1183,207 @@ var DataTable = ({
1143
1183
  },
1144
1184
  (_f = props.texts) == null ? void 0 : _f.noData
1145
1185
  ))))),
1146
- /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between" }, !props.showCount && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }), props.showCount && /* @__PURE__ */ React10.createElement(
1186
+ /* @__PURE__ */ React10.createElement(
1147
1187
  "div",
1148
1188
  {
1149
- className: "text-muted-foreground text-sm",
1150
- dir: props.direction
1151
- },
1152
- /* @__PURE__ */ React10.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
1153
- " ",
1154
- /* @__PURE__ */ React10.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
1155
- ), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, enableGoTo && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-sm" }, (_h = props.texts) == null ? void 0 : _h.goTo), /* @__PURE__ */ React10.createElement(
1156
- "input",
1157
- {
1158
- max: table.getPageCount(),
1159
- min: 0,
1160
- type: "number",
1161
- defaultValue: table.getState().pagination.pageIndex + 1,
1162
- onChange: (e) => {
1163
- let page = Number(e.target.value) - 1;
1164
- const max = table.getPageCount();
1165
- if (!isNaN(page) && Number(page) > max) {
1166
- page = max - 1;
1167
- }
1168
- table.setPageIndex(page);
1169
- },
1170
- className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
1171
- }
1172
- )), /* @__PURE__ */ React10.createElement(
1173
- DropdownMenu,
1174
- {
1175
- size: "sm",
1176
- width: "sm",
1177
- direction: props.direction,
1178
- items: itemsPerPageOptions || [
1179
- { label: `10 / ${pageText}`, value: 10 },
1180
- { label: `20 / ${pageText}`, value: 20 },
1181
- { label: `30 / ${pageText}`, value: 30 },
1182
- { label: `40 / ${pageText}`, value: 40 },
1183
- { label: `50 / ${pageText}`, value: 50 }
1184
- ],
1185
- trigger: /* @__PURE__ */ React10.createElement(
1186
- Button,
1187
- {
1188
- variant: "outline",
1189
- size: "icon",
1190
- className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 "
1191
- },
1192
- `${table.getState().pagination.pageSize} / ${(_i = props.texts) == null ? void 0 : _i.page}`
1193
- ),
1194
- onItemSelect: (e) => table.setPageSize(Number(e))
1195
- }
1196
- ), table.getPageCount() > 1 && /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm " }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React10.createElement("div", null, (_j = props.texts) == null ? void 0 : _j.page), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React10.createElement("span", null, (_k = props.texts) == null ? void 0 : _k.of), /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React10.createElement(
1197
- Button,
1198
- {
1199
- "aria-label": "Next Table Page",
1200
- variant: "outline",
1201
- size: "smallIcon",
1202
- onClick: () => table.setPageIndex(0),
1203
- disabled: !table.getCanPreviousPage(),
1204
1189
  className: cn(
1205
- props.direction === "rtl" && "hawa-rotate-180"
1190
+ "hawa-flex hawa-justify-between hawa-gap-4 tablet:hawa-gap-0",
1191
+ props.showSelectionCount ? "hawa-flex-col tablet:hawa-flex-row" : "hawa-flex-col mobile:hawa-flex-row"
1206
1192
  )
1207
1193
  },
1208
- /* @__PURE__ */ React10.createElement(
1209
- "svg",
1194
+ !props.showCount && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }),
1195
+ props.showCount || table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount ? /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-h-auto hawa-gap-4" }, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-h-auto hawa-items-center hawa-justify-between" }, props.showCount && /* @__PURE__ */ React10.createElement(
1196
+ "div",
1210
1197
  {
1211
- xmlns: "http://www.w3.org/2000/svg",
1212
- width: "20",
1213
- height: "20",
1214
- viewBox: "0 0 24 24",
1215
- fill: "none",
1216
- stroke: "currentColor",
1217
- strokeWidth: "2",
1218
- strokeLinecap: "round",
1219
- strokeLinejoin: "round"
1198
+ className: "hawa-text-muted-foreground hawa-text-sm",
1199
+ dir: props.direction
1220
1200
  },
1221
- /* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
1222
- /* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
1223
- )
1224
- ), /* @__PURE__ */ React10.createElement(
1225
- Button,
1226
- {
1227
- "aria-label": "Previous Table Page",
1228
- variant: "outline",
1229
- size: "smallIcon",
1230
- onClick: () => table.previousPage(),
1231
- disabled: !table.getCanPreviousPage(),
1232
- className: cn(
1233
- props.direction === "rtl" && "hawa-rotate-180"
1201
+ /* @__PURE__ */ React10.createElement("span", null, (_g = props.texts) == null ? void 0 : _g.total),
1202
+ " ",
1203
+ /* @__PURE__ */ React10.createElement("span", null, table.getFilteredRowModel().rows.length.toLocaleString())
1204
+ ), props.showCount && table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount && /* @__PURE__ */ React10.createElement("div", { className: "hawa-w-[0.5px] hawa-mx-2 hawa-bg-red-500 hawa-h-full" }), table.getFilteredSelectedRowModel().rows.length > 0 && props.showSelectionCount && /* @__PURE__ */ React10.createElement(
1205
+ "div",
1206
+ {
1207
+ className: "hawa-text-muted-foreground hawa-text-sm",
1208
+ dir: props.direction
1209
+ },
1210
+ table.getFilteredSelectedRowModel().rows.length,
1211
+ " ",
1212
+ (_h = props.texts) == null ? void 0 : _h.of,
1213
+ " ",
1214
+ table.getFilteredRowModel().rows.length,
1215
+ " ",
1216
+ (_i = props.texts) == null ? void 0 : _i.selectedRows
1217
+ )), table.getFilteredSelectedRowModel().rows.length > 0 && /* @__PURE__ */ React10.createElement("div", { className: "" }, /* @__PURE__ */ React10.createElement(
1218
+ DropdownMenu,
1219
+ {
1220
+ size: "sm",
1221
+ width: "sm",
1222
+ direction: props.direction,
1223
+ items: (props.bulkActions || []).map((action) => ({
1224
+ ...action,
1225
+ action: () => action.action(
1226
+ table.getFilteredSelectedRowModel().rows
1227
+ )
1228
+ })),
1229
+ trigger: /* @__PURE__ */ React10.createElement(Button, { size: "xs" }, ((_j = props.texts) == null ? void 0 : _j.bulkAction) || "Bulk Action")
1230
+ }
1231
+ ))) : null,
1232
+ /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-items-center hawa-gap-2 hawa-bg--500 tablet:hawa-w-fit hawa-justify-between" }, enableGoTo && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-text-sm" }, (_k = props.texts) == null ? void 0 : _k.goTo), /* @__PURE__ */ React10.createElement(
1233
+ "input",
1234
+ {
1235
+ max: table.getPageCount(),
1236
+ min: 0,
1237
+ type: "number",
1238
+ defaultValue: table.getState().pagination.pageIndex + 1,
1239
+ onChange: (e) => {
1240
+ let page = Number(e.target.value) - 1;
1241
+ const max = table.getPageCount();
1242
+ if (!isNaN(page) && Number(page) > max) {
1243
+ page = max - 1;
1244
+ }
1245
+ table.setPageIndex(page);
1246
+ },
1247
+ className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
1248
+ }
1249
+ )), /* @__PURE__ */ React10.createElement(
1250
+ DropdownMenu,
1251
+ {
1252
+ size: "sm",
1253
+ width: "sm",
1254
+ direction: props.direction,
1255
+ items: itemsPerPageOptions || [
1256
+ { label: `10 / ${pageText}`, value: 10 },
1257
+ { label: `20 / ${pageText}`, value: 20 },
1258
+ { label: `30 / ${pageText}`, value: 30 },
1259
+ { label: `40 / ${pageText}`, value: 40 },
1260
+ { label: `50 / ${pageText}`, value: 50 }
1261
+ ],
1262
+ trigger: /* @__PURE__ */ React10.createElement(
1263
+ Button,
1264
+ {
1265
+ variant: "outline",
1266
+ size: "icon",
1267
+ className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 hawa-whitespace-nowrap"
1268
+ },
1269
+ `${table.getState().pagination.pageSize} / ${(_l = props.texts) == null ? void 0 : _l.page}`
1270
+ ),
1271
+ onItemSelect: (e) => table.setPageSize(Number(e))
1272
+ }
1273
+ ), table.getPageCount() > 1 && /* @__PURE__ */ React10.createElement("div", { className: "hawa-bg--500 hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-bg--500 hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-flex hawa-items-center hawa-gap-1" }, /* @__PURE__ */ React10.createElement("div", null, (_m = props.texts) == null ? void 0 : _m.page), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-1" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React10.createElement("span", null, (_n = props.texts) == null ? void 0 : _n.of), /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold" }, table.getPageCount())))), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2 hawa-items-center hawa-bg--500" }, /* @__PURE__ */ React10.createElement(
1274
+ Button,
1275
+ {
1276
+ "aria-label": "Next Table Page",
1277
+ variant: "outline",
1278
+ size: "smallIcon",
1279
+ onClick: () => table.setPageIndex(0),
1280
+ disabled: !table.getCanPreviousPage(),
1281
+ className: cn(
1282
+ props.direction === "rtl" && "hawa-rotate-180"
1283
+ )
1284
+ },
1285
+ /* @__PURE__ */ React10.createElement(
1286
+ "svg",
1287
+ {
1288
+ xmlns: "http://www.w3.org/2000/svg",
1289
+ width: "20",
1290
+ height: "20",
1291
+ viewBox: "0 0 24 24",
1292
+ fill: "none",
1293
+ stroke: "currentColor",
1294
+ strokeWidth: "2",
1295
+ strokeLinecap: "round",
1296
+ strokeLinejoin: "round"
1297
+ },
1298
+ /* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
1299
+ /* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
1234
1300
  )
1235
- },
1236
- /* @__PURE__ */ React10.createElement(
1237
- "svg",
1301
+ ), /* @__PURE__ */ React10.createElement(
1302
+ Button,
1238
1303
  {
1239
- xmlns: "http://www.w3.org/2000/svg",
1240
- width: "20",
1241
- height: "20",
1242
- "aria-label": "Single Chevron Icon",
1243
- viewBox: "0 0 24 24",
1244
- fill: "none",
1245
- stroke: "currentColor",
1246
- strokeWidth: "2",
1247
- strokeLinecap: "round",
1248
- strokeLinejoin: "round"
1304
+ "aria-label": "Previous Table Page",
1305
+ variant: "outline",
1306
+ size: "smallIcon",
1307
+ onClick: () => table.previousPage(),
1308
+ disabled: !table.getCanPreviousPage(),
1309
+ className: cn(
1310
+ props.direction === "rtl" && "hawa-rotate-180"
1311
+ )
1249
1312
  },
1250
- /* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
1251
- )
1252
- ), /* @__PURE__ */ React10.createElement(
1253
- Button,
1254
- {
1255
- "aria-label": "Next Table Page",
1256
- variant: "outline",
1257
- size: "smallIcon",
1258
- onClick: () => table.nextPage(),
1259
- disabled: !table.getCanNextPage(),
1260
- className: cn(
1261
- props.direction === "ltr" && "hawa-rotate-180"
1313
+ /* @__PURE__ */ React10.createElement(
1314
+ "svg",
1315
+ {
1316
+ xmlns: "http://www.w3.org/2000/svg",
1317
+ width: "20",
1318
+ height: "20",
1319
+ "aria-label": "Single Chevron Icon",
1320
+ viewBox: "0 0 24 24",
1321
+ fill: "none",
1322
+ stroke: "currentColor",
1323
+ strokeWidth: "2",
1324
+ strokeLinecap: "round",
1325
+ strokeLinejoin: "round"
1326
+ },
1327
+ /* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
1262
1328
  )
1263
- },
1264
- /* @__PURE__ */ React10.createElement(
1265
- "svg",
1329
+ ), /* @__PURE__ */ React10.createElement(
1330
+ Button,
1266
1331
  {
1267
- xmlns: "http://www.w3.org/2000/svg",
1268
- width: "20",
1269
- height: "20",
1270
- "aria-label": "Single Chevron Icon",
1271
- viewBox: "0 0 24 24",
1272
- fill: "none",
1273
- stroke: "currentColor",
1274
- strokeWidth: "2",
1275
- strokeLinecap: "round",
1276
- strokeLinejoin: "round"
1332
+ "aria-label": "Next Table Page",
1333
+ variant: "outline",
1334
+ size: "smallIcon",
1335
+ onClick: () => table.nextPage(),
1336
+ disabled: !table.getCanNextPage(),
1337
+ className: cn(
1338
+ props.direction === "ltr" && "hawa-rotate-180"
1339
+ )
1277
1340
  },
1278
- /* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
1279
- )
1280
- ), /* @__PURE__ */ React10.createElement(
1281
- Button,
1282
- {
1283
- "aria-label": "Next Table Page",
1284
- variant: "outline",
1285
- size: "smallIcon",
1286
- onClick: () => table.setPageIndex(table.getPageCount() - 1),
1287
- disabled: !table.getCanNextPage(),
1288
- className: cn(
1289
- props.direction === "ltr" && "hawa-rotate-180"
1341
+ /* @__PURE__ */ React10.createElement(
1342
+ "svg",
1343
+ {
1344
+ xmlns: "http://www.w3.org/2000/svg",
1345
+ width: "20",
1346
+ height: "20",
1347
+ "aria-label": "Single Chevron Icon",
1348
+ viewBox: "0 0 24 24",
1349
+ fill: "none",
1350
+ stroke: "currentColor",
1351
+ strokeWidth: "2",
1352
+ strokeLinecap: "round",
1353
+ strokeLinejoin: "round"
1354
+ },
1355
+ /* @__PURE__ */ React10.createElement("path", { d: "m15 18-6-6 6-6" })
1290
1356
  )
1291
- },
1292
- /* @__PURE__ */ React10.createElement(
1293
- "svg",
1357
+ ), /* @__PURE__ */ React10.createElement(
1358
+ Button,
1294
1359
  {
1295
- xmlns: "http://www.w3.org/2000/svg",
1296
- width: "20",
1297
- height: "20",
1298
- viewBox: "0 0 24 24",
1299
- fill: "none",
1300
- stroke: "currentColor",
1301
- strokeWidth: "2",
1302
- strokeLinecap: "round",
1303
- strokeLinejoin: "round"
1360
+ "aria-label": "Next Table Page",
1361
+ variant: "outline",
1362
+ size: "smallIcon",
1363
+ onClick: () => table.setPageIndex(table.getPageCount() - 1),
1364
+ disabled: !table.getCanNextPage(),
1365
+ className: cn(
1366
+ props.direction === "ltr" && "hawa-rotate-180"
1367
+ )
1304
1368
  },
1305
- /* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
1306
- /* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
1307
- )
1308
- ))))
1369
+ /* @__PURE__ */ React10.createElement(
1370
+ "svg",
1371
+ {
1372
+ xmlns: "http://www.w3.org/2000/svg",
1373
+ width: "20",
1374
+ height: "20",
1375
+ viewBox: "0 0 24 24",
1376
+ fill: "none",
1377
+ stroke: "currentColor",
1378
+ strokeWidth: "2",
1379
+ strokeLinecap: "round",
1380
+ strokeLinejoin: "round"
1381
+ },
1382
+ /* @__PURE__ */ React10.createElement("path", { d: "m11 17-5-5 5-5" }),
1383
+ /* @__PURE__ */ React10.createElement("path", { d: "m18 17-5-5 5-5" })
1384
+ )
1385
+ ))))
1386
+ )
1309
1387
  ));
1310
1388
  };
1311
1389