sheerly 0.0.1 → 0.0.3
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/lib/accordion.d.ts +13 -4
- package/lib/alert.d.ts +22 -7
- package/lib/avatar.css +1 -1
- package/lib/avatar.d.ts +21 -8
- package/lib/badge.d.ts +14 -4
- package/lib/breadcrumb.d.ts +49 -8
- package/lib/button.css +1 -1
- package/lib/button.d.ts +13 -4
- package/lib/card.d.ts +32 -12
- package/lib/carousel.d.ts +13 -7
- package/lib/checkbox.d.ts +6 -0
- package/lib/dialog.d.ts +20 -8
- package/lib/dropdown-menu.d.ts +39 -17
- package/lib/hover-card.d.ts +15 -6
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +308 -300
- package/lib/input.css +1 -1
- package/lib/input.d.ts +6 -0
- package/lib/kbd.d.ts +10 -3
- package/lib/label.css +1 -1
- package/lib/label.d.ts +6 -0
- package/lib/pagination.d.ts +52 -13
- package/lib/popover.d.ts +15 -6
- package/lib/progress.d.ts +6 -0
- package/lib/radio.d.ts +13 -3
- package/lib/scrollbar.css +1 -0
- package/lib/scrollbar.d.ts +17 -0
- package/lib/select.css +1 -1
- package/lib/select.d.ts +6 -0
- package/lib/separator.d.ts +14 -4
- package/lib/sheet.d.ts +19 -6
- package/lib/skeleton.d.ts +12 -3
- package/lib/slider.d.ts +6 -0
- package/lib/spinner.d.ts +10 -4
- package/lib/switch.d.ts +6 -0
- package/lib/table.css +1 -1
- package/lib/table.d.ts +14 -3
- package/lib/tabs.d.ts +37 -11
- package/lib/textarea.d.ts +6 -0
- package/lib/toggle.d.ts +7 -0
- package/lib/tooltip.d.ts +15 -6
- package/lib/typography.d.ts +12 -4
- package/lib/utils/polymorphic.d.ts +14 -0
- package/package.json +34 -33
- package/src/accordion.tsx +20 -6
- package/src/alert.tsx +52 -14
- package/src/avatar.css +0 -1
- package/src/avatar.tsx +44 -15
- package/src/badge.tsx +34 -16
- package/src/breadcrumb.tsx +97 -26
- package/src/button.css +1 -0
- package/src/button.tsx +44 -27
- package/src/card.tsx +82 -23
- package/src/carousel.tsx +28 -11
- package/src/checkbox.tsx +7 -1
- package/src/dialog.tsx +55 -16
- package/src/dropdown-menu.tsx +115 -33
- package/src/hover-card.tsx +28 -9
- package/src/index.css +1 -0
- package/src/index.ts +1 -1
- package/src/input.css +1 -0
- package/src/input.tsx +7 -1
- package/src/kbd.tsx +17 -5
- package/src/label.css +1 -0
- package/src/label.tsx +7 -1
- package/src/pagination.tsx +107 -35
- package/src/popover.tsx +28 -9
- package/src/progress.tsx +7 -1
- package/src/radio.tsx +20 -5
- package/src/scrollbar.css +56 -0
- package/src/scrollbar.tsx +28 -0
- package/src/select.css +24 -0
- package/src/select.tsx +7 -1
- package/src/separator.tsx +23 -7
- package/src/sheet.tsx +53 -13
- package/src/skeleton.tsx +19 -5
- package/src/slider.tsx +7 -1
- package/src/spinner.tsx +21 -8
- package/src/switch.tsx +7 -1
- package/src/table.css +0 -1
- package/src/table.tsx +21 -5
- package/src/tabs.tsx +65 -25
- package/src/textarea.tsx +7 -1
- package/src/toggle.tsx +8 -1
- package/src/tooltip.tsx +28 -9
- package/src/typography.tsx +19 -5
- package/src/utils/polymorphic.ts +19 -0
- /package/lib/{cn.d.ts → utils/cn.d.ts} +0 -0
- /package/src/{cn.ts → utils/cn.ts} +0 -0
package/lib/accordion.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { DetailsHTMLAttributes,
|
|
1
|
+
import { DetailsHTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
2
3
|
export type AccordionProps = DetailsHTMLAttributes<HTMLDetailsElement>;
|
|
3
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Native <details>. Set the same `name` on siblings for exclusive open.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Accordion name="faq">
|
|
9
|
+
* <summary>Is it accessible?</summary>
|
|
10
|
+
* <AccordionContent>Yes.</AccordionContent>
|
|
11
|
+
* </Accordion>
|
|
12
|
+
*/
|
|
4
13
|
export declare function Accordion({ className, ...props }: AccordionProps): import("react").JSX.Element;
|
|
5
|
-
export type AccordionContentProps =
|
|
6
|
-
export declare function AccordionContent({ className, ...props }: AccordionContentProps): import("react").JSX.Element;
|
|
14
|
+
export type AccordionContentProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
15
|
+
export declare function AccordionContent<T extends ElementType = 'div'>({ as, className, ...props }: AccordionContentProps<T>): import("react").JSX.Element;
|
package/lib/alert.d.ts
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type AlertProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
3
4
|
'data-variant'?: 'default' | 'destructive' | 'success' | 'info' | 'warning';
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* A callout. The leading icon is embedded in CSS and swaps per `data-variant`.
|
|
8
|
+
*
|
|
9
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `div`).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Alert data-variant="warning">
|
|
13
|
+
* <AlertTitle>Heads up</AlertTitle>
|
|
14
|
+
* <AlertDescription>Your session expires soon.</AlertDescription>
|
|
15
|
+
* </Alert>
|
|
16
|
+
*/
|
|
17
|
+
export declare function Alert<T extends ElementType = 'div'>({ as, className, ...props }: AlertProps<T>): import("react").JSX.Element;
|
|
18
|
+
export type AlertTitleProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
19
|
+
export declare function AlertTitle<T extends ElementType = 'div'>({ as, className, ...props }: AlertTitleProps<T>): import("react").JSX.Element;
|
|
20
|
+
export type AlertDescriptionProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
21
|
+
export declare function AlertDescription<T extends ElementType = 'div'>({ as, className, ...props }: AlertDescriptionProps<T>): import("react").JSX.Element;
|
|
22
|
+
export type AlertActionProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
23
|
+
export declare function AlertAction<T extends ElementType = 'div'>({ as, className, ...props }: AlertActionProps<T>): import("react").JSX.Element;
|
package/lib/avatar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.sheerly-avatar{border-radius:var(--sheerly-radius-full);-webkit-user-select:none;user-select:none;flex-shrink:0;width:32px;height:32px;display:flex;
|
|
1
|
+
.sheerly-avatar{border-radius:var(--sheerly-radius-full);-webkit-user-select:none;user-select:none;flex-shrink:0;width:32px;height:32px;display:flex;overflow:hidden}.sheerly-avatar[data-size=sm]{width:24px;height:24px}.sheerly-avatar[data-size=lg]{width:40px;height:40px}.sheerly-avatar[data-size=xl]{width:56px;height:56px}.sheerly-avatar img{aspect-ratio:1;object-fit:cover;width:100%;height:100%}.sheerly-avatar-fallback{border-radius:var(--sheerly-radius-full);background-color:var(--sheerly-muted);width:100%;height:100%;color:var(--sheerly-muted-foreground);justify-content:center;align-items:center;font-family:Geist Sans,system-ui,-apple-system,sans-serif;font-size:14px;font-weight:500;display:flex}.sheerly-avatar[data-size=sm] .sheerly-avatar-fallback{font-size:11px}.sheerly-avatar[data-size=lg] .sheerly-avatar-fallback{font-size:16px}.sheerly-avatar[data-size=xl] .sheerly-avatar-fallback{font-size:20px}.sheerly-avatar-group{display:flex}.sheerly-avatar-group .sheerly-avatar{box-shadow:0 0 0 2px var(--sheerly-background)}.sheerly-avatar-group .sheerly-avatar+.sheerly-avatar{margin-left:-8px}
|
package/lib/avatar.d.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType, ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type AvatarProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
3
4
|
'data-size'?: 'sm' | 'default' | 'lg' | 'xl';
|
|
4
|
-
}
|
|
5
|
-
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* A circular avatar. Nest an <AvatarImage> with an <AvatarFallback> for initials.
|
|
8
|
+
*
|
|
9
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `div`, e.g.
|
|
10
|
+
* `as="a"` for a linkable avatar).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Avatar>
|
|
14
|
+
* <AvatarImage src="/me.jpg" alt="Ada" />
|
|
15
|
+
* <AvatarFallback>AL</AvatarFallback>
|
|
16
|
+
* </Avatar>
|
|
17
|
+
*/
|
|
18
|
+
export declare function Avatar<T extends ElementType = 'div'>({ as, className, ...props }: AvatarProps<T>): import("react").JSX.Element;
|
|
6
19
|
export interface AvatarImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
7
20
|
alt: string;
|
|
8
21
|
}
|
|
9
22
|
export declare function AvatarImage(props: AvatarImageProps): import("react").JSX.Element;
|
|
10
|
-
export type AvatarFallbackProps =
|
|
11
|
-
export declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): import("react").JSX.Element;
|
|
12
|
-
export type AvatarGroupProps =
|
|
13
|
-
export declare function AvatarGroup({ className, ...props }: AvatarGroupProps): import("react").JSX.Element;
|
|
23
|
+
export type AvatarFallbackProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
24
|
+
export declare function AvatarFallback<T extends ElementType = 'span'>({ as, className, ...props }: AvatarFallbackProps<T>): import("react").JSX.Element;
|
|
25
|
+
export type AvatarGroupProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
26
|
+
export declare function AvatarGroup<T extends ElementType = 'div'>({ as, className, ...props }: AvatarGroupProps<T>): import("react").JSX.Element;
|
package/lib/badge.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type BadgeProps<T extends ElementType = 'span'> = PolymorphicProps<T, {
|
|
3
4
|
'data-variant'?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'success' | 'warning' | 'error' | 'blue';
|
|
4
|
-
}
|
|
5
|
-
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* A pill-shaped label. Set `data-variant` for color.
|
|
8
|
+
*
|
|
9
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `span`, e.g.
|
|
10
|
+
* `as="a"` for a linkable badge).
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Badge data-variant="success">Active</Badge>
|
|
14
|
+
*/
|
|
15
|
+
export declare function Badge<T extends ElementType = 'span'>({ as, className, ...props }: BadgeProps<T>): import("react").JSX.Element;
|
package/lib/breadcrumb.d.ts
CHANGED
|
@@ -1,8 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type BreadcrumbProps<T extends ElementType = 'nav'> = PolymorphicProps<T>;
|
|
4
|
+
/**
|
|
5
|
+
* A path hierarchy of links.
|
|
6
|
+
*
|
|
7
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `nav`).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Breadcrumb>
|
|
11
|
+
* <BreadcrumbList>
|
|
12
|
+
* <BreadcrumbItem><BreadcrumbLink href="/">Home</BreadcrumbLink></BreadcrumbItem>
|
|
13
|
+
* <BreadcrumbSeparator />
|
|
14
|
+
* <BreadcrumbItem><BreadcrumbPage>Docs</BreadcrumbPage></BreadcrumbItem>
|
|
15
|
+
* </BreadcrumbList>
|
|
16
|
+
* </Breadcrumb>
|
|
17
|
+
*/
|
|
18
|
+
export declare function Breadcrumb<T extends ElementType = 'nav'>({ as, className, ...props }: BreadcrumbProps<T>): import("react").JSX.Element;
|
|
19
|
+
export type BreadcrumbListProps<T extends ElementType = 'ol'> = PolymorphicProps<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `ol`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function BreadcrumbList<T extends ElementType = 'ol'>({ as, className, ...props }: BreadcrumbListProps<T>): import("react").JSX.Element;
|
|
24
|
+
export type BreadcrumbItemProps<T extends ElementType = 'li'> = PolymorphicProps<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `li`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function BreadcrumbItem<T extends ElementType = 'li'>({ as, className, ...props }: BreadcrumbItemProps<T>): import("react").JSX.Element;
|
|
29
|
+
export type BreadcrumbLinkProps<T extends ElementType = 'a'> = PolymorphicProps<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `a`, e.g.
|
|
32
|
+
* `as={Link}` for a router link).
|
|
33
|
+
*/
|
|
34
|
+
export declare function BreadcrumbLink<T extends ElementType = 'a'>({ as, className, ...props }: BreadcrumbLinkProps<T>): import("react").JSX.Element;
|
|
35
|
+
export type BreadcrumbPageProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `span`).
|
|
38
|
+
*/
|
|
39
|
+
export declare function BreadcrumbPage<T extends ElementType = 'span'>({ as, className, ...props }: BreadcrumbPageProps<T>): import("react").JSX.Element;
|
|
40
|
+
export type BreadcrumbSeparatorProps<T extends ElementType = 'li'> = PolymorphicProps<T>;
|
|
41
|
+
/**
|
|
42
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `li`).
|
|
43
|
+
*/
|
|
44
|
+
export declare function BreadcrumbSeparator<T extends ElementType = 'li'>({ as, className, ...props }: BreadcrumbSeparatorProps<T>): import("react").JSX.Element;
|
|
45
|
+
export type BreadcrumbEllipsisProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
46
|
+
/**
|
|
47
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `span`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function BreadcrumbEllipsis<T extends ElementType = 'span'>({ as, className, ...props }: BreadcrumbEllipsisProps<T>): import("react").JSX.Element;
|
package/lib/button.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.sheerly-button{white-space:nowrap;border-radius:var(--sheerly-radius-lg);cursor:pointer;-webkit-user-select:none;user-select:none;background-color:var(--sheerly-primary);color:var(--sheerly-primary-foreground);border:1px solid #0000;outline:none;flex-shrink:0;justify-content:center;align-items:center;gap:6px;height:32px;padding:0 10px;font-family:Geist Sans,system-ui,-apple-system,sans-serif;font-size:14px;font-weight:500;line-height:20px;text-decoration:none;transition:all .15s;display:inline-flex}.sheerly-button:hover{background-color:oklch(from var(--sheerly-primary) l c h / 80%)}.sheerly-button:active:not([aria-haspopup]){translate:0 1px}.sheerly-button:focus-visible{border-color:var(--sheerly-ring);box-shadow:var(--sheerly-focus-ring)}.sheerly-button:disabled{pointer-events:none;opacity:.5}.sheerly-button svg{pointer-events:none;flex-shrink:0;width:16px;height:16px}.sheerly-button [data-icon=inline-start]{margin-inline-start:-2px}.sheerly-button [data-icon=inline-end]{margin-inline-end:-2px}.sheerly-button[data-rounded=full]{border-radius:var(--sheerly-radius-full)}.sheerly-button[data-variant=default],.sheerly-button[data-variant=primary]{background-color:var(--sheerly-primary);color:var(--sheerly-primary-foreground)}:is(.sheerly-button[data-variant=default],.sheerly-button[data-variant=primary]):hover{background-color:oklch(from var(--sheerly-primary) l c h / 80%)}.sheerly-button[data-variant=secondary]{background-color:var(--sheerly-secondary);color:var(--sheerly-secondary-foreground)}.sheerly-button[data-variant=secondary]:hover{background-color:color-mix(in oklch, var(--sheerly-secondary), var(--sheerly-foreground) 5%)}.sheerly-button[data-variant=tertiary],.sheerly-button[data-variant=ghost]{color:var(--sheerly-foreground);background-color:#0000}:is(.sheerly-button[data-variant=tertiary],.sheerly-button[data-variant=ghost]):hover{background-color:var(--sheerly-muted);color:var(--sheerly-foreground)}.sheerly-button[data-variant=muted]{background-color:var(--sheerly-muted);color:var(--sheerly-muted-foreground)}.sheerly-button[data-variant=muted]:hover{background-color:color-mix(in oklch, var(--sheerly-muted), var(--sheerly-foreground) 5%)}.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]{background-color:oklch(from var(--sheerly-destructive) l c h / 10%);color:var(--sheerly-destructive)}:is(.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]):hover{background-color:oklch(from var(--sheerly-destructive) l c h / 20%)}:is(.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]):focus-visible{border-color:oklch(from var(--sheerly-destructive) l c h / 40%);box-shadow:0 0 0 3px oklch(from var(--sheerly-destructive) l c h / 20%)}.sheerly-button[data-variant=outline]{background-color:var(--sheerly-background);color:var(--sheerly-foreground);border-color:var(--sheerly-border)}.sheerly-button[data-variant=outline]:hover{background-color:var(--sheerly-muted);color:var(--sheerly-foreground)}.sheerly-button[data-variant=link]{color:var(--sheerly-primary);text-underline-offset:4px;background-color:#0000;border:none;height:auto;padding:0}.sheerly-button[data-variant=link]:hover{text-decoration:underline}.sheerly-button[data-size=xs]{border-radius:var(--sheerly-radius-md);gap:4px;height:24px;padding:0 8px;font-size:12px}.sheerly-button[data-size=xs] svg{width:14px;height:14px}.sheerly-button[data-size=sm]{border-radius:var(--sheerly-radius-md);gap:4px;height:28px;padding:0 10px;font-size:13px}.sheerly-button[data-size=default]{height:32px;padding:0 10px}.sheerly-button[data-size=lg]{height:36px;padding:0 10px}.sheerly-button[data-size=icon]{width:32px;height:32px;padding:0}.sheerly-button[data-size=icon-xs]{border-radius:var(--sheerly-radius-md);width:24px;height:24px;padding:0}.sheerly-button[data-size=icon-xs] svg{width:14px;height:14px}.sheerly-button[data-size=icon-sm]{border-radius:var(--sheerly-radius-md);width:28px;height:28px;padding:0}.sheerly-button[data-size=icon-lg]{width:36px;height:36px;padding:0}
|
|
1
|
+
.sheerly-button{white-space:nowrap;border-radius:var(--sheerly-radius-lg);cursor:pointer;box-sizing:border-box;-webkit-user-select:none;user-select:none;background-color:var(--sheerly-primary);color:var(--sheerly-primary-foreground);border:1px solid #0000;outline:none;flex-shrink:0;justify-content:center;align-items:center;gap:6px;height:32px;padding:0 10px;font-family:Geist Sans,system-ui,-apple-system,sans-serif;font-size:14px;font-weight:500;line-height:20px;text-decoration:none;transition:all .15s;display:inline-flex}.sheerly-button:hover{background-color:oklch(from var(--sheerly-primary) l c h / 80%)}.sheerly-button:active:not([aria-haspopup]){translate:0 1px}.sheerly-button:focus-visible{border-color:var(--sheerly-ring);box-shadow:var(--sheerly-focus-ring)}.sheerly-button:disabled{pointer-events:none;opacity:.5}.sheerly-button svg{pointer-events:none;flex-shrink:0;width:16px;height:16px}.sheerly-button [data-icon=inline-start]{margin-inline-start:-2px}.sheerly-button [data-icon=inline-end]{margin-inline-end:-2px}.sheerly-button[data-rounded=full]{border-radius:var(--sheerly-radius-full)}.sheerly-button[data-variant=default],.sheerly-button[data-variant=primary]{background-color:var(--sheerly-primary);color:var(--sheerly-primary-foreground)}:is(.sheerly-button[data-variant=default],.sheerly-button[data-variant=primary]):hover{background-color:oklch(from var(--sheerly-primary) l c h / 80%)}.sheerly-button[data-variant=secondary]{background-color:var(--sheerly-secondary);color:var(--sheerly-secondary-foreground)}.sheerly-button[data-variant=secondary]:hover{background-color:color-mix(in oklch, var(--sheerly-secondary), var(--sheerly-foreground) 5%)}.sheerly-button[data-variant=tertiary],.sheerly-button[data-variant=ghost]{color:var(--sheerly-foreground);background-color:#0000}:is(.sheerly-button[data-variant=tertiary],.sheerly-button[data-variant=ghost]):hover{background-color:var(--sheerly-muted);color:var(--sheerly-foreground)}.sheerly-button[data-variant=muted]{background-color:var(--sheerly-muted);color:var(--sheerly-muted-foreground)}.sheerly-button[data-variant=muted]:hover{background-color:color-mix(in oklch, var(--sheerly-muted), var(--sheerly-foreground) 5%)}.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]{background-color:oklch(from var(--sheerly-destructive) l c h / 10%);color:var(--sheerly-destructive)}:is(.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]):hover{background-color:oklch(from var(--sheerly-destructive) l c h / 20%)}:is(.sheerly-button[data-variant=destructive],.sheerly-button[data-variant=error]):focus-visible{border-color:oklch(from var(--sheerly-destructive) l c h / 40%);box-shadow:0 0 0 3px oklch(from var(--sheerly-destructive) l c h / 20%)}.sheerly-button[data-variant=outline]{background-color:var(--sheerly-background);color:var(--sheerly-foreground);border-color:var(--sheerly-border)}.sheerly-button[data-variant=outline]:hover{background-color:var(--sheerly-muted);color:var(--sheerly-foreground)}.sheerly-button[data-variant=link]{color:var(--sheerly-primary);text-underline-offset:4px;background-color:#0000;border:none;height:auto;padding:0}.sheerly-button[data-variant=link]:hover{text-decoration:underline}.sheerly-button[data-size=xs]{border-radius:var(--sheerly-radius-md);gap:4px;height:24px;padding:0 8px;font-size:12px}.sheerly-button[data-size=xs] svg{width:14px;height:14px}.sheerly-button[data-size=sm]{border-radius:var(--sheerly-radius-md);gap:4px;height:28px;padding:0 10px;font-size:13px}.sheerly-button[data-size=default]{height:32px;padding:0 10px}.sheerly-button[data-size=lg]{height:36px;padding:0 10px}.sheerly-button[data-size=icon]{width:32px;height:32px;padding:0}.sheerly-button[data-size=icon-xs]{border-radius:var(--sheerly-radius-md);width:24px;height:24px;padding:0}.sheerly-button[data-size=icon-xs] svg{width:14px;height:14px}.sheerly-button[data-size=icon-sm]{border-radius:var(--sheerly-radius-md);width:28px;height:28px;padding:0}.sheerly-button[data-size=icon-lg]{width:36px;height:36px;padding:0}
|
package/lib/button.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type ButtonProps<T extends ElementType = 'button'> = PolymorphicProps<T, {
|
|
3
4
|
'data-variant'?: 'default' | 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'muted' | 'destructive' | 'error' | 'outline' | 'link';
|
|
4
5
|
'data-size'?: 'xs' | 'sm' | 'default' | 'lg' | 'icon' | 'icon-xs' | 'icon-sm' | 'icon-lg';
|
|
5
6
|
'data-rounded'?: 'full';
|
|
6
|
-
}
|
|
7
|
-
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* A button. Defaults to the primary variant; set `data-variant` / `data-size`
|
|
10
|
+
* to change it.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Button data-variant="secondary">Save</Button>
|
|
14
|
+
* <Button as="a" role="button" href="/settings">Settings</Button>
|
|
15
|
+
*/
|
|
16
|
+
export declare function Button<T extends ElementType = 'button'>({ as, className, ...props }: ButtonProps<T>): import("react").JSX.Element;
|
package/lib/card.d.ts
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type CardProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
3
4
|
'data-size'?: 'default' | 'sm';
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* A surface container. Compose with the sub-parts below.
|
|
8
|
+
*
|
|
9
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `div`).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Card as="article">
|
|
13
|
+
* <CardHeader>
|
|
14
|
+
* <CardTitle>Notifications</CardTitle>
|
|
15
|
+
* <CardDescription>You have 3 unread.</CardDescription>
|
|
16
|
+
* </CardHeader>
|
|
17
|
+
* <CardContent>…</CardContent>
|
|
18
|
+
* </Card>
|
|
19
|
+
*/
|
|
20
|
+
export declare function Card<T extends ElementType = 'div'>({ as, className, ...props }: CardProps<T>): import("react").JSX.Element;
|
|
21
|
+
export type CardHeaderProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
22
|
+
export declare function CardHeader<T extends ElementType = 'div'>({ as, className, ...props }: CardHeaderProps<T>): import("react").JSX.Element;
|
|
23
|
+
export type CardTitleProps<T extends ElementType = 'h3'> = PolymorphicProps<T>;
|
|
24
|
+
export declare function CardTitle<T extends ElementType = 'h3'>({ as, className, ...props }: CardTitleProps<T>): import("react").JSX.Element;
|
|
25
|
+
export type CardDescriptionProps<T extends ElementType = 'p'> = PolymorphicProps<T>;
|
|
26
|
+
export declare function CardDescription<T extends ElementType = 'p'>({ as, className, ...props }: CardDescriptionProps<T>): import("react").JSX.Element;
|
|
27
|
+
export type CardActionProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
28
|
+
export declare function CardAction<T extends ElementType = 'div'>({ as, className, ...props }: CardActionProps<T>): import("react").JSX.Element;
|
|
29
|
+
export type CardContentProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
30
|
+
export declare function CardContent<T extends ElementType = 'div'>({ as, className, ...props }: CardContentProps<T>): import("react").JSX.Element;
|
|
31
|
+
export type CardFooterProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
12
32
|
'data-direction'?: 'column';
|
|
13
|
-
}
|
|
14
|
-
export declare function CardFooter({ className, ...props }: CardFooterProps): import("react").JSX.Element;
|
|
33
|
+
}>;
|
|
34
|
+
export declare function CardFooter<T extends ElementType = 'div'>({ as, className, ...props }: CardFooterProps<T>): import("react").JSX.Element;
|
package/lib/carousel.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type CarouselProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
3
4
|
/**
|
|
4
5
|
* Pure-CSS carousel. The element itself is the scroll container — put
|
|
5
6
|
* `<CarouselItem>`s (or any children) directly inside. The browser generates
|
|
@@ -11,11 +12,16 @@ export type CarouselProps = HTMLAttributes<HTMLDivElement>;
|
|
|
11
12
|
* component sets no gap on purpose (a fixed basis + gap breaks first/last
|
|
12
13
|
* snapping, so the prev/next buttons wouldn't disable and end dots wouldn't
|
|
13
14
|
* highlight).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Carousel>
|
|
18
|
+
* <CarouselItem data-name="Slide 1">…</CarouselItem>
|
|
19
|
+
* <CarouselItem data-name="Slide 2">…</CarouselItem>
|
|
20
|
+
* </Carousel>
|
|
14
21
|
*/
|
|
15
|
-
export declare function Carousel({ className, ...props }: CarouselProps): import("react").JSX.Element;
|
|
16
|
-
export
|
|
17
|
-
/** Accessible name for this slide's generated scroll marker (WCAG). */
|
|
22
|
+
export declare function Carousel<T extends ElementType = 'div'>({ as, className, ...props }: CarouselProps<T>): import("react").JSX.Element;
|
|
23
|
+
export type CarouselItemProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
18
24
|
'data-name'?: string;
|
|
19
|
-
}
|
|
25
|
+
}>;
|
|
20
26
|
/** A slide. Defaults to `width: 100%` (one per page); override via `style`/`className`. */
|
|
21
|
-
export declare function CarouselItem({ className, ...props }: CarouselItemProps): import("react").JSX.Element;
|
|
27
|
+
export declare function CarouselItem<T extends ElementType = 'div'>({ as, className, ...props }: CarouselItemProps<T>): import("react").JSX.Element;
|
package/lib/checkbox.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
3
|
+
/**
|
|
4
|
+
* A checkbox `<input>`. Pair with a <Label> for a clickable target.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <Checkbox id="terms" defaultChecked />
|
|
8
|
+
*/
|
|
3
9
|
export declare function Checkbox({ className, ...props }: CheckboxProps): import("react").JSX.Element;
|
package/lib/dialog.d.ts
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, DialogHTMLAttributes,
|
|
1
|
+
import { ButtonHTMLAttributes, DialogHTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
2
3
|
/**
|
|
3
4
|
* Native <dialog>. Open via invoker command (`command="show-modal"`) or
|
|
4
5
|
* `.showModal()`. Add `closedby="any"` for light-dismiss.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <button commandfor="d" command="show-modal">Open</button>
|
|
9
|
+
* <Dialog id="d" closedby="any">
|
|
10
|
+
* <DialogHeader><DialogTitle>Confirm</DialogTitle></DialogHeader>
|
|
11
|
+
* <DialogFooter><DialogClose command="close" commandfor="d">Cancel</DialogClose></DialogFooter>
|
|
12
|
+
* </Dialog>
|
|
5
13
|
*/
|
|
6
14
|
export declare function Dialog({ className, ...props }: DialogHTMLAttributes<HTMLDialogElement>): import("react").JSX.Element;
|
|
7
|
-
export
|
|
8
|
-
export declare function
|
|
9
|
-
export
|
|
10
|
-
export declare function
|
|
11
|
-
export
|
|
15
|
+
export type DialogHeaderProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
16
|
+
export declare function DialogHeader<T extends ElementType = 'div'>({ as, className, ...props }: DialogHeaderProps<T>): import("react").JSX.Element;
|
|
17
|
+
export type DialogTitleProps<T extends ElementType = 'h3'> = PolymorphicProps<T>;
|
|
18
|
+
export declare function DialogTitle<T extends ElementType = 'h3'>({ as, className, ...props }: DialogTitleProps<T>): import("react").JSX.Element;
|
|
19
|
+
export type DialogDescriptionProps<T extends ElementType = 'p'> = PolymorphicProps<T>;
|
|
20
|
+
export declare function DialogDescription<T extends ElementType = 'p'>({ as, className, ...props }: DialogDescriptionProps<T>): import("react").JSX.Element;
|
|
21
|
+
export type DialogBodyProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
22
|
+
export declare function DialogBody<T extends ElementType = 'div'>({ as, className, ...props }: DialogBodyProps<T>): import("react").JSX.Element;
|
|
23
|
+
export type DialogFooterProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
12
24
|
'data-direction'?: 'column';
|
|
13
|
-
}
|
|
14
|
-
export declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react").JSX.Element;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function DialogFooter<T extends ElementType = 'div'>({ as, className, ...props }: DialogFooterProps<T>): import("react").JSX.Element;
|
|
15
27
|
export declare function DialogClose({ className, type, ...props }: ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
|
package/lib/dropdown-menu.d.ts
CHANGED
|
@@ -1,38 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ButtonHTMLAttributes, ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper carrying the anchor. Nest the trigger button + content inside.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <DropdownMenu>
|
|
8
|
+
* <Button commandfor="m" command="toggle-popover">Open</Button>
|
|
9
|
+
* <DropdownMenuContent id="m" popover role="menu">
|
|
10
|
+
* <DropdownMenuItem>Profile</DropdownMenuItem>
|
|
11
|
+
* <DropdownMenuItem data-variant="destructive">Sign out</DropdownMenuItem>
|
|
12
|
+
* </DropdownMenuContent>
|
|
13
|
+
* </DropdownMenu>
|
|
14
|
+
*/
|
|
15
|
+
export type DropdownMenuProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
16
|
+
export declare function DropdownMenu<T extends ElementType = 'span'>({ as, className, ...props }: DropdownMenuProps<T>): import("react").JSX.Element;
|
|
4
17
|
/**
|
|
5
18
|
* The floating menu panel. Give it `popover`, an `id` matched by the trigger's
|
|
6
19
|
* `commandfor`, and `role="menu"`. When nested inside a <DropdownMenuSub> it is
|
|
7
20
|
* automatically styled as a submenu panel (no extra attribute needed).
|
|
8
21
|
*/
|
|
9
|
-
export type DropdownMenuContentProps =
|
|
10
|
-
export declare function DropdownMenuContent({ className, ...props }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
22
|
+
export type DropdownMenuContentProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
23
|
+
export declare function DropdownMenuContent<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuContentProps<T>): import("react").JSX.Element;
|
|
11
24
|
/** A semantic wrapper for a set of related items/labels. */
|
|
12
|
-
export
|
|
25
|
+
export type DropdownMenuGroupProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
26
|
+
export declare function DropdownMenuGroup<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuGroupProps<T>): import("react").JSX.Element;
|
|
13
27
|
/** A non-interactive section heading. */
|
|
14
|
-
export
|
|
28
|
+
export type DropdownMenuLabelProps<T extends ElementType = 'div'> = PolymorphicProps<T, {
|
|
15
29
|
'data-inset'?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps): import("react").JSX.Element;
|
|
30
|
+
}>;
|
|
31
|
+
export declare function DropdownMenuLabel<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuLabelProps<T>): import("react").JSX.Element;
|
|
18
32
|
/** An interactive menu row. Renders a <button> by default. */
|
|
19
33
|
export interface DropdownMenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
20
34
|
'data-variant'?: 'destructive';
|
|
21
35
|
'data-inset'?: boolean;
|
|
22
36
|
}
|
|
23
37
|
export declare function DropdownMenuItem({ className, type, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
24
|
-
/**
|
|
25
|
-
|
|
38
|
+
/**
|
|
39
|
+
* An interactive menu row rendered as a link.
|
|
40
|
+
*
|
|
41
|
+
* Polymorphic: pass `as` to change the rendered tag (defaults to `a`, e.g.
|
|
42
|
+
* `as={Link}` for a router link).
|
|
43
|
+
*/
|
|
44
|
+
export type DropdownMenuLinkItemProps<T extends ElementType = 'a'> = PolymorphicProps<T, {
|
|
26
45
|
'data-variant'?: 'destructive';
|
|
27
46
|
'data-inset'?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function DropdownMenuLinkItem({ className, ...props }: DropdownMenuLinkItemProps): import("react").JSX.Element;
|
|
47
|
+
}>;
|
|
48
|
+
export declare function DropdownMenuLinkItem<T extends ElementType = 'a'>({ as, className, ...props }: DropdownMenuLinkItemProps<T>): import("react").JSX.Element;
|
|
30
49
|
/** A trailing keyboard-shortcut hint inside an item. */
|
|
31
|
-
export
|
|
50
|
+
export type DropdownMenuShortcutProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
51
|
+
export declare function DropdownMenuShortcut<T extends ElementType = 'span'>({ as, className, ...props }: DropdownMenuShortcutProps<T>): import("react").JSX.Element;
|
|
32
52
|
/** A horizontal divider between item groups. */
|
|
33
|
-
export
|
|
53
|
+
export type DropdownMenuSeparatorProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
54
|
+
export declare function DropdownMenuSeparator<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuSeparatorProps<T>): import("react").JSX.Element;
|
|
34
55
|
/** Submenu wrapper (display: contents). Nest a sub-trigger + a sub-content. */
|
|
35
|
-
export
|
|
56
|
+
export type DropdownMenuSubProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
57
|
+
export declare function DropdownMenuSub<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuSubProps<T>): import("react").JSX.Element;
|
|
36
58
|
/**
|
|
37
59
|
* Opens a submenu. Use `popoverTarget` (+ `popoverTargetAction="toggle"`)
|
|
38
60
|
* pointing at the sub-content id — NOT command/commandfor, which would
|
|
@@ -46,4 +68,4 @@ export declare function DropdownMenuSubTrigger({ className, type, ...props }: Dr
|
|
|
46
68
|
* The submenu panel. It's a DropdownMenuContent nested inside a DropdownMenuSub;
|
|
47
69
|
* the child-combinator CSS picks it up as a submenu — no extra attribute needed.
|
|
48
70
|
*/
|
|
49
|
-
export declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
71
|
+
export declare function DropdownMenuSubContent<T extends ElementType = 'div'>({ as, className, ...props }: DropdownMenuContentProps<T>): import("react").JSX.Element;
|
package/lib/hover-card.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { PolymorphicProps } from './utils/polymorphic';
|
|
3
|
+
export type HoverCardProps<T extends ElementType = 'span'> = PolymorphicProps<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper carrying the anchor. Nest the trigger + content inside.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <HoverCard>
|
|
9
|
+
* <a href="/user/ada" interestfor="hc">@ada</a>
|
|
10
|
+
* <HoverCardContent id="hc" popover="hint">Ada Lovelace — 1815</HoverCardContent>
|
|
11
|
+
* </HoverCard>
|
|
12
|
+
*/
|
|
13
|
+
export declare function HoverCard<T extends ElementType = 'span'>({ as, className, ...props }: HoverCardProps<T>): import("react").JSX.Element;
|
|
14
|
+
export type HoverCardContentProps<T extends ElementType = 'div'> = PolymorphicProps<T>;
|
|
6
15
|
/** The floating card. Give it `popover="hint"` and an `id` matched by the trigger's `interestfor`. */
|
|
7
|
-
export declare function HoverCardContent({ className, ...props }: HoverCardContentProps): import("react").JSX.Element;
|
|
16
|
+
export declare function HoverCardContent<T extends ElementType = 'div'>({ as, className, ...props }: HoverCardContentProps<T>): import("react").JSX.Element;
|