@kroo-web/design-system 1.0.39 → 1.0.41

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 (70) hide show
  1. package/README.MD +5 -0
  2. package/dist/cjs/icons/Icon.stories.d.ts +2 -2
  3. package/dist/cjs/index.js +40 -4
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/product/components/Button/button.stories.d.ts +5 -1
  6. package/dist/cjs/product/components/Button/index.d.ts +24 -3
  7. package/dist/cjs/product/components/Callout/Callout.stories.d.ts +1 -1
  8. package/dist/cjs/product/components/Columns/Columns.stories.d.ts +6 -0
  9. package/dist/cjs/product/components/DatePicker/DatePicker.stories.d.ts +1 -1
  10. package/dist/cjs/product/components/Disclosure/Disclosure.stories.d.ts +1 -1
  11. package/dist/cjs/product/components/Form/Form.stories.d.ts +12 -0
  12. package/dist/cjs/product/components/Loading/Loading.stories.d.ts +7 -0
  13. package/dist/cjs/product/components/Loading/Loading.test.d.ts +1 -0
  14. package/dist/cjs/product/components/Loading/index.d.ts +12 -0
  15. package/dist/cjs/product/components/Modal/Modal.stories.d.ts +7 -0
  16. package/dist/cjs/product/components/Modal/Modal.test.d.ts +1 -0
  17. package/dist/cjs/product/components/Modal/index.d.ts +25 -0
  18. package/dist/cjs/product/components/NumberField/numberField.stories.d.ts +1 -1
  19. package/dist/cjs/product/components/ProgressIndicator/ProgressIndicator.stories.d.ts +1 -1
  20. package/dist/cjs/product/components/ProgressIndicator/index.d.ts +2 -2
  21. package/dist/cjs/product/components/RadioGroup/radioGroup.stories.d.ts +1 -1
  22. package/dist/cjs/product/components/Range/range.stories.d.ts +2 -2
  23. package/dist/cjs/product/components/Select/select.stories.d.ts +2 -2
  24. package/dist/cjs/product/components/TextField/textField.stories.d.ts +1 -1
  25. package/dist/cjs/product/components/Toast/Toast.stories.d.ts +7 -0
  26. package/dist/cjs/product/components/Toast/index.d.ts +16 -0
  27. package/dist/cjs/product/components/Tooltip/Tooltip.stories.d.ts +7 -0
  28. package/dist/cjs/product/components/Tooltip/Tooltip.test.d.ts +1 -0
  29. package/dist/cjs/product/components/Tooltip/index.d.ts +10 -0
  30. package/dist/cjs/product/components/Typography/typography.stories.d.ts +1 -1
  31. package/dist/cjs/product/components/index.d.ts +6 -1
  32. package/dist/esm/icons/Icon.stories.d.ts +2 -2
  33. package/dist/esm/index.js +40 -4
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/product/components/Button/button.stories.d.ts +5 -1
  36. package/dist/esm/product/components/Button/index.d.ts +24 -3
  37. package/dist/esm/product/components/Callout/Callout.stories.d.ts +1 -1
  38. package/dist/esm/product/components/Columns/Columns.stories.d.ts +6 -0
  39. package/dist/esm/product/components/DatePicker/DatePicker.stories.d.ts +1 -1
  40. package/dist/esm/product/components/Disclosure/Disclosure.stories.d.ts +1 -1
  41. package/dist/esm/product/components/Form/Form.stories.d.ts +12 -0
  42. package/dist/esm/product/components/Loading/Loading.stories.d.ts +7 -0
  43. package/dist/esm/product/components/Loading/Loading.test.d.ts +1 -0
  44. package/dist/esm/product/components/Loading/index.d.ts +12 -0
  45. package/dist/esm/product/components/Modal/Modal.stories.d.ts +7 -0
  46. package/dist/esm/product/components/Modal/Modal.test.d.ts +1 -0
  47. package/dist/esm/product/components/Modal/index.d.ts +25 -0
  48. package/dist/esm/product/components/NumberField/numberField.stories.d.ts +1 -1
  49. package/dist/esm/product/components/ProgressIndicator/ProgressIndicator.stories.d.ts +1 -1
  50. package/dist/esm/product/components/ProgressIndicator/index.d.ts +2 -2
  51. package/dist/esm/product/components/RadioGroup/radioGroup.stories.d.ts +1 -1
  52. package/dist/esm/product/components/Range/range.stories.d.ts +2 -2
  53. package/dist/esm/product/components/Select/select.stories.d.ts +2 -2
  54. package/dist/esm/product/components/TextField/textField.stories.d.ts +1 -1
  55. package/dist/esm/product/components/Toast/Toast.stories.d.ts +7 -0
  56. package/dist/esm/product/components/Toast/index.d.ts +16 -0
  57. package/dist/esm/product/components/Tooltip/Tooltip.stories.d.ts +7 -0
  58. package/dist/esm/product/components/Tooltip/Tooltip.test.d.ts +1 -0
  59. package/dist/esm/product/components/Tooltip/index.d.ts +10 -0
  60. package/dist/esm/product/components/Typography/typography.stories.d.ts +1 -1
  61. package/dist/esm/product/components/index.d.ts +6 -1
  62. package/dist/styles/dev.global.css +2 -0
  63. package/dist/styles/global.css +4 -0
  64. package/dist/styles/tokens/product.css +1 -0
  65. package/dist/types.d.ts +117 -26
  66. package/package.json +8 -5
  67. /package/dist/cjs/product/components/{FormField → shared/FormField}/FormField.stories.d.ts +0 -0
  68. /package/dist/cjs/product/components/{FormField → shared/FormField}/index.d.ts +0 -0
  69. /package/dist/esm/product/components/{FormField → shared/FormField}/FormField.stories.d.ts +0 -0
  70. /package/dist/esm/product/components/{FormField → shared/FormField}/index.d.ts +0 -0
@@ -1,11 +1,15 @@
1
1
  import React from 'react';
2
2
  import { StoryObj } from '@storybook/react';
3
3
  import { Button } from '.';
4
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").IButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
4
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>>;
5
5
  export default _default;
6
6
  type Story = StoryObj<typeof Button>;
7
+ export declare const GeneralUsage: Story;
8
+ export declare const PolymorphicButton: Story;
9
+ export declare const OnlyIcon: Story;
7
10
  export declare const DefaultVariants: Story;
8
11
  export declare const ActionVariants: Story;
12
+ export declare const TextVariants: Story;
9
13
  export declare const DefaultOnlyIcons: Story;
10
14
  export declare const ActionOnlyIcons: Story;
11
15
  export declare const IconsAndText: Story;
@@ -6,15 +6,36 @@ export type TButtonDefaultProps = {
6
6
  variant?: "primary" | "secondary" | "tertiary" | "ghost" | "danger";
7
7
  };
8
8
  export type TActionButtonProps = {
9
+ /**
10
+ * The size changing variant of the button.
11
+ */
9
12
  visualType?: "action";
13
+ /**
14
+ * The colour changing variant of the button.
15
+ */
10
16
  variant?: "standard" | "secondary" | "tertiary" | "ghost" | "danger";
11
17
  };
12
- type ConditionalProps = TButtonDefaultProps | TActionButtonProps;
18
+ export type TTextButtonProps = {
19
+ visualType?: "text";
20
+ variant?: "primary" | "secondary";
21
+ };
22
+ type ConditionalProps = TButtonDefaultProps | TActionButtonProps | TTextButtonProps;
13
23
  export interface IButtonOwnProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, PropsWithChildren {
24
+ /**
25
+ * Polymorphic prop to define the element type of the button, currently
26
+ * we only support 2 types: button and span.
27
+ */
14
28
  as?: "button" | "span";
29
+ /**
30
+ * Appends the className to the button element.
31
+ */
15
32
  className?: string;
33
+ /**
34
+ * To be used when the contents of the button is only an icon this props
35
+ * will correct the padding as the padding is different to a button that includes text.
36
+ */
16
37
  onlyIcon?: boolean;
17
38
  }
18
- export type IButtonProps<T extends React.ElementType = typeof defaultElement> = PolymorphicPropsWithoutRef<IButtonOwnProps, T> & ConditionalProps;
19
- export declare function Button<T extends React.ElementType = typeof defaultElement>({ as, children, variant, className, visualType, onlyIcon, ...rest }: IButtonProps<T>): React.JSX.Element;
39
+ export type TButtonProps<T extends React.ElementType = typeof defaultElement> = PolymorphicPropsWithoutRef<IButtonOwnProps, T> & ConditionalProps;
40
+ export declare function Button<T extends React.ElementType = typeof defaultElement>({ as, children, variant, className, visualType, onlyIcon, ...rest }: TButtonProps<T>): React.JSX.Element;
20
41
  export {};
@@ -6,5 +6,5 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
6
6
  }>;
7
7
  export default _default;
8
8
  type Story = StoryObj<typeof Callout.Root>;
9
- export declare const Default: Story;
9
+ export declare const GeneralUsage: Story;
10
10
  export declare const Types: Story;
@@ -0,0 +1,6 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { Columns } from ".";
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TColumnsProps>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Columns>;
6
+ export declare const GeneralUsage: Story;
@@ -3,6 +3,6 @@ import { DatePicker } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TDatePicker<import("react-hook-form").FieldValues>>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof DatePicker>;
6
- export declare const Default: Story;
6
+ export declare const GeneralUsage: Story;
7
7
  export declare const Helper: Story;
8
8
  export declare const Error: Story;
@@ -3,4 +3,4 @@ import { Disclosure } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TDisclosureProps>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof Disclosure>;
6
- export declare const Default: Story;
6
+ export declare const GeneralUsage: Story;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { StoryObj } from "@storybook/react";
3
+ import { Form } from ".";
4
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, React.HTMLProps<HTMLFormElement> & {
5
+ children?: React.ReactNode;
6
+ } & {
7
+ methods: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues>;
8
+ onSubmit: (values: import("react-hook-form").FieldValues) => void;
9
+ }>;
10
+ export default _default;
11
+ type Story = StoryObj<typeof Form>;
12
+ export declare const GeneralUsage: Story;
@@ -0,0 +1,7 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { Loading } from ".";
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TLoadingProps>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Loading>;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const Sizes: Story;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ declare const sizes: {
3
+ small: string;
4
+ medium: string;
5
+ large: string;
6
+ full: string;
7
+ };
8
+ export type TLoadingProps = {
9
+ size?: keyof typeof sizes;
10
+ };
11
+ export declare const Loading: ({ size }: TLoadingProps) => React.JSX.Element;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { Modal } from ".";
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TModalControlProps>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Modal.Control>;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const MultipleModals: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { TButtonProps } from "../Button";
3
+ export type TUseModalProps = {
4
+ activeModal: string;
5
+ isOpen: boolean;
6
+ open: (value: string) => void;
7
+ close: () => void;
8
+ };
9
+ export declare const useModal: import("zustand").UseBoundStore<import("zustand").StoreApi<TUseModalProps>>;
10
+ export type TModalContentProps = {
11
+ children: React.ReactNode;
12
+ value: string;
13
+ };
14
+ export type TModalControlProps = {
15
+ children: React.ReactNode;
16
+ value: string;
17
+ } & TButtonProps;
18
+ export type TModalHeaderProps = {
19
+ title: string;
20
+ };
21
+ export declare const Modal: {
22
+ Content: ({ value, children }: TModalContentProps) => React.ReactPortal;
23
+ Control: ({ value, children, ...rest }: TModalControlProps) => React.JSX.Element;
24
+ Header: ({ title }: TModalHeaderProps) => React.JSX.Element;
25
+ };
@@ -4,7 +4,7 @@ import { NumberField } from ".";
4
4
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TNumberFieldProps<import("react-hook-form").FieldValues>>;
5
5
  export default _default;
6
6
  type Story = StoryObj<typeof NumberField>;
7
- export declare const Default: Story;
7
+ export declare const GeneralUsage: Story;
8
8
  export declare const Error: {
9
9
  render: () => React.JSX.Element;
10
10
  };
@@ -3,5 +3,5 @@ import { ProgressIndicator } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TProgressIndicatorProps>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof ProgressIndicator>;
6
- export declare const Default: Story;
6
+ export declare const GeneralUsage: Story;
7
7
  export declare const Size: Story;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  export type TProgressIndicatorProps = {
3
3
  label?: string;
4
4
  size?: "small" | "medium" | "full-width";
5
- current: number;
6
- max: number;
5
+ current?: number;
6
+ max?: number;
7
7
  };
8
8
  export declare const ProgressIndicator: ({ label, size, current, max, }: TProgressIndicatorProps) => React.JSX.Element;
@@ -7,5 +7,5 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
7
7
  } & Omit<import("@radix-ui/react-radio-group").RadioGroupProps, "name">>;
8
8
  export default _default;
9
9
  type Story = StoryObj<typeof RadioGroup.Root>;
10
- export declare const Default: Story;
10
+ export declare const GeneralUsage: Story;
11
11
  export declare const Error: Story;
@@ -3,6 +3,6 @@ import { Range } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TRangeProps<import("react-hook-form").FieldValues>>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof Range>;
6
- export declare const Default: Story;
7
- export declare const Error: Story;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const Labels: Story;
8
8
  export declare const Helper: Story;
@@ -3,5 +3,5 @@ import { Select } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TSelectProps<import("react-hook-form").FieldValues>>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof Select>;
6
- export declare const Default: Story;
7
- export declare const Error: Story;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const Labeling: Story;
@@ -3,7 +3,7 @@ import { TextField } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TTextFieldProps<import("react-hook-form").FieldValues>>;
4
4
  export default _default;
5
5
  type Story = StoryObj<typeof TextField>;
6
- export declare const Default: Story;
6
+ export declare const GeneralUsage: Story;
7
7
  export declare const Error: Story;
8
8
  export declare const HelperText: Story;
9
9
  export declare const RightContent: Story;
@@ -0,0 +1,7 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { Toast } from ".";
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import(".").TToastRootProps>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Toast>;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const Variants: Story;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export type TToastRootProps = {
3
+ children: React.ReactNode;
4
+ };
5
+ export type TToastTitleProps = {
6
+ className?: string;
7
+ children: React.ReactNode;
8
+ };
9
+ export type TToastDescriptionProps = {
10
+ children: React.ReactNode;
11
+ };
12
+ export declare const Toast: {
13
+ Root: ({ children }: TToastRootProps) => React.JSX.Element;
14
+ Title: ({ className, children }: TToastTitleProps) => React.JSX.Element;
15
+ Description: ({ children }: TToastDescriptionProps) => React.JSX.Element;
16
+ };
@@ -0,0 +1,7 @@
1
+ import { StoryObj } from "@storybook/react";
2
+ import { Tooltip } from ".";
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@radix-ui/react-tooltip").TooltipProps>;
4
+ export default _default;
5
+ type Story = StoryObj<typeof Tooltip>;
6
+ export declare const GeneralUsage: Story;
7
+ export declare const OpenByDefault: Story;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import * as RadixTooltip from "@radix-ui/react-tooltip";
3
+ export type TTooltipRootProps = React.ComponentProps<typeof RadixTooltip.Root>;
4
+ export type TTooltipTriggerProps = React.ComponentProps<typeof RadixTooltip.Trigger>;
5
+ export type TTooltipContentProps = React.ComponentProps<typeof RadixTooltip.Content>;
6
+ export declare const Tooltip: {
7
+ Root: ({ children, ...rest }: TTooltipRootProps) => React.JSX.Element;
8
+ Trigger: ({ className, children, ...rest }: TTooltipTriggerProps) => React.JSX.Element;
9
+ Content: ({ className, children, ...rest }: TTooltipContentProps) => React.JSX.Element;
10
+ };
@@ -8,7 +8,7 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
8
8
  } & Omit<any, "ref">>;
9
9
  export default _default;
10
10
  type Story = StoryObj<typeof Typography>;
11
- export declare const Default: Story;
11
+ export declare const GeneralUsage: Story;
12
12
  export declare const Variants: Story;
13
13
  export declare const Polymorphic: Story;
14
14
  export declare const DangerousHTML: Story;
@@ -1,12 +1,17 @@
1
1
  export * from "./Button";
2
+ export * from './Callout';
2
3
  export * from "./Columns";
3
4
  export * from "./DatePicker";
4
5
  export * from "./Disclosure";
5
6
  export * from "./Form";
7
+ export * from "./Loading";
8
+ export * from "./Modal";
6
9
  export * from "./NumberField";
10
+ export * from "./ProgressIndicator";
7
11
  export * from "./RadioGroup";
8
12
  export * from "./Range";
9
13
  export * from "./Select";
10
14
  export * from './TextField';
15
+ export * from "./Toast";
16
+ export * from './Tooltip';
11
17
  export * from './Typography';
12
- export * from './Callout';
@@ -1,8 +1,8 @@
1
1
  import { StoryObj } from "@storybook/react";
2
2
  import { Icon } from ".";
3
3
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, {
4
- size?: "large" | "regular" | "xlarge" | undefined;
5
- weight?: "medium" | "normal" | "light" | undefined;
4
+ size?: "regular" | "large" | "xlarge" | undefined;
5
+ weight?: "light" | "normal" | "medium" | undefined;
6
6
  } & Omit<import("react-material-symbols").MaterialSymbolProps, "size" | "weight">>;
7
7
  export default _default;
8
8
  type Story = StoryObj<typeof Icon>;