@digo-labs/ui 0.1.17 → 0.1.18

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.
@@ -0,0 +1,35 @@
1
+ import { ClearToolbarItem, HistoryToolbarItems, Icon, RedoToolbarItem, Toolbar, ToolbarToggle, UndoToolbarItem, ZoomToolbarItem } from '..';
2
+ import { ComponentProps } from 'react';
3
+ import { DrawingTool } from '../providers/drawing-provider';
4
+ interface Properties extends ComponentProps<typeof Toolbar> {
5
+ minSize?: number;
6
+ maxSize?: number;
7
+ palette?: string[];
8
+ withCustomColor?: boolean;
9
+ }
10
+ export declare function DrawingToolbar(properties: Properties): import("react").JSX.Element;
11
+ interface DrawingToolbarToolProperties extends ComponentProps<typeof ToolbarToggle> {
12
+ tool: DrawingTool;
13
+ icon?: ComponentProps<typeof Icon>['icon'];
14
+ }
15
+ export declare function DrawingToolbarTool(properties: DrawingToolbarToolProperties): import("react").JSX.Element;
16
+ interface DrawingToolbarPenProperties {
17
+ minSize?: number;
18
+ maxSize?: number;
19
+ palette?: string[];
20
+ withCustomColor?: boolean;
21
+ className?: string;
22
+ }
23
+ export declare function DrawingToolbarPen(properties: DrawingToolbarPenProperties): import("react").JSX.Element;
24
+ interface DrawingToolbarEraserProperties {
25
+ minSize?: number;
26
+ maxSize?: number;
27
+ className?: string;
28
+ }
29
+ export declare function DrawingToolbarEraser(properties: DrawingToolbarEraserProperties): import("react").JSX.Element;
30
+ export declare function DrawingToolbarHistory(properties: ComponentProps<typeof HistoryToolbarItems>): import("react").JSX.Element;
31
+ export declare function DrawingToolbarUndo(properties: ComponentProps<typeof UndoToolbarItem>): import("react").JSX.Element;
32
+ export declare function DrawingToolbarRedo(properties: ComponentProps<typeof RedoToolbarItem>): import("react").JSX.Element;
33
+ export declare function DrawingToolbarClear(properties: ComponentProps<typeof ClearToolbarItem>): import("react").JSX.Element;
34
+ export declare function DrawingToolbarZoom(properties: ComponentProps<typeof ZoomToolbarItem>): import("react").JSX.Element;
35
+ export {};
@@ -0,0 +1,78 @@
1
+ import { ToolbarButton, ToolbarGroup } from '..';
2
+ import { ComponentProps } from 'react';
3
+ import { DrawingEraserMode } from '../providers/drawing-provider';
4
+ import { ComponentStylesProps } from '../utils/styles';
5
+ export declare const DEFAULT_TOOLBAR_MIN_SIZE = 2;
6
+ export declare const DEFAULT_TOOLBAR_MAX_SIZE = 24;
7
+ export declare const DEFAULT_TOOLBAR_COLORS: string[];
8
+ type ToolbarSizeIconProperties = ToolbarSizeIconRootProperties & ComponentStylesProps<'toolbarItems'>;
9
+ export declare function ToolbarSizeIcon(properties: ToolbarSizeIconProperties): import("react").JSX.Element;
10
+ interface ToolbarSizeIconRootProperties {
11
+ size?: number;
12
+ min?: number;
13
+ max?: number;
14
+ className?: string;
15
+ }
16
+ type ToolbarSizesProperties = ToolbarSizesRootProperties & ComponentStylesProps<'toolbarItems'>;
17
+ export declare function ToolbarSizes(properties: ToolbarSizesProperties): import("react").JSX.Element;
18
+ interface ToolbarSizesRootProperties {
19
+ value?: number;
20
+ onValueChange?: (size: number) => void;
21
+ min?: number;
22
+ max?: number;
23
+ disabled?: boolean;
24
+ className?: string;
25
+ }
26
+ type ToolbarColorsProperties = ToolbarColorsRootProperties & ComponentStylesProps<'toolbarItems'>;
27
+ export declare function ToolbarColors(properties: ToolbarColorsProperties): import("react").JSX.Element;
28
+ interface ToolbarColorsRootProperties {
29
+ colors?: string[];
30
+ value?: string;
31
+ onValueChange?: (color: string) => void;
32
+ withCustom?: boolean;
33
+ className?: string;
34
+ }
35
+ type PenToolbarItemProperties = PenToolbarItemRootProperties & ComponentStylesProps<'toolbarItems'>;
36
+ export declare function PenToolbarItem(properties: PenToolbarItemProperties): import("react").JSX.Element;
37
+ interface PenToolbarItemRootProperties {
38
+ pressed?: boolean;
39
+ onPressedChange?: (pressed: boolean) => void;
40
+ color?: string;
41
+ onColorChange?: (color: string) => void;
42
+ size?: number;
43
+ onSizeChange?: (size: number) => void;
44
+ minSize?: number;
45
+ maxSize?: number;
46
+ palette?: string[];
47
+ withCustomColor?: boolean;
48
+ classNames?: ComponentStylesProps<'toolbarItems'>['classNames'];
49
+ className?: string;
50
+ }
51
+ type EraserToolbarItemProperties = EraserToolbarItemRootProperties & ComponentStylesProps<'toolbarItems'>;
52
+ export declare function EraserToolbarItem(properties: EraserToolbarItemProperties): import("react").JSX.Element;
53
+ interface EraserToolbarItemRootProperties {
54
+ pressed?: boolean;
55
+ onPressedChange?: (pressed: boolean) => void;
56
+ size?: number;
57
+ onSizeChange?: (size: number) => void;
58
+ minSize?: number;
59
+ maxSize?: number;
60
+ mode?: DrawingEraserMode;
61
+ onModeChange?: (mode: DrawingEraserMode) => void;
62
+ classNames?: ComponentStylesProps<'toolbarItems'>['classNames'];
63
+ className?: string;
64
+ }
65
+ type ZoomToolbarItemProperties = ZoomToolbarItemRootProperties & ComponentStylesProps<'toolbarItems'>;
66
+ export declare function ZoomToolbarItem(properties: ZoomToolbarItemProperties): import("react").JSX.Element;
67
+ interface ZoomToolbarItemRootProperties {
68
+ zoom?: number;
69
+ onZoomIn?: () => void;
70
+ onZoomOut?: () => void;
71
+ onFit?: () => void;
72
+ className?: string;
73
+ }
74
+ export declare function UndoToolbarItem(properties: ComponentProps<typeof ToolbarButton>): import("react").JSX.Element;
75
+ export declare function RedoToolbarItem(properties: ComponentProps<typeof ToolbarButton>): import("react").JSX.Element;
76
+ export declare function ClearToolbarItem(properties: ComponentProps<typeof ToolbarButton>): import("react").JSX.Element;
77
+ export declare function HistoryToolbarItems(properties: ComponentProps<typeof ToolbarGroup>): import("react").JSX.Element;
78
+ export {};
@@ -0,0 +1,39 @@
1
+ import { Orientation } from '@digo-labs/common';
2
+ import { ComponentProps } from 'react';
3
+ import { Transition } from 'motion/react';
4
+ import { CarouselCurve } from '../utils/carousel-helpers';
5
+ import { ComponentStylesProps } from '../utils/styles';
6
+ export type { CarouselCurve } from '../utils/carousel-helpers';
7
+ export declare function carouselCurve(distance: number): number;
8
+ interface ContextProperties {
9
+ value: string | undefined;
10
+ count: number;
11
+ activeIndex: number;
12
+ expandedSize: number;
13
+ orientation: Orientation;
14
+ goTo: (index: number) => void;
15
+ step: (direction: number) => void;
16
+ }
17
+ export declare function useCarousel(): ContextProperties;
18
+ interface ItemContextProperties {
19
+ value: string;
20
+ active: boolean;
21
+ }
22
+ export declare function useCarouselItem(): ItemContextProperties;
23
+ type Properties = RootProperties & ComponentStylesProps<'carousel'>;
24
+ export declare function Carousel(properties: Properties): import("react").JSX.Element;
25
+ interface RootProperties extends ComponentProps<'div'> {
26
+ value?: string;
27
+ defaultValue?: string;
28
+ onValueChange?: (value: string) => void;
29
+ items?: number;
30
+ expanded?: number;
31
+ gap?: number;
32
+ curve?: CarouselCurve;
33
+ transition?: Transition;
34
+ orientation?: Orientation;
35
+ }
36
+ interface ItemProperties extends ComponentProps<'div'> {
37
+ value: string;
38
+ }
39
+ export declare function CarouselItem(properties: ItemProperties): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from 'react';
2
+ import { ComponentStylesProps } from '../utils/styles';
3
+ export type DrawingCanvasInputs = 'auto' | 'all' | 'pen';
4
+ type Properties = RootProperties & ComponentStylesProps<'drawingCanvas'>;
5
+ export declare function DrawingCanvas(properties: Properties): import("react").JSX.Element;
6
+ interface RootProperties extends ComponentProps<'div'> {
7
+ inputs?: DrawingCanvasInputs;
8
+ }
9
+ export {};
@@ -0,0 +1,41 @@
1
+ import { Icon, Slider, Tabs, Toggle } from '..';
2
+ import { ComponentProps } from 'react';
3
+ import { PopoverPopup, PopoverTrigger } from './popover';
4
+ import { Toolbar as ToolbarPrimitive } from '@base-ui/react/toolbar';
5
+ import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
6
+ import { ComponentStylesProps } from '../utils/styles';
7
+ type Properties = RootProperties & ComponentStylesProps<'toolbar'>;
8
+ export declare function Toolbar(properties: Properties): import("react").JSX.Element;
9
+ type RootProperties = ToolbarPrimitive.Root.Props;
10
+ export declare function ToolbarGroup(properties: ToolbarPrimitive.Group.Props): import("react").JSX.Element;
11
+ interface ToolbarButtonProperties extends ToolbarPrimitive.Button.Props {
12
+ tooltip?: string;
13
+ }
14
+ export declare function ToolbarButton(properties: ToolbarButtonProperties): import("react").JSX.Element;
15
+ interface ToolbarToggleProperties extends ComponentProps<typeof Toggle> {
16
+ tooltip?: string;
17
+ }
18
+ export declare function ToolbarToggle(properties: ToolbarToggleProperties): import("react").JSX.Element;
19
+ export declare function ToolbarToggleGroup(properties: ToggleGroupPrimitive.Props): import("react").JSX.Element;
20
+ export interface ToolbarTab {
21
+ value: string;
22
+ icon: ComponentProps<typeof Icon>['icon'];
23
+ tooltip?: string;
24
+ }
25
+ interface ToolbarTabsProperties extends Omit<ComponentProps<typeof Tabs>, 'children'> {
26
+ tabs: ToolbarTab[];
27
+ }
28
+ export declare function ToolbarTabs(properties: ToolbarTabsProperties): import("react").JSX.Element;
29
+ export declare function ToolbarArtToggle(properties: ToolbarToggleProperties): import("react").JSX.Element;
30
+ export declare function ToolbarIcon(properties: ComponentProps<typeof Icon>): import("react").JSX.Element;
31
+ export declare function ToolbarSlider(properties: ComponentProps<typeof Slider>): import("react").JSX.Element;
32
+ export declare function ToolbarSeparator(properties: ToolbarPrimitive.Separator.Props): import("react").JSX.Element;
33
+ export declare const ToolbarMenu: typeof import('@base-ui/react').PopoverRoot;
34
+ export declare function ToolbarMenuTrigger(properties: ComponentProps<typeof PopoverTrigger>): import("react").JSX.Element;
35
+ interface ToolbarMenuPopupProperties extends ComponentProps<typeof Toolbar> {
36
+ side?: ComponentProps<typeof PopoverPopup>['side'];
37
+ align?: ComponentProps<typeof PopoverPopup>['align'];
38
+ sideOffset?: ComponentProps<typeof PopoverPopup>['sideOffset'];
39
+ }
40
+ export declare function ToolbarMenuPopup(properties: ToolbarMenuPopupProperties): import("react").JSX.Element;
41
+ export {};
@@ -0,0 +1,47 @@
1
+ import { AwsColor } from '@digo-labs/common';
2
+ import { CSSProperties, ReactNode } from 'react';
3
+ import { Transition } from 'motion/react';
4
+ import { BrickOrigin } from './brick';
5
+ import { ComponentStylesProps } from '../utils/styles';
6
+ export type BrickGridMode = 'noise' | 'cluster' | 'image' | 'path' | 'loading';
7
+ export type BrickGridLines = 'lines' | 'none';
8
+ export type BrickGridDistribution = 'edges' | 'fill';
9
+ export type BrickGridWave = 'clockwise' | 'counterclockwise' | 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top';
10
+ type Properties = RootProperties & ComponentStylesProps<'brickGrid'>;
11
+ export declare function BrickGrid(properties: Properties): import("react").JSX.Element;
12
+ interface RootProperties {
13
+ mode?: BrickGridMode;
14
+ cellSize?: number;
15
+ gap?: number;
16
+ colors?: AwsColor[];
17
+ density?: number;
18
+ tempo?: number;
19
+ seed?: number;
20
+ interval?: number;
21
+ maxSize?: number;
22
+ src?: string;
23
+ imageOpacity?: number;
24
+ threshold?: number;
25
+ path?: string;
26
+ filled?: boolean;
27
+ loadingSize?: number;
28
+ wave?: BrickGridWave;
29
+ distribution?: BrickGridDistribution;
30
+ grid?: BrickGridLines;
31
+ transition?: Transition;
32
+ className?: string;
33
+ style?: CSSProperties;
34
+ children?: ReactNode;
35
+ }
36
+ interface ItemProperties {
37
+ colSpan?: number;
38
+ rowSpan?: number;
39
+ colStart?: number;
40
+ rowStart?: number;
41
+ origin?: BrickOrigin;
42
+ className?: string;
43
+ style?: CSSProperties;
44
+ children?: ReactNode;
45
+ }
46
+ export declare function BrickGridItem(properties: ItemProperties): import("react").JSX.Element;
47
+ export {};
@@ -0,0 +1,28 @@
1
+ import { AwsColor, AwsGlyph } from '@digo-labs/common';
2
+ import { CSSProperties } from 'react';
3
+ import { Transition } from 'motion/react';
4
+ import { ComponentStylesProps } from '../utils/styles';
5
+ export type BrickAnimation = 'none' | 'pulse' | 'rotate';
6
+ export type BrickOrigin = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
7
+ export declare const brickOriginClasses: {
8
+ 'top-left': string;
9
+ 'top-right': string;
10
+ 'bottom-left': string;
11
+ 'bottom-right': string;
12
+ };
13
+ type Properties = RootProperties & ComponentStylesProps<'brick'>;
14
+ export declare function Brick(properties: Properties): import("react").JSX.Element;
15
+ interface RootProperties {
16
+ glyph: AwsGlyph;
17
+ size?: number;
18
+ color?: AwsColor;
19
+ glyphColor?: AwsColor;
20
+ origin?: BrickOrigin;
21
+ animation?: BrickAnimation;
22
+ interval?: number;
23
+ delay?: number;
24
+ transition?: Transition;
25
+ className?: string;
26
+ style?: CSSProperties;
27
+ }
28
+ export {};
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './blocks/card';
6
6
  export * from './blocks/chat-thread';
7
7
  export * from './blocks/command-button';
8
8
  export * from './blocks/copy-paste-button';
9
+ export * from './blocks/drawing-toolbar';
9
10
  export * from './blocks/dropzone';
10
11
  export * from './blocks/font-picker';
11
12
  export * from './blocks/gate';
@@ -38,6 +39,7 @@ export * from './blocks/prompt-input';
38
39
  export * from './blocks/google-signin-button';
39
40
  export * from './blocks/switch-theme';
40
41
  export * from './blocks/toggle-theme';
42
+ export * from './blocks/toolbar-items';
41
43
  export * from './blocks/transparent-background';
42
44
  export * from './blocks/user-avatar';
43
45
  export * from './blocks/user-info';
@@ -51,6 +53,7 @@ export * from './components/badge';
51
53
  export * from './components/breadcrumb';
52
54
  export * from './components/bubble';
53
55
  export * from './components/button';
56
+ export * from './components/carousel';
54
57
  export * from './components/chart';
55
58
  export * from './components/checkbox';
56
59
  export * from './components/circular-progress';
@@ -67,6 +70,7 @@ export * from './components/combobox';
67
70
  export * from './components/command';
68
71
  export * from './effects/counter';
69
72
  export * from './components/drawer';
73
+ export * from './components/drawing-canvas';
70
74
  export * from './components/empty';
71
75
  export * from './components/field';
72
76
  export * from './components/field-set';
@@ -107,6 +111,7 @@ export * from './components/loader';
107
111
  export * from './components/tabs';
108
112
  export * from './components/toggle';
109
113
  export * from './components/toggle-group';
114
+ export * from './components/toolbar';
110
115
  export * from './components/table-of-contents';
111
116
  export * from './components/text-area';
112
117
  export * from './components/tint-image';
@@ -116,6 +121,8 @@ export * from './cursors/cursor-container';
116
121
  export * from './cursors/cursor-clipping';
117
122
  export * from './cursors/cursor-bracket';
118
123
  export * from './effects/border-glow';
124
+ export * from './effects/brick';
125
+ export * from './effects/brick-grid';
119
126
  export * from './effects/crt-screen';
120
127
  export * from './effects/dark-veil';
121
128
  export * from './effects/dissolve-overlay';
@@ -156,6 +163,7 @@ export * from './pages/loading-page';
156
163
  export * from './pages/login-page';
157
164
  export * from './providers/command-provider';
158
165
  export * from './providers/design-system-provider';
166
+ export * from './providers/drawing-provider';
159
167
  export * from './providers/portal-provider';
160
168
  export * as baseStyles from './styles';
161
169
  export * from './presets';