@hex-core/components 0.1.0 → 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/README.md +4 -0
- package/dist/index.d.ts +69 -16
- package/dist/index.js +287 -182
- package/dist/index.js.map +1 -1
- package/package.json +99 -98
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @hex-core/components
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@hex-core/components)
|
|
4
|
+
[](https://www.npmjs.com/package/@hex-core/components)
|
|
5
|
+
[](https://github.com/oscarabcorona/hex-core/blob/main/LICENSE)
|
|
6
|
+
|
|
3
7
|
AI-native React components — Radix UI + Tailwind CSS + CVA, with machine-readable schemas for every component.
|
|
4
8
|
|
|
5
9
|
## Install
|
package/dist/index.d.ts
CHANGED
|
@@ -125,11 +125,21 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
|
|
|
125
125
|
/** A single radio option within a RadioGroup. */
|
|
126
126
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
127
127
|
|
|
128
|
+
interface SliderProps extends React$1.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
|
|
129
|
+
/**
|
|
130
|
+
* Per-thumb accessible labels. When the slider has multiple thumbs, pass
|
|
131
|
+
* one entry per thumb (e.g. ["Minimum", "Maximum"]). For a single-thumb
|
|
132
|
+
* slider, the Root's `aria-label` / `aria-labelledby` is mirrored onto
|
|
133
|
+
* the thumb automatically — pass `thumbLabels` only when those defaults
|
|
134
|
+
* are insufficient.
|
|
135
|
+
*/
|
|
136
|
+
thumbLabels?: string[];
|
|
137
|
+
}
|
|
128
138
|
/**
|
|
129
139
|
* A range input with one or more draggable thumbs.
|
|
130
140
|
* Built on Radix UI Slider with keyboard controls (arrows, Home, End, PageUp/Down).
|
|
131
141
|
*/
|
|
132
|
-
declare const Slider: React$1.ForwardRefExoticComponent<
|
|
142
|
+
declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
133
143
|
|
|
134
144
|
declare const toggleVariants: (props?: ({
|
|
135
145
|
variant?: "default" | "outline" | null | undefined;
|
|
@@ -175,8 +185,17 @@ declare function Skeleton({ className, ...props }: React$1.HTMLAttributes<HTMLDi
|
|
|
175
185
|
*/
|
|
176
186
|
declare const Progress: React$1.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
177
187
|
|
|
188
|
+
interface ScrollAreaProps extends React$1.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {
|
|
189
|
+
/**
|
|
190
|
+
* tabIndex applied to the scroll viewport so keyboard users can scroll
|
|
191
|
+
* without a pointer. Defaults to `0` (focusable) — pass `-1` to skip the
|
|
192
|
+
* viewport in the tab order when ScrollArea wraps purely decorative or
|
|
193
|
+
* already-keyboard-reachable content.
|
|
194
|
+
*/
|
|
195
|
+
viewportTabIndex?: number;
|
|
196
|
+
}
|
|
178
197
|
/** A scrollable area with custom-styled scrollbars. Content must be explicitly sized. */
|
|
179
|
-
declare const ScrollArea: React$1.ForwardRefExoticComponent<
|
|
198
|
+
declare const ScrollArea: React$1.ForwardRefExoticComponent<ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
180
199
|
/** Styled scrollbar track + thumb. Rendered inside ScrollArea automatically. */
|
|
181
200
|
declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
182
201
|
|
|
@@ -224,8 +243,22 @@ declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
|
224
243
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
225
244
|
/** Dimmed backdrop rendered behind the dialog content. */
|
|
226
245
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
246
|
+
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
247
|
+
/**
|
|
248
|
+
* When `true` (the default), DialogContent caps its height at viewport-2rem
|
|
249
|
+
* and renders children inside a padded inner scroll container. The Close
|
|
250
|
+
* button stays anchored to the (non-scrolling) outer panel so it remains
|
|
251
|
+
* visible even when the user scrolls long content.
|
|
252
|
+
*
|
|
253
|
+
* Pass `scrollable={false}` to opt out — useful when the consumer manages
|
|
254
|
+
* its own scroll surface (e.g. CommandDialog defers scroll to cmdk's
|
|
255
|
+
* internal CommandList).
|
|
256
|
+
*/
|
|
257
|
+
scrollable?: boolean;
|
|
258
|
+
}
|
|
227
259
|
/** The dialog content panel, centered on the overlay. Includes a close button by default. */
|
|
228
|
-
declare const DialogContent: React$1.ForwardRefExoticComponent<
|
|
260
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<DialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
261
|
+
|
|
229
262
|
/**
|
|
230
263
|
* Header container inside DialogContent; stacks title and description.
|
|
231
264
|
* @returns A div wrapping title/description with vertical rhythm
|
|
@@ -511,7 +544,11 @@ declare const TableRow: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes
|
|
|
511
544
|
declare const TableHead: React$1.ForwardRefExoticComponent<React$1.ThHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
512
545
|
/** `<td>` with consistent padding. */
|
|
513
546
|
declare const TableCell: React$1.ForwardRefExoticComponent<React$1.TdHTMLAttributes<HTMLTableCellElement> & React$1.RefAttributes<HTMLTableCellElement>>;
|
|
514
|
-
/**
|
|
547
|
+
/**
|
|
548
|
+
* Visible `<caption>` rendered below the table. The parent `<Table>` sets
|
|
549
|
+
* `caption-bottom`, so the caption is announced first by screen readers when
|
|
550
|
+
* entering the table, then visually placed below the rows.
|
|
551
|
+
*/
|
|
515
552
|
declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLTableCaptionElement> & React$1.RefAttributes<HTMLTableCaptionElement>>;
|
|
516
553
|
|
|
517
554
|
/**
|
|
@@ -523,13 +560,24 @@ declare const TableCaption: React$1.ForwardRefExoticComponent<React$1.HTMLAttrib
|
|
|
523
560
|
interface DataTableProps<TData> {
|
|
524
561
|
columns: ColumnDef<TData, unknown>[];
|
|
525
562
|
data: TData[];
|
|
563
|
+
/**
|
|
564
|
+
* Visible caption rendered below the table. Announced by screen readers
|
|
565
|
+
* when the user enters the table. Provide either `caption` or `aria-label`.
|
|
566
|
+
*/
|
|
567
|
+
caption?: React$1.ReactNode;
|
|
568
|
+
/**
|
|
569
|
+
* Accessible label for the table when no visible caption is shown.
|
|
570
|
+
* Forwarded as `aria-label` on the underlying `<table>` element. Kebab-case
|
|
571
|
+
* to match the canonical ARIA prop convention used elsewhere in Hex UI.
|
|
572
|
+
*/
|
|
573
|
+
"aria-label"?: string;
|
|
526
574
|
}
|
|
527
575
|
/**
|
|
528
576
|
* Render a data-driven table from TanStack column definitions.
|
|
529
|
-
* @param props - Columns and
|
|
577
|
+
* @param props - Columns, data, and optional accessible labelling (`caption` or `aria-label`)
|
|
530
578
|
* @returns A styled Table rendered from the TanStack row model
|
|
531
579
|
*/
|
|
532
|
-
declare function DataTable<TData>({ columns, data }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
580
|
+
declare function DataTable<TData>({ columns, data, caption, "aria-label": ariaLabel, }: DataTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
533
581
|
|
|
534
582
|
/**
|
|
535
583
|
* Root nav landmark for pagination controls.
|
|
@@ -690,14 +738,17 @@ declare const CommandGroup: React$1.ForwardRefExoticComponent<Omit<{
|
|
|
690
738
|
value?: string;
|
|
691
739
|
forceMount?: boolean;
|
|
692
740
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
693
|
-
/**
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
741
|
+
/**
|
|
742
|
+
* Horizontal rule between groups. Renders as a presentational `<div>` (no role)
|
|
743
|
+
* so it can sit inside CommandList (role=listbox) without violating ARIA's
|
|
744
|
+
* required-children rule for listbox. The line is purely decorative — cmdk's
|
|
745
|
+
* built-in Separator hardcodes `role="separator"`, which axe rejects in this
|
|
746
|
+
* context, so we render the divider directly.
|
|
747
|
+
*
|
|
748
|
+
* The `data-cmdk-separator` attribute is preserved so existing CSS / test
|
|
749
|
+
* selectors that target cmdk's separator continue to match.
|
|
750
|
+
*/
|
|
751
|
+
declare const CommandSeparator: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
701
752
|
/** Selectable item. onSelect fires on Enter or click. */
|
|
702
753
|
declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
703
754
|
children?: React$1.ReactNode;
|
|
@@ -746,8 +797,10 @@ interface ComboboxProps {
|
|
|
746
797
|
disabled?: boolean;
|
|
747
798
|
/** Extra class names on the trigger button. */
|
|
748
799
|
className?: string;
|
|
749
|
-
/** Accessible label for the trigger (required when no adjacent visible
|
|
800
|
+
/** Accessible label for the trigger (required when no adjacent visible label). */
|
|
750
801
|
"aria-label"?: string;
|
|
802
|
+
/** Id of an external visible label that names this combobox. */
|
|
803
|
+
"aria-labelledby"?: string;
|
|
751
804
|
}
|
|
752
805
|
/**
|
|
753
806
|
* Searchable select input built on Command + Popover.
|
|
@@ -756,7 +809,7 @@ interface ComboboxProps {
|
|
|
756
809
|
* the trigger; the popover contains a CommandInput and filtered CommandList.
|
|
757
810
|
* @returns A trigger button that opens a filtered option list.
|
|
758
811
|
*/
|
|
759
|
-
declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyText, disabled, className, "aria-label": ariaLabel, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
812
|
+
declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyText, disabled, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
760
813
|
declare namespace Combobox {
|
|
761
814
|
var displayName: string;
|
|
762
815
|
}
|