@sikka/hawa 0.10.17-next → 0.10.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/README.md CHANGED
@@ -52,8 +52,13 @@
52
52
 
53
53
  ## Install
54
54
 
55
- **Note:** `@beta` only points to pre-releases.
56
- Use `@latest` for the latest stable release.
55
+ **Note:** Current npm tags 👇
56
+
57
+ `@beta` is archived.
58
+
59
+ `@next` only points to pre-releases.
60
+
61
+ `@latest` for the latest stable release.
57
62
 
58
63
  ```bash
59
64
  npm install @sikka/hawa
package/dist/index.d.mts CHANGED
@@ -460,11 +460,13 @@ type DataTableProps<DataProps = {}> = {
460
460
  direction?: "rtl" | "ltr";
461
461
  columns: ColumnDef<DataProps>[];
462
462
  data: DataProps[];
463
+ showCount?: boolean;
463
464
  condensed?: boolean;
464
465
  isLoading?: boolean;
465
466
  defaultSort?: string;
466
467
  texts?: {
467
468
  searchPlaceholder?: string;
469
+ item?: string;
468
470
  noData?: any;
469
471
  page?: string;
470
472
  filter?: string;
@@ -662,6 +664,7 @@ type ComboboxTypes<T> = {
662
664
  /** This the same value as the one with the key valueKey */
663
665
  defaultValue?: string;
664
666
  preview?: boolean;
667
+ hideInput?: boolean;
665
668
  onChange?: (e: any) => void;
666
669
  };
667
670
  declare const Combobox: React$1.FC<ComboboxTypes<any>>;
package/dist/index.d.ts CHANGED
@@ -460,11 +460,13 @@ type DataTableProps<DataProps = {}> = {
460
460
  direction?: "rtl" | "ltr";
461
461
  columns: ColumnDef<DataProps>[];
462
462
  data: DataProps[];
463
+ showCount?: boolean;
463
464
  condensed?: boolean;
464
465
  isLoading?: boolean;
465
466
  defaultSort?: string;
466
467
  texts?: {
467
468
  searchPlaceholder?: string;
469
+ item?: string;
468
470
  noData?: any;
469
471
  page?: string;
470
472
  filter?: string;
@@ -662,6 +664,7 @@ type ComboboxTypes<T> = {
662
664
  /** This the same value as the one with the key valueKey */
663
665
  defaultValue?: string;
664
666
  preview?: boolean;
667
+ hideInput?: boolean;
665
668
  onChange?: (e: any) => void;
666
669
  };
667
670
  declare const Combobox: React$1.FC<ComboboxTypes<any>>;
package/dist/index.js CHANGED
@@ -5001,7 +5001,7 @@ var DataTable = function(_param) {
5001
5001
  "columns",
5002
5002
  "data"
5003
5003
  ]);
5004
- var _props_texts, _table_getRowModel_rows, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8, _props_texts9;
5004
+ 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;
5005
5005
  var _React37_useState = _sliced_to_array(React37.useState([
5006
5006
  {
5007
5007
  id: props.defaultSort || "",
@@ -5081,9 +5081,12 @@ var DataTable = function(_param) {
5081
5081
  className: "hawa-h-24 hawa-text-center"
5082
5082
  }, (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.noData))))), /* @__PURE__ */ React37.createElement("div", {
5083
5083
  className: "hawa-flex hawa-items-center hawa-justify-between"
5084
- }, /* @__PURE__ */ React37.createElement("div", {
5084
+ }, !props.showCount && /* @__PURE__ */ React37.createElement("div", {
5085
5085
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground"
5086
- }), table.getPageCount() !== 0 && /* @__PURE__ */ React37.createElement("div", {
5086
+ }), props.showCount && /* @__PURE__ */ React37.createElement("div", {
5087
+ className: "text-sm text-muted-foreground",
5088
+ dir: props.direction
5089
+ }, /* @__PURE__ */ React37.createElement("span", null, (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.total), " ", /* @__PURE__ */ React37.createElement("span", null, table.getFilteredRowModel().rows.length)), table.getPageCount() !== 0 && /* @__PURE__ */ React37.createElement("div", {
5087
5090
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 "
5088
5091
  }, /* @__PURE__ */ React37.createElement(DropdownMenu, {
5089
5092
  size: "sm",
@@ -5091,23 +5094,23 @@ var DataTable = function(_param) {
5091
5094
  direction: props.direction,
5092
5095
  items: [
5093
5096
  {
5094
- label: "10 / ".concat((_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.page),
5097
+ label: "10 / ".concat((_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.page),
5095
5098
  value: 10
5096
5099
  },
5097
5100
  {
5098
- label: "20 / ".concat((_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.page),
5101
+ label: "20 / ".concat((_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.page),
5099
5102
  value: 20
5100
5103
  },
5101
5104
  {
5102
- label: "30 / ".concat((_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.page),
5105
+ label: "30 / ".concat((_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.page),
5103
5106
  value: 30
5104
5107
  },
5105
5108
  {
5106
- label: "40 / ".concat((_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.page),
5109
+ label: "40 / ".concat((_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.page),
5107
5110
  value: 40
5108
5111
  },
5109
5112
  {
5110
- label: "50 / ".concat((_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.page),
5113
+ label: "50 / ".concat((_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.page),
5111
5114
  value: 50
5112
5115
  }
5113
5116
  ],
@@ -5115,7 +5118,7 @@ var DataTable = function(_param) {
5115
5118
  variant: "outline",
5116
5119
  size: "icon",
5117
5120
  className: "hawa-h-fit hawa-w-fit hawa-p-0 hawa-px-2 hawa-py-1 "
5118
- }, "".concat(table.getState().pagination.pageSize, " / ").concat((_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.page)),
5121
+ }, "".concat(table.getState().pagination.pageSize, " / ").concat((_props_texts8 = props.texts) === null || _props_texts8 === void 0 ? void 0 : _props_texts8.page)),
5119
5122
  onItemSelect: function(e) {
5120
5123
  return table.setPageSize(Number(e));
5121
5124
  }
@@ -5123,11 +5126,11 @@ var DataTable = function(_param) {
5123
5126
  className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm "
5124
5127
  }, /* @__PURE__ */ React37.createElement("span", {
5125
5128
  className: "hawa-flex hawa-items-center hawa-gap-1"
5126
- }, /* @__PURE__ */ React37.createElement("div", null, (_props_texts8 = props.texts) === null || _props_texts8 === void 0 ? void 0 : _props_texts8.page), /* @__PURE__ */ React37.createElement("div", {
5129
+ }, /* @__PURE__ */ React37.createElement("div", null, (_props_texts9 = props.texts) === null || _props_texts9 === void 0 ? void 0 : _props_texts9.page), /* @__PURE__ */ React37.createElement("div", {
5127
5130
  className: "hawa-flex hawa-flex-row hawa-gap-1"
5128
5131
  }, /* @__PURE__ */ React37.createElement("span", {
5129
5132
  className: "hawa-font-bold"
5130
- }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React37.createElement("span", null, (_props_texts9 = props.texts) === null || _props_texts9 === void 0 ? void 0 : _props_texts9.of), /* @__PURE__ */ React37.createElement("span", {
5133
+ }, table.getState().pagination.pageIndex + 1), /* @__PURE__ */ React37.createElement("span", null, (_props_texts10 = props.texts) === null || _props_texts10 === void 0 ? void 0 : _props_texts10.of), /* @__PURE__ */ React37.createElement("span", {
5131
5134
  className: "hawa-font-bold"
5132
5135
  }, table.getPageCount())))), /* @__PURE__ */ React37.createElement(Button, {
5133
5136
  variant: "outline",
@@ -6049,9 +6052,9 @@ var Combobox = function(_param) {
6049
6052
  className: cn("hawa-text-primary hawa-border hawa-h-10 hawa-py-2 hawa-justify-between hawa-w-full hawa-font-normal hawa-inline-flex hawa-items-center hawa-transition-all hawa-select-none hawa-rounded-md hawa-text-sm hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50", props.preview ? "hawa-px-0 hawa-rounded-none hawa-border-transparent hawa-cursor-default" : "hawa-px-3 hawa-bg-background ")
6050
6053
  }, value ? getProperty(data.find(function(item) {
6051
6054
  return item[valueKey] === value;
6052
- }) || {}, labelKey) : props.placeholder || "...", !props.preview && /* @__PURE__ */ React47.createElement("svg", {
6055
+ }) || {}, labelKey) : props.placeholder || "...", /* @__PURE__ */ React47.createElement("svg", {
6053
6056
  xmlns: "http://www.w3.org/2000/svg",
6054
- className: "hawa-w-4 hawa-h-4",
6057
+ className: cn("hawa-w-4 hawa-h-4 hawa-transition-all", !props.preview ? "hawa-opacity-100 hawa-visible" : "hawa-opacity-0 hawa-invisible"),
6055
6058
  viewBox: "0 0 24 24",
6056
6059
  fill: "none",
6057
6060
  stroke: "currentColor",
@@ -6062,7 +6065,7 @@ var Combobox = function(_param) {
6062
6065
  d: "m6 9 6 6 6-6"
6063
6066
  }))))), /* @__PURE__ */ React47.createElement(PopoverContent, {
6064
6067
  className: cn("popover-w-parent")
6065
- }, /* @__PURE__ */ React47.createElement(Command, null, /* @__PURE__ */ React47.createElement(CommandInput, {
6068
+ }, /* @__PURE__ */ React47.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React47.createElement(CommandInput, {
6066
6069
  placeholder: props.searchPlaceholder
6067
6070
  }), /* @__PURE__ */ React47.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React47.createElement(CommandGroup, {
6068
6071
  className: " hawa-max-h-[200px] hawa-overflow-y-auto"
package/dist/index.mjs CHANGED
@@ -4728,7 +4728,16 @@ var DataTable = ({
4728
4728
  className: "hawa-h-24 hawa-text-center"
4729
4729
  },
4730
4730
  props.texts?.noData
4731
- ))))), /* @__PURE__ */ React37.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between" }, /* @__PURE__ */ React37.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-sm hawa-text-muted-foreground" }), table.getPageCount() !== 0 && /* @__PURE__ */ React37.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, /* @__PURE__ */ React37.createElement(
4731
+ ))))), /* @__PURE__ */ React37.createElement("div", { className: "hawa-flex hawa-items-center hawa-justify-between" }, !props.showCount && /* @__PURE__ */ React37.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__ */ React37.createElement(
4732
+ "div",
4733
+ {
4734
+ className: "text-sm text-muted-foreground",
4735
+ dir: props.direction
4736
+ },
4737
+ /* @__PURE__ */ React37.createElement("span", null, props.texts?.total),
4738
+ " ",
4739
+ /* @__PURE__ */ React37.createElement("span", null, table.getFilteredRowModel().rows.length)
4740
+ ), table.getPageCount() !== 0 && /* @__PURE__ */ React37.createElement("div", { className: "hawa-flex hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2 " }, /* @__PURE__ */ React37.createElement(
4732
4741
  DropdownMenu,
4733
4742
  {
4734
4743
  size: "sm",
@@ -5745,11 +5754,14 @@ var Combobox = ({
5745
5754
  data.find((item) => item[valueKey] === value) || {},
5746
5755
  labelKey
5747
5756
  ) : props.placeholder || "...",
5748
- !props.preview && /* @__PURE__ */ React47.createElement(
5757
+ /* @__PURE__ */ React47.createElement(
5749
5758
  "svg",
5750
5759
  {
5751
5760
  xmlns: "http://www.w3.org/2000/svg",
5752
- className: "hawa-w-4 hawa-h-4",
5761
+ className: cn(
5762
+ "hawa-w-4 hawa-h-4 hawa-transition-all",
5763
+ !props.preview ? "hawa-opacity-100 hawa-visible" : "hawa-opacity-0 hawa-invisible"
5764
+ ),
5753
5765
  viewBox: "0 0 24 24",
5754
5766
  fill: "none",
5755
5767
  stroke: "currentColor",
@@ -5759,7 +5771,7 @@ var Combobox = ({
5759
5771
  },
5760
5772
  /* @__PURE__ */ React47.createElement("path", { d: "m6 9 6 6 6-6" })
5761
5773
  )
5762
- ))), /* @__PURE__ */ React47.createElement(PopoverContent, { className: cn("popover-w-parent") }, /* @__PURE__ */ React47.createElement(Command, null, /* @__PURE__ */ React47.createElement(CommandInput, { placeholder: props.searchPlaceholder }), /* @__PURE__ */ React47.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React47.createElement(CommandGroup, { className: " hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item) => /* @__PURE__ */ React47.createElement(
5774
+ ))), /* @__PURE__ */ React47.createElement(PopoverContent, { className: cn("popover-w-parent") }, /* @__PURE__ */ React47.createElement(Command, null, !props.hideInput && /* @__PURE__ */ React47.createElement(CommandInput, { placeholder: props.searchPlaceholder }), /* @__PURE__ */ React47.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React47.createElement(CommandGroup, { className: " hawa-max-h-[200px] hawa-overflow-y-auto" }, data.map((item) => /* @__PURE__ */ React47.createElement(
5763
5775
  CommandItem,
5764
5776
  {
5765
5777
  key: getProperty(item, valueKey),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.10.17-next",
3
+ "version": "0.10.19-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {