@sikka/hawa 0.30.15-next → 0.30.17-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.
@@ -28,7 +28,7 @@ import {
28
28
  TabsTrigger,
29
29
  Textarea,
30
30
  UncheckMark
31
- } from "../chunk-VVRT5XAJ.mjs";
31
+ } from "../chunk-CXBN42TF.mjs";
32
32
  import {
33
33
  Sheet,
34
34
  SheetClose,
@@ -925,15 +925,9 @@ var DataTable = ({
925
925
  const [expanded, setExpanded] = React10.useState({});
926
926
  const [columnVisibility, setColumnVisibility] = React10.useState({});
927
927
  const [rowSelection, setRowSelection] = React10.useState({});
928
- const visibleColumns = columns.filter(
929
- (column) => {
930
- var _a2;
931
- return ((_a2 = column.meta) == null ? void 0 : _a2.hidden) !== true;
932
- }
933
- );
934
928
  const table = useReactTable({
935
929
  data,
936
- columns: visibleColumns,
930
+ columns,
937
931
  onExpandedChange: setExpanded,
938
932
  getExpandedRowModel: getExpandedRowModel(),
939
933
  onGlobalFilterChange: setGlobalFilter,
@@ -953,15 +947,22 @@ var DataTable = ({
953
947
  rowSelection,
954
948
  expanded
955
949
  }
956
- // defaultColumn: {
957
- // maxSize: 200
958
- // }
959
950
  });
960
951
  const pageText = ((_a = props.texts) == null ? void 0 : _a.page) || "page";
961
952
  const itemsPerPageOptions = (_b = props.itemsPerPage) == null ? void 0 : _b.map((item) => ({
962
953
  label: `${item} / ${pageText}`,
963
954
  value: item
964
955
  }));
956
+ React10.useEffect(() => {
957
+ setColumnVisibility((prev) => {
958
+ let newColumnVisibility = {};
959
+ columns.forEach((column) => {
960
+ var _a2;
961
+ newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
962
+ });
963
+ return newColumnVisibility;
964
+ });
965
+ }, [columns]);
965
966
  return /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React10.createElement(
966
967
  Input,
967
968
  {
@@ -1238,7 +1239,7 @@ var DataTable = ({
1238
1239
  };
1239
1240
 
1240
1241
  // elements/backToTop/BackToTop.tsx
1241
- import React11, { useState as useState3, useEffect as useEffect2, useRef as useRef2 } from "react";
1242
+ import React11, { useState as useState3, useEffect as useEffect3, useRef as useRef2 } from "react";
1242
1243
  var BackToTop = ({ ...props }) => {
1243
1244
  const [visible, setVisible] = useState3(false);
1244
1245
  const [rect, _setRect] = useState3(null);
@@ -1268,7 +1269,7 @@ var BackToTop = ({ ...props }) => {
1268
1269
  props.anchor.current.scrollTo({ top: 0, behavior: "smooth" });
1269
1270
  }
1270
1271
  };
1271
- useEffect2(() => {
1272
+ useEffect3(() => {
1272
1273
  if (!props.anchor.current)
1273
1274
  return;
1274
1275
  props.anchor.current.addEventListener("scroll", onScroll);
@@ -1607,7 +1608,7 @@ var Combobox = React13.forwardRef(
1607
1608
  );
1608
1609
 
1609
1610
  // elements/fileDropzone/FileDropzone.tsx
1610
- import React14, { useEffect as useEffect3, useState as useState5 } from "react";
1611
+ import React14, { useEffect as useEffect4, useState as useState5 } from "react";
1611
1612
  import { useDropzone } from "react-dropzone";
1612
1613
  import clsx from "clsx";
1613
1614
  var FileDropzone = ({
@@ -1652,7 +1653,7 @@ var FileDropzone = ({
1652
1653
  );
1653
1654
  }
1654
1655
  });
1655
- useEffect3(
1656
+ useEffect4(
1656
1657
  () => () => {
1657
1658
  files == null ? void 0 : files.forEach((file) => {
1658
1659
  URL.revokeObjectURL(file.preview);
@@ -1660,7 +1661,7 @@ var FileDropzone = ({
1660
1661
  },
1661
1662
  [files]
1662
1663
  );
1663
- useEffect3(() => {
1664
+ useEffect4(() => {
1664
1665
  setFiles(acceptedFiles);
1665
1666
  }, [acceptedFiles, cmp, setFiles]);
1666
1667
  onClearFiles = () => {
@@ -1672,7 +1673,7 @@ var FileDropzone = ({
1672
1673
  acceptedFiles.length = 0;
1673
1674
  setFiles([]);
1674
1675
  };
1675
- useEffect3(() => {
1676
+ useEffect4(() => {
1676
1677
  if (maxSize > 0) {
1677
1678
  const k = 1024;
1678
1679
  const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
@@ -2000,7 +2001,7 @@ var AppStores = (props) => {
2000
2001
  };
2001
2002
 
2002
2003
  // elements/badge/Badge.tsx
2003
- import React19, { useEffect as useEffect5, useState as useState7, useRef as useRef5 } from "react";
2004
+ import React19, { useEffect as useEffect6, useState as useState7, useRef as useRef5 } from "react";
2004
2005
  var Badge = ({
2005
2006
  anchor,
2006
2007
  position = "right",
@@ -2015,7 +2016,7 @@ var Badge = ({
2015
2016
  default: { top: 4, left: 7, right: 5, classes: "hawa-w-3 hawa-h-3" },
2016
2017
  large: { top: 6, left: 12, right: 7, classes: "hawa-w-6 hawa-h-6" }
2017
2018
  };
2018
- useEffect5(() => {
2019
+ useEffect6(() => {
2019
2020
  const handlePositioning = () => {
2020
2021
  var _a;
2021
2022
  if (anchor.current && indicatorRef.current) {
@@ -2079,7 +2080,7 @@ var BadgedComponent = ({
2079
2080
  // elements/colorPicker/ColorPicker.tsx
2080
2081
  import React20, {
2081
2082
  useState as useState8,
2082
- useEffect as useEffect6
2083
+ useEffect as useEffect7
2083
2084
  } from "react";
2084
2085
  var ColorPicker = ({
2085
2086
  containerProps,
@@ -2092,7 +2093,7 @@ var ColorPicker = ({
2092
2093
  ...props
2093
2094
  }) => {
2094
2095
  const [selectedColor, setSelectedColor] = useState8(props.color);
2095
- useEffect6(() => {
2096
+ useEffect7(() => {
2096
2097
  if (selectedColor && selectedColor[0] !== "#") {
2097
2098
  setSelectedColor(`#${selectedColor}`);
2098
2099
  }
@@ -2374,7 +2375,7 @@ var Pagination = ({
2374
2375
  };
2375
2376
 
2376
2377
  // elements/passwordInput/PasswordInput.tsx
2377
- import React23, { useEffect as useEffect7, useState as useState9 } from "react";
2378
+ import React23, { useEffect as useEffect8, useState as useState9 } from "react";
2378
2379
  var PasswordStrengthIndicator = ({ strength }) => {
2379
2380
  const strengthLevels = [
2380
2381
  "none",
@@ -2422,7 +2423,7 @@ var PasswordInput = ({
2422
2423
  const [specialCharCriteriaMet, setSpecialCharCriteriaMet] = useState9(false);
2423
2424
  const [lowercaseCriteriaMet, setLowercaseCriteriaMet] = useState9(false);
2424
2425
  const [uppercaseCriteriaMet, setUppercaseCriteriaMet] = useState9(false);
2425
- useEffect7(() => {
2426
+ useEffect8(() => {
2426
2427
  const calculateStrength = () => {
2427
2428
  let strengthScore = 0;
2428
2429
  if (lengthCriteriaMet)
@@ -2605,7 +2606,7 @@ var SimpleTable = ({
2605
2606
  };
2606
2607
 
2607
2608
  // elements/scrollIndicator/ScrollIndicator.tsx
2608
- import React26, { useState as useState10, useEffect as useEffect8 } from "react";
2609
+ import React26, { useState as useState10, useEffect as useEffect9 } from "react";
2609
2610
  var ScrollIndicator = ({
2610
2611
  anchor,
2611
2612
  inContainer = false
@@ -2621,7 +2622,7 @@ var ScrollIndicator = ({
2621
2622
  setScrollPercentage(percentageScrolled);
2622
2623
  }
2623
2624
  };
2624
- useEffect8(() => {
2625
+ useEffect9(() => {
2625
2626
  if (!anchor.current)
2626
2627
  return;
2627
2628
  anchor.current.addEventListener("scroll", onScroll);
@@ -2806,7 +2807,7 @@ var CodeBlock = ({
2806
2807
  };
2807
2808
 
2808
2809
  // elements/carousel/Carousel.tsx
2809
- import React28, { useEffect as useEffect9, useState as useState12 } from "react";
2810
+ import React28, { useEffect as useEffect10, useState as useState12 } from "react";
2810
2811
  import useEmblaCarousel from "embla-carousel-react";
2811
2812
  var Carousel = ({
2812
2813
  items,
@@ -2823,7 +2824,7 @@ var Carousel = ({
2823
2824
  loop: autoplay ? true : (options == null ? void 0 : options.loop) || false
2824
2825
  });
2825
2826
  const [selectedIndex, setSelectedIndex] = useState12(0);
2826
- useEffect9(() => {
2827
+ useEffect10(() => {
2827
2828
  function selectHandler() {
2828
2829
  const index = emblaApi == null ? void 0 : emblaApi.selectedScrollSnap();
2829
2830
  setSelectedIndex(index || 0);
@@ -2833,7 +2834,7 @@ var Carousel = ({
2833
2834
  emblaApi == null ? void 0 : emblaApi.off("select", selectHandler);
2834
2835
  };
2835
2836
  }, [emblaApi]);
2836
- useEffect9(() => {
2837
+ useEffect10(() => {
2837
2838
  let autoplayTimer;
2838
2839
  if (autoplay && emblaApi) {
2839
2840
  autoplayTimer = setInterval(() => {
package/dist/index.css CHANGED
@@ -2190,9 +2190,8 @@ input[type="number"]::-webkit-inner-spin-button,
2190
2190
  --tw-border-opacity: 1;
2191
2191
  border-color: hsl(var(--error) / var(--tw-border-opacity));
2192
2192
  }
2193
- .hawa-border-gray-200 {
2194
- --tw-border-opacity: 1;
2195
- border-color: rgb(229 231 235 / var(--tw-border-opacity));
2193
+ .hawa-border-foreground\/10 {
2194
+ border-color: hsl(var(--foreground) / 0.1);
2196
2195
  }
2197
2196
  .hawa-border-gray-800 {
2198
2197
  --tw-border-opacity: 1;
@@ -2784,9 +2783,6 @@ input[type="number"]::-webkit-inner-spin-button,
2784
2783
  .hawa-uppercase {
2785
2784
  text-transform: uppercase;
2786
2785
  }
2787
- .hawa-capitalize {
2788
- text-transform: capitalize;
2789
- }
2790
2786
  .hawa-leading-4 {
2791
2787
  line-height: 1rem;
2792
2788
  }
@@ -3937,6 +3933,9 @@ body {
3937
3933
  --tw-scale-y: 1;
3938
3934
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3939
3935
  }
3936
+ :is(.hawa-dark .dark\:hawa-border-foreground\/10) {
3937
+ border-color: hsl(var(--foreground) / 0.1);
3938
+ }
3940
3939
  :is(.hawa-dark .dark\:hawa-border-gray-200) {
3941
3940
  --tw-border-opacity: 1;
3942
3941
  border-color: rgb(229 231 235 / var(--tw-border-opacity));
package/dist/index.js CHANGED
@@ -2849,15 +2849,9 @@ var DataTable = ({
2849
2849
  const [expanded, setExpanded] = React22.useState({});
2850
2850
  const [columnVisibility, setColumnVisibility] = React22.useState({});
2851
2851
  const [rowSelection, setRowSelection] = React22.useState({});
2852
- const visibleColumns = columns.filter(
2853
- (column) => {
2854
- var _a2;
2855
- return ((_a2 = column.meta) == null ? void 0 : _a2.hidden) !== true;
2856
- }
2857
- );
2858
2852
  const table = (0, import_react_table.useReactTable)({
2859
2853
  data,
2860
- columns: visibleColumns,
2854
+ columns,
2861
2855
  onExpandedChange: setExpanded,
2862
2856
  getExpandedRowModel: (0, import_react_table.getExpandedRowModel)(),
2863
2857
  onGlobalFilterChange: setGlobalFilter,
@@ -2877,15 +2871,22 @@ var DataTable = ({
2877
2871
  rowSelection,
2878
2872
  expanded
2879
2873
  }
2880
- // defaultColumn: {
2881
- // maxSize: 200
2882
- // }
2883
2874
  });
2884
2875
  const pageText = ((_a = props.texts) == null ? void 0 : _a.page) || "page";
2885
2876
  const itemsPerPageOptions = (_b = props.itemsPerPage) == null ? void 0 : _b.map((item) => ({
2886
2877
  label: `${item} / ${pageText}`,
2887
2878
  value: item
2888
2879
  }));
2880
+ React22.useEffect(() => {
2881
+ setColumnVisibility((prev) => {
2882
+ let newColumnVisibility = {};
2883
+ columns.forEach((column) => {
2884
+ var _a2;
2885
+ newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
2886
+ });
2887
+ return newColumnVisibility;
2888
+ });
2889
+ }, [columns]);
2889
2890
  return /* @__PURE__ */ React22.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-4" }, (enableSearch || enableHideColumns) && /* @__PURE__ */ React22.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-4" }, enableSearch && /* @__PURE__ */ React22.createElement(
2890
2891
  Input,
2891
2892
  {
@@ -3412,7 +3413,7 @@ var Radio = (0, import_react11.forwardRef)(
3412
3413
  {
3413
3414
  htmlFor: opt.value.toString(),
3414
3415
  className: cn(
3415
- "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-gray-200 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-gray-700 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
3416
+ "hawa-inline-flex hawa-h-full hawa-w-full hawa-transition-all hawa-items-center hawa-justify-between hawa-rounded-lg hawa-border hawa-border-foreground/10 hawa-bg-background hawa-p-5 hawa-text-gray-500 peer-checked:hawa-border-primary peer-checked:hawa-text-primary dark:hawa-border-foreground/10 dark:hawa-bg-foreground/5 dark:hawa-text-gray-400 dark:peer-checked:hawa-text-primary",
3416
3417
  opt.disabled ? "hawa-opacity-50" : "hawa-cursor-pointer hover:hawa-bg-foreground/10 hover:hawa-text-gray-600 dark:hover:hawa-bg-foreground/20 dark:hover:hawa-text-gray-300"
3417
3418
  )
3418
3419
  },