@synerise/ds-subject 1.0.16 → 1.0.18

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/README.md CHANGED
@@ -6,6 +6,7 @@ title: Subject
6
6
  Subject UI Component
7
7
 
8
8
  ## Installation
9
+
9
10
  ```
10
11
  npm i @synerise/ds-subject
11
12
  or
@@ -13,6 +14,7 @@ yarn add @synerise/ds-subject
13
14
  ```
14
15
 
15
16
  ## Usage
17
+
16
18
  ```
17
19
  import Subject from '@synerise/ds-subject'
18
20
 
@@ -49,36 +51,31 @@ import Subject from '@synerise/ds-subject'
49
51
 
50
52
  ## API
51
53
 
52
- | --------- | ------ | ------ | ----- |
53
- | getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement | null) => HTMLElement; | - |
54
- | iconPlaceholder | Icon for empty selected item | React.ReactNode | - |
55
- | items | Array of available subjects | SubjectItem[] | [] |
56
- | onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
57
- | onDeactivate | Callback called when user closes dropdown | () => void | - |
58
- | onSelectItem | Callback called when user select new subject | ( SubjectItem) => void; | - |
59
- | onShowPreview | Callback called when user clicks on Show Preview button | () => void \ undefined | - |
60
- | placeholder | Placeholder for empty selected item | string \ React.ReactNode; | - |
61
- | Property | Description | Type | Default |
62
- | selectedItem? | Selected item | SubjectItem \ undefined; | `undefined` |
63
- | texts | Object with translations | TEXTS | - |
64
- | type? | Type of subject `parameter` \ `context` \ `event` | SubjectType | `parameter` |
65
-
66
-
54
+ | --------- | ------ | ------ | ----- |
55
+ | getPopupContainerOverride | Popup container function for child tooltips and dropdowns | (trigger: HTMLElement | null) => HTMLElement; | - |
56
+ | iconPlaceholder | Icon for empty selected item | React.ReactNode | - |
57
+ | items | Array of available subjects | SubjectItem[] | [] |
58
+ | onActivate | Callback called when user opens dropdown | (fieldType: string) => void | - |
59
+ | onDeactivate | Callback called when user closes dropdown | () => void | - |
60
+ | onSelectItem | Callback called when user select new subject | ( SubjectItem) => void; | - |
61
+ | onShowPreview | Callback called when user clicks on Show Preview button | () => void \ undefined | - |
62
+ | placeholder | Placeholder for empty selected item | string \ React.ReactNode; | - |
63
+ | Property | Description | Type | Default |
64
+ | selectedItem? | Selected item | SubjectItem \ undefined; | `undefined` |
65
+ | texts | Object with translations | TEXTS | - |
66
+ | type? | Type of subject `parameter` \ `context` \ `event` | SubjectType | `parameter` |
67
67
 
68
68
  ### SubjectItem
69
69
 
70
- | Property | Description | Type | Default |
71
- | --------- | ------ | ------ | ----- |
72
- | icon | Icon of subject item | React.ReactNode | - |
73
- | id | Id of subject item | React.ReactText | - |
74
- | name | Name of subject item | string | - |
75
-
76
-
70
+ | Property | Description | Type | Default |
71
+ | -------- | -------------------- | --------------- | ------- |
72
+ | icon | Icon of subject item | React.ReactNode | - |
73
+ | id | Id of subject item | React.ReactText | - |
74
+ | name | Name of subject item | string | - |
77
75
 
78
76
  ### TEXTS
79
- | Property | Description | Type | Default |
80
- | --------- | ------ | ------ | ----- |
81
- | noResults | No results info | string | - |
82
- | searchPlaceholder | Search box placeholder | string | - |
83
77
 
84
-
78
+ | Property | Description | Type | Default |
79
+ | ----------------- | ---------------------- | ------ | ------- |
80
+ | noResults | No results info | string | - |
81
+ | searchPlaceholder | Search box placeholder | string | - |
package/dist/Subject.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SubjectProps } from './Subject.types';
2
+ import { type SubjectProps } from './Subject.types';
3
3
  declare const Subject: React.FC<SubjectProps>;
4
4
  export default Subject;
package/dist/Subject.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import Dropdown from '@synerise/ds-dropdown';
3
3
  import Icon, { ShowM } from '@synerise/ds-icon';
4
- import SubjectTrigger from './SubjectTrigger/SubjectTrigger';
5
4
  import * as S from './Subject.style';
6
5
  import SubjectList from './SubjectList/SubjectList';
6
+ import SubjectTrigger from './SubjectTrigger/SubjectTrigger';
7
7
  var Subject = function Subject(_ref) {
8
8
  var selectedItem = _ref.selectedItem,
9
9
  iconPlaceholder = _ref.iconPlaceholder,
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode, ReactText } from 'react';
2
2
  export declare const ALL_TYPES: readonly ["event", "parameter", "context"];
3
- export type SubjectType = typeof ALL_TYPES[number] | string;
3
+ export type SubjectType = (typeof ALL_TYPES)[number] | string;
4
4
  export type SubjectItem = {
5
5
  id: ReactText;
6
6
  name: string;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SubjectListProps } from '../Subject.types';
2
+ import { type SubjectListProps } from '../Subject.types';
3
3
  declare const SubjectList: React.FC<SubjectListProps>;
4
4
  export default SubjectList;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
+ import { v4 as uuid } from 'uuid';
2
3
  import Dropdown from '@synerise/ds-dropdown';
3
- import Scrollbar from '@synerise/ds-scrollbar';
4
+ import Icon, { SearchM } from '@synerise/ds-icon';
4
5
  import Result from '@synerise/ds-result';
6
+ import Scrollbar from '@synerise/ds-scrollbar';
5
7
  import { focusWithArrowKeys, useOnClickOutside } from '@synerise/ds-utils';
6
- import Icon, { SearchM } from '@synerise/ds-icon';
7
- import { v4 as uuid } from 'uuid';
8
8
  import * as S from './SubjectList.styles';
9
9
  import SubjectListItem from './SubjectListItem';
10
10
  var SubjectList = function SubjectList(_ref) {
@@ -50,7 +50,6 @@ var SubjectList = function SubjectList(_ref) {
50
50
  "data-testid": "subject-overlay",
51
51
  onKeyDown: function onKeyDown(e) {
52
52
  setSearchInputFocus(false);
53
- // eslint-disable-next-line @typescript-eslint/no-empty-function
54
53
  searchQuery && focusWithArrowKeys(e, classNames.split(' ')[1], function () {
55
54
  setSearchInputFocus(true);
56
55
  });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { SubjectItem } from '../Subject.types';
2
+ import { type SubjectItem } from '../Subject.types';
3
3
  type Props = {
4
4
  item: SubjectItem;
5
5
  clearSearch: () => void;
@@ -8,5 +8,5 @@ type Props = {
8
8
  select: (item: SubjectItem) => void;
9
9
  className: string;
10
10
  };
11
- declare const SubjectListItem: ({ item, clearSearch, searchQuery, hideDropdown, select, className }: Props) => React.JSX.Element;
11
+ declare const SubjectListItem: ({ item, clearSearch, searchQuery, hideDropdown, select, className, }: Props) => React.JSX.Element;
12
12
  export default SubjectListItem;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { SubjectTriggerProps } from '../Subject.types';
2
+ import { type SubjectTriggerProps } from '../Subject.types';
3
3
  declare const SubjectTrigger: React.FC<SubjectTriggerProps>;
4
4
  export default SubjectTrigger;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { default } from './Subject';
2
- export type { SubjectProps, SubjectItem, SubjectListProps, SubjectTriggerProps, SubjectType } from './Subject.types';
2
+ export type { SubjectProps, SubjectItem, SubjectListProps, SubjectTriggerProps, SubjectType, } from './Subject.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-subject",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Subject UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,13 +34,13 @@
34
34
  ],
35
35
  "types": "dist/index.d.ts",
36
36
  "dependencies": {
37
- "@synerise/ds-button": "^1.4.1",
38
- "@synerise/ds-dropdown": "^1.0.14",
39
- "@synerise/ds-icon": "^1.5.3",
40
- "@synerise/ds-list-item": "^1.0.12",
41
- "@synerise/ds-result": "^1.0.13",
42
- "@synerise/ds-scrollbar": "^1.1.1",
43
- "@synerise/ds-utils": "^1.3.0",
37
+ "@synerise/ds-button": "^1.4.3",
38
+ "@synerise/ds-dropdown": "^1.0.16",
39
+ "@synerise/ds-icon": "^1.5.4",
40
+ "@synerise/ds-list-item": "^1.0.13",
41
+ "@synerise/ds-result": "^1.0.15",
42
+ "@synerise/ds-scrollbar": "^1.1.2",
43
+ "@synerise/ds-utils": "^1.3.1",
44
44
  "uuid": "^8.3.2"
45
45
  },
46
46
  "peerDependencies": {
@@ -48,5 +48,5 @@
48
48
  "react": ">=16.9.0 <= 18.3.1",
49
49
  "styled-components": "^5.3.3"
50
50
  },
51
- "gitHead": "11fe1d29b2ac23e70c3d5e6ce8ae20201a619a34"
51
+ "gitHead": "8db1900bf3f7b0782c834ff82f628199530cd934"
52
52
  }