@ahrowe/ui 0.1.3 → 0.1.4

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.
@@ -1,26 +1,3 @@
1
- import { default as React } from 'react';
1
+ import { IdleManagerProps } from './idleManager.types';
2
+ declare function IdleManager({ children, idleAfterSeconds, renderCondition, }: IdleManagerProps): import("react/jsx-runtime").JSX.Element;
2
3
  export default IdleManager;
3
- declare class IdleManager extends React.Component<any, any, any> {
4
- static propTypes: {
5
- children: any;
6
- idleAfterSeconds: any;
7
- renderCondition: any;
8
- };
9
- static defaultProps: {
10
- children: null;
11
- idleAfterSeconds: number;
12
- renderCondition: boolean;
13
- };
14
- constructor(props: any);
15
- state: {
16
- isIdleContentShown: boolean;
17
- };
18
- componentDidMount(): void;
19
- componentDidUpdate(prevProps: any): void;
20
- componentWillUnmount(): void;
21
- registerHandlers(): void;
22
- unregisterhandlers(): void;
23
- resetIdleTimeout: () => void;
24
- render(): import("react/jsx-runtime").JSX.Element;
25
- #private;
26
- }
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface IdleManagerProps {
3
+ children?: React.ReactNode;
4
+ /** Seconds of inactivity before children are rendered. Defaults to 600 (10 min). */
5
+ idleAfterSeconds?: number;
6
+ /** Children are only rendered when this is true AND the user is idle. Defaults to true. */
7
+ renderCondition?: boolean;
8
+ }
@@ -1,2 +1 @@
1
- import { default as IdleManager } from './idleManager.jsx';
2
- export default IdleManager;
1
+ export { default } from './idleManager';
@@ -1,2 +1 @@
1
- import { default as InfiniteBlock } from './infiniteBlock';
2
- export default InfiniteBlock;
1
+ export { default } from './infiniteBlock';
@@ -1,30 +1,3 @@
1
- import { default as React } from 'react';
2
- export default class InfiniteBlock extends React.PureComponent<any, any, any> {
3
- static propTypes: {
4
- children: any;
5
- onScroll: any;
6
- className: any;
7
- isDataLoading: any;
8
- setHighlightedIndex: any;
9
- };
10
- static defaultProps: {
11
- className: string;
12
- children: null;
13
- isDataLoading: boolean;
14
- setHighlightedIndex: () => null;
15
- };
16
- constructor(props: any);
17
- constructor(props: any, context: any);
18
- state: {
19
- isLoadingOnScroll: boolean;
20
- index: number;
21
- };
22
- componentDidMount(): void;
23
- componentWillUnmount(): void;
24
- onScroll: () => void;
25
- respondToUserInput: (event: any) => void;
26
- childStartsWithKey: (child: any, key: any) => any;
27
- addToIndex(val: any, index: any): any;
28
- render(): import("react/jsx-runtime").JSX.Element;
29
- tableBody: HTMLDivElement | null | undefined;
30
- }
1
+ import { InfiniteBlockProps } from './infiniteBlock.types';
2
+ declare function InfiniteBlock({ children, onScroll, className, isDataLoading, setHighlightedIndex, }: InfiniteBlockProps): import("react/jsx-runtime").JSX.Element;
3
+ export default InfiniteBlock;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ export interface InfiniteBlockProps {
3
+ children?: React.ReactNode;
4
+ /** Called when the user scrolls to the bottom; must return a Promise that resolves when the new data has loaded. */
5
+ onScroll: () => Promise<void>;
6
+ className?: string;
7
+ /** Replaces children with a full-block spinner (initial load). */
8
+ isDataLoading?: boolean;
9
+ /** Called with the newly highlighted child index after keyboard navigation. */
10
+ setHighlightedIndex?: (index: number) => void;
11
+ }
@@ -1,2 +1 @@
1
- import { default as RoomViewer } from './roomViewer.jsx';
2
- export default RoomViewer;
1
+ export { default } from './roomViewer';
@@ -1,26 +1,3 @@
1
- import { default as React } from 'react';
1
+ import { RoomViewerProps } from './roomViewer.types';
2
+ declare function RoomViewer({ data }: RoomViewerProps): import("react/jsx-runtime").JSX.Element;
2
3
  export default RoomViewer;
3
- declare class RoomViewer extends React.Component<any, any, any> {
4
- static propTypes: {
5
- data: any;
6
- };
7
- static defaultProps: {
8
- data: never[];
9
- };
10
- constructor(props: any);
11
- roomViewerRef: React.RefObject<any>;
12
- listenerAbortController: AbortController | null;
13
- state: {
14
- selectedRoomId: null;
15
- svgData: null;
16
- selectedDataId: number;
17
- isLoading: boolean;
18
- };
19
- componentDidMount(): void;
20
- componentDidUpdate(prevProps: any, prevState: any): void;
21
- componentWillUnmount(): void;
22
- loadData: () => void;
23
- onRoomClicked: (roomId: any) => void;
24
- addToCurrentFloor: (change: any) => void;
25
- render(): import("react/jsx-runtime").JSX.Element;
26
- }
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface RoomViewerFloor {
3
+ /** Display label shown above the floor plan (e.g. "Ground Floor") */
4
+ label: string;
5
+ /** The SVG floor plan to render for this floor */
6
+ data: React.ReactNode;
7
+ }
8
+ export interface RoomViewerProps {
9
+ data?: RoomViewerFloor[];
10
+ }
@@ -0,0 +1,7 @@
1
+ import { Theme } from './theme.types';
2
+ /**
3
+ * Built-in default theme used by ThemeProvider when no `themes` prop is
4
+ * supplied. Provides a complete set of CSS variables so the component
5
+ * library renders correctly out of the box.
6
+ */
7
+ export declare const defaultTheme: Theme;
@@ -1,2 +1,3 @@
1
1
  export { default } from './themeProvider';
2
+ export { defaultTheme } from './defaultTheme';
2
3
  export type { Theme, ThemeVariables } from './theme.types';
@@ -2,7 +2,7 @@ import { default as React, Component } from 'react';
2
2
  import { Theme } from './theme.types';
3
3
  interface Props {
4
4
  children: React.ReactNode;
5
- themes: Theme[];
5
+ themes?: Theme[];
6
6
  currentThemeId?: string;
7
7
  }
8
8
  interface State {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahrowe/ui",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -99,6 +99,7 @@
99
99
  "eslint-config-prettier": "^10.1.8",
100
100
  "eslint-plugin-react": "^7.37.5",
101
101
  "eslint-plugin-react-hooks": "^7.1.1",
102
+ "jiti": "^2.7.0",
102
103
  "jsdom": "^29.1.1",
103
104
  "postcss": "^8.5.15",
104
105
  "postcss-nested": "^7.0.2",
@@ -1,2 +0,0 @@
1
- import { default as SearchInputModern } from './searchInputModern';
2
- export default SearchInputModern;
@@ -1,39 +0,0 @@
1
- import { default as React } from 'react';
2
- export default class SearchInput extends React.PureComponent<any, any, any> {
3
- static propTypes: {
4
- id: any;
5
- className: any;
6
- onChange: any;
7
- onDebounce: any;
8
- placeholder: any;
9
- value: any;
10
- totalAmount: any;
11
- maxLength: any;
12
- dataTest: any;
13
- width: any;
14
- showAmount: any;
15
- label: any;
16
- autoComplete: any;
17
- };
18
- static defaultProps: {
19
- id: null;
20
- className: string;
21
- placeholder: string;
22
- totalAmount: undefined;
23
- maxLength: number;
24
- dataTest: string;
25
- width: null;
26
- showAmount: boolean;
27
- onDebounce: () => null;
28
- label: string;
29
- autoComplete: string;
30
- };
31
- constructor(props: any);
32
- constructor(props: any, context: any);
33
- searchInput: React.RefObject<any>;
34
- onChange: (value: any) => void;
35
- onClearClicked: () => void;
36
- focusInput(): void;
37
- searchDebounce: any;
38
- render(): import("react/jsx-runtime").JSX.Element;
39
- }