@apple-pie/slice 0.0.0 → 0.0.1
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/dist/index.esm.js +1459 -431
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1468 -430
- package/dist/index.js.map +1 -1
- package/dist/types/hooks/index.d.ts +9 -2
- package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +1 -0
- package/dist/types/hooks/useKeyboardShortcuts/useKeyboardShortcuts.d.ts +6 -0
- package/dist/types/hooks/useLastUpdated/useLastUpdated.d.ts +4 -0
- package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -0
- package/dist/types/hooks/{useObserveResize.d.ts → useObserveResize/useObserveResize.d.ts} +1 -1
- package/dist/types/hooks/useObserveTheme/useObserveTheme.d.ts +2 -0
- package/dist/types/hooks/useTheme/useTheme.d.ts +47 -0
- package/dist/types/hooks/useToolTip/useToolTip.d.ts +6 -0
- package/dist/types/hooks/useWindow/useWindow.d.ts +15 -0
- package/dist/types/index.d.ts +9 -4
- package/dist/types/providers/ThemeProvider.d.ts +1 -0
- package/dist/types/theme/colors/colors.d.ts +2 -0
- package/dist/types/theme/colors/types.d.ts +14 -0
- package/dist/types/theme/components/BrandColors.d.ts +1 -0
- package/dist/types/theme/components/ColorTile.d.ts +6 -0
- package/dist/types/theme/components/ColorTileGroup.d.ts +6 -0
- package/dist/types/theme/components/ThemeColors.d.ts +2 -0
- package/dist/types/theme/components/_types.d.ts +15 -0
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/themes.d.ts +3 -3
- package/dist/types/theme/type/type.d.ts +3 -0
- package/dist/types/uikit/Avatar/_types.d.ts +3 -2
- package/dist/types/uikit/AvatarGroup/_types.d.ts +4 -2
- package/dist/types/uikit/Badge/_types.d.ts +5 -2
- package/dist/types/uikit/CheckBox/_types.d.ts +5 -2
- package/dist/types/uikit/DivInput/_types.d.ts +4 -2
- package/dist/types/uikit/DocIcon/_types.d.ts +5 -2
- package/dist/types/uikit/Dot/_types.d.ts +6 -2
- package/dist/types/uikit/DraggablePanel/DrggablePanel.d.ts +3 -2
- package/dist/types/uikit/DropDown/DropDown.d.ts +2 -1
- package/dist/types/uikit/DropDown/_types.d.ts +5 -2
- package/dist/types/uikit/EditorButtonBar/_types.d.ts +4 -2
- package/dist/types/uikit/ErrorSummary/ErrorSummary.d.ts +2 -1
- package/dist/types/uikit/ErrorSummary/_types.d.ts +5 -2
- package/dist/types/uikit/FlexDiv/FlexDiv.d.ts +57 -2
- package/dist/types/uikit/FlexDiv/_types.d.ts +7 -2
- package/dist/types/uikit/Grouper/_types.d.ts +6 -2
- package/dist/types/uikit/Icon/_types.d.ts +7 -2
- package/dist/types/uikit/Icon/iconRegistry.d.ts +1 -0
- package/dist/types/uikit/IconButton/_types.d.ts +4 -2
- package/dist/types/uikit/Logos/_types.d.ts +8 -4
- package/dist/types/uikit/MessageInput/InputField/_types.d.ts +5 -2
- package/dist/types/uikit/Overlay/_types.d.ts +5 -2
- package/dist/types/uikit/Pager/_types.d.ts +5 -2
- package/dist/types/uikit/Progress/DoneCheck/_types.d.ts +5 -2
- package/dist/types/uikit/Progress/ProgressIndicator/_types.d.ts +5 -2
- package/dist/types/uikit/RadioButton/_types.d.ts +5 -2
- package/dist/types/uikit/RadioButtonList/_types.d.ts +5 -2
- package/dist/types/uikit/Slider/_types.d.ts +5 -2
- package/dist/types/uikit/Spacer/_types.d.ts +5 -2
- package/dist/types/uikit/Switch/Switch.d.ts +1 -1
- package/dist/types/uikit/Switch/_types.d.ts +5 -4
- package/dist/types/uikit/TabBar/_types.d.ts +5 -2
- package/dist/types/uikit/TextArea/_types.d.ts +5 -2
- package/dist/types/uikit/Textfield/_types.d.ts +4 -2
- package/dist/types/uikit/Tip/Tip.d.ts +3 -0
- package/dist/types/uikit/Tip/_types.d.ts +28 -0
- package/dist/types/uikit/Tip/index.d.ts +2 -0
- package/dist/types/uikit/Toast/Toast.d.ts +3 -0
- package/dist/types/uikit/Toast/_types.d.ts +18 -0
- package/dist/types/uikit/Toast/index.d.ts +2 -0
- package/dist/types/uikit/UIButton/UIButton.d.ts +73 -2
- package/dist/types/uikit/UIButton/_types.d.ts +4 -2
- package/dist/types/uikit/UIButtonBar/_types.d.ts +5 -2
- package/dist/types/uikit/UICard/_types.d.ts +5 -2
- package/dist/types/uikit/UIChip/_types.d.ts +4 -2
- package/dist/types/uikit/UIFileIcon/UIFileIcon.d.ts +1 -1
- package/dist/types/uikit/UIFileIcon/_types.d.ts +4 -2
- package/dist/types/uikit/UILabel/_types.d.ts +4 -2
- package/dist/types/util/utils.d.ts +12 -0
- package/package.json +2 -1
- package/dist/colors.css +0 -237
- package/dist/type.css +0 -16
- package/dist/types/hooks/useMayaTheme.d.ts +0 -7
- package/dist/types/hooks/useTheme.d.ts +0 -2
- package/dist/types/uikit/Avatar/AvatarInline.stories.d.ts +0 -7
- /package/dist/{flexBox.module.css → css/flexBox.module.css} +0 -0
- /package/dist/{type.module.css → css/type.module.css} +0 -0
- /package/dist/types/hooks/{useTrackRenders.d.ts → useTrackRenders/useTrackRenders.d.ts} +0 -0
|
@@ -3,7 +3,7 @@ import type { ToolTip } from '../../sharedTypes';
|
|
|
3
3
|
import type { DocExcerpt } from '../ExcerptList/_types';
|
|
4
4
|
import type { UserPresence } from '../UserList/_types';
|
|
5
5
|
import type { JurisdictionFocus, SendMessage } from '../_types';
|
|
6
|
-
|
|
6
|
+
type MessageInputBaseProps = {
|
|
7
7
|
maxHeight?: number;
|
|
8
8
|
focused?: boolean;
|
|
9
9
|
height?: string;
|
|
@@ -23,6 +23,7 @@ export interface MessageInputProps {
|
|
|
23
23
|
presenceID?: string;
|
|
24
24
|
jurisdiction?: JurisdictionFocus | null;
|
|
25
25
|
jurisdictionClick?: () => void;
|
|
26
|
+
complianceCheckClick?: () => void;
|
|
26
27
|
attachClick?: (e: React.MouseEvent<any> | undefined) => void;
|
|
27
28
|
onChangeFiles?: (files: File[]) => void;
|
|
28
29
|
onChangeExcerpts?: (excerpts: DocExcerpt[]) => void;
|
|
@@ -33,4 +34,6 @@ export interface MessageInputProps {
|
|
|
33
34
|
onFocus?: () => void;
|
|
34
35
|
onSend?: (message: SendMessage) => void;
|
|
35
36
|
onStop?: () => void;
|
|
36
|
-
}
|
|
37
|
+
};
|
|
38
|
+
export type MessageInputProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof MessageInputBaseProps> & MessageInputBaseProps;
|
|
39
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type OverlayBaseProps = {
|
|
2
3
|
opacity?: number;
|
|
3
4
|
color?: string;
|
|
4
5
|
type?: 'clear' | 'dark';
|
|
@@ -6,4 +7,6 @@ export interface OverlayProps {
|
|
|
6
7
|
overlay?: any;
|
|
7
8
|
onClick?: () => void;
|
|
8
9
|
toggleOverlay?: (state: boolean) => void;
|
|
9
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export type OverlayProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof OverlayBaseProps> & OverlayBaseProps;
|
|
12
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type PagerBaseProps = {
|
|
2
3
|
size?: number;
|
|
3
4
|
index?: number;
|
|
4
5
|
color?: string;
|
|
@@ -7,4 +8,6 @@ export interface PagerProps {
|
|
|
7
8
|
pages?: number;
|
|
8
9
|
gap?: number;
|
|
9
10
|
onChange?: (index: number) => void;
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export type PagerProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof PagerBaseProps> & PagerBaseProps;
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type DoneCheckBaseProps = {
|
|
2
3
|
size?: number;
|
|
3
4
|
color?: string;
|
|
4
5
|
stroke?: number;
|
|
@@ -8,4 +9,6 @@ export interface DoneCheckProps {
|
|
|
8
9
|
play?: boolean;
|
|
9
10
|
didStart?: () => void;
|
|
10
11
|
didEnd?: () => void;
|
|
11
|
-
}
|
|
12
|
+
};
|
|
13
|
+
export type DoneCheckProps = Omit<React.SVGAttributes<SVGSVGElement>, keyof DoneCheckBaseProps> & DoneCheckBaseProps;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type ProgressIndicatorBaseProps = {
|
|
2
3
|
size?: number;
|
|
3
4
|
secondsPerSpin?: number;
|
|
4
5
|
show?: boolean;
|
|
@@ -8,4 +9,6 @@ export interface ProgressIndicatorProps {
|
|
|
8
9
|
inline?: boolean;
|
|
9
10
|
didStart?: () => void;
|
|
10
11
|
didStop?: () => void;
|
|
11
|
-
}
|
|
12
|
+
};
|
|
13
|
+
export type ProgressIndicatorProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof ProgressIndicatorBaseProps> & ProgressIndicatorBaseProps;
|
|
14
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
export type RadioButtonOption = {
|
|
2
3
|
fieldName?: string;
|
|
3
4
|
title?: string;
|
|
@@ -5,7 +6,7 @@ export type RadioButtonOption = {
|
|
|
5
6
|
state?: boolean;
|
|
6
7
|
icon?: string;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type RadioButtonBaseProps = {
|
|
9
10
|
selected?: boolean;
|
|
10
11
|
option: RadioButtonOption;
|
|
11
12
|
deselect?: boolean;
|
|
@@ -17,4 +18,6 @@ export interface RadioButtonProps {
|
|
|
17
18
|
iconColor?: string;
|
|
18
19
|
noFrame?: boolean;
|
|
19
20
|
onChange?: (option: RadioButtonOption, state: boolean) => void;
|
|
20
|
-
}
|
|
21
|
+
};
|
|
22
|
+
export type RadioButtonProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof RadioButtonBaseProps> & RadioButtonBaseProps;
|
|
23
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { RadioButtonOption } from '../RadioButton/_types';
|
|
2
|
-
|
|
3
|
+
type RadioButtonListBaseProps = {
|
|
3
4
|
options?: RadioButtonOption[];
|
|
4
5
|
selectedIndexes?: number[] | null;
|
|
5
6
|
selectedOptions?: string[] | null;
|
|
@@ -17,4 +18,6 @@ export interface RadioButtonListProps {
|
|
|
17
18
|
iconSelectedColor?: string;
|
|
18
19
|
noFrame?: boolean;
|
|
19
20
|
onChange?: (options: RadioButtonOption[] | null, indexes: number[] | null) => void;
|
|
20
|
-
}
|
|
21
|
+
};
|
|
22
|
+
export type RadioButtonListProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof RadioButtonListBaseProps> & RadioButtonListBaseProps;
|
|
23
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type SliderBaseProps = {
|
|
2
3
|
value?: number;
|
|
3
4
|
scaleMin?: number;
|
|
4
5
|
scaleMax?: number;
|
|
@@ -14,4 +15,6 @@ export interface SliderProps {
|
|
|
14
15
|
cursor?: 'default' | 'grab' | 'grabbing' | 'pointer';
|
|
15
16
|
onChange?: (value: number, percent: number) => void;
|
|
16
17
|
onDragChange?: (value: number, percent: number) => void;
|
|
17
|
-
}
|
|
18
|
+
};
|
|
19
|
+
export type SliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof SliderBaseProps> & SliderBaseProps;
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type SwitchBaseProps = {
|
|
3
3
|
state?: boolean;
|
|
4
4
|
height?: number;
|
|
5
5
|
width?: number;
|
|
@@ -8,5 +8,6 @@ export interface SwitchProps {
|
|
|
8
8
|
knobColor?: string;
|
|
9
9
|
padding?: number;
|
|
10
10
|
onChange?: (state: boolean) => void;
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
};
|
|
12
|
+
export type SwitchProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof SwitchBaseProps> & SwitchBaseProps;
|
|
13
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { ToolTip } from '../sharedTypes';
|
|
2
3
|
export type TabOption = {
|
|
3
4
|
name?: string;
|
|
@@ -8,7 +9,7 @@ export type TabOption = {
|
|
|
8
9
|
component?: any;
|
|
9
10
|
};
|
|
10
11
|
export declare const placeholderOptions: TabOption[];
|
|
11
|
-
|
|
12
|
+
type TabBarBaseProps = {
|
|
12
13
|
options?: TabOption[];
|
|
13
14
|
selected?: number;
|
|
14
15
|
underline?: boolean;
|
|
@@ -28,7 +29,8 @@ export interface TabBarProps {
|
|
|
28
29
|
onChange?: (index: number) => void;
|
|
29
30
|
onTabChange?: (option: TabOption) => void;
|
|
30
31
|
onClose?: () => void;
|
|
31
|
-
}
|
|
32
|
+
};
|
|
33
|
+
export type TabBarProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof TabBarBaseProps> & TabBarBaseProps;
|
|
32
34
|
export interface TabOptionProps {
|
|
33
35
|
label?: string;
|
|
34
36
|
value?: number;
|
|
@@ -45,3 +47,4 @@ export interface TabOptionProps {
|
|
|
45
47
|
onClick?: (value: number) => void;
|
|
46
48
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
47
49
|
}
|
|
50
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
|
|
2
|
+
type TextAreaBaseProps = {
|
|
3
3
|
value?: string;
|
|
4
4
|
name?: string;
|
|
5
5
|
width?: number | string;
|
|
6
|
+
height?: number | string;
|
|
6
7
|
minWidth?: number | string;
|
|
7
8
|
rows?: number;
|
|
8
9
|
focused?: boolean;
|
|
@@ -29,10 +30,12 @@ export interface TextAreaProps {
|
|
|
29
30
|
onBlur?: () => void;
|
|
30
31
|
onValidate?: (state: boolean) => void;
|
|
31
32
|
onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
32
|
-
}
|
|
33
|
+
};
|
|
34
|
+
export type TextAreaProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof TextAreaBaseProps> & TextAreaBaseProps;
|
|
33
35
|
export type Tip = {
|
|
34
36
|
icon?: string;
|
|
35
37
|
iconRight?: boolean;
|
|
36
38
|
key: string;
|
|
37
39
|
label?: string;
|
|
38
40
|
};
|
|
41
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Transition } from 'motion/react';
|
|
2
2
|
import type React from 'react';
|
|
3
|
-
|
|
3
|
+
type TextFieldBaseProps = {
|
|
4
4
|
value?: string;
|
|
5
5
|
name?: string;
|
|
6
6
|
label?: string;
|
|
@@ -60,7 +60,8 @@ export interface TextFieldProps {
|
|
|
60
60
|
borderType?: 'box' | 'underline' | 'none';
|
|
61
61
|
inputType?: 'text' | 'password';
|
|
62
62
|
noShow?: boolean;
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
|
+
export type TextFieldProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof TextFieldBaseProps> & TextFieldBaseProps;
|
|
64
65
|
export declare const MOTION_CONFIG: {
|
|
65
66
|
variants: {
|
|
66
67
|
initial: {
|
|
@@ -75,3 +76,4 @@ export declare const MOTION_CONFIG: {
|
|
|
75
76
|
};
|
|
76
77
|
transition: Transition;
|
|
77
78
|
};
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
import type { ToolTip } from '../sharedTypes';
|
|
3
|
+
export declare const tipBasePos: {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
};
|
|
7
|
+
export type PosCoords = {
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
};
|
|
11
|
+
type ToolTipBaseProps = {
|
|
12
|
+
tip?: ToolTip | null;
|
|
13
|
+
size?: 's' | 'm' | 'l';
|
|
14
|
+
bgColor?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
border?: boolean;
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
padding?: number | string;
|
|
19
|
+
radius?: number;
|
|
20
|
+
coords?: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
showDelay?: number;
|
|
25
|
+
hideDelay?: number;
|
|
26
|
+
};
|
|
27
|
+
export type ToolTipProps = Omit<HTMLMotionProps<'div'>, keyof ToolTipBaseProps> & ToolTipBaseProps;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
type ToastBaseProps = {
|
|
3
|
+
message?: string | null;
|
|
4
|
+
size?: 's' | 'm' | 'l';
|
|
5
|
+
border?: boolean;
|
|
6
|
+
padding?: number | string;
|
|
7
|
+
radius?: number | string;
|
|
8
|
+
position?: 'top' | 'bottom';
|
|
9
|
+
offset?: number;
|
|
10
|
+
showDelay?: number;
|
|
11
|
+
duration?: number;
|
|
12
|
+
close?: boolean;
|
|
13
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
14
|
+
didHide?: () => void;
|
|
15
|
+
};
|
|
16
|
+
type ReservedToastEvents = 'onMouseEnter' | 'onMouseLeave' | 'onFocus' | 'onBlur';
|
|
17
|
+
export type ToastProps = Omit<HTMLMotionProps<'div'>, keyof ToastBaseProps | ReservedToastEvents> & ToastBaseProps;
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,74 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ToolTip } from '../sharedTypes';
|
|
3
|
+
import type { UIButtonHandle } from './_types';
|
|
4
|
+
export declare const UIButton: React.NamedExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, keyof {
|
|
5
|
+
size?: "large" | "medium" | "text";
|
|
6
|
+
variant?: "solid" | "outline" | "text";
|
|
7
|
+
state?: "normal" | "hover" | "disabled";
|
|
8
|
+
width?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
iconRight?: string;
|
|
11
|
+
iconLeft?: string;
|
|
12
|
+
fill?: boolean;
|
|
13
|
+
count?: number;
|
|
14
|
+
showDot?: boolean;
|
|
15
|
+
round?: boolean;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
iconSize?: number;
|
|
18
|
+
borderRadius?: number;
|
|
19
|
+
iconColor?: string;
|
|
20
|
+
bgColor?: string;
|
|
21
|
+
bgColorDisabled?: string;
|
|
22
|
+
labelColor?: string;
|
|
23
|
+
labelSize?: "s" | "m" | "l";
|
|
24
|
+
transition?: import("framer-motion").Transition;
|
|
25
|
+
variants?: import("framer-motion").Variants;
|
|
26
|
+
initial?: string;
|
|
27
|
+
animate?: string;
|
|
28
|
+
exit?: string;
|
|
29
|
+
underline?: boolean;
|
|
30
|
+
progress?: boolean;
|
|
31
|
+
working?: boolean;
|
|
32
|
+
duration?: number;
|
|
33
|
+
trigger?: boolean;
|
|
34
|
+
destructive?: boolean;
|
|
35
|
+
paddingRight?: number;
|
|
36
|
+
paddingLeft?: number;
|
|
37
|
+
onToolTip?: (tip: ToolTip | null) => void;
|
|
38
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => void;
|
|
39
|
+
}> & {
|
|
40
|
+
size?: "large" | "medium" | "text";
|
|
41
|
+
variant?: "solid" | "outline" | "text";
|
|
42
|
+
state?: "normal" | "hover" | "disabled";
|
|
43
|
+
width?: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
iconRight?: string;
|
|
46
|
+
iconLeft?: string;
|
|
47
|
+
fill?: boolean;
|
|
48
|
+
count?: number;
|
|
49
|
+
showDot?: boolean;
|
|
50
|
+
round?: boolean;
|
|
51
|
+
tooltip?: string;
|
|
52
|
+
iconSize?: number;
|
|
53
|
+
borderRadius?: number;
|
|
54
|
+
iconColor?: string;
|
|
55
|
+
bgColor?: string;
|
|
56
|
+
bgColorDisabled?: string;
|
|
57
|
+
labelColor?: string;
|
|
58
|
+
labelSize?: "s" | "m" | "l";
|
|
59
|
+
transition?: import("framer-motion").Transition;
|
|
60
|
+
variants?: import("framer-motion").Variants;
|
|
61
|
+
initial?: string;
|
|
62
|
+
animate?: string;
|
|
63
|
+
exit?: string;
|
|
64
|
+
underline?: boolean;
|
|
65
|
+
progress?: boolean;
|
|
66
|
+
working?: boolean;
|
|
67
|
+
duration?: number;
|
|
68
|
+
trigger?: boolean;
|
|
69
|
+
destructive?: boolean;
|
|
70
|
+
paddingRight?: number;
|
|
71
|
+
paddingLeft?: number;
|
|
72
|
+
onToolTip?: (tip: ToolTip | null) => void;
|
|
73
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => void;
|
|
74
|
+
} & React.RefAttributes<UIButtonHandle>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Transition, Variants } from 'motion/react';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
import type { ToolTip } from '../sharedTypes';
|
|
4
|
-
|
|
4
|
+
type UIButtonBaseProps = {
|
|
5
5
|
size?: 'large' | 'medium' | 'text';
|
|
6
6
|
variant?: 'solid' | 'outline' | 'text';
|
|
7
7
|
state?: 'normal' | 'hover' | 'disabled';
|
|
@@ -36,7 +36,9 @@ export interface UIButtonProps {
|
|
|
36
36
|
paddingLeft?: number;
|
|
37
37
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
38
38
|
onClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => void;
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
|
+
export type UIButtonProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UIButtonBaseProps> & UIButtonBaseProps;
|
|
40
41
|
export interface UIButtonHandle {
|
|
41
42
|
triggerClick: () => void;
|
|
42
43
|
}
|
|
44
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type React from 'react';
|
|
1
2
|
import type { ToolTip } from '../sharedTypes';
|
|
2
3
|
export type BarButton = {
|
|
3
4
|
icon?: string;
|
|
@@ -5,10 +6,12 @@ export type BarButton = {
|
|
|
5
6
|
label?: string;
|
|
6
7
|
tip: string;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type UIButtonBarBaseProps = {
|
|
9
10
|
options?: BarButton[];
|
|
10
11
|
label?: string;
|
|
11
12
|
current?: number;
|
|
12
13
|
onChange?: (option: BarButton) => void;
|
|
13
14
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
14
|
-
}
|
|
15
|
+
};
|
|
16
|
+
export type UIButtonBarProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UIButtonBarBaseProps> & UIButtonBarBaseProps;
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
type UICardBaseProps = {
|
|
2
3
|
id?: string;
|
|
3
4
|
icon?: string;
|
|
4
5
|
label?: string;
|
|
@@ -8,4 +9,6 @@ export interface UICardProps {
|
|
|
8
9
|
id?: string;
|
|
9
10
|
command?: string;
|
|
10
11
|
}) => void;
|
|
11
|
-
}
|
|
12
|
+
};
|
|
13
|
+
export type UICardProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UICardBaseProps> & UICardBaseProps;
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { IconNames } from '../Icon/_types';
|
|
3
3
|
import type { ToolTip } from '../sharedTypes';
|
|
4
|
-
|
|
4
|
+
type UIChipBaseProps = {
|
|
5
5
|
label?: string;
|
|
6
6
|
icon?: IconNames | string;
|
|
7
7
|
disabled?: boolean;
|
|
@@ -16,4 +16,6 @@ export interface UIChipProps {
|
|
|
16
16
|
onToolTip?: (tip: ToolTip | null) => void;
|
|
17
17
|
onClick?: (e: React.MouseEvent<HTMLDivElement> | undefined) => void;
|
|
18
18
|
onMouseDown?: (e: React.MouseEvent<HTMLDivElement> | undefined) => void;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
export type UIChipProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UIChipBaseProps> & UIChipBaseProps;
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { UIFileIconProps } from './_types';
|
|
3
|
-
export declare const UIFileIcon: React.MemoExoticComponent<(props: UIFileIconProps) => any>;
|
|
3
|
+
export declare const UIFileIcon: React.MemoExoticComponent<(props: UIFileIconProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null>;
|
|
@@ -8,10 +8,12 @@ export declare enum UIFileIcons {
|
|
|
8
8
|
Document = "document",
|
|
9
9
|
Spreadhseet = "spreadsheet"
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
type UIFileIconBaseProps = {
|
|
12
12
|
name?: UIFileIcons | string;
|
|
13
13
|
size?: number;
|
|
14
14
|
pointer?: boolean;
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
onClick?: (e: React.MouseEvent<SVGElement, MouseEvent>) => void;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
export type UIFileIconProps = Omit<React.SVGAttributes<SVGSVGElement>, keyof UIFileIconBaseProps> & UIFileIconBaseProps;
|
|
19
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
|
|
2
|
+
type UILabelBaseProps = {
|
|
3
3
|
label?: string;
|
|
4
4
|
state?: 'red' | 'yellow' | 'green' | 'blue' | 'grey' | 'lightgrey' | 'white';
|
|
5
5
|
noFill?: boolean;
|
|
6
6
|
round?: boolean;
|
|
7
7
|
button?: boolean;
|
|
8
8
|
onClick?: (e: React.MouseEvent<any>) => void;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
|
+
export type UILabelProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof UILabelBaseProps> & UILabelBaseProps;
|
|
11
|
+
export {};
|
|
@@ -31,3 +31,15 @@ export declare const hexToRgb: (hex: string | undefined) => string | undefined;
|
|
|
31
31
|
* Utility to accessibility - mimics click event with designated keys event
|
|
32
32
|
*/
|
|
33
33
|
export declare function accessibleKeyDown(e: React.KeyboardEvent<any>, clickFunction: () => void, keys?: string[]): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get the pointer position from a DOM touch or mouse event
|
|
36
|
+
*/
|
|
37
|
+
export declare function pointerPosition(e: MouseEvent | TouchEvent): number;
|
|
38
|
+
/**
|
|
39
|
+
* Filter and trim class name array
|
|
40
|
+
*/
|
|
41
|
+
export declare function filterClasses(classNames: string[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Takes a style string or number and returns a valid CSS style string
|
|
44
|
+
*/
|
|
45
|
+
export declare function setStyle(value: string | number | undefined, defaultVal?: number | string | undefined): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apple-pie/slice",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"files": ["dist", "README.md", "scripts/copy-assets.mjs"],
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
60
60
|
"rollup-plugin-postcss": "^4.0.2",
|
|
61
61
|
"rollup-plugin-strip-code": "^0.2.8",
|
|
62
|
+
"rollup-plugin-visualizer": "^7.0.1",
|
|
62
63
|
"storybook": "^10.2.9",
|
|
63
64
|
"tsx": "^4.21.0",
|
|
64
65
|
"typescript": "^5.7.3",
|