@sikka/hawa 0.8.17-next → 0.9.1-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.css CHANGED
@@ -1098,8 +1098,8 @@ input[type="number"]::-webkit-inner-spin-button,
1098
1098
  .hawa-h-\[37\.5px\] {
1099
1099
  height: 37.5px;
1100
1100
  }
1101
- .hawa-h-\[38px\] {
1102
- height: 38px;
1101
+ .hawa-h-\[40px\] {
1102
+ height: 40px;
1103
1103
  }
1104
1104
  .hawa-h-\[44px\] {
1105
1105
  height: 44px;
package/dist/index.d.mts CHANGED
@@ -649,7 +649,7 @@ declare const CommandShortcut: {
649
649
  displayName: string;
650
650
  };
651
651
 
652
- declare function Combobox(): React$1.JSX.Element;
652
+ declare function Combobox(props: any): React$1.JSX.Element;
653
653
 
654
654
  type SelectOptionProps = {
655
655
  value: any;
package/dist/index.d.ts CHANGED
@@ -649,7 +649,7 @@ declare const CommandShortcut: {
649
649
  displayName: string;
650
650
  };
651
651
 
652
- declare function Combobox(): React$1.JSX.Element;
652
+ declare function Combobox(props: any): React$1.JSX.Element;
653
653
 
654
654
  type SelectOptionProps = {
655
655
  value: any;
package/dist/index.js CHANGED
@@ -4517,15 +4517,13 @@ var Select = function(props) {
4517
4517
  return /* @__PURE__ */ import_react18.default.createElement("div", {
4518
4518
  className: cn("hawa-flex hawa-flex-col hawa-gap-2", props.width === "fit" ? "hawa-w-fit" : "hawa-w-full")
4519
4519
  }, props.label && /* @__PURE__ */ import_react18.default.createElement(Label2, null, props.label), props.isLoading ? /* @__PURE__ */ import_react18.default.createElement(Skeleton, {
4520
- className: "hawa-h-[38px] hawa-w-full"
4520
+ className: "hawa-h-[40px] hawa-w-full"
4521
4521
  }) : !props.isCreatable ? // TODO: enable keyboard to go to the next item in the list
4522
4522
  /* @__PURE__ */ import_react18.default.createElement(import_react_select.default, {
4523
4523
  noOptionsMessage: NoOption,
4524
4524
  classNames: {
4525
4525
  control: function() {
4526
- return cn(// "hawa-text-sm hawa-flex hawa-w-full hawa-rounded hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500 hawa-cursor-pointer hawa-border",
4527
- // "hawa-p-2",
4528
- props.phoneCode && "hawa-rounded-r-none", props.controlClassNames);
4526
+ return cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames);
4529
4527
  },
4530
4528
  container: function() {
4531
4529
  return cn("hawa-rounded", props.phoneCode && "hawa-w-fit hawa-min-w-[65px] hawa-text-right hawa-w-[100px] hawa-p-0 hawa-rounded-r-none hawa-h-[37.5px] ", "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-0 hawa-px-1 hawa-text-sm", props.disabled ? "hawa-cursor-not-allowed" : "hawa-cursor-pointer");
@@ -4544,17 +4542,7 @@ var Select = function(props) {
4544
4542
  }
4545
4543
  },
4546
4544
  unstyled: true,
4547
- isDisabled: props.disabled,
4548
- options: props.options,
4549
- defaultValue: props.defaultValue,
4550
- isClearable: props.isClearable,
4551
- isMulti: props.isMulti,
4552
- isSearchable: props.isSearchable,
4553
- placeholder: props.placeholder,
4554
4545
  autoFocus: true,
4555
- onChange: function(newValue, action) {
4556
- return props.onChange(newValue, action);
4557
- },
4558
4546
  components: props.hideIndicator ? {
4559
4547
  Option: Option,
4560
4548
  Menu: Menu,
@@ -4565,6 +4553,16 @@ var Select = function(props) {
4565
4553
  Option: Option,
4566
4554
  Menu: Menu
4567
4555
  },
4556
+ onChange: function(newValue, action) {
4557
+ return props.onChange(newValue, action);
4558
+ },
4559
+ isDisabled: props.disabled,
4560
+ options: props.options,
4561
+ defaultValue: props.defaultValue,
4562
+ isClearable: props.isClearable,
4563
+ isMulti: props.isMulti,
4564
+ isSearchable: props.isSearchable,
4565
+ placeholder: props.placeholder,
4568
4566
  getOptionLabel: props.getOptionLabel
4569
4567
  }) : /* @__PURE__ */ import_react18.default.createElement(import_creatable.default, {
4570
4568
  formatCreateLabel: function(inputValue) {
@@ -4894,7 +4892,7 @@ var Input = function(_param) {
4894
4892
  return /* @__PURE__ */ import_react22.default.createElement("div", {
4895
4893
  className: cn(defaultStyle, marginStyles[margin], widthStyles[width], props.containerClassName, "hawa-w-full hawa-gap-2")
4896
4894
  }, props.label && /* @__PURE__ */ import_react22.default.createElement(Label2, null, props.label), props.isLoading ? /* @__PURE__ */ import_react22.default.createElement(Skeleton, {
4897
- className: "hawa-h-[38px] hawa-w-full"
4895
+ className: "hawa-h-[40px] hawa-w-full"
4898
4896
  }) : /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement("div", {
4899
4897
  className: cn("hawa-absolute hawa-top-[22px] hawa-h-[0.8px] hawa-w-full hawa-bg-gray-200 hawa-transition-all dark:hawa-bg-gray-800", preview ? "hawa-opacity-100" : "hawa-opacity-0")
4900
4898
  }), /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement("div", {
@@ -4909,11 +4907,14 @@ var Input = function(_param) {
4909
4907
  defaultValue: props.defaultValue,
4910
4908
  type: props.type,
4911
4909
  placeholder: props.placeholder,
4912
- disabled: preview
4910
+ disabled: preview,
4911
+ style: {
4912
+ height: 40
4913
+ }
4913
4914
  })), props.iconInside && /* @__PURE__ */ import_react22.default.createElement("div", {
4914
4915
  className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2"
4915
4916
  }, props.iconInside), props.helperText && /* @__PURE__ */ import_react22.default.createElement("p", {
4916
- className: "hawa-mb-0 hawa-mt-0 helper-text"
4917
+ className: "hawa-mb-0 hawa-mt-0 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500"
4917
4918
  }, props.helperText))));
4918
4919
  };
4919
4920
  // components/elements/DataTable.tsx
@@ -5962,11 +5963,15 @@ var frameworks = [
5962
5963
  label: "Astro"
5963
5964
  }
5964
5965
  ];
5965
- function Combobox() {
5966
+ function Combobox(props) {
5966
5967
  var _frameworks_find;
5967
5968
  var _React45_useState = _sliced_to_array(React45.useState(false), 2), open = _React45_useState[0], setOpen = _React45_useState[1];
5968
5969
  var _React45_useState1 = _sliced_to_array(React45.useState(""), 2), value = _React45_useState1[0], setValue = _React45_useState1[1];
5969
- return /* @__PURE__ */ React45.createElement(PopoverPrimitive2.Root, {
5970
+ return /* @__PURE__ */ React45.createElement("div", {
5971
+ className: cn("hawa-flex hawa-flex-col hawa-gap-2", props.width === "fit" ? "hawa-w-fit" : "hawa-w-full")
5972
+ }, props.label && /* @__PURE__ */ React45.createElement(Label2, null, props.label), props.isLoading ? /* @__PURE__ */ React45.createElement(Skeleton, {
5973
+ className: "hawa-h-[40px] hawa-w-full"
5974
+ }) : /* @__PURE__ */ React45.createElement(PopoverPrimitive2.Root, {
5970
5975
  open: open,
5971
5976
  onOpenChange: setOpen
5972
5977
  }, /* @__PURE__ */ React45.createElement(PopoverTrigger, {
@@ -6018,7 +6023,7 @@ function Combobox() {
6018
6023
  }, /* @__PURE__ */ React45.createElement("polyline", {
6019
6024
  points: "20 6 9 17 4 12"
6020
6025
  })), framework.label);
6021
- })))));
6026
+ }))))));
6022
6027
  }
6023
6028
  // components/elements/Count.tsx
6024
6029
  var import_react29 = __toESM(require("react"));
package/dist/index.mjs CHANGED
@@ -4168,7 +4168,7 @@ var Select = (props) => {
4168
4168
  )
4169
4169
  },
4170
4170
  props.label && /* @__PURE__ */ React29.createElement(Label2, null, props.label),
4171
- props.isLoading ? /* @__PURE__ */ React29.createElement(Skeleton, { className: "hawa-h-[38px] hawa-w-full" }) : !props.isCreatable ? (
4171
+ props.isLoading ? /* @__PURE__ */ React29.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
4172
4172
  // TODO: enable keyboard to go to the next item in the list
4173
4173
  /* @__PURE__ */ React29.createElement(
4174
4174
  ReactSelect,
@@ -4176,8 +4176,6 @@ var Select = (props) => {
4176
4176
  noOptionsMessage: NoOption,
4177
4177
  classNames: {
4178
4178
  control: () => cn(
4179
- // "hawa-text-sm hawa-flex hawa-w-full hawa-rounded hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500 hawa-cursor-pointer hawa-border",
4180
- // "hawa-p-2",
4181
4179
  props.phoneCode && "hawa-rounded-r-none",
4182
4180
  props.controlClassNames
4183
4181
  ),
@@ -4196,6 +4194,9 @@ var Select = (props) => {
4196
4194
  )
4197
4195
  },
4198
4196
  unstyled: true,
4197
+ autoFocus: true,
4198
+ components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : { Option, Menu },
4199
+ onChange: (newValue, action) => props.onChange(newValue, action),
4199
4200
  isDisabled: props.disabled,
4200
4201
  options: props.options,
4201
4202
  defaultValue: props.defaultValue,
@@ -4203,17 +4204,6 @@ var Select = (props) => {
4203
4204
  isMulti: props.isMulti,
4204
4205
  isSearchable: props.isSearchable,
4205
4206
  placeholder: props.placeholder,
4206
- autoFocus: true,
4207
- onChange: (newValue, action) => props.onChange(newValue, action),
4208
- components: props.hideIndicator ? {
4209
- Option,
4210
- Menu,
4211
- IndicatorsContainer: () => null
4212
- // Set to null if phoneCode is true, otherwise undefined
4213
- } : {
4214
- Option,
4215
- Menu
4216
- },
4217
4207
  getOptionLabel: props.getOptionLabel
4218
4208
  }
4219
4209
  )
@@ -4565,7 +4555,7 @@ var Input = ({
4565
4555
  )
4566
4556
  },
4567
4557
  props.label && /* @__PURE__ */ React34.createElement(Label2, null, props.label),
4568
- props.isLoading ? /* @__PURE__ */ React34.createElement(Skeleton, { className: "hawa-h-[38px] hawa-w-full" }) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(
4558
+ props.isLoading ? /* @__PURE__ */ React34.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(
4569
4559
  "div",
4570
4560
  {
4571
4561
  className: cn(
@@ -4590,9 +4580,10 @@ var Input = ({
4590
4580
  defaultValue: props.defaultValue,
4591
4581
  type: props.type,
4592
4582
  placeholder: props.placeholder,
4593
- disabled: preview
4583
+ disabled: preview,
4584
+ style: { height: 40 }
4594
4585
  }
4595
- )), props.iconInside && /* @__PURE__ */ React34.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), props.helperText && /* @__PURE__ */ React34.createElement("p", { className: "hawa-mb-0 hawa-mt-0 helper-text" }, props.helperText)))
4586
+ )), props.iconInside && /* @__PURE__ */ React34.createElement("div", { className: "hawa-absolute hawa-right-1 hawa-top-[41px] hawa--translate-y-1/2" }, props.iconInside), props.helperText && /* @__PURE__ */ React34.createElement("p", { className: "hawa-mb-0 hawa-mt-0 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500" }, props.helperText)))
4596
4587
  );
4597
4588
  };
4598
4589
 
@@ -5682,65 +5673,75 @@ var frameworks = [
5682
5673
  label: "Astro"
5683
5674
  }
5684
5675
  ];
5685
- function Combobox() {
5676
+ function Combobox(props) {
5686
5677
  const [open, setOpen] = React45.useState(false);
5687
5678
  const [value, setValue] = React45.useState("");
5688
- return /* @__PURE__ */ React45.createElement(PopoverPrimitive2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React45.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React45.createElement(
5689
- Button,
5679
+ return /* @__PURE__ */ React45.createElement(
5680
+ "div",
5690
5681
  {
5691
- variant: "outline",
5692
- role: "combobox",
5693
- "aria-expanded": open,
5694
- className: "hawa-w-[200px] hawa-justify-between"
5682
+ className: cn(
5683
+ "hawa-flex hawa-flex-col hawa-gap-2",
5684
+ props.width === "fit" ? "hawa-w-fit" : "hawa-w-full"
5685
+ )
5695
5686
  },
5696
- value ? frameworks.find((framework) => framework.value === value)?.label : "Select framework...",
5697
- /* @__PURE__ */ React45.createElement(
5698
- "svg",
5687
+ props.label && /* @__PURE__ */ React45.createElement(Label2, null, props.label),
5688
+ props.isLoading ? /* @__PURE__ */ React45.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : /* @__PURE__ */ React45.createElement(PopoverPrimitive2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React45.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React45.createElement(
5689
+ Button,
5699
5690
  {
5700
- xmlns: "http://www.w3.org/2000/svg",
5701
- width: "24",
5702
- height: "24",
5703
- viewBox: "0 0 24 24",
5704
- fill: "none",
5705
- stroke: "currentColor",
5706
- strokeWidth: "2",
5707
- strokeLinecap: "round",
5708
- strokeLinejoin: "round",
5709
- className: "hawa-ml-2 hawa-h-4 hawa-w-4 hawa-shrink-0 hawa-opacity-50"
5691
+ variant: "outline",
5692
+ role: "combobox",
5693
+ "aria-expanded": open,
5694
+ className: "hawa-w-[200px] hawa-justify-between"
5710
5695
  },
5711
- /* @__PURE__ */ React45.createElement("path", { d: "m7 15 5 5 5-5" }),
5712
- /* @__PURE__ */ React45.createElement("path", { d: "m7 9 5-5 5 5" })
5713
- )
5714
- )), /* @__PURE__ */ React45.createElement(PopoverContent, { className: "hawa-w-[200px] hawa-p-0" }, /* @__PURE__ */ React45.createElement(Command, null, /* @__PURE__ */ React45.createElement(CommandInput, { placeholder: "Search framework..." }), /* @__PURE__ */ React45.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React45.createElement(CommandGroup, null, frameworks.map((framework) => /* @__PURE__ */ React45.createElement(
5715
- CommandItem,
5716
- {
5717
- key: framework.value,
5718
- onSelect: (currentValue) => {
5719
- setValue(currentValue === value ? "" : currentValue);
5720
- setOpen(false);
5721
- }
5722
- },
5723
- /* @__PURE__ */ React45.createElement(
5724
- "svg",
5696
+ value ? frameworks.find((framework) => framework.value === value)?.label : "Select framework...",
5697
+ /* @__PURE__ */ React45.createElement(
5698
+ "svg",
5699
+ {
5700
+ xmlns: "http://www.w3.org/2000/svg",
5701
+ width: "24",
5702
+ height: "24",
5703
+ viewBox: "0 0 24 24",
5704
+ fill: "none",
5705
+ stroke: "currentColor",
5706
+ strokeWidth: "2",
5707
+ strokeLinecap: "round",
5708
+ strokeLinejoin: "round",
5709
+ className: "hawa-ml-2 hawa-h-4 hawa-w-4 hawa-shrink-0 hawa-opacity-50"
5710
+ },
5711
+ /* @__PURE__ */ React45.createElement("path", { d: "m7 15 5 5 5-5" }),
5712
+ /* @__PURE__ */ React45.createElement("path", { d: "m7 9 5-5 5 5" })
5713
+ )
5714
+ )), /* @__PURE__ */ React45.createElement(PopoverContent, { className: "hawa-w-[200px] hawa-p-0" }, /* @__PURE__ */ React45.createElement(Command, null, /* @__PURE__ */ React45.createElement(CommandInput, { placeholder: "Search framework..." }), /* @__PURE__ */ React45.createElement(CommandEmpty, null, "No framework found."), /* @__PURE__ */ React45.createElement(CommandGroup, null, frameworks.map((framework) => /* @__PURE__ */ React45.createElement(
5715
+ CommandItem,
5725
5716
  {
5726
- xmlns: "http://www.w3.org/2000/svg",
5727
- width: "24",
5728
- height: "24",
5729
- viewBox: "0 0 24 24",
5730
- fill: "none",
5731
- stroke: "currentColor",
5732
- strokeWidth: "2",
5733
- strokeLinecap: "round",
5734
- strokeLinejoin: "round",
5735
- className: cn(
5736
- "hawa-mr-2 hawa-h-4 hawa-w-4",
5737
- value === framework.value ? "hawa-opacity-100" : "hawa-opacity-0"
5738
- )
5717
+ key: framework.value,
5718
+ onSelect: (currentValue) => {
5719
+ setValue(currentValue === value ? "" : currentValue);
5720
+ setOpen(false);
5721
+ }
5739
5722
  },
5740
- /* @__PURE__ */ React45.createElement("polyline", { points: "20 6 9 17 4 12" })
5741
- ),
5742
- framework.label
5743
- ))))));
5723
+ /* @__PURE__ */ React45.createElement(
5724
+ "svg",
5725
+ {
5726
+ xmlns: "http://www.w3.org/2000/svg",
5727
+ width: "24",
5728
+ height: "24",
5729
+ viewBox: "0 0 24 24",
5730
+ fill: "none",
5731
+ stroke: "currentColor",
5732
+ strokeWidth: "2",
5733
+ strokeLinecap: "round",
5734
+ strokeLinejoin: "round",
5735
+ className: cn(
5736
+ "hawa-mr-2 hawa-h-4 hawa-w-4",
5737
+ value === framework.value ? "hawa-opacity-100" : "hawa-opacity-0"
5738
+ )
5739
+ },
5740
+ /* @__PURE__ */ React45.createElement("polyline", { points: "20 6 9 17 4 12" })
5741
+ ),
5742
+ framework.label
5743
+ ))))))
5744
+ );
5744
5745
  }
5745
5746
 
5746
5747
  // components/elements/Count.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.8.17-next",
3
+ "version": "0.9.1-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {