@kwantis-id3/frontend-library 0.7.0 → 0.8.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.
@@ -1,16 +1,17 @@
1
1
  /** @jsxImportSource @emotion/react */
2
+ import * as React from "react";
2
3
  import { ThemeColors } from "../ThemeContext/ThemeContext";
3
4
  import { Interpolation } from "@emotion/styled";
4
5
  import { Theme } from "@emotion/react";
5
6
  export type ButtonVariants = "contained" | "outlined" | "text";
6
7
  export type ButtonProps = {
7
- label: string;
8
8
  color?: ThemeColors;
9
9
  sx?: Interpolation<Theme>;
10
10
  variant?: ButtonVariants;
11
11
  onClick?: () => void;
12
- htmlClassName?: string;
12
+ className?: string;
13
13
  htmlId?: string;
14
14
  disabled?: boolean;
15
+ children?: React.ReactNode;
15
16
  };
16
17
  export declare const Button: (props: ButtonProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { ThemeColors } from "../ThemeContext";
3
+ export type SliderProps = {
4
+ values: number[];
5
+ min?: number;
6
+ max?: number;
7
+ onChange: (values: number[]) => void;
8
+ onFinalChange?: (values: number[]) => void;
9
+ color?: ThemeColors;
10
+ unselectedColor?: ThemeColors;
11
+ htmlId?: string;
12
+ className?: string;
13
+ showThumbValue?: boolean;
14
+ autoCalculateMinMax?: boolean;
15
+ };
16
+ export declare const Slider: (props: SliderProps) => JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ export declare const OuterTrackDiv: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: React.ElementType<any> | undefined;
5
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const InnerTrackDiv: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: React.ElementType<any> | undefined;
9
+ } & {
10
+ bgColor: string;
11
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
12
+ export declare const ThumbDiv: import("@emotion/styled").StyledComponent<{
13
+ theme?: import("@emotion/react").Theme | undefined;
14
+ as?: React.ElementType<any> | undefined;
15
+ } & {
16
+ bgColor: string;
17
+ borderColor: string;
18
+ value: string;
19
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
+ export declare const ThumbValueSpan: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme | undefined;
22
+ as?: React.ElementType<any> | undefined;
23
+ } & {
24
+ textColor: string;
25
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1 @@
1
+ export { Slider, SliderProps } from "./Slider";
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- export type Color = {
2
+ export interface Color {
3
3
  main: string;
4
4
  contrastText: string;
5
- };
6
- export type ThemeColorsObject = {
5
+ }
6
+ export interface ThemeColorsObject {
7
7
  primary: Color;
8
8
  secondary: Color;
9
9
  tertiary: Color;
@@ -11,7 +11,7 @@ export type ThemeColorsObject = {
11
11
  statusWarning: Color;
12
12
  statusCritical: Color;
13
13
  statusNeutral: Color;
14
- };
14
+ }
15
15
  type ThemeContextProps = {
16
16
  colors: ThemeColorsObject;
17
17
  };
@@ -2,3 +2,4 @@ export { Button, ButtonProps } from "./Button";
2
2
  export { ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext, } from "./ThemeContext";
3
3
  export { Accordion, AccordionProps } from "./Accordion";
4
4
  export { SingleSelect, SingleSelectProps, MultiSelect, MultiSelectProps, } from "./SelectFilter";
5
+ export { Slider, SliderProps } from "./Slider";
package/dist/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import * as _emotion_react_types_jsx_namespace from '@emotion/react/types/jsx-namespace';
3
- import React from 'react';
3
+ import * as React from 'react';
4
+ import React__default from 'react';
4
5
  import { Interpolation } from '@emotion/styled';
5
6
  import { Theme } from '@emotion/react';
6
7
  import { GroupBase } from 'react-select';
7
8
 
8
- type Color = {
9
+ interface Color {
9
10
  main: string;
10
11
  contrastText: string;
11
- };
12
- type ThemeColorsObject = {
12
+ }
13
+ interface ThemeColorsObject {
13
14
  primary: Color;
14
15
  secondary: Color;
15
16
  tertiary: Color;
@@ -17,32 +18,32 @@ type ThemeColorsObject = {
17
18
  statusWarning: Color;
18
19
  statusCritical: Color;
19
20
  statusNeutral: Color;
20
- };
21
+ }
21
22
  type ThemeContextProps = {
22
23
  colors: ThemeColorsObject;
23
24
  };
24
25
  type ThemeColors = keyof ThemeColorsObject;
25
- declare const ThemeContextProvider: (props: React.PropsWithChildren<{
26
+ declare const ThemeContextProvider: (props: React__default.PropsWithChildren<{
26
27
  theme?: ThemeContextProps;
27
28
  }>) => JSX.Element;
28
29
  declare const useThemeContext: () => ThemeContextProps;
29
30
 
30
31
  type ButtonVariants = "contained" | "outlined" | "text";
31
32
  type ButtonProps = {
32
- label: string;
33
33
  color?: ThemeColors;
34
34
  sx?: Interpolation<Theme>;
35
35
  variant?: ButtonVariants;
36
36
  onClick?: () => void;
37
- htmlClassName?: string;
37
+ className?: string;
38
38
  htmlId?: string;
39
39
  disabled?: boolean;
40
+ children?: React.ReactNode;
40
41
  };
41
42
  declare const Button: (props: ButtonProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
42
43
 
43
44
  type AccordionProps = {
44
45
  title: string;
45
- children: React.ReactNode;
46
+ children: React__default.ReactNode;
46
47
  color?: ThemeColors;
47
48
  iconColor?: ThemeColors;
48
49
  dividerColor?: ThemeColors;
@@ -87,4 +88,19 @@ interface MultiSelectProps<Option, IsMulti extends boolean, Group> {
87
88
  }
88
89
  declare const MultiSelect: <Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(props: MultiSelectProps<Option, IsMulti, Group>) => JSX.Element;
89
90
 
90
- export { Accordion, AccordionProps, Button, ButtonProps, MultiSelect, MultiSelectProps, SingleSelect, SingleSelectProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
91
+ type SliderProps = {
92
+ values: number[];
93
+ min?: number;
94
+ max?: number;
95
+ onChange: (values: number[]) => void;
96
+ onFinalChange?: (values: number[]) => void;
97
+ color?: ThemeColors;
98
+ unselectedColor?: ThemeColors;
99
+ htmlId?: string;
100
+ className?: string;
101
+ showThumbValue?: boolean;
102
+ autoCalculateMinMax?: boolean;
103
+ };
104
+ declare const Slider: (props: SliderProps) => JSX.Element;
105
+
106
+ export { Accordion, AccordionProps, Button, ButtonProps, MultiSelect, MultiSelectProps, SingleSelect, SingleSelectProps, Slider, SliderProps, ThemeColors, ThemeColorsObject, ThemeContextProvider, useThemeContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwantis-id3/frontend-library",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Kwantis frontend components collection",
5
5
  "author": {
6
6
  "name": "kwantis"
@@ -47,7 +47,7 @@
47
47
  "typescript": "^5.0.3"
48
48
  },
49
49
  "peerDependencies": {
50
- "react": "^18.2.0"
50
+ "react": ">= 17.0.2"
51
51
  },
52
52
  "main": "dist/cjs/index.js",
53
53
  "module": "dist/esm/index.js",
@@ -59,6 +59,7 @@
59
59
  "@rollup/plugin-terser": "^0.4.1",
60
60
  "react-collapsible": "^2.10.0",
61
61
  "react-icons-kit": "^2.0.0",
62
+ "react-range": "^1.8.14",
62
63
  "react-select": "^5.7.3",
63
64
  "rollup-plugin-peer-deps-external": "^2.2.4",
64
65
  "tinycolor2": "^1.6.0"