idea-react 3.0.0-rc.2 → 3.0.0-rc.3

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/style.css CHANGED
@@ -1,7 +1,7 @@
1
1
  .HR-isq_paused .carousel-indicators .active:after {
2
2
  animation-play-state: paused;
3
3
  }
4
- .rDVV3q_hiddenBackdrop {
4
+ .h491eq_hiddenBackdrop {
5
5
  --bs-dialog-backdrop-bg: transparent;
6
6
  --bs-dialog-backdrop-blur: 0;
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-react",
3
- "version": "3.0.0-rc.2",
3
+ "version": "3.0.0-rc.3",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "author": "shiy2008@gmail.com",
6
6
  "description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
@@ -19,7 +19,7 @@ import styles from './style.module.css';
19
19
  const transitionMilliseconds = (value: string) =>
20
20
  (parseFloat(value) || 0) * (value.trim().endsWith('ms') ? 1 : 1000);
21
21
 
22
- export interface NativeDialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
22
+ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open'> {
23
23
  modal?: boolean;
24
24
  dialog?: boolean;
25
25
  theme?: 'light' | 'dark';
@@ -61,16 +61,16 @@ export const DialogFooter = polymorphic<ComponentPropsWithRef<'div'>>(
61
61
  );
62
62
  DialogFooter.displayName = 'DialogFooter';
63
63
 
64
- export class NativeDialog<T extends ElementType | undefined = 'dialog'> extends Component<
65
- PolymorphicClassProps<T, NativeDialogProps>
64
+ export class Dialog<T extends ElementType | undefined = 'dialog'> extends Component<
65
+ PolymorphicClassProps<T, DialogProps>
66
66
  > {
67
- declare readonly props: PolymorphicClassProps<T, NativeDialogProps>;
67
+ declare readonly props: PolymorphicClassProps<T, DialogProps>;
68
68
 
69
- protected get componentProps(): Readonly<NativeDialogProps & AsProps> {
69
+ protected get componentProps(): Readonly<DialogProps & AsProps> {
70
70
  return this.props;
71
71
  }
72
72
 
73
- static scrollLocks = new Set<NativeDialog<ElementType>>();
73
+ static scrollLocks = new Set<Dialog<ElementType>>();
74
74
  static bodyOverflow = '';
75
75
 
76
76
  element = createRef<HTMLDialogElement>();
@@ -86,7 +86,7 @@ export class NativeDialog<T extends ElementType | undefined = 'dialog'> extends
86
86
  if (this.componentProps.open) this.show();
87
87
  }
88
88
 
89
- componentDidUpdate({ open, modal, scroll }: NativeDialogProps) {
89
+ componentDidUpdate({ open, modal, scroll }: DialogProps) {
90
90
  const modeChanged = this.componentProps.modal !== modal;
91
91
  const openChanged = this.componentProps.open !== open;
92
92
  const wasOpen = this.open;
@@ -121,20 +121,20 @@ export class NativeDialog<T extends ElementType | undefined = 'dialog'> extends
121
121
  };
122
122
 
123
123
  lockScroll = () => {
124
- const { scrollLocks } = NativeDialog;
124
+ const { scrollLocks } = Dialog;
125
125
 
126
126
  if (!scrollLocks.size) {
127
- NativeDialog.bodyOverflow = document.body.style.overflow;
127
+ Dialog.bodyOverflow = document.body.style.overflow;
128
128
  document.body.style.overflow = 'hidden';
129
129
  }
130
130
  scrollLocks.add(this);
131
131
  };
132
132
 
133
133
  unlockScroll = () => {
134
- const { scrollLocks } = NativeDialog;
134
+ const { scrollLocks } = Dialog;
135
135
 
136
136
  if (!scrollLocks.delete(this)) return;
137
- if (!scrollLocks.size) document.body.style.overflow = NativeDialog.bodyOverflow;
137
+ if (!scrollLocks.size) document.body.style.overflow = Dialog.bodyOverflow;
138
138
  };
139
139
 
140
140
  close = () => {
@@ -8,7 +8,7 @@ import { Component, ComponentPropsWithRef, createRef, ElementType, ReactNode } f
8
8
  import { AsProps, polymorphic, PolymorphicClassProps } from '../Helper/Polymorphic';
9
9
  import { Breakpoint } from '../Layout/Grid';
10
10
  import { CloseButton } from './CloseButton';
11
- import { NativeDialog, NativeDialogProps } from './NativeDialog';
11
+ import { Dialog, DialogProps } from './Dialog';
12
12
 
13
13
  export type DrawerPlacement = 'start' | 'end' | 'top' | 'bottom';
14
14
 
@@ -41,7 +41,7 @@ export const DrawerFooter = polymorphic<ComponentPropsWithRef<'div'>>(
41
41
  DrawerFooter.displayName = 'DrawerFooter';
42
42
 
43
43
  export interface DrawerProps extends Omit<
44
- NativeDialogProps,
44
+ DialogProps,
45
45
  'dialog' | 'onClose' | 'title' | 'animation' | 'fullscreen'
46
46
  > {
47
47
  title?: ReactNode;
@@ -78,7 +78,7 @@ export class Drawer<T extends ElementType | undefined = 'dialog'> extends Compon
78
78
 
79
79
  @observable accessor expanded = false;
80
80
 
81
- dialog = createRef<NativeDialog<ElementType>>();
81
+ dialog = createRef<Dialog<ElementType>>();
82
82
  media?: MediaQueryList;
83
83
  dismissed = false;
84
84
 
@@ -146,7 +146,7 @@ export class Drawer<T extends ElementType | undefined = 'dialog'> extends Compon
146
146
  } = this.componentProps;
147
147
 
148
148
  return (
149
- <NativeDialog
149
+ <Dialog
150
150
  as={this.componentProps.as}
151
151
  {...props}
152
152
  ref={this.dialog}
@@ -176,7 +176,7 @@ export class Drawer<T extends ElementType | undefined = 'dialog'> extends Compon
176
176
  </DrawerHeader>
177
177
  <DrawerBody className={bodyClassName}>{children}</DrawerBody>
178
178
  {footer && <DrawerFooter>{footer}</DrawerFooter>}
179
- </NativeDialog>
179
+ </Dialog>
180
180
  );
181
181
  }
182
182
  }
@@ -9,11 +9,11 @@ export * from './Card';
9
9
  export * from './Carousel';
10
10
  export * from './CloseButton';
11
11
  export * from './Collapse';
12
+ export * from './Dialog';
12
13
  export * from './Drawer';
13
14
  export * from './Fade';
14
15
  export * from './ListGroup';
15
16
  export * from './Menu';
16
- export * from './NativeDialog';
17
17
  export * from './Nav';
18
18
  export * from './Navbar';
19
19
  export * from './NavOverflow';
@@ -2,7 +2,7 @@ import classNames from 'classnames';
2
2
  import { ComponentPropsWithRef } from 'react';
3
3
 
4
4
  import { polymorphic } from '../Helper/Polymorphic';
5
- import { Image, ImageProps } from './Images';
5
+ import { Image, ImageProps } from './Image';
6
6
 
7
7
  export type FigureProps = ComponentPropsWithRef<'figure'>;
8
8
 
@@ -1,3 +1,3 @@
1
1
  export * from './Figure';
2
- export * from './Images';
2
+ export * from './Image';
3
3
  export * from './Tables';
@@ -3,17 +3,17 @@ import { action, observable } from 'mobx';
3
3
  import { observer } from 'mobx-react';
4
4
  import { FC } from 'react';
5
5
 
6
- export class DialogClose extends Error {
6
+ export class DialogBoxClose extends Error {
7
7
  constructor(message = 'Dialog closed') {
8
8
  super(message);
9
9
  }
10
10
  }
11
11
 
12
- export interface DialogProps<T = unknown> {
12
+ export interface DialogBoxProps<T = unknown> {
13
13
  defer?: Defer<T>;
14
14
  }
15
15
 
16
- export class Dialog<I extends object = {}, O = unknown> {
16
+ export class DialogBox<I extends object = {}, O = unknown> {
17
17
  @observable
18
18
  accessor input = {} as I;
19
19
 
@@ -22,11 +22,11 @@ export class Dialog<I extends object = {}, O = unknown> {
22
22
 
23
23
  Component: FC<I>;
24
24
 
25
- constructor(Factory: FC<I & DialogProps<O>>) {
25
+ constructor(Factory: FC<I & DialogBoxProps<O>>) {
26
26
  this.Component = observer(props => (
27
27
  <Factory {...props} {...this.input} defer={this.defer} />
28
28
  ));
29
- this.Component.displayName = 'DialogComponent';
29
+ this.Component.displayName = 'DialogBoxComponent';
30
30
  }
31
31
 
32
32
  @action
@@ -6,7 +6,7 @@ import { observer } from 'mobx-react';
6
6
  import { Component, createRef, HTMLAttributes, MouseEvent } from 'react';
7
7
  import { blobOf } from 'web-utility';
8
8
 
9
- import { Image } from '../Content/Images';
9
+ import { Image } from '../Content/Image';
10
10
  import { Loading } from './Loading';
11
11
 
12
12
  export async function elementToImage(element: HTMLElement, type?: string, quality?: number) {
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes } from 'react';
2
2
 
3
3
  import { Badge } from '../../Base/Badge';
4
- import { Image } from '../../Content/Images';
4
+ import { Image } from '../../Content/Image';
5
5
  import { Table } from '../../Content/Tables';
6
6
  import { polymorphic } from '../../Helper/Polymorphic';
7
7
  import { Col, Container, Row } from '../../Layout/Grid';
File without changes