@zicas/ui 0.0.0-stage → 0.1.0-beta.0
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/LICENSE +21 -0
- package/README.md +76 -2
- package/dist/accordion.d.ts +23 -0
- package/dist/accordion.js +105 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.js +50 -0
- package/dist/avatar.d.ts +14 -0
- package/dist/avatar.js +53 -0
- package/dist/badge.d.ts +11 -0
- package/dist/badge.js +46 -0
- package/dist/breadcrumb.d.ts +26 -0
- package/dist/breadcrumb.js +92 -0
- package/dist/button.d.ts +17 -0
- package/dist/button.js +174 -0
- package/dist/card.d.ts +24 -0
- package/dist/card.js +81 -0
- package/dist/checkbox.d.ts +9 -0
- package/dist/checkbox.js +91 -0
- package/dist/dialog.d.ts +39 -0
- package/dist/dialog.js +195 -0
- package/dist/direction.d.ts +17 -0
- package/dist/direction.js +93 -0
- package/dist/dropdown-menu.d.ts +39 -0
- package/dist/dropdown-menu.js +189 -0
- package/dist/field.d.ts +24 -0
- package/dist/field.js +59 -0
- package/dist/icon-button.d.ts +15 -0
- package/dist/icon-button.js +50 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +36 -0
- package/dist/inline.d.ts +12 -0
- package/dist/inline.js +25 -0
- package/dist/input.d.ts +9 -0
- package/dist/input.js +54 -0
- package/dist/navbar.d.ts +44 -0
- package/dist/navbar.js +258 -0
- package/dist/popover.d.ts +36 -0
- package/dist/popover.js +148 -0
- package/dist/progress.d.ts +23 -0
- package/dist/progress.js +67 -0
- package/dist/radio.d.ts +15 -0
- package/dist/radio.js +93 -0
- package/dist/scroll-area.d.ts +21 -0
- package/dist/scroll-area.js +120 -0
- package/dist/select.d.ts +37 -0
- package/dist/select.js +260 -0
- package/dist/semantic-colors.stylex.d.ts +22 -0
- package/dist/semantic-colors.stylex.js +23 -0
- package/dist/separator.d.ts +9 -0
- package/dist/separator.js +26 -0
- package/dist/skeleton.d.ts +6 -0
- package/dist/skeleton.js +18 -0
- package/dist/stack.d.ts +11 -0
- package/dist/stack.js +24 -0
- package/dist/surface.d.ts +9 -0
- package/dist/surface.js +18 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.js +73 -0
- package/dist/table.d.ts +34 -0
- package/dist/table.js +84 -0
- package/dist/tabs.d.ts +19 -0
- package/dist/tabs.js +115 -0
- package/dist/text.d.ts +14 -0
- package/dist/text.js +31 -0
- package/dist/textarea.d.ts +8 -0
- package/dist/textarea.js +70 -0
- package/dist/theme-root.d.ts +9 -0
- package/dist/theme-root.js +61 -0
- package/dist/theme-types.d.ts +16 -0
- package/dist/theme-types.js +0 -0
- package/dist/themes/atelier-theme.d.ts +2 -0
- package/dist/themes/atelier-theme.js +3 -0
- package/dist/themes/compact-theme.d.ts +2 -0
- package/dist/themes/compact-theme.js +3 -0
- package/dist/themes/compose-theme.d.ts +27 -0
- package/dist/themes/compose-theme.js +82 -0
- package/dist/themes/fragments/borders.d.ts +34 -0
- package/dist/themes/fragments/borders.js +19 -0
- package/dist/themes/fragments/density.d.ts +58 -0
- package/dist/themes/fragments/density.js +31 -0
- package/dist/themes/fragments/elevation.d.ts +34 -0
- package/dist/themes/fragments/elevation.js +19 -0
- package/dist/themes/fragments/font-family.d.ts +16 -0
- package/dist/themes/fragments/font-family.js +9 -0
- package/dist/themes/fragments/line-height.d.ts +24 -0
- package/dist/themes/fragments/line-height.js +13 -0
- package/dist/themes/fragments/motion.d.ts +40 -0
- package/dist/themes/fragments/motion.js +21 -0
- package/dist/themes/fragments/radius.d.ts +60 -0
- package/dist/themes/fragments/radius.js +13 -0
- package/dist/themes/fragments/semantic-colors.d.ts +151 -0
- package/dist/themes/fragments/semantic-colors.js +68 -0
- package/dist/themes/fragments/type-scale.d.ts +36 -0
- package/dist/themes/fragments/type-scale.js +16 -0
- package/dist/themes/nitro-theme.d.ts +2 -0
- package/dist/themes/nitro-theme.js +3 -0
- package/dist/token-types.d.ts +1 -0
- package/dist/token-types.js +0 -0
- package/dist/tokens.stylex.d.ts +59 -0
- package/dist/tokens.stylex.js +61 -0
- package/dist/tooltip.d.ts +23 -0
- package/dist/tooltip.js +89 -0
- package/package.json +42 -4
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useState } from "react";
|
|
3
|
+
import { DirectionProvider, useDirection } from "@base-ui/react/direction-provider";
|
|
4
|
+
function readDirection(element) {
|
|
5
|
+
return element.ownerDocument.defaultView?.getComputedStyle(element).direction === "rtl" ? "rtl" : "ltr";
|
|
6
|
+
}
|
|
7
|
+
function useElementDirection(element) {
|
|
8
|
+
const [direction, setDirection] = useState();
|
|
9
|
+
const syncDirection = useCallback((target = element) => {
|
|
10
|
+
if (target) setDirection(readDirection(target));
|
|
11
|
+
}, [element]);
|
|
12
|
+
useLayoutEffect(() => {
|
|
13
|
+
if (!element) return;
|
|
14
|
+
syncDirection();
|
|
15
|
+
const observer = new MutationObserver(() => syncDirection());
|
|
16
|
+
for (let ancestor = element; ancestor; ancestor = ancestor.parentElement) observer.observe(ancestor, {
|
|
17
|
+
attributes: true,
|
|
18
|
+
attributeFilter: [
|
|
19
|
+
"dir",
|
|
20
|
+
"class",
|
|
21
|
+
"style"
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
return () => observer.disconnect();
|
|
25
|
+
}, [element, syncDirection]);
|
|
26
|
+
return [direction, syncDirection];
|
|
27
|
+
}
|
|
28
|
+
function ElementDirectionProvider({ direction, children }) {
|
|
29
|
+
const inheritedDirection = useDirection();
|
|
30
|
+
return jsx(DirectionProvider, {
|
|
31
|
+
direction: direction ?? inheritedDirection,
|
|
32
|
+
children
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var PopupDirectionContext = createContext(null);
|
|
36
|
+
function PopupDirectionProvider({ children }) {
|
|
37
|
+
const [anchor, setAnchor] = useState(null);
|
|
38
|
+
const [direction, syncDirection] = useElementDirection(anchor);
|
|
39
|
+
return jsx(PopupDirectionContext.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
direction,
|
|
42
|
+
setAnchor,
|
|
43
|
+
syncDirection
|
|
44
|
+
},
|
|
45
|
+
children: jsx(ElementDirectionProvider, {
|
|
46
|
+
direction,
|
|
47
|
+
children
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function usePopupAnchorRef() {
|
|
52
|
+
const setAnchor = useContext(PopupDirectionContext)?.setAnchor;
|
|
53
|
+
const [element, setElement] = useState(null);
|
|
54
|
+
useLayoutEffect(() => {
|
|
55
|
+
if (!element || !setAnchor) return;
|
|
56
|
+
setAnchor((current) => current ?? element);
|
|
57
|
+
const syncActiveTrigger = () => {
|
|
58
|
+
if (element.getAttribute("aria-expanded") === "true" || element.hasAttribute("data-popup-open")) setAnchor(element);
|
|
59
|
+
};
|
|
60
|
+
syncActiveTrigger();
|
|
61
|
+
const observer = new MutationObserver(syncActiveTrigger);
|
|
62
|
+
observer.observe(element, {
|
|
63
|
+
attributes: true,
|
|
64
|
+
attributeFilter: ["aria-expanded", "data-popup-open"]
|
|
65
|
+
});
|
|
66
|
+
return () => {
|
|
67
|
+
observer.disconnect();
|
|
68
|
+
setAnchor((current) => current === element ? null : current);
|
|
69
|
+
};
|
|
70
|
+
}, [element, setAnchor]);
|
|
71
|
+
return setElement;
|
|
72
|
+
}
|
|
73
|
+
function usePopupDirection() {
|
|
74
|
+
return useContext(PopupDirectionContext)?.direction;
|
|
75
|
+
}
|
|
76
|
+
function usePopupOpenChange(onOpenChange) {
|
|
77
|
+
const context = useContext(PopupDirectionContext);
|
|
78
|
+
return (open, details) => {
|
|
79
|
+
onOpenChange?.(open, details);
|
|
80
|
+
if (open && !details.isCanceled && details.trigger) {
|
|
81
|
+
context?.syncDirection(details.trigger);
|
|
82
|
+
context?.setAnchor(details.trigger);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function PopupDirectionSync() {
|
|
87
|
+
const syncDirection = useContext(PopupDirectionContext)?.syncDirection;
|
|
88
|
+
useLayoutEffect(() => {
|
|
89
|
+
syncDirection?.();
|
|
90
|
+
}, [syncDirection]);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
export { ElementDirectionProvider, PopupDirectionProvider, PopupDirectionSync, useElementDirection, usePopupAnchorRef, usePopupDirection, usePopupOpenChange };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { Menu as BaseUIMenu } from "@base-ui/react/menu";
|
|
3
|
+
import type { StyleXStyles } from "@stylexjs/stylex";
|
|
4
|
+
export type DropdownMenuProps = ComponentPropsWithoutRef<typeof BaseUIMenu.Root>;
|
|
5
|
+
export type DropdownMenuTriggerProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Trigger>, "className" | "style"> & {
|
|
6
|
+
xstyle?: StyleXStyles;
|
|
7
|
+
};
|
|
8
|
+
export type DropdownMenuPortalProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Portal>, "className" | "style" | "container"> & {
|
|
9
|
+
xstyle?: StyleXStyles;
|
|
10
|
+
};
|
|
11
|
+
type PositionerProps = ComponentPropsWithoutRef<typeof BaseUIMenu.Positioner>;
|
|
12
|
+
export type DropdownMenuPopupProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Popup>, "className" | "style"> & Pick<PositionerProps, "side" | "align" | "sideOffset" | "alignOffset"> & {
|
|
13
|
+
xstyle?: StyleXStyles;
|
|
14
|
+
};
|
|
15
|
+
export type DropdownMenuItemProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Item>, "className" | "style"> & {
|
|
16
|
+
xstyle?: StyleXStyles;
|
|
17
|
+
};
|
|
18
|
+
export type DropdownMenuLinkItemProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.LinkItem>, "className" | "style"> & {
|
|
19
|
+
xstyle?: StyleXStyles;
|
|
20
|
+
};
|
|
21
|
+
export type DropdownMenuSeparatorProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Separator>, "className" | "style" | "children"> & {
|
|
22
|
+
xstyle?: StyleXStyles;
|
|
23
|
+
};
|
|
24
|
+
export type DropdownMenuGroupProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.Group>, "className" | "style"> & {
|
|
25
|
+
xstyle?: StyleXStyles;
|
|
26
|
+
};
|
|
27
|
+
export type DropdownMenuGroupLabelProps = Omit<ComponentPropsWithoutRef<typeof BaseUIMenu.GroupLabel>, "className" | "style"> & {
|
|
28
|
+
xstyle?: StyleXStyles;
|
|
29
|
+
};
|
|
30
|
+
export declare function DropdownMenu(props: DropdownMenuProps): import("react").JSX.Element;
|
|
31
|
+
export declare function DropdownMenuTrigger({ xstyle, ...props }: DropdownMenuTriggerProps): import("react").JSX.Element;
|
|
32
|
+
export declare function DropdownMenuPortal({ xstyle, children, ...props }: DropdownMenuPortalProps): import("react").JSX.Element;
|
|
33
|
+
export declare function DropdownMenuPopup({ side, align, sideOffset, alignOffset, xstyle, ...props }: DropdownMenuPopupProps): import("react").JSX.Element;
|
|
34
|
+
export declare function DropdownMenuItem({ xstyle, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
35
|
+
export declare function DropdownMenuLinkItem({ xstyle, ...props }: DropdownMenuLinkItemProps): import("react").JSX.Element;
|
|
36
|
+
export declare function DropdownMenuSeparator({ orientation, xstyle, ...props }: DropdownMenuSeparatorProps): import("react").JSX.Element;
|
|
37
|
+
export declare function DropdownMenuGroup({ xstyle, ...props }: DropdownMenuGroupProps): import("react").JSX.Element;
|
|
38
|
+
export declare function DropdownMenuGroupLabel({ xstyle, ...props }: DropdownMenuGroupLabelProps): import("react").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { colors } from "./semantic-colors.stylex.js";
|
|
2
|
+
import { borders, controlSizes, elevation, fontSizes, fontWeights, lineHeights, radii, spacing, typography } from "./tokens.stylex.js";
|
|
3
|
+
import { PopupDirectionProvider, PopupDirectionSync, usePopupAnchorRef, usePopupDirection, usePopupOpenChange } from "./direction.js";
|
|
4
|
+
import { useThemePortalHost } from "./theme-root.js";
|
|
5
|
+
import * as stylex from "@stylexjs/stylex";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Menu } from "@base-ui/react/menu";
|
|
8
|
+
var styles = stylex.create({
|
|
9
|
+
trigger: {
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
gap: spacing[2],
|
|
14
|
+
boxSizing: "border-box",
|
|
15
|
+
minHeight: controlSizes.md,
|
|
16
|
+
paddingBlock: spacing[2],
|
|
17
|
+
paddingInline: spacing[3],
|
|
18
|
+
borderWidth: 0,
|
|
19
|
+
borderRadius: radii.md,
|
|
20
|
+
backgroundColor: {
|
|
21
|
+
default: colors.muted,
|
|
22
|
+
":hover": colors.mutedHover,
|
|
23
|
+
":active": colors.mutedActive
|
|
24
|
+
},
|
|
25
|
+
color: colors.foreground,
|
|
26
|
+
fontFamily: typography.fontFamily,
|
|
27
|
+
fontSize: fontSizes.sm,
|
|
28
|
+
lineHeight: lineHeights.normal,
|
|
29
|
+
cursor: "pointer",
|
|
30
|
+
outlineStyle: "solid",
|
|
31
|
+
outlineWidth: "2px",
|
|
32
|
+
outlineOffset: "2px",
|
|
33
|
+
outlineColor: {
|
|
34
|
+
default: "transparent",
|
|
35
|
+
":focus-visible": colors.focus
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
opacity: .5,
|
|
40
|
+
cursor: "not-allowed"
|
|
41
|
+
},
|
|
42
|
+
popup: {
|
|
43
|
+
boxSizing: "border-box",
|
|
44
|
+
minInlineSize: "12rem",
|
|
45
|
+
maxInlineSize: "var(--available-width)",
|
|
46
|
+
maxBlockSize: "var(--available-height)",
|
|
47
|
+
overflow: "auto",
|
|
48
|
+
padding: spacing[1],
|
|
49
|
+
borderWidth: borders.surface,
|
|
50
|
+
borderStyle: "solid",
|
|
51
|
+
borderColor: colors.border,
|
|
52
|
+
borderRadius: radii.lg,
|
|
53
|
+
backgroundColor: colors.surface,
|
|
54
|
+
color: colors.surfaceForeground,
|
|
55
|
+
boxShadow: elevation.md,
|
|
56
|
+
outlineStyle: "solid",
|
|
57
|
+
outlineWidth: "2px",
|
|
58
|
+
outlineOffset: "2px",
|
|
59
|
+
outlineColor: {
|
|
60
|
+
default: "transparent",
|
|
61
|
+
":focus-visible": colors.focus
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
item: {
|
|
65
|
+
display: "flex",
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
gap: spacing[2],
|
|
68
|
+
minInlineSize: 0,
|
|
69
|
+
paddingBlock: spacing[2],
|
|
70
|
+
paddingInline: spacing[3],
|
|
71
|
+
borderRadius: radii.md,
|
|
72
|
+
color: colors.surfaceForeground,
|
|
73
|
+
fontFamily: typography.fontFamily,
|
|
74
|
+
fontSize: fontSizes.sm,
|
|
75
|
+
lineHeight: lineHeights.normal,
|
|
76
|
+
textDecoration: "none",
|
|
77
|
+
cursor: "pointer",
|
|
78
|
+
outlineStyle: "solid",
|
|
79
|
+
outlineWidth: "2px",
|
|
80
|
+
outlineOffset: "-2px",
|
|
81
|
+
outlineColor: {
|
|
82
|
+
default: "transparent",
|
|
83
|
+
":focus-visible": colors.focus
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
highlighted: { backgroundColor: colors.mutedHover },
|
|
87
|
+
separator: {
|
|
88
|
+
blockSize: "1px",
|
|
89
|
+
backgroundColor: colors.border,
|
|
90
|
+
marginBlock: spacing[1]
|
|
91
|
+
},
|
|
92
|
+
separatorVertical: {
|
|
93
|
+
blockSize: "auto",
|
|
94
|
+
inlineSize: "1px",
|
|
95
|
+
alignSelf: "stretch"
|
|
96
|
+
},
|
|
97
|
+
group: {
|
|
98
|
+
display: "flex",
|
|
99
|
+
flexDirection: "column"
|
|
100
|
+
},
|
|
101
|
+
groupLabel: {
|
|
102
|
+
paddingBlock: spacing[1],
|
|
103
|
+
paddingInline: spacing[3],
|
|
104
|
+
color: colors.mutedForeground,
|
|
105
|
+
fontFamily: typography.fontFamily,
|
|
106
|
+
fontSize: fontSizes.xs,
|
|
107
|
+
fontWeight: fontWeights.medium,
|
|
108
|
+
lineHeight: lineHeights.normal
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
function DropdownMenu(props) {
|
|
112
|
+
return jsx(PopupDirectionProvider, { children: jsx(DropdownMenuRoot, { ...props }) });
|
|
113
|
+
}
|
|
114
|
+
function DropdownMenuRoot({ onOpenChange, ...props }) {
|
|
115
|
+
const handleOpenChange = usePopupOpenChange(onOpenChange);
|
|
116
|
+
return jsx(Menu.Root, {
|
|
117
|
+
...props,
|
|
118
|
+
onOpenChange: handleOpenChange
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function DropdownMenuTrigger({ xstyle, ...props }) {
|
|
122
|
+
const anchorRef = usePopupAnchorRef();
|
|
123
|
+
return jsx(Menu.Trigger, {
|
|
124
|
+
...props,
|
|
125
|
+
ref: anchorRef,
|
|
126
|
+
className: (state) => stylex.props(styles.trigger, state.disabled && styles.disabled, xstyle).className,
|
|
127
|
+
style: (state) => stylex.props(styles.trigger, state.disabled && styles.disabled, xstyle).style
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function DropdownMenuPortal({ xstyle, children, ...props }) {
|
|
131
|
+
const portalHost = useThemePortalHost();
|
|
132
|
+
const direction = usePopupDirection();
|
|
133
|
+
return jsxs(Menu.Portal, {
|
|
134
|
+
...props,
|
|
135
|
+
container: portalHost ?? void 0,
|
|
136
|
+
dir: direction ?? props.dir,
|
|
137
|
+
...stylex.props(xstyle),
|
|
138
|
+
children: [jsx(PopupDirectionSync, {}), children]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function DropdownMenuPopup({ side = "bottom", align = "start", sideOffset = 6, alignOffset = 0, xstyle, ...props }) {
|
|
142
|
+
const direction = usePopupDirection();
|
|
143
|
+
return jsx(Menu.Positioner, {
|
|
144
|
+
dir: direction,
|
|
145
|
+
side,
|
|
146
|
+
align,
|
|
147
|
+
sideOffset,
|
|
148
|
+
alignOffset,
|
|
149
|
+
children: jsx(Menu.Popup, {
|
|
150
|
+
...props,
|
|
151
|
+
dir: direction ?? props.dir,
|
|
152
|
+
...stylex.props(styles.popup, xstyle)
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function DropdownMenuItem({ xstyle, ...props }) {
|
|
157
|
+
return jsx(Menu.Item, {
|
|
158
|
+
...props,
|
|
159
|
+
className: (state) => stylex.props(styles.item, state.highlighted && styles.highlighted, state.disabled && styles.disabled, xstyle).className,
|
|
160
|
+
style: (state) => stylex.props(styles.item, state.highlighted && styles.highlighted, state.disabled && styles.disabled, xstyle).style
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function DropdownMenuLinkItem({ xstyle, ...props }) {
|
|
164
|
+
return jsx(Menu.LinkItem, {
|
|
165
|
+
...props,
|
|
166
|
+
className: (state) => stylex.props(styles.item, state.highlighted && styles.highlighted, xstyle).className,
|
|
167
|
+
style: (state) => stylex.props(styles.item, state.highlighted && styles.highlighted, xstyle).style
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function DropdownMenuSeparator({ orientation = "horizontal", xstyle, ...props }) {
|
|
171
|
+
return jsx(Menu.Separator, {
|
|
172
|
+
...props,
|
|
173
|
+
orientation,
|
|
174
|
+
...stylex.props(styles.separator, orientation === "vertical" && styles.separatorVertical, xstyle)
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function DropdownMenuGroup({ xstyle, ...props }) {
|
|
178
|
+
return jsx(Menu.Group, {
|
|
179
|
+
...props,
|
|
180
|
+
...stylex.props(styles.group, xstyle)
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function DropdownMenuGroupLabel({ xstyle, ...props }) {
|
|
184
|
+
return jsx(Menu.GroupLabel, {
|
|
185
|
+
...props,
|
|
186
|
+
...stylex.props(styles.groupLabel, xstyle)
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
export { DropdownMenu, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger };
|
package/dist/field.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { Field as BaseUIField } from "@base-ui/react/field";
|
|
3
|
+
import type { StyleXStyles } from "@stylexjs/stylex";
|
|
4
|
+
type NativeFieldProps = Omit<ComponentPropsWithoutRef<typeof BaseUIField.Root>, "className" | "style">;
|
|
5
|
+
export type FieldProps = NativeFieldProps & {
|
|
6
|
+
xstyle?: StyleXStyles;
|
|
7
|
+
};
|
|
8
|
+
type NativeFieldLabelProps = Omit<ComponentPropsWithoutRef<typeof BaseUIField.Label>, "className" | "style">;
|
|
9
|
+
export type FieldLabelProps = NativeFieldLabelProps & {
|
|
10
|
+
xstyle?: StyleXStyles;
|
|
11
|
+
};
|
|
12
|
+
type NativeFieldDescriptionProps = Omit<ComponentPropsWithoutRef<typeof BaseUIField.Description>, "className" | "style">;
|
|
13
|
+
export type FieldDescriptionProps = NativeFieldDescriptionProps & {
|
|
14
|
+
xstyle?: StyleXStyles;
|
|
15
|
+
};
|
|
16
|
+
type NativeFieldErrorProps = Omit<ComponentPropsWithoutRef<typeof BaseUIField.Error>, "className" | "style">;
|
|
17
|
+
export type FieldErrorProps = NativeFieldErrorProps & {
|
|
18
|
+
xstyle?: StyleXStyles;
|
|
19
|
+
};
|
|
20
|
+
export declare function Field({ xstyle, ...props }: FieldProps): import("react").JSX.Element;
|
|
21
|
+
export declare function FieldLabel({ xstyle, ...props }: FieldLabelProps): import("react").JSX.Element;
|
|
22
|
+
export declare function FieldDescription({ xstyle, ...props }: FieldDescriptionProps): import("react").JSX.Element;
|
|
23
|
+
export declare function FieldError({ xstyle, ...props }: FieldErrorProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
package/dist/field.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { colors } from "./semantic-colors.stylex.js";
|
|
2
|
+
import { fontSizes, fontWeights, lineHeights, spacing, typography } from "./tokens.stylex.js";
|
|
3
|
+
import * as stylex from "@stylexjs/stylex";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
6
|
+
var styles = stylex.create({
|
|
7
|
+
root: {
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
gap: spacing[2],
|
|
11
|
+
width: "100%"
|
|
12
|
+
},
|
|
13
|
+
label: {
|
|
14
|
+
color: colors.foreground,
|
|
15
|
+
fontFamily: typography.fontFamily,
|
|
16
|
+
fontSize: fontSizes.sm,
|
|
17
|
+
fontWeight: fontWeights.medium,
|
|
18
|
+
lineHeight: lineHeights.normal
|
|
19
|
+
},
|
|
20
|
+
description: {
|
|
21
|
+
margin: 0,
|
|
22
|
+
color: colors.mutedForeground,
|
|
23
|
+
fontFamily: typography.fontFamily,
|
|
24
|
+
fontSize: fontSizes.sm,
|
|
25
|
+
lineHeight: lineHeights.normal
|
|
26
|
+
},
|
|
27
|
+
error: {
|
|
28
|
+
margin: 0,
|
|
29
|
+
color: colors.danger,
|
|
30
|
+
fontFamily: typography.fontFamily,
|
|
31
|
+
fontSize: fontSizes.sm,
|
|
32
|
+
lineHeight: lineHeights.normal
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
function Field({ xstyle, ...props }) {
|
|
36
|
+
return jsx(Field$1.Root, {
|
|
37
|
+
...props,
|
|
38
|
+
...stylex.props(styles.root, xstyle)
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function FieldLabel({ xstyle, ...props }) {
|
|
42
|
+
return jsx(Field$1.Label, {
|
|
43
|
+
...props,
|
|
44
|
+
...stylex.props(styles.label, xstyle)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function FieldDescription({ xstyle, ...props }) {
|
|
48
|
+
return jsx(Field$1.Description, {
|
|
49
|
+
...props,
|
|
50
|
+
...stylex.props(styles.description, xstyle)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function FieldError({ xstyle, ...props }) {
|
|
54
|
+
return jsx(Field$1.Error, {
|
|
55
|
+
...props,
|
|
56
|
+
...stylex.props(styles.error, xstyle)
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export { Field, FieldDescription, FieldError, FieldLabel };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactElement } from "react";
|
|
2
|
+
import type { StyleXStyles } from "@stylexjs/stylex";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
type NativeIconButtonProps = Omit<ComponentPropsWithoutRef<typeof Button>, "children" | "size" | "xstyle">;
|
|
5
|
+
export type IconButtonSize = "sm" | "md" | "lg";
|
|
6
|
+
export type IconButtonProps = NativeIconButtonProps & {
|
|
7
|
+
children: ReactElement<{
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
size?: IconButtonSize;
|
|
11
|
+
xstyle?: StyleXStyles;
|
|
12
|
+
"aria-label": string;
|
|
13
|
+
};
|
|
14
|
+
export declare function IconButton({ children, size, xstyle, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { controlSizes } from "./tokens.stylex.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import * as stylex from "@stylexjs/stylex";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cloneElement, isValidElement } from "react";
|
|
6
|
+
var buttonSizeStyles = stylex.create({
|
|
7
|
+
sm: {
|
|
8
|
+
width: controlSizes.sm,
|
|
9
|
+
height: controlSizes.sm,
|
|
10
|
+
padding: 0
|
|
11
|
+
},
|
|
12
|
+
md: {
|
|
13
|
+
width: controlSizes.md,
|
|
14
|
+
height: controlSizes.md,
|
|
15
|
+
padding: 0
|
|
16
|
+
},
|
|
17
|
+
lg: {
|
|
18
|
+
width: controlSizes.lg,
|
|
19
|
+
height: controlSizes.lg,
|
|
20
|
+
padding: 0
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var iconStyles = stylex.create({
|
|
24
|
+
sm: {
|
|
25
|
+
flexShrink: 0,
|
|
26
|
+
width: "1rem",
|
|
27
|
+
height: "1rem"
|
|
28
|
+
},
|
|
29
|
+
md: {
|
|
30
|
+
flexShrink: 0,
|
|
31
|
+
width: "1.25rem",
|
|
32
|
+
height: "1.25rem"
|
|
33
|
+
},
|
|
34
|
+
lg: {
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
width: "1.5rem",
|
|
37
|
+
height: "1.5rem"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function IconButton({ children, size = "md", xstyle, ...props }) {
|
|
41
|
+
const { className: iconClassName } = stylex.props(iconStyles[size]);
|
|
42
|
+
const icon = isValidElement(children) ? cloneElement(children, { className: [children.props.className, iconClassName].filter(Boolean).join(" ") }) : children;
|
|
43
|
+
return jsx(Button, {
|
|
44
|
+
...props,
|
|
45
|
+
size,
|
|
46
|
+
xstyle: [buttonSizeStyles[size], xstyle],
|
|
47
|
+
children: icon
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export { IconButton };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export { ThemeRoot } from "./theme-root";
|
|
2
|
+
export { Table, TableCaption, TableHead, TableBody, TableFoot, TableRow, TableHeader, TableCell } from "./table";
|
|
3
|
+
export type { TableProps, TableCaptionProps, TableHeadProps, TableBodyProps, TableFootProps, TableRowProps, TableHeaderProps, TableCellProps } from "./table";
|
|
4
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuPopup, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuGroup, DropdownMenuGroupLabel, } from "./dropdown-menu";
|
|
5
|
+
export type { DropdownMenuProps, DropdownMenuTriggerProps, DropdownMenuPortalProps, DropdownMenuPopupProps, DropdownMenuItemProps, DropdownMenuLinkItemProps, DropdownMenuSeparatorProps, DropdownMenuGroupProps, DropdownMenuGroupLabelProps, } from "./dropdown-menu";
|
|
6
|
+
export { Text } from "./text";
|
|
7
|
+
export { Stack } from "./stack";
|
|
8
|
+
export { Inline } from "./inline";
|
|
9
|
+
export { Surface } from "./surface";
|
|
10
|
+
export { Button } from "./button";
|
|
11
|
+
export { IconButton } from "./icon-button";
|
|
12
|
+
export { Badge } from "./badge";
|
|
13
|
+
export { Alert, AlertTitle, AlertDescription } from "./alert";
|
|
14
|
+
export { Progress, ProgressLabel, ProgressTrack, ProgressIndicator, ProgressValue, } from "./progress";
|
|
15
|
+
export { Skeleton } from "./skeleton";
|
|
16
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, } from "./breadcrumb";
|
|
17
|
+
export { Avatar } from "./avatar";
|
|
18
|
+
export { Input } from "./input";
|
|
19
|
+
export { Field, FieldLabel, FieldDescription, FieldError } from "./field";
|
|
20
|
+
export { Checkbox } from "./checkbox";
|
|
21
|
+
export { Switch } from "./switch";
|
|
22
|
+
export { Radio, RadioGroup } from "./radio";
|
|
23
|
+
export { Tabs, TabsList, TabsTab, TabsPanel } from "./tabs";
|
|
24
|
+
export { Accordion, AccordionItem, AccordionHeader, AccordionTrigger, AccordionPanel } from "./accordion";
|
|
25
|
+
export { Navbar, NavbarBrand, NavbarMenu, NavbarItem, NavbarTrigger, NavbarContent, NavbarLink, NavbarActions, } from "./navbar";
|
|
26
|
+
export { Textarea } from "./textarea";
|
|
27
|
+
export { Separator } from "./separator";
|
|
28
|
+
export { ScrollArea } from "./scroll-area";
|
|
29
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "./card";
|
|
30
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, } from "./dialog";
|
|
31
|
+
export { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent, } from "./tooltip";
|
|
32
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverTitle, PopoverDescription, PopoverClose, } from "./popover";
|
|
33
|
+
export { Select, SelectLabel, SelectTrigger, SelectValue, SelectContent, SelectItem, } from "./select";
|
|
34
|
+
export { compactTheme } from "./themes/compact-theme";
|
|
35
|
+
export type { ThemeRootProps } from "./theme-root";
|
|
36
|
+
export type { TextProps, TextSize, TextWeight } from "./text";
|
|
37
|
+
export type { StackProps } from "./stack";
|
|
38
|
+
export type { InlineProps } from "./inline";
|
|
39
|
+
export type { SurfaceProps } from "./surface";
|
|
40
|
+
export type { ButtonProps, ButtonVariant, ButtonSize, ButtonShape, } from "./button";
|
|
41
|
+
export type { IconButtonProps, IconButtonSize } from "./icon-button";
|
|
42
|
+
export type { BadgeProps, BadgeVariant } from "./badge";
|
|
43
|
+
export type { AlertProps, AlertTitleProps, AlertDescriptionProps, AlertVariant, } from "./alert";
|
|
44
|
+
export type { ProgressProps, ProgressLabelProps, ProgressTrackProps, ProgressIndicatorProps, ProgressValueProps, } from "./progress";
|
|
45
|
+
export type { SkeletonProps } from "./skeleton";
|
|
46
|
+
export type { BreadcrumbProps, BreadcrumbListProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbPageProps, BreadcrumbSeparatorProps, } from "./breadcrumb";
|
|
47
|
+
export type { AvatarProps, AvatarSize } from "./avatar";
|
|
48
|
+
export type { InputProps } from "./input";
|
|
49
|
+
export type { FieldProps, FieldLabelProps, FieldDescriptionProps, FieldErrorProps, } from "./field";
|
|
50
|
+
export type { CheckboxProps } from "./checkbox";
|
|
51
|
+
export type { SwitchProps } from "./switch";
|
|
52
|
+
export type { RadioProps, RadioGroupProps } from "./radio";
|
|
53
|
+
export type { TabsProps, TabsListProps, TabsTabProps, TabsPanelProps } from "./tabs";
|
|
54
|
+
export type { AccordionProps, AccordionItemProps, AccordionHeaderProps, AccordionTriggerProps, AccordionPanelProps } from "./accordion";
|
|
55
|
+
export type { NavbarProps, NavbarBrandProps, NavbarMenuProps, NavbarItemProps, NavbarTriggerProps, NavbarContentProps, NavbarLinkProps, NavbarActionsProps, } from "./navbar";
|
|
56
|
+
export type { TextareaProps } from "./textarea";
|
|
57
|
+
export type { SeparatorProps } from "./separator";
|
|
58
|
+
export type { ScrollAreaProps, ScrollAreaScrollbars, ScrollAreaOverscroll } from "./scroll-area";
|
|
59
|
+
export type { CardProps, CardHeaderProps, CardTitleProps, CardDescriptionProps, CardContentProps, CardFooterProps, } from "./card";
|
|
60
|
+
export type { DialogProps, DialogTriggerProps, DialogContentProps, DialogHeaderProps, DialogTitleProps, DialogDescriptionProps, DialogFooterProps, DialogCloseProps, } from "./dialog";
|
|
61
|
+
export { type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps, type TooltipContentProps, } from "./tooltip";
|
|
62
|
+
export { type PopoverProps, type PopoverTriggerProps, type PopoverContentProps, type PopoverTitleProps, type PopoverDescriptionProps, type PopoverCloseProps, } from "./popover";
|
|
63
|
+
export { type SelectProps, type SelectLabelProps, type SelectTriggerProps, type SelectValueProps, type SelectContentProps, type SelectItemProps, } from "./select";
|
|
64
|
+
export { atelierTheme } from "./themes/atelier-theme";
|
|
65
|
+
export { nitroTheme } from "./themes/nitro-theme";
|
|
66
|
+
export { composeTheme, themePresetOptions } from "./themes/compose-theme";
|
|
67
|
+
export type { ThemeOptions, ThemePreset } from "./themes/compose-theme";
|
|
68
|
+
export type { SemanticColorOverrides } from "./theme-types";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger } from "./accordion.js";
|
|
2
|
+
import { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
3
|
+
import { Avatar } from "./avatar.js";
|
|
4
|
+
import { Badge } from "./badge.js";
|
|
5
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./breadcrumb.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
8
|
+
import { Checkbox } from "./checkbox.js";
|
|
9
|
+
import { ThemeRoot } from "./theme-root.js";
|
|
10
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./dialog.js";
|
|
11
|
+
import { DropdownMenu, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
12
|
+
import { Field, FieldDescription, FieldError, FieldLabel } from "./field.js";
|
|
13
|
+
import { IconButton } from "./icon-button.js";
|
|
14
|
+
import { Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeader, TableRow } from "./table.js";
|
|
15
|
+
import { Text } from "./text.js";
|
|
16
|
+
import { Stack } from "./stack.js";
|
|
17
|
+
import { Inline } from "./inline.js";
|
|
18
|
+
import { Surface } from "./surface.js";
|
|
19
|
+
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from "./progress.js";
|
|
20
|
+
import { Skeleton } from "./skeleton.js";
|
|
21
|
+
import { Input } from "./input.js";
|
|
22
|
+
import { Switch } from "./switch.js";
|
|
23
|
+
import { Radio, RadioGroup } from "./radio.js";
|
|
24
|
+
import { Tabs, TabsList, TabsPanel, TabsTab } from "./tabs.js";
|
|
25
|
+
import { Navbar, NavbarActions, NavbarBrand, NavbarContent, NavbarItem, NavbarLink, NavbarMenu, NavbarTrigger } from "./navbar.js";
|
|
26
|
+
import { Textarea } from "./textarea.js";
|
|
27
|
+
import { Separator } from "./separator.js";
|
|
28
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
29
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
30
|
+
import { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger } from "./popover.js";
|
|
31
|
+
import { Select, SelectContent, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "./select.js";
|
|
32
|
+
import { composeTheme, themePresetOptions } from "./themes/compose-theme.js";
|
|
33
|
+
import { compactTheme } from "./themes/compact-theme.js";
|
|
34
|
+
import { atelierTheme } from "./themes/atelier-theme.js";
|
|
35
|
+
import { nitroTheme } from "./themes/nitro-theme.js";
|
|
36
|
+
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDescription, AlertTitle, Avatar, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuLinkItem, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, Field, FieldDescription, FieldError, FieldLabel, IconButton, Inline, Input, Navbar, NavbarActions, NavbarBrand, NavbarContent, NavbarItem, NavbarLink, NavbarMenu, NavbarTrigger, Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, Radio, RadioGroup, ScrollArea, Select, SelectContent, SelectItem, SelectLabel, SelectTrigger, SelectValue, Separator, Skeleton, Stack, Surface, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Text, Textarea, ThemeRoot, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, atelierTheme, compactTheme, composeTheme, nitroTheme, themePresetOptions };
|
package/dist/inline.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import type { StyleXStyles } from "@stylexjs/stylex";
|
|
3
|
+
import type { SpacingKey } from "./token-types";
|
|
4
|
+
type NativeInlineProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "className" | "style">;
|
|
5
|
+
export type InlineProps = NativeInlineProps & {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
gap?: SpacingKey;
|
|
8
|
+
wrap?: boolean;
|
|
9
|
+
xstyle?: StyleXStyles;
|
|
10
|
+
};
|
|
11
|
+
export declare function Inline({ children, gap, wrap, xstyle, ...props }: InlineProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
package/dist/inline.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { spacing } from "./tokens.stylex.js";
|
|
2
|
+
import * as stylex from "@stylexjs/stylex";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var styles = stylex.create({ root: {
|
|
5
|
+
display: "flex",
|
|
6
|
+
flexDirection: "row"
|
|
7
|
+
} });
|
|
8
|
+
var gapStyles = stylex.create({
|
|
9
|
+
1: { gap: spacing[1] },
|
|
10
|
+
2: { gap: spacing[2] },
|
|
11
|
+
3: { gap: spacing[3] },
|
|
12
|
+
4: { gap: spacing[4] },
|
|
13
|
+
5: { gap: spacing[5] },
|
|
14
|
+
6: { gap: spacing[6] },
|
|
15
|
+
8: { gap: spacing[8] }
|
|
16
|
+
});
|
|
17
|
+
var wrapStyles = stylex.create({ wrap: { flexWrap: "wrap" } });
|
|
18
|
+
function Inline({ children, gap = 2, wrap = false, xstyle, ...props }) {
|
|
19
|
+
return jsx("div", {
|
|
20
|
+
...props,
|
|
21
|
+
...stylex.props(styles.root, gapStyles[gap], wrap && wrapStyles.wrap, xstyle),
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export { Inline };
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { Input as BaseUIInput } from "@base-ui/react/input";
|
|
3
|
+
import type { StyleXStyles } from "@stylexjs/stylex";
|
|
4
|
+
type NativeInputProps = Omit<ComponentPropsWithoutRef<typeof BaseUIInput>, "children" | "className" | "style">;
|
|
5
|
+
export type InputProps = NativeInputProps & {
|
|
6
|
+
xstyle?: StyleXStyles;
|
|
7
|
+
};
|
|
8
|
+
export declare function Input({ xstyle, ...props }: InputProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|