@nurihaus/web-design-system 0.0.29 → 1.1.0
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/avatar/avatar-type.d.ts +7 -0
- package/dist/components/avatar/avatar.d.ts +1 -7
- package/dist/components/badge/badge-type.d.ts +10 -0
- package/dist/components/badge/base-badge.d.ts +2 -0
- package/dist/components/badge/icon-text-badge.d.ts +7 -0
- package/dist/components/badge/icon-text-option-badge.d.ts +9 -0
- package/dist/components/badge/option-badge.d.ts +6 -0
- package/dist/components/button/base-button.d.ts +4 -6
- package/dist/components/button/button-type.d.ts +13 -0
- package/dist/components/button/button.stories.d.ts +10 -0
- package/dist/components/button/cta-button.d.ts +1 -9
- package/dist/components/loading/{Loading.d.ts → loading.d.ts} +1 -1
- package/dist/components/table/base-table.d.ts +11 -0
- package/dist/components/table/data-table.d.ts +13 -0
- package/dist/components/table/table-type.d.ts +15 -0
- package/dist/components/table/table.stories.d.ts +57 -0
- package/dist/components/text-field/base-text-field.d.ts +14 -0
- package/dist/components/text-field/text-field-type.d.ts +10 -0
- package/dist/components/text-field/text-field-with-error.d.ts +10 -0
- package/dist/components/text-field/text-field.d.ts +10 -0
- package/dist/components/text-field/text-filed.stories.d.ts +14 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +413 -166
- package/package.json +15 -8
- package/dist/components/badge/badge.d.ts +0 -27
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
1
|
import "./avatar-style.css";
|
|
3
|
-
|
|
4
|
-
size: "xl" | "l" | "m" | "s";
|
|
5
|
-
src?: string;
|
|
6
|
-
alt?: string;
|
|
7
|
-
badgeOption?: ReactNode | string;
|
|
8
|
-
}
|
|
2
|
+
import { AvatarProps } from "./avatar-type";
|
|
9
3
|
declare const Avatar: (props: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
4
|
export default Avatar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { colors } from "../../styles/token/colors";
|
|
3
|
+
export interface BaseBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
borderColor?: keyof typeof colors;
|
|
5
|
+
textColor?: keyof typeof colors;
|
|
6
|
+
backgroundColor?: keyof typeof colors;
|
|
7
|
+
size?: "l" | "m" | "r" | "s" | "sm";
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BaseBadgeProps } from "./badge-type";
|
|
3
|
+
declare const IconTextBadge: (props: Omit<BaseBadgeProps, "asChild" | "children"> & {
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
text: ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default IconTextBadge;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./badge-style.css";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { BaseBadgeProps } from "./badge-type";
|
|
4
|
+
declare const IconTextOptionBadge: (props: Omit<BaseBadgeProps, "asChild" | "children"> & {
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
text: ReactNode;
|
|
7
|
+
option: ReactNode;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default IconTextOptionBadge;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./button-style.css";
|
|
2
3
|
import "../../styles/token/color.css";
|
|
3
4
|
import "../../styles/token/font.css";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
asChild?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare const BaseButton: import("react").ForwardRefExoticComponent<BaseButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
import { BaseButtonProps } from "./button-type";
|
|
6
|
+
declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
7
|
export default BaseButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface BaseButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface CTAButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: "primary" | "secondary" | "ghost" | "white";
|
|
8
|
+
size?: "xl" | "l" | "m" | "r" | "s";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react/*";
|
|
2
|
+
import { CTAButtonProps } from "./button-type";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: (props: CTAButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof meta>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
export declare const Primary: StoryObj<CTAButtonProps>;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface CTAButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
variant?: "primary" | "secondary" | "ghost" | "white";
|
|
4
|
-
size?: "xl" | "l" | "m" | "r" | "s";
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
icon?: ReactNode;
|
|
8
|
-
text: string;
|
|
9
|
-
}
|
|
1
|
+
import { CTAButtonProps } from "./button-type";
|
|
10
2
|
declare const CTAButton: (props: CTAButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
3
|
export default CTAButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./table-style.css";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { TableCellProps, TableHeaderProps, TableRowProps } from "./table-type";
|
|
4
|
+
declare const TableRoot: {
|
|
5
|
+
(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Header: (props: TableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Body: (props: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Row: (props: TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
Cell: (props: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export default TableRoot;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RowItem {
|
|
2
|
+
id: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
type ColumnsType<T extends readonly RowItem[]> = Array<{
|
|
6
|
+
[K in T[number]["id"]]: any;
|
|
7
|
+
}>;
|
|
8
|
+
export interface DataTableProps<T extends readonly RowItem[]> {
|
|
9
|
+
rows: T;
|
|
10
|
+
columns: ColumnsType<T>;
|
|
11
|
+
}
|
|
12
|
+
declare const DataTable: <T extends readonly RowItem[]>(props: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default DataTable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface TableProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export interface TableRootProps extends Omit<TableProps, "children">, ComponentPropsWithRef<"table"> {
|
|
6
|
+
}
|
|
7
|
+
export interface TableHeaderProps extends Omit<TableProps, "children">, ComponentPropsWithRef<"thead"> {
|
|
8
|
+
justify?: "center" | "start" | "end";
|
|
9
|
+
}
|
|
10
|
+
export interface TableRowProps extends Omit<TableProps, "children">, ComponentPropsWithRef<"tr"> {
|
|
11
|
+
}
|
|
12
|
+
export interface TableBodyProps extends Omit<TableProps, "children">, ComponentPropsWithRef<"tbody"> {
|
|
13
|
+
}
|
|
14
|
+
export interface TableCellProps extends Omit<TableProps, "children">, ComponentPropsWithRef<"td"> {
|
|
15
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import { DataTableProps, RowItem } from "./data-table";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: <T extends readonly RowItem[]>(props: DataTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
declare const rows: readonly [{
|
|
9
|
+
readonly id: "row1";
|
|
10
|
+
readonly value: "row1";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "row2";
|
|
13
|
+
readonly value: "row2";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "row3";
|
|
16
|
+
readonly value: "row3";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "row4";
|
|
19
|
+
readonly value: "row4";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "row5";
|
|
22
|
+
readonly value: "row5";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "row6";
|
|
25
|
+
readonly value: "row6";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "row7";
|
|
28
|
+
readonly value: "row7";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "row8";
|
|
31
|
+
readonly value: "row8";
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "row9";
|
|
34
|
+
readonly value: "row9";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "row10";
|
|
37
|
+
readonly value: "row10";
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "row11";
|
|
40
|
+
readonly value: "row11";
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "row12";
|
|
43
|
+
readonly value: "row12";
|
|
44
|
+
}, {
|
|
45
|
+
readonly id: "row13";
|
|
46
|
+
readonly value: "row13";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "row14";
|
|
49
|
+
readonly value: "row14";
|
|
50
|
+
}, {
|
|
51
|
+
readonly id: "row15";
|
|
52
|
+
readonly value: "row15";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "row16";
|
|
55
|
+
readonly value: "row16";
|
|
56
|
+
}];
|
|
57
|
+
export declare const Default: StoryObj<DataTableProps<typeof rows>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import "./text-field-style.css";
|
|
3
|
+
import "../../styles/token/font.css";
|
|
4
|
+
import { TextFieldHelperTextProps, TextFieldInputProps, TextFieldLabelProps } from "./text-field-type";
|
|
5
|
+
declare const TextFieldRoot: {
|
|
6
|
+
({ children, validations, width, }: PropsWithChildren<{
|
|
7
|
+
validations?: RegExp[];
|
|
8
|
+
width?: number;
|
|
9
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
TextLabel: (props: TextFieldLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
InputField: (props: TextFieldInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
HelperText: (props: TextFieldHelperTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export default TextFieldRoot;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface TextFieldLabelProps extends ComponentPropsWithRef<"div"> {
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TextFieldInputProps extends ComponentPropsWithRef<"input"> {
|
|
6
|
+
}
|
|
7
|
+
export interface TextFieldHelperTextProps extends ComponentPropsWithRef<"div"> {
|
|
8
|
+
text: string;
|
|
9
|
+
isError?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./text-field-style.css";
|
|
2
|
+
import "../../styles/token/font.css";
|
|
3
|
+
declare const TextFieldWithError: ({ width, placeholder, name, helperText, labelText, }: {
|
|
4
|
+
width?: number;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
labelText?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default TextFieldWithError;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./text-field-style.css";
|
|
2
|
+
import "../../styles/token/font.css";
|
|
3
|
+
declare const TextField: ({ width, placeholder, name, helperText, labelText, }: {
|
|
4
|
+
width?: number;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
labelText?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default TextField;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react/*";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ width, placeholder, name, helperText, labelText, }: {
|
|
5
|
+
width?: number;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
labelText?: string;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof meta>;
|
|
14
|
+
export declare const Default: Story;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { default as Avatar } from "./components/avatar/avatar";
|
|
2
2
|
export { default as CTAButton } from "./components/button/cta-button";
|
|
3
|
+
export { default as OptionBadge } from "./components/badge/option-badge";
|
|
4
|
+
export { default as IconTextBadge } from "./components/badge/icon-text-badge";
|
|
5
|
+
export { default as IconTextOptionBadge } from "./components/badge/icon-text-option-badge";
|
|
6
|
+
export { default as DataTable } from "./components/table/data-table";
|