@tipp/ui 1.4.14 → 1.4.16
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/atoms/dialog.cjs +4 -3
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/index.cjs +134 -100
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.d.cts +3 -1
- package/dist/atoms/index.d.ts +3 -1
- package/dist/atoms/index.js +3 -3
- package/dist/atoms/text-area.cjs +47 -1
- package/dist/atoms/text-area.cjs.map +1 -1
- package/dist/atoms/text-area.d.cts +11 -1
- package/dist/atoms/text-area.d.ts +11 -1
- package/dist/atoms/text-area.js +1 -1
- package/dist/atoms/text-field.cjs +43 -1
- package/dist/atoms/text-field.cjs.map +1 -1
- package/dist/atoms/text-field.d.cts +15 -1
- package/dist/atoms/text-field.d.ts +15 -1
- package/dist/atoms/text-field.js +1 -1
- package/dist/chunk-2LJ7CD62.js +340 -0
- package/dist/chunk-2LJ7CD62.js.map +1 -0
- package/dist/chunk-2PGSMNLI.js +90 -0
- package/dist/chunk-2PGSMNLI.js.map +1 -0
- package/dist/chunk-2VD5Y72N.js +89 -0
- package/dist/chunk-2VD5Y72N.js.map +1 -0
- package/dist/chunk-3ADRZ7OH.js +27 -0
- package/dist/chunk-3ADRZ7OH.js.map +1 -0
- package/dist/chunk-3KFECMWE.js +97 -0
- package/dist/chunk-3KFECMWE.js.map +1 -0
- package/dist/chunk-4UR2XNMY.js +87 -0
- package/dist/chunk-4UR2XNMY.js.map +1 -0
- package/dist/chunk-7RMTZBCT.js +192 -0
- package/dist/chunk-7RMTZBCT.js.map +1 -0
- package/dist/chunk-7UNNTQPU.js +28 -0
- package/dist/chunk-7UNNTQPU.js.map +1 -0
- package/dist/chunk-AP2MXJOW.js +164 -0
- package/dist/chunk-AP2MXJOW.js.map +1 -0
- package/dist/chunk-CJDUEQIT.js +169 -0
- package/dist/chunk-CJDUEQIT.js.map +1 -0
- package/dist/chunk-CVON644P.js +164 -0
- package/dist/chunk-CVON644P.js.map +1 -0
- package/dist/chunk-DDBXZ3IQ.js +28 -0
- package/dist/chunk-DDBXZ3IQ.js.map +1 -0
- package/dist/chunk-EXC5RUGV.js +20 -0
- package/dist/chunk-EXC5RUGV.js.map +1 -0
- package/dist/chunk-EZEZH6DF.js +29 -0
- package/dist/chunk-EZEZH6DF.js.map +1 -0
- package/dist/chunk-G6ITJNH2.js +128 -0
- package/dist/chunk-G6ITJNH2.js.map +1 -0
- package/dist/chunk-GJ6NEBI5.js +340 -0
- package/dist/chunk-GJ6NEBI5.js.map +1 -0
- package/dist/chunk-IKUXA6XG.js +340 -0
- package/dist/chunk-IKUXA6XG.js.map +1 -0
- package/dist/chunk-IYIR2TWL.js +192 -0
- package/dist/chunk-IYIR2TWL.js.map +1 -0
- package/dist/chunk-KFK3272Z.js +169 -0
- package/dist/chunk-KFK3272Z.js.map +1 -0
- package/dist/chunk-KQDTZZMT.js +29 -0
- package/dist/chunk-KQDTZZMT.js.map +1 -0
- package/dist/chunk-LZYIGZTE.js +164 -0
- package/dist/chunk-LZYIGZTE.js.map +1 -0
- package/dist/chunk-MVO7NIPH.js +164 -0
- package/dist/chunk-MVO7NIPH.js.map +1 -0
- package/dist/chunk-NCZFYI4T.js +192 -0
- package/dist/chunk-NCZFYI4T.js.map +1 -0
- package/dist/chunk-OCAFG4UV.js +97 -0
- package/dist/chunk-OCAFG4UV.js.map +1 -0
- package/dist/chunk-OHBL3CTQ.js +113 -0
- package/dist/chunk-OHBL3CTQ.js.map +1 -0
- package/dist/chunk-OKN5AK5Z.js +340 -0
- package/dist/chunk-OKN5AK5Z.js.map +1 -0
- package/dist/chunk-Q6OLO22T.js +89 -0
- package/dist/chunk-Q6OLO22T.js.map +1 -0
- package/dist/chunk-R4JVUEWZ.js +32 -0
- package/dist/chunk-R4JVUEWZ.js.map +1 -0
- package/dist/chunk-RJIYLM7M.js +32 -0
- package/dist/chunk-RJIYLM7M.js.map +1 -0
- package/dist/chunk-RT5L7IEL.js +29 -0
- package/dist/chunk-RT5L7IEL.js.map +1 -0
- package/dist/chunk-SHFRE4AI.js +340 -0
- package/dist/chunk-SHFRE4AI.js.map +1 -0
- package/dist/chunk-TRPACCEM.js +169 -0
- package/dist/chunk-TRPACCEM.js.map +1 -0
- package/dist/chunk-TT3Y6TU5.js +89 -0
- package/dist/chunk-TT3Y6TU5.js.map +1 -0
- package/dist/chunk-V5CNGZN6.js +87 -0
- package/dist/chunk-V5CNGZN6.js.map +1 -0
- package/dist/chunk-VIXDNPET.js +28 -0
- package/dist/chunk-VIXDNPET.js.map +1 -0
- package/dist/chunk-VKEZRJ2L.js +128 -0
- package/dist/chunk-VKEZRJ2L.js.map +1 -0
- package/dist/chunk-WVD5KKRC.js +97 -0
- package/dist/chunk-WVD5KKRC.js.map +1 -0
- package/dist/chunk-Y44Z3OUE.js +89 -0
- package/dist/chunk-Y44Z3OUE.js.map +1 -0
- package/dist/chunk-YY45YYJE.js +28 -0
- package/dist/chunk-YY45YYJE.js.map +1 -0
- package/dist/index.cjs +291 -257
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -3
- package/dist/molecules/expand-table/index.js +3 -3
- package/dist/molecules/expand-table/row.js +3 -3
- package/dist/molecules/index.js +3 -3
- package/dist/molecules/navigation.js +3 -3
- package/dist/molecules/tag-selector.js +3 -3
- package/package.json +3 -3
- package/src/atoms/dialog.tsx +5 -4
- package/src/atoms/text-area.tsx +29 -1
- package/src/atoms/text-field.tsx +29 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AlertDialog, AspectRatio, Blockquote, BlockquoteProps, Box, BoxProps, Callout, CheckboxCards, Code, CodeProps, Container, ContainerProps, DataList, Em, EmProps, Flex, FlexProps, Grid, GridProps, HoverCard, IconButton, IconButtonProps, Inset, InsetProps, Kbd, KbdProps, Popover, Progress, ProgressProps, Quote, QuoteProps, Radio, RadioCards, RadioGroup, RadioProps, Button as RadixButton, ButtonProps as RadixButtonProps, Heading as RadixHeading, ScrollArea, ScrollAreaProps, Section, SectionProps, SegmentedControl, Separator, SeparatorProps, Skeleton, SkeletonProps, Spinner, SpinnerProps, Strong, StrongProps, Switch, SwitchProps, TabNav, Tabs,
|
|
1
|
+
export { AlertDialog, AspectRatio, Blockquote, BlockquoteProps, Box, BoxProps, Callout, CheckboxCards, Code, CodeProps, Container, ContainerProps, DataList, Em, EmProps, Flex, FlexProps, Grid, GridProps, HoverCard, IconButton, IconButtonProps, Inset, InsetProps, Kbd, KbdProps, Popover, Progress, ProgressProps, Quote, QuoteProps, Radio, RadioCards, RadioGroup, RadioProps, Button as RadixButton, ButtonProps as RadixButtonProps, Heading as RadixHeading, ScrollArea, ScrollAreaProps, Section, SectionProps, SegmentedControl, Separator, SeparatorProps, Skeleton, SkeletonProps, Spinner, SpinnerProps, Strong, StrongProps, Switch, SwitchProps, TabNav, Tabs, Tooltip, TooltipProps, useThemeContext } from '@radix-ui/themes';
|
|
2
2
|
export { Avatar, AvatarProps } from './atoms/avatar.cjs';
|
|
3
3
|
export { Badge, BadgeProps } from './atoms/badge.cjs';
|
|
4
4
|
export { Button } from './atoms/button.cjs';
|
|
@@ -11,7 +11,9 @@ export { DropdownMenu } from './atoms/dropdown-menu.cjs';
|
|
|
11
11
|
export { Heading, HeadingProps } from './atoms/heading.cjs';
|
|
12
12
|
export { Link, LinkProps } from './atoms/link.cjs';
|
|
13
13
|
export { ContentProps, Select } from './atoms/select.cjs';
|
|
14
|
+
export { TextArea, TextAreaProps } from './atoms/text-area.cjs';
|
|
14
15
|
export { Typo, TypoProps } from './atoms/typo.cjs';
|
|
16
|
+
export { RootProps, SlotProps, TextField } from './atoms/text-field.cjs';
|
|
15
17
|
export { Collapse, CollapseProps } from './atoms/collapse.cjs';
|
|
16
18
|
export { Pagination, PaginationProps } from './atoms/pagination.cjs';
|
|
17
19
|
export { FieldErrorWrapper, FieldErrorWrapperProps } from './atoms/field-error-wrapper.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AlertDialog, AspectRatio, Blockquote, BlockquoteProps, Box, BoxProps, Callout, CheckboxCards, Code, CodeProps, Container, ContainerProps, DataList, Em, EmProps, Flex, FlexProps, Grid, GridProps, HoverCard, IconButton, IconButtonProps, Inset, InsetProps, Kbd, KbdProps, Popover, Progress, ProgressProps, Quote, QuoteProps, Radio, RadioCards, RadioGroup, RadioProps, Button as RadixButton, ButtonProps as RadixButtonProps, Heading as RadixHeading, ScrollArea, ScrollAreaProps, Section, SectionProps, SegmentedControl, Separator, SeparatorProps, Skeleton, SkeletonProps, Spinner, SpinnerProps, Strong, StrongProps, Switch, SwitchProps, TabNav, Tabs,
|
|
1
|
+
export { AlertDialog, AspectRatio, Blockquote, BlockquoteProps, Box, BoxProps, Callout, CheckboxCards, Code, CodeProps, Container, ContainerProps, DataList, Em, EmProps, Flex, FlexProps, Grid, GridProps, HoverCard, IconButton, IconButtonProps, Inset, InsetProps, Kbd, KbdProps, Popover, Progress, ProgressProps, Quote, QuoteProps, Radio, RadioCards, RadioGroup, RadioProps, Button as RadixButton, ButtonProps as RadixButtonProps, Heading as RadixHeading, ScrollArea, ScrollAreaProps, Section, SectionProps, SegmentedControl, Separator, SeparatorProps, Skeleton, SkeletonProps, Spinner, SpinnerProps, Strong, StrongProps, Switch, SwitchProps, TabNav, Tabs, Tooltip, TooltipProps, useThemeContext } from '@radix-ui/themes';
|
|
2
2
|
export { Avatar, AvatarProps } from './atoms/avatar.js';
|
|
3
3
|
export { Badge, BadgeProps } from './atoms/badge.js';
|
|
4
4
|
export { Button } from './atoms/button.js';
|
|
@@ -11,7 +11,9 @@ export { DropdownMenu } from './atoms/dropdown-menu.js';
|
|
|
11
11
|
export { Heading, HeadingProps } from './atoms/heading.js';
|
|
12
12
|
export { Link, LinkProps } from './atoms/link.js';
|
|
13
13
|
export { ContentProps, Select } from './atoms/select.js';
|
|
14
|
+
export { TextArea, TextAreaProps } from './atoms/text-area.js';
|
|
14
15
|
export { Typo, TypoProps } from './atoms/typo.js';
|
|
16
|
+
export { RootProps, SlotProps, TextField } from './atoms/text-field.js';
|
|
15
17
|
export { Collapse, CollapseProps } from './atoms/collapse.js';
|
|
16
18
|
export { Pagination, PaginationProps } from './atoms/pagination.js';
|
|
17
19
|
export { FieldErrorWrapper, FieldErrorWrapperProps } from './atoms/field-error-wrapper.js';
|
package/dist/index.js
CHANGED
|
@@ -49,10 +49,10 @@ import {
|
|
|
49
49
|
} from "./chunk-DWCPI2UN.js";
|
|
50
50
|
import {
|
|
51
51
|
TextArea
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-R4JVUEWZ.js";
|
|
53
53
|
import {
|
|
54
54
|
TextField
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-YY45YYJE.js";
|
|
56
56
|
import {
|
|
57
57
|
ToastContainer,
|
|
58
58
|
toast
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
} from "./chunk-VTJZMOSP.js";
|
|
183
183
|
import {
|
|
184
184
|
Dialog
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-2VD5Y72N.js";
|
|
186
186
|
import {
|
|
187
187
|
Avatar
|
|
188
188
|
} from "./chunk-3SSSCLJ5.js";
|
|
@@ -7,8 +7,8 @@ import "../../chunk-BSTJBBEX.js";
|
|
|
7
7
|
import "../../chunk-NDUKDKGB.js";
|
|
8
8
|
import "../../chunk-KTVZ4KLX.js";
|
|
9
9
|
import "../../chunk-DWCPI2UN.js";
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-R4JVUEWZ.js";
|
|
11
|
+
import "../../chunk-YY45YYJE.js";
|
|
12
12
|
import "../../chunk-CYYWMYE7.js";
|
|
13
13
|
import "../../chunk-3JRNKBMN.js";
|
|
14
14
|
import "../../chunk-HYITAA4J.js";
|
|
@@ -50,7 +50,7 @@ import "../../chunk-OHMOP5PV.js";
|
|
|
50
50
|
import "../../chunk-LZJR77Q2.js";
|
|
51
51
|
import "../../chunk-Q37G2GS6.js";
|
|
52
52
|
import "../../chunk-VTJZMOSP.js";
|
|
53
|
-
import "../../chunk-
|
|
53
|
+
import "../../chunk-2VD5Y72N.js";
|
|
54
54
|
import "../../chunk-3SSSCLJ5.js";
|
|
55
55
|
import "../../chunk-EWD4AO5N.js";
|
|
56
56
|
import "../../chunk-YGL6SWKN.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-PCWEW2UL.js";
|
|
4
4
|
import "../../chunk-KTVZ4KLX.js";
|
|
5
5
|
import "../../chunk-DWCPI2UN.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-R4JVUEWZ.js";
|
|
7
|
+
import "../../chunk-YY45YYJE.js";
|
|
8
8
|
import "../../chunk-CYYWMYE7.js";
|
|
9
9
|
import "../../chunk-3JRNKBMN.js";
|
|
10
10
|
import "../../chunk-HYITAA4J.js";
|
|
@@ -46,7 +46,7 @@ import "../../chunk-OHMOP5PV.js";
|
|
|
46
46
|
import "../../chunk-LZJR77Q2.js";
|
|
47
47
|
import "../../chunk-Q37G2GS6.js";
|
|
48
48
|
import "../../chunk-VTJZMOSP.js";
|
|
49
|
-
import "../../chunk-
|
|
49
|
+
import "../../chunk-2VD5Y72N.js";
|
|
50
50
|
import "../../chunk-3SSSCLJ5.js";
|
|
51
51
|
import "../../chunk-EWD4AO5N.js";
|
|
52
52
|
import "../../chunk-YGL6SWKN.js";
|
package/dist/molecules/index.js
CHANGED
|
@@ -27,8 +27,8 @@ import "../chunk-BSTJBBEX.js";
|
|
|
27
27
|
import "../chunk-NDUKDKGB.js";
|
|
28
28
|
import "../chunk-KTVZ4KLX.js";
|
|
29
29
|
import "../chunk-DWCPI2UN.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-R4JVUEWZ.js";
|
|
31
|
+
import "../chunk-YY45YYJE.js";
|
|
32
32
|
import "../chunk-CYYWMYE7.js";
|
|
33
33
|
import "../chunk-3JRNKBMN.js";
|
|
34
34
|
import "../chunk-HYITAA4J.js";
|
|
@@ -70,7 +70,7 @@ import "../chunk-OHMOP5PV.js";
|
|
|
70
70
|
import "../chunk-LZJR77Q2.js";
|
|
71
71
|
import "../chunk-Q37G2GS6.js";
|
|
72
72
|
import "../chunk-VTJZMOSP.js";
|
|
73
|
-
import "../chunk-
|
|
73
|
+
import "../chunk-2VD5Y72N.js";
|
|
74
74
|
import "../chunk-3SSSCLJ5.js";
|
|
75
75
|
import "../chunk-EWD4AO5N.js";
|
|
76
76
|
import "../chunk-YGL6SWKN.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../chunk-OCINOC2X.js";
|
|
4
4
|
import "../chunk-KTVZ4KLX.js";
|
|
5
5
|
import "../chunk-DWCPI2UN.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-R4JVUEWZ.js";
|
|
7
|
+
import "../chunk-YY45YYJE.js";
|
|
8
8
|
import "../chunk-CYYWMYE7.js";
|
|
9
9
|
import "../chunk-3JRNKBMN.js";
|
|
10
10
|
import "../chunk-HYITAA4J.js";
|
|
@@ -46,7 +46,7 @@ import "../chunk-OHMOP5PV.js";
|
|
|
46
46
|
import "../chunk-LZJR77Q2.js";
|
|
47
47
|
import "../chunk-Q37G2GS6.js";
|
|
48
48
|
import "../chunk-VTJZMOSP.js";
|
|
49
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-2VD5Y72N.js";
|
|
50
50
|
import "../chunk-3SSSCLJ5.js";
|
|
51
51
|
import "../chunk-EWD4AO5N.js";
|
|
52
52
|
import "../chunk-YGL6SWKN.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../chunk-66QBRZEL.js";
|
|
4
4
|
import "../chunk-KTVZ4KLX.js";
|
|
5
5
|
import "../chunk-DWCPI2UN.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-R4JVUEWZ.js";
|
|
7
|
+
import "../chunk-YY45YYJE.js";
|
|
8
8
|
import "../chunk-CYYWMYE7.js";
|
|
9
9
|
import "../chunk-3JRNKBMN.js";
|
|
10
10
|
import "../chunk-HYITAA4J.js";
|
|
@@ -46,7 +46,7 @@ import "../chunk-OHMOP5PV.js";
|
|
|
46
46
|
import "../chunk-LZJR77Q2.js";
|
|
47
47
|
import "../chunk-Q37G2GS6.js";
|
|
48
48
|
import "../chunk-VTJZMOSP.js";
|
|
49
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-2VD5Y72N.js";
|
|
50
50
|
import "../chunk-3SSSCLJ5.js";
|
|
51
51
|
import "../chunk-EWD4AO5N.js";
|
|
52
52
|
import "../chunk-YGL6SWKN.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tipp/ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"ts-node": "^10.9.2",
|
|
59
59
|
"tsup": "^8.0.2",
|
|
60
60
|
"typescript": "^5.3.3",
|
|
61
|
-
"@tipp/
|
|
62
|
-
"@tipp/
|
|
61
|
+
"@tipp/typescript-config": "1.0.0",
|
|
62
|
+
"@tipp/eslint-config": "1.0.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "pnpm run build:js && pnpm run build:css",
|
package/src/atoms/dialog.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
2
2
|
import { Cross1Icon } from '@radix-ui/react-icons';
|
|
3
3
|
import { Flex } from '@radix-ui/themes';
|
|
4
|
-
import {
|
|
4
|
+
import { useRef } from 'react';
|
|
5
5
|
import { Button } from './button';
|
|
6
6
|
|
|
7
7
|
type ContentProps = RadixDialog.DialogContentProps & {
|
|
@@ -27,9 +27,10 @@ function Content(props: ContentProps): React.ReactElement {
|
|
|
27
27
|
} = props;
|
|
28
28
|
const containerRef = useRef<Element | null>(null);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
if (typeof document !== 'undefined') {
|
|
31
|
+
const container = document.getElementsByClassName('radix-themes')[0];
|
|
32
|
+
containerRef.current = container;
|
|
33
|
+
}
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<RadixDialog.Portal container={containerRef.current}>
|
package/src/atoms/text-area.tsx
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
TextArea as RTextArea,
|
|
3
|
+
type TextAreaProps as RTextAreaProps,
|
|
4
|
+
} from '@radix-ui/themes';
|
|
5
|
+
import { forwardRef, useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
type TextAreaProps = RTextAreaProps & {
|
|
8
|
+
error?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
12
|
+
(props, ref) => {
|
|
13
|
+
const { error, style, ...rest } = props;
|
|
14
|
+
const fieldStyle = useMemo(() => {
|
|
15
|
+
if (!style && !error) return undefined;
|
|
16
|
+
const errorStyle = {
|
|
17
|
+
boxShadow: 'inset 0 0 0 var(--text-area-border-width) var(--error-11)',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return { ...(style || {}), ...errorStyle };
|
|
21
|
+
}, [error, style]);
|
|
22
|
+
|
|
23
|
+
return <RTextArea {...rest} ref={ref} style={fieldStyle} />;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
TextArea.displayName = 'TextArea';
|
|
28
|
+
|
|
29
|
+
export { TextArea, type TextAreaProps };
|
package/src/atoms/text-field.tsx
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { TextField as RTextField } from '@radix-ui/themes';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
type RSlotProps = RTextField.SlotProps;
|
|
5
|
+
|
|
6
|
+
type RootProps = RTextField.RootProps & { error?: boolean };
|
|
7
|
+
|
|
8
|
+
const Root = forwardRef<
|
|
9
|
+
HTMLInputElement,
|
|
10
|
+
RTextField.RootProps & { error?: boolean }
|
|
11
|
+
>((props, ref) => {
|
|
12
|
+
const { error, style, ...rest } = props;
|
|
13
|
+
const fieldStyle = useMemo(() => {
|
|
14
|
+
if (!style && !error) return undefined;
|
|
15
|
+
const errorStyle = {
|
|
16
|
+
boxShadow: 'inset 0 0 0 var(--text-field-border-width) var(--error-11)',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return { ...(style || {}), ...errorStyle };
|
|
20
|
+
}, [error, style]);
|
|
21
|
+
return <RTextField.Root ref={ref} style={fieldStyle} {...rest} />;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
Root.displayName = 'TextField.Root';
|
|
25
|
+
|
|
26
|
+
const TextField = { Root, Slot: RTextField.Slot };
|
|
27
|
+
|
|
28
|
+
export { TextField };
|
|
29
|
+
export type { RootProps, RSlotProps as SlotProps };
|