@xcv-ui/ui 0.0.0-stage → 1.0.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 +17 -0
- package/README.md +72 -2
- package/dist/index.d.ts +424 -0
- package/dist/index.js +1559 -0
- package/package.json +39 -4
- package/styles/index.css +1 -0
- package/styles/primitives.css +1184 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 XCV contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
package/README.md
CHANGED
|
@@ -1,3 +1,73 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @xcv-ui/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reusable, accessible React UI components and composition patterns from XCV.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- React >=18.2
|
|
8
|
+
- React DOM >=18.2
|
|
9
|
+
|
|
10
|
+
React and React DOM are peer dependencies and must be provided by the consuming application.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @xcv-ui/ui @xcv-ui/tokens
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Styles and themes
|
|
19
|
+
|
|
20
|
+
Import the token color mode and the component stylesheet explicitly in your application entry point:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import "@xcv-ui/tokens/themes/dark.css";
|
|
24
|
+
import "@xcv-ui/ui/styles.css";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Apply the color mode and optional brand to the subtree that should receive them:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<div data-xcv-brand="default" data-xcv-mode="dark">
|
|
31
|
+
{/* XCV components */}
|
|
32
|
+
</div>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Dark is the default color mode. Use `data-xcv-mode="light"` to opt into Light. Brand identity is independently selected with the optional `data-xcv-brand` attribute and consumer-owned token overrides. The legacy `data-xcv-theme` attribute remains supported as a deprecated mode alias. XCV does not modify global document styles or automatically detect the system color scheme.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { XcvButton, XcvCard, XcvText } from "@xcv-ui/ui";
|
|
41
|
+
|
|
42
|
+
export function Example() {
|
|
43
|
+
return (
|
|
44
|
+
<XcvCard>
|
|
45
|
+
<XcvCard.Content>
|
|
46
|
+
<XcvText>Ready for the next session?</XcvText>
|
|
47
|
+
</XcvCard.Content>
|
|
48
|
+
<XcvCard.Footer>
|
|
49
|
+
<XcvButton>View sessions</XcvButton>
|
|
50
|
+
</XcvCard.Footer>
|
|
51
|
+
</XcvCard>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
See the [component guide](https://github.com/LuisAnaya/XCV/blob/main/docs/components/COMPONENTS.md) for the component inventory, props, and composition guidance.
|
|
57
|
+
|
|
58
|
+
## Design principles
|
|
59
|
+
|
|
60
|
+
- Native HTML semantics and keyboard accessibility first.
|
|
61
|
+
- Public components and types use the `Xcv` prefix.
|
|
62
|
+
- Icons are provided by consumers as React nodes.
|
|
63
|
+
- Styles are namespaced and consume semantic design tokens.
|
|
64
|
+
- Component interactions use one shared motion language with built-in behavior and reduced-motion support; no motion profiles or global effects API.
|
|
65
|
+
- No dependency on React Router or a specific icon library.
|
|
66
|
+
|
|
67
|
+
## Project status
|
|
68
|
+
|
|
69
|
+
XCV is under active development. Do not treat this package as a production release until installation, typecheck, tests, build, package-content, and browser accessibility checks have passed.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT. See the accompanying `LICENSE` file.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, OlHTMLAttributes, ReactNode, LabelHTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, FieldsetHTMLAttributes, TableHTMLAttributes, ThHTMLAttributes, TdHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type XcvSize = "sm" | "md" | "lg";
|
|
5
|
+
type XcvSpacing = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
type XcvRadius = "none" | "subtle" | "medium" | "large" | "full";
|
|
7
|
+
type XcvFieldState = "default" | "error" | "success";
|
|
8
|
+
type XcvAlignment = "start" | "center" | "end";
|
|
9
|
+
type XcvLayoutAlignment = XcvAlignment | "stretch" | "baseline";
|
|
10
|
+
type XcvJustification = "start" | "center" | "end" | "between" | "around" | "evenly";
|
|
11
|
+
type XcvFlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
|
|
12
|
+
|
|
13
|
+
interface XcvBoxProps extends HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
15
|
+
display?: "block" | "flex" | "grid" | "inline-flex";
|
|
16
|
+
direction?: XcvFlexDirection;
|
|
17
|
+
align?: XcvLayoutAlignment;
|
|
18
|
+
justify?: XcvJustification;
|
|
19
|
+
gap?: XcvSpacing;
|
|
20
|
+
wrap?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const XcvBox: react.ForwardRefExoticComponent<XcvBoxProps & react.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
|
|
24
|
+
interface XcvStackProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
gap?: XcvSpacing;
|
|
26
|
+
align?: XcvLayoutAlignment;
|
|
27
|
+
justify?: XcvJustification;
|
|
28
|
+
}
|
|
29
|
+
declare const XcvStack: react.ForwardRefExoticComponent<XcvStackProps & react.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
|
|
31
|
+
interface XcvInlineProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
gap?: XcvSpacing;
|
|
33
|
+
align?: XcvLayoutAlignment;
|
|
34
|
+
justify?: XcvJustification;
|
|
35
|
+
wrap?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const XcvInline: react.ForwardRefExoticComponent<XcvInlineProps & react.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
|
|
39
|
+
interface XcvContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
size?: "sm" | "md" | "lg" | "xl" | "full";
|
|
41
|
+
centered?: boolean;
|
|
42
|
+
}
|
|
43
|
+
declare const XcvContainer: react.ForwardRefExoticComponent<XcvContainerProps & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
|
|
45
|
+
interface XcvDividerProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "role" | "aria-orientation"> {
|
|
46
|
+
orientation?: "horizontal" | "vertical";
|
|
47
|
+
spacing?: XcvSpacing;
|
|
48
|
+
}
|
|
49
|
+
declare const XcvDivider: react.ForwardRefExoticComponent<XcvDividerProps & react.RefAttributes<HTMLElement>>;
|
|
50
|
+
|
|
51
|
+
interface XcvSurfaceProps extends HTMLAttributes<HTMLDivElement> {
|
|
52
|
+
variant?: "default" | "subtle" | "outlined";
|
|
53
|
+
padding?: XcvSpacing;
|
|
54
|
+
radius?: XcvRadius;
|
|
55
|
+
}
|
|
56
|
+
declare const XcvSurface: react.ForwardRefExoticComponent<XcvSurfaceProps & react.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
|
|
58
|
+
interface XcvCardVisualProps {
|
|
59
|
+
variant?: "default" | "outlined" | "subtle";
|
|
60
|
+
padding?: XcvSpacing;
|
|
61
|
+
radius?: XcvRadius;
|
|
62
|
+
/** Enables the component's standard hover and focus feedback. */
|
|
63
|
+
interactive?: boolean;
|
|
64
|
+
/** Shows a consumer-defined accent rail using --xcv-color-accent. */
|
|
65
|
+
accented?: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface XcvCardProps extends XcvCardVisualProps, HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
}
|
|
69
|
+
interface XcvCardSlotProps extends HTMLAttributes<HTMLDivElement> {
|
|
70
|
+
}
|
|
71
|
+
declare const XcvCard: react.ForwardRefExoticComponent<XcvCardProps & react.RefAttributes<HTMLDivElement>> & {
|
|
72
|
+
Content: react.ForwardRefExoticComponent<XcvCardSlotProps & react.RefAttributes<HTMLDivElement>>;
|
|
73
|
+
Footer: react.ForwardRefExoticComponent<XcvCardSlotProps & react.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type XcvMediaAspectRatio = "square" | "video" | "portrait" | "landscape" | "wide" | (string & {});
|
|
77
|
+
interface XcvMediaProps extends HTMLAttributes<HTMLDivElement> {
|
|
78
|
+
aspectRatio?: XcvMediaAspectRatio;
|
|
79
|
+
radius?: XcvRadius;
|
|
80
|
+
fit?: "cover" | "contain" | "fill" | "none" | "scale-down";
|
|
81
|
+
position?: string;
|
|
82
|
+
}
|
|
83
|
+
declare const XcvMedia: react.ForwardRefExoticComponent<XcvMediaProps & react.RefAttributes<HTMLDivElement>>;
|
|
84
|
+
|
|
85
|
+
type XcvListVariant = "plain" | "divided";
|
|
86
|
+
type XcvListMarker = "none" | "disc" | "decimal";
|
|
87
|
+
interface XcvListProps extends OlHTMLAttributes<HTMLOListElement> {
|
|
88
|
+
[key: `data-${string}`]: string | number | undefined;
|
|
89
|
+
/** Native list semantics: unordered (ul) or ordered (ol). */
|
|
90
|
+
as?: "ul" | "ol";
|
|
91
|
+
/** Plain spacing or separators between rows. */
|
|
92
|
+
variant?: XcvListVariant;
|
|
93
|
+
/** Token-based spacing between rows, or vertical inset for divided rows. */
|
|
94
|
+
gap?: XcvSpacing;
|
|
95
|
+
/** Visual marker style. Defaults to none for ul and decimal for ol. */
|
|
96
|
+
marker?: XcvListMarker;
|
|
97
|
+
}
|
|
98
|
+
interface XcvListItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
99
|
+
[key: `data-${string}`]: string | number | undefined;
|
|
100
|
+
/** Optional leading content, such as an icon, avatar, or category. */
|
|
101
|
+
leading?: ReactNode;
|
|
102
|
+
/** Optional trailing content, such as metadata or actions. */
|
|
103
|
+
trailing?: ReactNode;
|
|
104
|
+
/** Vertical alignment of the three item regions. */
|
|
105
|
+
align?: "start" | "center";
|
|
106
|
+
}
|
|
107
|
+
declare const XcvList: react.ForwardRefExoticComponent<XcvListProps & react.RefAttributes<HTMLOListElement | HTMLUListElement>>;
|
|
108
|
+
declare const XcvListItem: react.ForwardRefExoticComponent<XcvListItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
109
|
+
|
|
110
|
+
interface XcvTextProps extends HTMLAttributes<HTMLElement> {
|
|
111
|
+
as?: "p" | "span" | "div";
|
|
112
|
+
variant?: "body" | "small" | "caption" | "eyebrow";
|
|
113
|
+
weight?: "normal" | "medium" | "semibold" | "bold";
|
|
114
|
+
color?: "primary" | "secondary" | "muted" | "inverse";
|
|
115
|
+
}
|
|
116
|
+
declare const XcvText: react.ForwardRefExoticComponent<XcvTextProps & react.RefAttributes<HTMLElement>>;
|
|
117
|
+
|
|
118
|
+
interface XcvTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
119
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
120
|
+
size?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
121
|
+
weight?: "medium" | "semibold" | "bold";
|
|
122
|
+
}
|
|
123
|
+
declare const XcvTitle: react.ForwardRefExoticComponent<XcvTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
124
|
+
|
|
125
|
+
interface XcvLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
126
|
+
required?: boolean;
|
|
127
|
+
}
|
|
128
|
+
declare const XcvLabel: react.ForwardRefExoticComponent<XcvLabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
129
|
+
|
|
130
|
+
type XcvButtonVariant = "primary" | "secondary" | "tertiary";
|
|
131
|
+
type XcvButtonBaseProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & {
|
|
132
|
+
variant?: XcvButtonVariant;
|
|
133
|
+
size?: XcvSize;
|
|
134
|
+
radius?: XcvRadius;
|
|
135
|
+
loading?: boolean;
|
|
136
|
+
fullWidth?: boolean;
|
|
137
|
+
/** Icon-only buttons require an accessible name. */
|
|
138
|
+
iconOnly?: boolean;
|
|
139
|
+
"aria-label"?: string;
|
|
140
|
+
};
|
|
141
|
+
type XcvButtonProps = XcvButtonBaseProps & ({
|
|
142
|
+
iconOnly: true;
|
|
143
|
+
"aria-label": string;
|
|
144
|
+
} | {
|
|
145
|
+
iconOnly?: false;
|
|
146
|
+
"aria-label"?: string;
|
|
147
|
+
});
|
|
148
|
+
declare const XcvButton: react.ForwardRefExoticComponent<XcvButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
149
|
+
|
|
150
|
+
interface XcvLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
151
|
+
/** A destination is required so XcvLink always renders an actual navigation link. */
|
|
152
|
+
href: string;
|
|
153
|
+
variant?: "default" | "subtle";
|
|
154
|
+
}
|
|
155
|
+
declare const XcvLink: react.ForwardRefExoticComponent<XcvLinkProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
156
|
+
|
|
157
|
+
interface XcvTextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
158
|
+
fieldState?: XcvFieldState;
|
|
159
|
+
radius?: XcvRadius;
|
|
160
|
+
inputSize?: "sm" | "md" | "lg";
|
|
161
|
+
}
|
|
162
|
+
declare const XcvTextInput: react.ForwardRefExoticComponent<XcvTextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
163
|
+
|
|
164
|
+
interface XcvTextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
165
|
+
fieldState?: XcvFieldState;
|
|
166
|
+
radius?: XcvRadius;
|
|
167
|
+
}
|
|
168
|
+
declare const XcvTextArea: react.ForwardRefExoticComponent<XcvTextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
169
|
+
|
|
170
|
+
interface XcvSelectOption {
|
|
171
|
+
value: string;
|
|
172
|
+
label: string;
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
}
|
|
175
|
+
interface XcvSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "multiple" | "children"> {
|
|
176
|
+
options: readonly XcvSelectOption[];
|
|
177
|
+
fieldState?: XcvFieldState;
|
|
178
|
+
radius?: XcvRadius;
|
|
179
|
+
placeholder?: string;
|
|
180
|
+
selectSize?: "sm" | "md" | "lg";
|
|
181
|
+
}
|
|
182
|
+
declare const XcvSelect: react.ForwardRefExoticComponent<XcvSelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
183
|
+
|
|
184
|
+
interface XcvCheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
185
|
+
fieldState?: XcvFieldState;
|
|
186
|
+
}
|
|
187
|
+
declare const XcvCheckbox: react.ForwardRefExoticComponent<XcvCheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
188
|
+
|
|
189
|
+
interface XcvRadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
190
|
+
fieldState?: XcvFieldState;
|
|
191
|
+
}
|
|
192
|
+
declare const XcvRadio: react.ForwardRefExoticComponent<XcvRadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
193
|
+
|
|
194
|
+
interface XcvToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "role"> {
|
|
195
|
+
fieldState?: XcvFieldState;
|
|
196
|
+
}
|
|
197
|
+
declare const XcvToggle: react.ForwardRefExoticComponent<XcvToggleProps & react.RefAttributes<HTMLInputElement>>;
|
|
198
|
+
|
|
199
|
+
interface XcvFormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
200
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
201
|
+
label: ReactNode;
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
id?: string;
|
|
204
|
+
description?: ReactNode;
|
|
205
|
+
error?: ReactNode;
|
|
206
|
+
required?: boolean;
|
|
207
|
+
}
|
|
208
|
+
declare const XcvFormField: react.ForwardRefExoticComponent<XcvFormFieldProps & react.RefAttributes<HTMLDivElement>>;
|
|
209
|
+
|
|
210
|
+
type XcvNoticeTone = "info" | "success" | "warning" | "error";
|
|
211
|
+
interface XcvNoticeProps extends Omit<HTMLAttributes<HTMLDivElement>, "aria-live" | "title"> {
|
|
212
|
+
tone?: XcvNoticeTone;
|
|
213
|
+
radius?: XcvRadius;
|
|
214
|
+
title?: ReactNode;
|
|
215
|
+
icon?: ReactNode;
|
|
216
|
+
announce?: "polite" | "assertive" | false;
|
|
217
|
+
}
|
|
218
|
+
declare const XcvNotice: react.ForwardRefExoticComponent<XcvNoticeProps & react.RefAttributes<HTMLDivElement>>;
|
|
219
|
+
|
|
220
|
+
type XcvBadgeTone = "neutral" | "info" | "success" | "warning" | "error";
|
|
221
|
+
interface XcvBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
222
|
+
tone?: XcvBadgeTone;
|
|
223
|
+
radius?: XcvRadius;
|
|
224
|
+
}
|
|
225
|
+
declare const XcvBadge: react.ForwardRefExoticComponent<XcvBadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
226
|
+
|
|
227
|
+
type XcvLoaderVariant = "orbit" | "comet" | "pulse" | "wave" | "ring";
|
|
228
|
+
type XcvLoaderSize = "sm" | "md" | "lg";
|
|
229
|
+
interface XcvLoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
230
|
+
/** Visual pattern; animation follows the shared XCV motion and reduced-motion contracts. */ variant?: XcvLoaderVariant;
|
|
231
|
+
size?: XcvLoaderSize;
|
|
232
|
+
label?: string;
|
|
233
|
+
showLabel?: boolean;
|
|
234
|
+
}
|
|
235
|
+
declare const XcvLoader: react.ForwardRefExoticComponent<XcvLoaderProps & react.RefAttributes<HTMLSpanElement>>;
|
|
236
|
+
|
|
237
|
+
type XcvAccordionMode = "single" | "multiple";
|
|
238
|
+
type XcvAccordionValue = string | readonly string[];
|
|
239
|
+
interface XcvAccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
240
|
+
radius?: XcvRadius;
|
|
241
|
+
mode?: XcvAccordionMode;
|
|
242
|
+
value?: XcvAccordionValue;
|
|
243
|
+
defaultValue?: XcvAccordionValue;
|
|
244
|
+
onValueChange?: (value: XcvAccordionValue | undefined) => void;
|
|
245
|
+
}
|
|
246
|
+
interface XcvAccordionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
247
|
+
value: string;
|
|
248
|
+
disabled?: boolean;
|
|
249
|
+
}
|
|
250
|
+
declare function XcvAccordionItem({ value, disabled, className, children, ...props }: XcvAccordionItemProps): react.JSX.Element;
|
|
251
|
+
type XcvAccordionTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
252
|
+
declare function XcvAccordionTrigger({ className, children, type, disabled, ...props }: XcvAccordionTriggerProps): react.JSX.Element;
|
|
253
|
+
type XcvAccordionContentProps = HTMLAttributes<HTMLDivElement>;
|
|
254
|
+
declare function XcvAccordionContent({ className, children, ...props }: XcvAccordionContentProps): react.JSX.Element;
|
|
255
|
+
declare const XcvAccordion: react.ForwardRefExoticComponent<XcvAccordionProps & react.RefAttributes<HTMLDivElement>> & {
|
|
256
|
+
Item: typeof XcvAccordionItem;
|
|
257
|
+
Trigger: typeof XcvAccordionTrigger;
|
|
258
|
+
Content: typeof XcvAccordionContent;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
interface XcvActionsMenuProps extends HTMLAttributes<HTMLDivElement> {
|
|
262
|
+
radius?: XcvRadius;
|
|
263
|
+
defaultOpen?: boolean;
|
|
264
|
+
open?: boolean;
|
|
265
|
+
onOpenChange?: (open: boolean) => void;
|
|
266
|
+
}
|
|
267
|
+
type XcvActionsMenuTriggerProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
|
268
|
+
declare function XcvActionsMenuTrigger({ className, children, type, onClick, onKeyDown, ...props }: XcvActionsMenuTriggerProps): react.JSX.Element;
|
|
269
|
+
interface XcvActionsMenuContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
270
|
+
label: string;
|
|
271
|
+
}
|
|
272
|
+
declare function XcvActionsMenuContent({ label, className, children, onKeyDown, ...props }: XcvActionsMenuContentProps): react.ReactPortal | null;
|
|
273
|
+
interface XcvActionsMenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
274
|
+
disabled?: boolean;
|
|
275
|
+
onSelect?: () => void;
|
|
276
|
+
children: ReactNode;
|
|
277
|
+
}
|
|
278
|
+
declare function XcvActionsMenuItem({ className, disabled, onSelect, onClick, children, ...props }: XcvActionsMenuItemProps): react.JSX.Element;
|
|
279
|
+
declare function XcvActionsMenuSeparator(): react.JSX.Element;
|
|
280
|
+
declare const XcvActionsMenu: react.ForwardRefExoticComponent<XcvActionsMenuProps & react.RefAttributes<HTMLDivElement>> & {
|
|
281
|
+
Trigger: typeof XcvActionsMenuTrigger;
|
|
282
|
+
Content: typeof XcvActionsMenuContent;
|
|
283
|
+
Item: typeof XcvActionsMenuItem;
|
|
284
|
+
Separator: typeof XcvActionsMenuSeparator;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
type XcvTabsOrientation = "horizontal" | "vertical";
|
|
288
|
+
type XcvTabsProps = HTMLAttributes<HTMLDivElement> & {
|
|
289
|
+
radius?: XcvRadius;
|
|
290
|
+
onValueChange?: (value: string) => void;
|
|
291
|
+
orientation?: XcvTabsOrientation;
|
|
292
|
+
} & ({
|
|
293
|
+
value: string;
|
|
294
|
+
defaultValue?: never;
|
|
295
|
+
} | {
|
|
296
|
+
value?: never;
|
|
297
|
+
defaultValue: string;
|
|
298
|
+
});
|
|
299
|
+
interface XcvTabsListProps extends HTMLAttributes<HTMLDivElement> {
|
|
300
|
+
label: string;
|
|
301
|
+
}
|
|
302
|
+
declare function XcvTabsList({ label, className, children, onKeyDown, ...props }: XcvTabsListProps): react.JSX.Element;
|
|
303
|
+
interface XcvTabsTabProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
304
|
+
value: string;
|
|
305
|
+
children: ReactNode;
|
|
306
|
+
}
|
|
307
|
+
declare function XcvTabsTab({ value, className, children, disabled, ...props }: XcvTabsTabProps): react.JSX.Element;
|
|
308
|
+
interface XcvTabsPanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
309
|
+
value: string;
|
|
310
|
+
}
|
|
311
|
+
declare function XcvTabsPanel({ value, className, children, ...props }: XcvTabsPanelProps): react.JSX.Element;
|
|
312
|
+
declare const XcvTabs: react.ForwardRefExoticComponent<XcvTabsProps & react.RefAttributes<HTMLDivElement>> & {
|
|
313
|
+
List: typeof XcvTabsList;
|
|
314
|
+
Tab: typeof XcvTabsTab;
|
|
315
|
+
Panel: typeof XcvTabsPanel;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
interface XcvStepperStep {
|
|
319
|
+
/** Stable unique key for this step. */
|
|
320
|
+
id: string;
|
|
321
|
+
/** Visible step label. */
|
|
322
|
+
label: ReactNode;
|
|
323
|
+
/** Native anchor destination, including an in-page fragment when appropriate. */
|
|
324
|
+
href: string;
|
|
325
|
+
}
|
|
326
|
+
interface XcvStepperProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
327
|
+
[key: `data-${string}`]: string | number | boolean | undefined;
|
|
328
|
+
/** Steps to render as native navigation links. */
|
|
329
|
+
radius?: XcvRadius;
|
|
330
|
+
steps: readonly XcvStepperStep[];
|
|
331
|
+
/** Number of columns on wider viewports. Narrow layouts use two columns. */
|
|
332
|
+
columns?: 3 | 4;
|
|
333
|
+
/** Accessible name for the navigation landmark. */
|
|
334
|
+
label?: string;
|
|
335
|
+
}
|
|
336
|
+
declare const XcvStepper: react.ForwardRefExoticComponent<XcvStepperProps & react.RefAttributes<HTMLElement>>;
|
|
337
|
+
|
|
338
|
+
interface XcvPaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
|
|
339
|
+
radius?: XcvRadius;
|
|
340
|
+
page: number;
|
|
341
|
+
pageCount: number;
|
|
342
|
+
onPageChange: (page: number) => void;
|
|
343
|
+
/** @deprecated The page window is intentionally fixed at three slots. */
|
|
344
|
+
siblingCount?: number;
|
|
345
|
+
label?: string;
|
|
346
|
+
firstLabel?: string;
|
|
347
|
+
previousLabel?: string;
|
|
348
|
+
nextLabel?: string;
|
|
349
|
+
lastLabel?: string;
|
|
350
|
+
pageLabel?: (page: number) => string;
|
|
351
|
+
}
|
|
352
|
+
declare const XcvPagination: react.ForwardRefExoticComponent<XcvPaginationProps & react.RefAttributes<HTMLElement>>;
|
|
353
|
+
|
|
354
|
+
interface XcvFilterOption {
|
|
355
|
+
value: string;
|
|
356
|
+
label: string;
|
|
357
|
+
disabled?: boolean;
|
|
358
|
+
}
|
|
359
|
+
interface XcvFilterGroupProps extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange"> {
|
|
360
|
+
label: string;
|
|
361
|
+
name?: string;
|
|
362
|
+
options: readonly XcvFilterOption[];
|
|
363
|
+
values?: readonly string[];
|
|
364
|
+
defaultValues?: readonly string[];
|
|
365
|
+
onValuesChange?: (values: string[]) => void;
|
|
366
|
+
orientation?: "vertical" | "horizontal";
|
|
367
|
+
}
|
|
368
|
+
declare const XcvFilterGroup: react.ForwardRefExoticComponent<XcvFilterGroupProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
369
|
+
|
|
370
|
+
type XcvStatCardDetailTone = "neutral" | "positive" | "negative";
|
|
371
|
+
interface XcvStatCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
372
|
+
radius?: XcvRadius;
|
|
373
|
+
label: ReactNode;
|
|
374
|
+
value: ReactNode;
|
|
375
|
+
description?: ReactNode;
|
|
376
|
+
detail?: ReactNode;
|
|
377
|
+
detailTone?: XcvStatCardDetailTone;
|
|
378
|
+
icon?: ReactNode;
|
|
379
|
+
}
|
|
380
|
+
declare const XcvStatCard: react.ForwardRefExoticComponent<XcvStatCardProps & react.RefAttributes<HTMLDivElement>>;
|
|
381
|
+
|
|
382
|
+
interface XcvTableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
383
|
+
density?: "comfortable" | "compact";
|
|
384
|
+
radius?: XcvRadius;
|
|
385
|
+
wrapperClassName?: string;
|
|
386
|
+
wrapperLabel?: string;
|
|
387
|
+
}
|
|
388
|
+
type XcvTableCaptionProps = HTMLAttributes<HTMLTableCaptionElement>;
|
|
389
|
+
declare function XcvTableCaption({ className, ...props }: XcvTableCaptionProps): react.JSX.Element;
|
|
390
|
+
type XcvTableHeadProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
391
|
+
declare function XcvTableHead({ className, ...props }: XcvTableHeadProps): react.JSX.Element;
|
|
392
|
+
type XcvTableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
|
|
393
|
+
declare function XcvTableBody({ className, ...props }: XcvTableBodyProps): react.JSX.Element;
|
|
394
|
+
type XcvTableRowProps = HTMLAttributes<HTMLTableRowElement>;
|
|
395
|
+
declare function XcvTableRow({ className, ...props }: XcvTableRowProps): react.JSX.Element;
|
|
396
|
+
type XcvTableHeaderCellProps = ThHTMLAttributes<HTMLTableCellElement>;
|
|
397
|
+
declare function XcvTableHeaderCell({ scope, className, ...props }: XcvTableHeaderCellProps): react.JSX.Element;
|
|
398
|
+
type XcvTableCellProps = TdHTMLAttributes<HTMLTableCellElement>;
|
|
399
|
+
declare function XcvTableCell({ className, ...props }: XcvTableCellProps): react.JSX.Element;
|
|
400
|
+
declare const XcvTable: react.ForwardRefExoticComponent<XcvTableProps & react.RefAttributes<HTMLTableElement>> & {
|
|
401
|
+
Caption: typeof XcvTableCaption;
|
|
402
|
+
Head: typeof XcvTableHead;
|
|
403
|
+
Body: typeof XcvTableBody;
|
|
404
|
+
Row: typeof XcvTableRow;
|
|
405
|
+
HeaderCell: typeof XcvTableHeaderCell;
|
|
406
|
+
Cell: typeof XcvTableCell;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
interface XcvSearchBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "value" | "defaultValue" | "onChange"> {
|
|
410
|
+
label: string;
|
|
411
|
+
radius?: XcvRadius;
|
|
412
|
+
value?: string;
|
|
413
|
+
defaultValue?: string;
|
|
414
|
+
onValueChange?: (value: string) => void;
|
|
415
|
+
onSearch: (value: string) => void;
|
|
416
|
+
debounceMs?: number;
|
|
417
|
+
loading?: boolean;
|
|
418
|
+
clearable?: boolean;
|
|
419
|
+
clearLabel?: string;
|
|
420
|
+
submitLabel?: string;
|
|
421
|
+
}
|
|
422
|
+
declare const XcvSearchBox: react.ForwardRefExoticComponent<XcvSearchBoxProps & react.RefAttributes<HTMLInputElement>>;
|
|
423
|
+
|
|
424
|
+
export { XcvAccordion, type XcvAccordionContentProps, type XcvAccordionItemProps, type XcvAccordionMode, type XcvAccordionProps, type XcvAccordionTriggerProps, type XcvAccordionValue, XcvActionsMenu, type XcvActionsMenuContentProps, type XcvActionsMenuItemProps, type XcvActionsMenuProps, type XcvActionsMenuTriggerProps, type XcvAlignment, XcvBadge, type XcvBadgeProps, type XcvBadgeTone, XcvBox, type XcvBoxProps, XcvButton, type XcvButtonProps, type XcvButtonVariant, XcvCard, type XcvCardProps, type XcvCardSlotProps, type XcvCardVisualProps, XcvCheckbox, type XcvCheckboxProps, XcvContainer, type XcvContainerProps, XcvDivider, type XcvDividerProps, type XcvFieldState, XcvFilterGroup, type XcvFilterGroupProps, type XcvFilterOption, type XcvFlexDirection, XcvFormField, type XcvFormFieldProps, XcvInline, type XcvInlineProps, type XcvJustification, XcvLabel, type XcvLabelProps, type XcvLayoutAlignment, XcvLink, type XcvLinkProps, XcvList, XcvListItem, type XcvListItemProps, type XcvListMarker, type XcvListProps, type XcvListVariant, XcvLoader, type XcvLoaderProps, type XcvLoaderSize, type XcvLoaderVariant, XcvMedia, type XcvMediaAspectRatio, type XcvMediaProps, XcvNotice, type XcvNoticeProps, type XcvNoticeTone, XcvPagination, type XcvPaginationProps, XcvRadio, type XcvRadioProps, type XcvRadius, XcvSearchBox, type XcvSearchBoxProps, XcvSelect, type XcvSelectOption, type XcvSelectProps, type XcvSize, type XcvSpacing, XcvStack, type XcvStackProps, XcvStatCard, type XcvStatCardDetailTone, type XcvStatCardProps, XcvStepper, type XcvStepperProps, type XcvStepperStep, XcvSurface, type XcvSurfaceProps, XcvTable, type XcvTableBodyProps, type XcvTableCaptionProps, type XcvTableCellProps, type XcvTableHeadProps, type XcvTableHeaderCellProps, type XcvTableProps, type XcvTableRowProps, XcvTabs, type XcvTabsListProps, type XcvTabsOrientation, type XcvTabsPanelProps, type XcvTabsProps, type XcvTabsTabProps, XcvText, XcvTextArea, type XcvTextAreaProps, XcvTextInput, type XcvTextInputProps, type XcvTextProps, XcvTitle, type XcvTitleProps, XcvToggle, type XcvToggleProps };
|