@sikka/hawa 0.16.10-next → 0.16.12-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
@@ -269,32 +269,31 @@ type ColorPickerTypes = {
269
269
  };
270
270
  declare const ColorPicker: FC<ColorPickerTypes>;
271
271
 
272
- type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
273
- isLoading?: boolean;
274
- containerClassName?: string;
275
- margin?: "none" | "normal" | "large";
276
- width?: "small" | "normal" | "full" | "auto";
272
+ declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
273
+ isLoading?: boolean | undefined;
274
+ containerClassName?: string | undefined;
275
+ margin?: "none" | "normal" | "large" | undefined;
276
+ width?: "small" | "full" | "normal" | "auto" | undefined;
277
277
  /** The label of the input field */
278
278
  label?: any;
279
- hint?: string;
280
- hintSide?: PositionType;
279
+ hint?: string | undefined;
280
+ hintSide?: PositionType | undefined;
281
281
  /** If true, it will show a red asterisk next to the label*/
282
- isRequired?: boolean;
282
+ isRequired?: boolean | undefined;
283
283
  /** Disable/Enable multiple line text input field */
284
- multiline?: boolean;
284
+ multiline?: boolean | undefined;
285
285
  /** The small red text under the input field to show validation or a hint. */
286
286
  helperText?: any;
287
- forceHideHelperText?: boolean;
288
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
287
+ forceHideHelperText?: boolean | undefined;
288
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
289
289
  /** The icon inside the input field */
290
290
  icon?: any;
291
291
  /** Boolean to enable/disable editing the input field and using it as a text field */
292
- preview?: boolean;
292
+ preview?: boolean | undefined;
293
293
  iconInside?: React__default.ReactNode;
294
294
  endIcon?: React__default.ReactNode;
295
295
  startIcon?: React__default.ReactNode;
296
- };
297
- declare const Input: FC<TextFieldTypes>;
296
+ } & React__default.RefAttributes<HTMLInputElement>>;
298
297
 
299
298
  type ComboboxTypes<T> = {
300
299
  labelKey?: keyof T;
package/dist/index.d.ts CHANGED
@@ -269,32 +269,31 @@ type ColorPickerTypes = {
269
269
  };
270
270
  declare const ColorPicker: FC<ColorPickerTypes>;
271
271
 
272
- type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
273
- isLoading?: boolean;
274
- containerClassName?: string;
275
- margin?: "none" | "normal" | "large";
276
- width?: "small" | "normal" | "full" | "auto";
272
+ declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
273
+ isLoading?: boolean | undefined;
274
+ containerClassName?: string | undefined;
275
+ margin?: "none" | "normal" | "large" | undefined;
276
+ width?: "small" | "full" | "normal" | "auto" | undefined;
277
277
  /** The label of the input field */
278
278
  label?: any;
279
- hint?: string;
280
- hintSide?: PositionType;
279
+ hint?: string | undefined;
280
+ hintSide?: PositionType | undefined;
281
281
  /** If true, it will show a red asterisk next to the label*/
282
- isRequired?: boolean;
282
+ isRequired?: boolean | undefined;
283
283
  /** Disable/Enable multiple line text input field */
284
- multiline?: boolean;
284
+ multiline?: boolean | undefined;
285
285
  /** The small red text under the input field to show validation or a hint. */
286
286
  helperText?: any;
287
- forceHideHelperText?: boolean;
288
- inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
287
+ forceHideHelperText?: boolean | undefined;
288
+ inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
289
289
  /** The icon inside the input field */
290
290
  icon?: any;
291
291
  /** Boolean to enable/disable editing the input field and using it as a text field */
292
- preview?: boolean;
292
+ preview?: boolean | undefined;
293
293
  iconInside?: React__default.ReactNode;
294
294
  endIcon?: React__default.ReactNode;
295
295
  startIcon?: React__default.ReactNode;
296
- };
297
- declare const Input: FC<TextFieldTypes>;
296
+ } & React__default.RefAttributes<HTMLInputElement>>;
298
297
 
299
298
  type ComboboxTypes<T> = {
300
299
  labelKey?: keyof T;
package/dist/index.js CHANGED
@@ -4066,7 +4066,7 @@ var ColorPicker = function(_param) {
4066
4066
  };
4067
4067
  // components/elements/Input.tsx
4068
4068
  var import_react15 = __toESM(require("react"));
4069
- var Input = function(_param) {
4069
+ var Input = (0, import_react15.forwardRef)(function(_param, ref) {
4070
4070
  var _param_margin = _param.margin, margin = _param_margin === void 0 ? "none" : _param_margin, _param_width = _param.width, width = _param_width === void 0 ? "full" : _param_width, _param_preview = _param.preview, preview = _param_preview === void 0 ? false : _param_preview, _param_forceHideHelperText = _param.forceHideHelperText, forceHideHelperText = _param_forceHideHelperText === void 0 ? false : _param_forceHideHelperText, props = _object_without_properties(_param, [
4071
4071
  "margin",
4072
4072
  "width",
@@ -4123,7 +4123,7 @@ var Input = function(_param) {
4123
4123
  })), !forceHideHelperText && /* @__PURE__ */ import_react15.default.createElement("p", {
4124
4124
  className: cn("hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start", props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0")
4125
4125
  }, props.helperText))));
4126
- };
4126
+ });
4127
4127
  // components/elements/Combobox.tsx
4128
4128
  var React28 = __toESM(require("react"));
4129
4129
  var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"));
@@ -5678,13 +5678,16 @@ var TableHeader = React44.forwardRef(function(_param, ref) /* @__PURE__ */ {
5678
5678
  });
5679
5679
  TableHeader.displayName = "TableHeader";
5680
5680
  var TableHead = React44.forwardRef(function(_param, ref) /* @__PURE__ */ {
5681
- var className = _param.className, props = _object_without_properties(_param, [
5682
- "className"
5681
+ var className = _param.className, condensed = _param.condensed, clickable = _param.clickable, dir = _param.dir, props = _object_without_properties(_param, [
5682
+ "className",
5683
+ "condensed",
5684
+ "clickable",
5685
+ "dir"
5683
5686
  ]);
5684
5687
  return React44.createElement("th", _object_spread({
5685
5688
  ref: ref,
5686
- className: cn("hawa-bg-muted/60 dark:hawa-bg-muted/40 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x", props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r", props.condensed ? "hawa-h-8" : "hawa-h-12", props.clickable ? "hawa-px-1" : "hawa-px-4", //First and last columns
5687
- props.clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4", //Columns in between
5689
+ className: cn("hawa-bg-muted/60 dark:hawa-bg-muted/40 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x", dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r", condensed ? "hawa-h-8" : "hawa-h-12", clickable ? "hawa-px-1" : "hawa-px-4", //First and last columns
5690
+ clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4", //Columns in between
5688
5691
  className)
5689
5692
  }, props));
5690
5693
  });
@@ -5763,12 +5766,12 @@ var DataTable = function(_param) {
5763
5766
  "enableGoTo"
5764
5767
  ]);
5765
5768
  var _props_texts, _props_itemsPerPage, _props_texts1, _props_texts2, _table_getRowModel_rows, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8;
5766
- var _React45_useState = _sliced_to_array(React45.useState([
5769
+ var _React45_useState = _sliced_to_array(React45.useState(props.defaultSort ? [
5767
5770
  {
5768
- id: props.defaultSort || "",
5771
+ id: props.defaultSort,
5769
5772
  desc: false
5770
5773
  }
5771
- ]), 2), sorting = _React45_useState[0], setSorting = _React45_useState[1];
5774
+ ] : []), 2), sorting = _React45_useState[0], setSorting = _React45_useState[1];
5772
5775
  var _React45_useState1 = _sliced_to_array(React45.useState([]), 2), columnFilters = _React45_useState1[0], setColumnFilters = _React45_useState1[1];
5773
5776
  var _React45_useState2 = _sliced_to_array(React45.useState(""), 2), globalFilter = _React45_useState2[0], setGlobalFilter = _React45_useState2[1];
5774
5777
  var _React45_useState3 = _sliced_to_array(React45.useState({}), 2), expanded = _React45_useState3[0], setExpanded = _React45_useState3[1];
package/dist/index.mjs CHANGED
@@ -3442,90 +3442,92 @@ var ColorPicker = ({
3442
3442
  };
3443
3443
 
3444
3444
  // components/elements/Input.tsx
3445
- import React24 from "react";
3446
- var Input = ({
3447
- margin = "none",
3448
- width = "full",
3449
- preview = false,
3450
- forceHideHelperText = false,
3451
- ...props
3452
- }) => {
3453
- let marginStyles = {
3454
- none: "hawa-mb-0",
3455
- normal: "hawa-mb-3",
3456
- large: "hawa-mb-5"
3457
- };
3458
- let widthStyles = {
3459
- small: "hawa-w-full hawa-max-w-2xs",
3460
- normal: "hawa-w-1/2",
3461
- full: "hawa-w-full",
3462
- auto: ""
3463
- };
3464
- let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
3465
- let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
3466
- return /* @__PURE__ */ React24.createElement(
3467
- "div",
3468
- {
3469
- className: cn(
3470
- defaultStyle,
3471
- marginStyles[margin],
3472
- widthStyles[width],
3473
- props.containerClassName,
3474
- "hawa-w-full hawa-gap-2"
3475
- )
3476
- },
3477
- props.label && /* @__PURE__ */ React24.createElement(
3478
- Label2,
3479
- {
3480
- htmlFor: props.id,
3481
- hint: props.hint,
3482
- hintSide: props.hintSide,
3483
- required: props.isRequired
3484
- },
3485
- props.label
3486
- ),
3487
- props.isLoading ? /* @__PURE__ */ React24.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React24.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
3445
+ import React24, { forwardRef as forwardRef9 } from "react";
3446
+ var Input = forwardRef9(
3447
+ ({
3448
+ margin = "none",
3449
+ width = "full",
3450
+ preview = false,
3451
+ forceHideHelperText = false,
3452
+ ...props
3453
+ }, ref) => {
3454
+ let marginStyles = {
3455
+ none: "hawa-mb-0",
3456
+ normal: "hawa-mb-3",
3457
+ large: "hawa-mb-5"
3458
+ };
3459
+ let widthStyles = {
3460
+ small: "hawa-w-full hawa-max-w-2xs",
3461
+ normal: "hawa-w-1/2",
3462
+ full: "hawa-w-full",
3463
+ auto: ""
3464
+ };
3465
+ let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
3466
+ let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
3467
+ return /* @__PURE__ */ React24.createElement(
3488
3468
  "div",
3489
3469
  {
3490
3470
  className: cn(
3491
- "hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
3492
- preview ? "hawa-opacity-100" : "hawa-opacity-0"
3493
- )
3494
- }
3495
- ), /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", { className: cn("hawa-relative") }, props.startIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.endIcon), /* @__PURE__ */ React24.createElement(
3496
- "input",
3497
- {
3498
- required: true,
3499
- dir: props.dir,
3500
- type: props.type,
3501
- value: props.value,
3502
- onChange: props.onChange,
3503
- autoComplete: props.autoComplete,
3504
- defaultValue: props.defaultValue,
3505
- placeholder: props.placeholder,
3506
- disabled: preview,
3507
- style: { height: 40 },
3508
- className: cn(
3509
- defaultInputStyle,
3510
- " dark:hawa-text-white focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0",
3511
- props.endIcon && "hawa-pe-9",
3512
- props.startIcon && "hawa-ps-9",
3513
- preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
3514
- props.inputProps?.className
3515
- )
3516
- }
3517
- )), !forceHideHelperText && /* @__PURE__ */ React24.createElement(
3518
- "p",
3519
- {
3520
- className: cn(
3521
- "hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start",
3522
- props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
3471
+ defaultStyle,
3472
+ marginStyles[margin],
3473
+ widthStyles[width],
3474
+ props.containerClassName,
3475
+ "hawa-w-full hawa-gap-2"
3523
3476
  )
3524
3477
  },
3525
- props.helperText
3526
- )))
3527
- );
3528
- };
3478
+ props.label && /* @__PURE__ */ React24.createElement(
3479
+ Label2,
3480
+ {
3481
+ htmlFor: props.id,
3482
+ hint: props.hint,
3483
+ hintSide: props.hintSide,
3484
+ required: props.isRequired
3485
+ },
3486
+ props.label
3487
+ ),
3488
+ props.isLoading ? /* @__PURE__ */ React24.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React24.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
3489
+ "div",
3490
+ {
3491
+ className: cn(
3492
+ "hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800",
3493
+ preview ? "hawa-opacity-100" : "hawa-opacity-0"
3494
+ )
3495
+ }
3496
+ ), /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", { className: cn("hawa-relative") }, props.startIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-start-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.startIcon), props.endIcon && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-end-3 hawa-top-1/2 hawa--translate-y-1/2" }, props.endIcon), /* @__PURE__ */ React24.createElement(
3497
+ "input",
3498
+ {
3499
+ required: true,
3500
+ dir: props.dir,
3501
+ type: props.type,
3502
+ value: props.value,
3503
+ onChange: props.onChange,
3504
+ autoComplete: props.autoComplete,
3505
+ defaultValue: props.defaultValue,
3506
+ placeholder: props.placeholder,
3507
+ disabled: preview,
3508
+ style: { height: 40 },
3509
+ className: cn(
3510
+ defaultInputStyle,
3511
+ " dark:hawa-text-white focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0",
3512
+ props.endIcon && "hawa-pe-9",
3513
+ props.startIcon && "hawa-ps-9",
3514
+ preview && "hawa-border-transparent hawa-bg-transparent hawa-px-0",
3515
+ props.inputProps?.className
3516
+ )
3517
+ }
3518
+ )), !forceHideHelperText && /* @__PURE__ */ React24.createElement(
3519
+ "p",
3520
+ {
3521
+ className: cn(
3522
+ "hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all hawa-text-start",
3523
+ props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0"
3524
+ )
3525
+ },
3526
+ props.helperText
3527
+ )))
3528
+ );
3529
+ }
3530
+ );
3529
3531
 
3530
3532
  // components/elements/Combobox.tsx
3531
3533
  import * as React28 from "react";
@@ -5365,17 +5367,17 @@ var TableHeader = React44.forwardRef(({ className, ...props }, ref) => /* @__PUR
5365
5367
  ));
5366
5368
  TableHeader.displayName = "TableHeader";
5367
5369
  var TableHead = React44.forwardRef(
5368
- ({ className, ...props }, ref) => /* @__PURE__ */ React44.createElement(
5370
+ ({ className, condensed, clickable, dir, ...props }, ref) => /* @__PURE__ */ React44.createElement(
5369
5371
  "th",
5370
5372
  {
5371
5373
  ref,
5372
5374
  className: cn(
5373
5375
  "hawa-bg-muted/60 dark:hawa-bg-muted/40 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x",
5374
- props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
5375
- props.condensed ? "hawa-h-8" : "hawa-h-12",
5376
- props.clickable ? "hawa-px-1" : "hawa-px-4",
5376
+ dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r",
5377
+ condensed ? "hawa-h-8" : "hawa-h-12",
5378
+ clickable ? "hawa-px-1" : "hawa-px-4",
5377
5379
  //First and last columns
5378
- props.clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
5380
+ clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4",
5379
5381
  //Columns in between
5380
5382
  className
5381
5383
  ),
@@ -5465,9 +5467,9 @@ var DataTable = ({
5465
5467
  enableGoTo,
5466
5468
  ...props
5467
5469
  }) => {
5468
- const [sorting, setSorting] = React45.useState([
5469
- { id: props.defaultSort || "", desc: false }
5470
- ]);
5470
+ const [sorting, setSorting] = React45.useState(
5471
+ props.defaultSort ? [{ id: props.defaultSort, desc: false }] : []
5472
+ );
5471
5473
  const [columnFilters, setColumnFilters] = React45.useState(
5472
5474
  []
5473
5475
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.16.10-next",
3
+ "version": "0.16.12-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {