@cerberus-design/react 0.3.2-next-b86ed22 → 0.3.2-next-4a29e36
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 +20 -0
- package/build/legacy/chunk-5TBINKAO.js +36 -0
- package/build/legacy/chunk-5TBINKAO.js.map +1 -0
- package/build/legacy/components/Textarea.d.ts +2 -0
- package/build/legacy/components/Textarea.js +9 -0
- package/build/legacy/components/Textarea.js.map +1 -0
- package/build/legacy/index.d.ts +2 -0
- package/build/legacy/index.js +4 -0
- package/build/modern/_tsup-dts-rollup.d.ts +20 -0
- package/build/modern/chunk-5TBINKAO.js +36 -0
- package/build/modern/chunk-5TBINKAO.js.map +1 -0
- package/build/modern/components/Textarea.d.ts +2 -0
- package/build/modern/components/Textarea.js +9 -0
- package/build/modern/components/Textarea.js.map +1 -0
- package/build/modern/index.d.ts +2 -0
- package/build/modern/index.js +4 -0
- package/package.json +1 -1
- package/src/components/Textarea.tsx +45 -0
- package/src/index.ts +1 -0
|
@@ -9,6 +9,7 @@ import { MutableRefObject } from 'react';
|
|
|
9
9
|
import { PropsWithChildren } from 'react';
|
|
10
10
|
import { ReactNode } from 'react';
|
|
11
11
|
import { RefObject } from 'react';
|
|
12
|
+
import type { TextareaHTMLAttributes } from 'react';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* A component that allows the user to perform actions
|
|
@@ -401,6 +402,25 @@ declare interface TabsProps {
|
|
|
401
402
|
export { TabsProps }
|
|
402
403
|
export { TabsProps as TabsProps_alias_1 }
|
|
403
404
|
|
|
405
|
+
/**
|
|
406
|
+
* A component that allows the user to input large blocks of text.
|
|
407
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
|
|
408
|
+
*/
|
|
409
|
+
declare function Textarea(props: TextareaProps): JSX.Element;
|
|
410
|
+
export { Textarea }
|
|
411
|
+
export { Textarea as Textarea_alias_1 }
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* This module contains the Textarea component.
|
|
415
|
+
* @module
|
|
416
|
+
*/
|
|
417
|
+
declare interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
|
|
418
|
+
describedBy?: string;
|
|
419
|
+
id: string;
|
|
420
|
+
}
|
|
421
|
+
export { TextareaProps }
|
|
422
|
+
export { TextareaProps as TextareaProps_alias_1 }
|
|
423
|
+
|
|
404
424
|
declare const THEME_KEY = "cerberus-theme";
|
|
405
425
|
export { THEME_KEY }
|
|
406
426
|
export { THEME_KEY as THEME_KEY_alias_1 }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldContext
|
|
3
|
+
} from "./chunk-ZAU4JVLL.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Textarea.tsx
|
|
6
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { input } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function Textarea(props) {
|
|
10
|
+
const { describedBy, ...nativeProps } = props;
|
|
11
|
+
const { invalid, ...fieldState } = useFieldContext();
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
"textarea",
|
|
14
|
+
{
|
|
15
|
+
...nativeProps,
|
|
16
|
+
...fieldState,
|
|
17
|
+
...describedBy && { "aria-describedby": describedBy },
|
|
18
|
+
...invalid && { "aria-invalid": true },
|
|
19
|
+
className: cx(
|
|
20
|
+
props.className,
|
|
21
|
+
input().input,
|
|
22
|
+
css({
|
|
23
|
+
pxi: "2",
|
|
24
|
+
py: "2",
|
|
25
|
+
resize: "vertical"
|
|
26
|
+
})
|
|
27
|
+
),
|
|
28
|
+
rows: 4
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Textarea
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-5TBINKAO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Textarea.tsx"],"sourcesContent":["'use client'\n\nimport type { TextareaHTMLAttributes } from 'react'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { input } from '@cerberus/styled-system/recipes'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the Textarea component.\n * @module\n */\n\nexport interface TextareaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {\n describedBy?: string\n id: string\n}\n\n/**\n * A component that allows the user to input large blocks of text.\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx\n */\nexport function Textarea(props: TextareaProps): JSX.Element {\n const { describedBy, ...nativeProps } = props\n const { invalid, ...fieldState } = useFieldContext()\n\n return (\n <textarea\n {...nativeProps}\n {...fieldState}\n {...(describedBy && { 'aria-describedby': describedBy })}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(\n props.className,\n input().input,\n css({\n pxi: '2',\n py: '2',\n resize: 'vertical',\n }),\n )}\n rows={4}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAS,KAAK,UAAU;AACxB,SAAS,aAAa;AAuBlB;AALG,SAAS,SAAS,OAAmC;AAC1D,QAAM,EAAE,aAAa,GAAG,YAAY,IAAI;AACxC,QAAM,EAAE,SAAS,GAAG,WAAW,IAAI,gBAAgB;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,eAAe,EAAE,oBAAoB,YAAY;AAAA,MACrD,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,WAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM,EAAE;AAAA,QACR,IAAI;AAAA,UACF,KAAK;AAAA,UACL,IAAI;AAAA,UACJ,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA,MACA,MAAM;AAAA;AAAA,EACR;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export { TabList } from './_tsup-dts-rollup';
|
|
|
22
22
|
export { TabListProps } from './_tsup-dts-rollup';
|
|
23
23
|
export { TabPanel } from './_tsup-dts-rollup';
|
|
24
24
|
export { TabPanelProps } from './_tsup-dts-rollup';
|
|
25
|
+
export { Textarea } from './_tsup-dts-rollup';
|
|
26
|
+
export { TextareaProps } from './_tsup-dts-rollup';
|
|
25
27
|
export { Show } from './_tsup-dts-rollup';
|
|
26
28
|
export { ShowProps } from './_tsup-dts-rollup';
|
|
27
29
|
export { Field } from './_tsup-dts-rollup';
|
package/build/legacy/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TabPanel
|
|
3
3
|
} from "./chunk-SVZU6LPF.js";
|
|
4
|
+
import {
|
|
5
|
+
Textarea
|
|
6
|
+
} from "./chunk-5TBINKAO.js";
|
|
4
7
|
import {
|
|
5
8
|
Input
|
|
6
9
|
} from "./chunk-LD5ZV46F.js";
|
|
@@ -81,6 +84,7 @@ export {
|
|
|
81
84
|
TabPanel,
|
|
82
85
|
Tabs,
|
|
83
86
|
TabsContext,
|
|
87
|
+
Textarea,
|
|
84
88
|
ThemeProvider,
|
|
85
89
|
createNavTriggerProps,
|
|
86
90
|
getPosition,
|
|
@@ -9,6 +9,7 @@ import { MutableRefObject } from 'react';
|
|
|
9
9
|
import { PropsWithChildren } from 'react';
|
|
10
10
|
import { ReactNode } from 'react';
|
|
11
11
|
import { RefObject } from 'react';
|
|
12
|
+
import type { TextareaHTMLAttributes } from 'react';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* A component that allows the user to perform actions
|
|
@@ -401,6 +402,25 @@ declare interface TabsProps {
|
|
|
401
402
|
export { TabsProps }
|
|
402
403
|
export { TabsProps as TabsProps_alias_1 }
|
|
403
404
|
|
|
405
|
+
/**
|
|
406
|
+
* A component that allows the user to input large blocks of text.
|
|
407
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
|
|
408
|
+
*/
|
|
409
|
+
declare function Textarea(props: TextareaProps): JSX.Element;
|
|
410
|
+
export { Textarea }
|
|
411
|
+
export { Textarea as Textarea_alias_1 }
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* This module contains the Textarea component.
|
|
415
|
+
* @module
|
|
416
|
+
*/
|
|
417
|
+
declare interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
|
|
418
|
+
describedBy?: string;
|
|
419
|
+
id: string;
|
|
420
|
+
}
|
|
421
|
+
export { TextareaProps }
|
|
422
|
+
export { TextareaProps as TextareaProps_alias_1 }
|
|
423
|
+
|
|
404
424
|
declare const THEME_KEY = "cerberus-theme";
|
|
405
425
|
export { THEME_KEY }
|
|
406
426
|
export { THEME_KEY as THEME_KEY_alias_1 }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldContext
|
|
3
|
+
} from "./chunk-ZAU4JVLL.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Textarea.tsx
|
|
6
|
+
import { css, cx } from "@cerberus/styled-system/css";
|
|
7
|
+
import { input } from "@cerberus/styled-system/recipes";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function Textarea(props) {
|
|
10
|
+
const { describedBy, ...nativeProps } = props;
|
|
11
|
+
const { invalid, ...fieldState } = useFieldContext();
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
"textarea",
|
|
14
|
+
{
|
|
15
|
+
...nativeProps,
|
|
16
|
+
...fieldState,
|
|
17
|
+
...describedBy && { "aria-describedby": describedBy },
|
|
18
|
+
...invalid && { "aria-invalid": true },
|
|
19
|
+
className: cx(
|
|
20
|
+
props.className,
|
|
21
|
+
input().input,
|
|
22
|
+
css({
|
|
23
|
+
pxi: "2",
|
|
24
|
+
py: "2",
|
|
25
|
+
resize: "vertical"
|
|
26
|
+
})
|
|
27
|
+
),
|
|
28
|
+
rows: 4
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
Textarea
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-5TBINKAO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/Textarea.tsx"],"sourcesContent":["'use client'\n\nimport type { TextareaHTMLAttributes } from 'react'\nimport { css, cx } from '@cerberus/styled-system/css'\nimport { input } from '@cerberus/styled-system/recipes'\nimport { useFieldContext } from '../context/field'\n\n/**\n * This module contains the Textarea component.\n * @module\n */\n\nexport interface TextareaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {\n describedBy?: string\n id: string\n}\n\n/**\n * A component that allows the user to input large blocks of text.\n * @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx\n */\nexport function Textarea(props: TextareaProps): JSX.Element {\n const { describedBy, ...nativeProps } = props\n const { invalid, ...fieldState } = useFieldContext()\n\n return (\n <textarea\n {...nativeProps}\n {...fieldState}\n {...(describedBy && { 'aria-describedby': describedBy })}\n {...(invalid && { 'aria-invalid': true })}\n className={cx(\n props.className,\n input().input,\n css({\n pxi: '2',\n py: '2',\n resize: 'vertical',\n }),\n )}\n rows={4}\n />\n )\n}\n"],"mappings":";;;;;AAGA,SAAS,KAAK,UAAU;AACxB,SAAS,aAAa;AAuBlB;AALG,SAAS,SAAS,OAAmC;AAC1D,QAAM,EAAE,aAAa,GAAG,YAAY,IAAI;AACxC,QAAM,EAAE,SAAS,GAAG,WAAW,IAAI,gBAAgB;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAI,eAAe,EAAE,oBAAoB,YAAY;AAAA,MACrD,GAAI,WAAW,EAAE,gBAAgB,KAAK;AAAA,MACvC,WAAW;AAAA,QACT,MAAM;AAAA,QACN,MAAM,EAAE;AAAA,QACR,IAAI;AAAA,UACF,KAAK;AAAA,UACL,IAAI;AAAA,UACJ,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AAAA,MACA,MAAM;AAAA;AAAA,EACR;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/build/modern/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export { TabList } from './_tsup-dts-rollup';
|
|
|
22
22
|
export { TabListProps } from './_tsup-dts-rollup';
|
|
23
23
|
export { TabPanel } from './_tsup-dts-rollup';
|
|
24
24
|
export { TabPanelProps } from './_tsup-dts-rollup';
|
|
25
|
+
export { Textarea } from './_tsup-dts-rollup';
|
|
26
|
+
export { TextareaProps } from './_tsup-dts-rollup';
|
|
25
27
|
export { Show } from './_tsup-dts-rollup';
|
|
26
28
|
export { ShowProps } from './_tsup-dts-rollup';
|
|
27
29
|
export { Field } from './_tsup-dts-rollup';
|
package/build/modern/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TabPanel
|
|
3
3
|
} from "./chunk-SVZU6LPF.js";
|
|
4
|
+
import {
|
|
5
|
+
Textarea
|
|
6
|
+
} from "./chunk-5TBINKAO.js";
|
|
4
7
|
import {
|
|
5
8
|
Input
|
|
6
9
|
} from "./chunk-LD5ZV46F.js";
|
|
@@ -81,6 +84,7 @@ export {
|
|
|
81
84
|
TabPanel,
|
|
82
85
|
Tabs,
|
|
83
86
|
TabsContext,
|
|
87
|
+
Textarea,
|
|
84
88
|
ThemeProvider,
|
|
85
89
|
createNavTriggerProps,
|
|
86
90
|
getPosition,
|
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import type { TextareaHTMLAttributes } from 'react'
|
|
4
|
+
import { css, cx } from '@cerberus/styled-system/css'
|
|
5
|
+
import { input } from '@cerberus/styled-system/recipes'
|
|
6
|
+
import { useFieldContext } from '../context/field'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module contains the Textarea component.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export interface TextareaProps
|
|
14
|
+
extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'id'> {
|
|
15
|
+
describedBy?: string
|
|
16
|
+
id: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A component that allows the user to input large blocks of text.
|
|
21
|
+
* @description https://github.com/omnifed/cerberus/blob/main/packages/react/src/components/Textarea.tsx
|
|
22
|
+
*/
|
|
23
|
+
export function Textarea(props: TextareaProps): JSX.Element {
|
|
24
|
+
const { describedBy, ...nativeProps } = props
|
|
25
|
+
const { invalid, ...fieldState } = useFieldContext()
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<textarea
|
|
29
|
+
{...nativeProps}
|
|
30
|
+
{...fieldState}
|
|
31
|
+
{...(describedBy && { 'aria-describedby': describedBy })}
|
|
32
|
+
{...(invalid && { 'aria-invalid': true })}
|
|
33
|
+
className={cx(
|
|
34
|
+
props.className,
|
|
35
|
+
input().input,
|
|
36
|
+
css({
|
|
37
|
+
pxi: '2',
|
|
38
|
+
py: '2',
|
|
39
|
+
resize: 'vertical',
|
|
40
|
+
}),
|
|
41
|
+
)}
|
|
42
|
+
rows={4}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
package/src/index.ts
CHANGED