windows-98-ui
Version:
React component library inspired by and using the css from [98.css](https://github.com/jdan/98.css) library for vanilla html
124 lines (110 loc) • 4.85 kB
TypeScript
import * as React from 'react';
import React__default from 'react';
type PropsOf<C extends React__default.ElementType> = React__default.ComponentPropsWithoutRef<C>;
type AsProp<C extends React__default.ElementType> = {
as?: C;
};
type ExtendableProps<ExtendedProps, OverrideProps> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
type InheritableElementProps<C extends React__default.ElementType, Props = object> = ExtendableProps<PropsOf<C>, Props>;
type PolymorphicComponentProps<C extends React__default.ElementType, Props = object> = InheritableElementProps<C, Props & AsProp<C>>;
type PolymorphicRef<C extends React__default.ElementType> = React__default.Ref<React__default.ElementRef<C>>;
type PolymorphicComponentPropsWithRef<C extends React__default.ElementType, Props = object> = PolymorphicComponentProps<C, Props> & {
ref?: PolymorphicRef<C>;
};
type ButtonProps = PolymorphicComponentPropsWithRef<"button", {
label: string;
className?: string;
disabled?: boolean;
}>;
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
type CheckBoxProps = PolymorphicComponentPropsWithRef<'input', {
id: string;
checked?: boolean;
disabled?: boolean;
label?: string;
}>;
declare const CheckBox: React__default.ForwardRefExoticComponent<Omit<CheckBoxProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
type Option = {
value: string;
label: string;
};
type Options = Option[];
type DropdownProps = PolymorphicComponentPropsWithRef<"select", {
className?: string;
options: Options;
}>;
declare const Dropdown: React__default.ForwardRefExoticComponent<Omit<DropdownProps, "ref"> & React__default.RefAttributes<HTMLSelectElement>>;
type TextBoxProps<T> = PolymorphicComponentPropsWithRef<'input', {
className?: string;
label: string;
id: T;
type: string;
stacked?: boolean;
}>;
declare const TextBox: React__default.ForwardRefExoticComponent<Omit<TextBoxProps<string>, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
type SliderProps = PolymorphicComponentPropsWithRef<'input', {
label?: string;
type?: string;
id: string;
min: number | string;
max: number | string;
value: number | string;
minLabel?: string;
maxLabel?: string;
}>;
declare const Slider: React__default.ForwardRefExoticComponent<Omit<SliderProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
type TitleBarProps = PolymorphicComponentProps<'div', {
className?: string;
inactive?: boolean;
title?: string;
minimize?: boolean;
maximize?: boolean;
close?: boolean;
onMaximize?: () => void;
onMinimize?: () => void;
onClose?: () => void;
}>;
declare const TitleBar: React__default.ForwardRefExoticComponent<{
className?: string;
inactive?: boolean;
title?: string;
minimize?: boolean;
maximize?: boolean;
close?: boolean;
onMaximize?: () => void;
onMinimize?: () => void;
onClose?: () => void;
} & {
as?: "div" | undefined;
} & Omit<Omit<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "title" | "as" | "className" | "onClose" | "inactive" | "minimize" | "maximize" | "close" | "onMaximize" | "onMinimize"> & React__default.RefAttributes<HTMLDivElement>>;
type WindowProps = PolymorphicComponentPropsWithRef<'div', {
className?: string;
width?: string;
height?: string;
}>;
declare const Window: React__default.ForwardRefExoticComponent<Omit<WindowProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
type WidnowBodyProps = PolymorphicComponentPropsWithRef<'div', {
className?: string;
}>;
declare const WindowBody: React__default.ForwardRefExoticComponent<Omit<WidnowBodyProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
type DesktopProps = PolymorphicComponentPropsWithRef<'div', {
titleBarProps?: TitleBarProps;
windowProps?: WindowProps;
windowBodyProps?: WidnowBodyProps;
className?: string;
}>;
declare const Desktop: React.ForwardRefExoticComponent<Omit<DesktopProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
type TreeItem = {
label: string;
items?: TreeItem[];
};
type TreeViewProps = PolymorphicComponentPropsWithRef<'ul', {
items: TreeItem[];
}>;
declare const TreeView: React__default.ForwardRefExoticComponent<Omit<TreeViewProps, "ref"> & React__default.RefAttributes<HTMLUListElement>>;
type ProgressProps = PolymorphicComponentPropsWithRef<'div'> & {
variant?: '' | 'segmented';
value?: number;
};
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
export { Button, CheckBox, Desktop, Dropdown, Progress, Slider, TextBox, TitleBar, TreeView, Window, WindowBody };