canny-ui-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/dist/components/Alert/Alert.d.ts +2 -0
  4. package/dist/components/Alert/Alert.types.d.ts +8 -0
  5. package/dist/components/Alert/index.d.ts +2 -0
  6. package/dist/components/Avatar/Avatar.d.ts +3 -0
  7. package/dist/components/Avatar/Avatar.types.d.ts +13 -0
  8. package/dist/components/Avatar/index.d.ts +2 -0
  9. package/dist/components/Button/Button.d.ts +2 -0
  10. package/dist/components/Button/Button.types.d.ts +27 -0
  11. package/dist/components/Button/ButtonGroup.d.ts +13 -0
  12. package/dist/components/Button/FAB.d.ts +37 -0
  13. package/dist/components/Button/IconButton.d.ts +13 -0
  14. package/dist/components/Button/Ripple.d.ts +17 -0
  15. package/dist/components/Button/ToggleButton.d.ts +18 -0
  16. package/dist/components/Button/ToggleButtonGroup.d.ts +29 -0
  17. package/dist/components/Button/index.d.ts +11 -0
  18. package/dist/components/Card/Card.d.ts +2 -0
  19. package/dist/components/Card/Card.types.d.ts +6 -0
  20. package/dist/components/Card/index.d.ts +2 -0
  21. package/dist/components/Checkbox/Checkbox.d.ts +10 -0
  22. package/dist/components/Checkbox/index.d.ts +2 -0
  23. package/dist/components/Field/Field.d.ts +31 -0
  24. package/dist/components/Field/index.d.ts +2 -0
  25. package/dist/components/Input/Input.d.ts +2 -0
  26. package/dist/components/Input/Input.types.d.ts +18 -0
  27. package/dist/components/Input/index.d.ts +2 -0
  28. package/dist/components/Layout/Box.d.ts +19 -0
  29. package/dist/components/Layout/Container.d.ts +11 -0
  30. package/dist/components/Layout/Divider.d.ts +11 -0
  31. package/dist/components/Layout/Grid.d.ts +11 -0
  32. package/dist/components/Layout/Spacer.d.ts +4 -0
  33. package/dist/components/Layout/Stack.d.ts +12 -0
  34. package/dist/components/Layout/index.d.ts +13 -0
  35. package/dist/components/Layout/layout.types.d.ts +38 -0
  36. package/dist/components/MultiSelect/MultiSelect.d.ts +54 -0
  37. package/dist/components/MultiSelect/index.d.ts +2 -0
  38. package/dist/components/Navbar/Navbar.d.ts +6 -0
  39. package/dist/components/Navbar/Navbar.types.d.ts +19 -0
  40. package/dist/components/Navbar/index.d.ts +2 -0
  41. package/dist/components/Progress/Progress.d.ts +3 -0
  42. package/dist/components/Progress/Progress.types.d.ts +12 -0
  43. package/dist/components/Progress/index.d.ts +2 -0
  44. package/dist/components/Radio/Radio.d.ts +14 -0
  45. package/dist/components/Radio/index.d.ts +2 -0
  46. package/dist/components/Scroll/Scroll.d.ts +3 -0
  47. package/dist/components/Scroll/Scroll.types.d.ts +13 -0
  48. package/dist/components/Scroll/index.d.ts +2 -0
  49. package/dist/components/Select/Select.d.ts +51 -0
  50. package/dist/components/Select/index.d.ts +2 -0
  51. package/dist/components/Sidebar/Sidebar.d.ts +4 -0
  52. package/dist/components/Sidebar/Sidebar.types.d.ts +20 -0
  53. package/dist/components/Sidebar/index.d.ts +2 -0
  54. package/dist/components/Skeleton/Skeleton.d.ts +2 -0
  55. package/dist/components/Skeleton/Skeleton.types.d.ts +7 -0
  56. package/dist/components/Skeleton/index.d.ts +2 -0
  57. package/dist/components/Switch/Switch.d.ts +8 -0
  58. package/dist/components/Switch/index.d.ts +2 -0
  59. package/dist/components/Text/Text.d.ts +26 -0
  60. package/dist/components/Text/index.d.ts +2 -0
  61. package/dist/components/Textarea/Textarea.d.ts +13 -0
  62. package/dist/components/Textarea/index.d.ts +2 -0
  63. package/dist/index.cjs +119 -0
  64. package/dist/index.cjs.map +1 -0
  65. package/dist/index.d.ts +19 -0
  66. package/dist/index.js +11531 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/test/setup.d.ts +1 -0
  69. package/dist/utils/cx.d.ts +2 -0
  70. package/package.json +83 -0
@@ -0,0 +1,2 @@
1
+ export { Navbar, NavbarBrand, NavbarNav, NavbarItem, NavbarActions } from './Navbar';
2
+ export type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarItemProps, NavbarActionsProps, } from './Navbar.types';
@@ -0,0 +1,3 @@
1
+ import type { ProgressProps, ProgressRingProps } from './Progress.types';
2
+ export declare const Progress: import("react").ForwardRefExoticComponent<ProgressProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const ProgressRing: import("react").ForwardRefExoticComponent<ProgressRingProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export type ProgressColor = 'primary' | 'danger' | 'warning' | 'success' | 'info';
3
+ export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
4
+ value?: number;
5
+ color?: ProgressColor;
6
+ indeterminate?: boolean;
7
+ }
8
+ export interface ProgressRingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
9
+ value: number;
10
+ size?: 'md' | 'lg';
11
+ showLabel?: boolean;
12
+ }
@@ -0,0 +1,2 @@
1
+ export { Progress, ProgressRing } from './Progress';
2
+ export type { ProgressProps, ProgressRingProps, ProgressColor } from './Progress.types';
@@ -0,0 +1,14 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import * as RadixRadio from '@radix-ui/react-radio-group';
3
+ type RadioGroupProps = ComponentPropsWithoutRef<typeof RadixRadio.Root>;
4
+ type RadioItemProps = ComponentPropsWithoutRef<typeof RadixRadio.Item>;
5
+ export interface RadioGroupRootProps extends RadioGroupProps {
6
+ /** Stack direction. Default: `'column'`. */
7
+ orientation?: 'horizontal' | 'vertical';
8
+ }
9
+ export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupRootProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export interface RadioProps extends Omit<RadioItemProps, 'children'> {
11
+ children?: ReactNode;
12
+ }
13
+ export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLButtonElement>>;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Radio, RadioGroup } from './Radio';
2
+ export type { RadioProps, RadioGroupRootProps } from './Radio';
@@ -0,0 +1,3 @@
1
+ import type { ScrollProps } from './Scroll.types';
2
+ export declare const Scroll: import("react").ForwardRefExoticComponent<ScrollProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const ScrollRegion: import("react").ForwardRefExoticComponent<Omit<ScrollProps, "region"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export type ScrollVariant = 'default' | 'thin' | 'subtle' | 'overlay' | 'expand';
3
+ export type ScrollTone = 'neutral' | 'primary';
4
+ export type ScrollAxis = 'both' | 'x' | 'y';
5
+ export interface ScrollProps extends HTMLAttributes<HTMLDivElement> {
6
+ variant?: ScrollVariant;
7
+ tone?: ScrollTone;
8
+ axis?: ScrollAxis;
9
+ maxHeight?: number | string;
10
+ maxWidth?: number | string;
11
+ region?: boolean;
12
+ children: ReactNode;
13
+ }
@@ -0,0 +1,2 @@
1
+ export { Scroll, ScrollRegion } from './Scroll';
2
+ export type { ScrollProps, ScrollVariant, ScrollTone, ScrollAxis } from './Scroll.types';
@@ -0,0 +1,51 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import * as RadixSelect from '@radix-ui/react-select';
3
+ export type SelectColor = 'primary' | 'danger' | 'warning' | 'success';
4
+ export type SelectSize = 'sm' | 'md' | 'lg';
5
+ type SelectRootProps = ComponentPropsWithoutRef<typeof RadixSelect.Root>;
6
+ export interface SelectProps extends SelectRootProps {
7
+ /** Placeholder shown when nothing is selected. */
8
+ placeholder?: string;
9
+ /** Trigger size. */
10
+ size?: SelectSize;
11
+ /** Validation color on the trigger. */
12
+ color?: SelectColor;
13
+ /** Pre-label rendered next to the selected value (e.g. an icon). */
14
+ triggerIcon?: ReactNode;
15
+ /** Extra trigger className. */
16
+ triggerClassName?: string;
17
+ /** Extra content (dropdown panel) className. */
18
+ contentClassName?: string;
19
+ /** Omit `id` pass-through handled by Field. */
20
+ id?: string;
21
+ /** aria-invalid — Field threads this in for validation. */
22
+ 'aria-invalid'?: boolean;
23
+ /** aria-describedby — Field threads this in. */
24
+ 'aria-describedby'?: string;
25
+ /** Apply .danger/.warning/.success via Field's className thread. */
26
+ className?: string;
27
+ /** `<SelectItem>` / `<SelectGroup>` / `<SelectSeparator>` / `<SelectLabel>` children. */
28
+ children: ReactNode;
29
+ }
30
+ /**
31
+ * Select — single-select dropdown built on @radix-ui/react-select.
32
+ * Fully keyboard accessible, portalled, positioned intelligently.
33
+ *
34
+ * @example
35
+ * <Select placeholder="Environment" onValueChange={setEnv}>
36
+ * <SelectItem value="prod">Production</SelectItem>
37
+ * <SelectItem value="staging">Staging</SelectItem>
38
+ * </Select>
39
+ */
40
+ export declare function Select({ placeholder, size, color, triggerIcon, triggerClassName, contentClassName, id, className, disabled, children, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, ...rootProps }: SelectProps): import("react/jsx-runtime").JSX.Element;
41
+ export interface SelectItemProps extends ComponentPropsWithoutRef<typeof RadixSelect.Item> {
42
+ }
43
+ export declare const SelectItem: import("react").ForwardRefExoticComponent<SelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
44
+ export interface SelectGroupProps extends ComponentPropsWithoutRef<typeof RadixSelect.Group> {
45
+ }
46
+ export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
47
+ export interface SelectLabelProps extends ComponentPropsWithoutRef<typeof RadixSelect.Label> {
48
+ }
49
+ export declare const SelectLabel: import("react").ForwardRefExoticComponent<SelectLabelProps & import("react").RefAttributes<HTMLDivElement>>;
50
+ export declare const SelectSeparator: import("react").ForwardRefExoticComponent<Omit<RadixSelect.SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Select, SelectItem, SelectGroup, SelectLabel, SelectSeparator, } from './Select';
2
+ export type { SelectProps, SelectItemProps, SelectGroupProps, SelectLabelProps, SelectColor, SelectSize, } from './Select';
@@ -0,0 +1,4 @@
1
+ import type { SidebarProps, SidebarSectionProps, SidebarItemProps } from './Sidebar.types';
2
+ export declare const Sidebar: import("react").ForwardRefExoticComponent<SidebarProps & import("react").RefAttributes<HTMLElement>>;
3
+ export declare const SidebarSection: import("react").ForwardRefExoticComponent<SidebarSectionProps & import("react").RefAttributes<HTMLDivElement>>;
4
+ export declare const SidebarItem: import("react").ForwardRefExoticComponent<SidebarItemProps & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,20 @@
1
+ import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
+ export type SidebarWidth = 'thin' | 'default' | 'wide';
3
+ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
4
+ width?: SidebarWidth;
5
+ sticky?: boolean;
6
+ collapsed?: boolean;
7
+ responsive?: boolean;
8
+ children: ReactNode;
9
+ }
10
+ export interface SidebarSectionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
11
+ title?: ReactNode;
12
+ children: ReactNode;
13
+ }
14
+ export interface SidebarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
15
+ active?: boolean;
16
+ disabled?: boolean;
17
+ icon?: ReactNode;
18
+ badge?: ReactNode;
19
+ children: ReactNode;
20
+ }
@@ -0,0 +1,2 @@
1
+ export { Sidebar, SidebarSection, SidebarItem } from './Sidebar';
2
+ export type { SidebarProps, SidebarSectionProps, SidebarItemProps, SidebarWidth } from './Sidebar.types';
@@ -0,0 +1,2 @@
1
+ import type { SkeletonProps } from './Skeleton.types';
2
+ export declare const Skeleton: import("react").ForwardRefExoticComponent<SkeletonProps & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export type SkeletonShape = 'text' | 'title' | 'avatar' | 'button';
3
+ export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
4
+ shape?: SkeletonShape;
5
+ width?: number | string;
6
+ height?: number | string;
7
+ }
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from './Skeleton';
2
+ export type { SkeletonProps, SkeletonShape } from './Skeleton.types';
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import * as RadixSwitch from '@radix-ui/react-switch';
3
+ type SwitchRootProps = ComponentPropsWithoutRef<typeof RadixSwitch.Root>;
4
+ export interface SwitchProps extends Omit<SwitchRootProps, 'children'> {
5
+ children?: ReactNode;
6
+ }
7
+ export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Switch } from './Switch';
2
+ export type { SwitchProps } from './Switch';
@@ -0,0 +1,26 @@
1
+ import type { ComponentPropsWithoutRef, ElementType, ForwardedRef, ReactElement } from 'react';
2
+ export type TextVariant = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'lead' | 'body' | 'small' | 'caption' | 'code' | 'kbd';
3
+ export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
4
+ export type TextAlign = 'left' | 'center' | 'right' | 'justify';
5
+ export type TextColor = 'primary' | 'secondary' | 'muted' | 'accent' | 'danger' | 'warning' | 'success' | 'info';
6
+ export type TextProps<E extends ElementType = ElementType> = Omit<ComponentPropsWithoutRef<E>, 'color'> & {
7
+ as?: E;
8
+ variant?: TextVariant;
9
+ weight?: TextWeight;
10
+ align?: TextAlign;
11
+ color?: TextColor;
12
+ truncate?: boolean;
13
+ };
14
+ /**
15
+ * Text — typography primitive. `variant` picks the semantic element and the
16
+ * type scale in one prop. Override the rendered tag with `as` while keeping
17
+ * the style (e.g. `<Text variant="h1" as="div">`).
18
+ *
19
+ * @example
20
+ * <Text variant="h1">Page title</Text>
21
+ * <Text variant="body" color="muted">Subtle paragraph</Text>
22
+ * <Text variant="caption" truncate>Long caption…</Text>
23
+ */
24
+ export declare const Text: <E extends ElementType = ElementType>(props: TextProps<E> & {
25
+ ref?: ForwardedRef<Element>;
26
+ }) => ReactElement;
@@ -0,0 +1,2 @@
1
+ export { Text } from './Text';
2
+ export type { TextProps, TextVariant, TextWeight, TextAlign, TextColor } from './Text';
@@ -0,0 +1,13 @@
1
+ import type { TextareaHTMLAttributes } from 'react';
2
+ export type TextareaColor = 'primary' | 'danger' | 'warning' | 'success';
3
+ export type TextareaSize = 'sm' | 'md' | 'lg';
4
+ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
5
+ color?: TextareaColor;
6
+ size?: TextareaSize;
7
+ /** Grow the textarea with content. Max-height is capped via CSS / max-rows. */
8
+ autoGrow?: boolean;
9
+ /** With autoGrow, limits how tall the textarea can get. Default 12. */
10
+ maxRows?: number;
11
+ }
12
+ /** Auto-growing textarea. Measures scrollHeight on every change to set height. */
13
+ export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,2 @@
1
+ export { Textarea } from './Textarea';
2
+ export type { TextareaProps, TextareaColor, TextareaSize } from './Textarea';