@react95/core 8.0.0-alpha.9 → 8.0.1

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.
Files changed (84) hide show
  1. package/README.md +18 -42
  2. package/cjs/Avatar/Avatar.cjs +2 -19
  3. package/cjs/Button/Button.cjs +1 -1
  4. package/cjs/Fieldset/Fieldset.cjs +1 -1
  5. package/cjs/Frame/Frame.cjs +1 -0
  6. package/cjs/Input/Input.cjs +1 -20
  7. package/cjs/List/List.cjs +3 -5
  8. package/cjs/List/ListDivider.cjs +1 -11
  9. package/cjs/Modal/Modal.cjs +17 -36
  10. package/cjs/Modal/ModalProvider.cjs +6 -21
  11. package/cjs/Range/Range.cjs +9 -28
  12. package/cjs/Tabs/Tabs.cjs +16 -19
  13. package/cjs/TextArea/TextArea.cjs +2 -19
  14. package/cjs/TitleBar/TitleBar.cjs +10 -8
  15. package/cjs/Tooltip/Tooltip.cjs +6 -23
  16. package/cjs/Tree/Node.cjs +10 -27
  17. package/cjs/Tree/Tree.css.ts.vanilla.css +1 -1
  18. package/cjs/Video/Video.cjs +28 -44
  19. package/cjs/Video/buttons/Fullscreen.cjs +2 -19
  20. package/cjs/Video/buttons/Pause.cjs +2 -19
  21. package/cjs/Video/buttons/Play.cjs +2 -19
  22. package/cjs/Video/buttons/Stop.cjs +2 -19
  23. package/esm/Alert/Alert.mjs +6 -6
  24. package/esm/Avatar/Avatar.mjs +2 -2
  25. package/esm/Button/Button.mjs +4 -4
  26. package/esm/Checkbox/Checkbox.mjs +3 -3
  27. package/esm/Dropdown/Dropdown.mjs +2 -2
  28. package/esm/Fieldset/Fieldset.mjs +2 -2
  29. package/esm/Frame/Frame.mjs +4 -3
  30. package/esm/Input/Input.mjs +2 -4
  31. package/esm/List/List.mjs +3 -5
  32. package/esm/List/ListDivider.mjs +2 -12
  33. package/esm/List/ListItem.mjs +3 -3
  34. package/esm/Modal/Modal.mjs +9 -11
  35. package/esm/Modal/ModalProvider.mjs +6 -4
  36. package/esm/ProgressBar/ProgressBar.mjs +4 -4
  37. package/esm/RadioButton/RadioButton.mjs +3 -3
  38. package/esm/Range/Range.mjs +11 -13
  39. package/esm/Tabs/Tab.mjs +2 -2
  40. package/esm/Tabs/Tabs.mjs +21 -24
  41. package/esm/TaskBar/Clock.mjs +3 -3
  42. package/esm/TaskBar/TaskBar.mjs +9 -9
  43. package/esm/TaskBar/WindowButton.mjs +3 -3
  44. package/esm/TextArea/TextArea.mjs +2 -2
  45. package/esm/TitleBar/TitleBar.mjs +16 -14
  46. package/esm/Tooltip/Tooltip.mjs +5 -5
  47. package/esm/Tree/Node.mjs +2 -2
  48. package/esm/Tree/Tree.css.ts.vanilla.css +1 -1
  49. package/esm/Tree/Tree.mjs +2 -2
  50. package/esm/Video/Video.mjs +14 -13
  51. package/esm/Video/buttons/Fullscreen.mjs +1 -1
  52. package/esm/Video/buttons/Pause.mjs +1 -1
  53. package/esm/Video/buttons/Play.mjs +1 -1
  54. package/esm/Video/buttons/Stop.mjs +1 -1
  55. package/package.json +7 -7
  56. package/types/Avatar/Avatar.d.ts +7 -4
  57. package/types/Button/Button.d.ts +5 -2
  58. package/types/Checkbox/Checkbox.d.ts +3 -2
  59. package/types/Dropdown/Dropdown.d.ts +2 -1
  60. package/types/Fieldset/Fieldset.d.ts +2 -1
  61. package/types/Frame/Frame.d.ts +7 -4
  62. package/types/Input/Input.d.ts +1 -1
  63. package/types/List/List.d.ts +1 -1
  64. package/types/List/ListItem.d.ts +3 -2
  65. package/types/Modal/Modal.d.ts +8 -8
  66. package/types/Modal/ModalContext.d.ts +2 -2
  67. package/types/Modal/ModalProvider.d.ts +2 -2
  68. package/types/ProgressBar/ProgressBar.d.ts +6 -3
  69. package/types/RadioButton/RadioButton.d.ts +2 -1
  70. package/types/Range/Range.d.ts +1 -1
  71. package/types/Tabs/Tab.d.ts +3 -2
  72. package/types/Tabs/Tabs.d.ts +3 -2
  73. package/types/TaskBar/TaskBar.d.ts +2 -1
  74. package/types/TaskBar/WindowButton.d.ts +2 -1
  75. package/types/TextArea/TextArea.d.ts +1 -1
  76. package/types/TitleBar/TitleBar.d.ts +5 -4
  77. package/types/Tooltip/Tooltip.d.ts +3 -2
  78. package/types/Tree/Node.d.ts +7 -6
  79. package/types/Tree/Tree.d.ts +2 -2
  80. package/types/Video/Video.d.ts +10 -9
  81. package/types/Video/buttons/Fullscreen.d.ts +3 -2
  82. package/types/Video/buttons/Pause.d.ts +3 -2
  83. package/types/Video/buttons/Play.d.ts +3 -2
  84. package/types/Video/buttons/Stop.d.ts +3 -2
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import type { HTMLProps } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
4
  export type FieldSetProps = {
4
5
  legend?: string;
5
- } & React.HTMLProps<HTMLFieldSetElement> & FrameProps;
6
+ } & HTMLProps<HTMLFieldSetElement> & Omit<FrameProps<'fieldset'>, 'as'>;
6
7
  export declare const Fieldset: React.ForwardRefExoticComponent<Omit<FieldSetProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
@@ -1,10 +1,13 @@
1
- import React, { ComponentPropsWithRef, ElementType } from 'react';
1
+ import React from 'react';
2
+ import type { ComponentPropsWithRef, ElementType, Ref, ReactNode, RefAttributes } from 'react';
2
3
  import { Sprinkles } from './Frame.css';
4
+ type FixedForwardRef = <T, P = object>(render: (props: P, ref: Ref<T>) => ReactNode) => (props: P & RefAttributes<T>) => ReactNode;
5
+ export declare const fixedForwardRef: FixedForwardRef;
3
6
  type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends any ? Omit<T, TOmitted> : never;
4
- export type FrameProps<TAs extends ElementType = 'div'> = {
7
+ export type FrameProps<TAs extends ElementType> = {
5
8
  as?: TAs;
6
9
  } & DistributiveOmit<ComponentPropsWithRef<ElementType extends TAs ? 'div' : TAs>, 'as'> & Sprinkles;
7
- export declare const Frame: <TAs extends React.ElementType>(props: {
10
+ export declare const Frame: <TAs extends React.ElementType = "div">(props: {
8
11
  as?: TAs | undefined;
9
12
  } & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends TAs ? "div" : TAs>, "as"> & import("rainbow-sprinkles/dist/declarations/src/types").ChildSprinkles<{
10
13
  readonly backgroundColor: {
@@ -2247,5 +2250,5 @@ export declare const Frame: <TAs extends React.ElementType>(props: {
2247
2250
  default: string;
2248
2251
  };
2249
2252
  };
2250
- }> & React.RefAttributes<any>) => React.ReactNode;
2253
+ }> & React.RefAttributes<any>) => ReactNode;
2251
2254
  export {};
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { FrameProps } from '../Frame/Frame';
3
3
  export type InputProps = Omit<FrameProps<'input'>, 'as'>;
4
4
  export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,7 @@
1
+ import React from 'react';
1
2
  import { ListItem } from './ListItem';
2
3
  import { Divider } from './ListDivider';
3
4
  import { FrameProps } from '../Frame/Frame';
4
- import React from 'react';
5
5
  export type ListProps = Omit<FrameProps<'ul'>, 'as'>;
6
6
  declare const ListRenderer: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
7
7
  export type IListProps = typeof ListRenderer & {
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import type { ReactElement, HtmlHTMLAttributes } from 'react';
2
3
  export type ListItemProps = {
3
- icon?: React.ReactElement;
4
- } & React.HtmlHTMLAttributes<HTMLLIElement>;
4
+ icon?: ReactElement;
5
+ } & HtmlHTMLAttributes<HTMLLIElement>;
5
6
  export declare const ListItem: React.ForwardRefExoticComponent<{
6
7
  icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
7
8
  } & React.HtmlHTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
@@ -1,30 +1,30 @@
1
1
  /// <reference path="../../../../../types/draggable.d.ts" />
2
- import * as React from 'react';
2
+ import React, { HTMLAttributes, ReactElement, MouseEvent } from 'react';
3
3
  import { DraggableProps } from 'react-draggable';
4
4
  import { List } from '../List/List';
5
5
  import { FrameProps } from '../Frame/Frame';
6
6
  export type ModalButtons = {
7
7
  value: string;
8
- onClick(event: React.MouseEvent): void;
8
+ onClick(event: MouseEvent): void;
9
9
  };
10
10
  export type ModalMenu = {
11
11
  name: string;
12
- list: React.ReactElement<typeof List>;
12
+ list: ReactElement<typeof List>;
13
13
  };
14
14
  export type ModalDefaultPosition = {
15
15
  x: number;
16
16
  y: number;
17
17
  };
18
18
  export type ModalProps = {
19
- icon?: React.ReactElement;
20
- onClose(event: React.MouseEvent): void;
21
- onHelp?(event: React.MouseEvent): void;
19
+ icon?: ReactElement;
20
+ onClose(event: MouseEvent): void;
21
+ onHelp?(event: MouseEvent): void;
22
22
  title: string;
23
23
  buttons?: Array<ModalButtons>;
24
24
  menu?: Array<ModalMenu>;
25
25
  defaultPosition?: DraggableProps['defaultPosition'];
26
26
  positionOffset?: DraggableProps['positionOffset'];
27
27
  hasWindowButton?: boolean;
28
- buttonsAlignment?: FrameProps['justifyContent'];
29
- } & Omit<FrameProps, 'as'> & React.HTMLAttributes<HTMLDivElement>;
28
+ buttonsAlignment?: FrameProps<'div'>['justifyContent'];
29
+ } & Omit<FrameProps<'div'>, 'as'> & HTMLAttributes<HTMLDivElement>;
30
30
  export declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import type { ReactElement } from 'react';
2
2
  export type Windows = {
3
- icon?: React.ReactElement;
3
+ icon?: ReactElement;
4
4
  title: string;
5
5
  hasButton: boolean;
6
6
  };
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  export type ModalProviderProps = {};
3
- export declare const ModalProvider: React.FC<React.PropsWithChildren<ModalProviderProps>>;
3
+ export declare const ModalProvider: FC<PropsWithChildren<ModalProviderProps>>;
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
+ import type { ElementType, ReactElement, ElementRef, ForwardedRef } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
- export type ProgressBarProps = {
4
+ export type ProgressBarProps<TAs extends ElementType> = {
4
5
  percent?: number;
5
- } & FrameProps;
6
- export declare const ProgressBar: React.ForwardRefExoticComponent<Omit<ProgressBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ } & FrameProps<TAs>;
7
+ export declare const ProgressBar: <TAs extends React.ElementType = "div">(props: ProgressBarProps<TAs> & {
8
+ ref?: ForwardedRef<ElementRef<TAs>>;
9
+ }) => ReactElement;
@@ -1,3 +1,4 @@
1
1
  import React from 'react';
2
- export type RadioButtonProps = React.InputHTMLAttributes<HTMLInputElement>;
2
+ import type { InputHTMLAttributes } from 'react';
3
+ export type RadioButtonProps = InputHTMLAttributes<HTMLInputElement>;
3
4
  export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { FrameProps } from '../Frame/Frame';
3
3
  export type RangeProps = Omit<FrameProps<'input'>, 'as'>;
4
4
  export declare const Range: React.ForwardRefExoticComponent<Omit<RangeProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import type { MouseEvent, HTMLProps } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
4
  export type TabProps = {
4
5
  activeTab?: string;
5
6
  title: string;
6
7
  disabled?: boolean;
7
- onClick?(e: React.MouseEvent): void;
8
- } & React.HTMLProps<HTMLLIElement> & Omit<FrameProps<'li'>, 'as'>;
8
+ onClick?(e: MouseEvent): void;
9
+ } & HTMLProps<HTMLLIElement> & Omit<FrameProps<'li'>, 'as'>;
9
10
  export declare const Tab: React.ForwardRefExoticComponent<Omit<TabProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import type { MouseEvent, ReactElement } from 'react';
2
3
  import { TabProps } from './Tab';
3
4
  import { FrameProps } from '../Frame/Frame';
4
5
  export type TabsProps = {
5
6
  defaultActiveTab?: string;
6
- children: React.ReactElement<TabProps> | Array<React.ReactElement<TabProps>>;
7
- onChange?(title: string, e: React.MouseEvent): void;
7
+ children: ReactElement<TabProps> | Array<ReactElement<TabProps>>;
8
+ onChange?(title: string, e: MouseEvent): void;
8
9
  } & Omit<FrameProps<'ol'>, 'as'>;
9
10
  export declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsProps, "ref"> & React.RefAttributes<HTMLOListElement>>;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import type { ReactElement } from 'react';
2
3
  import { List } from '../List/List';
3
4
  export type TaskBarProps = {
4
- list?: React.ReactElement<typeof List>;
5
+ list?: ReactElement<typeof List>;
5
6
  };
6
7
  export declare const TaskBar: React.ForwardRefExoticComponent<TaskBarProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import type { ButtonHTMLAttributes } from 'react';
2
3
  import { Windows } from '../Modal/ModalContext';
3
4
  export type WindowButtonProps = {
4
5
  small?: boolean;
5
6
  active?: boolean;
6
- } & Pick<Windows, 'icon'> & React.ButtonHTMLAttributes<HTMLButtonElement>;
7
+ } & Pick<Windows, 'icon'> & ButtonHTMLAttributes<HTMLButtonElement>;
7
8
  export declare const WindowButton: React.ForwardRefExoticComponent<{
8
9
  small?: boolean | undefined;
9
10
  active?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { FrameProps } from '../Frame/Frame';
3
3
  export type TextAreaProps = Omit<FrameProps<'textarea'>, 'as'>;
4
4
  export declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
@@ -1,17 +1,18 @@
1
1
  import React from 'react';
2
+ import type { ReactElement, HTMLAttributes } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
- declare const OptionsBox: React.ForwardRefExoticComponent<Omit<FrameProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const OptionsBox: React.ForwardRefExoticComponent<Omit<FrameProps<"div">, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
5
  declare const Option: React.ForwardRefExoticComponent<Omit<FrameProps<"button">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
- export interface TitleBarBackgroundProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, FrameProps {
6
+ export interface TitleBarBackgroundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>, FrameProps<'div'> {
6
7
  active?: boolean;
7
- icon?: React.ReactElement;
8
+ icon?: ReactElement;
8
9
  title?: string;
9
10
  }
10
11
  interface TitleBarOptions {
11
12
  Option: typeof Option;
12
13
  OptionsBox: typeof OptionsBox;
13
14
  }
14
- export interface TitleBarProps extends TitleBarBackgroundProps, TitleBarOptions, FrameProps {
15
+ export interface TitleBarProps extends TitleBarBackgroundProps, TitleBarOptions, FrameProps<'div'> {
15
16
  }
16
17
  export declare const TitleBar: TitleBarProps & React.ForwardRefRenderFunction<HTMLDivElement, TitleBarBackgroundProps>;
17
18
  export {};
@@ -1,8 +1,9 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
2
3
  export type TooltipProps = {
3
4
  text?: string;
4
5
  delay?: number;
5
- } & React.HTMLAttributes<HTMLDivElement>;
6
+ } & HTMLAttributes<HTMLDivElement>;
6
7
  export declare const Tooltip: React.ForwardRefExoticComponent<{
7
8
  text?: string | undefined;
8
9
  delay?: number | undefined;
@@ -1,4 +1,5 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import type { FC, ReactElement, MouseEvent, KeyboardEvent } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
4
  export declare const icons: {
4
5
  readonly FILE_MEDIA: React.FC<import("@react95/icons").MediaCdProps>;
@@ -12,11 +13,11 @@ export declare const icons: {
12
13
  };
13
14
  export type NodeProps = {
14
15
  label: string;
15
- icon?: React.ReactElement;
16
+ icon?: ReactElement;
16
17
  id: number;
17
18
  children?: Array<NodeProps>;
18
- onClick?(event: React.MouseEvent | React.KeyboardEvent, props: NodeProps): void;
19
- } & Omit<FrameProps, 'id' | 'children'>;
19
+ onClick?(event: MouseEvent | KeyboardEvent, props: NodeProps): void;
20
+ } & Omit<FrameProps<'li'>, 'id' | 'children'>;
20
21
  export type NodeRootProps = Omit<NodeProps, 'children'>;
21
- export declare const Node: React.FC<NodeProps>;
22
- export declare const NodeRoot: React.FC<NodeRootProps>;
22
+ export declare const Node: FC<NodeProps>;
23
+ export declare const NodeRoot: FC<NodeRootProps>;
@@ -1,11 +1,11 @@
1
- import React from 'react';
1
+ import type { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  import { icons, NodeProps } from './Node';
3
3
  import { FrameProps } from '../Frame/Frame';
4
4
  export type TreeProps = {
5
5
  data: Array<NodeProps>;
6
6
  root?: Omit<NodeProps, 'children'>;
7
7
  };
8
- type TreeComposition = React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<HTMLUListElement>> & {
8
+ type TreeComposition = ForwardRefExoticComponent<TreeProps & RefAttributes<HTMLUListElement>> & {
9
9
  icons: typeof icons;
10
10
  } & Omit<FrameProps<'ul'>, 'as'>;
11
11
  export declare const Tree: TreeComposition;
@@ -1,16 +1,17 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
+ import type { Ref, HTMLProps } from 'react';
2
3
  import { FrameProps } from '../Frame/Frame';
3
4
  export type VideoProps = {
4
5
  name?: string;
5
6
  src: string;
6
- videoProps?: React.HTMLProps<HTMLVideoElement>;
7
- } & FrameProps;
7
+ videoProps?: HTMLProps<HTMLVideoElement>;
8
+ } & FrameProps<'div'>;
8
9
  export type VideoRefs = {
9
- video: React.Ref<HTMLVideoElement>;
10
- progress: React.Ref<HTMLInputElement>;
11
- wrapper: React.Ref<HTMLDivElement>;
12
- playpause: React.Ref<HTMLButtonElement>;
13
- stop: React.Ref<HTMLButtonElement>;
14
- fullScreen: React.Ref<HTMLButtonElement>;
10
+ video: Ref<HTMLVideoElement>;
11
+ progress: Ref<HTMLInputElement>;
12
+ wrapper: Ref<HTMLDivElement>;
13
+ playpause: Ref<HTMLButtonElement>;
14
+ stop: Ref<HTMLButtonElement>;
15
+ fullScreen: Ref<HTMLButtonElement>;
15
16
  };
16
17
  export declare const Video: React.ForwardRefExoticComponent<Omit<VideoProps, "ref"> & React.RefAttributes<VideoRefs>>;
@@ -1,3 +1,4 @@
1
- import * as React from 'react';
2
- declare const Fullscreen: (props: React.HTMLAttributes<SVGElement>) => React.JSX.Element;
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ declare const Fullscreen: (props: HTMLAttributes<SVGElement>) => React.JSX.Element;
3
4
  export default Fullscreen;
@@ -1,3 +1,4 @@
1
- import * as React from 'react';
2
- declare const Pause: (props: React.HTMLAttributes<SVGElement>) => React.JSX.Element;
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ declare const Pause: (props: HTMLAttributes<SVGElement>) => React.JSX.Element;
3
4
  export default Pause;
@@ -1,3 +1,4 @@
1
- import * as React from 'react';
2
- declare const Play: (props: React.HTMLAttributes<SVGElement>) => React.JSX.Element;
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ declare const Play: (props: HTMLAttributes<SVGElement>) => React.JSX.Element;
3
4
  export default Play;
@@ -1,3 +1,4 @@
1
- import * as React from 'react';
2
- declare const Stop: (props: React.HTMLAttributes<SVGElement>) => React.JSX.Element;
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ declare const Stop: (props: HTMLAttributes<SVGElement>) => React.JSX.Element;
3
4
  export default Stop;