stp-ui-kit 0.0.7 → 0.0.9
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.
- package/dist/components/Message/Message.d.ts +19 -0
- package/dist/components/Message/Message.stories.d.ts +5 -0
- package/dist/components/Modal/Modal.d.ts +17 -16
- package/dist/components/Modal/Modal.stories.d.ts +7 -0
- package/dist/components/Modal/ModalApi.d.ts +18 -0
- package/dist/components/Table/Table.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +10 -0
- package/dist/components/index.d.ts +5 -1
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/lib/utils.d.ts +2 -0
- package/dist/stp-ui-kit.cjs.js +270 -11
- package/dist/stp-ui-kit.es.js +26233 -819
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/src/styles/_variables.scss +11 -9
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type MessageType = "default" | "warning" | "error";
|
|
2
|
+
interface MessageItem {
|
|
3
|
+
id: number;
|
|
4
|
+
type: MessageType;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Message: ({ id, type, text, onClose, }: MessageItem & {
|
|
8
|
+
onClose: (id: number) => void;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const MessageContainer: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const message: {
|
|
12
|
+
_id: number;
|
|
13
|
+
show(text: string, type?: MessageType): number | undefined;
|
|
14
|
+
default(text: string): number | undefined;
|
|
15
|
+
warning(text: string): number | undefined;
|
|
16
|
+
error(text: string): number | undefined;
|
|
17
|
+
close(id: number): void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface ModalAction {
|
|
3
|
+
content: string;
|
|
4
|
+
onAction: () => void;
|
|
5
|
+
}
|
|
2
6
|
export interface ModalProps {
|
|
7
|
+
activator?: ReactNode;
|
|
3
8
|
open: boolean;
|
|
4
9
|
onClose: () => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
title: string;
|
|
11
|
+
primaryAction?: ModalAction;
|
|
12
|
+
secondaryActions?: ModalAction[];
|
|
13
|
+
tone?: "default" | "critical" | "warning";
|
|
14
|
+
children: ReactNode;
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: React.ReactNode;
|
|
16
|
+
interface SectionProps {
|
|
17
|
+
children: ReactNode;
|
|
14
18
|
}
|
|
15
|
-
declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Header: typeof Header;
|
|
19
|
-
Content: typeof Content;
|
|
20
|
-
Footer: typeof Footer;
|
|
19
|
+
declare const Section: ({ children }: SectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
interface ModalComponent extends React.FC<ModalProps> {
|
|
21
|
+
Section: typeof Section;
|
|
21
22
|
}
|
|
22
|
-
declare const Modal:
|
|
23
|
+
declare const Modal: ModalComponent;
|
|
23
24
|
export { Modal };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { Modal } from './Modal';
|
|
3
|
+
declare const meta: Meta<typeof Modal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Default: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./Modal').ModalProps>;
|
|
6
|
+
export declare const Critical: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./Modal').ModalProps>;
|
|
7
|
+
export declare const Warning: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('./Modal').ModalProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ModalShowOptions {
|
|
3
|
+
title: string;
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
onOk?: () => void;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
okText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
tone?: "default" | "critical" | "warning";
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
centered?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function showModal(options: ModalShowOptions): void;
|
|
14
|
+
export declare const ModalAPI: {
|
|
15
|
+
error: (opts: Omit<ModalShowOptions, "tone">) => void;
|
|
16
|
+
warning: (opts: Omit<ModalShowOptions, "tone">) => void;
|
|
17
|
+
info: (opts: Omit<ModalShowOptions, "tone">) => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Table as ShadcnTable, TableBody as ShadcnTableBody, TableCaption as ShadcnTableCaption, TableCell as ShadcnTableCell, TableHead as ShadcnTableHead, TableHeader as ShadcnTableHeader, TableRow as ShadcnTableRow } from '../ui/table';
|
|
2
|
+
export declare const Table: React.FC<React.ComponentProps<typeof ShadcnTable>>;
|
|
3
|
+
export declare const TableBody: React.FC<React.ComponentProps<typeof ShadcnTableBody>>;
|
|
4
|
+
export declare const TableCaption: React.FC<React.ComponentProps<typeof ShadcnTableCaption>>;
|
|
5
|
+
export type CellType = "label" | "input" | "button" | "icon-button" | "checkbox" | "empty" | "icon-label";
|
|
6
|
+
export interface CustomTableCellProps extends React.ComponentProps<typeof ShadcnTableCell> {
|
|
7
|
+
cellType?: CellType;
|
|
8
|
+
hasBottomBorder?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const TableCell: ({ cellType, hasBottomBorder, className, children, ...props }: CustomTableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const TableHeader: React.FC<React.ComponentProps<typeof ShadcnTableHeader>>;
|
|
12
|
+
interface CustomTableHeadProps extends React.ComponentProps<typeof ShadcnTableHead> {
|
|
13
|
+
variant?: "primary" | "secondary";
|
|
14
|
+
}
|
|
15
|
+
export declare const TableHead: React.FC<CustomTableHeadProps>;
|
|
16
|
+
export declare const TableRow: React.FC<React.ComponentProps<typeof ShadcnTableRow>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
hoverDelay?: number;
|
|
6
|
+
preferredPosition?: "above" | "below" | "mostSpace" | "cover";
|
|
7
|
+
zIndexOverride?: number;
|
|
8
|
+
persistOnClick?: boolean;
|
|
9
|
+
trigger?: "hover" | "click" | "both";
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
tooltipClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Tooltip: ({ active: controlledActive, content, hoverDelay, preferredPosition, zIndexOverride, trigger, children, className, tooltipClassName, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { TooltipProps } from './Tooltip';
|
|
3
|
+
declare const meta: Meta<TooltipProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<TooltipProps>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const ClickToShow: Story;
|
|
8
|
+
export declare const BelowPosition: Story;
|
|
9
|
+
export declare const PersistentClick: Story;
|
|
10
|
+
export declare const CoverPosition: Story;
|
|
@@ -5,11 +5,15 @@ import { CourseCollapse } from './CourseCollapse/CourseCollapse';
|
|
|
5
5
|
import { Empty } from './Empty/Empty';
|
|
6
6
|
import { FormItem } from './FormItem/FormItem';
|
|
7
7
|
import { IconButton } from './IconButton/IconButton';
|
|
8
|
+
import { message, Message } from './Message/Message';
|
|
8
9
|
import { Modal } from './Modal/Modal';
|
|
10
|
+
import { ModalAPI } from './Modal/ModalApi';
|
|
9
11
|
import { NavigationItem } from './NavigationItem/NavigationItem';
|
|
10
12
|
import { PageHeader } from './PageHeader/PageHeader';
|
|
11
13
|
import { ProgressLine } from './ProgressLine/ProgressLine';
|
|
12
14
|
import { SectionHeader } from './SectionHeader/SectionHeader';
|
|
15
|
+
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from './Table/Table';
|
|
16
|
+
import { Tooltip } from './Tooltip/Tooltip';
|
|
13
17
|
import { TopBar } from './TopBar/TopBar';
|
|
14
18
|
import { Typography } from './Typography/Typography';
|
|
15
|
-
export { Banner, Button, Collapse, CourseCollapse, Empty, FormItem, IconButton, Modal, NavigationItem, PageHeader, ProgressLine, SectionHeader, TopBar, Typography, };
|
|
19
|
+
export { Banner, Button, Collapse, CourseCollapse, Empty, FormItem, IconButton, Modal, Tooltip, NavigationItem, PageHeader, ProgressLine, SectionHeader, TopBar, Typography, message, Message, ModalAPI, Table, TableBody, TableHead, TableHeader, TableCaption, TableCell, TableRow, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Banner, Button, Collapse, CourseCollapse, Empty, FormItem, IconButton, Modal, NavigationItem, PageHeader, ProgressLine, SectionHeader, TopBar, Typography } from './components';
|
|
2
|
-
|
|
2
|
+
import { Tooltip } from './components/Tooltip/Tooltip';
|
|
3
|
+
export { Banner, Button, Collapse, CourseCollapse, Empty, FormItem, IconButton, Modal, Tooltip, NavigationItem, PageHeader, ProgressLine, SectionHeader, TopBar, Typography, };
|