@kwantis-id3/frontend-library 0.6.0 → 0.7.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 (29) hide show
  1. package/README.md +22 -0
  2. package/dist/cjs/index.js +49 -13
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/Accordion/Accordion.d.ts +19 -0
  5. package/dist/cjs/types/components/Accordion/AccordionStyled.d.ts +24 -0
  6. package/dist/cjs/types/components/Accordion/index.d.ts +1 -0
  7. package/dist/{esm/types/components/button → cjs/types/components/Button}/Button.d.ts +2 -2
  8. package/dist/cjs/types/components/SelectFilter/MultiSelect.d.ts +18 -0
  9. package/dist/cjs/types/components/SelectFilter/SingleSelect.d.ts +18 -0
  10. package/dist/cjs/types/components/SelectFilter/index.d.ts +2 -0
  11. package/dist/cjs/types/components/ThemeContext/ThemeContext.d.ts +2 -2
  12. package/dist/cjs/types/components/index.d.ts +3 -1
  13. package/dist/esm/index.js +49 -13
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/types/components/Accordion/Accordion.d.ts +19 -0
  16. package/dist/esm/types/components/Accordion/AccordionStyled.d.ts +24 -0
  17. package/dist/esm/types/components/Accordion/index.d.ts +1 -0
  18. package/dist/{cjs/types/components/button → esm/types/components/Button}/Button.d.ts +2 -2
  19. package/dist/esm/types/components/SelectFilter/MultiSelect.d.ts +18 -0
  20. package/dist/esm/types/components/SelectFilter/SingleSelect.d.ts +18 -0
  21. package/dist/esm/types/components/SelectFilter/index.d.ts +2 -0
  22. package/dist/esm/types/components/ThemeContext/ThemeContext.d.ts +2 -2
  23. package/dist/esm/types/components/index.d.ts +3 -1
  24. package/dist/index.d.ts +54 -5
  25. package/package.json +14 -4
  26. package/dist/cjs/types/components/accordion/Accordion.d.ts +0 -10
  27. package/dist/esm/types/components/accordion/Accordion.d.ts +0 -10
  28. /package/dist/cjs/types/components/{button → Button}/index.d.ts +0 -0
  29. /package/dist/esm/types/components/{button → Button}/index.d.ts +0 -0
@@ -0,0 +1,19 @@
1
+ /** @jsxImportSource @emotion/react */
2
+ import { Interpolation } from "@emotion/styled";
3
+ import React from "react";
4
+ import { ThemeColors } from "../ThemeContext";
5
+ import { Theme } from "@emotion/react";
6
+ export type AccordionProps = {
7
+ title: string;
8
+ children: React.ReactNode;
9
+ color?: ThemeColors;
10
+ iconColor?: ThemeColors;
11
+ dividerColor?: ThemeColors;
12
+ isOpen?: boolean;
13
+ isLazy?: boolean;
14
+ onClick?: () => void;
15
+ onOpen?: () => void;
16
+ onClose?: () => void;
17
+ sx?: Interpolation<Theme>;
18
+ };
19
+ export declare const Accordion: (props: AccordionProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ export declare const Divider: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & {
6
+ color: string;
7
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const TitleDiv: import("@emotion/styled").StyledComponent<{
9
+ theme?: import("@emotion/react").Theme | undefined;
10
+ as?: import("react").ElementType<any> | undefined;
11
+ } & {
12
+ color: string;
13
+ textColor: string;
14
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
+ export declare const IconContainer: import("@emotion/styled").StyledComponent<{
16
+ theme?: import("@emotion/react").Theme | undefined;
17
+ as?: import("react").ElementType<any> | undefined;
18
+ } & {
19
+ iconColor: string;
20
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
+ export declare const TitleH2: import("@emotion/styled").StyledComponent<{
22
+ theme?: import("@emotion/react").Theme | undefined;
23
+ as?: import("react").ElementType<any> | undefined;
24
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
@@ -0,0 +1 @@
1
+ export { Accordion, AccordionProps } from "./Accordion";
@@ -3,7 +3,7 @@ import { ThemeColors } from "../ThemeContext/ThemeContext";
3
3
  import { Interpolation } from "@emotion/styled";
4
4
  import { Theme } from "@emotion/react";
5
5
  export type ButtonVariants = "contained" | "outlined" | "text";
6
- export interface ButtonProps {
6
+ export type ButtonProps = {
7
7
  label: string;
8
8
  color?: ThemeColors;
9
9
  sx?: Interpolation<Theme>;
@@ -12,5 +12,5 @@ export interface ButtonProps {
12
12
  htmlClassName?: string;
13
13
  htmlId?: string;
14
14
  disabled?: boolean;
15
- }
15
+ };
16
16
  export declare const Button: (props: ButtonProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { GroupBase } from "react-select";
3
+ import { ThemeColors } from "../ThemeContext";
4
+ export interface MultiSelectProps<Option, IsMulti extends boolean, Group> {
5
+ options: Option[];
6
+ onChange?: (option: Option[] | null) => void;
7
+ value?: readonly Option[] | null;
8
+ placeholder?: string;
9
+ isDisabled?: boolean;
10
+ isClearable?: boolean;
11
+ isSearchable?: boolean;
12
+ isOptionDisabled?: (option: Option) => boolean;
13
+ isLoading?: boolean;
14
+ color?: ThemeColors;
15
+ htmlId?: string;
16
+ className?: string;
17
+ }
18
+ export declare const MultiSelect: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: MultiSelectProps<Option, IsMulti, Group>) => JSX.Element;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { GroupBase } from "react-select";
3
+ import { ThemeColors } from "../ThemeContext";
4
+ export interface SingleSelectProps<Option, IsMulti extends boolean, Group> {
5
+ options: Option[];
6
+ onChange?: (option: Option | null) => void;
7
+ value?: Option | null;
8
+ placeholder?: string;
9
+ isDisabled?: boolean;
10
+ isClearable?: boolean;
11
+ isSearchable?: boolean;
12
+ isOptionDisabled?: (option: Option) => boolean;
13
+ isLoading?: boolean;
14
+ color?: ThemeColors;
15
+ htmlId?: string;
16
+ className?: string;
17
+ }
18
+ export declare const SingleSelect: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: SingleSelectProps<Option, IsMulti, Group>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { SingleSelect, SingleSelectProps } from "./SingleSelect";
2
+ export { MultiSelect, MultiSelectProps } from "./MultiSelect";
@@ -12,9 +12,9 @@ export type ThemeColorsObject = {
12
12
  statusCritical: Color;
13
13
  statusNeutral: Color;
14
14
  };
15
- interface ThemeContextProps {
15
+ type ThemeContextProps = {
16
16
  colors: ThemeColorsObject;
17
- }
17
+ };
18
18
  export type ThemeColors = keyof ThemeColorsObject;
19
19
  export declare const defaultThemeColors: {
20
20
  primary: {
@@ -1,2 +1,4 @@
1
- export { Button, ButtonProps } from "./button";
1
+ export { Button, ButtonProps } from "./Button";
2
2
  export { ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext, } from "./ThemeContext";
3
+ export { Accordion, AccordionProps } from "./Accordion";
4
+ export { SingleSelect, SingleSelectProps, MultiSelect, MultiSelectProps, } from "./SelectFilter";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ /// <reference types="react" />
1
2
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
2
3
  import React from 'react';
3
4
  import { Interpolation } from '@emotion/styled';
4
5
  import { Theme } from '@emotion/react';
6
+ import { GroupBase } from 'react-select';
5
7
 
6
8
  type Color = {
7
9
  main: string;
@@ -16,9 +18,9 @@ type ThemeColorsObject = {
16
18
  statusCritical: Color;
17
19
  statusNeutral: Color;
18
20
  };
19
- interface ThemeContextProps {
21
+ type ThemeContextProps = {
20
22
  colors: ThemeColorsObject;
21
- }
23
+ };
22
24
  type ThemeColors = keyof ThemeColorsObject;
23
25
  declare const ThemeContextProvider: (props: React.PropsWithChildren<{
24
26
  theme?: ThemeContextProps;
@@ -26,7 +28,7 @@ declare const ThemeContextProvider: (props: React.PropsWithChildren<{
26
28
  declare const useThemeContext: () => ThemeContextProps;
27
29
 
28
30
  type ButtonVariants = "contained" | "outlined" | "text";
29
- interface ButtonProps {
31
+ type ButtonProps = {
30
32
  label: string;
31
33
  color?: ThemeColors;
32
34
  sx?: Interpolation<Theme>;
@@ -35,7 +37,54 @@ interface ButtonProps {
35
37
  htmlClassName?: string;
36
38
  htmlId?: string;
37
39
  disabled?: boolean;
38
- }
40
+ };
39
41
  declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
40
42
 
41
- export { Button, ButtonProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
43
+ type AccordionProps = {
44
+ title: string;
45
+ children: React.ReactNode;
46
+ color?: ThemeColors;
47
+ iconColor?: ThemeColors;
48
+ dividerColor?: ThemeColors;
49
+ isOpen?: boolean;
50
+ isLazy?: boolean;
51
+ onClick?: () => void;
52
+ onOpen?: () => void;
53
+ onClose?: () => void;
54
+ sx?: Interpolation<Theme>;
55
+ };
56
+ declare const Accordion: (props: AccordionProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
57
+
58
+ interface SingleSelectProps<Option, IsMulti extends boolean, Group> {
59
+ options: Option[];
60
+ onChange?: (option: Option | null) => void;
61
+ value?: Option | null;
62
+ placeholder?: string;
63
+ isDisabled?: boolean;
64
+ isClearable?: boolean;
65
+ isSearchable?: boolean;
66
+ isOptionDisabled?: (option: Option) => boolean;
67
+ isLoading?: boolean;
68
+ color?: ThemeColors;
69
+ htmlId?: string;
70
+ className?: string;
71
+ }
72
+ declare const SingleSelect: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: SingleSelectProps<Option, IsMulti, Group>) => JSX.Element;
73
+
74
+ interface MultiSelectProps<Option, IsMulti extends boolean, Group> {
75
+ options: Option[];
76
+ onChange?: (option: Option[] | null) => void;
77
+ value?: readonly Option[] | null;
78
+ placeholder?: string;
79
+ isDisabled?: boolean;
80
+ isClearable?: boolean;
81
+ isSearchable?: boolean;
82
+ isOptionDisabled?: (option: Option) => boolean;
83
+ isLoading?: boolean;
84
+ color?: ThemeColors;
85
+ htmlId?: string;
86
+ className?: string;
87
+ }
88
+ declare const MultiSelect: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: MultiSelectProps<Option, IsMulti, Group>) => JSX.Element;
89
+
90
+ export { Accordion, AccordionProps, Button, ButtonProps, MultiSelect, MultiSelectProps, SingleSelect, SingleSelectProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@kwantis-id3/frontend-library",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Kwantis frontend components collection",
5
- "author": "kwantis",
5
+ "author": {
6
+ "name": "kwantis"
7
+ },
6
8
  "license": "apache-2.0",
7
9
  "devDependencies": {
8
10
  "@emotion/react": "^11.10.6",
@@ -22,9 +24,12 @@
22
24
  "@types/jest": "^29.5.0",
23
25
  "@types/react": "^18.0.33",
24
26
  "@types/testing-library__jest-dom": "^5.14.5",
27
+ "@types/tinycolor2": "^1.4.3",
25
28
  "@typescript-eslint/eslint-plugin": "^5.58.0",
26
29
  "@typescript-eslint/parser": "^5.58.0",
30
+ "chromatic": "^6.17.4",
27
31
  "eslint": "^8.38.0",
32
+ "eslint-config-prettier": "^8.8.0",
28
33
  "eslint-plugin-react": "^7.32.2",
29
34
  "eslint-plugin-react-hooks": "^4.6.0",
30
35
  "jest": "^29.5.0",
@@ -54,12 +59,17 @@
54
59
  "@rollup/plugin-terser": "^0.4.1",
55
60
  "react-collapsible": "^2.10.0",
56
61
  "react-icons-kit": "^2.0.0",
57
- "rollup-plugin-peer-deps-external": "^2.2.4"
62
+ "react-select": "^5.7.3",
63
+ "rollup-plugin-peer-deps-external": "^2.2.4",
64
+ "tinycolor2": "^1.6.0"
58
65
  },
66
+ "readme": "ERROR: No README data found!",
67
+ "_id": "@kwantis-id3/frontend-library@0.6.1",
59
68
  "scripts": {
60
69
  "rollup": "rollup -c",
61
70
  "test": "jest",
62
71
  "storybook": "storybook dev -p 6006",
63
- "build-storybook": "storybook build"
72
+ "build-storybook": "storybook build",
73
+ "chromatic": "npx chromatic --project-token=3dd812d03e4c"
64
74
  }
65
75
  }
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- export interface AccordionProps {
3
- title: string;
4
- children: React.ReactNode;
5
- isOpen?: boolean;
6
- onClick?: () => void;
7
- onOpen?: () => void;
8
- onClose?: () => void;
9
- }
10
- export declare const Accordion: (props: AccordionProps) => JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- export interface AccordionProps {
3
- title: string;
4
- children: React.ReactNode;
5
- isOpen?: boolean;
6
- onClick?: () => void;
7
- onOpen?: () => void;
8
- onClose?: () => void;
9
- }
10
- export declare const Accordion: (props: AccordionProps) => JSX.Element;