uikit-react-public 0.24.3 → 0.24.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,6 +1,38 @@
1
- export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
1
+ import { SpecificIconProps } from '../Icon/Icon';
2
+ import { ThemeType } from '../../theme';
3
+ export type BadgeVariant = 'neutral' | 'neutral-subtle' | 'critical' | 'critical-subtle' | 'caution' | 'caution-subtle' | 'success' | 'success-subtle' | 'warning' | 'warning-subtle' | 'disabled';
4
+ export declare const VARIANT_ICON_MAP: {
5
+ neutral: import('react').FC<SpecificIconProps>;
6
+ 'neutral-subtle': import('react').FC<SpecificIconProps>;
7
+ critical: import('react').FC<SpecificIconProps>;
8
+ 'critical-subtle': import('react').FC<SpecificIconProps>;
9
+ caution: import('react').FC<SpecificIconProps>;
10
+ 'caution-subtle': import('react').FC<SpecificIconProps>;
11
+ success: import('react').FC<SpecificIconProps>;
12
+ 'success-subtle': import('react').FC<SpecificIconProps>;
13
+ warning: import('react').FC<SpecificIconProps>;
14
+ 'warning-subtle': import('react').FC<SpecificIconProps>;
15
+ disabled: null;
16
+ };
17
+ export interface BadgeVariantStyle {
18
+ color: string;
19
+ backgroundColor: string;
20
+ border?: string;
21
+ }
22
+ export declare const getBadgeVariantColours: (theme: ThemeType) => Record<BadgeVariant, BadgeVariantStyle>;
23
+ export type BadgeIndicator = {
24
+ statusIndicator?: boolean;
25
+ icon?: never;
26
+ } | {
27
+ icon?: boolean;
28
+ statusIndicator?: never;
29
+ };
30
+ export interface BadgeBaseProps extends React.HTMLAttributes<HTMLSpanElement> {
2
31
  testId?: string;
3
32
  className?: string;
33
+ variant?: BadgeVariant;
34
+ size?: 'medium' | 'large';
4
35
  }
5
- declare const Badge: ({ testId, className, children, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
36
+ export type BadgeProps = BadgeBaseProps & BadgeIndicator;
37
+ declare const Badge: ({ testId, className, variant, size, statusIndicator, icon, children, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
6
38
  export default Badge;
@@ -1,15 +1,60 @@
1
1
  import { StoryObj } from '@storybook/react';
2
+ import { BadgeVariant } from './Badge';
2
3
  declare const meta: {
3
4
  title: string;
4
- component: ({ testId, className, children, ...props }: import('./Badge').BadgeProps) => import("react/jsx-runtime").JSX.Element;
5
+ component: ({ testId, className, variant, size, statusIndicator, icon, children, ...props }: import('./Badge').BadgeProps) => import("react/jsx-runtime").JSX.Element;
5
6
  parameters: {
6
7
  layout: string;
7
8
  };
9
+ argTypes: {
10
+ variant: {
11
+ options: BadgeVariant[];
12
+ control: {
13
+ type: "select";
14
+ };
15
+ };
16
+ size: {
17
+ options: string[];
18
+ control: {
19
+ type: "radio";
20
+ };
21
+ };
22
+ icon: {
23
+ control: {
24
+ type: "boolean";
25
+ };
26
+ };
27
+ statusIndicator: {
28
+ control: {
29
+ type: "boolean";
30
+ };
31
+ };
32
+ testId: {
33
+ control: {
34
+ type: "text";
35
+ };
36
+ };
37
+ className: {
38
+ control: false;
39
+ };
40
+ children: {
41
+ control: {
42
+ type: "text";
43
+ };
44
+ };
45
+ };
8
46
  args: {
9
47
  children: string;
48
+ variant: "neutral";
49
+ size: "medium";
10
50
  };
11
51
  tags: string[];
12
52
  };
13
53
  export default meta;
14
54
  type Story = StoryObj<typeof meta>;
15
55
  export declare const Default: Story;
56
+ export declare const Large: Story;
57
+ export declare const WithIcon: Story;
58
+ export declare const WithStatusIndicator: Story;
59
+ export declare const AllVariants: Story;
60
+ export declare const Sizes: Story;
@@ -0,0 +1 @@
1
+ export {};