idea-react 2.3.5 → 3.0.0-alpha.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 (64) hide show
  1. package/AGENTS.md +253 -0
  2. package/ReadMe.md +81 -67
  3. package/dist/index.d.mts +419 -203
  4. package/dist/index.d.ts +419 -203
  5. package/dist/index.js +18 -18
  6. package/dist/index.mjs +17 -17
  7. package/dist/style.css +5 -1
  8. package/package.json +36 -35
  9. package/source/Avatar.tsx +65 -12
  10. package/source/Badge.tsx +34 -0
  11. package/source/Button.tsx +73 -0
  12. package/source/ButtonGroup.tsx +28 -0
  13. package/source/Card.tsx +26 -0
  14. package/source/ClickBoundary.tsx +6 -5
  15. package/source/CloseButton.tsx +23 -0
  16. package/source/CodeBlock.tsx +5 -3
  17. package/source/Countdown.tsx +2 -0
  18. package/source/Drawer.tsx +62 -0
  19. package/source/Editor.tsx +5 -8
  20. package/source/Grid.tsx +92 -0
  21. package/source/HorizontalMarquee/index.tsx +4 -10
  22. package/source/Image.tsx +15 -0
  23. package/source/ListGroup.tsx +103 -0
  24. package/source/LiveTSX.tsx +1 -1
  25. package/source/Loading.tsx +4 -3
  26. package/source/Menu.tsx +282 -0
  27. package/source/MonthCalendar.tsx +60 -22
  28. package/source/NativeDialog/index.tsx +139 -0
  29. package/source/NativeDialog/style.module.css +4 -0
  30. package/source/Nav.tsx +52 -0
  31. package/source/Navbar.tsx +64 -0
  32. package/source/Overlay.ts +22 -0
  33. package/source/OverlayBox.tsx +200 -32
  34. package/source/PageNav.tsx +56 -32
  35. package/source/Popover.tsx +36 -0
  36. package/source/ScrollNav/Scroller.tsx +107 -0
  37. package/source/ScrollNav/index.tsx +12 -99
  38. package/source/Select.tsx +66 -55
  39. package/source/ShareBox.tsx +5 -11
  40. package/source/Spinner.tsx +30 -0
  41. package/source/SpinnerButton.tsx +8 -10
  42. package/source/Table.tsx +59 -0
  43. package/source/TableSpinner.tsx +7 -5
  44. package/source/{TextTruncate.tsx → TextTruncate/Content.tsx} +24 -20
  45. package/source/TextTruncate/index.tsx +25 -0
  46. package/source/Time.tsx +7 -33
  47. package/source/TimeDistance.tsx +1 -1
  48. package/source/Timeline/index.tsx +7 -7
  49. package/source/Toast.tsx +114 -29
  50. package/source/ToggleButton.tsx +47 -0
  51. package/source/Tooltip.tsx +32 -0
  52. package/source/TypeEcho/Content.tsx +58 -0
  53. package/source/TypeEcho/index.tsx +14 -0
  54. package/source/UserRank/index.module.less +9 -20
  55. package/source/UserRank/index.tsx +35 -32
  56. package/source/VerticalMarquee/index.module.less +0 -1
  57. package/source/VerticalMarquee/index.tsx +3 -5
  58. package/source/ZodiacBar.tsx +1 -1
  59. package/source/animate.ts +4 -2
  60. package/source/color.ts +3 -5
  61. package/source/index.ts +18 -0
  62. package/source/types.d.ts +4 -0
  63. package/tsconfig.json +6 -2
  64. package/source/TypeEcho.tsx +0 -49
package/source/index.ts CHANGED
@@ -1,30 +1,48 @@
1
1
  export * from './animate';
2
2
  export * from './Avatar';
3
+ export * from './Badge';
4
+ export * from './Button';
5
+ export * from './ButtonGroup';
6
+ export * from './Card';
3
7
  export * from './ClickBoundary';
8
+ export * from './CloseButton';
4
9
  export * from './CodeBlock';
5
10
  export * from './color';
6
11
  export * from './Countdown';
7
12
  export * from './Dialog';
13
+ export * from './Drawer';
8
14
  export * from './Editor';
9
15
  export * from './EditorHTML';
16
+ export * from './Grid';
10
17
  export * from './HorizontalMarquee';
11
18
  export * from './Icon';
19
+ export * from './Image';
20
+ export * from './ListGroup';
12
21
  export * from './LiveTSX';
13
22
  export * from './Loading';
23
+ export * from './Menu';
14
24
  export * from './MonthCalendar';
15
25
  export * from './Nameplate';
26
+ export * from './NativeDialog';
27
+ export * from './Nav';
28
+ export * from './Navbar';
16
29
  export * from './OverlayBox';
17
30
  export * from './PageNav';
31
+ export * from './Popover';
18
32
  export * from './ScrollNav';
19
33
  export * from './Select';
20
34
  export * from './ShareBox';
35
+ export * from './Spinner';
21
36
  export * from './SpinnerButton';
37
+ export * from './Table';
22
38
  export * from './TableSpinner';
23
39
  export * from './TextTruncate';
24
40
  export * from './Time';
25
41
  export * from './TimeDistance';
26
42
  export * from './Timeline';
27
43
  export * from './Toast';
44
+ export * from './ToggleButton';
45
+ export * from './Tooltip';
28
46
  export * from './TypeEcho';
29
47
  export * from './UserRank';
30
48
  export * from './VerticalMarquee';
package/source/types.d.ts CHANGED
@@ -6,3 +6,7 @@ declare module '*.png' {
6
6
  const path: string;
7
7
  export default path;
8
8
  }
9
+ declare module '*.module.css' {
10
+ const classes: Readonly<Record<string, string>>;
11
+ export default classes;
12
+ }
package/tsconfig.json CHANGED
@@ -8,14 +8,18 @@
8
8
  "useDefineForClassFields": true,
9
9
  "jsx": "react-jsx",
10
10
  "skipLibCheck": true,
11
- "lib": ["ES2024", "DOM"]
11
+ "lib": ["ES2024", "DOM", "DOM.Iterable"]
12
12
  },
13
13
  "include": ["*.ts", "source/**/*"],
14
14
  "typedocOptions": {
15
15
  "name": "Idea React",
16
+ "includeVersion": true,
16
17
  "excludeExternals": true,
17
18
  "excludePrivate": true,
19
+ "plugin": ["typedoc-plugin-mdn-links"],
18
20
  "readme": "./ReadMe.md",
19
- "plugin": ["typedoc-plugin-mdn-links"]
21
+ "navigationLinks": {
22
+ "GitHub": "https://github.com/idea2app/Idea-React"
23
+ }
20
24
  }
21
25
  }
@@ -1,49 +0,0 @@
1
- import classNames from 'classnames';
2
- import { observable } from 'mobx';
3
- import { observer } from 'mobx-react';
4
- import { Component, HTMLAttributes, RefCallback } from 'react';
5
- import { sleep } from 'web-utility';
6
-
7
- export interface TypeEchoProps extends HTMLAttributes<HTMLPreElement> {
8
- text: string;
9
- intervals?: number;
10
- }
11
-
12
- @observer
13
- export class TypeEcho extends Component<TypeEchoProps> {
14
- static displayName = 'TypeEcho';
15
-
16
- @observable
17
- accessor echoed = '';
18
-
19
- init: RefCallback<HTMLPreElement> = node =>
20
- node &&
21
- new IntersectionObserver(async ([{ isIntersecting }], observer) => {
22
- if (!isIntersecting) return;
23
-
24
- observer.disconnect();
25
-
26
- const { text, intervals = 150 } = this.props;
27
-
28
- for (const char of text) {
29
- await sleep(intervals / 1000);
30
-
31
- this.echoed += char;
32
- }
33
- }).observe(node);
34
-
35
- render() {
36
- const { className, text, ...props } = this.props,
37
- { echoed } = this;
38
-
39
- return (
40
- <pre
41
- {...props}
42
- ref={this.init}
43
- className={classNames('text-wrap', className)}
44
- >
45
- {echoed + (echoed === text ? '' : '_')}
46
- </pre>
47
- );
48
- }
49
- }