colibri-ui 0.7.21 → 0.7.24
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/Button/index.d.ts +2 -2
- package/Button/index.js +3 -3
- package/Button/index.props.d.ts +4 -10
- package/ClickOutside/index.d.ts +6 -0
- package/ClickOutside/package.json +6 -0
- package/Menu/components/MenuItem/index.d.ts +4 -0
- package/Menu/components/MenuItem/index.props.d.ts +23 -0
- package/Menu/components/MenuItem/styles.d.ts +10 -0
- package/Menu/index.d.ts +3 -0
- package/Menu/index.props.d.ts +33 -0
- package/Menu/package.json +6 -0
- package/Menu/styles.d.ts +5 -0
- package/Portal/index.d.ts +6 -0
- package/Portal/package.json +6 -0
- package/Theme/index.d.ts +2 -0
- package/Theme/index.props.d.ts +2 -0
- package/Theme/themes/buenos_aires.d.ts +4 -1
- package/Theme/themes/buenos_aires.js +25 -3
- package/Theme/themes/default.d.ts +3 -0
- package/Theme/themes/default.js +22 -0
- package/esm/Button/index.d.ts +2 -2
- package/esm/Button/index.js +3 -3
- package/esm/Button/index.props.d.ts +4 -10
- package/esm/ClickOutside/index.d.ts +6 -0
- package/esm/Menu/components/MenuItem/index.d.ts +4 -0
- package/esm/Menu/components/MenuItem/index.props.d.ts +23 -0
- package/esm/Menu/components/MenuItem/styles.d.ts +10 -0
- package/esm/Menu/index.d.ts +3 -0
- package/esm/Menu/index.props.d.ts +33 -0
- package/esm/Menu/styles.d.ts +5 -0
- package/esm/Portal/index.d.ts +6 -0
- package/esm/Theme/index.d.ts +2 -0
- package/esm/Theme/index.props.d.ts +2 -0
- package/esm/Theme/themes/buenos_aires.d.ts +4 -1
- package/esm/Theme/themes/buenos_aires.js +24 -3
- package/esm/Theme/themes/default.d.ts +3 -0
- package/esm/Theme/themes/default.js +22 -1
- package/esm/hooks/useOnClickOutside/index.d.ts +3 -0
- package/hooks/useOnClickOutside/index.d.ts +3 -0
- package/package.json +9 -4
- package/Button/index.props.js +0 -9
- package/esm/Button/index.props.js +0 -9
package/Button/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { type ButtonProps } from "./index.props";
|
|
3
|
-
declare const Button:
|
|
3
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default Button;
|
package/Button/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
7
|
var react = require('react');
|
|
8
|
-
var index_props = require('./index.props.js');
|
|
9
8
|
var styles = require('./styles.js');
|
|
10
9
|
|
|
11
10
|
var Button = /*#__PURE__*/react.forwardRef(function (_a, ref) {
|
|
@@ -13,7 +12,7 @@ var Button = /*#__PURE__*/react.forwardRef(function (_a, ref) {
|
|
|
13
12
|
_b = _a.fullWidth,
|
|
14
13
|
fullWidth = _b === void 0 ? false : _b,
|
|
15
14
|
_c = _a.variant,
|
|
16
|
-
variant = _c === void 0 ?
|
|
15
|
+
variant = _c === void 0 ? "primary" : _c,
|
|
17
16
|
iconStart = _a.iconStart,
|
|
18
17
|
iconEnd = _a.iconEnd,
|
|
19
18
|
icon = _a.icon,
|
|
@@ -28,7 +27,8 @@ var Button = /*#__PURE__*/react.forwardRef(function (_a, ref) {
|
|
|
28
27
|
className: className,
|
|
29
28
|
variant: variant,
|
|
30
29
|
icon: icon,
|
|
31
|
-
fullWidth: fullWidth
|
|
30
|
+
fullWidth: fullWidth,
|
|
31
|
+
"data-cy": "button"
|
|
32
32
|
}, props, {
|
|
33
33
|
children: [icon && jsxRuntime.jsx(styles.StyledIcon, {
|
|
34
34
|
children: icon
|
package/Button/index.props.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import type { CSSObject } from "@emotion/react";
|
|
3
|
-
export declare enum VARIANT {
|
|
4
|
-
PRIMARY = "primary",
|
|
5
|
-
SECONDARY = "secondary",
|
|
6
|
-
PSEUDO = "pseudo",
|
|
7
|
-
CLEAR = "clear"
|
|
8
|
-
}
|
|
9
3
|
type BaseStyles = {
|
|
10
4
|
color?: CSSObject["color"];
|
|
11
5
|
borderRadius: CSSObject["borderRadius"];
|
|
@@ -31,10 +25,10 @@ export type ButtonBase = {
|
|
|
31
25
|
base: BaseStyles;
|
|
32
26
|
};
|
|
33
27
|
export type ButtonVariant = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
"primary": VariantStates;
|
|
29
|
+
"secondary": VariantStates;
|
|
30
|
+
"pseudo": VariantStates;
|
|
31
|
+
"clear": VariantStates;
|
|
38
32
|
};
|
|
39
33
|
export type ButtonSize = "xs" | "s" | "m" | "l";
|
|
40
34
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSObject } from "@emotion/react";
|
|
2
|
+
import { ReactNode, MouseEvent } from "react";
|
|
3
|
+
import { MenuVariant } from "../../index.props";
|
|
4
|
+
interface IStylesProps {
|
|
5
|
+
color?: CSSObject["color"];
|
|
6
|
+
backgroundColor: CSSObject["backgroundColor"];
|
|
7
|
+
}
|
|
8
|
+
export interface MenuItemPalette {
|
|
9
|
+
normal: IStylesProps;
|
|
10
|
+
hovered?: IStylesProps;
|
|
11
|
+
focused?: IStylesProps;
|
|
12
|
+
selected?: IStylesProps;
|
|
13
|
+
disabled?: IStylesProps;
|
|
14
|
+
}
|
|
15
|
+
export interface MenuItemProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
isSelected?: boolean;
|
|
19
|
+
onClick?: (e: MouseEvent) => void;
|
|
20
|
+
variant?: keyof MenuVariant;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuVariant } from "../../index.props";
|
|
3
|
+
export declare const Item: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
isSelected?: boolean | undefined;
|
|
8
|
+
variant: keyof MenuVariant;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
}, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
package/Menu/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CSSObject } from "@emotion/react";
|
|
2
|
+
import { ReactElement, MouseEvent, FC } from "react";
|
|
3
|
+
import MenuItem from "./components/MenuItem";
|
|
4
|
+
import { MenuItemProps, MenuItemPalette } from "./components/MenuItem/index.props";
|
|
5
|
+
export interface MenuPalette {
|
|
6
|
+
backgroundColor: CSSObject["backgroundColor"];
|
|
7
|
+
item: MenuItemPalette;
|
|
8
|
+
}
|
|
9
|
+
type VariantStyles = {
|
|
10
|
+
color?: CSSObject["color"];
|
|
11
|
+
backgroundColor?: CSSObject["backgroundColor"];
|
|
12
|
+
};
|
|
13
|
+
type VariantStates = {
|
|
14
|
+
normal?: VariantStyles;
|
|
15
|
+
hovered?: VariantStyles;
|
|
16
|
+
focused?: VariantStyles;
|
|
17
|
+
selected?: VariantStyles;
|
|
18
|
+
disabled?: VariantStyles;
|
|
19
|
+
};
|
|
20
|
+
export type MenuVariant = {
|
|
21
|
+
"primary": VariantStates;
|
|
22
|
+
};
|
|
23
|
+
interface Props {
|
|
24
|
+
selected?: string[];
|
|
25
|
+
variant?: keyof MenuVariant;
|
|
26
|
+
className?: string;
|
|
27
|
+
onClick?: (key: string, e: MouseEvent) => void;
|
|
28
|
+
children?: ReactElement<MenuItemProps> | ReactElement<MenuItemProps>[];
|
|
29
|
+
}
|
|
30
|
+
export interface MenuProps extends FC<Props> {
|
|
31
|
+
Item: typeof MenuItem;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
package/Menu/styles.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MenuList: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
package/Theme/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const THEMES: {
|
|
|
4
4
|
DEFAULT: {
|
|
5
5
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
6
6
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
7
|
+
menu: import("../Menu/index.props").MenuVariant;
|
|
7
8
|
input: {
|
|
8
9
|
placeholder: {
|
|
9
10
|
color: string;
|
|
@@ -119,6 +120,7 @@ export declare const THEMES: {
|
|
|
119
120
|
BA: {
|
|
120
121
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
121
122
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
123
|
+
menu: import("../Menu/index.props").MenuVariant;
|
|
122
124
|
input: {
|
|
123
125
|
placeholder: {
|
|
124
126
|
color: string;
|
package/Theme/index.props.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ import type { BreakpointsTheme } from "./breakpoints";
|
|
|
5
5
|
import type { ButtonBase, ButtonVariant } from "../Button/index.props";
|
|
6
6
|
import type { TypographyVariant } from "../Typography/index.props";
|
|
7
7
|
import type { SwitchStates } from "../Switch/index.props";
|
|
8
|
+
import { MenuVariant } from "../Menu/index.props";
|
|
8
9
|
export type ThemeProps = {
|
|
9
10
|
button: ButtonVariant & ButtonBase;
|
|
11
|
+
menu: MenuVariant;
|
|
10
12
|
checkbox: CheckboxVariant;
|
|
11
13
|
breakpoints: BreakpointsTheme;
|
|
12
14
|
typography: TypographyVariant;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CheckboxVariant } from "../../Checkbox/index.props";
|
|
2
2
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
3
|
+
import { MenuVariant } from "../../Menu/index.props";
|
|
3
4
|
export declare const ButtonThemeBA: ButtonVariant & ButtonBase;
|
|
4
5
|
export declare const InputThemeBA: {
|
|
5
6
|
placeholder: {
|
|
@@ -50,7 +51,7 @@ export declare const TypographyThemeBA: {
|
|
|
50
51
|
color: string;
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
|
-
export declare const
|
|
54
|
+
export declare const SwitchThemeBA: {
|
|
54
55
|
circle: {
|
|
55
56
|
backgroundColor: string;
|
|
56
57
|
};
|
|
@@ -65,9 +66,11 @@ export declare const SwitchThemeDefault: {
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
};
|
|
69
|
+
export declare const MenuThemeBA: MenuVariant;
|
|
68
70
|
export declare const THEME_BA: {
|
|
69
71
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
70
72
|
button: ButtonVariant & ButtonBase;
|
|
73
|
+
menu: MenuVariant;
|
|
71
74
|
input: {
|
|
72
75
|
placeholder: {
|
|
73
76
|
color: string;
|
|
@@ -180,7 +180,7 @@ var TypographyThemeBA = {
|
|
|
180
180
|
color: color.Color.BG_3
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
var
|
|
183
|
+
var SwitchThemeBA = {
|
|
184
184
|
circle: {
|
|
185
185
|
backgroundColor: color.Color.WHITE
|
|
186
186
|
},
|
|
@@ -195,19 +195,41 @@ var SwitchThemeDefault = {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
+
var MenuThemeBA = {
|
|
199
|
+
primary: {
|
|
200
|
+
normal: {
|
|
201
|
+
backgroundColor: color.Color.WHITE
|
|
202
|
+
},
|
|
203
|
+
hovered: {
|
|
204
|
+
backgroundColor: color.Color.PRIMARY_BA_2
|
|
205
|
+
},
|
|
206
|
+
focused: {
|
|
207
|
+
backgroundColor: color.Color.PRIMARY_BA_2
|
|
208
|
+
},
|
|
209
|
+
selected: {
|
|
210
|
+
backgroundColor: color.Color.PRIMARY_BA_2
|
|
211
|
+
},
|
|
212
|
+
disabled: {
|
|
213
|
+
color: color.Color.BG_2,
|
|
214
|
+
backgroundColor: color.Color.WHITE
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
198
218
|
var THEME_BA = {
|
|
199
219
|
breakpoints: breakpoints.default,
|
|
200
220
|
button: ButtonThemeBA,
|
|
221
|
+
menu: MenuThemeBA,
|
|
201
222
|
input: InputThemeBA,
|
|
202
223
|
checkbox: CheckboxThemeBA,
|
|
203
224
|
typography: TypographyThemeBA,
|
|
204
|
-
"switch":
|
|
225
|
+
"switch": SwitchThemeBA,
|
|
205
226
|
palette: color.Color
|
|
206
227
|
};
|
|
207
228
|
|
|
208
229
|
exports.ButtonThemeBA = ButtonThemeBA;
|
|
209
230
|
exports.CheckboxThemeBA = CheckboxThemeBA;
|
|
210
231
|
exports.InputThemeBA = InputThemeBA;
|
|
211
|
-
exports.
|
|
232
|
+
exports.MenuThemeBA = MenuThemeBA;
|
|
233
|
+
exports.SwitchThemeBA = SwitchThemeBA;
|
|
212
234
|
exports.THEME_BA = THEME_BA;
|
|
213
235
|
exports.TypographyThemeBA = TypographyThemeBA;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CheckboxVariant } from "../../Checkbox/index.props";
|
|
2
2
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
3
|
+
import { MenuVariant } from "../../Menu/index.props";
|
|
3
4
|
export declare const ButtonThemeDefault: ButtonVariant & ButtonBase;
|
|
4
5
|
export declare const InputThemeDefault: {
|
|
5
6
|
placeholder: {
|
|
@@ -65,9 +66,11 @@ export declare const SwitchThemeDefault: {
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
};
|
|
69
|
+
export declare const MenuThemeDefault: MenuVariant;
|
|
68
70
|
export declare const THEME_DEFAULT: {
|
|
69
71
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
70
72
|
button: ButtonVariant & ButtonBase;
|
|
73
|
+
menu: MenuVariant;
|
|
71
74
|
input: {
|
|
72
75
|
placeholder: {
|
|
73
76
|
color: string;
|
package/Theme/themes/default.js
CHANGED
|
@@ -193,9 +193,30 @@ var SwitchThemeDefault = {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
+
var MenuThemeDefault = {
|
|
197
|
+
primary: {
|
|
198
|
+
normal: {
|
|
199
|
+
backgroundColor: color.Color.WHITE
|
|
200
|
+
},
|
|
201
|
+
hovered: {
|
|
202
|
+
backgroundColor: color.Color.PRIMARY_2
|
|
203
|
+
},
|
|
204
|
+
focused: {
|
|
205
|
+
backgroundColor: color.Color.PRIMARY_2
|
|
206
|
+
},
|
|
207
|
+
selected: {
|
|
208
|
+
backgroundColor: color.Color.PRIMARY_2
|
|
209
|
+
},
|
|
210
|
+
disabled: {
|
|
211
|
+
color: color.Color.BG_2,
|
|
212
|
+
backgroundColor: color.Color.WHITE
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
196
216
|
var THEME_DEFAULT = {
|
|
197
217
|
breakpoints: breakpoints.default,
|
|
198
218
|
button: ButtonThemeDefault,
|
|
219
|
+
menu: MenuThemeDefault,
|
|
199
220
|
input: InputThemeDefault,
|
|
200
221
|
checkbox: CheckboxThemeDefault,
|
|
201
222
|
typography: TypographyThemeDefault,
|
|
@@ -206,6 +227,7 @@ var THEME_DEFAULT = {
|
|
|
206
227
|
exports.ButtonThemeDefault = ButtonThemeDefault;
|
|
207
228
|
exports.CheckboxThemeDefault = CheckboxThemeDefault;
|
|
208
229
|
exports.InputThemeDefault = InputThemeDefault;
|
|
230
|
+
exports.MenuThemeDefault = MenuThemeDefault;
|
|
209
231
|
exports.SwitchThemeDefault = SwitchThemeDefault;
|
|
210
232
|
exports.THEME_DEFAULT = THEME_DEFAULT;
|
|
211
233
|
exports.TypographyThemeDefault = TypographyThemeDefault;
|
package/esm/Button/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { type ButtonProps } from "./index.props";
|
|
3
|
-
declare const Button:
|
|
3
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default Button;
|
package/esm/Button/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { VARIANT } from './index.props.js';
|
|
5
4
|
import { StyledButton, StyledIcon } from './styles.js';
|
|
6
5
|
|
|
7
6
|
var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
@@ -9,7 +8,7 @@ var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
9
8
|
_b = _a.fullWidth,
|
|
10
9
|
fullWidth = _b === void 0 ? false : _b,
|
|
11
10
|
_c = _a.variant,
|
|
12
|
-
variant = _c === void 0 ?
|
|
11
|
+
variant = _c === void 0 ? "primary" : _c,
|
|
13
12
|
iconStart = _a.iconStart,
|
|
14
13
|
iconEnd = _a.iconEnd,
|
|
15
14
|
icon = _a.icon,
|
|
@@ -24,7 +23,8 @@ var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
24
23
|
className: className,
|
|
25
24
|
variant: variant,
|
|
26
25
|
icon: icon,
|
|
27
|
-
fullWidth: fullWidth
|
|
26
|
+
fullWidth: fullWidth,
|
|
27
|
+
"data-cy": "button"
|
|
28
28
|
}, props, {
|
|
29
29
|
children: [icon && jsx(StyledIcon, {
|
|
30
30
|
children: icon
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import type { CSSObject } from "@emotion/react";
|
|
3
|
-
export declare enum VARIANT {
|
|
4
|
-
PRIMARY = "primary",
|
|
5
|
-
SECONDARY = "secondary",
|
|
6
|
-
PSEUDO = "pseudo",
|
|
7
|
-
CLEAR = "clear"
|
|
8
|
-
}
|
|
9
3
|
type BaseStyles = {
|
|
10
4
|
color?: CSSObject["color"];
|
|
11
5
|
borderRadius: CSSObject["borderRadius"];
|
|
@@ -31,10 +25,10 @@ export type ButtonBase = {
|
|
|
31
25
|
base: BaseStyles;
|
|
32
26
|
};
|
|
33
27
|
export type ButtonVariant = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
"primary": VariantStates;
|
|
29
|
+
"secondary": VariantStates;
|
|
30
|
+
"pseudo": VariantStates;
|
|
31
|
+
"clear": VariantStates;
|
|
38
32
|
};
|
|
39
33
|
export type ButtonSize = "xs" | "s" | "m" | "l";
|
|
40
34
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSObject } from "@emotion/react";
|
|
2
|
+
import { ReactNode, MouseEvent } from "react";
|
|
3
|
+
import { MenuVariant } from "../../index.props";
|
|
4
|
+
interface IStylesProps {
|
|
5
|
+
color?: CSSObject["color"];
|
|
6
|
+
backgroundColor: CSSObject["backgroundColor"];
|
|
7
|
+
}
|
|
8
|
+
export interface MenuItemPalette {
|
|
9
|
+
normal: IStylesProps;
|
|
10
|
+
hovered?: IStylesProps;
|
|
11
|
+
focused?: IStylesProps;
|
|
12
|
+
selected?: IStylesProps;
|
|
13
|
+
disabled?: IStylesProps;
|
|
14
|
+
}
|
|
15
|
+
export interface MenuItemProps {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
isSelected?: boolean;
|
|
19
|
+
onClick?: (e: MouseEvent) => void;
|
|
20
|
+
variant?: keyof MenuVariant;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuVariant } from "../../index.props";
|
|
3
|
+
export declare const Item: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
} & {
|
|
7
|
+
isSelected?: boolean | undefined;
|
|
8
|
+
variant: keyof MenuVariant;
|
|
9
|
+
disabled?: boolean | undefined;
|
|
10
|
+
}, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CSSObject } from "@emotion/react";
|
|
2
|
+
import { ReactElement, MouseEvent, FC } from "react";
|
|
3
|
+
import MenuItem from "./components/MenuItem";
|
|
4
|
+
import { MenuItemProps, MenuItemPalette } from "./components/MenuItem/index.props";
|
|
5
|
+
export interface MenuPalette {
|
|
6
|
+
backgroundColor: CSSObject["backgroundColor"];
|
|
7
|
+
item: MenuItemPalette;
|
|
8
|
+
}
|
|
9
|
+
type VariantStyles = {
|
|
10
|
+
color?: CSSObject["color"];
|
|
11
|
+
backgroundColor?: CSSObject["backgroundColor"];
|
|
12
|
+
};
|
|
13
|
+
type VariantStates = {
|
|
14
|
+
normal?: VariantStyles;
|
|
15
|
+
hovered?: VariantStyles;
|
|
16
|
+
focused?: VariantStyles;
|
|
17
|
+
selected?: VariantStyles;
|
|
18
|
+
disabled?: VariantStyles;
|
|
19
|
+
};
|
|
20
|
+
export type MenuVariant = {
|
|
21
|
+
"primary": VariantStates;
|
|
22
|
+
};
|
|
23
|
+
interface Props {
|
|
24
|
+
selected?: string[];
|
|
25
|
+
variant?: keyof MenuVariant;
|
|
26
|
+
className?: string;
|
|
27
|
+
onClick?: (key: string, e: MouseEvent) => void;
|
|
28
|
+
children?: ReactElement<MenuItemProps> | ReactElement<MenuItemProps>[];
|
|
29
|
+
}
|
|
30
|
+
export interface MenuProps extends FC<Props> {
|
|
31
|
+
Item: typeof MenuItem;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MenuList: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
package/esm/Theme/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const THEMES: {
|
|
|
4
4
|
DEFAULT: {
|
|
5
5
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
6
6
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
7
|
+
menu: import("../Menu/index.props").MenuVariant;
|
|
7
8
|
input: {
|
|
8
9
|
placeholder: {
|
|
9
10
|
color: string;
|
|
@@ -119,6 +120,7 @@ export declare const THEMES: {
|
|
|
119
120
|
BA: {
|
|
120
121
|
breakpoints: import("./breakpoints").BreakpointsTheme;
|
|
121
122
|
button: import("../Button/index.props").ButtonVariant & import("../Button/index.props").ButtonBase;
|
|
123
|
+
menu: import("../Menu/index.props").MenuVariant;
|
|
122
124
|
input: {
|
|
123
125
|
placeholder: {
|
|
124
126
|
color: string;
|
|
@@ -5,8 +5,10 @@ import type { BreakpointsTheme } from "./breakpoints";
|
|
|
5
5
|
import type { ButtonBase, ButtonVariant } from "../Button/index.props";
|
|
6
6
|
import type { TypographyVariant } from "../Typography/index.props";
|
|
7
7
|
import type { SwitchStates } from "../Switch/index.props";
|
|
8
|
+
import { MenuVariant } from "../Menu/index.props";
|
|
8
9
|
export type ThemeProps = {
|
|
9
10
|
button: ButtonVariant & ButtonBase;
|
|
11
|
+
menu: MenuVariant;
|
|
10
12
|
checkbox: CheckboxVariant;
|
|
11
13
|
breakpoints: BreakpointsTheme;
|
|
12
14
|
typography: TypographyVariant;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CheckboxVariant } from "../../Checkbox/index.props";
|
|
2
2
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
3
|
+
import { MenuVariant } from "../../Menu/index.props";
|
|
3
4
|
export declare const ButtonThemeBA: ButtonVariant & ButtonBase;
|
|
4
5
|
export declare const InputThemeBA: {
|
|
5
6
|
placeholder: {
|
|
@@ -50,7 +51,7 @@ export declare const TypographyThemeBA: {
|
|
|
50
51
|
color: string;
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
|
-
export declare const
|
|
54
|
+
export declare const SwitchThemeBA: {
|
|
54
55
|
circle: {
|
|
55
56
|
backgroundColor: string;
|
|
56
57
|
};
|
|
@@ -65,9 +66,11 @@ export declare const SwitchThemeDefault: {
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
};
|
|
69
|
+
export declare const MenuThemeBA: MenuVariant;
|
|
68
70
|
export declare const THEME_BA: {
|
|
69
71
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
70
72
|
button: ButtonVariant & ButtonBase;
|
|
73
|
+
menu: MenuVariant;
|
|
71
74
|
input: {
|
|
72
75
|
placeholder: {
|
|
73
76
|
color: string;
|
|
@@ -178,7 +178,7 @@ var TypographyThemeBA = {
|
|
|
178
178
|
color: Color.BG_3
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
|
-
var
|
|
181
|
+
var SwitchThemeBA = {
|
|
182
182
|
circle: {
|
|
183
183
|
backgroundColor: Color.WHITE
|
|
184
184
|
},
|
|
@@ -193,14 +193,35 @@ var SwitchThemeDefault = {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
+
var MenuThemeBA = {
|
|
197
|
+
primary: {
|
|
198
|
+
normal: {
|
|
199
|
+
backgroundColor: Color.WHITE
|
|
200
|
+
},
|
|
201
|
+
hovered: {
|
|
202
|
+
backgroundColor: Color.PRIMARY_BA_2
|
|
203
|
+
},
|
|
204
|
+
focused: {
|
|
205
|
+
backgroundColor: Color.PRIMARY_BA_2
|
|
206
|
+
},
|
|
207
|
+
selected: {
|
|
208
|
+
backgroundColor: Color.PRIMARY_BA_2
|
|
209
|
+
},
|
|
210
|
+
disabled: {
|
|
211
|
+
color: Color.BG_2,
|
|
212
|
+
backgroundColor: Color.WHITE
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
196
216
|
var THEME_BA = {
|
|
197
217
|
breakpoints: Breakpoints,
|
|
198
218
|
button: ButtonThemeBA,
|
|
219
|
+
menu: MenuThemeBA,
|
|
199
220
|
input: InputThemeBA,
|
|
200
221
|
checkbox: CheckboxThemeBA,
|
|
201
222
|
typography: TypographyThemeBA,
|
|
202
|
-
"switch":
|
|
223
|
+
"switch": SwitchThemeBA,
|
|
203
224
|
palette: Color
|
|
204
225
|
};
|
|
205
226
|
|
|
206
|
-
export { ButtonThemeBA, CheckboxThemeBA, InputThemeBA,
|
|
227
|
+
export { ButtonThemeBA, CheckboxThemeBA, InputThemeBA, MenuThemeBA, SwitchThemeBA, THEME_BA, TypographyThemeBA };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CheckboxVariant } from "../../Checkbox/index.props";
|
|
2
2
|
import type { ButtonBase, ButtonVariant } from "../../Button/index.props";
|
|
3
|
+
import { MenuVariant } from "../../Menu/index.props";
|
|
3
4
|
export declare const ButtonThemeDefault: ButtonVariant & ButtonBase;
|
|
4
5
|
export declare const InputThemeDefault: {
|
|
5
6
|
placeholder: {
|
|
@@ -65,9 +66,11 @@ export declare const SwitchThemeDefault: {
|
|
|
65
66
|
};
|
|
66
67
|
};
|
|
67
68
|
};
|
|
69
|
+
export declare const MenuThemeDefault: MenuVariant;
|
|
68
70
|
export declare const THEME_DEFAULT: {
|
|
69
71
|
breakpoints: import("../breakpoints").BreakpointsTheme;
|
|
70
72
|
button: ButtonVariant & ButtonBase;
|
|
73
|
+
menu: MenuVariant;
|
|
71
74
|
input: {
|
|
72
75
|
placeholder: {
|
|
73
76
|
color: string;
|
|
@@ -191,9 +191,30 @@ var SwitchThemeDefault = {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
+
var MenuThemeDefault = {
|
|
195
|
+
primary: {
|
|
196
|
+
normal: {
|
|
197
|
+
backgroundColor: Color.WHITE
|
|
198
|
+
},
|
|
199
|
+
hovered: {
|
|
200
|
+
backgroundColor: Color.PRIMARY_2
|
|
201
|
+
},
|
|
202
|
+
focused: {
|
|
203
|
+
backgroundColor: Color.PRIMARY_2
|
|
204
|
+
},
|
|
205
|
+
selected: {
|
|
206
|
+
backgroundColor: Color.PRIMARY_2
|
|
207
|
+
},
|
|
208
|
+
disabled: {
|
|
209
|
+
color: Color.BG_2,
|
|
210
|
+
backgroundColor: Color.WHITE
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
};
|
|
194
214
|
var THEME_DEFAULT = {
|
|
195
215
|
breakpoints: Breakpoints,
|
|
196
216
|
button: ButtonThemeDefault,
|
|
217
|
+
menu: MenuThemeDefault,
|
|
197
218
|
input: InputThemeDefault,
|
|
198
219
|
checkbox: CheckboxThemeDefault,
|
|
199
220
|
typography: TypographyThemeDefault,
|
|
@@ -201,4 +222,4 @@ var THEME_DEFAULT = {
|
|
|
201
222
|
palette: Color
|
|
202
223
|
};
|
|
203
224
|
|
|
204
|
-
export { ButtonThemeDefault, CheckboxThemeDefault, InputThemeDefault, SwitchThemeDefault, THEME_DEFAULT, TypographyThemeDefault };
|
|
225
|
+
export { ButtonThemeDefault, CheckboxThemeDefault, InputThemeDefault, MenuThemeDefault, SwitchThemeDefault, THEME_DEFAULT, TypographyThemeDefault };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colibri-ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.24",
|
|
4
4
|
"description": "React UI components library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {},
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/plugin-transform-runtime": "7.24.3",
|
|
33
|
-
"@babel/preset-
|
|
34
|
-
"@
|
|
35
|
-
"@babel/preset-typescript": "7.24.1",
|
|
33
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
34
|
+
"@cypress/code-coverage": "^3.12.39",
|
|
36
35
|
"@emotion/babel-plugin": "11.11.0",
|
|
37
36
|
"@eslint/js": "9.2.0",
|
|
38
37
|
"@rollup/plugin-babel": "6.0.4",
|
|
@@ -52,7 +51,12 @@
|
|
|
52
51
|
"@storybook/test": "8.0.10",
|
|
53
52
|
"@svgr/rollup": "8.1.0",
|
|
54
53
|
"@swc/plugin-emotion": "^3.0.4",
|
|
54
|
+
"@types/cypress": "^1.1.3",
|
|
55
|
+
"@types/node": "^20.12.12",
|
|
55
56
|
"@types/react": "18.3.1",
|
|
57
|
+
"@types/react-dom": "^18.3.0",
|
|
58
|
+
"babel-loader": "^9.1.3",
|
|
59
|
+
"cypress": "^13.10.0",
|
|
56
60
|
"eslint": "8.57.0",
|
|
57
61
|
"eslint-config-prettier": "9.1.0",
|
|
58
62
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -63,6 +67,7 @@
|
|
|
63
67
|
"prettier": "3.2.5",
|
|
64
68
|
"rollup": "4.17.2",
|
|
65
69
|
"storybook": "8.0.10",
|
|
70
|
+
"ts-loader": "^9.5.1",
|
|
66
71
|
"ts-node": "10.9.2",
|
|
67
72
|
"typescript": "5.4.5",
|
|
68
73
|
"typescript-eslint": "7.8.0"
|
package/Button/index.props.js
DELETED