@cerberus-design/react 0.1.3-next-86c9e1e → 0.1.3-next-9be4883
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/build/legacy/_tsup-dts-rollup.d.ts +28 -0
- package/build/legacy/{chunk-JCAWOVKD.js → chunk-46TCLT7U.js} +4 -4
- package/build/legacy/chunk-6VY34K3P.js +24 -0
- package/build/legacy/chunk-6VY34K3P.js.map +1 -0
- package/build/legacy/components/FieldMessage.d.ts +2 -0
- package/build/legacy/components/FieldMessage.js +9 -0
- package/build/legacy/components/FieldMessage.js.map +1 -0
- package/build/legacy/components/Label.js +2 -2
- package/build/legacy/index.d.ts +2 -0
- package/build/legacy/index.js +11 -7
- package/build/modern/_tsup-dts-rollup.d.ts +28 -0
- package/build/modern/{chunk-JCAWOVKD.js → chunk-46TCLT7U.js} +4 -4
- package/build/modern/chunk-6VY34K3P.js +24 -0
- package/build/modern/chunk-6VY34K3P.js.map +1 -0
- package/build/modern/components/FieldMessage.d.ts +2 -0
- package/build/modern/components/FieldMessage.js +9 -0
- package/build/modern/components/FieldMessage.js.map +1 -0
- package/build/modern/components/Label.js +2 -2
- package/build/modern/index.d.ts +2 -0
- package/build/modern/index.js +11 -7
- package/package.json +1 -1
- package/src/components/FieldMessage.tsx +41 -0
- package/src/index.ts +1 -0
- /package/build/legacy/{chunk-JCAWOVKD.js.map → chunk-46TCLT7U.js.map} +0 -0
- /package/build/modern/{chunk-JCAWOVKD.js.map → chunk-46TCLT7U.js.map} +0 -0
|
@@ -56,6 +56,34 @@ declare interface FieldContextValue {
|
|
|
56
56
|
export { FieldContextValue }
|
|
57
57
|
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* A component that provides feedback about the field.
|
|
61
|
+
* @description [FieldMessage Docs](https://cerberus.digitalu.design/react/field-message)
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <Field>
|
|
65
|
+
* <Label htmlFor="first_name">First Name</Label>
|
|
66
|
+
* <Input aria-describedBy="help:first_name" id="first_name" type="text" />
|
|
67
|
+
* <FieldMessage id="help:first_name">
|
|
68
|
+
* This will only be used in your account information.
|
|
69
|
+
* </FieldMessage>
|
|
70
|
+
* </Field>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function FieldMessage(props: FieldMessageProps): JSX_2.Element;
|
|
74
|
+
export { FieldMessage }
|
|
75
|
+
export { FieldMessage as FieldMessage_alias_1 }
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This module contains the FieldMessage component.
|
|
79
|
+
* @module
|
|
80
|
+
*/
|
|
81
|
+
declare interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
82
|
+
id: string;
|
|
83
|
+
}
|
|
84
|
+
export { FieldMessageProps }
|
|
85
|
+
export { FieldMessageProps as FieldMessageProps_alias_1 }
|
|
86
|
+
|
|
59
87
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
60
88
|
export { getPosition }
|
|
61
89
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useFieldContext
|
|
3
|
-
} from "./chunk-KETL4ZJK.js";
|
|
4
1
|
import {
|
|
5
2
|
Show
|
|
6
3
|
} from "./chunk-R4H3352X.js";
|
|
4
|
+
import {
|
|
5
|
+
useFieldContext
|
|
6
|
+
} from "./chunk-KETL4ZJK.js";
|
|
7
7
|
|
|
8
8
|
// src/components/Label.tsx
|
|
9
9
|
import { label } from "@cerberus/styled-system/recipes";
|
|
@@ -45,4 +45,4 @@ function Label(props) {
|
|
|
45
45
|
export {
|
|
46
46
|
Label
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-46TCLT7U.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldContext
|
|
3
|
+
} from "./chunk-KETL4ZJK.js";
|
|
4
|
+
|
|
5
|
+
// src/components/FieldMessage.tsx
|
|
6
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { fieldMessage } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function FieldMessage(props) {
|
|
10
|
+
const { invalid } = useFieldContext();
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"small",
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
...invalid && { "aria-invalid": true },
|
|
16
|
+
className: cx(props.className, fieldMessage())
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
FieldMessage
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-6VY34K3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/FieldMessage.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { fieldMessage } from '@cerberus/styled-system/recipes'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the FieldMessage component.\n * @module\n */\n\nexport interface FieldMessageProps\n extends HTMLAttributes<HTMLParagraphElement> {\n id: string\n}\n\n/**\n * A component that provides feedback about the field.\n * @description [FieldMessage Docs](https://cerberus.digitalu.design/react/field-message)\n * @example\n * ```tsx\n * <Field>\n * <Label htmlFor=\"first_name\">First Name</Label>\n * <Input aria-describedBy=\"help:first_name\" id=\"first_name\" type=\"text\" />\n * <FieldMessage id=\"help:first_name\">\n * This will only be used in your account information.\n * </FieldMessage>\n * </Field>\n * ```\n */\nexport function FieldMessage(props: FieldMessageProps) {\n const { invalid } = useFieldContext()\n return (\n <small\n {...props}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(props.className, fieldMessage())}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAS,UAAU;AACnB,SAAS,oBAAoB;AA8BzB;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,EAAE,QAAQ,IAAI,gBAAgB;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,WAAW,GAAG,MAAM,WAAW,aAAa,CAAC;AAAA;AAAA,EAC/C;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { FieldMessage } from './_tsup-dts-rollup';
|
|
4
|
+
export { FieldMessageProps } from './_tsup-dts-rollup';
|
|
3
5
|
export { IconButton } from './_tsup-dts-rollup';
|
|
4
6
|
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
7
|
export { IconButtonProps } from './_tsup-dts-rollup';
|
package/build/legacy/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NavMenuLink
|
|
3
|
+
} from "./chunk-JA4IX7GN.js";
|
|
1
4
|
import {
|
|
2
5
|
NavMenuList,
|
|
3
6
|
getPosition
|
|
@@ -23,25 +26,26 @@ import {
|
|
|
23
26
|
import {
|
|
24
27
|
Button
|
|
25
28
|
} from "./chunk-XFWARXLU.js";
|
|
29
|
+
import {
|
|
30
|
+
FieldMessage
|
|
31
|
+
} from "./chunk-6VY34K3P.js";
|
|
26
32
|
import {
|
|
27
33
|
IconButton
|
|
28
34
|
} from "./chunk-BPIYUAYS.js";
|
|
29
35
|
import {
|
|
30
36
|
Label
|
|
31
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-46TCLT7U.js";
|
|
38
|
+
import {
|
|
39
|
+
Show
|
|
40
|
+
} from "./chunk-R4H3352X.js";
|
|
32
41
|
import {
|
|
33
42
|
Field,
|
|
34
43
|
useFieldContext
|
|
35
44
|
} from "./chunk-KETL4ZJK.js";
|
|
36
|
-
import {
|
|
37
|
-
NavMenuLink
|
|
38
|
-
} from "./chunk-JA4IX7GN.js";
|
|
39
|
-
import {
|
|
40
|
-
Show
|
|
41
|
-
} from "./chunk-R4H3352X.js";
|
|
42
45
|
export {
|
|
43
46
|
Button,
|
|
44
47
|
Field,
|
|
48
|
+
FieldMessage,
|
|
45
49
|
IconButton,
|
|
46
50
|
Label,
|
|
47
51
|
MODE_KEY,
|
|
@@ -56,6 +56,34 @@ declare interface FieldContextValue {
|
|
|
56
56
|
export { FieldContextValue }
|
|
57
57
|
export { FieldContextValue as FieldContextValue_alias_1 }
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* A component that provides feedback about the field.
|
|
61
|
+
* @description [FieldMessage Docs](https://cerberus.digitalu.design/react/field-message)
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <Field>
|
|
65
|
+
* <Label htmlFor="first_name">First Name</Label>
|
|
66
|
+
* <Input aria-describedBy="help:first_name" id="first_name" type="text" />
|
|
67
|
+
* <FieldMessage id="help:first_name">
|
|
68
|
+
* This will only be used in your account information.
|
|
69
|
+
* </FieldMessage>
|
|
70
|
+
* </Field>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function FieldMessage(props: FieldMessageProps): JSX_2.Element;
|
|
74
|
+
export { FieldMessage }
|
|
75
|
+
export { FieldMessage as FieldMessage_alias_1 }
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This module contains the FieldMessage component.
|
|
79
|
+
* @module
|
|
80
|
+
*/
|
|
81
|
+
declare interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
82
|
+
id: string;
|
|
83
|
+
}
|
|
84
|
+
export { FieldMessageProps }
|
|
85
|
+
export { FieldMessageProps as FieldMessageProps_alias_1 }
|
|
86
|
+
|
|
59
87
|
declare function getPosition(position: Positions): GetPositionResult;
|
|
60
88
|
export { getPosition }
|
|
61
89
|
export { getPosition as getPosition_alias_1 }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useFieldContext
|
|
3
|
-
} from "./chunk-KETL4ZJK.js";
|
|
4
1
|
import {
|
|
5
2
|
Show
|
|
6
3
|
} from "./chunk-R4H3352X.js";
|
|
4
|
+
import {
|
|
5
|
+
useFieldContext
|
|
6
|
+
} from "./chunk-KETL4ZJK.js";
|
|
7
7
|
|
|
8
8
|
// src/components/Label.tsx
|
|
9
9
|
import { label } from "@cerberus/styled-system/recipes";
|
|
@@ -45,4 +45,4 @@ function Label(props) {
|
|
|
45
45
|
export {
|
|
46
46
|
Label
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-46TCLT7U.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldContext
|
|
3
|
+
} from "./chunk-KETL4ZJK.js";
|
|
4
|
+
|
|
5
|
+
// src/components/FieldMessage.tsx
|
|
6
|
+
import { cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { fieldMessage } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function FieldMessage(props) {
|
|
10
|
+
const { invalid } = useFieldContext();
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"small",
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
...invalid && { "aria-invalid": true },
|
|
16
|
+
className: cx(props.className, fieldMessage())
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
FieldMessage
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-6VY34K3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/FieldMessage.tsx"],"sourcesContent":["'use client'\n\nimport type { HTMLAttributes } from 'react'\nimport { cx } from '@cerberus/styled-system/css'\nimport { fieldMessage } from '@cerberus/styled-system/recipes'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the FieldMessage component.\n * @module\n */\n\nexport interface FieldMessageProps\n extends HTMLAttributes<HTMLParagraphElement> {\n id: string\n}\n\n/**\n * A component that provides feedback about the field.\n * @description [FieldMessage Docs](https://cerberus.digitalu.design/react/field-message)\n * @example\n * ```tsx\n * <Field>\n * <Label htmlFor=\"first_name\">First Name</Label>\n * <Input aria-describedBy=\"help:first_name\" id=\"first_name\" type=\"text\" />\n * <FieldMessage id=\"help:first_name\">\n * This will only be used in your account information.\n * </FieldMessage>\n * </Field>\n * ```\n */\nexport function FieldMessage(props: FieldMessageProps) {\n const { invalid } = useFieldContext()\n return (\n <small\n {...props}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(props.className, fieldMessage())}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAS,UAAU;AACnB,SAAS,oBAAoB;AA8BzB;AAHG,SAAS,aAAa,OAA0B;AACrD,QAAM,EAAE,QAAQ,IAAI,gBAAgB;AACpC,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,WAAW,GAAG,MAAM,WAAW,aAAa,CAAC;AAAA;AAAA,EAC/C;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Button } from './_tsup-dts-rollup';
|
|
2
2
|
export { ButtonProps } from './_tsup-dts-rollup';
|
|
3
|
+
export { FieldMessage } from './_tsup-dts-rollup';
|
|
4
|
+
export { FieldMessageProps } from './_tsup-dts-rollup';
|
|
3
5
|
export { IconButton } from './_tsup-dts-rollup';
|
|
4
6
|
export { IconButtonUsage } from './_tsup-dts-rollup';
|
|
5
7
|
export { IconButtonProps } from './_tsup-dts-rollup';
|
package/build/modern/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NavMenuLink
|
|
3
|
+
} from "./chunk-JA4IX7GN.js";
|
|
1
4
|
import {
|
|
2
5
|
NavMenuList,
|
|
3
6
|
getPosition
|
|
@@ -23,25 +26,26 @@ import {
|
|
|
23
26
|
import {
|
|
24
27
|
Button
|
|
25
28
|
} from "./chunk-XFWARXLU.js";
|
|
29
|
+
import {
|
|
30
|
+
FieldMessage
|
|
31
|
+
} from "./chunk-6VY34K3P.js";
|
|
26
32
|
import {
|
|
27
33
|
IconButton
|
|
28
34
|
} from "./chunk-BPIYUAYS.js";
|
|
29
35
|
import {
|
|
30
36
|
Label
|
|
31
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-46TCLT7U.js";
|
|
38
|
+
import {
|
|
39
|
+
Show
|
|
40
|
+
} from "./chunk-R4H3352X.js";
|
|
32
41
|
import {
|
|
33
42
|
Field,
|
|
34
43
|
useFieldContext
|
|
35
44
|
} from "./chunk-KETL4ZJK.js";
|
|
36
|
-
import {
|
|
37
|
-
NavMenuLink
|
|
38
|
-
} from "./chunk-JA4IX7GN.js";
|
|
39
|
-
import {
|
|
40
|
-
Show
|
|
41
|
-
} from "./chunk-R4H3352X.js";
|
|
42
45
|
export {
|
|
43
46
|
Button,
|
|
44
47
|
Field,
|
|
48
|
+
FieldMessage,
|
|
45
49
|
IconButton,
|
|
46
50
|
Label,
|
|
47
51
|
MODE_KEY,
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import type { HTMLAttributes } from 'react'
|
|
4
|
+
import { cx } from '@cerberus/styled-system/css'
|
|
5
|
+
import { fieldMessage } from '@cerberus/styled-system/recipes'
|
|
6
|
+
import { useFieldContext } from '../context/field'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module contains the FieldMessage component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface FieldMessageProps
|
|
14
|
+
extends HTMLAttributes<HTMLParagraphElement> {
|
|
15
|
+
id: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A component that provides feedback about the field.
|
|
20
|
+
* @description [FieldMessage Docs](https://cerberus.digitalu.design/react/field-message)
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Field>
|
|
24
|
+
* <Label htmlFor="first_name">First Name</Label>
|
|
25
|
+
* <Input aria-describedBy="help:first_name" id="first_name" type="text" />
|
|
26
|
+
* <FieldMessage id="help:first_name">
|
|
27
|
+
* This will only be used in your account information.
|
|
28
|
+
* </FieldMessage>
|
|
29
|
+
* </Field>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function FieldMessage(props: FieldMessageProps) {
|
|
33
|
+
const { invalid } = useFieldContext()
|
|
34
|
+
return (
|
|
35
|
+
<small
|
|
36
|
+
{...props}
|
|
37
|
+
{...(invalid && { 'aria-invalid': true })}
|
|
38
|
+
className={cx(props.className, fieldMessage())}
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
}
|
package/src/index.ts
CHANGED
|
File without changes
|
|
File without changes
|