@codefast/ui 0.12.0 → 0.14.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/CHANGELOG.md +68 -0
- package/README.md +3 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/bubble.js +1 -1
- package/dist/components/button-group.d.ts +2 -1
- package/dist/components/button.d.ts +2 -3
- package/dist/components/calendar.d.ts +4 -2
- package/dist/components/calendar.js +2 -2
- package/dist/components/card.d.ts +2 -2
- package/dist/components/chart.d.ts +5 -4
- package/dist/components/checkbox-cards.js +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/direction.d.ts +2 -2
- package/dist/components/empty.d.ts +2 -1
- package/dist/components/field.d.ts +6 -5
- package/dist/components/input-group.d.ts +4 -2
- package/dist/components/input-group.js +2 -2
- package/dist/components/input-number.js +6 -6
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +4 -3
- package/dist/components/message-scroller.d.ts +3 -2
- package/dist/components/native-select.d.ts +2 -2
- package/dist/components/native-select.js +1 -1
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/radio-cards.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.js +1 -1
- package/dist/components/scroll-area.d.ts +2 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.js +4 -4
- package/dist/components/slider.js +1 -1
- package/dist/components/sonner.d.ts +2 -0
- package/dist/components/sonner.js +5 -3
- package/dist/components/spinner.js +1 -1
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs.d.ts +2 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/message-scroller/geometry.d.ts +1 -8
- package/dist/lib/message-scroller/geometry.js +1 -1
- package/dist/lib/message-scroller/stores.d.ts +2 -6
- package/dist/lib/message-scroller/stores.js +1 -1
- package/dist/lib/message-scroller/types.d.ts +9 -15
- package/dist/lib/message-scroller/types.js +1 -1
- package/dist/primitives/checkbox-group.d.ts +4 -1
- package/dist/primitives/input-number.d.ts +2 -0
- package/dist/primitives/input.d.ts +4 -1
- package/dist/primitives/message-scroller.d.ts +2 -1
- package/dist/variants/attachment.js +1 -1
- package/dist/variants/badge.js +3 -3
- package/dist/variants/bubble.js +1 -1
- package/dist/variants/button.js +3 -3
- package/dist/variants/input-group.js +1 -1
- package/dist/variants/item.js +1 -1
- package/dist/variants/navigation-menu.js +1 -1
- package/dist/variants/sidebar.js +1 -1
- package/dist/variants/toggle.js +1 -1
- package/package.json +8 -20
- package/src/css/foundation/base.css +10 -3
- package/src/css/foundation/motion.css +17 -0
- package/src/css/foundation/tokens.css +2 -0
- package/src/css/foundation/utilities.css +0 -8
- package/src/css/preset.css +1 -1
- package/src/css/themes/amber.css +9 -9
- package/src/css/themes/blue.css +8 -8
- package/src/css/themes/cyan.css +9 -9
- package/src/css/themes/emerald.css +9 -9
- package/src/css/themes/fuchsia.css +11 -11
- package/src/css/themes/gray.css +5 -5
- package/src/css/themes/green.css +9 -9
- package/src/css/themes/indigo.css +9 -9
- package/src/css/themes/lime.css +9 -9
- package/src/css/themes/neutral.css +4 -4
- package/src/css/themes/orange.css +9 -9
- package/src/css/themes/pink.css +11 -11
- package/src/css/themes/purple.css +9 -9
- package/src/css/themes/red.css +11 -11
- package/src/css/themes/rose.css +11 -11
- package/src/css/themes/sky.css +9 -9
- package/src/css/themes/slate.css +5 -5
- package/src/css/themes/stone.css +3 -3
- package/src/css/themes/teal.css +9 -9
- package/src/css/themes/violet.css +9 -9
- package/src/css/themes/yellow.css +9 -9
- package/src/css/themes/zinc.css +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# @codefast/ui
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1068](https://github.com/codefastlabs/codefast/pull/1068) Lower the Node.js floor from 24 to the lowest release the package, its dependencies and its full test suite run on:
|
|
8
|
+
22.12 for `@codefast/cli` and `@codefast/tailwind-variants`, 22.18 for `@codefast/di` and `@codefast/di-testing`, and
|
|
9
|
+
22.22.2 for `@codefast/theme`, `@codefast/tracking` and `@codefast/ui`. Each floor is type-checked against what Node 22
|
|
10
|
+
ships and proven by running the package's tests on that release in CI.
|
|
11
|
+
|
|
12
|
+
- [#1125](https://github.com/codefastlabs/codefast/pull/1125) **Breaking:** `Toaster` takes its color scheme from `@codefast/theme` instead of `next-themes`, so toasts follow the
|
|
13
|
+
user's appearance like every other component rather than falling back to `"system"` in an app with no `next-themes`
|
|
14
|
+
provider. `@codefast/theme` 0.10 or later — the version this release ships — is now a peer dependency, `next-themes` is
|
|
15
|
+
no longer a dependency, and `Toaster` must render inside an `AppearanceProvider` — outside one it throws, as
|
|
16
|
+
`useAppearance` does.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#1060](https://github.com/codefastlabs/codefast/pull/1060) Every focusable element now draws the same solid 2px `ring` outline, offset 2px, as `Button`. An element with no focus
|
|
21
|
+
style of its own (a plain link, `<summary>`, a custom `tabIndex` element) gets it from the base layer instead of the
|
|
22
|
+
browser's two-tone `auto` outline, and a component's own `outline-*` utilities still override it. The sidebar parts
|
|
23
|
+
(`SidebarMenuButton`, `SidebarMenuSubButton`, `SidebarMenuAction`, `SidebarGroupLabel`, `SidebarGroupAction`) and
|
|
24
|
+
`ResizableSeparator` draw focus as that outline instead of a box-shadow ring, so it also shows in forced-colors mode.
|
|
25
|
+
|
|
26
|
+
- [#1124](https://github.com/codefastlabs/codefast/pull/1124) Secondary text now meets WCAG 2.2 AA contrast in every palette. In the light scheme `muted-foreground` moves from the
|
|
27
|
+
500 step of the palette's neutral to its 600 step (`zinc-600`, or `gray-600`, `neutral-600`, `slate-600`, `stone-600`),
|
|
28
|
+
so descriptions, placeholders, table captions and `Kbd` clear 4.5:1 on `muted` as well as on `background`, `card` and
|
|
29
|
+
`popover`; the 500 step measured 4.3–4.5:1 on `muted`. The dark scheme already cleared it and is unchanged.
|
|
30
|
+
`tests/unit/css/themes.test.ts` now checks `muted-foreground` on all four surfaces in every palette and both schemes.
|
|
31
|
+
|
|
32
|
+
- [#1071](https://github.com/codefastlabs/codefast/pull/1071) Component props that add their own members or join a variants type are declared as interfaces instead of `&`
|
|
33
|
+
intersections — `ButtonProps`, `CardProps`, `FieldProps`, `ScrollAreaProps` and the other 24 — so a prop that clashes
|
|
34
|
+
with the element's own now fails where it is declared rather than narrowing to `never`. Each accepts exactly the props
|
|
35
|
+
it did, with one exception: `ChartLegendContentProps` takes Recharts' legend-content type for every member the two
|
|
36
|
+
share, where the intersection demanded a value that satisfied both a `div` handler and a Recharts one, so it now accepts
|
|
37
|
+
more. `CalendarProps`, `ToggleGroupProps` and the internal `ScopedProps` helpers stay intersections, because their base
|
|
38
|
+
is a union or a type parameter.
|
|
39
|
+
|
|
40
|
+
- [#1090](https://github.com/codefastlabs/codefast/pull/1090) The preset now honours `prefers-reduced-motion` with one global rule: under `reduce`, every animation and transition,
|
|
41
|
+
including those on `::before` and `::after`, runs for a near-zero duration and plays once. Closed dialogs, popovers,
|
|
42
|
+
sheets and menus still unmount, because `animationend` and `transitionend` keep firing. The rule sits outside every
|
|
43
|
+
cascade layer, so it beats every utility, and a layered `!important` such as `motion-reduce:duration-200!` still opts
|
|
44
|
+
essential motion back in. This restores the reduced-motion coverage that most components had lost, and the per-component
|
|
45
|
+
`motion-reduce:` guards on `Spinner` and `InputNumber` and the `shimmer` utility's own reduced-motion block are gone,
|
|
46
|
+
since the global rule covers them.
|
|
47
|
+
- Updated dependencies:
|
|
48
|
+
- @codefast/tailwind-variants@0.10.0
|
|
49
|
+
- @codefast/theme@0.10.0
|
|
50
|
+
|
|
51
|
+
## 0.13.0
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- [#1054](https://github.com/codefastlabs/codefast/pull/1054) The `@codefast/ui/lib/message-scroller/geometry`, `stores` and `types` subpaths are no longer published: they are the
|
|
56
|
+
message-scroller primitive's internals. Its public types now ship from `@codefast/ui/primitives/message-scroller`, and
|
|
57
|
+
`MessageScrollerButtonRenderState` and `MessageScrollerButtonDirection` — the button's `render` state and `direction` —
|
|
58
|
+
are also exported from `@codefast/ui/message-scroller` and the root entry, so every type in the scroller's public
|
|
59
|
+
signatures stays nameable.
|
|
60
|
+
|
|
61
|
+
- [#1056](https://github.com/codefastlabs/codefast/pull/1056) Every palette now meets WCAG 2.2 AA contrast in both color schemes. `primary` moves to the step whose label and
|
|
62
|
+
`text-primary` links clear 4.5:1; `primary-foreground` turns dark on the bright dark-scheme `primary`; `ring` moves to a
|
|
63
|
+
step that clears 3:1 against every surface, and the sidebar tokens follow. Focus is drawn as a solid 2px `ring` outline
|
|
64
|
+
offset 2px
|
|
65
|
+
(`focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring`)
|
|
66
|
+
instead of a `ring` border with a 50% halo, so it keeps its contrast and survives forced-colors mode; the destructive
|
|
67
|
+
Button and Badge draw it in `destructive`. The base `outline-color` every element inherits is `ring` at full strength.
|
|
68
|
+
The default Button, Badge link and Bubble hover with the new `bg-primary-hover`, which pulls `primary` toward
|
|
69
|
+
`foreground` instead of fading it, so the label gains contrast on hover.
|
|
70
|
+
|
|
3
71
|
## 0.12.0
|
|
4
72
|
|
|
5
73
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -33,12 +33,14 @@ Or the equivalent with your package manager: `npm install @codefast/ui`, `yarn a
|
|
|
33
33
|
|
|
34
34
|
`@codefast/ui` requires:
|
|
35
35
|
|
|
36
|
-
- Node.js
|
|
36
|
+
- Node.js 22.22.2 or later.
|
|
37
37
|
- TypeScript 7 or later for its types.
|
|
38
38
|
- Chrome and Edge 136, Firefox 136, or Safari 18.4 or later in the browser
|
|
39
39
|
([support policy](../../SUPPORT.md#browsers)).
|
|
40
40
|
- React 19 — `react` and `react-dom` (19 or later) are peer dependencies; `@types/react` and `@types/react-dom` are
|
|
41
41
|
optional peers.
|
|
42
|
+
- `@codefast/theme` 0.9 or later — a peer dependency, because `Toaster` takes its color scheme from the enclosing
|
|
43
|
+
`AppearanceProvider`.
|
|
42
44
|
- Tailwind CSS 4 at build time — the stylesheets are Tailwind source, and rely on your Tailwind pipeline to compile
|
|
43
45
|
them.
|
|
44
46
|
|
|
@@ -18,7 +18,7 @@ function AccordionItem({ className, ...props }) {
|
|
|
18
18
|
* @since 0.3.16-canary.0
|
|
19
19
|
*/
|
|
20
20
|
function AccordionTrigger({ children, className, ...props }) {
|
|
21
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { className: cn("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-start text-sm font-medium transition-all outline-none hover:underline focus-visible:
|
|
21
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { className: cn("group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-start text-sm font-medium transition-all outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ms-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground", className), "data-slot": "accordion-trigger", ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden", "data-slot": "accordion-trigger-icon" }), _jsx(ChevronUpIcon, { className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline", "data-slot": "accordion-trigger-icon" })] }) }));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* @since 0.3.16-canary.0
|
|
@@ -3,9 +3,9 @@ import type { ComponentProps, JSX } from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface AvatarProps extends ComponentProps<typeof AvatarPrimitive.Root> {
|
|
7
7
|
size?: "default" | "sm" | "lg";
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
/**
|
|
10
10
|
* @since 0.3.16-canary.0
|
|
11
11
|
*/
|
|
@@ -19,7 +19,7 @@ function Bubble({ align = "start", className, variant = "default", ...props }) {
|
|
|
19
19
|
*/
|
|
20
20
|
function BubbleContent({ asChild = false, className, ...props }) {
|
|
21
21
|
const Component = asChild ? Slot.Root : "div";
|
|
22
|
-
return (_jsx(Component, { className: cn("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-start [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:
|
|
22
|
+
return (_jsx(Component, { className: cn("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-start [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:outline-2 [button,a]:focus-visible:outline-offset-2 [button,a]:focus-visible:outline-ring [button,a]:focus-visible:outline-solid", className), "data-slot": "bubble-content", ...props }));
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* @since 0.5.0-canary.3
|
|
@@ -4,7 +4,8 @@ import type { ButtonGroupVariants } from "#variants/button-group";
|
|
|
4
4
|
/**
|
|
5
5
|
* @since 0.3.16-canary.0
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
interface ButtonGroupProps extends ComponentProps<"div">, ButtonGroupVariants {
|
|
8
|
+
}
|
|
8
9
|
/**
|
|
9
10
|
* @since 0.3.16-canary.0
|
|
10
11
|
*/
|
|
@@ -3,10 +3,9 @@ import type { ButtonVariants } from "#variants/button";
|
|
|
3
3
|
/**
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface ButtonProps extends ComponentProps<"button">, ButtonVariants {
|
|
7
7
|
asChild?: boolean;
|
|
8
|
-
|
|
9
|
-
};
|
|
8
|
+
}
|
|
10
9
|
/**
|
|
11
10
|
* @since 0.3.16-canary.0
|
|
12
11
|
*/
|
|
@@ -3,6 +3,8 @@ import { DayPicker } from "@daypicker/react";
|
|
|
3
3
|
import type { ComponentProps, JSX } from "react";
|
|
4
4
|
import { Button } from "#components/button";
|
|
5
5
|
/**
|
|
6
|
+
* @remarks A type alias, since DayPicker's props are a union over `mode` that only `&` distributes into.
|
|
7
|
+
*
|
|
6
8
|
* @since 0.3.16-canary.0
|
|
7
9
|
*/
|
|
8
10
|
type CalendarProps = ComponentProps<typeof DayPicker> & {
|
|
@@ -15,9 +17,9 @@ declare function Calendar({ buttonVariant, captionLayout, className, classNames,
|
|
|
15
17
|
/**
|
|
16
18
|
* @since 0.3.16-canary.0
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
interface CalendarDayButtonProps extends ComponentProps<typeof DayButton> {
|
|
19
21
|
locale?: Partial<Locale> | undefined;
|
|
20
|
-
}
|
|
22
|
+
}
|
|
21
23
|
/**
|
|
22
24
|
* @since 0.3.16-canary.0
|
|
23
25
|
*/
|
|
@@ -19,7 +19,7 @@ function Calendar({ buttonVariant = "ghost", captionLayout = "label", className,
|
|
|
19
19
|
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
20
20
|
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
21
21
|
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
22
|
-
dropdown_root: cn("relative rounded-(--cell-radius) border border-transparent has-focus:
|
|
22
|
+
dropdown_root: cn("relative rounded-(--cell-radius) border border-transparent has-focus:outline-2 has-focus:outline-offset-2 has-focus:outline-ring has-focus:outline-solid", defaultClassNames.dropdown_root),
|
|
23
23
|
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
24
|
caption_label: cn("font-medium select-none", captionLayout === "label"
|
|
25
25
|
? "text-sm"
|
|
@@ -81,7 +81,7 @@ function CalendarDayButton({ className, day, locale, modifiers, ...props }) {
|
|
|
81
81
|
ref.current?.focus();
|
|
82
82
|
}
|
|
83
83
|
}, [modifiers.focused]);
|
|
84
|
-
return (_jsx(Button, { ref: ref, className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-focused/day:relative group-data-focused/day:z-10 group-data-focused/day:
|
|
84
|
+
return (_jsx(Button, { ref: ref, className: cn("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-focused/day:relative group-data-focused/day:z-10 group-data-focused/day:outline-2 group-data-focused/day:outline-offset-2 group-data-focused/day:outline-ring group-data-focused/day:outline-solid data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-e-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-s-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className), "data-day": day.date.toLocaleDateString(locale?.code), "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, "data-range-start": modifiers.range_start, "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle, size: "icon", variant: "ghost", ...props }));
|
|
85
85
|
}
|
|
86
86
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
87
87
|
export { Calendar, CalendarDayButton };
|
|
@@ -2,9 +2,9 @@ import type { ComponentProps, JSX } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* @since 0.3.16-canary.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
interface CardProps extends ComponentProps<"div"> {
|
|
6
6
|
size?: "default" | "sm";
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
/**
|
|
9
9
|
* @since 0.3.16-canary.0
|
|
10
10
|
*/
|
|
@@ -5,6 +5,7 @@ import * as RechartsPrimitive from "recharts";
|
|
|
5
5
|
import type { NameType, Payload, ValueType } from "recharts/types/component/DefaultTooltipContent";
|
|
6
6
|
type ExtractProps<T> = T extends (props: infer P) => ReactNode ? P : never;
|
|
7
7
|
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
|
+
type LegendContentProps = ExtractProps<RechartsPrimitive.LegendProps["content"]>;
|
|
8
9
|
declare const THEMES: {
|
|
9
10
|
readonly dark: ".dark";
|
|
10
11
|
readonly light: "";
|
|
@@ -63,7 +64,7 @@ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
|
63
64
|
/**
|
|
64
65
|
* @since 0.3.16-canary.0
|
|
65
66
|
*/
|
|
66
|
-
|
|
67
|
+
interface ChartTooltipContentProps<TValue extends ValueType, TName extends NameType> extends Omit<MakeOptional<TooltipContentProps<TValue, TName>, "accessibilityLayer" | "active" | "activeIndex" | "coordinate" | "payload">, "payload"> {
|
|
67
68
|
hideIndicator?: boolean;
|
|
68
69
|
hideLabel?: boolean;
|
|
69
70
|
indicator?: "dashed" | "dot" | "line";
|
|
@@ -72,7 +73,7 @@ type ChartTooltipContentProps<TValue extends ValueType, TName extends NameType>
|
|
|
72
73
|
color?: string | undefined;
|
|
73
74
|
className?: string | undefined;
|
|
74
75
|
payload?: Array<Payload<TValue, TName>>;
|
|
75
|
-
}
|
|
76
|
+
}
|
|
76
77
|
/**
|
|
77
78
|
* @since 0.3.16-canary.0
|
|
78
79
|
*/
|
|
@@ -88,10 +89,10 @@ declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
|
88
89
|
/**
|
|
89
90
|
* @since 0.3.16-canary.0
|
|
90
91
|
*/
|
|
91
|
-
|
|
92
|
+
interface ChartLegendContentProps extends Omit<ComponentProps<"div">, keyof LegendContentProps>, LegendContentProps {
|
|
92
93
|
hideIcon?: boolean;
|
|
93
94
|
nameKey?: string;
|
|
94
|
-
}
|
|
95
|
+
}
|
|
95
96
|
/**
|
|
96
97
|
* @since 0.3.16-canary.0
|
|
97
98
|
*/
|
|
@@ -13,7 +13,7 @@ function CheckboxCards(props) {
|
|
|
13
13
|
* @since 0.3.16-canary.0
|
|
14
14
|
*/
|
|
15
15
|
function CheckboxCardsItem({ checkboxClassName, children, className, ...props }) {
|
|
16
|
-
return (_jsxs(Label, { className: cn("flex items-start gap-2.5 rounded-lg border border-input p-2.5 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-data-indeterminate:border-primary/30 has-data-indeterminate:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 dark:has-data-indeterminate:border-primary/20 dark:has-data-indeterminate:bg-primary/10", className), "data-slot": "checkbox-card", children: [_jsx(CheckboxGroupPrimitive.Item, { className: cn("peer relative mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
16
|
+
return (_jsxs(Label, { className: cn("flex items-start gap-2.5 rounded-lg border border-input p-2.5 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-data-indeterminate:border-primary/30 has-data-indeterminate:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 dark:has-data-indeterminate:border-primary/20 dark:has-data-indeterminate:bg-primary/10", className), "data-slot": "checkbox-card", children: [_jsx(CheckboxGroupPrimitive.Item, { className: cn("peer relative mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary", checkboxClassName), "data-slot": "checkbox-card-item", ...props, children: _jsxs(CheckboxGroupPrimitive.CheckboxGroupIndicator, { className: "group/checkbox-card-indicator grid animate-in place-content-center text-current duration-control-indicator ease-spring zoom-in-50 [&>svg]:size-3.5", "data-slot": "checkbox-card-indicator", children: [_jsx(CheckIcon, { className: "group-data-indeterminate/checkbox-card-indicator:hidden" }), _jsx(MinusIcon, { className: "hidden group-data-indeterminate/checkbox-card-indicator:block" })] }) }), children] }));
|
|
17
17
|
}
|
|
18
18
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
19
19
|
export { CheckboxCards, CheckboxCardsItem };
|
|
@@ -12,7 +12,7 @@ function CheckboxGroup({ className, ...props }) {
|
|
|
12
12
|
* @since 0.3.16-canary.0
|
|
13
13
|
*/
|
|
14
14
|
function CheckboxGroupItem({ className, ...props }) {
|
|
15
|
-
return (_jsx(CheckboxGroupPrimitive.Item, { className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
15
|
+
return (_jsx(CheckboxGroupPrimitive.Item, { className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary", className), "data-slot": "checkbox-group-item", ...props, children: _jsxs(CheckboxGroupPrimitive.CheckboxGroupIndicator, { className: "group/checkbox-group-indicator grid animate-in place-content-center text-current duration-control-indicator ease-spring zoom-in-50 [&>svg]:size-3.5", "data-slot": "checkbox-group-indicator", children: [_jsx(CheckIcon, { className: "group-data-indeterminate/checkbox-group-indicator:hidden" }), _jsx(MinusIcon, { className: "hidden group-data-indeterminate/checkbox-group-indicator:block" })] }) }));
|
|
16
16
|
}
|
|
17
17
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
18
18
|
export { CheckboxGroup, CheckboxGroupItem };
|
|
@@ -6,7 +6,7 @@ import { cn } from "#lib/utils";
|
|
|
6
6
|
* @since 0.3.16-canary.0
|
|
7
7
|
*/
|
|
8
8
|
function Checkbox({ className, ...props }) {
|
|
9
|
-
return (_jsx(CheckboxPrimitive.Root, { className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
9
|
+
return (_jsx(CheckboxPrimitive.Root, { className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input shadow-xs transition-shadow duration-control ease-snappy outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:data-indeterminate:bg-primary", className), "data-slot": "checkbox", ...props, children: _jsxs(CheckboxPrimitive.Indicator, { className: "group/checkbox-indicator grid animate-in place-content-center text-current duration-control-indicator ease-spring zoom-in-50 [&>svg]:size-3.5", "data-slot": "checkbox-indicator", children: [_jsx(CheckIcon, { className: "group-data-indeterminate/checkbox-indicator:hidden" }), _jsx(MinusIcon, { className: "hidden group-data-indeterminate/checkbox-indicator:block" })] }) }));
|
|
10
10
|
}
|
|
11
11
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
12
12
|
export { Checkbox };
|
|
@@ -3,9 +3,9 @@ import type { ComponentProps } from "react";
|
|
|
3
3
|
/**
|
|
4
4
|
* @since 0.4.0-canary.4
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
interface DirectionProviderProps extends ComponentProps<typeof Direction.DirectionProvider> {
|
|
7
7
|
direction?: ComponentProps<typeof Direction.DirectionProvider>["dir"];
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
/**
|
|
10
10
|
* @since 0.4.0-canary.4
|
|
11
11
|
*/
|
|
@@ -19,7 +19,8 @@ declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): JSX.Ele
|
|
|
19
19
|
/**
|
|
20
20
|
* @since 0.3.16-canary.0
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
interface EmptyMediaProps extends ComponentProps<"div">, EmptyMediaVariants {
|
|
23
|
+
}
|
|
23
24
|
/**
|
|
24
25
|
* @since 0.3.16-canary.0
|
|
25
26
|
*/
|
|
@@ -12,9 +12,9 @@ declare function FieldSet({ className, ...props }: FieldSetProps): JSX.Element;
|
|
|
12
12
|
/**
|
|
13
13
|
* @since 0.3.16-canary.0
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
interface FieldLegendProps extends ComponentProps<"legend"> {
|
|
16
16
|
variant?: "label" | "legend";
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
/**
|
|
19
19
|
* @since 0.3.16-canary.0
|
|
20
20
|
*/
|
|
@@ -30,7 +30,8 @@ declare function FieldGroup({ className, ...props }: FieldGroupProps): JSX.Eleme
|
|
|
30
30
|
/**
|
|
31
31
|
* @since 0.3.16-canary.0
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
interface FieldProps extends ComponentProps<"div">, FieldVariants {
|
|
34
|
+
}
|
|
34
35
|
/**
|
|
35
36
|
* @since 0.3.16-canary.0
|
|
36
37
|
*/
|
|
@@ -70,9 +71,9 @@ declare function FieldDescription({ className, ...props }: FieldDescriptionProps
|
|
|
70
71
|
/**
|
|
71
72
|
* @since 0.3.16-canary.0
|
|
72
73
|
*/
|
|
73
|
-
|
|
74
|
+
interface FieldSeparatorProps extends ComponentProps<"div"> {
|
|
74
75
|
children?: ComponentProps<"span">["children"];
|
|
75
|
-
}
|
|
76
|
+
}
|
|
76
77
|
/**
|
|
77
78
|
* @since 0.3.16-canary.0
|
|
78
79
|
*/
|
|
@@ -14,7 +14,8 @@ declare function InputGroup({ className, ...props }: InputGroupProps): JSX.Eleme
|
|
|
14
14
|
/**
|
|
15
15
|
* @since 0.3.16-canary.0
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
interface InputGroupAddonProps extends ComponentProps<"div">, InputGroupAddonVariants {
|
|
18
|
+
}
|
|
18
19
|
/**
|
|
19
20
|
* @since 0.3.16-canary.0
|
|
20
21
|
*/
|
|
@@ -22,7 +23,8 @@ declare function InputGroupAddon({ align, className, ...props }: InputGroupAddon
|
|
|
22
23
|
/**
|
|
23
24
|
* @since 0.3.16-canary.0
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
|
+
interface InputGroupButtonProps extends Omit<ButtonProps, "size">, InputGroupButtonVariants {
|
|
27
|
+
}
|
|
26
28
|
/**
|
|
27
29
|
* @since 0.3.16-canary.0
|
|
28
30
|
*/
|
|
@@ -41,13 +41,13 @@ function InputGroupText({ className, ...props }) {
|
|
|
41
41
|
* @since 0.3.16-canary.0
|
|
42
42
|
*/
|
|
43
43
|
function InputGroupInput({ className, ...props }) {
|
|
44
|
-
return (_jsx(Input, { className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:
|
|
44
|
+
return (_jsx(Input, { className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:outline-none disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), "data-slot": "input-group-control", ...props }));
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* @since 0.3.16-canary.0
|
|
48
48
|
*/
|
|
49
49
|
function InputGroupTextarea({ className, ...props }) {
|
|
50
|
-
return (_jsx(Textarea, { className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:
|
|
50
|
+
return (_jsx(Textarea, { className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:outline-none disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent", className), "data-slot": "input-group-control", ...props }));
|
|
51
51
|
}
|
|
52
52
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
53
53
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -12,7 +12,7 @@ import { buttonVariants } from "#variants/button";
|
|
|
12
12
|
* @since 0.3.16-canary.0
|
|
13
13
|
*/
|
|
14
14
|
function InputNumber({ className, decrementLabel = "Decrement", incrementLabel = "Increment", spinner, ...props }) {
|
|
15
|
-
return (_jsx(InputNumberPrimitive.Root, { className: cn("group/input-number relative flex h-8 w-full min-w-0 items-center overflow-hidden rounded-lg bg-transparent text-base inset-ring inset-ring-input transition-[color,box-shadow] not-has-[input:disabled]:shadow-xs has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-aria-invalid:inset-ring-destructive has-[input:disabled]:bg-input/50 has-[input:disabled]:opacity-50 has-[input:focus-visible]:
|
|
15
|
+
return (_jsx(InputNumberPrimitive.Root, { className: cn("group/input-number relative flex h-8 w-full min-w-0 items-center overflow-hidden rounded-lg bg-transparent text-base inset-ring inset-ring-input transition-[color,box-shadow] not-has-[input:disabled]:shadow-xs has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-aria-invalid:inset-ring-destructive has-[input:disabled]:bg-input/50 has-[input:disabled]:opacity-50 has-[input:focus-visible]:outline-2 has-[input:focus-visible]:outline-offset-2 has-[input:focus-visible]:outline-ring has-[input:focus-visible]:outline-solid md:text-sm dark:bg-input/30 dark:has-aria-invalid:ring-destructive/40 dark:has-aria-invalid:inset-ring-destructive/50 dark:has-[input:disabled]:bg-input/80 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "input-number", decrementLabel: decrementLabel, incrementLabel: incrementLabel, spinner: spinner ?? _jsx(Spinner, {}), ...props }));
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* The editable numeric input.
|
|
@@ -29,11 +29,11 @@ function InputNumberField({ className, ...props }) {
|
|
|
29
29
|
* @since 0.5.0-canary.6
|
|
30
30
|
*/
|
|
31
31
|
function InputNumberStepper({ className, ...props }) {
|
|
32
|
-
return (_jsxs("div", { className: cn("grid h-full w-8 shrink-0 grid-rows-2 divide-y divide-input border-s border-s-input transition-colors group-has-aria-invalid/input-number:divide-destructive group-has-aria-invalid/input-number:border-s-destructive
|
|
33
|
-
className: "h-full min-w-0 rounded-none px-0 text-muted-foreground",
|
|
32
|
+
return (_jsxs("div", { className: cn("grid h-full w-8 shrink-0 grid-rows-2 divide-y divide-input border-s border-s-input transition-colors group-has-aria-invalid/input-number:divide-destructive group-has-aria-invalid/input-number:border-s-destructive group-has-aria-invalid/input-number:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid/input-number:*:[button]:focus-visible:bg-destructive/40", className), "data-slot": "input-number-stepper", ...props, children: [_jsx(InputNumberPrimitive.IncrementButton, { className: buttonVariants({
|
|
33
|
+
className: "h-full min-w-0 rounded-none px-0 text-muted-foreground focus-visible:-outline-offset-2",
|
|
34
34
|
variant: "ghost",
|
|
35
35
|
}), "data-slot": "input-number-increment", children: _jsx(ChevronUpIcon, { className: "size-3.5" }) }), _jsx(InputNumberPrimitive.DecrementButton, { className: buttonVariants({
|
|
36
|
-
className: "h-full min-w-0 rounded-none px-0 text-muted-foreground",
|
|
36
|
+
className: "h-full min-w-0 rounded-none px-0 text-muted-foreground focus-visible:-outline-offset-2",
|
|
37
37
|
variant: "ghost",
|
|
38
38
|
}), "data-slot": "input-number-decrement", children: _jsx(ChevronDownIcon, { className: "size-3.5" }) })] }));
|
|
39
39
|
}
|
|
@@ -45,7 +45,7 @@ function InputNumberStepper({ className, ...props }) {
|
|
|
45
45
|
*/
|
|
46
46
|
function InputNumberIncrement({ children, className, ...props }) {
|
|
47
47
|
return (_jsx(InputNumberPrimitive.IncrementButton, { className: buttonVariants({
|
|
48
|
-
className: cn("h-full w-8 shrink-0 rounded-none rounded-e-[calc(var(--radius-lg)-1px)] border-s border-s-input text-muted-foreground group-has-aria-invalid/input-number:border-s-destructive focus-visible
|
|
48
|
+
className: cn("h-full w-8 shrink-0 rounded-none rounded-e-[calc(var(--radius-lg)-1px)] border-s border-s-input text-muted-foreground group-has-aria-invalid/input-number:border-s-destructive focus-visible:-outline-offset-2 group-has-aria-invalid/input-number:focus-visible:bg-destructive/20 dark:group-has-aria-invalid/input-number:focus-visible:bg-destructive/40", className),
|
|
49
49
|
variant: "ghost",
|
|
50
50
|
}), "data-slot": "input-number-increment", ...props, children: children ?? _jsx(PlusIcon, {}) }));
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ function InputNumberIncrement({ children, className, ...props }) {
|
|
|
57
57
|
*/
|
|
58
58
|
function InputNumberDecrement({ children, className, ...props }) {
|
|
59
59
|
return (_jsx(InputNumberPrimitive.DecrementButton, { className: buttonVariants({
|
|
60
|
-
className: cn("h-full w-8 shrink-0 rounded-none rounded-s-[calc(var(--radius-lg)-1px)] border-e border-e-input text-muted-foreground group-has-aria-invalid/input-number:border-e-destructive focus-visible
|
|
60
|
+
className: cn("h-full w-8 shrink-0 rounded-none rounded-s-[calc(var(--radius-lg)-1px)] border-e border-e-input text-muted-foreground group-has-aria-invalid/input-number:border-e-destructive focus-visible:-outline-offset-2 group-has-aria-invalid/input-number:focus-visible:bg-destructive/20 dark:group-has-aria-invalid/input-number:focus-visible:bg-destructive/40", className),
|
|
61
61
|
variant: "ghost",
|
|
62
62
|
}), "data-slot": "input-number-decrement", ...props, children: children ?? _jsx(MinusIcon, {}) }));
|
|
63
63
|
}
|
|
@@ -25,7 +25,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
25
25
|
throw new Error(`InputOTPSlot: no slot at index ${index}`);
|
|
26
26
|
}
|
|
27
27
|
const { char, hasFakeCaret, isActive } = slot;
|
|
28
|
-
return (_jsxs("div", { className: cn("relative flex size-8 items-center justify-center border-y border-e border-input text-sm shadow-xs transition-all outline-none first:rounded-s-lg first:border-s last:rounded-e-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:
|
|
28
|
+
return (_jsxs("div", { className: cn("relative flex size-8 items-center justify-center border-y border-e border-input text-sm shadow-xs transition-all outline-none first:rounded-s-lg first:border-s last:rounded-e-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:outline-2 data-[active=true]:outline-offset-2 data-[active=true]:outline-ring data-[active=true]:outline-solid data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className), "data-active": isActive, "data-slot": "input-otp-slot", ...props, children: [char, hasFakeCaret ? (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000" }) })) : null] }));
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* @since 0.3.16-canary.0
|
package/dist/components/input.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cn } from "#lib/utils";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
function Input({ className, type, ...props }) {
|
|
7
|
-
return (_jsx("input", { className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:
|
|
7
|
+
return (_jsx("input", { className: cn("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className), "data-slot": "input", type: type, ...props }));
|
|
8
8
|
}
|
|
9
9
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
10
10
|
export { Input };
|
|
@@ -20,9 +20,9 @@ declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX
|
|
|
20
20
|
/**
|
|
21
21
|
* @since 0.3.16-canary.0
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
interface ItemProps extends ComponentProps<"div">, ItemVariants {
|
|
24
24
|
asChild?: boolean;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
/**
|
|
27
27
|
* @since 0.3.16-canary.0
|
|
28
28
|
*/
|
|
@@ -30,7 +30,8 @@ declare function Item({ asChild, className, size, variant, ...props }: ItemProps
|
|
|
30
30
|
/**
|
|
31
31
|
* @since 0.3.16-canary.0
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
interface ItemMediaProps extends ComponentProps<"div">, ItemMediaVariants {
|
|
34
|
+
}
|
|
34
35
|
/**
|
|
35
36
|
* @since 0.3.16-canary.0
|
|
36
37
|
*/
|
|
@@ -56,11 +56,12 @@ declare function MessageScrollerItem({ className, isScrollAnchor, ...props }: Me
|
|
|
56
56
|
*
|
|
57
57
|
* @since 0.5.0-canary.3
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
interface MessageScrollerButtonProps extends ComponentProps<typeof MessageScrollerButtonPrimitive>, Pick<ComponentProps<typeof Button>, "size" | "variant"> {
|
|
60
|
+
}
|
|
60
61
|
/**
|
|
61
62
|
* @since 0.5.0-canary.3
|
|
62
63
|
*/
|
|
63
64
|
declare function MessageScrollerButton({ children, className, direction, render, size, variant, ...props }: MessageScrollerButtonProps): JSX.Element;
|
|
64
65
|
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, };
|
|
65
66
|
export type { MessageScrollerButtonProps, MessageScrollerContentProps, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProviderProps, MessageScrollerViewportProps, };
|
|
66
|
-
export type { MessageScrollerDefaultScrollPosition, MessageScrollerScrollAlign, MessageScrollerScrollable, MessageScrollerScrollOptions, MessageScrollerVisibilityState, } from "#
|
|
67
|
+
export type { MessageScrollerButtonDirection, MessageScrollerButtonRenderState, MessageScrollerDefaultScrollPosition, MessageScrollerScrollAlign, MessageScrollerScrollable, MessageScrollerScrollOptions, MessageScrollerVisibilityState, } from "#primitives/message-scroller";
|
|
@@ -2,9 +2,9 @@ import type { ComponentProps, JSX } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* @since 0.3.16-canary.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
interface NativeSelectProps extends Omit<ComponentProps<"select">, "size"> {
|
|
6
6
|
size?: "default" | "sm";
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
/**
|
|
9
9
|
* @since 0.3.16-canary.0
|
|
10
10
|
*/
|
|
@@ -5,7 +5,7 @@ import { cn } from "#lib/utils";
|
|
|
5
5
|
* @since 0.3.16-canary.0
|
|
6
6
|
*/
|
|
7
7
|
function NativeSelect({ className, size = "default", ...props }) {
|
|
8
|
-
return (_jsxs("div", { className: cn("group/native-select relative w-fit has-[select:disabled]:opacity-50", className), "data-size": size, "data-slot": "native-select-wrapper", children: [_jsx("select", { className: "h-8 w-full min-w-0 appearance-none rounded-lg border border-input bg-transparent py-1 ps-2.5 pe-8 text-sm shadow-xs transition-[color,box-shadow] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:
|
|
8
|
+
return (_jsxs("div", { className: cn("group/native-select relative w-fit has-[select:disabled]:opacity-50", className), "data-size": size, "data-slot": "native-select-wrapper", children: [_jsx("select", { className: "h-8 w-full min-w-0 appearance-none rounded-lg border border-input bg-transparent py-1 ps-2.5 pe-8 text-sm shadow-xs transition-[color,box-shadow] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", "data-size": size, "data-slot": "native-select", ...props }), _jsx(ChevronDownIcon, { "aria-hidden": "true", className: "pointer-events-none absolute inset-e-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground select-none", "data-slot": "native-select-icon" })] }));
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @since 0.3.16-canary.0
|
|
@@ -31,13 +31,13 @@ function NavigationMenuTrigger({ children, className, ...props }) {
|
|
|
31
31
|
* @since 0.3.16-canary.0
|
|
32
32
|
*/
|
|
33
33
|
function NavigationMenuContent({ className, ...props }) {
|
|
34
|
-
return (_jsx(NavigationMenuPrimitive.Content, { className: cn("inset-s-0 top-0 w-full p-1 ease-snappy group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:animation-duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:ease-exit data-[motion^=to-]:fade-out
|
|
34
|
+
return (_jsx(NavigationMenuPrimitive.Content, { className: cn("inset-s-0 top-0 w-full p-1 ease-snappy group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:animation-duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:ease-exit data-[motion^=to-]:fade-out md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 data-closed:ease-exit group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95", className), "data-slot": "navigation-menu-content", ...props }));
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* @since 0.3.16-canary.0
|
|
38
38
|
*/
|
|
39
39
|
function NavigationMenuLink({ className, ...props }) {
|
|
40
|
-
return (_jsx(NavigationMenuPrimitive.Link, { className: cn("flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:
|
|
40
|
+
return (_jsx(NavigationMenuPrimitive.Link, { className: cn("flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4", className), "data-slot": "navigation-menu-link", ...props }));
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* @since 0.4.0-canary.4
|
|
@@ -13,7 +13,7 @@ function RadioCards(props) {
|
|
|
13
13
|
* @since 0.3.16-canary.0
|
|
14
14
|
*/
|
|
15
15
|
function RadioCardsItem({ children, className, ...props }) {
|
|
16
|
-
return (_jsxs(Label, { className: "flex items-start gap-2.5 rounded-lg border border-input p-2.5 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "data-slot": "radio-card", children: [_jsx(RadioGroupPrimitive.Item, { className: cn("peer relative mt-0.5 flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
16
|
+
return (_jsxs(Label, { className: "flex items-start gap-2.5 rounded-lg border border-input p-2.5 transition has-focus-visible:border-ring has-disabled:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10", "data-slot": "radio-card", children: [_jsx(RadioGroupPrimitive.Item, { className: cn("peer relative mt-0.5 flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), "data-slot": "radio-card-item", ...props, children: _jsx(RadioGroupPrimitive.Indicator, { className: "flex size-4 items-center justify-center", "data-slot": "radio-card-indicator", children: _jsx("span", { className: "absolute inset-s-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 animate-in rounded-full bg-primary-foreground duration-control-indicator ease-spring zoom-in-50 rtl:translate-x-1/2" }) }) }), children] }));
|
|
17
17
|
}
|
|
18
18
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
19
19
|
export { RadioCards, RadioCardsItem };
|
|
@@ -11,7 +11,7 @@ function RadioGroup({ className, ...props }) {
|
|
|
11
11
|
* @since 0.3.16-canary.0
|
|
12
12
|
*/
|
|
13
13
|
function RadioGroupItem({ className, ...props }) {
|
|
14
|
-
return (_jsx(RadioGroupPrimitive.Item, { className: cn("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:
|
|
14
|
+
return (_jsx(RadioGroupPrimitive.Item, { className: cn("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), "data-slot": "radio-group-item", ...props, children: _jsx(RadioGroupPrimitive.Indicator, { className: "flex size-4 items-center justify-center", "data-slot": "radio-group-indicator", children: _jsx("span", { className: "absolute inset-s-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 animate-in rounded-full bg-primary-foreground duration-control-indicator ease-spring zoom-in-50 rtl:translate-x-1/2" }) }) }));
|
|
15
15
|
}
|
|
16
16
|
// ── Exports ──────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
17
17
|
export { RadioGroup, RadioGroupItem };
|