cortex-react-ui 0.1.4 → 0.1.5

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.
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import { Cortex } from './types';
2
3
  export interface TooltipProps {
3
4
  tag: Cortex.Tag;
4
5
  className?: string;
5
6
  onDelete?: () => void;
6
7
  }
7
- declare const Tag: React.FC<TooltipProps>;
8
- export default Tag;
8
+ declare const TagItem: React.FC<TooltipProps>;
9
+ export default TagItem;
@@ -0,0 +1,12 @@
1
+ export declare namespace Cortex {
2
+ type Tag = {
3
+ id: string;
4
+ label: string;
5
+ };
6
+ type TagSuggestion = {
7
+ id: string;
8
+ label: string;
9
+ group?: boolean;
10
+ suggestions?: TagSuggestion[];
11
+ };
12
+ }
@@ -0,0 +1,31 @@
1
+ declare module '*.module.scss' {
2
+ const classes: { readonly [key: string]: string };
3
+ export default classes;
4
+ }
5
+
6
+ /*
7
+ ** Mapped types
8
+ */
9
+ type Nullable<T> = T | null;
10
+ type Writeable<T> = { -readonly [P in keyof T]: T[P] };
11
+ type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
12
+ type Required<T> = { [P in keyof T]-?: T[P] };
13
+ type ValuesOf<T extends readonly any[]> = T[number];
14
+ type ObjectValues<T> = T[keyof T];
15
+ type IndexableProperties<T> = keyof T extends string | number ? keyof T extends infer P ? P : never : never;
16
+ type AssertPropDefined<T, K extends keyof T = never> = {
17
+ [P in keyof T]: P extends K ? NonNullable<T[P]> : T[P];
18
+ };
19
+ type NonEmptyArray<T> = [T, ...T[]];
20
+ type ArrayType<T extends Array<any>> = T extends (infer U)[] ? U : never;
21
+ type NameOfProp<T, P> = P extends keyof T ? P : never;
22
+
23
+ /*
24
+ ** Common Types
25
+ */
26
+ type CustomRange<S = any, E = any> = { start: S, end: E };
27
+
28
+ type RefLabel<T = number> = {
29
+ id: T;
30
+ label: string;
31
+ };
@@ -0,0 +1,13 @@
1
+ // namespace Cortex {
2
+ // type Tag = {
3
+ // id: string,
4
+ // label: string
5
+ // };
6
+
7
+ // type TagSuggestion = {
8
+ // id: string,
9
+ // label: string,
10
+ // group?: boolean,
11
+ // suggestions?: TagSuggestion[]
12
+ // };
13
+ // }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortex-react-ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "React UI",
5
5
  "author": "Anthony",
6
6
  "license": "MIT",
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export interface TooltipProps {
3
- tags?: Cortex.Tag[];
4
- className?: string;
5
- suggestions?: Cortex.TagSuggestion[];
6
- onChange?: (tags: Cortex.Tag[]) => void;
7
- }
8
- declare const TagInput: React.FC<TooltipProps>;
9
- export default TagInput;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface TagSuggestionProps {
3
- open: boolean;
4
- suggestions?: Cortex.TagSuggestion[];
5
- anchorEl?: React.RefObject<HTMLElement>;
6
- filter?: string;
7
- onSuggestionClick?: (suggestion: Cortex.TagSuggestion) => void;
8
- }
9
- declare const TagSuggestion: React.ForwardRefExoticComponent<TagSuggestionProps & React.RefAttributes<HTMLElement>>;
10
- export default TagSuggestion;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface TagSuggestionGroupProps {
3
- group: Cortex.TagSuggestion;
4
- onClick?: (suggestion: Cortex.TagSuggestion, event: React.MouseEvent<HTMLDivElement>) => void;
5
- }
6
- declare const TagSuggestionGroup: React.FC<TagSuggestionGroupProps>;
7
- export default TagSuggestionGroup;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface TagSuggestionItemProps {
3
- suggestion: Cortex.TagSuggestion;
4
- onClick?: (suggestion: Cortex.TagSuggestion, event: React.MouseEvent<HTMLDivElement>) => void;
5
- }
6
- declare const TagSuggestionItem: React.FC<TagSuggestionItemProps>;
7
- export default TagSuggestionItem;