@wix/headless-forms 0.0.15 → 0.0.17

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
@@ -27,16 +27,9 @@ All changes should be documented using `jsdoc` and updating `docs/api/FORM_INTER
27
27
  ## Publishing
28
28
 
29
29
  1. **Update Version**
30
- - Update version in `package.json`
31
- - Create PR and merge to main branch
30
+ The version will be updated automatically by Falcon after merging to master
32
31
 
33
- 2. **Publish to NPM**
34
- - Go to GitHub Actions
35
- - Run "Publish Package" workflow
36
- - Enter package name: `forms`
37
- - Monitor the workflow for successful completion
38
-
39
- 3. **Update SDK Exports**
32
+ 2. **Update SDK Exports**
40
33
  - Go to Form app in Wix Dev Center
41
34
  - Update SDK exports extensions:
42
35
  - "Forms SDK Exports Components"
@@ -1,3 +1,3 @@
1
1
  export * as Form from './Form.js';
2
2
  export * from './types.js';
3
- export * from './Phone.js';
3
+ export { PhoneField } from '@wix/form-public';
@@ -36,7 +36,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Form = void 0;
39
+ exports.PhoneField = exports.Form = void 0;
40
40
  exports.Form = __importStar(require("./Form.js"));
41
41
  __exportStar(require("./types.js"), exports);
42
- __exportStar(require("./Phone.js"), exports);
42
+ var form_public_1 = require("@wix/form-public");
43
+ Object.defineProperty(exports, "PhoneField", { enumerable: true, get: function () { return form_public_1.PhoneField; } });
@@ -1,3 +1,3 @@
1
1
  export * as Form from './Form.js';
2
2
  export * from './types.js';
3
- export * from './Phone.js';
3
+ export { PhoneField } from '@wix/form-public';
@@ -1,3 +1,3 @@
1
1
  export * as Form from './Form.js';
2
2
  export * from './types.js';
3
- export * from './Phone.js';
3
+ export { PhoneField } from '@wix/form-public';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-forms",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -42,11 +42,12 @@
42
42
  "vitest": "^3.1.4"
43
43
  },
44
44
  "dependencies": {
45
- "@wix/form-public": "^0.55.0",
45
+ "@wix/form-public": "^0.64.0",
46
46
  "@wix/forms": "^1.0.331",
47
- "@wix/headless-utils": "0.0.6",
47
+ "@wix/headless-utils": "0.0.7",
48
48
  "@wix/services-definitions": "^0.1.4",
49
- "@wix/services-manager-react": "^0.1.26"
49
+ "@wix/services-manager-react": "^0.1.26",
50
+ "react-aria-components": "^1.13.0"
50
51
  },
51
52
  "publishConfig": {
52
53
  "registry": "https://registry.npmjs.org/",
@@ -58,5 +59,5 @@
58
59
  "groupId": "com.wixpress.headless-components"
59
60
  }
60
61
  },
61
- "falconPackageHash": "644ebef3f017cb75041a129a5b26f500d6b1a633fed30d4b024bf76e"
62
+ "falconPackageHash": "32d2f15a3874199a26e6700b141253e4f332c4fb8dafbc4bcbc1fcbf"
62
63
  }
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- export interface PhoneFieldProps {
3
- id: string;
4
- children: React.ReactNode;
5
- asChild?: boolean;
6
- className?: string;
7
- }
8
- export interface PhoneLabelProps {
9
- children: React.ReactNode;
10
- asChild?: boolean;
11
- className?: string;
12
- }
13
- export interface PhoneLabelRequiredProps {
14
- required?: boolean;
15
- children?: React.ReactNode;
16
- asChild?: boolean;
17
- className?: string;
18
- }
19
- export declare const Required: React.ForwardRefExoticComponent<PhoneLabelRequiredProps & React.RefAttributes<HTMLSpanElement>>;
20
- interface PhoneLabelComponent extends React.ForwardRefExoticComponent<PhoneLabelProps & React.RefAttributes<HTMLDivElement>> {
21
- Required: typeof Required;
22
- }
23
- export declare const Label: PhoneLabelComponent;
24
- export interface PhoneErrorProps {
25
- children?: React.ReactNode;
26
- asChild?: boolean;
27
- className?: string;
28
- }
29
- declare const Error: React.ForwardRefExoticComponent<PhoneErrorProps & React.RefAttributes<HTMLDivElement>>;
30
- export interface CountryCodeProps {
31
- asChild?: boolean;
32
- className?: string;
33
- }
34
- declare const CountryCode: React.ForwardRefExoticComponent<CountryCodeProps & React.RefAttributes<HTMLDivElement>>;
35
- export interface PhoneFieldInputProps {
36
- asChild?: boolean;
37
- className?: string;
38
- }
39
- declare const Input: React.ForwardRefExoticComponent<PhoneFieldInputProps & React.RefAttributes<HTMLDivElement>>;
40
- interface PhoneFieldComponent extends React.ForwardRefExoticComponent<PhoneFieldProps & React.RefAttributes<HTMLDivElement>> {
41
- Label: typeof Label;
42
- Error: typeof Error;
43
- Input: typeof Input;
44
- CountryCode: typeof CountryCode;
45
- }
46
- export declare const PhoneField: PhoneFieldComponent;
47
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PhoneField = exports.Label = exports.Required = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = __importDefault(require("react"));
9
- const react_2 = require("@wix/headless-forms/react");
10
- const form_public_1 = require("@wix/form-public");
11
- const Root = react_1.default.forwardRef((props, ref) => {
12
- const { id, children, asChild, className } = props;
13
- const { description } = (0, form_public_1.useFieldProps)();
14
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Field, { ref: ref, id: id, asChild: asChild, className: className, children: (0, jsx_runtime_1.jsx)(react_2.Form.Field.InputWrapper, { children: (0, jsx_runtime_1.jsx)(react_2.Form.Field.Input, { description: description, children: children }) }) }));
15
- });
16
- Root.displayName = 'PhoneField';
17
- const LabelRoot = react_1.default.forwardRef((props, ref) => {
18
- const { asChild, className, children } = props;
19
- const { id, label, showLabel } = (0, form_public_1.useFieldProps)();
20
- if (!showLabel) {
21
- return null;
22
- }
23
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Field.Label, { ref: ref, asChild: asChild, className: className, children: (0, jsx_runtime_1.jsxs)("label", { htmlFor: id, children: [label, children] }) }));
24
- });
25
- LabelRoot.displayName = 'PhoneField.Label';
26
- exports.Required = react_1.default.forwardRef((props, ref) => {
27
- const { required } = (0, form_public_1.useFieldProps)();
28
- return (0, jsx_runtime_1.jsx)(react_2.Form.Field.Label.Required, { ...props, ref: ref, required: required });
29
- });
30
- exports.Required.displayName = 'PhoneField.Label.Required';
31
- exports.Label = LabelRoot;
32
- exports.Label.Required = exports.Required;
33
- const Error = react_1.default.forwardRef((props, ref) => {
34
- const { children, ...rest } = props;
35
- const { errorMessage } = (0, form_public_1.useFieldProps)();
36
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Field.Error, { ref: ref, ...rest, children: errorMessage }));
37
- });
38
- Error.displayName = 'PhoneField.Error';
39
- const CountryCode = react_1.default.forwardRef((props, ref) => {
40
- const { asChild, className, ...rest } = props;
41
- const { id, countryCodes, defaultCountryCode, readOnly, onChange, onBlur, onFocus, } = (0, form_public_1.useFieldProps)();
42
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Field.Input, { ref: ref, asChild: asChild, className: className, ...rest, children: (0, jsx_runtime_1.jsx)("select", { id: `${id}-country`, defaultValue: defaultCountryCode || '', disabled: readOnly, onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), children: countryCodes?.map((code) => ((0, jsx_runtime_1.jsx)("option", { value: code, children: code }, code))) }) }));
43
- });
44
- CountryCode.displayName = 'PhoneField.CountryCode';
45
- const Input = react_1.default.forwardRef((props, ref) => {
46
- const { asChild, className, ...rest } = props;
47
- const { id, value, required, readOnly, placeholder, onChange, onBlur, onFocus, description, } = (0, form_public_1.useFieldProps)();
48
- const descriptionId = description ? `${id}-description` : undefined;
49
- return ((0, jsx_runtime_1.jsx)(react_2.Form.Field.Input, { ref: ref, asChild: asChild, className: className, ...rest, children: (0, jsx_runtime_1.jsx)("input", { id: id, type: "tel", value: value || '', required: required, readOnly: readOnly, placeholder: placeholder, "aria-describedby": descriptionId, "aria-invalid": !!(required && !value), "aria-required": required, onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.() }) }));
50
- });
51
- Input.displayName = 'PhoneField.Input';
52
- exports.PhoneField = Root;
53
- exports.PhoneField.Label = exports.Label;
54
- exports.PhoneField.Error = Error;
55
- exports.PhoneField.Input = Input;
56
- exports.PhoneField.CountryCode = CountryCode;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- export interface PhoneFieldProps {
3
- id: string;
4
- children: React.ReactNode;
5
- asChild?: boolean;
6
- className?: string;
7
- }
8
- export interface PhoneLabelProps {
9
- children: React.ReactNode;
10
- asChild?: boolean;
11
- className?: string;
12
- }
13
- export interface PhoneLabelRequiredProps {
14
- required?: boolean;
15
- children?: React.ReactNode;
16
- asChild?: boolean;
17
- className?: string;
18
- }
19
- export declare const Required: React.ForwardRefExoticComponent<PhoneLabelRequiredProps & React.RefAttributes<HTMLSpanElement>>;
20
- interface PhoneLabelComponent extends React.ForwardRefExoticComponent<PhoneLabelProps & React.RefAttributes<HTMLDivElement>> {
21
- Required: typeof Required;
22
- }
23
- export declare const Label: PhoneLabelComponent;
24
- export interface PhoneErrorProps {
25
- children?: React.ReactNode;
26
- asChild?: boolean;
27
- className?: string;
28
- }
29
- declare const Error: React.ForwardRefExoticComponent<PhoneErrorProps & React.RefAttributes<HTMLDivElement>>;
30
- export interface CountryCodeProps {
31
- asChild?: boolean;
32
- className?: string;
33
- }
34
- declare const CountryCode: React.ForwardRefExoticComponent<CountryCodeProps & React.RefAttributes<HTMLDivElement>>;
35
- export interface PhoneFieldInputProps {
36
- asChild?: boolean;
37
- className?: string;
38
- }
39
- declare const Input: React.ForwardRefExoticComponent<PhoneFieldInputProps & React.RefAttributes<HTMLDivElement>>;
40
- interface PhoneFieldComponent extends React.ForwardRefExoticComponent<PhoneFieldProps & React.RefAttributes<HTMLDivElement>> {
41
- Label: typeof Label;
42
- Error: typeof Error;
43
- Input: typeof Input;
44
- CountryCode: typeof CountryCode;
45
- }
46
- export declare const PhoneField: PhoneFieldComponent;
47
- export {};
@@ -1,50 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { Form } from '@wix/headless-forms/react';
4
- import { useFieldProps } from '@wix/form-public';
5
- const Root = React.forwardRef((props, ref) => {
6
- const { id, children, asChild, className } = props;
7
- const { description } = useFieldProps();
8
- return (_jsx(Form.Field, { ref: ref, id: id, asChild: asChild, className: className, children: _jsx(Form.Field.InputWrapper, { children: _jsx(Form.Field.Input, { description: description, children: children }) }) }));
9
- });
10
- Root.displayName = 'PhoneField';
11
- const LabelRoot = React.forwardRef((props, ref) => {
12
- const { asChild, className, children } = props;
13
- const { id, label, showLabel } = useFieldProps();
14
- if (!showLabel) {
15
- return null;
16
- }
17
- return (_jsx(Form.Field.Label, { ref: ref, asChild: asChild, className: className, children: _jsxs("label", { htmlFor: id, children: [label, children] }) }));
18
- });
19
- LabelRoot.displayName = 'PhoneField.Label';
20
- export const Required = React.forwardRef((props, ref) => {
21
- const { required } = useFieldProps();
22
- return _jsx(Form.Field.Label.Required, { ...props, ref: ref, required: required });
23
- });
24
- Required.displayName = 'PhoneField.Label.Required';
25
- export const Label = LabelRoot;
26
- Label.Required = Required;
27
- const Error = React.forwardRef((props, ref) => {
28
- const { children, ...rest } = props;
29
- const { errorMessage } = useFieldProps();
30
- return (_jsx(Form.Field.Error, { ref: ref, ...rest, children: errorMessage }));
31
- });
32
- Error.displayName = 'PhoneField.Error';
33
- const CountryCode = React.forwardRef((props, ref) => {
34
- const { asChild, className, ...rest } = props;
35
- const { id, countryCodes, defaultCountryCode, readOnly, onChange, onBlur, onFocus, } = useFieldProps();
36
- return (_jsx(Form.Field.Input, { ref: ref, asChild: asChild, className: className, ...rest, children: _jsx("select", { id: `${id}-country`, defaultValue: defaultCountryCode || '', disabled: readOnly, onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.(), children: countryCodes?.map((code) => (_jsx("option", { value: code, children: code }, code))) }) }));
37
- });
38
- CountryCode.displayName = 'PhoneField.CountryCode';
39
- const Input = React.forwardRef((props, ref) => {
40
- const { asChild, className, ...rest } = props;
41
- const { id, value, required, readOnly, placeholder, onChange, onBlur, onFocus, description, } = useFieldProps();
42
- const descriptionId = description ? `${id}-description` : undefined;
43
- return (_jsx(Form.Field.Input, { ref: ref, asChild: asChild, className: className, ...rest, children: _jsx("input", { id: id, type: "tel", value: value || '', required: required, readOnly: readOnly, placeholder: placeholder, "aria-describedby": descriptionId, "aria-invalid": !!(required && !value), "aria-required": required, onChange: (e) => onChange?.(e.target.value), onBlur: () => onBlur?.(), onFocus: () => onFocus?.() }) }));
44
- });
45
- Input.displayName = 'PhoneField.Input';
46
- export const PhoneField = Root;
47
- PhoneField.Label = Label;
48
- PhoneField.Error = Error;
49
- PhoneField.Input = Input;
50
- PhoneField.CountryCode = CountryCode;