@kwantis-id3/frontend-library 1.0.0-rc.4 → 1.0.0-rc.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,37 +1,3 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { Interpolation } from "@emotion/styled";
3
1
  import React from "react";
4
- import { Theme } from "@emotion/react";
5
- export type AccordionProps = {
6
- /** Text of the accordion trigger */
7
- title: string;
8
- /** Content of the accordion */
9
- children: React.ReactNode;
10
- /** Custom trigger component */
11
- customTrigger?: React.ReactNode;
12
- /** Works only if uncontrolled (isOpen props is not present) */
13
- defaultOpen?: boolean;
14
- /** Color of the accordion */
15
- color?: string;
16
- /** Color of the icon */
17
- iconColor?: string;
18
- /** Color of the divider */
19
- dividerColor?: string;
20
- /** Hide the icon */
21
- hideIcon?: boolean;
22
- /** Hide the divider */
23
- hideDivider?: boolean;
24
- /** Pass your state value here if the Accordion needs to be Controlled */
25
- isOpen?: boolean;
26
- /** Lazy render the content of the accordion */
27
- isLazy?: boolean;
28
- /** onClick handler */
29
- onClick?: () => void;
30
- /** onOpen handler */
31
- onOpen?: () => void;
32
- /** onClose handler */
33
- onClose?: () => void;
34
- /** Custom styles */
35
- sx?: Interpolation<Theme>;
36
- };
37
- export declare const Accordion: (props: AccordionProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ import { TAccordionProps } from "./AccordionInterfaces";
3
+ export declare const Accordion: React.FC<TAccordionProps>;
@@ -0,0 +1,21 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export type TAccordionProps = PropsWithChildren & {
3
+ /** Title to be used if no custom trigger is passed */
4
+ title: string;
5
+ /** Pass your state value here if the Accordion needs to be Controlled */
6
+ isOpen?: boolean;
7
+ /** Default open state if the accordion is Uncontrolled */
8
+ defaultOpen?: boolean;
9
+ /** Callback function to be called when the Accordion is clicked */
10
+ onClick?: () => void;
11
+ /** Callback function to be called when the Accordion opens */
12
+ onOpen?: () => void;
13
+ /** Callback function to be called when the Accordion closes */
14
+ onClose?: () => void;
15
+ /** Custom trigger element */
16
+ trigger?: (isOpen: boolean) => React.ReactNode;
17
+ /** Variant of the Accordion. Default has everything wrapped in borders, while light just renders the content and the title without setting colors
18
+ * @default "default"
19
+ */
20
+ variant?: "default" | "light";
21
+ };
@@ -1,23 +1,32 @@
1
- export declare const Divider: import("@emotion/styled").StyledComponent<{
1
+ export declare const AccordionGroup: import("@emotion/styled").StyledComponent<{
2
2
  theme?: import("@emotion/react").Theme;
3
3
  as?: React.ElementType;
4
- } & {
5
- $color: string;
6
4
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
- export declare const TitleDiv: import("@emotion/styled").StyledComponent<{
5
+ export declare const StyledAccordion: import("@emotion/styled").StyledComponent<{
8
6
  theme?: import("@emotion/react").Theme;
9
7
  as?: React.ElementType;
10
8
  } & {
11
- $color: string;
12
- $textColor: string;
9
+ $variant: "default" | "light";
10
+ $isOpen: boolean;
13
11
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
14
- export declare const IconContainer: import("@emotion/styled").StyledComponent<{
12
+ export declare const StyledAccordionHeader: import("@emotion/styled").StyledComponent<{
15
13
  theme?: import("@emotion/react").Theme;
16
14
  as?: React.ElementType;
17
15
  } & {
18
- $iconColor: string;
16
+ $variant: "default" | "light";
17
+ $isOpen: boolean;
18
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
19
+ export declare const StyledAccordionContent: import("@emotion/styled").StyledComponent<{
20
+ theme?: import("@emotion/react").Theme;
21
+ as?: React.ElementType;
22
+ } & {
23
+ $isOpen: boolean;
24
+ $variant: "default" | "light";
25
+ $defaultHeight: string;
19
26
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
- export declare const TitleH2: import("@emotion/styled").StyledComponent<{
27
+ export declare const Icon: import("@emotion/styled").StyledComponent<{
21
28
  theme?: import("@emotion/react").Theme;
22
29
  as?: React.ElementType;
23
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, {}>;
30
+ } & {
31
+ $isOpen: boolean;
32
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -1 +1,2 @@
1
- export { Accordion, AccordionProps } from "./Accordion";
1
+ export { Accordion } from "./Accordion";
2
+ export * from "./AccordionInterfaces";
@@ -12,6 +12,8 @@ export type ButtonProps = {
12
12
  sx?: Interpolation<Theme>;
13
13
  /** Variant of the button, either `contained`, `outlined` or `text` */
14
14
  variant?: ButtonVariants;
15
+ /** The button size; either "large" or "small" */
16
+ size?: "small" | "large";
15
17
  /** onClick handler */
16
18
  onClick?: () => void;
17
19
  className?: string;
@@ -1,6 +1,6 @@
1
1
  export { Button, ButtonProps } from "./Button";
2
2
  export * from "./ThemeContext";
3
- export { Accordion, AccordionProps } from "./Accordion";
3
+ export { Accordion, TAccordionProps } from "./Accordion";
4
4
  export { InputField } from "./InputField";
5
5
  export { SingleSelect, SingleSelectProps, MultiSelect, MultiSelectProps, } from "./SelectFilter";
6
6
  export { Slider, SliderProps } from "./Slider";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { FC, PropsWithChildren } from 'react';
3
+ import React__default, { PropsWithChildren, FC } from 'react';
4
4
  import { Interpolation, CreateStyled } from '@emotion/styled';
5
5
  import { Theme, Interpolation as Interpolation$1 } from '@emotion/react';
6
6
  import { ColumnDef } from '@tanstack/react-table';
@@ -15,6 +15,8 @@ type ButtonProps = {
15
15
  sx?: Interpolation<Theme>;
16
16
  /** Variant of the button, either `contained`, `outlined` or `text` */
17
17
  variant?: ButtonVariants;
18
+ /** The button size; either "large" or "small" */
19
+ size?: "small" | "large";
18
20
  /** onClick handler */
19
21
  onClick?: () => void;
20
22
  className?: string;
@@ -141,39 +143,28 @@ declare const defaultDarkPalette: IPalette;
141
143
  declare const ThemeContextProvider: ({ palettes, defaultMode, children, }: React__default.PropsWithChildren<IThemeContextProps>) => JSX.Element;
142
144
  declare const useThemeContext: () => IThemeContextValue;
143
145
 
144
- type AccordionProps = {
145
- /** Text of the accordion trigger */
146
+ type TAccordionProps = PropsWithChildren & {
147
+ /** Title to be used if no custom trigger is passed */
146
148
  title: string;
147
- /** Content of the accordion */
148
- children: React__default.ReactNode;
149
- /** Custom trigger component */
150
- customTrigger?: React__default.ReactNode;
151
- /** Works only if uncontrolled (isOpen props is not present) */
152
- defaultOpen?: boolean;
153
- /** Color of the accordion */
154
- color?: string;
155
- /** Color of the icon */
156
- iconColor?: string;
157
- /** Color of the divider */
158
- dividerColor?: string;
159
- /** Hide the icon */
160
- hideIcon?: boolean;
161
- /** Hide the divider */
162
- hideDivider?: boolean;
163
149
  /** Pass your state value here if the Accordion needs to be Controlled */
164
150
  isOpen?: boolean;
165
- /** Lazy render the content of the accordion */
166
- isLazy?: boolean;
167
- /** onClick handler */
151
+ /** Default open state if the accordion is Uncontrolled */
152
+ defaultOpen?: boolean;
153
+ /** Callback function to be called when the Accordion is clicked */
168
154
  onClick?: () => void;
169
- /** onOpen handler */
155
+ /** Callback function to be called when the Accordion opens */
170
156
  onOpen?: () => void;
171
- /** onClose handler */
157
+ /** Callback function to be called when the Accordion closes */
172
158
  onClose?: () => void;
173
- /** Custom styles */
174
- sx?: Interpolation<Theme>;
159
+ /** Custom trigger element */
160
+ trigger?: (isOpen: boolean) => React__default.ReactNode;
161
+ /** Variant of the Accordion. Default has everything wrapped in borders, while light just renders the content and the title without setting colors
162
+ * @default "default"
163
+ */
164
+ variant?: "default" | "light";
175
165
  };
176
- declare const Accordion: (props: AccordionProps) => _emotion_react_jsx_runtime.JSX.Element;
166
+
167
+ declare const Accordion: React__default.FC<TAccordionProps>;
177
168
 
178
169
  interface TextFieldProps extends React__default.InputHTMLAttributes<HTMLInputElement> {
179
170
  /** Classname given to the container div */
@@ -495,4 +486,4 @@ declare const darkenColor: (color: string, strength?: number) => string;
495
486
  */
496
487
  declare const lightenColor: (color: string, strength?: number) => string;
497
488
 
498
- export { Accordion, AccordionProps, Button, ButtonProps, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Dropdown, DropdownItem, DropdownProps, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewList, SingleSelect, SingleSelectProps, Slider, SliderProps, TCardSectionProps, TCellValues, TColorScale, TIndicatorProps, TIndicatorVariants, TMultiViewListProps, TTableCell, TTableProps, TTableRow, TTagProps, TThemeMode, Table, Tag, ThemeContextProvider, darkenColor, defaultDarkPalette, defaultLightPalette, getContrastColor, lightenColor, renderCell, styled, transientOptions, useIsMobile, useThemeContext };
489
+ export { Accordion, Button, ButtonProps, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Dropdown, DropdownItem, DropdownProps, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewList, SingleSelect, SingleSelectProps, Slider, SliderProps, TAccordionProps, TCardSectionProps, TCellValues, TColorScale, TIndicatorProps, TIndicatorVariants, TMultiViewListProps, TTableCell, TTableProps, TTableRow, TTagProps, TThemeMode, Table, Tag, ThemeContextProvider, darkenColor, defaultDarkPalette, defaultLightPalette, getContrastColor, lightenColor, renderCell, styled, transientOptions, useIsMobile, useThemeContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwantis-id3/frontend-library",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.5",
4
4
  "description": "Kwantis frontend components collection",
5
5
  "scriptsComments": {
6
6
  "storybook": "Starts storybook in development mode",