addon-ui 0.4.2 → 0.6.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.
- package/dist-types/components/Avatar/types.d.ts +1 -0
- package/dist-types/components/Button/types.d.ts +3 -1
- package/dist-types/components/Tabs/Tabs.d.ts +8 -0
- package/dist-types/components/Tabs/TabsContent.d.ts +6 -0
- package/dist-types/components/Tabs/TabsList.d.ts +11 -0
- package/dist-types/components/Tabs/TabsTrigger.d.ts +11 -0
- package/dist-types/components/Tabs/index.d.ts +6 -0
- package/dist-types/components/Tabs/types.d.ts +6 -0
- package/dist-types/components/Toast/Toast.d.ts +3 -1
- package/dist-types/components/Toast/types.d.ts +4 -0
- package/dist-types/components/Truncate/Truncate.d.ts +9 -0
- package/dist-types/components/Truncate/index.d.ts +2 -0
- package/dist-types/components/TruncateList/TruncateList.d.ts +13 -0
- package/dist-types/components/TruncateList/index.d.ts +2 -0
- package/dist-types/components/Viewport/Provider.d.ts +1 -0
- package/dist-types/components/Viewport/context.d.ts +1 -0
- package/dist-types/components/index.d.ts +3 -0
- package/dist-types/components/types.d.ts +8 -2
- package/package.json +8 -6
- package/src/components/Avatar/avatar.module.scss +4 -0
- package/src/components/Avatar/types.ts +1 -0
- package/src/components/Button/button.module.scss +32 -4
- package/src/components/Button/types.ts +2 -0
- package/src/components/List/list.module.scss +2 -1
- package/src/components/ListItem/list-item.module.scss +1 -1
- package/src/components/ScrollArea/ScrollArea.tsx +9 -2
- package/src/components/ScrollArea/scroll-area.module.scss +12 -3
- package/src/components/Tabs/Tabs.tsx +32 -0
- package/src/components/Tabs/TabsContent.tsx +21 -0
- package/src/components/Tabs/TabsList.tsx +131 -0
- package/src/components/Tabs/TabsTrigger.tsx +43 -0
- package/src/components/Tabs/index.ts +5 -0
- package/src/components/Tabs/tabs.module.scss +166 -0
- package/src/components/Tabs/types.ts +5 -0
- package/src/components/Tag/tag.module.scss +10 -7
- package/src/components/TextField/text-field.module.scss +6 -2
- package/src/components/Toast/Toast.tsx +7 -1
- package/src/components/Toast/toast.module.scss +56 -13
- package/src/components/Toast/types.ts +5 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Truncate/Truncate.tsx +112 -0
- package/src/components/Truncate/index.ts +1 -0
- package/src/components/Truncate/truncate.module.scss +20 -0
- package/src/components/TruncateList/TruncateList.tsx +47 -0
- package/src/components/TruncateList/index.ts +1 -0
- package/src/components/TruncateList/truncate-list.module.scss +20 -0
- package/src/components/Viewport/Provider.tsx +12 -1
- package/src/components/Viewport/context.ts +4 -0
- package/src/components/Viewport/viewport.module.scss +10 -7
- package/src/components/index.ts +3 -0
- package/src/components/types.ts +13 -1
- package/src/providers/ui/styles/reset.scss +2 -0
- package/src/styles/mixins.scss +6 -0
|
@@ -17,12 +17,21 @@ import styles from "./viewport.module.scss";
|
|
|
17
17
|
|
|
18
18
|
export type ViewportProps = ComponentProps<"div"> & {
|
|
19
19
|
mode?: ViewportMode;
|
|
20
|
+
transition?: boolean;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const Provider: ForwardRefRenderFunction<HTMLDivElement, PropsWithChildren<ViewportProps>> = (
|
|
23
|
-
{
|
|
24
|
+
{
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
style,
|
|
28
|
+
mode: viewportMode = ViewportMode.Adaptive,
|
|
29
|
+
transition: viewportTransition = true,
|
|
30
|
+
...props
|
|
31
|
+
},
|
|
24
32
|
ref
|
|
25
33
|
) => {
|
|
34
|
+
const [transition, withTransition] = useState(viewportTransition);
|
|
26
35
|
const [mode, setModeState] = useState<ViewportMode>(viewportMode);
|
|
27
36
|
const [sizes, setSizesState] = useState<ViewportSizes | null>(null);
|
|
28
37
|
|
|
@@ -40,6 +49,7 @@ const Provider: ForwardRefRenderFunction<HTMLDivElement, PropsWithChildren<Viewp
|
|
|
40
49
|
setSizes,
|
|
41
50
|
setMode,
|
|
42
51
|
resetSizes,
|
|
52
|
+
withTransition,
|
|
43
53
|
}),
|
|
44
54
|
[mode, setSizes, setMode, resetSizes]
|
|
45
55
|
);
|
|
@@ -81,6 +91,7 @@ const Provider: ForwardRefRenderFunction<HTMLDivElement, PropsWithChildren<Viewp
|
|
|
81
91
|
className={classnames(
|
|
82
92
|
styles["viewport"],
|
|
83
93
|
{
|
|
94
|
+
[styles["viewport--transition"]]: transition,
|
|
84
95
|
[styles["viewport--expanded"]]: mode === ViewportMode.Expanded,
|
|
85
96
|
[styles["viewport--fixed"]]: mode === ViewportMode.Fixed,
|
|
86
97
|
},
|
|
@@ -20,6 +20,8 @@ export interface ViewportContract {
|
|
|
20
20
|
|
|
21
21
|
setSizes(sizes: ViewportSizes): void;
|
|
22
22
|
|
|
23
|
+
withTransition(transition: boolean): void;
|
|
24
|
+
|
|
23
25
|
resetSizes(): void;
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -30,6 +32,8 @@ export const ViewportContext = createContext<ViewportContract>({
|
|
|
30
32
|
|
|
31
33
|
setSizes() {},
|
|
32
34
|
|
|
35
|
+
withTransition() {},
|
|
36
|
+
|
|
33
37
|
resetSizes() {},
|
|
34
38
|
});
|
|
35
39
|
|
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
max-width: var(--viewport-max-width);
|
|
7
7
|
min-height: var(--viewport-min-height);
|
|
8
8
|
max-height: var(--viewport-max-height);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
|
|
10
|
+
&--transition {
|
|
11
|
+
transition:
|
|
12
|
+
height var(--transition-viewport, var(--transition-speed-md)) ease-in-out,
|
|
13
|
+
width var(--transition-viewport, var(--transition-speed-md)) ease-in-out,
|
|
14
|
+
min-height var(--transition-viewport, var(--transition-speed-md)) ease-in-out,
|
|
15
|
+
min-width var(--transition-viewport, var(--transition-speed-md)) ease-in-out,
|
|
16
|
+
max-height var(--transition-viewport, var(--transition-speed-md)) ease-in-out,
|
|
17
|
+
max-width var(--transition-viewport, var(--transition-speed-md)) ease-in-out;
|
|
18
|
+
}
|
|
16
19
|
|
|
17
20
|
&--expanded {
|
|
18
21
|
min-height: var(--viewport-max-height);
|
package/src/components/index.ts
CHANGED
|
@@ -16,11 +16,14 @@ export * from "./Odometer";
|
|
|
16
16
|
export * from "./ScrollArea";
|
|
17
17
|
export * from "./SvgSprite";
|
|
18
18
|
export * from "./Switch";
|
|
19
|
+
export * from "./Tabs";
|
|
19
20
|
export * from "./Tag";
|
|
20
21
|
export * from "./TextArea";
|
|
21
22
|
export * from "./TextField";
|
|
22
23
|
export * from "./Toast";
|
|
23
24
|
export * from "./Tooltip";
|
|
25
|
+
export * from "./Truncate";
|
|
26
|
+
export * from "./TruncateList";
|
|
24
27
|
export * from "./View";
|
|
25
28
|
export * from "./ViewDrawer";
|
|
26
29
|
export * from "./ViewModal";
|
package/src/components/types.ts
CHANGED
|
@@ -15,11 +15,17 @@ import type {
|
|
|
15
15
|
OdometerProps,
|
|
16
16
|
ScrollAreaProps,
|
|
17
17
|
SwitchProps,
|
|
18
|
+
TabsProps,
|
|
19
|
+
TabsContentProps,
|
|
20
|
+
TabsListProps,
|
|
21
|
+
TabsTriggerProps,
|
|
18
22
|
TagProps,
|
|
19
23
|
TextAreaProps,
|
|
20
24
|
TextFieldProps,
|
|
21
25
|
ToastProps,
|
|
22
26
|
TooltipProps,
|
|
27
|
+
TruncateProps,
|
|
28
|
+
TruncateListProps,
|
|
23
29
|
ViewProps,
|
|
24
30
|
ViewDrawerProps,
|
|
25
31
|
ViewModalProps,
|
|
@@ -42,6 +48,10 @@ export interface ComponentsProps {
|
|
|
42
48
|
odometer?: Pick<OdometerProps, "auto" | "format" | "duration">;
|
|
43
49
|
scrollArea?: ScrollAreaProps;
|
|
44
50
|
switch?: SwitchProps;
|
|
51
|
+
tabs?: TabsProps;
|
|
52
|
+
tabsContent?: TabsContentProps;
|
|
53
|
+
tabsList?: TabsListProps;
|
|
54
|
+
tabsTrigger?: TabsTriggerProps;
|
|
45
55
|
tag?: Pick<TagProps, "variant" | "size" | "color" | "radius" | "clickable">;
|
|
46
56
|
textArea?: TextAreaProps;
|
|
47
57
|
textField?: TextFieldProps;
|
|
@@ -58,7 +68,9 @@ export interface ComponentsProps {
|
|
|
58
68
|
| "radius"
|
|
59
69
|
| "color"
|
|
60
70
|
>;
|
|
61
|
-
tooltip?: TooltipProps
|
|
71
|
+
tooltip?: Omit<TooltipProps, "content">;
|
|
72
|
+
truncate?: TruncateProps;
|
|
73
|
+
truncateList?: TruncateListProps;
|
|
62
74
|
view?: ViewProps;
|
|
63
75
|
viewDrawer?: ViewDrawerProps;
|
|
64
76
|
viewModal?: ViewModalProps;
|