@bundle-stats/ui 4.9.0-beta.0 → 4.9.1-beta.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/lib/components/entry-info/entry-info.js +2 -1
- package/lib/components/entry-info/entry-info.js.map +1 -1
- package/lib/components/entry-info/entry-info.module.css +0 -6
- package/lib/components/metric-run-info/metric-run-info.js +2 -1
- package/lib/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib/components/metric-run-info/metric-run-info.module.css +0 -18
- package/lib/components/metrics-table/metrics-table.js +2 -1
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.module.css +0 -18
- package/lib/components/metrics-table-title/metrics-table-title.js +2 -1
- package/lib/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/lib/components/sort-button/sort-button.js +4 -3
- package/lib/components/sort-button/sort-button.js.map +1 -1
- package/lib/components/sort-button/sort-button.module.css +5 -12
- package/lib/components/summary/summary.module.css +0 -18
- package/lib/components/total-size-type-title/total-size-type-title.js +2 -1
- package/lib/components/total-size-type-title/total-size-type-title.js.map +1 -1
- package/lib/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/lib/css/variables.css +14 -14
- package/lib/ui/button/button.js +34 -0
- package/lib/ui/button/button.js.map +1 -0
- package/lib/ui/button/button.module.css +285 -0
- package/lib/ui/button/index.js +18 -0
- package/lib/ui/button/index.js.map +1 -0
- package/lib/ui/dropdown/dropdown.module.css +1 -3
- package/lib/ui/empty-set/empty-set.js +4 -3
- package/lib/ui/empty-set/empty-set.js.map +1 -1
- package/lib/ui/empty-set/empty-set.module.css +0 -17
- package/lib/ui/filters/filters.i18n.js +5 -4
- package/lib/ui/filters/filters.i18n.js.map +1 -1
- package/lib/ui/filters/filters.js +5 -4
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +0 -52
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/input-search/input-search.js +2 -1
- package/lib/ui/input-search/input-search.js.map +1 -1
- package/lib/ui/input-search/input-search.module.css +1 -18
- package/lib-esm/components/entry-info/entry-info.js +2 -1
- package/lib-esm/components/entry-info/entry-info.js.map +1 -1
- package/lib-esm/components/entry-info/entry-info.module.css +0 -6
- package/lib-esm/components/metric-run-info/metric-run-info.js +2 -1
- package/lib-esm/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib-esm/components/metric-run-info/metric-run-info.module.css +0 -18
- package/lib-esm/components/metrics-table/metrics-table.js +2 -1
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.module.css +0 -18
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +2 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/lib-esm/components/sort-button/sort-button.js +4 -3
- package/lib-esm/components/sort-button/sort-button.js.map +1 -1
- package/lib-esm/components/sort-button/sort-button.module.css +5 -12
- package/lib-esm/components/summary/summary.module.css +0 -18
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +2 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.js.map +1 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/lib-esm/css/variables.css +14 -14
- package/lib-esm/ui/button/button.js +27 -0
- package/lib-esm/ui/button/button.js.map +1 -0
- package/lib-esm/ui/button/button.module.css +285 -0
- package/lib-esm/ui/button/index.js +2 -0
- package/lib-esm/ui/button/index.js.map +1 -0
- package/lib-esm/ui/dropdown/dropdown.module.css +1 -3
- package/lib-esm/ui/empty-set/empty-set.js +4 -3
- package/lib-esm/ui/empty-set/empty-set.js.map +1 -1
- package/lib-esm/ui/empty-set/empty-set.module.css +0 -17
- package/lib-esm/ui/filters/filters.i18n.js +4 -3
- package/lib-esm/ui/filters/filters.i18n.js.map +1 -1
- package/lib-esm/ui/filters/filters.js +5 -4
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +0 -52
- package/lib-esm/ui/index.js +1 -0
- package/lib-esm/ui/index.js.map +1 -1
- package/lib-esm/ui/input-search/input-search.js +2 -1
- package/lib-esm/ui/input-search/input-search.js.map +1 -1
- package/lib-esm/ui/input-search/input-search.module.css +1 -18
- package/package.json +3 -3
- package/src/components/entry-info/entry-info.module.css +0 -6
- package/src/components/entry-info/entry-info.tsx +4 -2
- package/src/components/metric-run-info/metric-run-info.module.css +0 -18
- package/src/components/metric-run-info/metric-run-info.tsx +3 -2
- package/src/components/metrics-table/metrics-table.module.css +0 -18
- package/src/components/metrics-table/metrics-table.tsx +9 -6
- package/src/components/metrics-table-title/metrics-table-title.jsx +7 -3
- package/src/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/src/components/sort-button/sort-button.module.css +5 -12
- package/src/components/sort-button/sort-button.tsx +5 -6
- package/src/components/summary/summary.module.css +0 -18
- package/src/components/total-size-type-title/total-size-type-title.jsx +4 -2
- package/src/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/src/css/variables.css +14 -14
- package/src/ui/button/button.module.css +285 -0
- package/src/ui/button/button.stories.tsx +108 -0
- package/src/ui/button/button.tsx +72 -0
- package/src/ui/button/index.ts +1 -0
- package/src/ui/dropdown/dropdown.module.css +1 -3
- package/src/ui/empty-set/empty-set.jsx +6 -5
- package/src/ui/empty-set/empty-set.module.css +0 -17
- package/src/ui/filters/filters.i18n.ts +4 -3
- package/src/ui/filters/filters.module.css +0 -52
- package/src/ui/filters/filters.tsx +18 -8
- package/src/ui/index.js +1 -0
- package/src/ui/input-search/input-search.module.css +1 -18
- package/src/ui/input-search/input-search.tsx +6 -3
- package/types/ui/button/button.d.ts +42 -0
- package/types/ui/button/index.d.ts +1 -0
- package/types/ui/filters/filters.i18n.d.ts +4 -3
- package/types/ui/index.d.ts +1 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { Stack } from '../../layout/stack';
|
|
5
|
+
import { FlexStack } from '../../layout/flex-stack';
|
|
6
|
+
import { Button } from '.';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'UI/Button',
|
|
10
|
+
component: Button,
|
|
11
|
+
} as Meta;
|
|
12
|
+
|
|
13
|
+
const Template: Story = ({ children = 'Action', ...props }) => (
|
|
14
|
+
<Button {...props}>{children}</Button>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const Default = Template.bind({});
|
|
18
|
+
|
|
19
|
+
export const All = () => (
|
|
20
|
+
<Stack space="large">
|
|
21
|
+
<Stack space="medium">
|
|
22
|
+
<h2>Size</h2>
|
|
23
|
+
<FlexStack space="small" alignItems="top">
|
|
24
|
+
{Object.values(Button.SIZE).map((size) => (
|
|
25
|
+
<Button size={size} key={size}>
|
|
26
|
+
Action {size}
|
|
27
|
+
</Button>
|
|
28
|
+
))}
|
|
29
|
+
</FlexStack>
|
|
30
|
+
</Stack>
|
|
31
|
+
<Stack space="medium">
|
|
32
|
+
<h2>Kind</h2>
|
|
33
|
+
<Stack space="small">
|
|
34
|
+
<FlexStack space="small" alignItems="top">
|
|
35
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
36
|
+
<Button kind={kind} key={kind}>
|
|
37
|
+
Action {kind}
|
|
38
|
+
</Button>
|
|
39
|
+
))}
|
|
40
|
+
</FlexStack>
|
|
41
|
+
<h3>Disabled</h3>
|
|
42
|
+
<FlexStack space="small" alignItems="top">
|
|
43
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
44
|
+
<Button kind={kind} key={kind} disabled>
|
|
45
|
+
Action {kind}
|
|
46
|
+
</Button>
|
|
47
|
+
))}
|
|
48
|
+
</FlexStack>
|
|
49
|
+
</Stack>
|
|
50
|
+
</Stack>
|
|
51
|
+
<Stack space="medium">
|
|
52
|
+
<h2>Outline & Kind</h2>
|
|
53
|
+
<Stack space="small">
|
|
54
|
+
{Object.values(Button.SIZE).map((size) => (
|
|
55
|
+
<FlexStack space="small" alignItems="top" key={size}>
|
|
56
|
+
<Button outline size={size}>
|
|
57
|
+
Action default
|
|
58
|
+
</Button>
|
|
59
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
60
|
+
<Button outline kind={kind} key={kind} size={size}>
|
|
61
|
+
Action {kind}
|
|
62
|
+
</Button>
|
|
63
|
+
))}
|
|
64
|
+
</FlexStack>
|
|
65
|
+
))}
|
|
66
|
+
<h3>Disabled</h3>
|
|
67
|
+
<FlexStack space="small" alignItems="top">
|
|
68
|
+
<Button outline disabled>
|
|
69
|
+
Action default
|
|
70
|
+
</Button>
|
|
71
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
72
|
+
<Button outline kind={kind} key={kind} disabled>
|
|
73
|
+
Action {kind}
|
|
74
|
+
</Button>
|
|
75
|
+
))}
|
|
76
|
+
</FlexStack>
|
|
77
|
+
</Stack>
|
|
78
|
+
</Stack>
|
|
79
|
+
<Stack space="medium">
|
|
80
|
+
<h2>Solid & Kind</h2>
|
|
81
|
+
<Stack space="small">
|
|
82
|
+
{Object.values(Button.SIZE).map((size) => (
|
|
83
|
+
<FlexStack space="small" alignItems="top" key={size}>
|
|
84
|
+
<Button solid size={size}>
|
|
85
|
+
Action default
|
|
86
|
+
</Button>
|
|
87
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
88
|
+
<Button solid kind={kind} key={kind} size={size}>
|
|
89
|
+
Action {kind}
|
|
90
|
+
</Button>
|
|
91
|
+
))}
|
|
92
|
+
</FlexStack>
|
|
93
|
+
))}
|
|
94
|
+
<h3>Disabled</h3>
|
|
95
|
+
<FlexStack space="small" alignItems="top">
|
|
96
|
+
<Button solid disabled>
|
|
97
|
+
Action default
|
|
98
|
+
</Button>
|
|
99
|
+
{Object.values(Button.KIND).map((kind) => (
|
|
100
|
+
<Button solid kind={kind} key={kind} disabled>
|
|
101
|
+
Action {kind}
|
|
102
|
+
</Button>
|
|
103
|
+
))}
|
|
104
|
+
</FlexStack>
|
|
105
|
+
</Stack>
|
|
106
|
+
</Stack>
|
|
107
|
+
</Stack>
|
|
108
|
+
);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { Button as ButtonBaseComponent } from 'ariakit/button';
|
|
4
|
+
|
|
5
|
+
import css from './button.module.css';
|
|
6
|
+
|
|
7
|
+
const SIZE = {
|
|
8
|
+
SMALL: 'small',
|
|
9
|
+
MEDIUM: 'medium',
|
|
10
|
+
LARGE: 'large',
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
const KIND = {
|
|
14
|
+
PRIMARY: 'primary',
|
|
15
|
+
SECONDARY: 'secondary',
|
|
16
|
+
DANGE: 'danger',
|
|
17
|
+
WARNING: 'warning',
|
|
18
|
+
INFO: 'info',
|
|
19
|
+
SUCCES: 'success',
|
|
20
|
+
} as const;
|
|
21
|
+
|
|
22
|
+
type Size = (typeof SIZE)[keyof typeof SIZE];
|
|
23
|
+
type Kind = (typeof KIND)[keyof typeof KIND];
|
|
24
|
+
|
|
25
|
+
interface ButtonProps {
|
|
26
|
+
outline?: boolean;
|
|
27
|
+
solid?: boolean;
|
|
28
|
+
kind?: Kind | 'default';
|
|
29
|
+
size?: Size;
|
|
30
|
+
radius?: Size | 'circle' | 'none';
|
|
31
|
+
padding?: Size | 'none';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Button = (props: ButtonProps & React.ComponentProps<typeof ButtonBaseComponent>) => {
|
|
35
|
+
const {
|
|
36
|
+
className = '',
|
|
37
|
+
outline = false,
|
|
38
|
+
solid = false,
|
|
39
|
+
kind = 'default',
|
|
40
|
+
size = 'medium',
|
|
41
|
+
radius = '',
|
|
42
|
+
padding = '',
|
|
43
|
+
...restProps
|
|
44
|
+
} = props;
|
|
45
|
+
|
|
46
|
+
// Set padding and radius when provided or when outline/solid variations are set
|
|
47
|
+
const resolvedPadding = padding || ((outline || solid) && size);
|
|
48
|
+
const resolvedRadius = radius || ((outline || solid) && size);
|
|
49
|
+
|
|
50
|
+
const rootClassName = cx(
|
|
51
|
+
css.root,
|
|
52
|
+
css[size],
|
|
53
|
+
kind && css[kind],
|
|
54
|
+
|
|
55
|
+
outline && css.outline,
|
|
56
|
+
outline && css[`outline--${kind}`],
|
|
57
|
+
|
|
58
|
+
solid && css.solid,
|
|
59
|
+
solid && css[`solid--${kind}`],
|
|
60
|
+
|
|
61
|
+
resolvedPadding && css[`padding--${resolvedPadding}`],
|
|
62
|
+
resolvedRadius && css[`radius--${resolvedRadius}`],
|
|
63
|
+
|
|
64
|
+
css[size],
|
|
65
|
+
className,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return <ButtonBaseComponent {...restProps} className={rootClassName} />;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
Button.SIZE = SIZE;
|
|
72
|
+
Button.KIND = KIND;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button';
|
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
border-radius: var(--radius-small);
|
|
12
12
|
padding: calc(var(--space-xxsmall) - 1px);
|
|
13
13
|
|
|
14
|
+
appearance: none;
|
|
14
15
|
background: none;
|
|
15
16
|
font-size: var(--size-small);
|
|
16
17
|
line-height: var(--space-small);
|
|
17
18
|
white-space: nowrap;
|
|
18
|
-
appearance: none;
|
|
19
|
-
cursor: pointer;
|
|
20
19
|
color: var(--color-text-light);
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -48,7 +47,6 @@
|
|
|
48
47
|
.item {
|
|
49
48
|
display: block;
|
|
50
49
|
appearance: none;
|
|
51
|
-
cursor: pointer;
|
|
52
50
|
width: 100%;
|
|
53
51
|
outline: none;
|
|
54
52
|
border: 0;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import { Stack } from '../../layout/stack';
|
|
5
4
|
import I18N from '../../i18n';
|
|
5
|
+
import { Stack } from '../../layout/stack';
|
|
6
|
+
import { Button } from '../button';
|
|
6
7
|
import css from './empty-set.module.css';
|
|
7
8
|
|
|
8
9
|
export const EmptySet = (props) => {
|
|
@@ -12,16 +13,16 @@ export const EmptySet = (props) => {
|
|
|
12
13
|
const actions = [
|
|
13
14
|
...(handleResetFilters
|
|
14
15
|
? [
|
|
15
|
-
<
|
|
16
|
+
<Button kind="primary" type="button" onClick={handleResetFilters} className={css.action}>
|
|
16
17
|
{I18N.RESET_FILTERS}
|
|
17
|
-
</
|
|
18
|
+
</Button>,
|
|
18
19
|
]
|
|
19
20
|
: []),
|
|
20
21
|
...(handleViewAll
|
|
21
22
|
? [
|
|
22
|
-
<
|
|
23
|
+
<Button kind="primary" type="button" onClick={handleViewAll} className={css.action}>
|
|
23
24
|
{I18N.VIEW_ALL}
|
|
24
|
-
</
|
|
25
|
+
</Button>,
|
|
25
26
|
]
|
|
26
27
|
: []),
|
|
27
28
|
];
|
|
@@ -1,20 +1,3 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
color: var(--color-text-light);
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
.action {
|
|
6
|
-
appearance: none;
|
|
7
|
-
padding: 0;
|
|
8
|
-
background: none;
|
|
9
|
-
border: none;
|
|
10
|
-
color: var(--color-primary);
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
text-decoration: underline;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.action:focus,
|
|
16
|
-
.action:active,
|
|
17
|
-
.action:hover {
|
|
18
|
-
color: var(--color-primary-dark);
|
|
19
|
-
text-decoration: none;
|
|
20
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
1
|
+
export const GROUP_NOT_FOUND = 'No filters found';
|
|
2
|
+
export const GROUP_SEARCH = 'Search by filter name';
|
|
3
|
+
export const GROUP_SEARCH_CLEAR = 'Clear search';
|
|
4
4
|
export const CLEAR = 'Clear all';
|
|
5
5
|
export const CHECK = 'Check all';
|
|
6
|
+
export const ONLY = 'only';
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.filterCheckbox {
|
|
13
|
-
cursor: pointer;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.filterInput {
|
|
17
16
|
flex: 0 0 auto;
|
|
18
17
|
height: 1em;
|
|
19
|
-
cursor: pointer;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.filterLabel {
|
|
@@ -28,29 +26,12 @@
|
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
.filterOnlyButton {
|
|
31
|
-
padding: 0 var(--space-xxxsmall);
|
|
32
29
|
display: none;
|
|
33
|
-
appearance: none;
|
|
34
|
-
border: none;
|
|
35
|
-
border-radius: var(--radius-small);
|
|
36
|
-
cursor: pointer;
|
|
37
30
|
position: absolute;
|
|
38
31
|
right: 2px;
|
|
39
32
|
top: 50%;
|
|
40
33
|
transform: translateY(-50%);
|
|
41
|
-
transition: var(--transition-in);
|
|
42
|
-
background: var(--color-info);
|
|
43
|
-
color: var(--color-background);
|
|
44
34
|
font-size: var(--size-xsmall);
|
|
45
|
-
line-height: var(--line-height-header);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.filterOnlyButton:hover,
|
|
49
|
-
.filterOnlyButton:active,
|
|
50
|
-
.filterOnlyButton:focus {
|
|
51
|
-
transition: var(--transition-out);
|
|
52
|
-
background: var(--color-info-dark);
|
|
53
|
-
color: var(--color-background);
|
|
54
35
|
}
|
|
55
36
|
|
|
56
37
|
/** cover item text */
|
|
@@ -129,22 +110,6 @@
|
|
|
129
110
|
color: var(--color-text-light);
|
|
130
111
|
}
|
|
131
112
|
|
|
132
|
-
.filterGroupSearchNotFoundClear {
|
|
133
|
-
outline: none;
|
|
134
|
-
appearance: none;
|
|
135
|
-
border: none;
|
|
136
|
-
background: none;
|
|
137
|
-
cursor: pointer;
|
|
138
|
-
white-space: nowrap;
|
|
139
|
-
color: var(--color-text-dark);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.filterGroupSearchNotFoundClear:hover,
|
|
143
|
-
.filterGroupSearchNotFoundClear:active,
|
|
144
|
-
.filterGroupSearchNotFoundClear:focus {
|
|
145
|
-
color: var(--color-text-dark);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
113
|
.filterGroupItems {
|
|
149
114
|
max-height: calc(10 * (var(--space-small) + 2 * var(--space-xxxsmall)));
|
|
150
115
|
overflow: auto;
|
|
@@ -158,23 +123,6 @@
|
|
|
158
123
|
border-top: 1px solid var(--color-outline);
|
|
159
124
|
}
|
|
160
125
|
|
|
161
|
-
/* clear / check all */
|
|
162
|
-
.filterGroupButton {
|
|
163
|
-
margin-top: calc(0px - var(--space-xxxsmall));
|
|
164
|
-
margin-bottom: calc(0px - var(--space-xxxsmall));
|
|
165
|
-
margin-right: calc(0px - var(--space-xxxsmall));
|
|
166
|
-
padding: var(--space-xxxsmall) 0;
|
|
167
|
-
outline: none;
|
|
168
|
-
appearance: none;
|
|
169
|
-
border: none;
|
|
170
|
-
background: none;
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
white-space: nowrap;
|
|
173
|
-
color: var(--color-primary);
|
|
174
|
-
font-size: var(--size-small);
|
|
175
|
-
line-height: 1;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
126
|
.item {
|
|
179
127
|
position: relative;
|
|
180
128
|
flex: 0 0 auto;
|
|
@@ -4,6 +4,7 @@ import cx from 'classnames';
|
|
|
4
4
|
import type { FilterFieldsData, FilterGroupFieldData } from '../../types';
|
|
5
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
6
6
|
import { Stack } from '../../layout/stack';
|
|
7
|
+
import { Button } from '../button';
|
|
7
8
|
import { Dropdown } from '../dropdown';
|
|
8
9
|
import { InputSearch } from '../input-search';
|
|
9
10
|
import * as I18N from './filters.i18n';
|
|
@@ -49,9 +50,16 @@ const Filter = (props: FilterProps) => {
|
|
|
49
50
|
</FlexStack>
|
|
50
51
|
|
|
51
52
|
{getOnOnlyClick && (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
<Button
|
|
54
|
+
kind="info"
|
|
55
|
+
solid
|
|
56
|
+
size="small"
|
|
57
|
+
type="button"
|
|
58
|
+
onClick={getOnOnlyClick(name)}
|
|
59
|
+
className={css.filterOnlyButton}
|
|
60
|
+
>
|
|
61
|
+
{I18N.ONLY}
|
|
62
|
+
</Button>
|
|
55
63
|
)}
|
|
56
64
|
</Component>
|
|
57
65
|
);
|
|
@@ -135,7 +143,7 @@ const FilterGroup = (props: FilterGroupProps) => {
|
|
|
135
143
|
<InputSearch
|
|
136
144
|
defaultValue={search}
|
|
137
145
|
onChange={setSearch}
|
|
138
|
-
placeholder={I18N.
|
|
146
|
+
placeholder={I18N.GROUP_SEARCH}
|
|
139
147
|
debounceWait={0}
|
|
140
148
|
/>
|
|
141
149
|
</div>
|
|
@@ -143,15 +151,17 @@ const FilterGroup = (props: FilterGroupProps) => {
|
|
|
143
151
|
<div className={css.filterGroupItems}>
|
|
144
152
|
{filteredGroupItems.length === 0 && (
|
|
145
153
|
<Stack className={css.filterGroupSearchNotFound}>
|
|
146
|
-
<p>{I18N.
|
|
154
|
+
<p>{I18N.GROUP_NOT_FOUND}</p>
|
|
147
155
|
<div>
|
|
148
|
-
<
|
|
156
|
+
<Button
|
|
157
|
+
size="small"
|
|
158
|
+
kind="primary"
|
|
149
159
|
type="button"
|
|
150
160
|
onClick={() => setSearch('')}
|
|
151
161
|
className={css.filterGroupSearchNotFoundClear}
|
|
152
162
|
>
|
|
153
|
-
{I18N.
|
|
154
|
-
</
|
|
163
|
+
{I18N.GROUP_SEARCH_CLEAR}
|
|
164
|
+
</Button>
|
|
155
165
|
</div>
|
|
156
166
|
</Stack>
|
|
157
167
|
)}
|
package/src/ui/index.js
CHANGED
|
@@ -9,33 +9,16 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.cancelButton {
|
|
12
|
-
appearance: none;
|
|
13
|
-
padding: 0;
|
|
14
|
-
border: 0;
|
|
15
|
-
background: none;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
border-radius: 50%;
|
|
18
12
|
position: absolute;
|
|
19
|
-
right:
|
|
13
|
+
right: var(--space-xxxsmall);
|
|
20
14
|
top: 50%;
|
|
21
15
|
transform: translateY(-50%);
|
|
22
|
-
padding: var(--space-xxxsmall);
|
|
23
|
-
width: var(--space-medium);
|
|
24
|
-
height: var(--space-medium);
|
|
25
16
|
background: radial-gradient(var(--color-background) 50%, transparent);
|
|
26
17
|
color: var(--color-text-ultra-light);
|
|
27
|
-
transition: var(--transition-in);
|
|
28
18
|
}
|
|
29
19
|
|
|
30
20
|
.cancelButton:focus,
|
|
31
21
|
.cancelButton:hover,
|
|
32
22
|
.cancelButton:active {
|
|
33
23
|
color: var(--color-text-light);
|
|
34
|
-
transition: var(--transition-out);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.cancelButtonIcon {
|
|
38
|
-
display: block;
|
|
39
|
-
width: var(--space-small);
|
|
40
|
-
height: var(--space-small);
|
|
41
24
|
}
|
|
@@ -3,6 +3,7 @@ import cx from 'classnames';
|
|
|
3
3
|
import debounce from 'lodash/debounce';
|
|
4
4
|
import noop from 'lodash/noop';
|
|
5
5
|
|
|
6
|
+
import { Button } from '../button';
|
|
6
7
|
import { Icon } from '../icon';
|
|
7
8
|
import { Input } from '../input';
|
|
8
9
|
|
|
@@ -68,14 +69,16 @@ export const InputSearch = (
|
|
|
68
69
|
autoComplete="off"
|
|
69
70
|
/>
|
|
70
71
|
{value && (
|
|
71
|
-
<
|
|
72
|
-
|
|
72
|
+
<Button
|
|
73
|
+
radius="circle"
|
|
74
|
+
padding="small"
|
|
73
75
|
type="button"
|
|
74
76
|
onClick={clearButtonOnClick}
|
|
75
77
|
aria-label="Clear search"
|
|
78
|
+
className={css.cancelButton}
|
|
76
79
|
>
|
|
77
80
|
<Icon className={css.cancelButtonIcon} glyph={Icon.ICONS.CANCEL} />
|
|
78
|
-
</
|
|
81
|
+
</Button>
|
|
79
82
|
)}
|
|
80
83
|
</div>
|
|
81
84
|
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button as ButtonBaseComponent } from 'ariakit/button';
|
|
3
|
+
declare const SIZE: {
|
|
4
|
+
readonly SMALL: "small";
|
|
5
|
+
readonly MEDIUM: "medium";
|
|
6
|
+
readonly LARGE: "large";
|
|
7
|
+
};
|
|
8
|
+
declare const KIND: {
|
|
9
|
+
readonly PRIMARY: "primary";
|
|
10
|
+
readonly SECONDARY: "secondary";
|
|
11
|
+
readonly DANGE: "danger";
|
|
12
|
+
readonly WARNING: "warning";
|
|
13
|
+
readonly INFO: "info";
|
|
14
|
+
readonly SUCCES: "success";
|
|
15
|
+
};
|
|
16
|
+
type Size = (typeof SIZE)[keyof typeof SIZE];
|
|
17
|
+
type Kind = (typeof KIND)[keyof typeof KIND];
|
|
18
|
+
interface ButtonProps {
|
|
19
|
+
outline?: boolean;
|
|
20
|
+
solid?: boolean;
|
|
21
|
+
kind?: Kind | 'default';
|
|
22
|
+
size?: Size;
|
|
23
|
+
radius?: Size | 'circle' | 'none';
|
|
24
|
+
padding?: Size | 'none';
|
|
25
|
+
}
|
|
26
|
+
export declare const Button: {
|
|
27
|
+
(props: ButtonProps & React.ComponentProps<typeof ButtonBaseComponent>): React.JSX.Element;
|
|
28
|
+
SIZE: {
|
|
29
|
+
readonly SMALL: "small";
|
|
30
|
+
readonly MEDIUM: "medium";
|
|
31
|
+
readonly LARGE: "large";
|
|
32
|
+
};
|
|
33
|
+
KIND: {
|
|
34
|
+
readonly PRIMARY: "primary";
|
|
35
|
+
readonly SECONDARY: "secondary";
|
|
36
|
+
readonly DANGE: "danger";
|
|
37
|
+
readonly WARNING: "warning";
|
|
38
|
+
readonly INFO: "info";
|
|
39
|
+
readonly SUCCES: "success";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
export declare const GROUP_NOT_FOUND = "No filters found";
|
|
2
|
+
export declare const GROUP_SEARCH = "Search by filter name";
|
|
3
|
+
export declare const GROUP_SEARCH_CLEAR = "Clear search";
|
|
4
4
|
export declare const CLEAR = "Clear all";
|
|
5
5
|
export declare const CHECK = "Check all";
|
|
6
|
+
export declare const ONLY = "only";
|