@ssa-ui-kit/widgets 0.0.8-alpha → 0.0.9-alpha

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.
Files changed (47) hide show
  1. package/custom-shots/widgets-bots-table--no-control-orders--menu-opened_[w1920px].png +0 -0
  2. package/custom-shots/widgets-bots-table--no-control-orders--run-reason-modal_[w1920px].png +0 -0
  3. package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px].png +0 -0
  4. package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px]_side_menu_expanded.png +0 -0
  5. package/custom-shots/widgets-collapsiblenavbar-opened__[w899px]_statistics_submenu.png +0 -0
  6. package/custom-shots/widgets-filters--default__[w1920px].png +0 -0
  7. package/custom-shots/widgets-filters--filter-button-items-not-selected__[w390px].png +0 -0
  8. package/custom-shots/widgets-filters--filter-button__[w390px].png +0 -0
  9. package/custom-shots/widgets-filters--more-button-items-selected__[w390px].png +0 -0
  10. package/custom-shots/widgets-filters--more-button__[w900px].png +0 -0
  11. package/custom-shots/widgets-linkstabbar--current-focus__[w1920px].png +0 -0
  12. package/custom-shots/widgets-meal-nutrients--hint-opened__[w1440px].png +0 -0
  13. package/custom-shots/widgets-meal-nutrients--hint-opened__[w1920px].png +0 -0
  14. package/custom-shots/widgets-meal-nutrients--hint-opened__[w390px].png +0 -0
  15. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w390px].png +0 -0
  16. package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w900px].png +0 -0
  17. package/custom-shots/widgets-notification-menu--is-opened__[w1440px].png +0 -0
  18. package/custom-shots/widgets-notification-menu--is-opened__[w390px].png +0 -0
  19. package/custom-shots/widgets-notification-menu--is-opened__[w900px].png +0 -0
  20. package/custom-shots/widgets-pagination--selected-hover__[w1920px].png +0 -0
  21. package/custom-shots/widgets-progressInfo__[w390px].png +0 -0
  22. package/custom-shots/widgets-progressInfo__[w900px].png +0 -0
  23. package/custom-shots/widgets-searchbox--cross-icon__[w900px].png +0 -0
  24. package/custom-shots/widgets-searchbox--search-icon__[w900px].png +0 -0
  25. package/dist/components/CollapsibleNavBar/stories/Layout.d.ts +3 -0
  26. package/dist/components/Filters/stories/StoryComponent.d.ts +3 -1
  27. package/dist/components/Filters/stories/mockData.d.ts +1 -0
  28. package/dist/components/TableFilters/TableFilterTrigger.d.ts +3 -2
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/package.json +2 -2
  32. package/src/components/CollapsibleNavBar/CollapsibleNavBarBase.ts +7 -3
  33. package/src/components/CollapsibleNavBar/CollapsibleNavBarWrapper.ts +4 -3
  34. package/src/components/CollapsibleNavBar/NavBarPopover.tsx +1 -0
  35. package/src/components/CollapsibleNavBar/stories/CollapsibleNavBar.stories.tsx +2 -6
  36. package/src/components/CollapsibleNavBar/stories/Layout.tsx +53 -0
  37. package/src/components/Filters/Filters.e2e.ts +37 -4
  38. package/src/components/Filters/FiltersWrapper.tsx +16 -0
  39. package/src/components/Filters/stories/Filters.stories.tsx +7 -0
  40. package/src/components/Filters/stories/StoryComponent.tsx +2 -2
  41. package/src/components/Filters/stories/mockData.ts +209 -0
  42. package/src/components/SearchBox/SearchBoxInput.tsx +24 -2
  43. package/src/components/SearchBox/SearchBoxWrapper.tsx +5 -2
  44. package/src/components/TableFilters/TableFilterTrigger.tsx +34 -30
  45. package/src/components/TableFilters/TableFilterTriggerWithNotification.tsx +1 -1
  46. package/tsbuildcache +1 -1
  47. package/test-results/src-components-TableFilters-TableFilters.e2e.ts-Widgets-TableFilters-Opens-popover-chromium/trace.zip +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssa-ui-kit/widgets",
3
- "version": "0.0.8-alpha",
3
+ "version": "0.0.9-alpha",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "private": false,
@@ -29,7 +29,7 @@
29
29
  "js-tokens": "^4.0.0",
30
30
  "loose-envify": "^1.4.0",
31
31
  "scheduler": "^0.23.0",
32
- "@ssa-ui-kit/core": "^0.0.6-alpha",
32
+ "@ssa-ui-kit/core": "^0.0.7-alpha",
33
33
  "@ssa-ui-kit/utils": "^0.0.1-alpha",
34
34
  "@ssa-ui-kit/hooks": "^0.0.1-alpha"
35
35
  },
@@ -35,12 +35,13 @@ const CollapsibleNavBarBase = styled(NavBarBase)`
35
35
  }
36
36
 
37
37
  &:has(> input[type='checkbox']:checked) {
38
- position: static;
39
38
  background: linear-gradient(
40
39
  108.3deg,
41
40
  ${({ theme }) => theme.colors.greyDarker} -0.36%,
42
41
  ${({ theme }) => theme.colors.greyDarker} 100%
43
42
  );
43
+ min-width: 100%;
44
+ width: 100%;
44
45
  height: 100%;
45
46
  }
46
47
 
@@ -66,7 +67,7 @@ const CollapsibleNavBarBase = styled(NavBarBase)`
66
67
  }
67
68
 
68
69
  & ~ div:nth-of-type(2) {
69
- opacity: 1;
70
+ display: block;
70
71
  border-radius: 12px 12px 0 0;
71
72
  height: calc(100vh - 60px);
72
73
 
@@ -81,7 +82,10 @@ const CollapsibleNavBarBase = styled(NavBarBase)`
81
82
  ${({ theme }) => theme.mediaQueries.md} {
82
83
  width: 85px;
83
84
  padding: 0;
84
- height: 100%;
85
+ position: static;
86
+ z-index: 0;
87
+ height: auto;
88
+
85
89
  & li {
86
90
  ${staticIconsToggle(false)}
87
91
  ${popupIconsToggle(true)}
@@ -4,17 +4,18 @@ import NavBarWrapper from '@components/NavBar/NavBarWrapper';
4
4
  const CollapsibleNavBarWrapper = styled(NavBarWrapper)`
5
5
  transform: none;
6
6
  transition: unset;
7
+ position: static;
7
8
 
8
- opacity: 0;
9
+ display: none;
9
10
  width: 100%;
11
+
10
12
  ${({ theme }) => theme.mediaQueries.md} {
11
13
  display: flex;
12
14
  flex-direction: column;
13
15
  align-items: center;
14
- opacity: 1;
15
16
  height: 100%;
17
+ min-height: 100vh;
16
18
  width: 85px;
17
- top: auto;
18
19
  border-radius: 0;
19
20
  padding-top: 35px;
20
21
  }
@@ -64,6 +64,7 @@ export const CollapsibleNavBarPopover = ({
64
64
  [theme.mediaQueries.md]: {
65
65
  display: 'block',
66
66
  },
67
+ zIndex: 2,
67
68
  }}>
68
69
  <PopoverHeading
69
70
  css={{
@@ -7,6 +7,7 @@ import { DecoratorFunction } from '@storybook/types';
7
7
  import { CollapsibleNavBar } from '../CollapsibleNavBar';
8
8
  import { ITEMS } from './consts';
9
9
  import { Logo } from './Logo';
10
+ import { Layout } from './Layout';
10
11
 
11
12
  type Args = Parameters<typeof CollapsibleNavBar>[0];
12
13
 
@@ -42,12 +43,7 @@ export default {
42
43
  ),
43
44
  },
44
45
  },
45
- decorators: [
46
- reactRouterDecorator,
47
- (Story) => (
48
- <div style={{ height: '100vh', position: 'relative' }}>{Story()}</div>
49
- ),
50
- ],
46
+ decorators: [reactRouterDecorator, (Story) => <Layout>{Story()}</Layout>],
51
47
  args: {
52
48
  items: ITEMS,
53
49
  renderLogo: <Logo />,
@@ -0,0 +1,53 @@
1
+ import styled from '@emotion/styled';
2
+ import { NotificationCard } from '@components/NotificationCard';
3
+
4
+ const Main = styled.main`
5
+ background: linear-gradient(
6
+ 143deg,
7
+ #e7ebf1 -4.16%,
8
+ #d7d9dd 39.37%,
9
+ #cccdd2 52.66%,
10
+ #e1e4ea 87.68%
11
+ ),
12
+ #f8f9fb;
13
+ width: 100%;
14
+ padding: 60px 10px 10px 15px;
15
+
16
+ ${({ theme }) => theme.mediaQueries.md} {
17
+ padding: 10px 21px 10px 35px;
18
+ }
19
+
20
+ ${({ theme }) => theme.mediaQueries.lg} {
21
+ padding: 10px 49px 10px 36px;
22
+ }
23
+
24
+ ${({ theme }) => theme.mediaQueries.xlg} {
25
+ padding: 10px 60px 10px 62px;
26
+ }
27
+ `;
28
+ export const Layout = ({ children }: { children: React.ReactNode }) => {
29
+ /* cSpell:disable */
30
+ return (
31
+ <div
32
+ css={{
33
+ display: 'flex',
34
+ minHeight: '100vh',
35
+ position: 'relative',
36
+ }}>
37
+ {children}
38
+ <Main>
39
+ {new Array(100).fill(1).map((_, index) => (
40
+ <NotificationCard
41
+ key={index}
42
+ title="CyberVeinToken is Now Available"
43
+ text="With our newest listing, we’re welcoming Wrapped"
44
+ isRead={false}
45
+ type="Informational"
46
+ time={Date.now()}
47
+ />
48
+ ))}
49
+ </Main>
50
+ </div>
51
+ );
52
+ /* cSpell:enable */
53
+ };
@@ -36,17 +36,19 @@ test('Widgets: Filters - More button should be shown', async ({ page }) => {
36
36
  });
37
37
  });
38
38
 
39
- test('Widgets: Filters - Filter button should be shown', async ({ page }) => {
39
+ test('Widgets: Filters - More button should be shown when items selected', async ({
40
+ page,
41
+ }) => {
40
42
  await gotoPage(page);
41
43
  await page.setViewportSize(SCREEN_SIZES[390]);
42
44
  const triggerButton = page.getByTestId('trigger-button');
43
45
  const beforeContent = await triggerButton.evaluate((el) => {
44
46
  return window.getComputedStyle(el, ':before').content;
45
47
  });
46
- expect(beforeContent).toEqual('"Filter"');
48
+ expect(beforeContent).toEqual('"More"');
47
49
  const buttonText = await triggerButton.innerText();
48
50
  expect(buttonText).toEqual('4');
49
- const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-filters--filter-button__`;
51
+ const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-filters--more-button-items-selected__`;
50
52
  await page.screenshot({
51
53
  path: `${SCREENSHOT_PREFIX}[w390px].png`,
52
54
  });
@@ -57,7 +59,7 @@ test('Widgets: Filters - More button count notification should be changed', asyn
57
59
  }) => {
58
60
  await gotoPage(page);
59
61
  await page.setViewportSize(SCREEN_SIZES[900]);
60
- let triggerButton = page.getByTestId('trigger-button');
62
+ let triggerButton = await page.getByTestId('trigger-button');
61
63
  let beforeContent = await triggerButton.evaluate((el) => {
62
64
  return window.getComputedStyle(el, ':before').content;
63
65
  });
@@ -80,3 +82,34 @@ test('Widgets: Filters - More button count notification should be changed', asyn
80
82
  buttonText = await triggerButton.innerText();
81
83
  expect(buttonText).toEqual('3');
82
84
  });
85
+
86
+ test('Widgets: Filters - Filter button should be shown when items not selected', async ({
87
+ page,
88
+ }) => {
89
+ await page.goto(
90
+ 'http://localhost:6007/iframe.html?args=&id=widgets-filters--all-items-enabled&viewMode=story',
91
+ );
92
+ await page.setViewportSize(SCREEN_SIZES[390]);
93
+ const triggerButton = page.getByTestId('trigger-button');
94
+ let beforeContent = await triggerButton.evaluate((el) => {
95
+ return window.getComputedStyle(el, ':before').content;
96
+ });
97
+ expect(beforeContent).toEqual('"More"');
98
+ const buttonText = await triggerButton.innerText();
99
+ expect(buttonText).toEqual('1');
100
+
101
+ await page.getByTestId('trigger-button').click();
102
+ /* cSpell:disable */
103
+ await page.locator('label').filter({ hasText: 'Checkcheckbox1' }).click();
104
+ await page.locator('label').filter({ hasText: 'Checkcheckbox4' }).click();
105
+
106
+ beforeContent = await triggerButton.evaluate((el) => {
107
+ return window.getComputedStyle(el, ':before').content;
108
+ });
109
+ expect(beforeContent).toEqual('"Filter"');
110
+
111
+ const SCREENSHOT_PREFIX = `${WIDGETS_CUSTOM_SHOTS_PATH}widgets-filters--filter-button-items-not-selected__`;
112
+ await page.screenshot({
113
+ path: `${SCREENSHOT_PREFIX}[w390px].png`,
114
+ });
115
+ });
@@ -8,6 +8,10 @@ export const FiltersWrapper = styled.div<{ isMoreButtonVisible?: boolean }>`
8
8
  flex-direction: ${({ isMoreButtonVisible }) =>
9
9
  isMoreButtonVisible ? 'row' : 'row-reverse'};
10
10
 
11
+ & button {
12
+ height: 30px;
13
+ }
14
+
11
15
  & > div:first-of-type > div:last-child {
12
16
  margin-right: ${({ isMoreButtonVisible }) =>
13
17
  isMoreButtonVisible ? '10px' : 0};
@@ -15,4 +19,16 @@ export const FiltersWrapper = styled.div<{ isMoreButtonVisible?: boolean }>`
15
19
  right: ${({ isMoreButtonVisible }) => (isMoreButtonVisible ? 'auto' : 0)};
16
20
  }
17
21
  }
22
+
23
+ ${({ theme }) => theme.mediaQueries.md} {
24
+ & button {
25
+ height: 36px;
26
+ }
27
+ }
28
+
29
+ ${({ theme }) => theme.mediaQueries.lg} {
30
+ & button {
31
+ height: 40px;
32
+ }
33
+ }
18
34
  `;
@@ -1,6 +1,7 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react';
2
2
  import { StoryComponent } from './StoryComponent';
3
3
  import { Filters } from '..';
4
+ import { mockDataEnabled } from './mockData';
4
5
 
5
6
  type FiltersType = typeof Filters;
6
7
 
@@ -15,3 +16,9 @@ export const Default: StoryObj<FiltersType> = () => {
15
16
  };
16
17
 
17
18
  Default.args = {};
19
+
20
+ export const AllItemsEnabled: StoryObj<FiltersType> = () => {
21
+ return <StoryComponent data={mockDataEnabled} />;
22
+ };
23
+
24
+ AllItemsEnabled.args = {};
@@ -1,7 +1,7 @@
1
1
  import { mockData } from './mockData';
2
2
  import { Filters } from '..';
3
3
 
4
- export const StoryComponent = () => {
4
+ export const StoryComponent = ({ data = mockData }) => {
5
5
  const handleSubmit = (submitData: Record<string, string[]>) => {
6
6
  console.log('>>>Filters onSubmit', submitData);
7
7
  };
@@ -13,7 +13,7 @@ export const StoryComponent = () => {
13
13
  alignItems: 'center',
14
14
  justifyContent: 'center',
15
15
  }}>
16
- <Filters handleSubmit={handleSubmit} checkboxData={mockData} />
16
+ <Filters handleSubmit={handleSubmit} checkboxData={data} />
17
17
  </div>
18
18
  );
19
19
  };
@@ -210,3 +210,212 @@ export const mockData: TableFilterConfig = {
210
210
  },
211
211
  },
212
212
  };
213
+
214
+ export const mockDataEnabled: TableFilterConfig = {
215
+ strategy: {
216
+ id: 'strategy',
217
+ title: 'Strategy',
218
+ isOpened: true,
219
+ ariaControls: 'strategy-panel',
220
+ selectedItems: ['checkbox1', 'checkbox4'],
221
+ items: {
222
+ checkbox1: {
223
+ key: 'strategy-checkbox1',
224
+ name: 'checkbox1',
225
+ content: {
226
+ statePath: ['strategy', 'items', 'checkbox1'],
227
+ text: 'checkbox1',
228
+ },
229
+ },
230
+ checkbox2: {
231
+ key: 'strategy-checkbox2',
232
+ name: 'checkbox2',
233
+ content: {
234
+ statePath: ['strategy', 'items', 'checkbox2'],
235
+ text: 'checkbox2',
236
+ },
237
+ },
238
+ checkbox3: {
239
+ key: 'strategy-checkbox3',
240
+ name: 'checkbox3',
241
+ content: {
242
+ statePath: ['strategy', 'items', 'checkbox3'],
243
+ text: 'checkbox3',
244
+ },
245
+ },
246
+ checkbox4: {
247
+ key: 'strategy-checkbox4',
248
+ name: 'checkbox4',
249
+ content: {
250
+ statePath: ['strategy', 'items', 'checkbox4'],
251
+ text: 'checkbox4',
252
+ },
253
+ },
254
+ checkbox5: {
255
+ key: 'strategy-checkbox5',
256
+ name: 'checkbox5',
257
+ content: {
258
+ statePath: ['strategy', 'items', 'checkbox5'],
259
+ text: 'checkbox5',
260
+ },
261
+ },
262
+ },
263
+ },
264
+ strategy2: {
265
+ id: 'strategy2',
266
+ title: 'Strategy #2',
267
+ isOpened: false,
268
+ ariaControls: 'strategy2-panel',
269
+ selectedItems: [],
270
+ items: {
271
+ strategy2Checkbox1: {
272
+ key: 'strategy2-checkbox1',
273
+ name: 'strategy2Checkbox1',
274
+ content: {
275
+ statePath: ['strategy', 'items', 'strategy2Checkbox1'],
276
+ text: 'strategy #2 checkbox1',
277
+ },
278
+ },
279
+ strategy2Checkbox2: {
280
+ key: 'strategy2-checkbox2',
281
+ name: 'strategy2Checkbox2',
282
+ content: {
283
+ statePath: ['strategy', 'items', 'strategy2Checkbox2'],
284
+ text: 'strategy #2 checkbox2',
285
+ },
286
+ },
287
+ strategy2Checkbox3: {
288
+ key: 'strategy2-checkbox3',
289
+ name: 'strategy2Checkbox3',
290
+ content: {
291
+ statePath: ['strategy', 'items', 'strategy2Checkbox3'],
292
+ text: 'strategy #2 checkbox3',
293
+ },
294
+ },
295
+ strategy2Checkbox4: {
296
+ key: 'strategy2-checkbox4',
297
+ name: 'strategy2Checkbox4',
298
+ content: {
299
+ statePath: ['strategy', 'items', 'strategy2Checkbox4'],
300
+ text: 'strategy #2 checkbox4',
301
+ },
302
+ },
303
+ strategy2Checkbox5: {
304
+ key: 'strategy2-checkbox5',
305
+ name: 'strategy2Checkbox5',
306
+ content: {
307
+ statePath: ['strategy', 'items', 'strategy2Checkbox5'],
308
+ text: 'strategy #2 checkbox5',
309
+ },
310
+ },
311
+ },
312
+ },
313
+ strategy3: {
314
+ id: 'strategy3',
315
+ title: 'Strategy #3',
316
+ isOpened: false,
317
+ ariaControls: 'strategy3-panel',
318
+ selectedItems: [],
319
+ items: {
320
+ strategy3Checkbox1: {
321
+ key: 'strategy3-checkbox1',
322
+ name: 'strategy3Checkbox1',
323
+ content: {
324
+ statePath: ['strategy', 'items', 'strategy3Checkbox1'],
325
+ text: 'strategy #3 checkbox1',
326
+ },
327
+ },
328
+ strategy3Checkbox2: {
329
+ key: 'strategy3-checkbox2',
330
+ name: 'strategy3Checkbox2',
331
+ content: {
332
+ statePath: ['strategy', 'items', 'strategy3Checkbox2'],
333
+ text: 'strategy #3 checkbox2',
334
+ },
335
+ },
336
+ strategy3Checkbox3: {
337
+ key: 'strategy3-checkbox3',
338
+ name: 'strategy3Checkbox3',
339
+ content: {
340
+ statePath: ['strategy', 'items', 'strategy3Checkbox3'],
341
+ text: 'strategy #3 checkbox3',
342
+ },
343
+ },
344
+ strategy3Checkbox4: {
345
+ key: 'strategy3-checkbox4',
346
+ name: 'strategy3Checkbox4',
347
+ content: {
348
+ statePath: ['strategy', 'items', 'strategy3Checkbox4'],
349
+ text: 'strategy #3 checkbox4',
350
+ },
351
+ },
352
+ strategy3Checkbox5: {
353
+ key: 'strategy3-checkbox5',
354
+ name: 'strategy3Checkbox5',
355
+ content: {
356
+ statePath: ['strategy', 'items', 'strategy3Checkbox5'],
357
+ text: 'strategy #3 checkbox5',
358
+ },
359
+ },
360
+ },
361
+ },
362
+ status: {
363
+ id: 'status',
364
+ title: 'Status',
365
+ isOpened: false,
366
+ ariaControls: 'status-panel',
367
+ selectedItems: [],
368
+ items: {
369
+ running: {
370
+ key: 'status-checkbox-running',
371
+ name: 'running',
372
+ content: {
373
+ statePath: ['status', 'items', 'running'],
374
+ text: 'Running',
375
+ },
376
+ },
377
+ stopped: {
378
+ key: 'status-checkbox-stopped',
379
+ name: 'stopped',
380
+ content: {
381
+ statePath: ['status', 'items', 'stopped'],
382
+ text: 'Stopped',
383
+ },
384
+ },
385
+ },
386
+ },
387
+ pairs: {
388
+ id: 'pairs',
389
+ title: 'Pairs',
390
+ isOpened: false,
391
+ ariaControls: 'pairs-panel',
392
+ selectedItems: [],
393
+ items: {
394
+ btcfdusd: {
395
+ key: 'btcfdusd',
396
+ name: 'btcfdusd',
397
+ content: {
398
+ statePath: ['pairs', 'items', 'btcfdusd'],
399
+ text: 'BTC-FDUSD',
400
+ },
401
+ },
402
+ },
403
+ },
404
+ exchange: {
405
+ id: 'exchange',
406
+ title: 'Exchange',
407
+ isOpened: false,
408
+ ariaControls: 'exchange-panel',
409
+ selectedItems: [],
410
+ items: {
411
+ binance: {
412
+ key: 'binance',
413
+ name: 'binance',
414
+ content: {
415
+ statePath: ['exchange', 'items', 'binance'],
416
+ text: 'Binance',
417
+ },
418
+ },
419
+ },
420
+ },
421
+ };
@@ -2,11 +2,13 @@ import styled from '@emotion/styled';
2
2
  import { Input } from '@ssa-ui-kit/core';
3
3
 
4
4
  export const SearchBoxInput = styled(Input)`
5
- height: 40px;
5
+ height: 30px;
6
+ font-size: 12px;
6
7
  border-radius: 5px;
7
8
  background-color: ${({ theme }) => theme.colors.greyLighter};
8
9
  border: 1px solid #dee0e8;
9
10
  color: ${({ theme }) => theme.colors.greyDarker};
11
+ padding-right: 20px;
10
12
  &::placeholder {
11
13
  color: #55575a;
12
14
  font-weight: 500;
@@ -15,6 +17,26 @@ export const SearchBoxInput = styled(Input)`
15
17
  border: ${({ theme }) => `1px solid ${theme.colors.greyDropdownFocused}`};
16
18
  }
17
19
  & + div {
18
- right: 23px;
20
+ right: 11px;
21
+ & svg {
22
+ width: 12px;
23
+ height: 12px;
24
+ }
25
+ }
26
+ ${({ theme }) => theme.mediaQueries.md} {
27
+ height: 36px;
28
+ font-size: 14px;
29
+ padding-right: 40px;
30
+ & + div {
31
+ right: 23px;
32
+ & svg {
33
+ width: 15px;
34
+ height: 15px;
35
+ }
36
+ }
37
+ }
38
+
39
+ ${({ theme }) => theme.mediaQueries.lg} {
40
+ height: 40px;
19
41
  }
20
42
  `;
@@ -1,6 +1,9 @@
1
1
  import styled from '@emotion/styled';
2
2
 
3
3
  export const SearchBoxWrapper = styled.div`
4
- width: 180px;
5
- height: 40px;
4
+ width: 139px;
5
+
6
+ ${({ theme }) => theme.mediaQueries.md} {
7
+ width: 180px;
8
+ }
6
9
  `;
@@ -2,48 +2,52 @@ import { css, useTheme } from '@emotion/react';
2
2
  import { PopoverTrigger, Icon } from '@ssa-ui-kit/core';
3
3
  import { Theme } from '@emotion/react';
4
4
 
5
- export const filterButtonStyles = (theme: Theme) => css`
6
- height: 40px;
7
- color: ${theme.colors.greyDisabled};
8
- background: ${theme.colors.white};
9
- border: 1px solid ${theme.colors.greyDropdownMain};
10
- border-radius: 6.5px;
11
- padding: 0 11px 0 13px;
12
- font-size: 14px;
13
- letter-spacing: normal;
14
- gap: 5px;
15
- user-select: none;
5
+ export const filterButtonStyles = (count?: number) => (theme: Theme) =>
6
+ css`
7
+ height: 40px;
8
+ color: ${theme.colors.greyDisabled};
9
+ background: ${theme.colors.white};
10
+ border: 1px solid ${theme.colors.greyDropdownMain};
11
+ border-radius: 6.5px;
12
+ padding: 0 11px 0 13px;
13
+ font-size: 14px;
14
+ letter-spacing: normal;
15
+ gap: 5px;
16
+ user-select: none;
16
17
 
17
- &::before {
18
- display: block;
19
- content: 'Filter';
20
- }
21
-
22
- @media screen and (min-width: 900px) {
23
18
  &::before {
24
- content: 'More';
19
+ display: block;
20
+ content: '"Filter"';
21
+ content: ${count ? '"More"' : '"Filter"'};
25
22
  }
26
- }
27
23
 
28
- &:hover {
29
- border-color: ${theme.colors.greyDropdownFocused};
30
- }
24
+ @media screen and (min-width: 900px) {
25
+ &::before {
26
+ content: 'More';
27
+ }
28
+ }
31
29
 
32
- &:active {
33
- border-color: ${theme.colors.blueNotification};
34
- }
30
+ &:hover {
31
+ border-color: ${theme.colors.greyDropdownFocused};
32
+ }
35
33
 
36
- &:disabled {
37
- background: ${theme.colors.grey};
38
- }
39
- `;
34
+ &:active {
35
+ border-color: ${theme.colors.blueNotification};
36
+ }
37
+
38
+ &:disabled {
39
+ background: ${theme.colors.grey};
40
+ }
41
+ `;
40
42
 
41
43
  export const TableFilterTrigger = ({
42
44
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
45
  children,
46
+ count,
44
47
  ...rest
45
48
  }: {
46
49
  children?: React.ReactNode;
50
+ count?: number;
47
51
  as?: string;
48
52
  className?: string;
49
53
  }) => {
@@ -51,7 +55,7 @@ export const TableFilterTrigger = ({
51
55
  return (
52
56
  <PopoverTrigger
53
57
  variant="custom"
54
- css={filterButtonStyles}
58
+ css={filterButtonStyles(count)}
55
59
  endIcon={
56
60
  <Icon name="filter" color={theme.colors.greyFilterIcon} size={20} />
57
61
  }
@@ -20,7 +20,7 @@ export const TableFilterTriggerWithNotification = ({
20
20
  css.borderColor = theme.colors.blueDropdownWithSelectedItemsBorder;
21
21
  }
22
22
  return (
23
- <TableFilterTrigger css={css}>
23
+ <TableFilterTrigger css={css} count={count}>
24
24
  {children}
25
25
  {count ? (
26
26
  <MultipleDropdownNotification