@hex-core/components 1.3.1 → 1.4.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 +183 -9
- package/dist/accordion.d.ts +13 -0
- package/dist/accordion.js +62 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert-dialog.d.ts +34 -0
- package/dist/alert-dialog.js +125 -0
- package/dist/alert-dialog.js.map +1 -0
- package/dist/alert.d.ts +17 -0
- package/dist/alert.js +54 -0
- package/dist/alert.js.map +1 -0
- package/dist/aspect-ratio.d.ts +7 -0
- package/dist/aspect-ratio.js +8 -0
- package/dist/aspect-ratio.js.map +1 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.js +44 -0
- package/dist/avatar.js.map +1 -0
- package/dist/badge.d.ts +22 -0
- package/dist/badge.js +36 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.d.ts +27 -0
- package/dist/breadcrumb.js +120 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button-variants-Bx6gCUFp.d.ts +19 -0
- package/dist/button.d.ts +13 -0
- package/dist/button.js +113 -0
- package/dist/button.js.map +1 -0
- package/dist/calendar.d.ts +17 -0
- package/dist/calendar.js +126 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +16 -0
- package/dist/card.js +68 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.d.ts +11 -0
- package/dist/checkbox.js +65 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/cluster.d.ts +34 -0
- package/dist/cluster.js +50 -0
- package/dist/cluster.js.map +1 -0
- package/dist/collapsible.d.ts +11 -0
- package/dist/collapsible.js +10 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/color-picker.d.ts +44 -0
- package/dist/color-picker.js +321 -0
- package/dist/color-picker.js.map +1 -0
- package/dist/combobox.d.ts +45 -0
- package/dist/combobox.js +226 -0
- package/dist/combobox.js.map +1 -0
- package/dist/command.d.ts +111 -0
- package/dist/command.js +232 -0
- package/dist/command.js.map +1 -0
- package/dist/container.d.ts +41 -0
- package/dist/container.js +39 -0
- package/dist/container.js.map +1 -0
- package/dist/context-menu.d.ts +37 -0
- package/dist/context-menu.js +130 -0
- package/dist/context-menu.js.map +1 -0
- package/dist/data-table.d.ts +33 -0
- package/dist/data-table.js +103 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +43 -0
- package/dist/date-picker.js +221 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dialog.d.ts +46 -0
- package/dist/dialog.js +125 -0
- package/dist/dialog.js.map +1 -0
- package/dist/drawer.d.ts +41 -0
- package/dist/drawer.js +82 -0
- package/dist/drawer.js.map +1 -0
- package/dist/dropdown-menu.d.ts +39 -0
- package/dist/dropdown-menu.js +133 -0
- package/dist/dropdown-menu.js.map +1 -0
- package/dist/dropzone.d.ts +54 -0
- package/dist/dropzone.js +194 -0
- package/dist/dropzone.js.map +1 -0
- package/dist/file-tree.d.ts +53 -0
- package/dist/file-tree.js +322 -0
- package/dist/file-tree.js.map +1 -0
- package/dist/form.d.ts +45 -0
- package/dist/form.js +114 -0
- package/dist/form.js.map +1 -0
- package/dist/grid.d.ts +50 -0
- package/dist/grid.js +58 -0
- package/dist/grid.js.map +1 -0
- package/dist/hover-card.d.ts +11 -0
- package/dist/hover-card.js +34 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/index.d.ts +98 -1571
- package/dist/index.js +527 -5536
- package/dist/index.js.map +1 -1
- package/dist/input-otp.d.ts +19 -0
- package/dist/input-otp.js +71 -0
- package/dist/input-otp.js.map +1 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +40 -0
- package/dist/input.js.map +1 -0
- package/dist/label.d.ts +11 -0
- package/dist/label.js +22 -0
- package/dist/label.js.map +1 -0
- package/dist/menubar.d.ts +35 -0
- package/dist/menubar.js +106 -0
- package/dist/menubar.js.map +1 -0
- package/dist/multi-combobox.d.ts +51 -0
- package/dist/multi-combobox.js +258 -0
- package/dist/multi-combobox.js.map +1 -0
- package/dist/navigation-menu.d.ts +23 -0
- package/dist/navigation-menu.js +108 -0
- package/dist/navigation-menu.js.map +1 -0
- package/dist/pagination.d.ts +40 -0
- package/dist/pagination.js +195 -0
- package/dist/pagination.js.map +1 -0
- package/dist/popover.d.ts +13 -0
- package/dist/popover.js +35 -0
- package/dist/popover.js.map +1 -0
- package/dist/progress.d.ts +10 -0
- package/dist/progress.js +38 -0
- package/dist/progress.js.map +1 -0
- package/dist/radio-group.d.ts +9 -0
- package/dist/radio-group.js +44 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/resizable.d.ts +28 -0
- package/dist/resizable.js +66 -0
- package/dist/resizable.js.map +1 -0
- package/dist/schemas.d.ts +121 -0
- package/dist/schemas.js +4643 -0
- package/dist/schemas.js.map +1 -0
- package/dist/scroll-area.d.ts +18 -0
- package/dist/scroll-area.js +55 -0
- package/dist/scroll-area.js.map +1 -0
- package/dist/select.d.ts +21 -0
- package/dist/select.js +136 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.d.ts +11 -0
- package/dist/separator.js +29 -0
- package/dist/separator.js.map +1 -0
- package/dist/sheet.d.ts +39 -0
- package/dist/sheet.js +140 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sidebar.d.ts +75 -0
- package/dist/sidebar.js +201 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/skeleton.d.ts +11 -0
- package/dist/skeleton.js +21 -0
- package/dist/skeleton.js.map +1 -0
- package/dist/slider.d.ts +20 -0
- package/dist/slider.js +55 -0
- package/dist/slider.js.map +1 -0
- package/dist/sonner.d.ts +14 -0
- package/dist/sonner.js +27 -0
- package/dist/sonner.js.map +1 -0
- package/dist/spacer.d.ts +38 -0
- package/dist/spacer.js +43 -0
- package/dist/spacer.js.map +1 -0
- package/dist/stack.d.ts +34 -0
- package/dist/stack.js +49 -0
- package/dist/stack.js.map +1 -0
- package/dist/stepper.d.ts +48 -0
- package/dist/stepper.js +226 -0
- package/dist/stepper.js.map +1 -0
- package/dist/switch.d.ts +11 -0
- package/dist/switch.js +47 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.d.ts +24 -0
- package/dist/table.js +85 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.d.ts +13 -0
- package/dist/tabs.js +57 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.d.ts +10 -0
- package/dist/textarea.js +36 -0
- package/dist/textarea.js.map +1 -0
- package/dist/time-picker.d.ts +34 -0
- package/dist/time-picker.js +50 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/timeline.d.ts +42 -0
- package/dist/timeline.js +84 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toggle-group.d.ts +17 -0
- package/dist/toggle-group.js +83 -0
- package/dist/toggle-group.js.map +1 -0
- package/dist/toggle.d.ts +19 -0
- package/dist/toggle.js +49 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tooltip.d.ts +13 -0
- package/dist/tooltip.js +33 -0
- package/dist/tooltip.js.map +1 -0
- package/package.json +68 -16
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface TimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "size"> {
|
|
4
|
+
/** Controlled time value as `"HH:MM"` or `"HH:MM:SS"` (24-hour). */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** Fired with the new `"HH:MM"` (or `"HH:MM:SS"`) string when the user picks a time. */
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Step in seconds — `60` shows HH:MM only (default), `1` shows HH:MM:SS.
|
|
10
|
+
* Smaller values change the spinner increment in supported browsers.
|
|
11
|
+
*/
|
|
12
|
+
step?: number;
|
|
13
|
+
/** Earliest selectable time as `"HH:MM"`. */
|
|
14
|
+
min?: string;
|
|
15
|
+
/** Latest selectable time as `"HH:MM"`. */
|
|
16
|
+
max?: string;
|
|
17
|
+
/** Disable the input. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Accessible label for the trigger (required when no adjacent visible <label>). */
|
|
20
|
+
"aria-label"?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Time input — styled wrapper around the native `<input type="time">` so the
|
|
24
|
+
* browser handles 12/24-hour locale, keyboard arrow stepping, and screen-reader
|
|
25
|
+
* announcement. Value is a `"HH:MM"` (or `"HH:MM:SS"` when `step={1}`) string.
|
|
26
|
+
*
|
|
27
|
+
* For free-form composite hour/minute fields with explicit AM/PM segments,
|
|
28
|
+
* compose Input + Select yourself — the native input covers ~95% of TimePicker
|
|
29
|
+
* use cases with full a11y, including keyboard-driven hour/minute spinning.
|
|
30
|
+
* @returns A token-styled native time input.
|
|
31
|
+
*/
|
|
32
|
+
declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
|
|
34
|
+
export { TimePicker, type TimePickerProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var TimePicker = React.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
value,
|
|
13
|
+
onChange,
|
|
14
|
+
step,
|
|
15
|
+
min,
|
|
16
|
+
max,
|
|
17
|
+
disabled,
|
|
18
|
+
className,
|
|
19
|
+
"aria-label": ariaLabel,
|
|
20
|
+
...rest
|
|
21
|
+
}, ref) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"input",
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
type: "time",
|
|
27
|
+
value: value ?? "",
|
|
28
|
+
step,
|
|
29
|
+
min,
|
|
30
|
+
max,
|
|
31
|
+
disabled,
|
|
32
|
+
"aria-label": ariaLabel,
|
|
33
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
34
|
+
className: cn(
|
|
35
|
+
"inline-flex h-[var(--control-height-md,2.5rem)] w-[160px] items-center rounded-md border border-input bg-background px-[var(--space-3,0.75rem)] py-[var(--space-2,0.5rem)] text-sm font-normal transition-all duration-[var(--duration-normal,200ms)] ease-out",
|
|
36
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
37
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
38
|
+
"[&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-60 hover:[&::-webkit-calendar-picker-indicator]:opacity-100",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...rest
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
TimePicker.displayName = "TimePicker";
|
|
47
|
+
|
|
48
|
+
export { TimePicker };
|
|
49
|
+
//# sourceMappingURL=time-picker.js.map
|
|
50
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/time-picker/time-picker.tsx"],"names":[],"mappings":";;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;AC6BA,IAAM,UAAA,GAAmB,KAAA,CAAA,UAAA;AAAA,EACxB,CACC;AAAA,IACC,KAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA,EAAc,SAAA;AAAA,IACd,GAAG;AAAA,KAEJ,GAAA,KACI;AACJ,IAAA,uBACC,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACA,GAAA;AAAA,QACA,IAAA,EAAK,MAAA;AAAA,QACL,OAAO,KAAA,IAAS,EAAA;AAAA,QAChB,IAAA;AAAA,QACA,GAAA;AAAA,QACA,GAAA;AAAA,QACA,QAAA;AAAA,QACA,YAAA,EAAY,SAAA;AAAA,QACZ,UAAU,CAAC,CAAA,KAAM,QAAA,GAAW,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QAC1C,SAAA,EAAW,EAAA;AAAA,UACV,gQAAA;AAAA,UACA,qGAAA;AAAA,UACA,kDAAA;AAAA,UACA,kKAAA;AAAA,UACA;AAAA,SACD;AAAA,QACC,GAAG;AAAA;AAAA,KACL;AAAA,EAEF;AACD;AACA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"time-picker.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\ninterface TimePickerProps\n\textends Omit<\n\t\tReact.InputHTMLAttributes<HTMLInputElement>,\n\t\t\"type\" | \"value\" | \"onChange\" | \"size\"\n\t> {\n\t/** Controlled time value as `\"HH:MM\"` or `\"HH:MM:SS\"` (24-hour). */\n\tvalue?: string;\n\t/** Fired with the new `\"HH:MM\"` (or `\"HH:MM:SS\"`) string when the user picks a time. */\n\tonChange?: (value: string) => void;\n\t/**\n\t * Step in seconds — `60` shows HH:MM only (default), `1` shows HH:MM:SS.\n\t * Smaller values change the spinner increment in supported browsers.\n\t */\n\tstep?: number;\n\t/** Earliest selectable time as `\"HH:MM\"`. */\n\tmin?: string;\n\t/** Latest selectable time as `\"HH:MM\"`. */\n\tmax?: string;\n\t/** Disable the input. */\n\tdisabled?: boolean;\n\t/** Accessible label for the trigger (required when no adjacent visible <label>). */\n\t\"aria-label\"?: string;\n}\n\n/**\n * Time input — styled wrapper around the native `<input type=\"time\">` so the\n * browser handles 12/24-hour locale, keyboard arrow stepping, and screen-reader\n * announcement. Value is a `\"HH:MM\"` (or `\"HH:MM:SS\"` when `step={1}`) string.\n *\n * For free-form composite hour/minute fields with explicit AM/PM segments,\n * compose Input + Select yourself — the native input covers ~95% of TimePicker\n * use cases with full a11y, including keyboard-driven hour/minute spinning.\n * @returns A token-styled native time input.\n */\nconst TimePicker = React.forwardRef<HTMLInputElement, TimePickerProps>(\n\t(\n\t\t{\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tstep,\n\t\t\tmin,\n\t\t\tmax,\n\t\t\tdisabled,\n\t\t\tclassName,\n\t\t\t\"aria-label\": ariaLabel,\n\t\t\t...rest\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<input\n\t\t\t\tref={ref}\n\t\t\t\ttype=\"time\"\n\t\t\t\tvalue={value ?? \"\"}\n\t\t\t\tstep={step}\n\t\t\t\tmin={min}\n\t\t\t\tmax={max}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"inline-flex h-[var(--control-height-md,2.5rem)] w-[160px] items-center rounded-md border border-input bg-background px-[var(--space-3,0.75rem)] py-[var(--space-2,0.5rem)] text-sm font-normal transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\t\t\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n\t\t\t\t\t\"disabled:pointer-events-none disabled:opacity-50\",\n\t\t\t\t\t\"[&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-60 hover:[&::-webkit-calendar-picker-indicator]:opacity-100\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\nTimePicker.displayName = \"TimePicker\";\n\nexport { TimePicker };\nexport type { TimePickerProps };\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type TimelineStatus = "default" | "success" | "warning" | "error" | "info";
|
|
5
|
+
interface TimelineEvent {
|
|
6
|
+
/** Stable unique id used as the React key. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Headline for the event. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Optional timestamp/metadata (e.g. "2 hours ago", "2026-04-27 14:30"). */
|
|
11
|
+
timestamp?: React.ReactNode;
|
|
12
|
+
/** Optional secondary text/body. */
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
/** Optional icon override for the indicator. Replaces the default dot. */
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
/** Color variant for the indicator. */
|
|
17
|
+
status?: TimelineStatus;
|
|
18
|
+
}
|
|
19
|
+
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLOListElement>, "aria-label"> {
|
|
20
|
+
/** Ordered list of chronological events. */
|
|
21
|
+
events: TimelineEvent[];
|
|
22
|
+
/** Indicator size — `"md"` by default. */
|
|
23
|
+
size?: "sm" | "md";
|
|
24
|
+
/** Required accessible name for the ordered list. */
|
|
25
|
+
"aria-label": string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Vertical chronological event feed (activity log, audit trail, release notes).
|
|
29
|
+
* Pure semantic HTML — `<ol>` of `<li>`. Events expose an optional icon, a
|
|
30
|
+
* status color, a timestamp, and a description; status is purely visual, no
|
|
31
|
+
* aria-current is set since events are historical, not navigational.
|
|
32
|
+
*
|
|
33
|
+
* For Gantt-style project timelines, build a custom layout — Timeline is for
|
|
34
|
+
* event feeds, not scheduling.
|
|
35
|
+
* @returns An accessible vertical event list.
|
|
36
|
+
*/
|
|
37
|
+
declare function Timeline({ events, size, "aria-label": ariaLabel, className, ...rest }: TimelineProps): react_jsx_runtime.JSX.Element;
|
|
38
|
+
declare namespace Timeline {
|
|
39
|
+
var displayName: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus };
|
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/components/timeline/timeline.tsx
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var indicator = cva(
|
|
11
|
+
"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-[var(--duration-normal,200ms)] ease-out",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
status: {
|
|
15
|
+
default: "bg-background border-input text-muted-foreground",
|
|
16
|
+
success: "bg-background border-primary text-primary",
|
|
17
|
+
warning: "bg-background border-[var(--color-warning,oklch(0.78_0.16_82))] text-[var(--color-warning,oklch(0.78_0.16_82))]",
|
|
18
|
+
error: "bg-destructive border-destructive text-destructive-foreground",
|
|
19
|
+
info: "bg-background border-ring text-ring"
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
sm: "h-5 w-5 text-[10px]",
|
|
23
|
+
md: "h-7 w-7 text-xs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: { status: "default", size: "md" }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
function DefaultDot() {
|
|
30
|
+
return /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-current", "aria-hidden": "true" });
|
|
31
|
+
}
|
|
32
|
+
function Timeline({
|
|
33
|
+
events,
|
|
34
|
+
size = "md",
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
className,
|
|
37
|
+
...rest
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"ol",
|
|
41
|
+
{
|
|
42
|
+
"aria-label": ariaLabel,
|
|
43
|
+
className: cn("flex flex-col list-none p-0 m-0", className),
|
|
44
|
+
...rest,
|
|
45
|
+
children: events.map((event, index) => {
|
|
46
|
+
const isLast = index === events.length - 1;
|
|
47
|
+
const status = event.status ?? "default";
|
|
48
|
+
return /* @__PURE__ */ jsxs("li", { className: "relative flex gap-[var(--space-3,0.75rem)]", children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: indicator({ status, size }), children: event.icon ?? /* @__PURE__ */ jsx(DefaultDot, {}) }),
|
|
51
|
+
!isLast ? /* @__PURE__ */ jsx(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: "w-px flex-1 bg-input min-h-[var(--space-6,1.5rem)]"
|
|
56
|
+
}
|
|
57
|
+
) : null
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsxs(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"flex flex-col gap-[var(--space-1,0.25rem)] min-w-0",
|
|
64
|
+
!isLast && "pb-[var(--space-6,1.5rem)]"
|
|
65
|
+
),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-[var(--space-2,0.5rem)]", children: [
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: event.title }),
|
|
69
|
+
event.timestamp ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: event.timestamp }) : null
|
|
70
|
+
] }),
|
|
71
|
+
event.description ? /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: event.description }) : null
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }, event.id);
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
Timeline.displayName = "Timeline";
|
|
81
|
+
|
|
82
|
+
export { Timeline };
|
|
83
|
+
//# sourceMappingURL=timeline.js.map
|
|
84
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/timeline/timeline.tsx"],"names":[],"mappings":";;;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACgBA,IAAM,SAAA,GAAY,GAAA;AAAA,EACjB,yJAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,MAAA,EAAQ;AAAA,QACP,OAAA,EAAS,kDAAA;AAAA,QACT,OAAA,EAAS,2CAAA;AAAA,QACT,OAAA,EACC,iHAAA;AAAA,QACD,KAAA,EAAO,+DAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACP;AAAA,MACA,IAAA,EAAM;AAAA,QACL,EAAA,EAAI,qBAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACL,KACD;AAAA,IACA,eAAA,EAAiB,EAAE,MAAA,EAAQ,SAAA,EAAW,MAAM,IAAA;AAAK;AAEnD,CAAA;AAaA,SAAS,UAAA,GAAa;AACrB,EAAA,uBAAO,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qCAAA,EAAsC,eAAY,MAAA,EAAO,CAAA;AACjF;AAYA,SAAS,QAAA,CAAS;AAAA,EACjB,MAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,YAAA,EAAc,SAAA;AAAA,EACd,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAkB;AACjB,EAAA,uBACC,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACA,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAW,EAAA,CAAG,iCAAA,EAAmC,SAAS,CAAA;AAAA,MACzD,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,KAAU;AAC7B,QAAA,MAAM,MAAA,GAAS,KAAA,KAAU,MAAA,CAAO,MAAA,GAAS,CAAA;AACzC,QAAA,MAAM,MAAA,GAAS,MAAM,MAAA,IAAU,SAAA;AAC/B,QAAA,uBACC,IAAA,CAAC,IAAA,EAAA,EAAkB,SAAA,EAAU,4CAAA,EAC5B,QAAA,EAAA;AAAA,0BAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,4BAAA,EACd,QAAA,EAAA;AAAA,4BAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAW,SAAA,CAAU,EAAE,MAAA,EAAQ,IAAA,EAAM,CAAA,EACzC,QAAA,EAAA,KAAA,CAAM,IAAA,oBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,CAAA,EAC5B,CAAA;AAAA,YACC,CAAC,MAAA,mBACD,GAAA;AAAA,cAAC,MAAA;AAAA,cAAA;AAAA,gBACA,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAU;AAAA;AAAA,aACX,GACG;AAAA,WAAA,EACL,CAAA;AAAA,0BACA,IAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACA,SAAA,EAAW,EAAA;AAAA,gBACV,oDAAA;AAAA,gBACA,CAAC,MAAA,IAAU;AAAA,eACZ;AAAA,cAEA,QAAA,EAAA;AAAA,gCAAA,IAAA,CAAC,KAAA,EAAA,EAAI,WAAU,2DAAA,EACd,QAAA,EAAA;AAAA,kCAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qCAAA,EACd,QAAA,EAAA,KAAA,CAAM,KAAA,EACR,CAAA;AAAA,kBACC,KAAA,CAAM,4BACN,GAAA,CAAC,MAAA,EAAA,EAAK,WAAU,+BAAA,EACd,QAAA,EAAA,KAAA,CAAM,WACR,CAAA,GACG;AAAA,iBAAA,EACL,CAAA;AAAA,gBACC,KAAA,CAAM,8BACN,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,+BAAA,EACb,QAAA,EAAA,KAAA,CAAM,aACR,CAAA,GACG;AAAA;AAAA;AAAA;AACL,SAAA,EAAA,EAjCQ,MAAM,EAkCf,CAAA;AAAA,MAEF,CAAC;AAAA;AAAA,GACF;AAEF;AACA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"timeline.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\ntype TimelineStatus = \"default\" | \"success\" | \"warning\" | \"error\" | \"info\";\n\ninterface TimelineEvent {\n\t/** Stable unique id used as the React key. */\n\tid: string;\n\t/** Headline for the event. */\n\ttitle: string;\n\t/** Optional timestamp/metadata (e.g. \"2 hours ago\", \"2026-04-27 14:30\"). */\n\ttimestamp?: React.ReactNode;\n\t/** Optional secondary text/body. */\n\tdescription?: React.ReactNode;\n\t/** Optional icon override for the indicator. Replaces the default dot. */\n\ticon?: React.ReactNode;\n\t/** Color variant for the indicator. */\n\tstatus?: TimelineStatus;\n}\n\n/*\n * `warning` uses a token-with-fallback so themes can override `--color-warning`\n * without touching component source. The OKLCH default lands at a desaturated\n * amber that holds AA contrast on both light and dark backgrounds.\n */\nconst indicator = cva(\n\t\"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-[var(--duration-normal,200ms)] ease-out\",\n\t{\n\t\tvariants: {\n\t\t\tstatus: {\n\t\t\t\tdefault: \"bg-background border-input text-muted-foreground\",\n\t\t\t\tsuccess: \"bg-background border-primary text-primary\",\n\t\t\t\twarning:\n\t\t\t\t\t\"bg-background border-[var(--color-warning,oklch(0.78_0.16_82))] text-[var(--color-warning,oklch(0.78_0.16_82))]\",\n\t\t\t\terror: \"bg-destructive border-destructive text-destructive-foreground\",\n\t\t\t\tinfo: \"bg-background border-ring text-ring\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tsm: \"h-5 w-5 text-[10px]\",\n\t\t\t\tmd: \"h-7 w-7 text-xs\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: { status: \"default\", size: \"md\" },\n\t},\n);\n\ninterface TimelineProps\n\textends Omit<React.HTMLAttributes<HTMLOListElement>, \"aria-label\"> {\n\t/** Ordered list of chronological events. */\n\tevents: TimelineEvent[];\n\t/** Indicator size — `\"md\"` by default. */\n\tsize?: \"sm\" | \"md\";\n\t/** Required accessible name for the ordered list. */\n\t\"aria-label\": string;\n}\n\n/** Solid dot rendered inside the indicator when no per-event icon is supplied. */\nfunction DefaultDot() {\n\treturn <span className=\"h-1.5 w-1.5 rounded-full bg-current\" aria-hidden=\"true\" />;\n}\n\n/**\n * Vertical chronological event feed (activity log, audit trail, release notes).\n * Pure semantic HTML — `<ol>` of `<li>`. Events expose an optional icon, a\n * status color, a timestamp, and a description; status is purely visual, no\n * aria-current is set since events are historical, not navigational.\n *\n * For Gantt-style project timelines, build a custom layout — Timeline is for\n * event feeds, not scheduling.\n * @returns An accessible vertical event list.\n */\nfunction Timeline({\n\tevents,\n\tsize = \"md\",\n\t\"aria-label\": ariaLabel,\n\tclassName,\n\t...rest\n}: TimelineProps) {\n\treturn (\n\t\t<ol\n\t\t\taria-label={ariaLabel}\n\t\t\tclassName={cn(\"flex flex-col list-none p-0 m-0\", className)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{events.map((event, index) => {\n\t\t\t\tconst isLast = index === events.length - 1;\n\t\t\t\tconst status = event.status ?? \"default\";\n\t\t\t\treturn (\n\t\t\t\t\t<li key={event.id} className=\"relative flex gap-[var(--space-3,0.75rem)]\">\n\t\t\t\t\t\t<div className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t<span className={indicator({ status, size })}>\n\t\t\t\t\t\t\t\t{event.icon ?? <DefaultDot />}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{!isLast ? (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\tclassName=\"w-px flex-1 bg-input min-h-[var(--space-6,1.5rem)]\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\"flex flex-col gap-[var(--space-1,0.25rem)] min-w-0\",\n\t\t\t\t\t\t\t\t!isLast && \"pb-[var(--space-6,1.5rem)]\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"flex flex-wrap items-baseline gap-[var(--space-2,0.5rem)]\">\n\t\t\t\t\t\t\t\t<span className=\"text-sm font-medium text-foreground\">\n\t\t\t\t\t\t\t\t\t{event.title}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t{event.timestamp ? (\n\t\t\t\t\t\t\t\t\t<span className=\"text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t{event.timestamp}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{event.description ? (\n\t\t\t\t\t\t\t\t<div className=\"text-sm text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{event.description}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t})}\n\t\t</ol>\n\t);\n}\nTimeline.displayName = \"Timeline\";\n\nexport { Timeline };\nexport type { TimelineEvent, TimelineProps, TimelineStatus };\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
/** Root container for a set of toggles (single-select or multi-select). */
|
|
7
|
+
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
8
|
+
variant?: "default" | "outline" | null | undefined;
|
|
9
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
/** A single toggle option within a ToggleGroup. Inherits variant/size from context. */
|
|
12
|
+
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
13
|
+
variant?: "default" | "outline" | null | undefined;
|
|
14
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
15
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
|
|
17
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
3
|
+
import * as React2 from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
var toggleVariants = cva(
|
|
14
|
+
[
|
|
15
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium",
|
|
16
|
+
"transition-all duration-[var(--duration-normal,200ms)] ease-out",
|
|
17
|
+
"hover:bg-muted hover:text-muted-foreground",
|
|
18
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
19
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
20
|
+
"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
21
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
|
|
22
|
+
].join(" "),
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: "bg-transparent",
|
|
27
|
+
outline: "border border-input bg-transparent shadow-sm inset-ring-1 inset-ring-foreground/[0.06] hover:bg-accent hover:text-accent-foreground"
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
default: "h-[var(--control-height-md,2.5rem)] px-[var(--space-3,0.75rem)] min-w-[var(--control-height-md,2.5rem)]",
|
|
31
|
+
sm: "h-[var(--control-height-sm,2.25rem)] px-2.5 min-w-[var(--control-height-sm,2.25rem)]",
|
|
32
|
+
lg: "h-[var(--control-height-lg,2.75rem)] px-5 min-w-[var(--control-height-lg,2.75rem)]"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var Toggle = React2.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
39
|
+
TogglePrimitive.Root,
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
|
+
Toggle.displayName = "Toggle";
|
|
47
|
+
var ToggleGroupContext = React2.createContext({
|
|
48
|
+
size: "default",
|
|
49
|
+
variant: "default"
|
|
50
|
+
});
|
|
51
|
+
var ToggleGroup = React2.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
52
|
+
ToggleGroupPrimitive.Root,
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
className: cn("flex items-center justify-center gap-1", className),
|
|
56
|
+
...props,
|
|
57
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
ToggleGroup.displayName = "ToggleGroup";
|
|
61
|
+
var ToggleGroupItem = React2.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
62
|
+
const context = React2.useContext(ToggleGroupContext);
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
ToggleGroupPrimitive.Item,
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
className: cn(
|
|
68
|
+
toggleVariants({
|
|
69
|
+
variant: variant ?? context.variant,
|
|
70
|
+
size: size ?? context.size
|
|
71
|
+
}),
|
|
72
|
+
className
|
|
73
|
+
),
|
|
74
|
+
...props,
|
|
75
|
+
children
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
80
|
+
|
|
81
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
82
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
83
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/primitives/toggle/toggle.tsx","../src/primitives/toggle-group/toggle-group.tsx"],"names":["React","jsx"],"mappings":";;;;;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACHA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACtB;AAAA,IACC,wEAAA;AAAA,IACA,iEAAA;AAAA,IACA,4CAAA;AAAA,IACA,qGAAA;AAAA,IACA,kDAAA;AAAA,IACA,kEAAA;AAAA,IACA;AAAA,GACD,CAAE,KAAK,GAAG,CAAA;AAAA,EACV;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,gBAAA;AAAA,QACT,OAAA,EACC;AAAA,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EAAS,yGAAA;AAAA,QACT,EAAA,EAAI,sFAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACL,KACD;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,SAAA,EAAW,MAAM,SAAA;AAAU;AAEzD,CAAA;AAMA,IAAM,MAAA,GAAeA,MAAA,CAAA,UAAA,CAGnB,CAAC,EAAE,SAAA,EAAW,SAAS,IAAA,EAAM,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1C,GAAA;AAAA,EAAiB,eAAA,CAAA,IAAA;AAAA,EAAhB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,IACzD,GAAG;AAAA;AACL,CACA,CAAA;AACD,MAAA,CAAO,WAAA,GAAc,QAAA;ACtCrB,IAAM,qBAA2B,MAAA,CAAA,aAAA,CAAuC;AAAA,EACvE,IAAA,EAAM,SAAA;AAAA,EACN,OAAA,EAAS;AACV,CAAC,CAAA;AAGD,IAAM,WAAA,GAAoB,MAAA,CAAA,UAAA,CAIxB,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,IAAA,EAAM,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,qBACpDC,GAAAA;AAAA,EAAsB,oBAAA,CAAA,IAAA;AAAA,EAArB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,IAChE,GAAG,KAAA;AAAA,IAEJ,QAAA,kBAAAA,GAAAA,CAAC,kBAAA,CAAmB,QAAA,EAAnB,EAA4B,OAAO,EAAE,OAAA,EAAS,IAAA,EAAK,EAAI,QAAA,EAAS;AAAA;AAClE,CACA;AACD,WAAA,CAAY,WAAA,GAAc,aAAA;AAG1B,IAAM,eAAA,GAAwB,MAAA,CAAA,UAAA,CAI5B,CAAC,EAAE,SAAA,EAAW,QAAA,EAAU,OAAA,EAAS,IAAA,EAAM,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC5D,EAAA,MAAM,OAAA,GAAgB,kBAAW,kBAAkB,CAAA;AACnD,EAAA,uBACCA,GAAAA;AAAA,IAAsB,oBAAA,CAAA,IAAA;AAAA,IAArB;AAAA,MACA,GAAA;AAAA,MACA,SAAA,EAAW,EAAA;AAAA,QACV,cAAA,CAAe;AAAA,UACd,OAAA,EAAS,WAAW,OAAA,CAAQ,OAAA;AAAA,UAC5B,IAAA,EAAM,QAAQ,OAAA,CAAQ;AAAA,SACtB,CAAA;AAAA,QACD;AAAA,OACD;AAAA,MACC,GAAG,KAAA;AAAA,MAEH;AAAA;AAAA,GACF;AAEF,CAAC;AACD,eAAA,CAAgB,WAAA,GAAc,iBAAA","file":"toggle-group.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\nconst toggleVariants = cva(\n\t[\n\t\t\"inline-flex items-center justify-center rounded-md text-sm font-medium\",\n\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\"hover:bg-muted hover:text-muted-foreground\",\n\t\t\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n\t\t\"disabled:pointer-events-none disabled:opacity-50\",\n\t\t\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n\t\t\"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t].join(\" \"),\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border border-input bg-transparent shadow-sm inset-ring-1 inset-ring-foreground/[0.06] hover:bg-accent hover:text-accent-foreground\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-[var(--control-height-md,2.5rem)] px-[var(--space-3,0.75rem)] min-w-[var(--control-height-md,2.5rem)]\",\n\t\t\t\tsm: \"h-[var(--control-height-sm,2.25rem)] px-2.5 min-w-[var(--control-height-sm,2.25rem)]\",\n\t\t\t\tlg: \"h-[var(--control-height-lg,2.75rem)] px-5 min-w-[var(--control-height-lg,2.75rem)]\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: { variant: \"default\", size: \"default\" },\n\t},\n);\n\n/**\n * A two-state button. Stays pressed when toggled on.\n * @returns A styled Radix Toggle root\n */\nconst Toggle = React.forwardRef<\n\tReact.ComponentRef<typeof TogglePrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n\t<TogglePrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(toggleVariants({ variant, size, className }))}\n\t\t{...props}\n\t/>\n));\nToggle.displayName = \"Toggle\";\n\nexport { Toggle, toggleVariants };\n","\"use client\";\n\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\nimport { toggleVariants } from \"../toggle/toggle.js\";\n\ntype ToggleGroupContextValue = VariantProps<typeof toggleVariants>;\n\nconst ToggleGroupContext = React.createContext<ToggleGroupContextValue>({\n\tsize: \"default\",\n\tvariant: \"default\",\n});\n\n/** Root container for a set of toggles (single-select or multi-select). */\nconst ToggleGroup = React.forwardRef<\n\tReact.ComponentRef<typeof ToggleGroupPrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n\t\tVariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n\t<ToggleGroupPrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(\"flex items-center justify-center gap-1\", className)}\n\t\t{...props}\n\t>\n\t\t<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n\t</ToggleGroupPrimitive.Root>\n));\nToggleGroup.displayName = \"ToggleGroup\";\n\n/** A single toggle option within a ToggleGroup. Inherits variant/size from context. */\nconst ToggleGroupItem = React.forwardRef<\n\tReact.ComponentRef<typeof ToggleGroupPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n\t\tVariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n\tconst context = React.useContext(ToggleGroupContext);\n\treturn (\n\t\t<ToggleGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\ttoggleVariants({\n\t\t\t\t\tvariant: variant ?? context.variant,\n\t\t\t\t\tsize: size ?? context.size,\n\t\t\t\t}),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</ToggleGroupPrimitive.Item>\n\t);\n});\nToggleGroupItem.displayName = \"ToggleGroupItem\";\n\nexport { ToggleGroup, ToggleGroupItem };\n"]}
|
package/dist/toggle.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
declare const toggleVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "outline" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
/**
|
|
11
|
+
* A two-state button. Stays pressed when toggled on.
|
|
12
|
+
* @returns A styled Radix Toggle root
|
|
13
|
+
*/
|
|
14
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
15
|
+
variant?: "default" | "outline" | null | undefined;
|
|
16
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
17
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
|
|
19
|
+
export { Toggle, toggleVariants };
|
package/dist/toggle.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var toggleVariants = cva(
|
|
13
|
+
[
|
|
14
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium",
|
|
15
|
+
"transition-all duration-[var(--duration-normal,200ms)] ease-out",
|
|
16
|
+
"hover:bg-muted hover:text-muted-foreground",
|
|
17
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
18
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
19
|
+
"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
20
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
|
|
21
|
+
].join(" "),
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: "bg-transparent",
|
|
26
|
+
outline: "border border-input bg-transparent shadow-sm inset-ring-1 inset-ring-foreground/[0.06] hover:bg-accent hover:text-accent-foreground"
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
default: "h-[var(--control-height-md,2.5rem)] px-[var(--space-3,0.75rem)] min-w-[var(--control-height-md,2.5rem)]",
|
|
30
|
+
sm: "h-[var(--control-height-sm,2.25rem)] px-2.5 min-w-[var(--control-height-sm,2.25rem)]",
|
|
31
|
+
lg: "h-[var(--control-height-lg,2.75rem)] px-5 min-w-[var(--control-height-lg,2.75rem)]"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
var Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
38
|
+
TogglePrimitive.Root,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
));
|
|
45
|
+
Toggle.displayName = "Toggle";
|
|
46
|
+
|
|
47
|
+
export { Toggle, toggleVariants };
|
|
48
|
+
//# sourceMappingURL=toggle.js.map
|
|
49
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/primitives/toggle/toggle.tsx"],"names":[],"mappings":";;;;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACHA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACtB;AAAA,IACC,wEAAA;AAAA,IACA,iEAAA;AAAA,IACA,4CAAA;AAAA,IACA,qGAAA;AAAA,IACA,kDAAA;AAAA,IACA,kEAAA;AAAA,IACA;AAAA,GACD,CAAE,KAAK,GAAG,CAAA;AAAA,EACV;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,gBAAA;AAAA,QACT,OAAA,EACC;AAAA,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EAAS,yGAAA;AAAA,QACT,EAAA,EAAI,sFAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACL,KACD;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,SAAA,EAAW,MAAM,SAAA;AAAU;AAEzD;AAMA,IAAM,MAAA,GAAe,KAAA,CAAA,UAAA,CAGnB,CAAC,EAAE,SAAA,EAAW,SAAS,IAAA,EAAM,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1C,GAAA;AAAA,EAAiB,eAAA,CAAA,IAAA;AAAA,EAAhB;AAAA,IACA,GAAA;AAAA,IACA,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,IACzD,GAAG;AAAA;AACL,CACA;AACD,MAAA,CAAO,WAAA,GAAc,QAAA","file":"toggle.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\nconst toggleVariants = cva(\n\t[\n\t\t\"inline-flex items-center justify-center rounded-md text-sm font-medium\",\n\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\"hover:bg-muted hover:text-muted-foreground\",\n\t\t\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n\t\t\"disabled:pointer-events-none disabled:opacity-50\",\n\t\t\"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n\t\t\"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t].join(\" \"),\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border border-input bg-transparent shadow-sm inset-ring-1 inset-ring-foreground/[0.06] hover:bg-accent hover:text-accent-foreground\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-[var(--control-height-md,2.5rem)] px-[var(--space-3,0.75rem)] min-w-[var(--control-height-md,2.5rem)]\",\n\t\t\t\tsm: \"h-[var(--control-height-sm,2.25rem)] px-2.5 min-w-[var(--control-height-sm,2.25rem)]\",\n\t\t\t\tlg: \"h-[var(--control-height-lg,2.75rem)] px-5 min-w-[var(--control-height-lg,2.75rem)]\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: { variant: \"default\", size: \"default\" },\n\t},\n);\n\n/**\n * A two-state button. Stays pressed when toggled on.\n * @returns A styled Radix Toggle root\n */\nconst Toggle = React.forwardRef<\n\tReact.ComponentRef<typeof TogglePrimitive.Root>,\n\tReact.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n\t<TogglePrimitive.Root\n\t\tref={ref}\n\t\tclassName={cn(toggleVariants({ variant, size, className }))}\n\t\t{...props}\n\t/>\n));\nToggle.displayName = \"Toggle\";\n\nexport { Toggle, toggleVariants };\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/** Provider required at the root of the app or tree where tooltips are used. */
|
|
5
|
+
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
6
|
+
/** Root container for a single tooltip. */
|
|
7
|
+
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
8
|
+
/** The element that shows the tooltip on hover/focus. */
|
|
9
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
/** The floating tooltip content (small, hover-reveal info). */
|
|
11
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
package/dist/tooltip.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
12
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
13
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
14
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
15
|
+
TooltipPrimitive.Content,
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
sideOffset,
|
|
19
|
+
className: cn(
|
|
20
|
+
"z-50 overflow-hidden rounded-md bg-primary px-[var(--space-3,0.75rem)] py-1.5 text-xs text-primary-foreground shadow-md",
|
|
21
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
22
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
23
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
) }));
|
|
29
|
+
TooltipContent.displayName = "TooltipContent";
|
|
30
|
+
|
|
31
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
32
|
+
//# sourceMappingURL=tooltip.js.map
|
|
33
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":";;;;;;AAQO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACHA,IAAM,eAAA,GAAmC,gBAAA,CAAA;AAGzC,IAAM,OAAA,GAA2B,gBAAA,CAAA;AAGjC,IAAM,cAAA,GAAkC,gBAAA,CAAA;AAGxC,IAAM,cAAA,GAAuB,KAAA,CAAA,UAAA,CAG3B,CAAC,EAAE,SAAA,EAAW,UAAA,GAAa,CAAA,EAAG,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC3C,GAAA,CAAkB,yBAAjB,EACA,QAAA,kBAAA,GAAA;AAAA,EAAkB,gBAAA,CAAA,OAAA;AAAA,EAAjB;AAAA,IACA,GAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACV,yHAAA;AAAA,MACA,iCAAA;AAAA,MACA,gGAAA;AAAA,MACA,6JAAA;AAAA,MACA;AAAA,KACD;AAAA,IACC,GAAG;AAAA;AACL,CAAA,EACD,CACA;AACD,cAAA,CAAe,WAAA,GAAc,gBAAA","file":"tooltip.js","sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\n\n/** Provider required at the root of the app or tree where tooltips are used. */\nconst TooltipProvider = TooltipPrimitive.Provider;\n\n/** Root container for a single tooltip. */\nconst Tooltip = TooltipPrimitive.Root;\n\n/** The element that shows the tooltip on hover/focus. */\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\n/** The floating tooltip content (small, hover-reveal info). */\nconst TooltipContent = React.forwardRef<\n\tReact.ComponentRef<typeof TooltipPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n\t<TooltipPrimitive.Portal>\n\t\t<TooltipPrimitive.Content\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn(\n\t\t\t\t\"z-50 overflow-hidden rounded-md bg-primary px-[var(--space-3,0.75rem)] py-1.5 text-xs text-primary-foreground shadow-md\",\n\t\t\t\t\"animate-in fade-in-0 zoom-in-95\",\n\t\t\t\t\"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n\t\t\t\t\"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t</TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = \"TooltipContent\";\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hex-core/components",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AI-native React components for Hex UI — Radix UI + Tailwind CSS with machine-readable schemas.",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "AI-native React components for Hex UI — Radix UI + Tailwind CSS with machine-readable schemas. RSC-aware per-component bundles + tree-shakable.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"components",
|
|
@@ -26,12 +26,21 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"main": "dist/index.js",
|
|
28
28
|
"types": "dist/index.d.ts",
|
|
29
|
+
"sideEffects": false,
|
|
29
30
|
"exports": {
|
|
30
31
|
".": {
|
|
31
|
-
"
|
|
32
|
-
"
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
33
34
|
},
|
|
34
|
-
"./
|
|
35
|
+
"./schemas": {
|
|
36
|
+
"types": "./dist/schemas.d.ts",
|
|
37
|
+
"import": "./dist/schemas.js"
|
|
38
|
+
},
|
|
39
|
+
"./tailwind.css": "./tailwind.css",
|
|
40
|
+
"./*": {
|
|
41
|
+
"types": "./dist/*.d.ts",
|
|
42
|
+
"import": "./dist/*.js"
|
|
43
|
+
}
|
|
35
44
|
},
|
|
36
45
|
"files": [
|
|
37
46
|
"dist",
|
|
@@ -71,32 +80,75 @@
|
|
|
71
80
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
72
81
|
"class-variance-authority": "^0.7.0",
|
|
73
82
|
"clsx": "^2.1.0",
|
|
83
|
+
"tailwind-merge": "^3.5.0"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@tanstack/react-table": "^8.21.3",
|
|
87
|
+
"@types/react": "^19.0.0",
|
|
88
|
+
"@types/react-dom": "^19.0.0",
|
|
74
89
|
"cmdk": "^1.1.1",
|
|
75
90
|
"date-fns": "^4.1.0",
|
|
91
|
+
"fast-glob": "^3.3.3",
|
|
76
92
|
"input-otp": "^1.4.2",
|
|
77
93
|
"react-day-picker": "^9.14.0",
|
|
94
|
+
"react-hook-form": "^7.74.0",
|
|
78
95
|
"react-resizable-panels": "^4.10.0",
|
|
79
96
|
"sonner": "^2.0.7",
|
|
80
|
-
"tailwind-merge": "^3.5.0",
|
|
81
|
-
"vaul": "^1.1.2",
|
|
82
|
-
"@hex-core/registry": "^0.3.0"
|
|
83
|
-
},
|
|
84
|
-
"devDependencies": {
|
|
85
|
-
"@tanstack/react-table": "^8.21.3",
|
|
86
|
-
"@types/react": "^19.0.0",
|
|
87
|
-
"@types/react-dom": "^19.0.0",
|
|
88
97
|
"tsup": "^8.3.0",
|
|
89
|
-
"typescript": "^6.0.3"
|
|
98
|
+
"typescript": "^6.0.3",
|
|
99
|
+
"vaul": "^1.1.2",
|
|
100
|
+
"@hex-core/registry": "^0.3.1"
|
|
90
101
|
},
|
|
91
102
|
"peerDependencies": {
|
|
103
|
+
"@hex-core/registry": "*",
|
|
92
104
|
"@tanstack/react-table": "^8.0.0 || ^9.0.0",
|
|
105
|
+
"cmdk": "^1.0.0",
|
|
106
|
+
"date-fns": "^3.0.0 || ^4.0.0",
|
|
107
|
+
"input-otp": "^1.0.0",
|
|
93
108
|
"react": "^18.0.0 || ^19.0.0",
|
|
109
|
+
"react-day-picker": "^8.0.0 || ^9.0.0",
|
|
94
110
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
95
|
-
"react-hook-form": "^7.0.0"
|
|
111
|
+
"react-hook-form": "^7.0.0",
|
|
112
|
+
"react-resizable-panels": "^2.0.0 || ^3.0.0 || ^4.0.0",
|
|
113
|
+
"sonner": "^1.0.0 || ^2.0.0",
|
|
114
|
+
"vaul": "^1.0.0"
|
|
115
|
+
},
|
|
116
|
+
"peerDependenciesMeta": {
|
|
117
|
+
"@hex-core/registry": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@tanstack/react-table": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"cmdk": {
|
|
124
|
+
"optional": true
|
|
125
|
+
},
|
|
126
|
+
"date-fns": {
|
|
127
|
+
"optional": true
|
|
128
|
+
},
|
|
129
|
+
"input-otp": {
|
|
130
|
+
"optional": true
|
|
131
|
+
},
|
|
132
|
+
"react-day-picker": {
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
135
|
+
"react-hook-form": {
|
|
136
|
+
"optional": true
|
|
137
|
+
},
|
|
138
|
+
"react-resizable-panels": {
|
|
139
|
+
"optional": true
|
|
140
|
+
},
|
|
141
|
+
"sonner": {
|
|
142
|
+
"optional": true
|
|
143
|
+
},
|
|
144
|
+
"vaul": {
|
|
145
|
+
"optional": true
|
|
146
|
+
}
|
|
96
147
|
},
|
|
97
148
|
"scripts": {
|
|
98
|
-
"build": "tsup",
|
|
149
|
+
"build": "tsup && node scripts/inject-use-client.mjs",
|
|
99
150
|
"clean": "rm -rf dist",
|
|
151
|
+
"audit:use-client": "node scripts/audit-use-client.mjs",
|
|
100
152
|
"test": "vitest run"
|
|
101
153
|
}
|
|
102
154
|
}
|