@sikka/hawa 0.46.4-next → 0.48.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 (55) hide show
  1. package/dist/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
  2. package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
  3. package/dist/blocks/auth/index.d.mts +34 -17
  4. package/dist/blocks/auth/index.d.ts +34 -17
  5. package/dist/blocks/auth/index.js +1008 -430
  6. package/dist/blocks/auth/index.mjs +427 -297
  7. package/dist/blocks/feedback/index.d.mts +1 -1
  8. package/dist/blocks/feedback/index.d.ts +1 -1
  9. package/dist/blocks/feedback/index.js +68 -79
  10. package/dist/blocks/feedback/index.mjs +1 -1
  11. package/dist/blocks/index.d.mts +28 -11
  12. package/dist/blocks/index.d.ts +28 -11
  13. package/dist/blocks/index.js +2340 -2233
  14. package/dist/blocks/index.mjs +407 -269
  15. package/dist/blocks/misc/index.d.mts +1 -1
  16. package/dist/blocks/misc/index.d.ts +1 -1
  17. package/dist/blocks/misc/index.js +68 -79
  18. package/dist/blocks/misc/index.mjs +50 -367
  19. package/dist/blocks/pricing/index.d.mts +1 -1
  20. package/dist/blocks/pricing/index.d.ts +1 -1
  21. package/dist/blocks/pricing/index.mjs +1 -1
  22. package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
  23. package/dist/{chunk-5CTMGPEF.mjs → chunk-GBLWUEYN.mjs} +650 -674
  24. package/dist/chunk-JFWD2ICY.mjs +511 -0
  25. package/dist/elements/index.d.mts +2 -2
  26. package/dist/elements/index.d.ts +2 -2
  27. package/dist/elements/index.js +81 -105
  28. package/dist/elements/index.mjs +1 -1
  29. package/dist/index.css +7 -0
  30. package/dist/index.d.mts +36 -17
  31. package/dist/index.d.ts +36 -17
  32. package/dist/index.js +482 -373
  33. package/dist/index.mjs +487 -373
  34. package/dist/phoneInput/index.d.mts +7 -7
  35. package/dist/phoneInput/index.d.ts +7 -7
  36. package/dist/phoneInput/index.js +78 -85
  37. package/dist/phoneInput/index.js.map +1 -1
  38. package/dist/phoneInput/index.mjs +78 -85
  39. package/dist/phoneInput/index.mjs.map +1 -1
  40. package/dist/pinInput/index.js +3 -20
  41. package/dist/pinInput/index.js.map +1 -1
  42. package/dist/pinInput/index.mjs +3 -20
  43. package/dist/pinInput/index.mjs.map +1 -1
  44. package/dist/select/index.d.mts +1 -0
  45. package/dist/select/index.d.ts +1 -0
  46. package/dist/select/index.js +68 -79
  47. package/dist/select/index.js.map +1 -1
  48. package/dist/select/index.mjs +68 -79
  49. package/dist/select/index.mjs.map +1 -1
  50. package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
  51. package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
  52. package/dist/types/index.d.mts +1 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/package.json +1 -1
  55. package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -1,6 +1,6 @@
1
1
  import React__default, { FC } from 'react';
2
2
  import { PopoverContentProps } from '@radix-ui/react-popover';
3
- import { D as DirectionType, B as BaseInputType } from '../../textTypes-DXLtO2fL.mjs';
3
+ import { D as DirectionType, B as BaseInputType } from '../../textTypes-CYQYIsFt.mjs';
4
4
 
5
5
  type RadioOptionsTypes = {
6
6
  value: any;
@@ -1,6 +1,6 @@
1
1
  import React__default, { FC } from 'react';
2
2
  import { PopoverContentProps } from '@radix-ui/react-popover';
3
- import { D as DirectionType, B as BaseInputType } from '../../textTypes-DXLtO2fL.js';
3
+ import { D as DirectionType, B as BaseInputType } from '../../textTypes-CYQYIsFt.js';
4
4
 
5
5
  type RadioOptionsTypes = {
6
6
  value: any;
@@ -1528,6 +1528,7 @@ var import_clsx2 = __toESM(require("clsx"));
1528
1528
  var Select = ({
1529
1529
  labelProps,
1530
1530
  labelKey = "label",
1531
+ valueKey = "value",
1531
1532
  ...props
1532
1533
  }) => {
1533
1534
  const NoOption = () => {
@@ -1547,13 +1548,7 @@ var Select = ({
1547
1548
  children
1548
1549
  );
1549
1550
  };
1550
- const Option = ({
1551
- children,
1552
- innerProps,
1553
- innerRef,
1554
- isFocused,
1555
- isSelected
1556
- }) => {
1551
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
1557
1552
  return /* @__PURE__ */ import_react12.default.createElement(
1558
1553
  "div",
1559
1554
  {
@@ -1568,14 +1563,7 @@ var Select = ({
1568
1563
  children
1569
1564
  );
1570
1565
  };
1571
- const Menu = ({
1572
- cx,
1573
- children,
1574
- getStyles,
1575
- innerProps,
1576
- innerRef,
1577
- ...menuProps
1578
- }) => {
1566
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
1579
1567
  const menuOpen = menuProps.selectProps.menuIsOpen;
1580
1568
  return /* @__PURE__ */ import_react12.default.createElement(
1581
1569
  "div",
@@ -1604,71 +1592,72 @@ var Select = ({
1604
1592
  )
1605
1593
  },
1606
1594
  props.label && /* @__PURE__ */ import_react12.default.createElement(Label, { ...labelProps }, props.label),
1607
- props.isLoading ? /* @__PURE__ */ import_react12.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
1608
- // TODO: enable keyboard to go to the next item in the list
1609
- /* @__PURE__ */ import_react12.default.createElement(
1610
- import_react_select.default,
1611
- {
1612
- noOptionsMessage: NoOption,
1613
- classNames: {
1614
- control: () => cn(
1615
- props.phoneCode && "hawa-rounded-r-none",
1616
- props.controlClassNames
1617
- ),
1618
- container: () => cn(
1619
- selectContainerStyles,
1620
- props.phoneCode && phoneCodeStyles,
1621
- props.isMulti && "hawa-ps-0 "
1622
- ),
1623
- placeholder: () => cn(
1624
- selectPlaceholderStyles,
1625
- props.disabled && "hawa-text-muted-foreground"
1626
- ),
1627
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
1628
- singleValue: () => cn(
1629
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1630
- ),
1631
- indicatorsContainer: () => cn(
1632
- selectIndicatorContainerStyles,
1633
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1634
- props.disabled && "hawa-opacity-30"
1635
- )
1636
- },
1637
- unstyled: true,
1638
- autoFocus: false,
1639
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
1595
+ props.isLoading ? /* @__PURE__ */ import_react12.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react12.default.createElement(
1596
+ import_react_select.default,
1597
+ {
1598
+ noOptionsMessage: NoOption,
1599
+ classNames: {
1600
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
1601
+ container: () => cn(
1602
+ selectContainerStyles,
1603
+ props.phoneCode && phoneCodeStyles,
1604
+ props.isMulti && "hawa-ps-0 "
1605
+ ),
1606
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
1607
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
1608
+ singleValue: () => cn(
1609
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
1610
+ ),
1611
+ indicatorsContainer: () => cn(
1612
+ selectIndicatorContainerStyles,
1613
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
1614
+ props.disabled && "hawa-opacity-30"
1615
+ )
1616
+ },
1617
+ unstyled: true,
1618
+ autoFocus: false,
1619
+ components: props.hideIndicator ? {
1620
+ Option: (optionProps) => /* @__PURE__ */ import_react12.default.createElement(
1640
1621
  Option,
1641
- Menu,
1642
- ValueContainer: (e) => /* @__PURE__ */ import_react12.default.createElement(
1643
- "div",
1644
- {
1645
- className: cn(
1646
- e.className,
1647
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
1648
- ),
1649
- ...e
1650
- }
1651
- ),
1652
- MultiValueContainer: (e) => /* @__PURE__ */ import_react12.default.createElement(
1653
- "div",
1654
- {
1655
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
1656
- ...e
1657
- }
1658
- )
1659
- },
1660
- onChange: (newValue, action) => props.onChange(newValue, action),
1661
- options: props.options,
1662
- getOptionLabel: props.getOptionLabel,
1663
- defaultValue: props.defaultValue,
1664
- value: props.value,
1665
- placeholder: props.placeholder,
1666
- isDisabled: props.disabled,
1667
- isClearable: props.isClearable,
1668
- isMulti: props.isMulti,
1669
- isSearchable: props.isSearchable
1670
- }
1671
- )
1622
+ {
1623
+ ...optionProps,
1624
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
1625
+ }
1626
+ ),
1627
+ Menu,
1628
+ IndicatorsContainer: () => null
1629
+ } : {
1630
+ Option,
1631
+ Menu,
1632
+ ValueContainer: (e) => /* @__PURE__ */ import_react12.default.createElement(
1633
+ "div",
1634
+ {
1635
+ className: cn(
1636
+ e.className,
1637
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
1638
+ ),
1639
+ ...e
1640
+ }
1641
+ ),
1642
+ MultiValueContainer: (e) => /* @__PURE__ */ import_react12.default.createElement(
1643
+ "div",
1644
+ {
1645
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
1646
+ ...e
1647
+ }
1648
+ )
1649
+ },
1650
+ onChange: (newValue, action) => props.onChange(newValue, action),
1651
+ options: props.options,
1652
+ getOptionLabel: props.getOptionLabel,
1653
+ defaultValue: props.defaultValue,
1654
+ value: props.value,
1655
+ placeholder: props.placeholder,
1656
+ isDisabled: props.disabled,
1657
+ isClearable: props.isClearable,
1658
+ isMulti: props.isMulti,
1659
+ isSearchable: props.isSearchable
1660
+ }
1672
1661
  ) : /* @__PURE__ */ import_react12.default.createElement(
1673
1662
  import_creatable.default,
1674
1663
  {
@@ -4,7 +4,7 @@ import {
4
4
  } from "../../chunk-5S5DR7KF.mjs";
5
5
  import {
6
6
  Select
7
- } from "../../chunk-6TG2PHZK.mjs";
7
+ } from "../../chunk-AWJSHOYU.mjs";
8
8
  import {
9
9
  Popover,
10
10
  Radio
@@ -1,6 +1,6 @@
1
1
  import React__default, { FC, InputHTMLAttributes } from 'react';
2
2
  import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.mjs';
3
- import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-Dyvlywnk.mjs';
3
+ import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-BPHTeDMz.mjs';
4
4
  import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-C-g8nFFC.mjs';
5
5
  import { M as MenuItemType } from '../DropdownMenu-mK9EvfKp.mjs';
6
6
  import '@radix-ui/react-popover';
@@ -103,11 +103,17 @@ type RegisterFormTypes = {
103
103
  direction?: DirectionType;
104
104
  /** Determines whether to display logos only or with text in the social media registration section. */
105
105
  logosOnly?: boolean;
106
- /** Enables registration via Google when set to true. */
106
+ /** Enables registration via Google when set to true.
107
+ * @default false
108
+ */
107
109
  viaGoogle?: boolean;
108
- /** Enables registration via Github when set to true. */
110
+ /** Enables registration via Github when set to true.
111
+ * @default false
112
+ */
109
113
  viaGithub?: boolean;
110
- /** Enables registration via Twitter when set to true. */
114
+ /** Enables registration via Twitter when set to true.
115
+ * @default false
116
+ */
111
117
  viaTwitter?: boolean;
112
118
  /** Determines whether to show the referral code field. */
113
119
  showRefCode?: boolean;
@@ -129,16 +135,14 @@ type RegisterFormTypes = {
129
135
  onTwitterRegister?: () => void;
130
136
  /** Callback function triggered to route to the Terms of Service page. */
131
137
  onRouteToTOS?: () => void;
132
- /** Determines whether to show an error alert. */
133
- showError?: boolean;
134
138
  /** Callback function triggered when the error alert is dismissed. */
135
139
  onErrorDismissed?: () => void;
140
+ /** Determines whether to show an error alert. */
141
+ showError?: boolean;
136
142
  /** Title for the error alert. */
137
143
  errorTitle?: any;
138
144
  /** Text for the error alert. */
139
145
  errorText?: any;
140
- /** Array containing the fields to be included in the form. */
141
- registerFields?: string[];
142
146
  /** Indicates whether the form submission is in progress. */
143
147
  isLoading?: boolean;
144
148
  /** If true, a loading spinner is displayed within the Google login button. */
@@ -164,8 +168,21 @@ type RegisterFormTypes = {
164
168
  };
165
169
  /** The minimum length of the password input field */
166
170
  minPasswordLength?: number;
167
- /** If true, the form is displayed without a card container styling.*/
171
+ /** If true, the form is displayed without a card container styling.
172
+ * @default false
173
+ */
168
174
  cardless?: boolean;
175
+ /** Array containing the fields to be included in the form. */
176
+ registerFields?: ("fullname" | "email" | "username" | "phone")[];
177
+ /** To show the register form in a different type, either "email" or "phone"
178
+ * @default "email"
179
+ */
180
+ registerTypes?: {
181
+ label: string;
182
+ value: string;
183
+ }[];
184
+ /** Props to pass to the PhoneInput component */
185
+ phoneInputProps?: PhoneInputProps;
169
186
  };
170
187
  declare const RegisterForm: FC<RegisterFormTypes>;
171
188
 
@@ -243,7 +260,7 @@ declare const ResetPasswordForm: FC<ResetPasswordType>;
243
260
 
244
261
  type TConfirmation = {
245
262
  texts?: {
246
- checkYourPhone?: string;
263
+ checkYourIdentifier?: string;
247
264
  weSentCode?: string;
248
265
  didntGetCode?: string;
249
266
  resendCode?: string;
@@ -257,7 +274,7 @@ type TConfirmation = {
257
274
  showError?: any;
258
275
  errorTitle?: any;
259
276
  errorText?: any;
260
- phoneNumber?: string;
277
+ identifier?: string;
261
278
  confirmLoading?: boolean;
262
279
  onConfirm?: any;
263
280
  onResend?: any;
@@ -1,6 +1,6 @@
1
1
  import React__default, { FC, InputHTMLAttributes } from 'react';
2
2
  import { ThirdPartyAuthTextsTypes, LoginFormTextsTypes, RegisterFormTextsTypes, NewPasswordTextsTypes, ResetPasswordTextsTypes, BaseInputType, TextInputType, PricingCardProps, PlanFeature, PricingPlanTexts } from '../types/index.js';
3
- import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-DlPwVCG4.js';
3
+ import { P as PhoneInputProps, S as SelectOptionProps, L as LabelProps, R as RadioOptionsTypes } from '../Radio-cRcIH8_L.js';
4
4
  import { D as DirectionType, a as RadioOptionType, O as OrientationType } from '../commonTypes-C-g8nFFC.js';
5
5
  import { M as MenuItemType } from '../DropdownMenu-CDnFCzfc.js';
6
6
  import '@radix-ui/react-popover';
@@ -103,11 +103,17 @@ type RegisterFormTypes = {
103
103
  direction?: DirectionType;
104
104
  /** Determines whether to display logos only or with text in the social media registration section. */
105
105
  logosOnly?: boolean;
106
- /** Enables registration via Google when set to true. */
106
+ /** Enables registration via Google when set to true.
107
+ * @default false
108
+ */
107
109
  viaGoogle?: boolean;
108
- /** Enables registration via Github when set to true. */
110
+ /** Enables registration via Github when set to true.
111
+ * @default false
112
+ */
109
113
  viaGithub?: boolean;
110
- /** Enables registration via Twitter when set to true. */
114
+ /** Enables registration via Twitter when set to true.
115
+ * @default false
116
+ */
111
117
  viaTwitter?: boolean;
112
118
  /** Determines whether to show the referral code field. */
113
119
  showRefCode?: boolean;
@@ -129,16 +135,14 @@ type RegisterFormTypes = {
129
135
  onTwitterRegister?: () => void;
130
136
  /** Callback function triggered to route to the Terms of Service page. */
131
137
  onRouteToTOS?: () => void;
132
- /** Determines whether to show an error alert. */
133
- showError?: boolean;
134
138
  /** Callback function triggered when the error alert is dismissed. */
135
139
  onErrorDismissed?: () => void;
140
+ /** Determines whether to show an error alert. */
141
+ showError?: boolean;
136
142
  /** Title for the error alert. */
137
143
  errorTitle?: any;
138
144
  /** Text for the error alert. */
139
145
  errorText?: any;
140
- /** Array containing the fields to be included in the form. */
141
- registerFields?: string[];
142
146
  /** Indicates whether the form submission is in progress. */
143
147
  isLoading?: boolean;
144
148
  /** If true, a loading spinner is displayed within the Google login button. */
@@ -164,8 +168,21 @@ type RegisterFormTypes = {
164
168
  };
165
169
  /** The minimum length of the password input field */
166
170
  minPasswordLength?: number;
167
- /** If true, the form is displayed without a card container styling.*/
171
+ /** If true, the form is displayed without a card container styling.
172
+ * @default false
173
+ */
168
174
  cardless?: boolean;
175
+ /** Array containing the fields to be included in the form. */
176
+ registerFields?: ("fullname" | "email" | "username" | "phone")[];
177
+ /** To show the register form in a different type, either "email" or "phone"
178
+ * @default "email"
179
+ */
180
+ registerTypes?: {
181
+ label: string;
182
+ value: string;
183
+ }[];
184
+ /** Props to pass to the PhoneInput component */
185
+ phoneInputProps?: PhoneInputProps;
169
186
  };
170
187
  declare const RegisterForm: FC<RegisterFormTypes>;
171
188
 
@@ -243,7 +260,7 @@ declare const ResetPasswordForm: FC<ResetPasswordType>;
243
260
 
244
261
  type TConfirmation = {
245
262
  texts?: {
246
- checkYourPhone?: string;
263
+ checkYourIdentifier?: string;
247
264
  weSentCode?: string;
248
265
  didntGetCode?: string;
249
266
  resendCode?: string;
@@ -257,7 +274,7 @@ type TConfirmation = {
257
274
  showError?: any;
258
275
  errorTitle?: any;
259
276
  errorText?: any;
260
- phoneNumber?: string;
277
+ identifier?: string;
261
278
  confirmLoading?: boolean;
262
279
  onConfirm?: any;
263
280
  onResend?: any;