@nurihaus/web-design-system 1.1.28 → 1.1.30
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/check-box/base-check-box.d.ts +9 -0
- package/dist/components/check-box/check-box-type.d.ts +13 -0
- package/dist/components/check-box/check-box.d.ts +8 -0
- package/dist/components/check-box/check-box.stories.d.ts +11 -0
- package/dist/components/core/composer/index.d.ts +1 -2
- package/dist/components/elements/text/text-type.d.ts +16 -0
- package/dist/components/elements/text/text-with-bold.d.ts +2 -0
- package/dist/components/elements/text/text.d.ts +6 -0
- package/dist/components/elements/text/text.stories.d.ts +9 -0
- package/dist/components/radio/base-radio.d.ts +12 -0
- package/dist/components/radio/radio-type.d.ts +25 -0
- package/dist/components/radio/radio.d.ts +4 -0
- package/dist/components/radio/radio.stories.d.ts +9 -0
- package/dist/helpers/hooks/useExternalState.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +484 -5
- package/package.json +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import "./check-box-style.css";
|
|
3
|
+
import { CheckBoxInputProps, CheckBoxLabelProps, CheckBoxProps } from "./check-box-type";
|
|
4
|
+
declare const CheckBoxRoot: {
|
|
5
|
+
(props: PropsWithChildren<CheckBoxProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Label: (props: PropsWithChildren<CheckBoxLabelProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Input: (props: PropsWithChildren<CheckBoxInputProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default CheckBoxRoot;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface CheckBoxProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
id: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckBoxInputProps extends ComponentPropsWithRef<"input"> {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface CheckBoxLabelProps {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./check-box-style.css";
|
|
2
|
+
import "../../styles/token/color.css";
|
|
3
|
+
import "../../styles/token/font.css";
|
|
4
|
+
import { CheckBoxProps } from "./check-box-type";
|
|
5
|
+
declare const CheckBox: (props: CheckBoxProps & {
|
|
6
|
+
label: string;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default CheckBox;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react/*";
|
|
2
|
+
import CheckBox from "./check-box";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: (props: import("./check-box-type").CheckBoxProps & {
|
|
6
|
+
label: string;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof CheckBox>;
|
|
11
|
+
export declare const Default: Story;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
interface ComposerProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
2
|
children?: React.ReactNode;
|
|
4
3
|
}
|
|
5
|
-
declare const Composer:
|
|
4
|
+
declare const Composer: import("react").ForwardRefExoticComponent<ComposerProps & import("react").RefAttributes<HTMLElement>>;
|
|
6
5
|
export type { ComposerProps };
|
|
7
6
|
export default Composer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes } from "react";
|
|
2
|
+
import { colors } from "../../../styles/token/colors";
|
|
3
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
text: string;
|
|
5
|
+
size: "xsm" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
6
|
+
weight: "regular" | "medium" | "semibold" | "bold" | "extrabold";
|
|
7
|
+
color?: keyof typeof colors;
|
|
8
|
+
textDecoration?: CSSProperties["textDecoration"];
|
|
9
|
+
textAlign?: CSSProperties["textAlign"];
|
|
10
|
+
wordBreak?: CSSProperties["wordBreak"];
|
|
11
|
+
whiteSpace?: CSSProperties["whiteSpace"];
|
|
12
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "strong";
|
|
13
|
+
}
|
|
14
|
+
export interface TextWithBoldProps extends TextProps {
|
|
15
|
+
boldText: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react/*";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: (props: import("./text-type").TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof meta>;
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
export declare const Bold: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { RadioButtonProps, RadioIndicatorProps, RadioLabelProps, RadioOptionGroupProps, RadioRootProps } from "./radio-type";
|
|
3
|
+
import "../../styles/token/color.css";
|
|
4
|
+
import "../../styles/token/font.css";
|
|
5
|
+
declare const RadioRoot: {
|
|
6
|
+
(props: PropsWithChildren<RadioRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Indicator: (props: PropsWithChildren<RadioIndicatorProps>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Label: (props: PropsWithChildren<RadioLabelProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
OptionGroup: (props: PropsWithChildren<RadioOptionGroupProps>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Button: (props: PropsWithChildren<RadioButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export default RadioRoot;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
export interface RadioRootProps {
|
|
4
|
+
options: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
selected?: null | string;
|
|
9
|
+
onChange?: (id: string | null) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface RadioOptionGroupProps extends ComponentPropsWithRef<"ul"> {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface RadioLabelProps extends ComponentPropsWithRef<"label"> {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RadioButtonProps extends ComponentPropsWithRef<"div"> {
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RadioIndicatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react/*";
|
|
2
|
+
import Radio from "./radio";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: (props: import("./radio-type").RadioRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<typeof Radio>;
|
|
9
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface ExternalStateType<T> {
|
|
2
|
+
prop?: T | null;
|
|
3
|
+
handler?: (state: T) => void;
|
|
4
|
+
defaultProp: T;
|
|
5
|
+
}
|
|
6
|
+
export declare const useExternalState: <T>({ prop, handler, defaultProp, }: ExternalStateType<T>) => readonly [T, (handledValue: T | ((prevState: T) => T)) => void];
|
|
7
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,3 +6,5 @@ export { default as IconTextOptionBadge } from "./components/badge/icon-text-opt
|
|
|
6
6
|
export { default as DataTable } from "./components/table/data-table";
|
|
7
7
|
export { default as TextField } from "./components/text-field/text-field";
|
|
8
8
|
export { default as TextFieldWithError } from "./components/text-field/text-field-with-error";
|
|
9
|
+
export { default as Radio } from "./components/radio/radio";
|
|
10
|
+
export { default as Checkbox } from "./components/check-box/check-box";
|