@semcore/select 17.3.0-prerelease.0 → 17.4.0-prerelease.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/lib/cjs/InputSearch.js +6 -6
  3. package/lib/cjs/Select.js +8 -8
  4. package/lib/cjs/components/AutoSuggest/AutoSuggest.js +506 -0
  5. package/lib/cjs/components/AutoSuggest/AutoSuggest.js.map +1 -0
  6. package/lib/cjs/components/AutoSuggest/AutoSuggest.type.js +2 -0
  7. package/lib/cjs/components/AutoSuggest/AutoSuggest.type.js.map +1 -0
  8. package/lib/cjs/components/AutoSuggest/Highlight.js +49 -0
  9. package/lib/cjs/components/AutoSuggest/Highlight.js.map +1 -0
  10. package/lib/cjs/index.d.js.map +1 -1
  11. package/lib/cjs/index.js +9 -1
  12. package/lib/cjs/index.js.map +1 -1
  13. package/lib/cjs/translations/en.json +2 -1
  14. package/lib/es6/InputSearch.js +6 -6
  15. package/lib/es6/Select.js +8 -8
  16. package/lib/es6/components/AutoSuggest/AutoSuggest.js +504 -0
  17. package/lib/es6/components/AutoSuggest/AutoSuggest.js.map +1 -0
  18. package/lib/es6/components/AutoSuggest/AutoSuggest.type.js +2 -0
  19. package/lib/es6/components/AutoSuggest/AutoSuggest.type.js.map +1 -0
  20. package/lib/es6/components/AutoSuggest/Highlight.js +42 -0
  21. package/lib/es6/components/AutoSuggest/Highlight.js.map +1 -0
  22. package/lib/es6/index.d.js.map +1 -1
  23. package/lib/es6/index.js +1 -0
  24. package/lib/es6/index.js.map +1 -1
  25. package/lib/es6/translations/en.json +2 -1
  26. package/lib/esm/InputSearch.mjs +7 -7
  27. package/lib/esm/Select.mjs +9 -9
  28. package/lib/esm/components/AutoSuggest/AutoSuggest.mjs +500 -0
  29. package/lib/esm/components/AutoSuggest/Highlight.mjs +44 -0
  30. package/lib/esm/index.mjs +2 -0
  31. package/lib/esm/translations/en.json.mjs +2 -1
  32. package/lib/types/components/AutoSuggest/AutoSuggest.d.ts +2 -0
  33. package/lib/types/components/AutoSuggest/AutoSuggest.type.d.ts +126 -0
  34. package/lib/types/components/AutoSuggest/Highlight.d.ts +7 -0
  35. package/lib/types/index.d.ts +6 -3
  36. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +87 -0
  37. package/package.json +15 -14
@@ -0,0 +1,2 @@
1
+ import type { NSAutoSuggest } from './AutoSuggest.type';
2
+ export declare const AutoSuggest: NSAutoSuggest.Component;
@@ -0,0 +1,126 @@
1
+ import type { NeighborItemProps } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import type Dropdown from '@semcore/dropdown';
4
+ import type { DropdownTriggerProps } from '@semcore/dropdown';
5
+ import type { InputValueProps, InputProps } from '@semcore/input';
6
+ import type Input from '@semcore/input';
7
+ import type React from 'react';
8
+ import type Select from '../../index';
9
+ declare namespace NSAutoSuggest {
10
+ type Suggestion = string;
11
+ type Props = InputValueProps & {
12
+ /**
13
+ * List of suggestions or async function to load suggestions.
14
+ */
15
+ suggestions: Suggestion[] | ((value: string, signal: AbortSignal) => Promise<Suggestion[]>);
16
+ /**
17
+ * Placeholder in popper for init state.
18
+ * Set an empty string to hide init state.
19
+ */
20
+ statusItemPlaceholder?: string;
21
+ /** Tag for the left Addon */
22
+ addonLeft?: React.ElementType;
23
+ /** Tag for the right Addon */
24
+ addonRight?: React.ElementType;
25
+ };
26
+ type State = {
27
+ isVisible: boolean;
28
+ highlightedIndex: number;
29
+ suggestions: Suggestion[];
30
+ openOnChanges: boolean;
31
+ isLoading: boolean;
32
+ };
33
+ type DefaultProps = {
34
+ defaultValue: string;
35
+ placeholder: string;
36
+ children: React.ReactNode;
37
+ };
38
+ type Handlers = {
39
+ value: null;
40
+ };
41
+ namespace Trigger {
42
+ type Props = {};
43
+ type InnerProps = {
44
+ 'tag': typeof Input;
45
+ 'onFocus': () => void;
46
+ 'onBlur': () => void;
47
+ 'aria-haspopup': 'listbox';
48
+ 'aria-expanded': 'true' | 'false';
49
+ 'aria-controls': string;
50
+ 'addonLeft'?: React.ElementType;
51
+ 'addonRight'?: React.ElementType;
52
+ 'isLoading': NSAutoSuggest.State['isLoading'];
53
+ 'size': NSAutoSuggest.Props['size'];
54
+ 'getI18nText': (str: string) => string;
55
+ 'neighborLocation': NeighborItemProps['neighborLocation'];
56
+ };
57
+ namespace Value {
58
+ type Props = {};
59
+ type InnerProps = {
60
+ id: string;
61
+ neighborLocation: NeighborItemProps['neighborLocation'];
62
+ value: string;
63
+ role: 'combobox';
64
+ onChange: (value: string, e: React.SyntheticEvent) => void;
65
+ onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
66
+ autoComplete: 'off';
67
+ ref?: React.Ref<any>;
68
+ };
69
+ type Component = Intergalactic.Component<typeof Input.Value, Props>;
70
+ }
71
+ type Component = Intergalactic.Component<typeof Dropdown.Trigger & typeof Input, DropdownTriggerProps & InputProps> & {
72
+ Value: Value.Component;
73
+ };
74
+ }
75
+ namespace Popper {
76
+ type Props = {};
77
+ type InnerProps = {
78
+ 'aria-labelledby': string;
79
+ 'ref': React.RefObject<HTMLElement>;
80
+ };
81
+ namespace LoadingState {
82
+ type InnerProps = {
83
+ isLoading: boolean;
84
+ };
85
+ type Component = Intergalactic.Component<typeof Dropdown.StatusItem>;
86
+ }
87
+ namespace StartTypingState {
88
+ type InnerProps = {
89
+ isLoading: boolean;
90
+ isStartTypingState: boolean;
91
+ children: string;
92
+ };
93
+ type Component = Intergalactic.Component<typeof Dropdown.StatusItem>;
94
+ }
95
+ namespace List {
96
+ type InnerProps = {
97
+ 'value': string;
98
+ 'isLoading': boolean;
99
+ 'suggestions': Suggestion[];
100
+ 'isStartTypingState': boolean;
101
+ 'aria-label': string;
102
+ };
103
+ type Component = Intergalactic.Component<typeof Select.List>;
104
+ }
105
+ namespace SuggestionItem {
106
+ type InnerProps = {
107
+ value: Suggestion;
108
+ selected: false;
109
+ onClick: (e: React.SyntheticEvent) => void;
110
+ children: React.ReactNode;
111
+ };
112
+ type Component = Intergalactic.Component<typeof Dropdown.StatusItem>;
113
+ }
114
+ type Component = Intergalactic.Component<typeof Select.Popper, Props> & {
115
+ LoadingState: LoadingState.Component;
116
+ StartTypingState: StartTypingState.Component;
117
+ List: List.Component;
118
+ SuggestionItem: SuggestionItem.Component;
119
+ };
120
+ }
121
+ type Component = Intergalactic.Component<typeof Input, Props> & {
122
+ Trigger: Trigger.Component;
123
+ Popper: Popper.Component;
124
+ };
125
+ }
126
+ export { NSAutoSuggest, };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ type HighlightProps = {
3
+ highlight: string;
4
+ children: string;
5
+ };
6
+ export declare function Highlight({ highlight, children }: HighlightProps): React.JSX.Element;
7
+ export {};
@@ -12,12 +12,13 @@ import type {
12
12
  DropdownMenuTriggerProps,
13
13
  } from '@semcore/dropdown-menu';
14
14
  import type DropdownMenu from '@semcore/dropdown-menu';
15
- import type { InputValueProps } from '@semcore/input';
15
+ import type { NSInput } from '@semcore/input';
16
16
  import type Input from '@semcore/input';
17
17
  import type { Text } from '@semcore/typography';
18
18
  import type React from 'react';
19
19
 
20
- export type SelectInputSearch = InputValueProps & {};
20
+ export type SelectInputSearch = NSInput.Value.Props & {};
21
+ import type { NSAutoSuggest } from './components/AutoSuggest/AutoSuggest.type';
21
22
 
22
23
  export type OptionValue = string | number;
23
24
  export type SelectValue = string | number | Array<string | number> | null;
@@ -172,5 +173,7 @@ declare const wrapSelect: <PropsExtending extends {}>(
172
173
  ) => React.ReactNode,
173
174
  ) => IntergalacticSelectComponent<PropsExtending>;
174
175
 
175
- export { InputSearch, wrapSelect };
176
+ declare const AutoSuggest: NSAutoSuggest.Component;
177
+
178
+ export { InputSearch, wrapSelect, AutoSuggest, NSAutoSuggest };
176
179
  export default Select;
@@ -0,0 +1,87 @@
1
+ export declare const localizedMessages: {
2
+ de: {
3
+ clearSearch: string;
4
+ selectPlaceholder: string;
5
+ "Select.InputSearch.Value:placeholder": string;
6
+ "Select.InputSearch.Value:aria-label": string;
7
+ };
8
+ en: {
9
+ clearSearch: string;
10
+ selectPlaceholder: string;
11
+ "Select.InputSearch.Value:placeholder": string;
12
+ "Select.InputSearch.Value:aria-label": string;
13
+ "AutoSuggest.Popper.placeholderText": string;
14
+ };
15
+ es: {
16
+ clearSearch: string;
17
+ selectPlaceholder: string;
18
+ "Select.InputSearch.Value:placeholder": string;
19
+ "Select.InputSearch.Value:aria-label": string;
20
+ };
21
+ fr: {
22
+ clearSearch: string;
23
+ selectPlaceholder: string;
24
+ "Select.InputSearch.Value:placeholder": string;
25
+ "Select.InputSearch.Value:aria-label": string;
26
+ };
27
+ it: {
28
+ clearSearch: string;
29
+ selectPlaceholder: string;
30
+ "Select.InputSearch.Value:placeholder": string;
31
+ "Select.InputSearch.Value:aria-label": string;
32
+ };
33
+ ja: {
34
+ clearSearch: string;
35
+ selectPlaceholder: string;
36
+ "Select.InputSearch.Value:placeholder": string;
37
+ "Select.InputSearch.Value:aria-label": string;
38
+ };
39
+ ko: {
40
+ clearSearch: string;
41
+ selectPlaceholder: string;
42
+ "Select.InputSearch.Value:placeholder": string;
43
+ "Select.InputSearch.Value:aria-label": string;
44
+ };
45
+ nl: {
46
+ clearSearch: string;
47
+ selectPlaceholder: string;
48
+ "Select.InputSearch.Value:placeholder": string;
49
+ "Select.InputSearch.Value:aria-label": string;
50
+ };
51
+ pt: {
52
+ clearSearch: string;
53
+ selectPlaceholder: string;
54
+ "Select.InputSearch.Value:placeholder": string;
55
+ "Select.InputSearch.Value:aria-label": string;
56
+ };
57
+ tr: {
58
+ clearSearch: string;
59
+ selectPlaceholder: string;
60
+ "Select.InputSearch.Value:placeholder": string;
61
+ "Select.InputSearch.Value:aria-label": string;
62
+ };
63
+ vi: {
64
+ clearSearch: string;
65
+ selectPlaceholder: string;
66
+ "Select.InputSearch.Value:placeholder": string;
67
+ "Select.InputSearch.Value:aria-label": string;
68
+ };
69
+ zh: {
70
+ clearSearch: string;
71
+ selectPlaceholder: string;
72
+ "Select.InputSearch.Value:placeholder": string;
73
+ "Select.InputSearch.Value:aria-label": string;
74
+ };
75
+ pl: {
76
+ clearSearch: string;
77
+ selectPlaceholder: string;
78
+ "Select.InputSearch.Value:placeholder": string;
79
+ "Select.InputSearch.Value:aria-label": string;
80
+ };
81
+ sv: {
82
+ clearSearch: string;
83
+ selectPlaceholder: string;
84
+ "Select.InputSearch.Value:placeholder": string;
85
+ "Select.InputSearch.Value:aria-label": string;
86
+ };
87
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/select",
3
3
  "description": "Semrush Select Component",
4
- "version": "17.3.0-prerelease.0",
4
+ "version": "17.4.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -13,19 +13,20 @@
13
13
  "require": "./lib/cjs/index.js"
14
14
  },
15
15
  "dependencies": {
16
- "@semcore/base-trigger": "^17.2.1-prerelease.0",
17
- "@semcore/button": "^17.2.1-prerelease.0",
18
- "@semcore/checkbox": "^17.2.1-prerelease.0",
19
- "@semcore/divider": "^17.2.1-prerelease.0",
20
- "@semcore/dropdown": "^17.3.0-prerelease.0",
21
- "@semcore/dropdown-menu": "^17.3.0-prerelease.0",
22
- "@semcore/input": "^17.2.1-prerelease.0",
23
- "@semcore/typography": "^17.2.1-prerelease.0",
16
+ "@semcore/base-trigger": "^17.2.1",
17
+ "@semcore/button": "^17.2.1",
18
+ "@semcore/checkbox": "^17.2.1",
19
+ "@semcore/divider": "^17.2.1",
20
+ "@semcore/dropdown": "^17.3.0",
21
+ "@semcore/dropdown-menu": "^17.3.1-prerelease.0",
22
+ "@semcore/input": "^17.2.2-prerelease.0",
23
+ "@semcore/spin": "^17.2.1",
24
+ "@semcore/typography": "^17.2.1",
24
25
  "classnames": "2.2.6"
25
26
  },
26
27
  "peerDependencies": {
27
28
  "@semcore/base-components": "^17.2.1",
28
- "@semcore/icon": "^17.2.1"
29
+ "@semcore/icon": "^17.2.0"
29
30
  },
30
31
  "repository": {
31
32
  "type": "git",
@@ -34,12 +35,12 @@
34
35
  },
35
36
  "devDependencies": {
36
37
  "@types/classnames": "2.2.6",
37
- "@semcore/core": "17.2.1-prerelease.0",
38
+ "@semcore/core": "17.2.1",
38
39
  "@semcore/testing-utils": "1.0.0",
39
- "@semcore/base-components": "17.2.1-prerelease.0",
40
- "@semcore/icon": "17.2.1-prerelease.0"
40
+ "@semcore/base-components": "17.2.1",
41
+ "@semcore/icon": "17.2.0"
41
42
  },
42
43
  "scripts": {
43
- "build": "pnpm semcore-builder --source=js && pnpm vite build"
44
+ "build": "pnpm semcore-builder --source=js,ts && pnpm vite build"
44
45
  }
45
46
  }