@hydrateless/react 0.10.1 → 0.11.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/README.md +20 -15
- package/dist/client.d.ts +760 -0
- package/dist/client.js +1121 -0
- package/dist/index.d.ts +2 -939
- package/dist/index.js +2 -1422
- package/dist/server.d.ts +216 -0
- package/dist/server.js +244 -0
- package/package.json +10 -2
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ButtonHTMLAttributes, LiHTMLAttributes, ReactNode, AnchorHTMLAttributes, ProgressHTMLAttributes, TableHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Props for {@link ModalTrigger}. */
|
|
5
|
+
interface ModalTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
/** Id of the `<Modal>` dialog this button invokes (sets `commandfor`). */
|
|
7
|
+
target: string;
|
|
8
|
+
/** Invoker command to dispatch. Defaults to `'show-modal'`. */
|
|
9
|
+
command?: 'show-modal' | 'close';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Declarative trigger that opens or closes a {@link Modal} through native HTML
|
|
13
|
+
* Invoker Commands (`command` and `commandfor`), so it works before hydration
|
|
14
|
+
* and renders as a Server Component.
|
|
15
|
+
*/
|
|
16
|
+
declare const ModalTrigger: react.ForwardRefExoticComponent<ModalTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
/** Props shared by the {@link Modal} section components. */
|
|
18
|
+
type ModalSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
/** Modal heading region; its content labels the dialog for assistive tech. */
|
|
20
|
+
declare const ModalHeader: react.ForwardRefExoticComponent<ModalSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
/** Modal main content region. */
|
|
22
|
+
declare const ModalBody: react.ForwardRefExoticComponent<ModalSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
/** Modal actions region. */
|
|
24
|
+
declare const ModalFooter: react.ForwardRefExoticComponent<ModalSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
/** Props for {@link DrawerTrigger}. */
|
|
26
|
+
interface DrawerTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
27
|
+
/** Id of the `<Drawer>` dialog this button invokes (sets `commandfor`). */
|
|
28
|
+
target: string;
|
|
29
|
+
/** Invoker command to dispatch. Defaults to `'show-modal'`. */
|
|
30
|
+
command?: 'show-modal' | 'close';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Declarative trigger that opens or closes a {@link Drawer} through native
|
|
34
|
+
* HTML Invoker Commands (`command` and `commandfor`), so it works before
|
|
35
|
+
* hydration and renders as a Server Component.
|
|
36
|
+
*/
|
|
37
|
+
declare const DrawerTrigger: react.ForwardRefExoticComponent<DrawerTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
/** Props shared by the {@link Drawer} section components. */
|
|
39
|
+
type DrawerSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
40
|
+
/** Drawer heading region. */
|
|
41
|
+
declare const DrawerHeader: react.ForwardRefExoticComponent<DrawerSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
/** Drawer main content region. */
|
|
43
|
+
declare const DrawerBody: react.ForwardRefExoticComponent<DrawerSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
/** Drawer actions region. */
|
|
45
|
+
declare const DrawerFooter: react.ForwardRefExoticComponent<DrawerSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
/** Props for {@link PopoverTrigger}. */
|
|
47
|
+
interface PopoverTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
48
|
+
/** Id of the `<Popover>` surface this button invokes (sets `popovertarget`). */
|
|
49
|
+
target: string;
|
|
50
|
+
/** Popover action to perform. Defaults to `'toggle'`. */
|
|
51
|
+
action?: 'toggle' | 'show' | 'hide';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Declarative trigger that toggles, shows, or hides a {@link Popover} through
|
|
55
|
+
* the native `popovertarget` attribute, so it works before hydration and
|
|
56
|
+
* renders as a Server Component.
|
|
57
|
+
*/
|
|
58
|
+
declare const PopoverTrigger: react.ForwardRefExoticComponent<PopoverTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
59
|
+
|
|
60
|
+
/** Props for {@link Breadcrumb}. */
|
|
61
|
+
type BreadcrumbProps = HTMLAttributes<HTMLElement>;
|
|
62
|
+
/**
|
|
63
|
+
* Semantic breadcrumb navigation (`<nav> > <ol>`). CSS-only, no enhancer.
|
|
64
|
+
* Compose with `<BreadcrumbItem>`.
|
|
65
|
+
*
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <Breadcrumb>
|
|
68
|
+
* <BreadcrumbItem href="/">Home</BreadcrumbItem>
|
|
69
|
+
* <BreadcrumbItem current>Components</BreadcrumbItem>
|
|
70
|
+
* </Breadcrumb>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare const Breadcrumb: react.ForwardRefExoticComponent<BreadcrumbProps & react.RefAttributes<HTMLElement>>;
|
|
74
|
+
/** Props for {@link BreadcrumbItem}. */
|
|
75
|
+
interface BreadcrumbItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'children'> {
|
|
76
|
+
href?: string;
|
|
77
|
+
/** Marks the current page; renders a non-link with `aria-current="page"`. */
|
|
78
|
+
current?: boolean;
|
|
79
|
+
children?: ReactNode;
|
|
80
|
+
/** Extra attributes for the `<a>` when `href` is set. */
|
|
81
|
+
anchorProps?: AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
82
|
+
}
|
|
83
|
+
/** A single crumb. Renders a link unless `current` (or no `href`) is set. */
|
|
84
|
+
declare const BreadcrumbItem: react.ForwardRefExoticComponent<BreadcrumbItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
85
|
+
|
|
86
|
+
/** Props for {@link SkipLink}. */
|
|
87
|
+
type SkipLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
88
|
+
children?: ReactNode;
|
|
89
|
+
};
|
|
90
|
+
/** Accessibility skip-navigation link, visually hidden until focused. */
|
|
91
|
+
declare const SkipLink: react.ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
92
|
+
children?: ReactNode;
|
|
93
|
+
} & react.RefAttributes<HTMLAnchorElement>>;
|
|
94
|
+
|
|
95
|
+
/** Props for {@link Button}. */
|
|
96
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
97
|
+
variant?: 'solid' | 'soft' | 'outline' | 'ghost' | 'link';
|
|
98
|
+
intent?: 'neutral' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
|
|
99
|
+
size?: 'sm' | 'md' | 'lg';
|
|
100
|
+
/** Stretch to the container width. */
|
|
101
|
+
block?: boolean;
|
|
102
|
+
/** Square, icon-only button. */
|
|
103
|
+
icon?: boolean;
|
|
104
|
+
/** Show a spinner and disable interaction. */
|
|
105
|
+
loading?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** Button primitive: `hl-button` with intent/variant/size modifiers. */
|
|
108
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
109
|
+
|
|
110
|
+
/** Props for {@link Alert}. */
|
|
111
|
+
interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
112
|
+
intent?: 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
113
|
+
title?: ReactNode;
|
|
114
|
+
/** Leading icon, rendered before the body. */
|
|
115
|
+
icon?: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
/** Alert primitive: `hl-alert` with intent, optional icon + title. */
|
|
118
|
+
declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
|
|
119
|
+
|
|
120
|
+
/** Props for {@link Badge}. */
|
|
121
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
122
|
+
intent?: 'neutral' | 'primary' | 'danger' | 'success' | 'warning' | 'info';
|
|
123
|
+
variant?: 'soft' | 'solid' | 'outline';
|
|
124
|
+
size?: 'sm' | 'md';
|
|
125
|
+
}
|
|
126
|
+
/** Badge primitive: `hl-badge` with intent/variant/size modifiers. */
|
|
127
|
+
declare const Badge: react.ForwardRefExoticComponent<BadgeProps & react.RefAttributes<HTMLSpanElement>>;
|
|
128
|
+
|
|
129
|
+
/** Props for {@link Card}. */
|
|
130
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
131
|
+
/** Hover/active elevation for clickable cards. */
|
|
132
|
+
interactive?: boolean;
|
|
133
|
+
}
|
|
134
|
+
/** Card container: `hl-card`. Compose with the Card.* parts. */
|
|
135
|
+
declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
|
|
136
|
+
/** Props shared by the {@link Card} section components. */
|
|
137
|
+
type CardSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
138
|
+
/** Header region of a {@link Card}. */
|
|
139
|
+
declare const CardHeader: react.ForwardRefExoticComponent<CardSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
/** Body region of a {@link Card}. */
|
|
141
|
+
declare const CardBody: react.ForwardRefExoticComponent<CardSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
142
|
+
/** Footer region of a {@link Card}. */
|
|
143
|
+
declare const CardFooter: react.ForwardRefExoticComponent<CardSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
144
|
+
/** Title heading of a {@link Card}. */
|
|
145
|
+
declare const CardTitle: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & react.RefAttributes<HTMLHeadingElement>>;
|
|
146
|
+
/** Description text of a {@link Card}. */
|
|
147
|
+
declare const CardDescription: react.ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & react.RefAttributes<HTMLParagraphElement>>;
|
|
148
|
+
|
|
149
|
+
/** Props for {@link Progress}. */
|
|
150
|
+
interface ProgressProps extends Omit<ProgressHTMLAttributes<HTMLProgressElement>, 'value'> {
|
|
151
|
+
/** Omit for an indeterminate bar. */
|
|
152
|
+
value?: number;
|
|
153
|
+
max?: number;
|
|
154
|
+
intent?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
155
|
+
size?: 'sm' | 'md' | 'lg';
|
|
156
|
+
}
|
|
157
|
+
/** Progress primitive: native `<progress class="hl-progress">`. */
|
|
158
|
+
declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLProgressElement>>;
|
|
159
|
+
|
|
160
|
+
/** Props for {@link Spinner}. */
|
|
161
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
162
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
163
|
+
/** Accessible label; announced via `role="status"`. */
|
|
164
|
+
label?: string;
|
|
165
|
+
}
|
|
166
|
+
/** Spinner primitive: `hl-spinner`. Inherits `currentColor`. */
|
|
167
|
+
declare const Spinner: react.ForwardRefExoticComponent<SpinnerProps & react.RefAttributes<HTMLSpanElement>>;
|
|
168
|
+
|
|
169
|
+
/** Props for {@link Skeleton}. */
|
|
170
|
+
interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
171
|
+
/** Placeholder silhouette. Defaults to a rectangle. */
|
|
172
|
+
shape?: 'rect' | 'text' | 'circle';
|
|
173
|
+
/** Inline size (maps to the logical `inline-size`). */
|
|
174
|
+
width?: string | number;
|
|
175
|
+
/** Block size (maps to the logical `block-size`). */
|
|
176
|
+
height?: string | number;
|
|
177
|
+
}
|
|
178
|
+
/** Skeleton placeholder primitive: `hl-skeleton`. Hidden from assistive tech. */
|
|
179
|
+
declare const Skeleton: react.ForwardRefExoticComponent<SkeletonProps & react.RefAttributes<HTMLSpanElement>>;
|
|
180
|
+
|
|
181
|
+
/** Props for {@link Kbd}. */
|
|
182
|
+
type KbdProps = HTMLAttributes<HTMLElement>;
|
|
183
|
+
/** Keyboard key primitive: `<kbd class="hl-kbd">`. */
|
|
184
|
+
declare const Kbd: react.ForwardRefExoticComponent<KbdProps & react.RefAttributes<HTMLElement>>;
|
|
185
|
+
|
|
186
|
+
/** Props for {@link Separator}. */
|
|
187
|
+
interface SeparatorProps extends HTMLAttributes<HTMLHRElement> {
|
|
188
|
+
orientation?: 'horizontal' | 'vertical';
|
|
189
|
+
/** Purely decorative: removes it from the accessibility tree. */
|
|
190
|
+
decorative?: boolean;
|
|
191
|
+
}
|
|
192
|
+
/** Separator primitive: `<hr class="hl-separator">`. */
|
|
193
|
+
declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLHRElement>>;
|
|
194
|
+
|
|
195
|
+
/** Props for {@link Table}. */
|
|
196
|
+
interface TableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, 'align'> {
|
|
197
|
+
/** Zebra-stripe the body rows. */
|
|
198
|
+
striped?: boolean;
|
|
199
|
+
/** Highlight body rows on hover. */
|
|
200
|
+
hover?: boolean;
|
|
201
|
+
/** Default cell alignment. */
|
|
202
|
+
align?: 'start' | 'center' | 'end';
|
|
203
|
+
/** Cell density. */
|
|
204
|
+
size?: 'sm' | 'md' | 'lg';
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Semantic table styled with the `hl-table` primitive. Pass `<thead>`,
|
|
208
|
+
* `<tbody>`, and friends as children; wrap it in an element with
|
|
209
|
+
* `overflow-x: auto` (the `hl-table-wrapper` class) when rows may overflow.
|
|
210
|
+
*/
|
|
211
|
+
declare const Table: react.ForwardRefExoticComponent<TableProps & react.RefAttributes<HTMLTableElement>>;
|
|
212
|
+
|
|
213
|
+
/** Join truthy class names into a single string. */
|
|
214
|
+
declare function cx(...classes: Array<string | false | null | undefined>): string;
|
|
215
|
+
|
|
216
|
+
export { Alert, type AlertProps, Badge, type BadgeProps, Breadcrumb, BreadcrumbItem, type BreadcrumbItemProps, type BreadcrumbProps, Button, type ButtonProps, Card, CardBody, CardDescription, CardFooter, CardHeader, type CardProps, type CardSectionProps, CardTitle, DrawerBody, DrawerFooter, DrawerHeader, type DrawerSectionProps, DrawerTrigger, type DrawerTriggerProps, Kbd, type KbdProps, ModalBody, ModalFooter, ModalHeader, type ModalSectionProps, ModalTrigger, type ModalTriggerProps, PopoverTrigger, type PopoverTriggerProps, Progress, type ProgressProps, Separator, type SeparatorProps, Skeleton, type SkeletonProps, SkipLink, type SkipLinkProps, Spinner, type SpinnerProps, Table, type TableProps, cx };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/OverlayParts.tsx
|
|
5
|
+
|
|
6
|
+
// src/util.ts
|
|
7
|
+
function cx(...classes) {
|
|
8
|
+
return classes.filter(Boolean).join(" ");
|
|
9
|
+
}
|
|
10
|
+
var ModalTrigger = forwardRef(function ModalTrigger2({ target, command = "show-modal", type, children, ...rest }, ref) {
|
|
11
|
+
const invoker = { command, commandfor: target };
|
|
12
|
+
return /* @__PURE__ */ jsx("button", { ...rest, ...invoker, ref, type: type ?? "button", children });
|
|
13
|
+
});
|
|
14
|
+
var ModalHeader = forwardRef(function ModalHeader2({ className, ...rest }, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-modal-header", className) });
|
|
16
|
+
});
|
|
17
|
+
var ModalBody = forwardRef(function ModalBody2({ className, ...rest }, ref) {
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-modal-body", className) });
|
|
19
|
+
});
|
|
20
|
+
var ModalFooter = forwardRef(function ModalFooter2({ className, ...rest }, ref) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-modal-footer", className) });
|
|
22
|
+
});
|
|
23
|
+
var DrawerTrigger = forwardRef(
|
|
24
|
+
function DrawerTrigger2({ target, command = "show-modal", type, children, ...rest }, ref) {
|
|
25
|
+
const invoker = { command, commandfor: target };
|
|
26
|
+
return /* @__PURE__ */ jsx("button", { ...rest, ...invoker, ref, type: type ?? "button", children });
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var DrawerHeader = forwardRef(function DrawerHeader2({ className, ...rest }, ref) {
|
|
30
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-drawer-header", className) });
|
|
31
|
+
});
|
|
32
|
+
var DrawerBody = forwardRef(function DrawerBody2({ className, ...rest }, ref) {
|
|
33
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-drawer-body", className) });
|
|
34
|
+
});
|
|
35
|
+
var DrawerFooter = forwardRef(function DrawerFooter2({ className, ...rest }, ref) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cx("hl-drawer-footer", className) });
|
|
37
|
+
});
|
|
38
|
+
var PopoverTrigger = forwardRef(
|
|
39
|
+
function PopoverTrigger2({ target, action = "toggle", type, children, ...rest }, ref) {
|
|
40
|
+
const attrs = {
|
|
41
|
+
popovertarget: target,
|
|
42
|
+
popovertargetaction: action === "toggle" ? void 0 : action
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
...rest,
|
|
48
|
+
...attrs,
|
|
49
|
+
popoverTarget: void 0,
|
|
50
|
+
popoverTargetAction: void 0,
|
|
51
|
+
ref,
|
|
52
|
+
type: type ?? "button",
|
|
53
|
+
children
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
var Breadcrumb = forwardRef(function Breadcrumb2({ className, children, ...rest }, ref) {
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"nav",
|
|
61
|
+
{
|
|
62
|
+
...rest,
|
|
63
|
+
ref,
|
|
64
|
+
className: cx("hl-breadcrumb", className),
|
|
65
|
+
"aria-label": rest["aria-label"] ?? "Breadcrumb",
|
|
66
|
+
children: /* @__PURE__ */ jsx("ol", { children })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
var BreadcrumbItem = forwardRef(
|
|
71
|
+
function BreadcrumbItem2({ href, current, anchorProps, children, ...rest }, ref) {
|
|
72
|
+
return /* @__PURE__ */ jsx("li", { ...rest, ref, children: current || !href ? /* @__PURE__ */ jsx("span", { "aria-current": current ? "page" : void 0, children }) : /* @__PURE__ */ jsx("a", { ...anchorProps, href, children }) });
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
var SkipLink = forwardRef(function SkipLink2({ children = "Skip to content", className, ...rest }, ref) {
|
|
76
|
+
return /* @__PURE__ */ jsx("a", { ...rest, ref, className: cx("hl-skip-link", className), children });
|
|
77
|
+
});
|
|
78
|
+
var Button = forwardRef(function Button2({ variant, intent, size, block, icon, loading, className, children, disabled, type, ...rest }, ref) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
...rest,
|
|
83
|
+
ref,
|
|
84
|
+
type: type ?? "button",
|
|
85
|
+
className: ["hl-button", className].filter(Boolean).join(" "),
|
|
86
|
+
"data-hl-variant": variant,
|
|
87
|
+
"data-hl-intent": intent,
|
|
88
|
+
"data-hl-size": size,
|
|
89
|
+
"data-hl-block": block || void 0,
|
|
90
|
+
"data-hl-icon": icon || void 0,
|
|
91
|
+
"data-hl-loading": loading || void 0,
|
|
92
|
+
"aria-busy": loading || void 0,
|
|
93
|
+
disabled: disabled || loading,
|
|
94
|
+
children
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
var Alert = forwardRef(function Alert2({ intent, title, icon, className, children, ...rest }, ref) {
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
...rest,
|
|
103
|
+
ref,
|
|
104
|
+
role: rest.role ?? "alert",
|
|
105
|
+
className: ["hl-alert", className].filter(Boolean).join(" "),
|
|
106
|
+
"data-hl-intent": intent,
|
|
107
|
+
children: [
|
|
108
|
+
icon,
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "hl-alert-body", children: [
|
|
110
|
+
title != null && /* @__PURE__ */ jsx("p", { className: "hl-alert-title", children: title }),
|
|
111
|
+
children
|
|
112
|
+
] })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
var Badge = forwardRef(function Badge2({ intent, variant, size, className, children, ...rest }, ref) {
|
|
118
|
+
return /* @__PURE__ */ jsx(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
...rest,
|
|
122
|
+
ref,
|
|
123
|
+
className: ["hl-badge", className].filter(Boolean).join(" "),
|
|
124
|
+
"data-hl-intent": intent,
|
|
125
|
+
"data-hl-variant": variant,
|
|
126
|
+
"data-hl-size": size,
|
|
127
|
+
children
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
var Card = forwardRef(function Card2({ interactive, className, children, ...rest }, ref) {
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
...rest,
|
|
136
|
+
ref,
|
|
137
|
+
className: ["hl-card", className].filter(Boolean).join(" "),
|
|
138
|
+
"data-hl-interactive": interactive || void 0,
|
|
139
|
+
children
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
var CardHeader = forwardRef(function CardHeader2({ className, ...rest }, ref) {
|
|
144
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: ["hl-card-header", className].filter(Boolean).join(" ") });
|
|
145
|
+
});
|
|
146
|
+
var CardBody = forwardRef(function CardBody2({ className, ...rest }, ref) {
|
|
147
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: ["hl-card-body", className].filter(Boolean).join(" ") });
|
|
148
|
+
});
|
|
149
|
+
var CardFooter = forwardRef(function CardFooter2({ className, ...rest }, ref) {
|
|
150
|
+
return /* @__PURE__ */ jsx("div", { ...rest, ref, className: ["hl-card-footer", className].filter(Boolean).join(" ") });
|
|
151
|
+
});
|
|
152
|
+
var CardTitle = forwardRef(
|
|
153
|
+
function CardTitle2({ className, ...rest }, ref) {
|
|
154
|
+
return /* @__PURE__ */ jsx("h3", { ...rest, ref, className: ["hl-card-title", className].filter(Boolean).join(" ") });
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
var CardDescription = forwardRef(function CardDescription2({ className, ...rest }, ref) {
|
|
158
|
+
return /* @__PURE__ */ jsx(
|
|
159
|
+
"p",
|
|
160
|
+
{
|
|
161
|
+
...rest,
|
|
162
|
+
ref,
|
|
163
|
+
className: ["hl-card-description", className].filter(Boolean).join(" ")
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
var Progress = forwardRef(function Progress2({ value, max = 100, intent, size, className, ...rest }, ref) {
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
"progress",
|
|
170
|
+
{
|
|
171
|
+
...rest,
|
|
172
|
+
ref,
|
|
173
|
+
className: ["hl-progress", className].filter(Boolean).join(" "),
|
|
174
|
+
"data-hl-intent": intent,
|
|
175
|
+
"data-hl-size": size,
|
|
176
|
+
value,
|
|
177
|
+
max
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
var Spinner = forwardRef(function Spinner2({ size, label = "Loading", className, ...rest }, ref) {
|
|
182
|
+
return /* @__PURE__ */ jsx(
|
|
183
|
+
"span",
|
|
184
|
+
{
|
|
185
|
+
...rest,
|
|
186
|
+
ref,
|
|
187
|
+
className: ["hl-spinner", className].filter(Boolean).join(" "),
|
|
188
|
+
"data-hl-size": size,
|
|
189
|
+
role: "status",
|
|
190
|
+
"aria-label": label
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
});
|
|
194
|
+
var Skeleton = forwardRef(function Skeleton2({ shape, width, height, className, style, ...rest }, ref) {
|
|
195
|
+
const sizeStyle = {
|
|
196
|
+
...width != null && { inlineSize: width },
|
|
197
|
+
...height != null && { blockSize: height },
|
|
198
|
+
...style
|
|
199
|
+
};
|
|
200
|
+
return /* @__PURE__ */ jsx(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
...rest,
|
|
204
|
+
ref,
|
|
205
|
+
className: cx("hl-skeleton", className),
|
|
206
|
+
"data-hl-shape": shape,
|
|
207
|
+
style: sizeStyle,
|
|
208
|
+
"aria-hidden": "true"
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
var Kbd = forwardRef(function Kbd2({ className, children, ...rest }, ref) {
|
|
213
|
+
return /* @__PURE__ */ jsx("kbd", { ...rest, ref, className: ["hl-kbd", className].filter(Boolean).join(" "), children });
|
|
214
|
+
});
|
|
215
|
+
var Separator = forwardRef(function Separator2({ orientation = "horizontal", decorative, className, ...rest }, ref) {
|
|
216
|
+
return /* @__PURE__ */ jsx(
|
|
217
|
+
"hr",
|
|
218
|
+
{
|
|
219
|
+
...rest,
|
|
220
|
+
ref,
|
|
221
|
+
className: ["hl-separator", className].filter(Boolean).join(" "),
|
|
222
|
+
"data-hl-orientation": orientation === "vertical" ? "vertical" : void 0,
|
|
223
|
+
"aria-orientation": orientation,
|
|
224
|
+
role: decorative ? "presentation" : "separator"
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
var Table = forwardRef(function Table2({ striped, hover, align, size, className, children, ...rest }, ref) {
|
|
229
|
+
return /* @__PURE__ */ jsx(
|
|
230
|
+
"table",
|
|
231
|
+
{
|
|
232
|
+
...rest,
|
|
233
|
+
ref,
|
|
234
|
+
className: cx("hl-table", className),
|
|
235
|
+
"data-hl-striped": striped || void 0,
|
|
236
|
+
"data-hl-hover": hover || void 0,
|
|
237
|
+
"data-hl-align": align,
|
|
238
|
+
"data-hl-size": size,
|
|
239
|
+
children
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
export { Alert, Badge, Breadcrumb, BreadcrumbItem, Button, Card, CardBody, CardDescription, CardFooter, CardHeader, CardTitle, DrawerBody, DrawerFooter, DrawerHeader, DrawerTrigger, Kbd, ModalBody, ModalFooter, ModalHeader, ModalTrigger, PopoverTrigger, Progress, Separator, Skeleton, SkipLink, Spinner, Table, cx };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydrateless/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "React bindings for Hydrateless: components (and a useEnhancer escape hatch) that wire the framework-agnostic enhancers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./server": {
|
|
22
|
+
"types": "./dist/server.d.ts",
|
|
23
|
+
"import": "./dist/server.js"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"types": "./dist/client.d.ts",
|
|
27
|
+
"import": "./dist/client.js"
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +36,7 @@
|
|
|
28
36
|
"test": "vitest run"
|
|
29
37
|
},
|
|
30
38
|
"dependencies": {
|
|
31
|
-
"@hydrateless/enhancers": "^0.
|
|
39
|
+
"@hydrateless/enhancers": "^0.11.0"
|
|
32
40
|
},
|
|
33
41
|
"peerDependencies": {
|
|
34
42
|
"react": ">=18"
|