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.
Files changed (90) hide show
  1. package/lib/accordion.d.ts +13 -4
  2. package/lib/alert.d.ts +22 -7
  3. package/lib/avatar.css +1 -1
  4. package/lib/avatar.d.ts +21 -8
  5. package/lib/badge.d.ts +14 -4
  6. package/lib/breadcrumb.d.ts +49 -8
  7. package/lib/button.css +1 -1
  8. package/lib/button.d.ts +13 -4
  9. package/lib/card.d.ts +32 -12
  10. package/lib/carousel.d.ts +13 -7
  11. package/lib/checkbox.d.ts +6 -0
  12. package/lib/dialog.d.ts +20 -8
  13. package/lib/dropdown-menu.d.ts +39 -17
  14. package/lib/hover-card.d.ts +15 -6
  15. package/lib/index.css +1 -1
  16. package/lib/index.d.ts +1 -1
  17. package/lib/index.js +308 -300
  18. package/lib/input.css +1 -1
  19. package/lib/input.d.ts +6 -0
  20. package/lib/kbd.d.ts +10 -3
  21. package/lib/label.css +1 -1
  22. package/lib/label.d.ts +6 -0
  23. package/lib/pagination.d.ts +52 -13
  24. package/lib/popover.d.ts +15 -6
  25. package/lib/progress.d.ts +6 -0
  26. package/lib/radio.d.ts +13 -3
  27. package/lib/scrollbar.css +1 -0
  28. package/lib/scrollbar.d.ts +17 -0
  29. package/lib/select.css +1 -1
  30. package/lib/select.d.ts +6 -0
  31. package/lib/separator.d.ts +14 -4
  32. package/lib/sheet.d.ts +19 -6
  33. package/lib/skeleton.d.ts +12 -3
  34. package/lib/slider.d.ts +6 -0
  35. package/lib/spinner.d.ts +10 -4
  36. package/lib/switch.d.ts +6 -0
  37. package/lib/table.css +1 -1
  38. package/lib/table.d.ts +14 -3
  39. package/lib/tabs.d.ts +37 -11
  40. package/lib/textarea.d.ts +6 -0
  41. package/lib/toggle.d.ts +7 -0
  42. package/lib/tooltip.d.ts +15 -6
  43. package/lib/typography.d.ts +12 -4
  44. package/lib/utils/polymorphic.d.ts +14 -0
  45. package/package.json +34 -33
  46. package/src/accordion.tsx +20 -6
  47. package/src/alert.tsx +52 -14
  48. package/src/avatar.css +0 -1
  49. package/src/avatar.tsx +44 -15
  50. package/src/badge.tsx +34 -16
  51. package/src/breadcrumb.tsx +97 -26
  52. package/src/button.css +1 -0
  53. package/src/button.tsx +44 -27
  54. package/src/card.tsx +82 -23
  55. package/src/carousel.tsx +28 -11
  56. package/src/checkbox.tsx +7 -1
  57. package/src/dialog.tsx +55 -16
  58. package/src/dropdown-menu.tsx +115 -33
  59. package/src/hover-card.tsx +28 -9
  60. package/src/index.css +1 -0
  61. package/src/index.ts +1 -1
  62. package/src/input.css +1 -0
  63. package/src/input.tsx +7 -1
  64. package/src/kbd.tsx +17 -5
  65. package/src/label.css +1 -0
  66. package/src/label.tsx +7 -1
  67. package/src/pagination.tsx +107 -35
  68. package/src/popover.tsx +28 -9
  69. package/src/progress.tsx +7 -1
  70. package/src/radio.tsx +20 -5
  71. package/src/scrollbar.css +56 -0
  72. package/src/scrollbar.tsx +28 -0
  73. package/src/select.css +24 -0
  74. package/src/select.tsx +7 -1
  75. package/src/separator.tsx +23 -7
  76. package/src/sheet.tsx +53 -13
  77. package/src/skeleton.tsx +19 -5
  78. package/src/slider.tsx +7 -1
  79. package/src/spinner.tsx +21 -8
  80. package/src/switch.tsx +7 -1
  81. package/src/table.css +0 -1
  82. package/src/table.tsx +21 -5
  83. package/src/tabs.tsx +65 -25
  84. package/src/textarea.tsx +7 -1
  85. package/src/toggle.tsx +8 -1
  86. package/src/tooltip.tsx +28 -9
  87. package/src/typography.tsx +19 -5
  88. package/src/utils/polymorphic.ts +19 -0
  89. /package/lib/{cn.d.ts → utils/cn.d.ts} +0 -0
  90. /package/src/{cn.ts → utils/cn.ts} +0 -0
@@ -1,6 +1,15 @@
1
- import { DetailsHTMLAttributes, HTMLAttributes } from 'react';
1
+ import { DetailsHTMLAttributes, ElementType } from 'react';
2
+ import { PolymorphicProps } from './utils/polymorphic';
2
3
  export type AccordionProps = DetailsHTMLAttributes<HTMLDetailsElement>;
3
- /** Native <details>. Set the same `name` on siblings for exclusive open. */
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 = HTMLAttributes<HTMLDivElement>;
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 { HTMLAttributes } from 'react';
2
- export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
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
- export declare function Alert({ className, role, ...props }: AlertProps): import("react").JSX.Element;
6
- export declare function AlertTitle({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
7
- export declare function AlertDescription({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
8
- export declare function AlertAction({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
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;position:relative;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}
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 { HTMLAttributes, ImgHTMLAttributes } from 'react';
2
- export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
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
- export declare function Avatar({ className, ...props }: AvatarProps): import("react").JSX.Element;
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 = HTMLAttributes<HTMLSpanElement>;
11
- export declare function AvatarFallback({ className, ...props }: AvatarFallbackProps): import("react").JSX.Element;
12
- export type AvatarGroupProps = HTMLAttributes<HTMLDivElement>;
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 { HTMLAttributes } from 'react';
2
- export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
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
- export declare function Badge({ className, ...props }: BadgeProps): import("react").JSX.Element;
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;
@@ -1,8 +1,49 @@
1
- import { AnchorHTMLAttributes, HTMLAttributes, OlHTMLAttributes } from 'react';
2
- export declare function Breadcrumb({ className, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
3
- export declare function BreadcrumbList({ className, ...props }: OlHTMLAttributes<HTMLOListElement>): import("react").JSX.Element;
4
- export declare function BreadcrumbItem({ className, ...props }: HTMLAttributes<HTMLLIElement>): import("react").JSX.Element;
5
- export declare function BreadcrumbLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnchorElement>): import("react").JSX.Element;
6
- export declare function BreadcrumbPage({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
7
- export declare function BreadcrumbSeparator({ className, children, ...props }: HTMLAttributes<HTMLLIElement>): import("react").JSX.Element;
8
- export declare function BreadcrumbEllipsis({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
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 { ButtonHTMLAttributes } from 'react';
2
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
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
- export declare function Button({ className, ...props }: ButtonProps): import("react").JSX.Element;
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 { HTMLAttributes } from 'react';
2
- export interface CardProps extends HTMLAttributes<HTMLDivElement> {
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
- export declare function Card({ className, ...props }: CardProps): import("react").JSX.Element;
6
- export declare function CardHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
7
- export declare function CardTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
8
- export declare function CardDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
9
- export declare function CardAction({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
10
- export declare function CardContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
11
- export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
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 { HTMLAttributes } from 'react';
2
- export type CarouselProps = HTMLAttributes<HTMLDivElement>;
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 interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
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, HTMLAttributes } from 'react';
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 declare function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
8
- export declare function DialogTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
9
- export declare function DialogDescription({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
10
- export declare function DialogBody({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
11
- export interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {
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;
@@ -1,38 +1,60 @@
1
- import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes } from 'react';
2
- /** Wrapper carrying the anchor. Nest the trigger button + content inside. */
3
- export declare function DropdownMenu({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
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 = HTMLAttributes<HTMLDivElement>;
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 declare function DropdownMenuGroup({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
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 interface DropdownMenuLabelProps extends HTMLAttributes<HTMLDivElement> {
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
- /** An interactive menu row rendered as a link (<a>). */
25
- export interface DropdownMenuLinkItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
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 declare function DropdownMenuShortcut({ className, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
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 declare function DropdownMenuSeparator({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
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 declare function DropdownMenuSub({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
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;
@@ -1,7 +1,16 @@
1
- import { HTMLAttributes } from 'react';
2
- export type HoverCardProps = HTMLAttributes<HTMLSpanElement>;
3
- /** Wrapper carrying the anchor. Nest the trigger + content inside. */
4
- export declare function HoverCard({ className, ...props }: HoverCardProps): import("react").JSX.Element;
5
- export type HoverCardContentProps = HTMLAttributes<HTMLDivElement>;
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;