@optiaxiom/react 0.1.0-next.4 → 0.1.0-next.6
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/animate-presence/AnimatePresence.js +36 -0
- package/dist/animate-presence/PresenceContext.js +11 -0
- package/dist/animate-presence/usePresence.js +13 -0
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-CihLlW6Z.css +6 -0
- package/dist/assets/src/button/{Button.css.ts.vanilla-VaFYcYGO.css → Button.css.ts.vanilla-CAppQRyC.css} +10 -37
- package/dist/assets/src/button-group/ButtonGroup.css.ts.vanilla-xsXT6MRu.css +28 -0
- package/dist/assets/src/input/Input.css.ts.vanilla-X0R-SsOp.css +32 -0
- package/dist/assets/src/separator/{Separator.css.ts.vanilla-DYzKo87M.css → Separator.css.ts.vanilla-C_EYtori.css} +8 -14
- package/dist/assets/src/sprinkles/{sprinkles.css.ts.vanilla-NXW-pecy.css → sprinkles.css.ts.vanilla-CDl96MYc.css} +1659 -1651
- package/dist/assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css +4 -0
- package/dist/assets/src/styles/{theme.css.ts.vanilla-Cb0QJvUK.css → theme.css.ts.vanilla-0B4GnT52.css} +4 -2
- package/dist/assets/src/text/{Text.css.ts.vanilla-BtaUGYv3.css → Text.css.ts.vanilla-DK_dMlGe.css} +0 -4
- package/dist/assets/src/transition/{Transition.css.ts.vanilla-qjeQECVe.css → Transition.css.ts.vanilla-COX8x_Bo.css} +18 -9
- package/dist/avatar/Avatar-css.js +5 -7
- package/dist/avatar/Avatar.js +2 -3
- package/dist/box/Box-css.js +5 -4
- package/dist/box/Box.js +2 -2
- package/dist/button/Button-css.js +5 -5
- package/dist/button/Button.js +9 -19
- package/dist/button-group/ButtonGroup-css.js +7 -0
- package/dist/button-group/ButtonGroup.js +54 -0
- package/dist/code/Code-css.js +4 -3
- package/dist/code/Code.js +2 -3
- package/dist/field/Field.js +41 -0
- package/dist/index.d.ts +304 -371
- package/dist/index.js +5 -0
- package/dist/input/Input-css.js +6 -6
- package/dist/input/Input.js +2 -3
- package/dist/kbd/Kbd-css.js +5 -4
- package/dist/kbd/Kbd.js +3 -4
- package/dist/progress/Progress.js +18 -16
- package/dist/separator/Separator-css.js +5 -5
- package/dist/separator/Separator.js +1 -5
- package/dist/skeleton/Skeleton-css.js +4 -3
- package/dist/skeleton/Skeleton.js +2 -3
- package/dist/sprinkles/sprinkles-css.js +4 -4
- package/dist/styles/layers-css.js +3 -2
- package/dist/styles/theme-css.js +2 -2
- package/dist/text/Text-css.js +5 -5
- package/dist/text/Text.js +3 -8
- package/dist/tokens/borderRadius.js +1 -1
- package/dist/tokens/zIndex.js +2 -1
- package/dist/tooltip/Tooltip.js +18 -6
- package/dist/transition/Transition-css.js +6 -5
- package/dist/transition/Transition.js +11 -20
- package/dist/vanilla-extract/recipeRuntime.js +51 -0
- package/package.json +4 -5
- package/dist/assets/src/avatar/Avatar.css.ts.vanilla-DdarHYxU.css +0 -11
- package/dist/assets/src/input/Input.css.ts.vanilla-CICpzaz6.css +0 -68
- package/dist/assets/src/styles/layers.css.ts.vanilla-D6EvK_O8.css +0 -3
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--ax-borderRadius-md: 0.375rem;
|
|
5
5
|
--ax-borderRadius-lg: 0.5rem;
|
|
6
6
|
--ax-borderRadius-xl: 0.75rem;
|
|
7
|
-
--ax-borderRadius-full:
|
|
7
|
+
--ax-borderRadius-full: 9999px;
|
|
8
8
|
--ax-borderRadius-none: 0;
|
|
9
9
|
--ax-borderWidth-0: 0;
|
|
10
10
|
--ax-borderWidth-1: 1px;
|
|
@@ -317,6 +317,7 @@
|
|
|
317
317
|
--ax-zIndex-40: 40;
|
|
318
318
|
--ax-zIndex-50: 50;
|
|
319
319
|
--ax-zIndex-auto: auto;
|
|
320
|
+
--ax-zIndex-popover: 1500;
|
|
320
321
|
}
|
|
321
322
|
:root.dark {
|
|
322
323
|
--ax-borderRadius-xs: 0.125rem;
|
|
@@ -324,7 +325,7 @@
|
|
|
324
325
|
--ax-borderRadius-md: 0.375rem;
|
|
325
326
|
--ax-borderRadius-lg: 0.5rem;
|
|
326
327
|
--ax-borderRadius-xl: 0.75rem;
|
|
327
|
-
--ax-borderRadius-full:
|
|
328
|
+
--ax-borderRadius-full: 9999px;
|
|
328
329
|
--ax-borderRadius-none: 0;
|
|
329
330
|
--ax-borderWidth-0: 0;
|
|
330
331
|
--ax-borderWidth-1: 1px;
|
|
@@ -637,4 +638,5 @@
|
|
|
637
638
|
--ax-zIndex-40: 40;
|
|
638
639
|
--ax-zIndex-50: 50;
|
|
639
640
|
--ax-zIndex-auto: auto;
|
|
641
|
+
--ax-zIndex-popover: 1500;
|
|
640
642
|
}
|
package/dist/assets/src/text/{Text.css.ts.vanilla-BtaUGYv3.css → Text.css.ts.vanilla-DK_dMlGe.css}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer optiaxiom._1kfj4ga1;
|
|
2
2
|
@layer optiaxiom._1kfj4ga1 {
|
|
3
3
|
._13y7bdy0 {
|
|
4
|
-
overflow: hidden;
|
|
5
4
|
text-overflow: ellipsis;
|
|
6
5
|
}
|
|
7
6
|
._13y7bdy1 {
|
|
@@ -20,7 +19,4 @@
|
|
|
20
19
|
._13y7bdy5 {
|
|
21
20
|
-webkit-line-clamp: 4;
|
|
22
21
|
}
|
|
23
|
-
._13y7bdy6 {
|
|
24
|
-
white-space: nowrap;
|
|
25
|
-
}
|
|
26
22
|
}
|
|
@@ -6,41 +6,50 @@
|
|
|
6
6
|
transition-timing-function: ease;
|
|
7
7
|
}
|
|
8
8
|
._1p67mhc1 {
|
|
9
|
-
|
|
9
|
+
transition-duration: 250ms;
|
|
10
10
|
}
|
|
11
11
|
._1p67mhc2 {
|
|
12
|
+
transition-duration: 400ms;
|
|
13
|
+
}
|
|
14
|
+
._1p67mhc3 {
|
|
15
|
+
transition-duration: 550ms;
|
|
16
|
+
}
|
|
17
|
+
._1p67mhc4 {
|
|
18
|
+
opacity: 0;
|
|
19
|
+
}
|
|
20
|
+
._1p67mhc5 {
|
|
12
21
|
opacity: 0;
|
|
13
22
|
transform: translateY(-15px);
|
|
14
23
|
}
|
|
15
|
-
.
|
|
24
|
+
._1p67mhc6 {
|
|
16
25
|
opacity: 0;
|
|
17
26
|
transform: translateX(15px);
|
|
18
27
|
}
|
|
19
|
-
.
|
|
28
|
+
._1p67mhc7 {
|
|
20
29
|
opacity: 0;
|
|
21
30
|
transform: translateX(-15px);
|
|
22
31
|
}
|
|
23
|
-
.
|
|
32
|
+
._1p67mhc8 {
|
|
24
33
|
opacity: 0;
|
|
25
34
|
transform: translateY(15px);
|
|
26
35
|
}
|
|
27
|
-
.
|
|
36
|
+
._1p67mhc9 {
|
|
28
37
|
opacity: 0;
|
|
29
38
|
transform: scale(0.9);
|
|
30
39
|
}
|
|
31
|
-
.
|
|
40
|
+
._1p67mhca {
|
|
32
41
|
opacity: 0;
|
|
33
42
|
transform: scale(0.9) translateY(-10px);
|
|
34
43
|
}
|
|
35
|
-
.
|
|
44
|
+
._1p67mhcb {
|
|
36
45
|
opacity: 0;
|
|
37
46
|
transform: scale(0.9) translateX(10px);
|
|
38
47
|
}
|
|
39
|
-
.
|
|
48
|
+
._1p67mhcc {
|
|
40
49
|
opacity: 0;
|
|
41
50
|
transform: scale(0.9) translateX(-10px);
|
|
42
51
|
}
|
|
43
|
-
.
|
|
52
|
+
._1p67mhcd {
|
|
44
53
|
opacity: 0;
|
|
45
54
|
transform: scale(0.9) translateY(10px);
|
|
46
55
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import './../assets/src/styles/layers.css.ts.vanilla-
|
|
2
|
-
import './../assets/src/
|
|
3
|
-
import '
|
|
4
|
-
import './../assets/src/avatar/Avatar.css.ts.vanilla-DdarHYxU.css';
|
|
5
|
-
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
1
|
+
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
+
import './../assets/src/avatar/Avatar.css.ts.vanilla-CihLlW6Z.css';
|
|
3
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
6
4
|
|
|
7
|
-
var avatar =
|
|
8
|
-
var fallback =
|
|
5
|
+
var avatar = recipeRuntime({base:[{alignItems:'center',display:'inline-flex',justifyContent:'center',overflow:'hidden',rounded:'full'},'t64xwp0'],variants:{colorScheme:{blue:{bg:'blue.50',color:'blue.500'},brand:{bg:'brand.50',color:'brand.500'},dark:{bg:'dark.50',color:'dark.500'},gray:{bg:'gray.50',color:'gray.500'},green:{bg:'green.50',color:'green.500'},magenta:{bg:'magenta.50',color:'magenta.500'},neutral:{bg:'neutral.50',color:'neutral.500'},orange:{bg:'orange.50',color:'orange.500'},purple:{bg:'purple.50',color:'purple.500'},red:{bg:'red.50',color:'red.500'},slate:{bg:'slate.50',color:'slate.500'},yellow:{bg:'yellow.50',color:'yellow.500'}},size:{xs:{fontSize:'xs',size:'xs'},sm:{fontSize:'sm',size:'sm'},md:{fontSize:'md',size:'md'},lg:{fontSize:'lg',size:'lg'},xl:{fontSize:'xl',size:'xl'}}}});
|
|
6
|
+
var fallback = recipeRuntime({base:{alignItems:'center',display:'flex',justifyContent:'center',rounded:'inherit',size:'full',textTransform:'uppercase'},variants:{size:{xs:{px:'4'},sm:{px:'6'},md:{px:'8'},lg:{px:'10'},xl:{px:'20'}}}});
|
|
9
7
|
|
|
10
8
|
export { avatar, fallback };
|
package/dist/avatar/Avatar.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as RadixAvatar from '@radix-ui/react-avatar';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { Box } from '../box/Box.js';
|
|
6
5
|
import { avatar, fallback } from './Avatar-css.js';
|
|
@@ -27,11 +26,11 @@ const Avatar = forwardRef(
|
|
|
27
26
|
Box,
|
|
28
27
|
{
|
|
29
28
|
asChild: true,
|
|
30
|
-
|
|
29
|
+
...avatar({ colorScheme, size }, className),
|
|
31
30
|
...props,
|
|
32
31
|
children: /* @__PURE__ */ jsxs(RadixAvatar.Root, { ref, children: [
|
|
33
32
|
/* @__PURE__ */ jsx(Box, { asChild: true, objectFit: "cover", rounded: "inherit", size: "full", children: /* @__PURE__ */ jsx(RadixAvatar.Image, { alt: name, src }) }),
|
|
34
|
-
/* @__PURE__ */ jsx(Box, { asChild: true,
|
|
33
|
+
/* @__PURE__ */ jsx(Box, { asChild: true, ...fallback({ size }), children: /* @__PURE__ */ jsx(RadixAvatar.Fallback, { delayMs: FALLBACK_DELAY_IN_MS, children: icon ? icon : name ? getInitialsFromName(name) : children }) })
|
|
35
34
|
] })
|
|
36
35
|
}
|
|
37
36
|
);
|
package/dist/box/Box-css.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import './../assets/src/styles/layers.css.ts.vanilla-
|
|
2
|
-
import './../assets/src/styles/theme.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
+
import './../assets/src/styles/theme.css.ts.vanilla-0B4GnT52.css';
|
|
3
3
|
import './../assets/src/box/Box.css.ts.vanilla-DMx7YI4c.css';
|
|
4
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var box = recipeRuntime({base:'_1jn0ep0'});
|
|
6
7
|
|
|
7
|
-
export {
|
|
8
|
+
export { box };
|
package/dist/box/Box.js
CHANGED
|
@@ -6,7 +6,7 @@ import 'inter-ui/inter-variable.css';
|
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
import { extractSprinkles } from '../sprinkles/extractSprinkles.js';
|
|
8
8
|
import { sprinkles } from '../sprinkles/sprinkles-css.js';
|
|
9
|
-
import {
|
|
9
|
+
import { box } from './Box-css.js';
|
|
10
10
|
|
|
11
11
|
const Box = forwardRef(
|
|
12
12
|
({ asChild, className, ...props }, ref) => {
|
|
@@ -15,8 +15,8 @@ const Box = forwardRef(
|
|
|
15
15
|
return /* @__PURE__ */ jsx(
|
|
16
16
|
Comp,
|
|
17
17
|
{
|
|
18
|
-
className: clsx(className, base, sprinkles(sprinkleProps)),
|
|
19
18
|
ref,
|
|
19
|
+
...box({}, clsx(className, sprinkles(sprinkleProps))),
|
|
20
20
|
...restProps
|
|
21
21
|
}
|
|
22
22
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import './../assets/src/styles/layers.css.ts.vanilla-
|
|
2
|
-
import './../assets/src/styles/theme.css.ts.vanilla-
|
|
3
|
-
import './../assets/src/button/Button.css.ts.vanilla-
|
|
4
|
-
import {
|
|
1
|
+
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
+
import './../assets/src/styles/theme.css.ts.vanilla-0B4GnT52.css';
|
|
3
|
+
import './../assets/src/button/Button.css.ts.vanilla-CAppQRyC.css';
|
|
4
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
5
5
|
|
|
6
|
-
var button =
|
|
6
|
+
var button = recipeRuntime({base:[{alignItems:'center',display:'inline-flex',flexDirection:'row',gap:'xs',justifyContent:'center',overflow:'hidden',transition:'colors'},'_1gqmi2d3'],variants:{colorScheme:{danger:'_1gqmi2d4',primary:'_1gqmi2d5',secondary:'_1gqmi2d6'},size:{sm:{fontSize:'sm',h:'24',px:'10'},md:{fontSize:'md',h:'32',px:'12'},lg:{fontSize:'lg',h:'40',px:'16'}},variant:{ghost:'_1gqmi2d7',outline:'_1gqmi2d8',solid:'_1gqmi2d9'}},variantsCompounded:[{style:'_1gqmi2da',variants:{colorScheme:'secondary',variant:'outline'}}]});
|
|
7
7
|
|
|
8
8
|
export { button };
|
package/dist/button/Button.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Slottable, Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
5
4
|
import { Box } from '../box/Box.js';
|
|
6
|
-
import { Text } from '../text/Text.js';
|
|
7
5
|
import { button } from './Button-css.js';
|
|
8
6
|
|
|
9
7
|
const presets = {
|
|
@@ -22,7 +20,6 @@ const Button = forwardRef(
|
|
|
22
20
|
disabled,
|
|
23
21
|
isLoading,
|
|
24
22
|
leftSection,
|
|
25
|
-
onClick,
|
|
26
23
|
preset = "default",
|
|
27
24
|
rightSection,
|
|
28
25
|
size = "md",
|
|
@@ -30,36 +27,29 @@ const Button = forwardRef(
|
|
|
30
27
|
...props
|
|
31
28
|
}, ref) => {
|
|
32
29
|
const Comp = asChild ? Slot : "button";
|
|
33
|
-
children = asChild && isValidElement(children) ? cloneElement(
|
|
34
|
-
children,
|
|
35
|
-
void 0,
|
|
36
|
-
/* @__PURE__ */ jsx(Text, { as: "span", fontSize: "inherit", children: children.props.children })
|
|
37
|
-
) : /* @__PURE__ */ jsx(Text, { as: "span", fontSize: "inherit", children });
|
|
38
30
|
const presetProps = presets[preset];
|
|
39
31
|
const finalColorScheme = colorScheme ?? presetProps.colorScheme;
|
|
40
32
|
const finalVariant = variant ?? presetProps.variant;
|
|
41
|
-
const isDisabled = disabled || isLoading;
|
|
33
|
+
const isDisabled = Boolean(disabled || isLoading);
|
|
42
34
|
return /* @__PURE__ */ jsx(
|
|
43
35
|
Box,
|
|
44
36
|
{
|
|
45
|
-
"aria-disabled": isDisabled,
|
|
46
37
|
asChild: true,
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
"data-disabled": isDisabled,
|
|
39
|
+
...button(
|
|
40
|
+
{
|
|
49
41
|
colorScheme: finalColorScheme,
|
|
50
42
|
size,
|
|
51
43
|
variant: finalVariant
|
|
52
|
-
}
|
|
44
|
+
},
|
|
53
45
|
className
|
|
54
46
|
),
|
|
55
|
-
"data-disabled": isDisabled,
|
|
56
|
-
onClick: isDisabled ? void 0 : onClick,
|
|
57
47
|
...props,
|
|
58
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ jsxs(Comp, { disabled: isDisabled, ref, children: [
|
|
59
49
|
leftSection,
|
|
60
50
|
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
61
51
|
rightSection
|
|
62
|
-
] })
|
|
52
|
+
] })
|
|
63
53
|
}
|
|
64
54
|
);
|
|
65
55
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
|
+
import './../assets/src/button-group/ButtonGroup.css.ts.vanilla-xsXT6MRu.css';
|
|
3
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
4
|
+
|
|
5
|
+
var button = recipeRuntime({base:'_1sewcgl0',variants:{orientation:{horizontal:'_1sewcgl1',vertical:'_1sewcgl2'},spacing:{false:{},true:{}}},variantsCompounded:[{style:'_1sewcgl3',variants:{orientation:'horizontal',spacing:false}},{style:'_1sewcgl4',variants:{orientation:'vertical',spacing:false}}]});
|
|
6
|
+
|
|
7
|
+
export { button };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, Children, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { Box } from '../box/Box.js';
|
|
4
|
+
import { Flex } from '../flex/Flex.js';
|
|
5
|
+
import { button } from './ButtonGroup-css.js';
|
|
6
|
+
|
|
7
|
+
const ButtonGroup = forwardRef(
|
|
8
|
+
({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
colorScheme,
|
|
12
|
+
disabled,
|
|
13
|
+
gap = "0",
|
|
14
|
+
orientation = "horizontal",
|
|
15
|
+
preset,
|
|
16
|
+
size,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const mappedChildren = Children.map(children, (child) => {
|
|
21
|
+
if (isValidElement(child)) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Box,
|
|
24
|
+
{
|
|
25
|
+
asChild: true,
|
|
26
|
+
...button({ orientation, spacing: gap !== "0" }),
|
|
27
|
+
children: cloneElement(child, {
|
|
28
|
+
colorScheme: child.props.colorScheme || colorScheme,
|
|
29
|
+
disabled: child.props.disabled || disabled,
|
|
30
|
+
preset: child.props.preset || preset,
|
|
31
|
+
size: child.props.size || size,
|
|
32
|
+
variant: child.props.variant || variant
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return child;
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
Flex,
|
|
41
|
+
{
|
|
42
|
+
className,
|
|
43
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
44
|
+
gap,
|
|
45
|
+
ref,
|
|
46
|
+
...props,
|
|
47
|
+
children: mappedChildren
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
ButtonGroup.displayName = "@optiaxiom/react/ButtonGroup";
|
|
53
|
+
|
|
54
|
+
export { ButtonGroup };
|
package/dist/code/Code-css.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import './../assets/src/styles/layers.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/styles/layers.css.ts.vanilla-D5zCXZwe.css';
|
|
2
2
|
import './../assets/src/code/Code.css.ts.vanilla-Dz07Qp9h.css';
|
|
3
|
+
import { recipeRuntime } from '../vanilla-extract/recipeRuntime.js';
|
|
3
4
|
|
|
4
|
-
var
|
|
5
|
+
var code = recipeRuntime({base:'go7emt0'});
|
|
5
6
|
|
|
6
|
-
export {
|
|
7
|
+
export { code };
|
package/dist/code/Code.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
3
|
import { forwardRef } from 'react';
|
|
5
4
|
import { Box } from '../box/Box.js';
|
|
6
|
-
import {
|
|
5
|
+
import { code } from './Code-css.js';
|
|
7
6
|
|
|
8
7
|
const Code = forwardRef(
|
|
9
8
|
({ asChild, children, className, ...props }, ref) => {
|
|
@@ -13,10 +12,10 @@ const Code = forwardRef(
|
|
|
13
12
|
{
|
|
14
13
|
asChild: true,
|
|
15
14
|
bg: "bg.neutral",
|
|
16
|
-
className: clsx(className, base),
|
|
17
15
|
display: "inline-block",
|
|
18
16
|
px: "4",
|
|
19
17
|
rounded: "sm",
|
|
18
|
+
...code({}, className),
|
|
20
19
|
...props,
|
|
21
20
|
children: /* @__PURE__ */ jsx(Comp, { ref, children })
|
|
22
21
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as RadixLabel from '@radix-ui/react-label';
|
|
3
|
+
import { useId } from '@reach/auto-id';
|
|
4
|
+
import { forwardRef, cloneElement } from 'react';
|
|
5
|
+
import { Flex } from '../flex/Flex.js';
|
|
6
|
+
import { Text } from '../text/Text.js';
|
|
7
|
+
|
|
8
|
+
const Field = forwardRef(
|
|
9
|
+
({
|
|
10
|
+
children,
|
|
11
|
+
description,
|
|
12
|
+
disabled,
|
|
13
|
+
error,
|
|
14
|
+
id: idProp,
|
|
15
|
+
label,
|
|
16
|
+
required,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const id = useId(idProp);
|
|
20
|
+
return /* @__PURE__ */ jsxs(Flex, { flexDirection: "column", gap: "2", maxW: "sm", ref, ...props, children: [
|
|
21
|
+
label && /* @__PURE__ */ jsx(Text, { asChild: true, children: /* @__PURE__ */ jsxs(RadixLabel.Root, { htmlFor: id, children: [
|
|
22
|
+
label,
|
|
23
|
+
required && /* @__PURE__ */ jsxs(Text, { "aria-hidden": "true", as: "span", color: "fg.error", children: [
|
|
24
|
+
" ",
|
|
25
|
+
"*"
|
|
26
|
+
] })
|
|
27
|
+
] }) }),
|
|
28
|
+
cloneElement(children, {
|
|
29
|
+
disabled,
|
|
30
|
+
error: !!error,
|
|
31
|
+
id,
|
|
32
|
+
required
|
|
33
|
+
}),
|
|
34
|
+
description && /* @__PURE__ */ jsx(Text, { as: "p", color: "fg.default", fontSize: "sm", children: description }),
|
|
35
|
+
error && /* @__PURE__ */ jsx(Text, { as: "p", color: "fg.error", fontSize: "sm", children: error })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
Field.displayName = "@optiaxiom/react/Field";
|
|
40
|
+
|
|
41
|
+
export { Field };
|