@kwantis-id3/frontend-library 1.0.0-rc.40 → 1.0.0-rc.42

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,5 +1,4 @@
1
- import { Interpolation } from "@emotion/react";
2
- import { Theme } from "@emotion/react/dist/declarations/src";
1
+ import { Interpolation, Theme } from "@emotion/react";
3
2
  export type TButtonVariants = "contained" | "outlined" | "text";
4
3
  export type TButtonProps = {
5
4
  /** Color of the button */
@@ -1,5 +1,4 @@
1
- import { Interpolation } from "@emotion/react";
2
- import { Theme } from "@emotion/react/dist/declarations/src";
1
+ import { Interpolation, Theme } from "@emotion/react";
3
2
  export type TCheckboxProps = {
4
3
  /** Lable of the checkbox */
5
4
  label?: string;
@@ -0,0 +1,2 @@
1
+ import { TSwitchProps } from "./SwitchInterfaces";
2
+ export declare const Switch: (props: TSwitchProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export type TSwitchProps = {
2
+ /** Whether the switch is checked (controlled) */
3
+ checked?: boolean;
4
+ /** Default checked state (uncontrolled) */
5
+ defaultChecked?: boolean;
6
+ /** Callback function when the switch state changes */
7
+ onChange?: (checked: boolean) => void;
8
+ /** The color of switch when checked */
9
+ color?: string;
10
+ /** The label for the switch */
11
+ label?: string;
12
+ /** Size of switch */
13
+ size?: "small" | "medium" | "large";
14
+ /** HTML id */
15
+ htmlId?: string;
16
+ className?: string;
17
+ };
@@ -0,0 +1,35 @@
1
+ export declare const SwitchContainer: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const SwitchSlider: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme;
7
+ as?: React.ElementType;
8
+ } & {
9
+ $size: "small" | "medium" | "large";
10
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export declare const SwitchInput: import("@emotion/styled").StyledComponent<{
12
+ theme?: import("@emotion/react").Theme;
13
+ as?: React.ElementType;
14
+ }, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {}>;
15
+ export declare const SwitchTrack: import("@emotion/styled").StyledComponent<{
16
+ theme?: import("@emotion/react").Theme;
17
+ as?: React.ElementType;
18
+ } & {
19
+ $checked: boolean;
20
+ $checkedColor: string;
21
+ $uncheckedColor: string;
22
+ $size: "small" | "medium" | "large";
23
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
24
+ export declare const SwitchThumb: import("@emotion/styled").StyledComponent<{
25
+ theme?: import("@emotion/react").Theme;
26
+ as?: React.ElementType;
27
+ } & {
28
+ $checked: boolean;
29
+ $thumbColor: string;
30
+ $size: "small" | "medium" | "large";
31
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
32
+ export declare const SwitchLabel: import("@emotion/styled").StyledComponent<{
33
+ theme?: import("@emotion/react").Theme;
34
+ as?: React.ElementType;
35
+ }, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {}>;
@@ -0,0 +1,2 @@
1
+ export * from "./Switch";
2
+ export * from "./SwitchInterfaces";
@@ -1,5 +1,4 @@
1
- import { Interpolation } from "@emotion/react";
2
- import { Theme } from "@emotion/react/dist/declarations/src";
1
+ import { Interpolation, Theme } from "@emotion/react";
3
2
  import { ITagColors } from "../ThemeContext";
4
3
  export type TTagProps = {
5
4
  text: string;
@@ -15,3 +15,4 @@ export * from "./MultiViewList";
15
15
  export * from "./TreeView";
16
16
  export * from "./Drawer";
17
17
  export * from "./Checkbox";
18
+ export * from "./Switch";
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import * as _emotion_react from '@emotion/react';
3
- import { Interpolation, Theme as Theme$1 } from '@emotion/react';
4
- import { Theme } from '@emotion/react/dist/declarations/src';
3
+ import { Interpolation, Theme } from '@emotion/react';
5
4
  import * as react from 'react';
6
5
  import { PropsWithChildren, ReactElement, FC, ReactNode } from 'react';
7
6
  import * as _emotion_styled from '@emotion/styled';
@@ -192,7 +191,7 @@ type TTextFieldProps = React.InputHTMLAttributes<HTMLInputElement> & {
192
191
  /** The color of the input */
193
192
  color?: string;
194
193
  /** Change the styles of the input field */
195
- sx?: Interpolation<Theme$1>;
194
+ sx?: Interpolation<Theme>;
196
195
  };
197
196
 
198
197
  interface SingleSelectProps<Option = {
@@ -433,7 +432,7 @@ type TTagProps = {
433
432
  declare const Tag: FC<TTagProps>;
434
433
 
435
434
  type TCardSectionProps = PropsWithChildren & {
436
- sx?: Interpolation<Theme$1>;
435
+ sx?: Interpolation<Theme>;
437
436
  onClick?: (e: React.MouseEvent<HTMLElement>) => void;
438
437
  };
439
438
 
@@ -490,14 +489,14 @@ type TMultiViewListProps<Cell extends TCellValues, Row extends TTableRow<Cell>>
490
489
  cardComponent: (item: Row, index: number) => React.ReactNode;
491
490
  cardsWidth?: string;
492
491
  cardsHeight?: string;
493
- sx?: Interpolation<Theme$1>;
492
+ sx?: Interpolation<Theme>;
494
493
  };
495
494
  type TMultiViewGridProps<Cell extends TCellValues, Row extends TDataGridRow<Cell>> = TDataGridProps<Cell, Row> & {
496
495
  mode: "table" | "cards";
497
496
  cardComponent: (item: Row, index: number) => React.ReactNode;
498
497
  cardsWidth?: string;
499
498
  cardsHeight?: string;
500
- sx?: Interpolation<Theme$1>;
499
+ sx?: Interpolation<Theme>;
501
500
  };
502
501
 
503
502
  declare const MultiViewList: <Cell extends TCellValues, Row extends TTableRow<Cell>>(props: TMultiViewListProps<Cell, Row>) => _emotion_react_jsx_runtime.JSX.Element;
@@ -548,7 +547,7 @@ type TTreeViewProps = TTreeItemFunctions & {
548
547
  /** Disable multi-selection possibility */
549
548
  isMultiSelectionDisabled?: boolean;
550
549
  /** Custom styles */
551
- sx?: Interpolation<Theme$1>;
550
+ sx?: Interpolation<Theme>;
552
551
  };
553
552
  type TUncontrolledTreeViewProps = TTreeViewProps & {
554
553
  items: TTreeViewItem[];
@@ -583,7 +582,7 @@ type TTreeViewItem = TTreeItemFunctions & {
583
582
  /** A callback to fetch children asynchronously */
584
583
  childrenAsync?: () => Promise<TTreeViewItem[]>;
585
584
  /** Custom styles */
586
- sx?: Interpolation<Theme$1>;
585
+ sx?: Interpolation<Theme>;
587
586
  };
588
587
 
589
588
  /** @jsxImportSource @emotion/react */
@@ -621,7 +620,7 @@ type TDrawerProps = {
621
620
  keepMounted?: boolean;
622
621
  /** Set a custom z-index */
623
622
  zIndex?: number;
624
- sx?: Interpolation<Theme$1>;
623
+ sx?: Interpolation<Theme>;
625
624
  onOpen?: () => void;
626
625
  onClose?: () => void;
627
626
  };
@@ -653,6 +652,26 @@ type TCheckboxProps = {
653
652
 
654
653
  declare const Checkbox: ({ label, htmlId, checked, defaultChecked, onChange, indeterminate, disabled, className, sx, name, size, }: TCheckboxProps) => _emotion_react_jsx_runtime.JSX.Element;
655
654
 
655
+ type TSwitchProps = {
656
+ /** Whether the switch is checked (controlled) */
657
+ checked?: boolean;
658
+ /** Default checked state (uncontrolled) */
659
+ defaultChecked?: boolean;
660
+ /** Callback function when the switch state changes */
661
+ onChange?: (checked: boolean) => void;
662
+ /** The color of switch when checked */
663
+ color?: string;
664
+ /** The label for the switch */
665
+ label?: string;
666
+ /** Size of switch */
667
+ size?: "small" | "medium" | "large";
668
+ /** HTML id */
669
+ htmlId?: string;
670
+ className?: string;
671
+ };
672
+
673
+ declare const Switch: (props: TSwitchProps) => _emotion_react_jsx_runtime.JSX.Element;
674
+
656
675
  /**
657
676
  * emotion.js doesn't support transient options out of the box.
658
677
  *
@@ -702,4 +721,4 @@ declare const getActiveColor: (color: string) => string;
702
721
 
703
722
  declare function usePrefersColorScheme(): "light" | "dark";
704
723
 
705
- export { Accordion, AccordionGroup, Button, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Checkbox, ControlledTreeView, DataGrid, Drawer, Dropdown, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewGrid, MultiViewList, SingleSelect, SingleSelectProps, Slider, TAccordionProps, TButtonProps, TButtonVariants, TCardSectionProps, TCellValues, TCheckboxProps, TColorScale, TControlledTreeViewProps, TCustomRenderProps, TDataGridProps, TDataGridRow, TDrawerProps, TDropdownItem, TDropdownItemProps, TDropdownProps, TIndicatorInstanceProps, TIndicatorProps, TIndicatorVariants, TModalProps, TMultiViewGridProps, TMultiViewListProps, TRenderTriggerProps, TSliderProps, TTableCell, TTableProps, TTableRow, TTagProps, TTextFieldProps, TThemeMode, TTreeViewItem, TUncontrolledTreeViewProps, TViewState, Table, Tag, ThemeContextProvider, UncontrolledTreeView, commonColors, darkenColor, defaultDarkPalette, defaultLightPalette, getActiveColor, getContrastColor, getHoverColor, lightenColor, renderCell, transientOptions, useIsMobile, usePrefersColorScheme, useThemeContext };
724
+ export { Accordion, AccordionGroup, Button, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Checkbox, ControlledTreeView, DataGrid, Drawer, Dropdown, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewGrid, MultiViewList, SingleSelect, SingleSelectProps, Slider, Switch, TAccordionProps, TButtonProps, TButtonVariants, TCardSectionProps, TCellValues, TCheckboxProps, TColorScale, TControlledTreeViewProps, TCustomRenderProps, TDataGridProps, TDataGridRow, TDrawerProps, TDropdownItem, TDropdownItemProps, TDropdownProps, TIndicatorInstanceProps, TIndicatorProps, TIndicatorVariants, TModalProps, TMultiViewGridProps, TMultiViewListProps, TRenderTriggerProps, TSliderProps, TSwitchProps, TTableCell, TTableProps, TTableRow, TTagProps, TTextFieldProps, TThemeMode, TTreeViewItem, TUncontrolledTreeViewProps, TViewState, Table, Tag, ThemeContextProvider, UncontrolledTreeView, commonColors, darkenColor, defaultDarkPalette, defaultLightPalette, getActiveColor, getContrastColor, getHoverColor, lightenColor, renderCell, transientOptions, useIsMobile, usePrefersColorScheme, useThemeContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwantis-id3/frontend-library",
3
- "version": "1.0.0-rc.40",
3
+ "version": "1.0.0-rc.42",
4
4
  "description": "Kwantis frontend components collection",
5
5
  "scriptsComments": {
6
6
  "storybook": "Starts storybook in development mode",
@@ -41,19 +41,16 @@
41
41
  },
42
42
  "license": "apache-2.0",
43
43
  "devDependencies": {
44
+ "@emotion/jest": "^11.11.0",
44
45
  "@rollup/plugin-commonjs": "^24.0.1",
45
46
  "@rollup/plugin-node-resolve": "^15.0.1",
46
47
  "@rollup/plugin-terser": "^0.4.4",
47
48
  "@rollup/plugin-typescript": "^11.0.0",
48
- "@storybook/addon-essentials": "^8.6.4",
49
- "@storybook/addon-interactions": "^8.6.4",
50
- "@storybook/addon-links": "^8.6.4",
51
- "@storybook/addon-webpack5-compiler-swc": "^2.1.0",
52
- "@storybook/blocks": "^8.6.4",
53
- "@storybook/react": "^8.6.4",
54
- "@storybook/react-webpack5": "^8.6.4",
55
- "@storybook/test": "^8.6.4",
56
- "@storybook/types": "^8.6.4",
49
+ "@storybook/addon-docs": "^10.1.10",
50
+ "@storybook/addon-links": "^10.1.10",
51
+ "@storybook/addon-webpack5-compiler-swc": "^4.0.2",
52
+ "@storybook/react": "^10.1.10",
53
+ "@storybook/react-webpack5": "^10.1.10",
57
54
  "@testing-library/jest-dom": "^5.16.5",
58
55
  "@testing-library/react": "^16.2.0",
59
56
  "@testing-library/user-event": "^14.6.1",
@@ -63,33 +60,33 @@
63
60
  "@types/tinycolor2": "^1.4.3",
64
61
  "@typescript-eslint/eslint-plugin": "^5.58.0",
65
62
  "@typescript-eslint/parser": "^5.58.0",
66
- "@vitest/coverage-v8": "^3.0.5",
63
+ "@vitejs/plugin-react": "^5.1.2",
64
+ "@vitest/coverage-v8": "3.0.5",
67
65
  "chromatic": "^11.0.4",
68
- "eslint": "^8.38.0",
66
+ "eslint": "^8.57.1",
69
67
  "eslint-config-prettier": "^8.8.0",
70
68
  "eslint-plugin-react": "^7.32.2",
71
69
  "eslint-plugin-react-hooks": "^4.6.0",
72
- "eslint-plugin-storybook": "^0.11.4",
73
- "jsdom": "^23.0.1",
70
+ "eslint-plugin-storybook": "^10.1.10",
71
+ "jsdom": "^23.2.0",
74
72
  "lucide-react": "^0.545.0",
75
73
  "prop-types": "15.8.1",
76
74
  "rollup": "^3.20.2",
77
75
  "rollup-plugin-dts": "^5.3.0",
78
76
  "rollup-plugin-peer-deps-external": "^2.2.4",
79
- "storybook": "^8.6.4",
77
+ "storybook": "^10.1.10",
80
78
  "ts-node": "^10.9.1",
81
79
  "tslib": "^2.5.0",
82
80
  "typescript": "^5.7.3",
83
- "vitest": "^3.0.5",
84
- "@emotion/jest": "^11.11.0"
81
+ "vitest": "^3.0.5"
85
82
  },
86
83
  "peerDependencies": {
84
+ "@emotion/react": "^11.0.0",
85
+ "@emotion/styled": "^11.0.0",
87
86
  "@tanstack/react-table": "^8.0.0",
88
87
  "lucide-react": "^0.545.0",
89
88
  "react": "^18.0.0 || ^19.0.0",
90
- "react-dom": "^18.0.0 || ^19.0.0",
91
- "@emotion/react": "^11.0.0",
92
- "@emotion/styled": "^11.0.0"
89
+ "react-dom": "^18.0.0 || ^19.0.0"
93
90
  },
94
91
  "main": "dist/cjs/index.js",
95
92
  "module": "dist/esm/index.js",
@@ -112,7 +109,12 @@
112
109
  "semver@>=7.0.0 <7.5.2": ">=7.5.2",
113
110
  "tough-cookie@<4.1.3": ">=4.1.3",
114
111
  "word-wrap@<1.2.4": ">=1.2.4",
115
- "@babel/traverse@<7.23.2": ">=7.23.2"
112
+ "@babel/traverse@<7.23.2": ">=7.23.2",
113
+ "brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12",
114
+ "brace-expansion@>=2.0.0 <=2.0.1": ">=2.0.2",
115
+ "form-data@>=4.0.0 <4.0.4": ">=4.0.4",
116
+ "js-yaml@>=4.0.0 <4.1.1": ">=4.1.1",
117
+ "glob@>=10.2.0 <10.5.0": ">=10.5.0"
116
118
  }
117
119
  },
118
120
  "engines": {