orynn 0.5.0 → 0.6.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 +9 -3
- package/dist/index.cjs +703 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +255 -4
- package/dist/index.d.ts +255 -4
- package/dist/index.js +691 -20
- package/dist/index.js.map +1 -1
- package/dist/styles.css +838 -10
- package/package.json +4 -2
- package/scripts/postinstall.mjs +102 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ChangeEvent, ComponentType, SyntheticEvent, TextareaHTMLAttributes, FormEvent, FormHTMLAttributes,
|
|
3
|
-
import { Label as Label$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Dialog as Dialog$1, Popover as Popover$1, Tooltip as Tooltip$1, DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
2
|
+
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ChangeEvent, ComponentType, SyntheticEvent, TextareaHTMLAttributes, FormEvent, FormHTMLAttributes, ComponentPropsWithoutRef, ComponentProps, MouseEvent, CSSProperties } from 'react';
|
|
3
|
+
import { Accordion as Accordion$1, Slider as Slider$1, Progress as Progress$1, Label as Label$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Dialog as Dialog$1, Popover as Popover$1, Tooltip as Tooltip$1, DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
4
4
|
|
|
5
5
|
type ControlSize = "sm" | "md" | "lg";
|
|
6
6
|
type ControlVariant = "outline" | "filled" | "flushed" | "unstyled";
|
|
@@ -165,7 +165,8 @@ interface DatePickerPreset {
|
|
|
165
165
|
interface DatePickerCommonProps extends Omit<BaseControlProps, "startContent" | "endContent" | "loading"> {
|
|
166
166
|
/**
|
|
167
167
|
* Display / parse pattern (`yyyy MM dd M d MMM MMMM HH mm a`) or an
|
|
168
|
-
* `Intl.DateTimeFormatOptions` object. Default `"
|
|
168
|
+
* `Intl.DateTimeFormatOptions` object. Default `"dd-MMM-yyyy"` (renders e.g.
|
|
169
|
+
* `12-Jan-2020`); pass `"yyyy-MM-dd"` for ISO.
|
|
169
170
|
*/
|
|
170
171
|
format?: string | Intl.DateTimeFormatOptions;
|
|
171
172
|
minDate?: Date;
|
|
@@ -189,6 +190,12 @@ interface DatePickerCommonProps extends Omit<BaseControlProps, "startContent" |
|
|
|
189
190
|
fixedWeeks?: boolean;
|
|
190
191
|
/** Side-by-side month panels. Default 1. */
|
|
191
192
|
numberOfMonths?: number;
|
|
193
|
+
/**
|
|
194
|
+
* Lower bound for the calendar's width (`--orynn-calendar-min-width`). The
|
|
195
|
+
* calendar otherwise fills the popover, which tracks the trigger width.
|
|
196
|
+
* Number = px.
|
|
197
|
+
*/
|
|
198
|
+
calendarWidth?: number | string;
|
|
192
199
|
/** Show an hour / minute picker beside the calendar (`single` mode). */
|
|
193
200
|
showTime?: boolean;
|
|
194
201
|
/** Minute granularity for the time picker. Default 5. */
|
|
@@ -1033,8 +1040,38 @@ interface FormProps<TValues extends Values = Values> extends Omit<FormHTMLAttrib
|
|
|
1033
1040
|
*/
|
|
1034
1041
|
declare function Form<TValues extends Values = Values>(props: FormProps<TValues>): react.JSX.Element;
|
|
1035
1042
|
|
|
1043
|
+
type AccordionVariant = "bordered" | "separated" | "ghost";
|
|
1044
|
+
type AccordionSize = "sm" | "md" | "lg";
|
|
1045
|
+
type RootProps$2 = ComponentPropsWithoutRef<typeof Accordion$1.Root>;
|
|
1046
|
+
type AccordionProps = RootProps$2 & {
|
|
1047
|
+
/** `bordered` (default, dividers) · `separated` (each item a card) · `ghost` (no chrome). */
|
|
1048
|
+
variant?: AccordionVariant;
|
|
1049
|
+
/** Trigger padding + type scale. Default `md`. */
|
|
1050
|
+
size?: AccordionSize;
|
|
1051
|
+
};
|
|
1052
|
+
/**
|
|
1053
|
+
* A stack of collapsible sections. Thin wrapper over Radix Accordion — every
|
|
1054
|
+
* Root prop (`type`, `collapsible`, `value` / `defaultValue`, `onValueChange`,
|
|
1055
|
+
* `disabled`, `orientation`, `dir`) passes straight through.
|
|
1056
|
+
*/
|
|
1057
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
1058
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<Omit<Accordion$1.AccordionItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1059
|
+
interface AccordionTriggerProps extends ComponentPropsWithoutRef<typeof Accordion$1.Trigger> {
|
|
1060
|
+
/** Indicator icon. Defaults to a chevron that rotates on open. */
|
|
1061
|
+
icon?: ReactNode;
|
|
1062
|
+
/** Which side the icon sits on. Default `end`. */
|
|
1063
|
+
iconPosition?: "start" | "end";
|
|
1064
|
+
/** Drop the indicator entirely. */
|
|
1065
|
+
hideIcon?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
declare const AccordionTrigger: react.ForwardRefExoticComponent<AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1068
|
+
declare const AccordionContent: react.ForwardRefExoticComponent<Omit<Accordion$1.AccordionContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1069
|
+
|
|
1036
1070
|
type ButtonVariant = "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
1037
1071
|
type ButtonSize = "default" | "sm" | "lg" | "icon";
|
|
1072
|
+
type ButtonHoverEffect = "darken" | "lift" | "glow" | "outline-fill" | "none";
|
|
1073
|
+
type ButtonFocusStyle = "ring" | "solid" | "ring-inset" | "none";
|
|
1074
|
+
type ButtonCursor = "pointer" | "default" | "auto";
|
|
1038
1075
|
type BadgeVariant = "default" | "secondary" | "destructive" | "outline";
|
|
1039
1076
|
/**
|
|
1040
1077
|
* Class list for a shadcn-style button. Exported so a non-`<button>` element can
|
|
@@ -1061,9 +1098,223 @@ interface ButtonProps extends ComponentProps<"button"> {
|
|
|
1061
1098
|
rightIcon?: ReactNode;
|
|
1062
1099
|
/** Stretch to the container width. */
|
|
1063
1100
|
fullWidth?: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Hover treatment. `"darken"` (default) shades the fill; `"lift"` adds a
|
|
1103
|
+
* raise + shadow; `"glow"` adds a soft ring; `"outline-fill"` floods the
|
|
1104
|
+
* fill on hover (nice on `ghost` / `outline`); `"none"` disables the hover
|
|
1105
|
+
* change. Retune via `--orynn-button-hover-*` / `--orynn-button-glow`.
|
|
1106
|
+
*/
|
|
1107
|
+
hoverEffect?: ButtonHoverEffect;
|
|
1108
|
+
/**
|
|
1109
|
+
* Focus-visible treatment. `"ring"` (default) = border + soft ring halo;
|
|
1110
|
+
* `"solid"` = a crisp outline; `"ring-inset"` = the halo drawn inside the
|
|
1111
|
+
* edge; `"none"` = no focus styling (supply your own).
|
|
1112
|
+
*/
|
|
1113
|
+
focusStyle?: ButtonFocusStyle;
|
|
1114
|
+
/**
|
|
1115
|
+
* Pressed / active state — a token-styled toggle look. Also sets
|
|
1116
|
+
* `aria-pressed`. Retune via `--orynn-button-selected-*`.
|
|
1117
|
+
*/
|
|
1118
|
+
selected?: boolean;
|
|
1119
|
+
/** Idle cursor. `"pointer"` (default) · `"default"` · `"auto"`. */
|
|
1120
|
+
cursor?: ButtonCursor;
|
|
1064
1121
|
}
|
|
1065
1122
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1066
1123
|
|
|
1124
|
+
type RootProps$1 = ComponentPropsWithoutRef<typeof Slider$1.Root>;
|
|
1125
|
+
interface SliderMark {
|
|
1126
|
+
value: number;
|
|
1127
|
+
label?: ReactNode;
|
|
1128
|
+
}
|
|
1129
|
+
interface SliderProps extends Omit<RootProps$1, "value" | "defaultValue" | "asChild"> {
|
|
1130
|
+
/** Controlled value. A scalar is treated as a single-thumb slider. */
|
|
1131
|
+
value?: number | number[];
|
|
1132
|
+
/** Uncontrolled initial value. Scalar → one thumb. Default `min`. */
|
|
1133
|
+
defaultValue?: number | number[];
|
|
1134
|
+
/** Track / thumb scale. Default `md`. */
|
|
1135
|
+
size?: "sm" | "md" | "lg";
|
|
1136
|
+
/** Ticks + labels pinned under the track at these values. */
|
|
1137
|
+
marks?: SliderMark[];
|
|
1138
|
+
/** Render a tick at every `step` (skipped when that would be > 60 ticks). */
|
|
1139
|
+
showTicks?: boolean;
|
|
1140
|
+
/** Value bubble over the thumb. Default `"none"`. */
|
|
1141
|
+
tooltip?: "always" | "hover" | "none";
|
|
1142
|
+
/** Format the tooltip / aria value text. */
|
|
1143
|
+
formatValue?: (value: number) => ReactNode;
|
|
1144
|
+
}
|
|
1145
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1146
|
+
|
|
1147
|
+
type RootProps = ComponentPropsWithoutRef<typeof Progress$1.Root>;
|
|
1148
|
+
interface ProgressProps extends Omit<RootProps, "value" | "getValueLabel"> {
|
|
1149
|
+
/** 0–`max`, or `null` / omitted for an indeterminate bar. */
|
|
1150
|
+
value?: number | null;
|
|
1151
|
+
max?: number;
|
|
1152
|
+
/** `line` (default) or `circle`. */
|
|
1153
|
+
shape?: "line" | "circle";
|
|
1154
|
+
/** Thickness / diameter scale. Default `md`. */
|
|
1155
|
+
size?: "sm" | "md" | "lg";
|
|
1156
|
+
/** Colour role. Default `default` (primary). */
|
|
1157
|
+
variant?: "default" | "success" | "warning" | "destructive";
|
|
1158
|
+
/** Render the percentage (line: trailing; circle: centred). */
|
|
1159
|
+
showValue?: boolean;
|
|
1160
|
+
/** Text shown alongside the bar (line only). */
|
|
1161
|
+
label?: ReactNode;
|
|
1162
|
+
/** Diagonal stripes (line only). */
|
|
1163
|
+
striped?: boolean;
|
|
1164
|
+
/** Animate the stripes (implies `striped`, line only). */
|
|
1165
|
+
animated?: boolean;
|
|
1166
|
+
/** Corner radius override for the line track. */
|
|
1167
|
+
radius?: string | number;
|
|
1168
|
+
/** Ring stroke width, px (circle only). Default 4 / 5 / 6 by size. */
|
|
1169
|
+
circleThickness?: number;
|
|
1170
|
+
/** Ring diameter, px (circle only). Default 40 / 56 / 72 by size. */
|
|
1171
|
+
circleSize?: number;
|
|
1172
|
+
/** Format the value text. */
|
|
1173
|
+
formatValue?: (value: number, max: number) => ReactNode;
|
|
1174
|
+
}
|
|
1175
|
+
declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1176
|
+
|
|
1177
|
+
type ToastVariant = "default" | "success" | "error" | "warning" | "info" | "loading";
|
|
1178
|
+
interface ToastAction {
|
|
1179
|
+
label: ReactNode;
|
|
1180
|
+
onClick: () => void;
|
|
1181
|
+
/** Screen-reader text for the action (Radix requires it). Defaults to the label if it's a string. */
|
|
1182
|
+
altText?: string;
|
|
1183
|
+
}
|
|
1184
|
+
interface ToastOptions {
|
|
1185
|
+
id?: string;
|
|
1186
|
+
title?: ReactNode;
|
|
1187
|
+
description?: ReactNode;
|
|
1188
|
+
variant?: ToastVariant;
|
|
1189
|
+
/** ms before auto-dismiss. `0` / `Infinity` = sticky. Falls back to the Toaster's `duration`. */
|
|
1190
|
+
duration?: number;
|
|
1191
|
+
action?: ToastAction;
|
|
1192
|
+
/** Custom leading icon. `null` hides the default variant icon. */
|
|
1193
|
+
icon?: ReactNode | null;
|
|
1194
|
+
/** Show the close button for this toast (defaults to the Toaster setting). */
|
|
1195
|
+
dismissible?: boolean;
|
|
1196
|
+
onOpenChange?: (open: boolean) => void;
|
|
1197
|
+
}
|
|
1198
|
+
interface ToastRecord extends ToastOptions {
|
|
1199
|
+
id: string;
|
|
1200
|
+
createdAt: number;
|
|
1201
|
+
}
|
|
1202
|
+
type ToastInput = ReactNode | ToastOptions;
|
|
1203
|
+
interface ToastFn {
|
|
1204
|
+
(message: ToastInput, opts?: ToastOptions): string;
|
|
1205
|
+
success: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1206
|
+
error: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1207
|
+
warning: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1208
|
+
info: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1209
|
+
loading: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1210
|
+
dismiss: (id?: string) => void;
|
|
1211
|
+
promise: <T>(promise: Promise<T>, msgs: {
|
|
1212
|
+
loading: ToastInput;
|
|
1213
|
+
success: ToastInput | ((value: T) => ToastInput);
|
|
1214
|
+
error: ToastInput | ((err: unknown) => ToastInput);
|
|
1215
|
+
}, opts?: ToastOptions) => Promise<T>;
|
|
1216
|
+
}
|
|
1217
|
+
declare const toast: ToastFn;
|
|
1218
|
+
|
|
1219
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1220
|
+
interface ToasterProps {
|
|
1221
|
+
/** Corner / edge the stack lives in. Default `"bottom-right"`. */
|
|
1222
|
+
position?: ToastPosition;
|
|
1223
|
+
/** Default auto-dismiss in ms. Default `4000`. */
|
|
1224
|
+
duration?: number;
|
|
1225
|
+
/** Max toasts shown at once (older ones wait). Default `4`. */
|
|
1226
|
+
visibleToasts?: number;
|
|
1227
|
+
/** Show a close button on every toast. Default `true`. */
|
|
1228
|
+
closeButton?: boolean;
|
|
1229
|
+
/** Tint the whole toast by variant instead of just the icon. Default `false`. */
|
|
1230
|
+
richColors?: boolean;
|
|
1231
|
+
/** Gap between stacked toasts, px. Default `12`. */
|
|
1232
|
+
gap?: number;
|
|
1233
|
+
/** Offset from the viewport edge, px. Default `24`. */
|
|
1234
|
+
offset?: number;
|
|
1235
|
+
className?: string;
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Drop one `<Toaster />` near the app root. Fire toasts imperatively from
|
|
1239
|
+
* anywhere with `toast("Saved")`, `toast.success(...)`, `toast.promise(...)`.
|
|
1240
|
+
*/
|
|
1241
|
+
declare function Toaster({ position, duration, visibleToasts, closeButton, richColors, gap, offset, className, }: ToasterProps): react.JSX.Element;
|
|
1242
|
+
/** Hook form of the imperative API, plus the live toast list. */
|
|
1243
|
+
declare function useToast(): {
|
|
1244
|
+
toast: ToastFn;
|
|
1245
|
+
dismiss: (id?: string) => void;
|
|
1246
|
+
toasts: ToastRecord[];
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1249
|
+
interface UsePaginationOptions {
|
|
1250
|
+
/** 1-based current page. */
|
|
1251
|
+
page: number;
|
|
1252
|
+
/** Total number of pages. Or give `total` + `pageSize`. */
|
|
1253
|
+
count?: number;
|
|
1254
|
+
/** Total item count — used with `pageSize` when `count` is absent. */
|
|
1255
|
+
total?: number;
|
|
1256
|
+
/** Items per page — used with `total`. Default 10. */
|
|
1257
|
+
pageSize?: number;
|
|
1258
|
+
/** Pages shown either side of the current one. Default 1. */
|
|
1259
|
+
siblingCount?: number;
|
|
1260
|
+
/** Pages pinned at each end. Default 1. */
|
|
1261
|
+
boundaryCount?: number;
|
|
1262
|
+
}
|
|
1263
|
+
type PaginationSlot = number | "ellipsis-start" | "ellipsis-end";
|
|
1264
|
+
interface UsePaginationResult {
|
|
1265
|
+
/** Resolved total page count (>= 1). */
|
|
1266
|
+
pageCount: number;
|
|
1267
|
+
/** Clamped current page. */
|
|
1268
|
+
page: number;
|
|
1269
|
+
hasPrev: boolean;
|
|
1270
|
+
hasNext: boolean;
|
|
1271
|
+
/** The row to render: page numbers with `"ellipsis-*"` gaps. */
|
|
1272
|
+
slots: PaginationSlot[];
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Pure model for a pagination control — the page numbers to show, where the
|
|
1276
|
+
* gaps go, and whether prev/next are live. UI-agnostic; drive any markup with it.
|
|
1277
|
+
*/
|
|
1278
|
+
declare function usePagination({ page, count, total, pageSize, siblingCount, boundaryCount, }: UsePaginationOptions): UsePaginationResult;
|
|
1279
|
+
|
|
1280
|
+
type PaginationSize = "sm" | "md" | "lg";
|
|
1281
|
+
type PaginationVariant = "outline" | "ghost" | "solid";
|
|
1282
|
+
declare const PaginationContent: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & react.RefAttributes<HTMLUListElement>>;
|
|
1283
|
+
declare const PaginationItem: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & react.RefAttributes<HTMLLIElement>>;
|
|
1284
|
+
interface PaginationLinkProps extends ComponentProps<"button"> {
|
|
1285
|
+
/** Marks the current page. */
|
|
1286
|
+
isActive?: boolean;
|
|
1287
|
+
/** Corner treatment for the item. */
|
|
1288
|
+
size?: PaginationSize;
|
|
1289
|
+
}
|
|
1290
|
+
declare const PaginationLink: react.ForwardRefExoticComponent<Omit<PaginationLinkProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1291
|
+
declare const PaginationEllipsis: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & react.RefAttributes<HTMLSpanElement>>;
|
|
1292
|
+
interface PaginationLabels {
|
|
1293
|
+
previous?: string;
|
|
1294
|
+
next?: string;
|
|
1295
|
+
first?: string;
|
|
1296
|
+
last?: string;
|
|
1297
|
+
page?: (n: number) => string;
|
|
1298
|
+
ariaLabel?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface PaginationProps extends Omit<ComponentProps<"nav">, "onChange">, UsePaginationOptions {
|
|
1301
|
+
onPageChange: (page: number) => void;
|
|
1302
|
+
/** Show jump-to-first / jump-to-last controls. Default `false`. */
|
|
1303
|
+
showFirstLast?: boolean;
|
|
1304
|
+
/** Show the prev / next controls. Default `true`. */
|
|
1305
|
+
showPrevNext?: boolean;
|
|
1306
|
+
/** Render prev/next as bare arrows (no text). Default `false`. */
|
|
1307
|
+
iconOnly?: boolean;
|
|
1308
|
+
size?: PaginationSize;
|
|
1309
|
+
variant?: PaginationVariant;
|
|
1310
|
+
disabled?: boolean;
|
|
1311
|
+
labels?: PaginationLabels;
|
|
1312
|
+
/** Custom prev / next glyphs. */
|
|
1313
|
+
prevIcon?: ReactNode;
|
|
1314
|
+
nextIcon?: ReactNode;
|
|
1315
|
+
}
|
|
1316
|
+
declare const Pagination: react.ForwardRefExoticComponent<Omit<PaginationProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
1317
|
+
|
|
1067
1318
|
interface LabelProps extends ComponentPropsWithoutRef<typeof Label$1.Root> {
|
|
1068
1319
|
/** Append a required asterisk. */
|
|
1069
1320
|
required?: boolean;
|
|
@@ -1447,4 +1698,4 @@ interface StandardIssue {
|
|
|
1447
1698
|
*/
|
|
1448
1699
|
declare function standardSchemaResolver(schema: StandardSchemaV1): ValidationResolver;
|
|
1449
1700
|
|
|
1450
|
-
export { Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, Badge, type BadgeProps, type BadgeVariant, type BaseControlProps, type BaseFieldConfig, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxFieldConfig, CheckboxGroup, type CheckboxGroupFieldConfig, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type ColumnSpec, type ControlComponent, type ControlProps, type ControlRadius, type ControlSize, type ControlVariant, type CustomValidator, type DateFieldConfig, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownFieldConfig, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownOption, type DropdownProps, type EqualsRule, type ErrorProp, FORM_ERROR_KEY, type Feedback, Field, FieldBox, type FieldBoxProps, type FieldCondition, type FieldConfig, type FieldConfigRegistry, type FieldError, type FieldProps, type FieldRegistration, type FieldRegistry, type FieldRenderContext, type FieldSlice, type FieldStatus, type FieldType, type FieldValidation, Fieldset, type FieldsetConfig, type FieldsetProps, type FieldsetState, FieldsetView, type FieldsetViewProps, Form, type FormProps, Input, type InputFieldConfig, type InputProps, Label, type LabelProps, type NormalizedFieldsetConfig, NumberField, type NumberFieldConfig, type NumberFieldProps, type OrynnDensity, type OrynnPreset, OrynnProvider, type OrynnProviderProps, type OrynnRadius, type OrynnThemeConfig, type OrynnThemeInput, type OrynnVarOverrides, type PatternRule, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Radio, type RadioFieldConfig, RadioGroup, type RadioGroupProps, type RadioOption, type RadioProps, type RuleFn, Dropdown as Select, Separator, type SeparatorProps, type StandardSchemaV1, Switch, type SwitchProps, type SyncResolver, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaFieldConfig, type TextareaProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, TooltipTrigger, type UseFieldsetStateOptions, type UseFieldsetStateReturn, type ValidationContext, type ValidationResolver, type ValidationResult, type ValidationTrigger, badgeClasses, builtInRules, buttonClasses, createRegistry, createRuleResolver, defaultRegistry, defaultResolver, normalizeConfig, registerField, registerRule, resolveThemeVars, standardSchemaResolver, useFieldsetState, useOrynnTheme, usePortalContainer };
|
|
1701
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, Badge, type BadgeProps, type BadgeVariant, type BaseControlProps, type BaseFieldConfig, Button, type ButtonCursor, type ButtonFocusStyle, type ButtonHoverEffect, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxFieldConfig, CheckboxGroup, type CheckboxGroupFieldConfig, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type ColumnSpec, type ControlComponent, type ControlProps, type ControlRadius, type ControlSize, type ControlVariant, type CustomValidator, type DateFieldConfig, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownFieldConfig, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownOption, type DropdownProps, type EqualsRule, type ErrorProp, FORM_ERROR_KEY, type Feedback, Field, FieldBox, type FieldBoxProps, type FieldCondition, type FieldConfig, type FieldConfigRegistry, type FieldError, type FieldProps, type FieldRegistration, type FieldRegistry, type FieldRenderContext, type FieldSlice, type FieldStatus, type FieldType, type FieldValidation, Fieldset, type FieldsetConfig, type FieldsetProps, type FieldsetState, FieldsetView, type FieldsetViewProps, Form, type FormProps, Input, type InputFieldConfig, type InputProps, Label, type LabelProps, type NormalizedFieldsetConfig, NumberField, type NumberFieldConfig, type NumberFieldProps, type OrynnDensity, type OrynnPreset, OrynnProvider, type OrynnProviderProps, type OrynnRadius, type OrynnThemeConfig, type OrynnThemeInput, type OrynnVarOverrides, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, type PaginationLabels, PaginationLink, type PaginationLinkProps, type PaginationProps, type PaginationSize, type PaginationSlot, type PaginationVariant, type PatternRule, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Progress, type ProgressProps, Radio, type RadioFieldConfig, RadioGroup, type RadioGroupProps, type RadioOption, type RadioProps, type RuleFn, Dropdown as Select, Separator, type SeparatorProps, Slider, type SliderMark, type SliderProps, type StandardSchemaV1, Switch, type SwitchProps, type SyncResolver, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaFieldConfig, type TextareaProps, type ToastAction, type ToastFn, type ToastOptions, type ToastPosition, type ToastRecord, type ToastVariant, Toaster, type ToasterProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, TooltipTrigger, type UseFieldsetStateOptions, type UseFieldsetStateReturn, type UsePaginationOptions, type UsePaginationResult, type ValidationContext, type ValidationResolver, type ValidationResult, type ValidationTrigger, badgeClasses, builtInRules, buttonClasses, createRegistry, createRuleResolver, defaultRegistry, defaultResolver, normalizeConfig, registerField, registerRule, resolveThemeVars, standardSchemaResolver, toast, useFieldsetState, useOrynnTheme, usePagination, usePortalContainer, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ChangeEvent, ComponentType, SyntheticEvent, TextareaHTMLAttributes, FormEvent, FormHTMLAttributes,
|
|
3
|
-
import { Label as Label$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Dialog as Dialog$1, Popover as Popover$1, Tooltip as Tooltip$1, DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
2
|
+
import { ReactNode, HTMLAttributes, InputHTMLAttributes, ChangeEvent, ComponentType, SyntheticEvent, TextareaHTMLAttributes, FormEvent, FormHTMLAttributes, ComponentPropsWithoutRef, ComponentProps, MouseEvent, CSSProperties } from 'react';
|
|
3
|
+
import { Accordion as Accordion$1, Slider as Slider$1, Progress as Progress$1, Label as Label$1, Separator as Separator$1, Switch as Switch$1, Tabs as Tabs$1, Dialog as Dialog$1, Popover as Popover$1, Tooltip as Tooltip$1, DropdownMenu as DropdownMenu$1 } from 'radix-ui';
|
|
4
4
|
|
|
5
5
|
type ControlSize = "sm" | "md" | "lg";
|
|
6
6
|
type ControlVariant = "outline" | "filled" | "flushed" | "unstyled";
|
|
@@ -165,7 +165,8 @@ interface DatePickerPreset {
|
|
|
165
165
|
interface DatePickerCommonProps extends Omit<BaseControlProps, "startContent" | "endContent" | "loading"> {
|
|
166
166
|
/**
|
|
167
167
|
* Display / parse pattern (`yyyy MM dd M d MMM MMMM HH mm a`) or an
|
|
168
|
-
* `Intl.DateTimeFormatOptions` object. Default `"
|
|
168
|
+
* `Intl.DateTimeFormatOptions` object. Default `"dd-MMM-yyyy"` (renders e.g.
|
|
169
|
+
* `12-Jan-2020`); pass `"yyyy-MM-dd"` for ISO.
|
|
169
170
|
*/
|
|
170
171
|
format?: string | Intl.DateTimeFormatOptions;
|
|
171
172
|
minDate?: Date;
|
|
@@ -189,6 +190,12 @@ interface DatePickerCommonProps extends Omit<BaseControlProps, "startContent" |
|
|
|
189
190
|
fixedWeeks?: boolean;
|
|
190
191
|
/** Side-by-side month panels. Default 1. */
|
|
191
192
|
numberOfMonths?: number;
|
|
193
|
+
/**
|
|
194
|
+
* Lower bound for the calendar's width (`--orynn-calendar-min-width`). The
|
|
195
|
+
* calendar otherwise fills the popover, which tracks the trigger width.
|
|
196
|
+
* Number = px.
|
|
197
|
+
*/
|
|
198
|
+
calendarWidth?: number | string;
|
|
192
199
|
/** Show an hour / minute picker beside the calendar (`single` mode). */
|
|
193
200
|
showTime?: boolean;
|
|
194
201
|
/** Minute granularity for the time picker. Default 5. */
|
|
@@ -1033,8 +1040,38 @@ interface FormProps<TValues extends Values = Values> extends Omit<FormHTMLAttrib
|
|
|
1033
1040
|
*/
|
|
1034
1041
|
declare function Form<TValues extends Values = Values>(props: FormProps<TValues>): react.JSX.Element;
|
|
1035
1042
|
|
|
1043
|
+
type AccordionVariant = "bordered" | "separated" | "ghost";
|
|
1044
|
+
type AccordionSize = "sm" | "md" | "lg";
|
|
1045
|
+
type RootProps$2 = ComponentPropsWithoutRef<typeof Accordion$1.Root>;
|
|
1046
|
+
type AccordionProps = RootProps$2 & {
|
|
1047
|
+
/** `bordered` (default, dividers) · `separated` (each item a card) · `ghost` (no chrome). */
|
|
1048
|
+
variant?: AccordionVariant;
|
|
1049
|
+
/** Trigger padding + type scale. Default `md`. */
|
|
1050
|
+
size?: AccordionSize;
|
|
1051
|
+
};
|
|
1052
|
+
/**
|
|
1053
|
+
* A stack of collapsible sections. Thin wrapper over Radix Accordion — every
|
|
1054
|
+
* Root prop (`type`, `collapsible`, `value` / `defaultValue`, `onValueChange`,
|
|
1055
|
+
* `disabled`, `orientation`, `dir`) passes straight through.
|
|
1056
|
+
*/
|
|
1057
|
+
declare const Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
1058
|
+
declare const AccordionItem: react.ForwardRefExoticComponent<Omit<Accordion$1.AccordionItemProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1059
|
+
interface AccordionTriggerProps extends ComponentPropsWithoutRef<typeof Accordion$1.Trigger> {
|
|
1060
|
+
/** Indicator icon. Defaults to a chevron that rotates on open. */
|
|
1061
|
+
icon?: ReactNode;
|
|
1062
|
+
/** Which side the icon sits on. Default `end`. */
|
|
1063
|
+
iconPosition?: "start" | "end";
|
|
1064
|
+
/** Drop the indicator entirely. */
|
|
1065
|
+
hideIcon?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
declare const AccordionTrigger: react.ForwardRefExoticComponent<AccordionTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1068
|
+
declare const AccordionContent: react.ForwardRefExoticComponent<Omit<Accordion$1.AccordionContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
1069
|
+
|
|
1036
1070
|
type ButtonVariant = "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
1037
1071
|
type ButtonSize = "default" | "sm" | "lg" | "icon";
|
|
1072
|
+
type ButtonHoverEffect = "darken" | "lift" | "glow" | "outline-fill" | "none";
|
|
1073
|
+
type ButtonFocusStyle = "ring" | "solid" | "ring-inset" | "none";
|
|
1074
|
+
type ButtonCursor = "pointer" | "default" | "auto";
|
|
1038
1075
|
type BadgeVariant = "default" | "secondary" | "destructive" | "outline";
|
|
1039
1076
|
/**
|
|
1040
1077
|
* Class list for a shadcn-style button. Exported so a non-`<button>` element can
|
|
@@ -1061,9 +1098,223 @@ interface ButtonProps extends ComponentProps<"button"> {
|
|
|
1061
1098
|
rightIcon?: ReactNode;
|
|
1062
1099
|
/** Stretch to the container width. */
|
|
1063
1100
|
fullWidth?: boolean;
|
|
1101
|
+
/**
|
|
1102
|
+
* Hover treatment. `"darken"` (default) shades the fill; `"lift"` adds a
|
|
1103
|
+
* raise + shadow; `"glow"` adds a soft ring; `"outline-fill"` floods the
|
|
1104
|
+
* fill on hover (nice on `ghost` / `outline`); `"none"` disables the hover
|
|
1105
|
+
* change. Retune via `--orynn-button-hover-*` / `--orynn-button-glow`.
|
|
1106
|
+
*/
|
|
1107
|
+
hoverEffect?: ButtonHoverEffect;
|
|
1108
|
+
/**
|
|
1109
|
+
* Focus-visible treatment. `"ring"` (default) = border + soft ring halo;
|
|
1110
|
+
* `"solid"` = a crisp outline; `"ring-inset"` = the halo drawn inside the
|
|
1111
|
+
* edge; `"none"` = no focus styling (supply your own).
|
|
1112
|
+
*/
|
|
1113
|
+
focusStyle?: ButtonFocusStyle;
|
|
1114
|
+
/**
|
|
1115
|
+
* Pressed / active state — a token-styled toggle look. Also sets
|
|
1116
|
+
* `aria-pressed`. Retune via `--orynn-button-selected-*`.
|
|
1117
|
+
*/
|
|
1118
|
+
selected?: boolean;
|
|
1119
|
+
/** Idle cursor. `"pointer"` (default) · `"default"` · `"auto"`. */
|
|
1120
|
+
cursor?: ButtonCursor;
|
|
1064
1121
|
}
|
|
1065
1122
|
declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1066
1123
|
|
|
1124
|
+
type RootProps$1 = ComponentPropsWithoutRef<typeof Slider$1.Root>;
|
|
1125
|
+
interface SliderMark {
|
|
1126
|
+
value: number;
|
|
1127
|
+
label?: ReactNode;
|
|
1128
|
+
}
|
|
1129
|
+
interface SliderProps extends Omit<RootProps$1, "value" | "defaultValue" | "asChild"> {
|
|
1130
|
+
/** Controlled value. A scalar is treated as a single-thumb slider. */
|
|
1131
|
+
value?: number | number[];
|
|
1132
|
+
/** Uncontrolled initial value. Scalar → one thumb. Default `min`. */
|
|
1133
|
+
defaultValue?: number | number[];
|
|
1134
|
+
/** Track / thumb scale. Default `md`. */
|
|
1135
|
+
size?: "sm" | "md" | "lg";
|
|
1136
|
+
/** Ticks + labels pinned under the track at these values. */
|
|
1137
|
+
marks?: SliderMark[];
|
|
1138
|
+
/** Render a tick at every `step` (skipped when that would be > 60 ticks). */
|
|
1139
|
+
showTicks?: boolean;
|
|
1140
|
+
/** Value bubble over the thumb. Default `"none"`. */
|
|
1141
|
+
tooltip?: "always" | "hover" | "none";
|
|
1142
|
+
/** Format the tooltip / aria value text. */
|
|
1143
|
+
formatValue?: (value: number) => ReactNode;
|
|
1144
|
+
}
|
|
1145
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLSpanElement>>;
|
|
1146
|
+
|
|
1147
|
+
type RootProps = ComponentPropsWithoutRef<typeof Progress$1.Root>;
|
|
1148
|
+
interface ProgressProps extends Omit<RootProps, "value" | "getValueLabel"> {
|
|
1149
|
+
/** 0–`max`, or `null` / omitted for an indeterminate bar. */
|
|
1150
|
+
value?: number | null;
|
|
1151
|
+
max?: number;
|
|
1152
|
+
/** `line` (default) or `circle`. */
|
|
1153
|
+
shape?: "line" | "circle";
|
|
1154
|
+
/** Thickness / diameter scale. Default `md`. */
|
|
1155
|
+
size?: "sm" | "md" | "lg";
|
|
1156
|
+
/** Colour role. Default `default` (primary). */
|
|
1157
|
+
variant?: "default" | "success" | "warning" | "destructive";
|
|
1158
|
+
/** Render the percentage (line: trailing; circle: centred). */
|
|
1159
|
+
showValue?: boolean;
|
|
1160
|
+
/** Text shown alongside the bar (line only). */
|
|
1161
|
+
label?: ReactNode;
|
|
1162
|
+
/** Diagonal stripes (line only). */
|
|
1163
|
+
striped?: boolean;
|
|
1164
|
+
/** Animate the stripes (implies `striped`, line only). */
|
|
1165
|
+
animated?: boolean;
|
|
1166
|
+
/** Corner radius override for the line track. */
|
|
1167
|
+
radius?: string | number;
|
|
1168
|
+
/** Ring stroke width, px (circle only). Default 4 / 5 / 6 by size. */
|
|
1169
|
+
circleThickness?: number;
|
|
1170
|
+
/** Ring diameter, px (circle only). Default 40 / 56 / 72 by size. */
|
|
1171
|
+
circleSize?: number;
|
|
1172
|
+
/** Format the value text. */
|
|
1173
|
+
formatValue?: (value: number, max: number) => ReactNode;
|
|
1174
|
+
}
|
|
1175
|
+
declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1176
|
+
|
|
1177
|
+
type ToastVariant = "default" | "success" | "error" | "warning" | "info" | "loading";
|
|
1178
|
+
interface ToastAction {
|
|
1179
|
+
label: ReactNode;
|
|
1180
|
+
onClick: () => void;
|
|
1181
|
+
/** Screen-reader text for the action (Radix requires it). Defaults to the label if it's a string. */
|
|
1182
|
+
altText?: string;
|
|
1183
|
+
}
|
|
1184
|
+
interface ToastOptions {
|
|
1185
|
+
id?: string;
|
|
1186
|
+
title?: ReactNode;
|
|
1187
|
+
description?: ReactNode;
|
|
1188
|
+
variant?: ToastVariant;
|
|
1189
|
+
/** ms before auto-dismiss. `0` / `Infinity` = sticky. Falls back to the Toaster's `duration`. */
|
|
1190
|
+
duration?: number;
|
|
1191
|
+
action?: ToastAction;
|
|
1192
|
+
/** Custom leading icon. `null` hides the default variant icon. */
|
|
1193
|
+
icon?: ReactNode | null;
|
|
1194
|
+
/** Show the close button for this toast (defaults to the Toaster setting). */
|
|
1195
|
+
dismissible?: boolean;
|
|
1196
|
+
onOpenChange?: (open: boolean) => void;
|
|
1197
|
+
}
|
|
1198
|
+
interface ToastRecord extends ToastOptions {
|
|
1199
|
+
id: string;
|
|
1200
|
+
createdAt: number;
|
|
1201
|
+
}
|
|
1202
|
+
type ToastInput = ReactNode | ToastOptions;
|
|
1203
|
+
interface ToastFn {
|
|
1204
|
+
(message: ToastInput, opts?: ToastOptions): string;
|
|
1205
|
+
success: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1206
|
+
error: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1207
|
+
warning: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1208
|
+
info: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1209
|
+
loading: (message: ToastInput, opts?: ToastOptions) => string;
|
|
1210
|
+
dismiss: (id?: string) => void;
|
|
1211
|
+
promise: <T>(promise: Promise<T>, msgs: {
|
|
1212
|
+
loading: ToastInput;
|
|
1213
|
+
success: ToastInput | ((value: T) => ToastInput);
|
|
1214
|
+
error: ToastInput | ((err: unknown) => ToastInput);
|
|
1215
|
+
}, opts?: ToastOptions) => Promise<T>;
|
|
1216
|
+
}
|
|
1217
|
+
declare const toast: ToastFn;
|
|
1218
|
+
|
|
1219
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
1220
|
+
interface ToasterProps {
|
|
1221
|
+
/** Corner / edge the stack lives in. Default `"bottom-right"`. */
|
|
1222
|
+
position?: ToastPosition;
|
|
1223
|
+
/** Default auto-dismiss in ms. Default `4000`. */
|
|
1224
|
+
duration?: number;
|
|
1225
|
+
/** Max toasts shown at once (older ones wait). Default `4`. */
|
|
1226
|
+
visibleToasts?: number;
|
|
1227
|
+
/** Show a close button on every toast. Default `true`. */
|
|
1228
|
+
closeButton?: boolean;
|
|
1229
|
+
/** Tint the whole toast by variant instead of just the icon. Default `false`. */
|
|
1230
|
+
richColors?: boolean;
|
|
1231
|
+
/** Gap between stacked toasts, px. Default `12`. */
|
|
1232
|
+
gap?: number;
|
|
1233
|
+
/** Offset from the viewport edge, px. Default `24`. */
|
|
1234
|
+
offset?: number;
|
|
1235
|
+
className?: string;
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Drop one `<Toaster />` near the app root. Fire toasts imperatively from
|
|
1239
|
+
* anywhere with `toast("Saved")`, `toast.success(...)`, `toast.promise(...)`.
|
|
1240
|
+
*/
|
|
1241
|
+
declare function Toaster({ position, duration, visibleToasts, closeButton, richColors, gap, offset, className, }: ToasterProps): react.JSX.Element;
|
|
1242
|
+
/** Hook form of the imperative API, plus the live toast list. */
|
|
1243
|
+
declare function useToast(): {
|
|
1244
|
+
toast: ToastFn;
|
|
1245
|
+
dismiss: (id?: string) => void;
|
|
1246
|
+
toasts: ToastRecord[];
|
|
1247
|
+
};
|
|
1248
|
+
|
|
1249
|
+
interface UsePaginationOptions {
|
|
1250
|
+
/** 1-based current page. */
|
|
1251
|
+
page: number;
|
|
1252
|
+
/** Total number of pages. Or give `total` + `pageSize`. */
|
|
1253
|
+
count?: number;
|
|
1254
|
+
/** Total item count — used with `pageSize` when `count` is absent. */
|
|
1255
|
+
total?: number;
|
|
1256
|
+
/** Items per page — used with `total`. Default 10. */
|
|
1257
|
+
pageSize?: number;
|
|
1258
|
+
/** Pages shown either side of the current one. Default 1. */
|
|
1259
|
+
siblingCount?: number;
|
|
1260
|
+
/** Pages pinned at each end. Default 1. */
|
|
1261
|
+
boundaryCount?: number;
|
|
1262
|
+
}
|
|
1263
|
+
type PaginationSlot = number | "ellipsis-start" | "ellipsis-end";
|
|
1264
|
+
interface UsePaginationResult {
|
|
1265
|
+
/** Resolved total page count (>= 1). */
|
|
1266
|
+
pageCount: number;
|
|
1267
|
+
/** Clamped current page. */
|
|
1268
|
+
page: number;
|
|
1269
|
+
hasPrev: boolean;
|
|
1270
|
+
hasNext: boolean;
|
|
1271
|
+
/** The row to render: page numbers with `"ellipsis-*"` gaps. */
|
|
1272
|
+
slots: PaginationSlot[];
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Pure model for a pagination control — the page numbers to show, where the
|
|
1276
|
+
* gaps go, and whether prev/next are live. UI-agnostic; drive any markup with it.
|
|
1277
|
+
*/
|
|
1278
|
+
declare function usePagination({ page, count, total, pageSize, siblingCount, boundaryCount, }: UsePaginationOptions): UsePaginationResult;
|
|
1279
|
+
|
|
1280
|
+
type PaginationSize = "sm" | "md" | "lg";
|
|
1281
|
+
type PaginationVariant = "outline" | "ghost" | "solid";
|
|
1282
|
+
declare const PaginationContent: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & react.RefAttributes<HTMLUListElement>>;
|
|
1283
|
+
declare const PaginationItem: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & react.RefAttributes<HTMLLIElement>>;
|
|
1284
|
+
interface PaginationLinkProps extends ComponentProps<"button"> {
|
|
1285
|
+
/** Marks the current page. */
|
|
1286
|
+
isActive?: boolean;
|
|
1287
|
+
/** Corner treatment for the item. */
|
|
1288
|
+
size?: PaginationSize;
|
|
1289
|
+
}
|
|
1290
|
+
declare const PaginationLink: react.ForwardRefExoticComponent<Omit<PaginationLinkProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
1291
|
+
declare const PaginationEllipsis: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & react.RefAttributes<HTMLSpanElement>>;
|
|
1292
|
+
interface PaginationLabels {
|
|
1293
|
+
previous?: string;
|
|
1294
|
+
next?: string;
|
|
1295
|
+
first?: string;
|
|
1296
|
+
last?: string;
|
|
1297
|
+
page?: (n: number) => string;
|
|
1298
|
+
ariaLabel?: string;
|
|
1299
|
+
}
|
|
1300
|
+
interface PaginationProps extends Omit<ComponentProps<"nav">, "onChange">, UsePaginationOptions {
|
|
1301
|
+
onPageChange: (page: number) => void;
|
|
1302
|
+
/** Show jump-to-first / jump-to-last controls. Default `false`. */
|
|
1303
|
+
showFirstLast?: boolean;
|
|
1304
|
+
/** Show the prev / next controls. Default `true`. */
|
|
1305
|
+
showPrevNext?: boolean;
|
|
1306
|
+
/** Render prev/next as bare arrows (no text). Default `false`. */
|
|
1307
|
+
iconOnly?: boolean;
|
|
1308
|
+
size?: PaginationSize;
|
|
1309
|
+
variant?: PaginationVariant;
|
|
1310
|
+
disabled?: boolean;
|
|
1311
|
+
labels?: PaginationLabels;
|
|
1312
|
+
/** Custom prev / next glyphs. */
|
|
1313
|
+
prevIcon?: ReactNode;
|
|
1314
|
+
nextIcon?: ReactNode;
|
|
1315
|
+
}
|
|
1316
|
+
declare const Pagination: react.ForwardRefExoticComponent<Omit<PaginationProps, "ref"> & react.RefAttributes<HTMLElement>>;
|
|
1317
|
+
|
|
1067
1318
|
interface LabelProps extends ComponentPropsWithoutRef<typeof Label$1.Root> {
|
|
1068
1319
|
/** Append a required asterisk. */
|
|
1069
1320
|
required?: boolean;
|
|
@@ -1447,4 +1698,4 @@ interface StandardIssue {
|
|
|
1447
1698
|
*/
|
|
1448
1699
|
declare function standardSchemaResolver(schema: StandardSchemaV1): ValidationResolver;
|
|
1449
1700
|
|
|
1450
|
-
export { Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, Badge, type BadgeProps, type BadgeVariant, type BaseControlProps, type BaseFieldConfig, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxFieldConfig, CheckboxGroup, type CheckboxGroupFieldConfig, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type ColumnSpec, type ControlComponent, type ControlProps, type ControlRadius, type ControlSize, type ControlVariant, type CustomValidator, type DateFieldConfig, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownFieldConfig, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownOption, type DropdownProps, type EqualsRule, type ErrorProp, FORM_ERROR_KEY, type Feedback, Field, FieldBox, type FieldBoxProps, type FieldCondition, type FieldConfig, type FieldConfigRegistry, type FieldError, type FieldProps, type FieldRegistration, type FieldRegistry, type FieldRenderContext, type FieldSlice, type FieldStatus, type FieldType, type FieldValidation, Fieldset, type FieldsetConfig, type FieldsetProps, type FieldsetState, FieldsetView, type FieldsetViewProps, Form, type FormProps, Input, type InputFieldConfig, type InputProps, Label, type LabelProps, type NormalizedFieldsetConfig, NumberField, type NumberFieldConfig, type NumberFieldProps, type OrynnDensity, type OrynnPreset, OrynnProvider, type OrynnProviderProps, type OrynnRadius, type OrynnThemeConfig, type OrynnThemeInput, type OrynnVarOverrides, type PatternRule, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Radio, type RadioFieldConfig, RadioGroup, type RadioGroupProps, type RadioOption, type RadioProps, type RuleFn, Dropdown as Select, Separator, type SeparatorProps, type StandardSchemaV1, Switch, type SwitchProps, type SyncResolver, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaFieldConfig, type TextareaProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, TooltipTrigger, type UseFieldsetStateOptions, type UseFieldsetStateReturn, type ValidationContext, type ValidationResolver, type ValidationResult, type ValidationTrigger, badgeClasses, builtInRules, buttonClasses, createRegistry, createRuleResolver, defaultRegistry, defaultResolver, normalizeConfig, registerField, registerRule, resolveThemeVars, standardSchemaResolver, useFieldsetState, useOrynnTheme, usePortalContainer };
|
|
1701
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionProps, type AccordionSize, AccordionTrigger, type AccordionTriggerProps, type AccordionVariant, Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, Badge, type BadgeProps, type BadgeVariant, type BaseControlProps, type BaseFieldConfig, Button, type ButtonCursor, type ButtonFocusStyle, type ButtonHoverEffect, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxFieldConfig, CheckboxGroup, type CheckboxGroupFieldConfig, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps, type ColumnSpec, type ControlComponent, type ControlProps, type ControlRadius, type ControlSize, type ControlVariant, type CustomValidator, type DateFieldConfig, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Dropdown, type DropdownFieldConfig, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownOption, type DropdownProps, type EqualsRule, type ErrorProp, FORM_ERROR_KEY, type Feedback, Field, FieldBox, type FieldBoxProps, type FieldCondition, type FieldConfig, type FieldConfigRegistry, type FieldError, type FieldProps, type FieldRegistration, type FieldRegistry, type FieldRenderContext, type FieldSlice, type FieldStatus, type FieldType, type FieldValidation, Fieldset, type FieldsetConfig, type FieldsetProps, type FieldsetState, FieldsetView, type FieldsetViewProps, Form, type FormProps, Input, type InputFieldConfig, type InputProps, Label, type LabelProps, type NormalizedFieldsetConfig, NumberField, type NumberFieldConfig, type NumberFieldProps, type OrynnDensity, type OrynnPreset, OrynnProvider, type OrynnProviderProps, type OrynnRadius, type OrynnThemeConfig, type OrynnThemeInput, type OrynnVarOverrides, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, type PaginationLabels, PaginationLink, type PaginationLinkProps, type PaginationProps, type PaginationSize, type PaginationSlot, type PaginationVariant, type PatternRule, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, type PopoverContentProps, PopoverTrigger, Progress, type ProgressProps, Radio, type RadioFieldConfig, RadioGroup, type RadioGroupProps, type RadioOption, type RadioProps, type RuleFn, Dropdown as Select, Separator, type SeparatorProps, Slider, type SliderMark, type SliderProps, type StandardSchemaV1, Switch, type SwitchProps, type SyncResolver, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, Textarea, type TextareaFieldConfig, type TextareaProps, type ToastAction, type ToastFn, type ToastOptions, type ToastPosition, type ToastRecord, type ToastVariant, Toaster, type ToasterProps, Tooltip, TooltipContent, type TooltipContentProps, type TooltipProps, TooltipProvider, TooltipTrigger, type UseFieldsetStateOptions, type UseFieldsetStateReturn, type UsePaginationOptions, type UsePaginationResult, type ValidationContext, type ValidationResolver, type ValidationResult, type ValidationTrigger, badgeClasses, builtInRules, buttonClasses, createRegistry, createRuleResolver, defaultRegistry, defaultResolver, normalizeConfig, registerField, registerRule, resolveThemeVars, standardSchemaResolver, toast, useFieldsetState, useOrynnTheme, usePagination, usePortalContainer, useToast };
|