dash-ui-kit 1.0.2

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 (42) hide show
  1. package/README.md +91 -0
  2. package/dist/react/components/accordion/index.d.ts +21 -0
  3. package/dist/react/components/avatar/index.d.ts +17 -0
  4. package/dist/react/components/bigNumber/index.d.ts +19 -0
  5. package/dist/react/components/button/index.d.ts +15 -0
  6. package/dist/react/components/copyButton/index.d.ts +10 -0
  7. package/dist/react/components/dashLogo/index.d.ts +28 -0
  8. package/dist/react/components/dateBlock/index.d.ts +21 -0
  9. package/dist/react/components/dialog/index.d.ts +21 -0
  10. package/dist/react/components/heading/index.d.ts +11 -0
  11. package/dist/react/components/icons/index.d.ts +37 -0
  12. package/dist/react/components/identifier/index.d.ts +25 -0
  13. package/dist/react/components/index.d.ts +26 -0
  14. package/dist/react/components/input/index.d.ts +38 -0
  15. package/dist/react/components/list/index.d.ts +13 -0
  16. package/dist/react/components/notActive/index.d.ts +6 -0
  17. package/dist/react/components/overlayMenu/index.d.ts +39 -0
  18. package/dist/react/components/overlaySelect/index.d.ts +40 -0
  19. package/dist/react/components/progressStepBar/index.d.ts +8 -0
  20. package/dist/react/components/select/index.d.ts +47 -0
  21. package/dist/react/components/switch/index.d.ts +56 -0
  22. package/dist/react/components/tabs/index.d.ts +37 -0
  23. package/dist/react/components/text/index.d.ts +31 -0
  24. package/dist/react/components/textarea/index.d.ts +41 -0
  25. package/dist/react/components/timeDelta/index.d.ts +21 -0
  26. package/dist/react/components/transactionStatusIcon/index.d.ts +26 -0
  27. package/dist/react/components/valueCard/index.d.ts +33 -0
  28. package/dist/react/contexts/ThemeContext.d.ts +36 -0
  29. package/dist/react/contexts/index.d.ts +1 -0
  30. package/dist/react/hooks/index.d.ts +1 -0
  31. package/dist/react/hooks/useDebounce.d.ts +42 -0
  32. package/dist/react/index.cjs.js +11175 -0
  33. package/dist/react/index.cjs.js.map +1 -0
  34. package/dist/react/index.d.ts +28 -0
  35. package/dist/react/index.esm.js +11100 -0
  36. package/dist/react/index.esm.js.map +1 -0
  37. package/dist/react/utils/copyToClipboard.d.ts +14 -0
  38. package/dist/react/utils/datetime.d.ts +41 -0
  39. package/dist/react/utils/index.d.ts +2 -0
  40. package/dist/styles.css +1 -0
  41. package/dist/theme.css +1 -0
  42. package/package.json +125 -0
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const textStyles: (props?: ({
4
+ reset?: boolean | null | undefined;
5
+ theme?: "light" | "dark" | null | undefined;
6
+ color?: "default" | "red" | "blue" | "blue-dark" | null | undefined;
7
+ size?: "sm" | "md" | "xl" | "xs" | "lg" | null | undefined;
8
+ weight?: "bold" | "normal" | 500 | null | undefined;
9
+ italic?: boolean | null | undefined;
10
+ underline?: boolean | null | undefined;
11
+ lineThrough?: boolean | null | undefined;
12
+ transform?: "none" | "capitalize" | "uppercase" | null | undefined;
13
+ opacity?: 0 | 20 | 10 | 100 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | null | undefined;
14
+ monospace?: boolean | null | undefined;
15
+ dim?: boolean | null | undefined;
16
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
17
+ type TextVariants = Omit<VariantProps<typeof textStyles>, 'theme'>;
18
+ export interface TextProps extends TextVariants {
19
+ /** Render as this element or component (e.g. 'h1' or Link). */
20
+ as?: React.ElementType;
21
+ /** Additional CSS classes. */
22
+ className?: string;
23
+ /** Text children. */
24
+ children?: React.ReactNode;
25
+ }
26
+ /**
27
+ * A versatile text component with size, color, weight, decoration,
28
+ * transform, opacity, monospace, dimming, and theme-aware defaults.
29
+ */
30
+ export declare const Text: React.FC<TextProps>;
31
+ export default Text;
@@ -0,0 +1,41 @@
1
+ import React, { TextareaHTMLAttributes } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const textareaContainer: (props?: ({
4
+ theme?: "light" | "dark" | null | undefined;
5
+ hasValue?: boolean | null | undefined;
6
+ colorScheme?: "default" | "brand" | "error" | "success" | null | undefined;
7
+ size?: "sm" | "md" | "xl" | null | undefined;
8
+ variant?: "outlined" | null | undefined;
9
+ isValid?: boolean | "null" | null | undefined;
10
+ disabled?: boolean | null | undefined;
11
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
12
+ type TextareaVariants = VariantProps<typeof textareaContainer>;
13
+ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'size'>, Omit<TextareaVariants, 'theme' | 'hasValue' | 'isValid' | 'disabled'> {
14
+ className?: string;
15
+ onChange?: (value: string) => void;
16
+ showPasteButton?: boolean;
17
+ validator?: ((value: string) => boolean) | boolean;
18
+ rows?: number;
19
+ font?: 'main' | 'grotesque';
20
+ weight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold';
21
+ error?: boolean;
22
+ success?: boolean;
23
+ }
24
+ /**
25
+ * A versatile textarea component that adapts to light/dark theme,
26
+ * supports various color schemes, sizes, variants, and states.
27
+ * Includes optional paste functionality and validation.
28
+ *
29
+ * @example
30
+ * <Textarea
31
+ * placeholder='Enter your message'
32
+ * colorScheme='brand'
33
+ * size='xl'
34
+ * font='grotesque'
35
+ * weight='medium'
36
+ * rows={4}
37
+ * showPasteButton={true}
38
+ * />
39
+ */
40
+ export declare const Textarea: React.FC<TextareaProps>;
41
+ export default Textarea;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { type TimeDeltaFormat } from '../../utils/datetime';
3
+ export interface TimeDeltaProps {
4
+ /** Start date for delta calculation, defaults to now */
5
+ startDate?: Date | number | string;
6
+ /** End date or timestamp */
7
+ endDate: Date | number | string;
8
+ /** Show tooltip with exact timestamp */
9
+ showTimestampTooltip?: boolean;
10
+ /** Override date for tooltip instead of endDate */
11
+ tooltipDate?: Date | number | string;
12
+ /** Format mode: 'default' shows delta and tooltip, 'detailed' suppresses tooltip */
13
+ format?: TimeDeltaFormat;
14
+ }
15
+ /**
16
+ * TimeDelta component renews a human-readable delta string periodically,
17
+ * and optionally wraps it in a tooltip showing the exact date/time.
18
+ * Supports light/dark theme.
19
+ */
20
+ export declare const TimeDelta: React.FC<TimeDeltaProps>;
21
+ export default TimeDelta;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { SuccessIcon } from '../icons';
3
+ /**
4
+ * Available status keys for which an icon will be rendered.
5
+ */
6
+ export type StatusKey = 'SUCCESS' | 'FAIL' | 'QUEUED' | 'POOLED' | 'BROADCASTED';
7
+ /**
8
+ * Props for the TransactionStatusIcon component.
9
+ * Inherits all props of SuccessIcon (assumed representative of all icons),
10
+ * plus a `status` field to choose which icon to render.
11
+ */
12
+ export interface TransactionStatusIconProps extends Omit<React.ComponentProps<typeof SuccessIcon>, 'size' | 'color'> {
13
+ /** Which status icon to show. */
14
+ status: StatusKey;
15
+ /** Optional override for icon size. */
16
+ size?: number;
17
+ /** Optional override for icon color. */
18
+ color?: string;
19
+ }
20
+ /**
21
+ * Renders an icon corresponding to the given `status`.
22
+ * If `status` is not recognized, returns null.
23
+ * Colors adapt to light/dark theme unless overridden.
24
+ */
25
+ export declare const TransactionStatusIcon: React.FC<TransactionStatusIconProps>;
26
+ export default TransactionStatusIcon;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const valueCard: (props?: ({
4
+ theme?: "light" | "dark" | null | undefined;
5
+ colorScheme?: "white" | "default" | "lightBlue" | "lightGray" | "green" | "transparent" | "yellow" | null | undefined;
6
+ size?: "sm" | "md" | "xl" | null | undefined;
7
+ clickable?: boolean | null | undefined;
8
+ loading?: boolean | null | undefined;
9
+ border?: boolean | null | undefined;
10
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
+ type ValueCardVariants = VariantProps<typeof valueCard>;
12
+ export interface ValueCardProps extends Omit<ValueCardVariants, 'theme'> {
13
+ /** If you pass an `as` component, it'll receive `href` when `link` is set */
14
+ as?: React.ElementType;
15
+ /** Only applies `href` if `as` is `'a'` or a component that accepts `href` */
16
+ link?: string;
17
+ className?: string;
18
+ children: React.ReactNode;
19
+ /** Additional props to pass to the underlying element */
20
+ [key: string]: any;
21
+ }
22
+ /**
23
+ * A card container that adapts to light/dark theme,
24
+ * supports various color schemes, sizes, clickability,
25
+ * loading state, and optional border styling.
26
+ *
27
+ * @example
28
+ * <ValueCard colorScheme="green" border as={Link} link="/foo">
29
+ * Go
30
+ * </ValueCard>
31
+ */
32
+ export declare const ValueCard: React.FC<ValueCardProps>;
33
+ export default ValueCard;
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ export type Theme = 'light' | 'dark';
3
+ /**
4
+ * Context value shape for theme switching.
5
+ */
6
+ export interface ThemeContextValue {
7
+ /** Current theme, either 'light' or 'dark'. */
8
+ theme: Theme;
9
+ /** Set the theme explicitly. */
10
+ setTheme: (theme: Theme) => void;
11
+ /** Toggle between 'light' and 'dark'. */
12
+ toggleTheme: () => void;
13
+ }
14
+ /**
15
+ * Props for the ThemeProvider component.
16
+ */
17
+ export interface ThemeProviderProps {
18
+ /** Initial theme; if not provided, reads from localStorage or defaults to 'light'. */
19
+ initialTheme?: Theme;
20
+ /** React children that will have access to the theme context. */
21
+ children: React.ReactNode;
22
+ }
23
+ /**
24
+ * Provides theme context to its descendants and syncs theme with localStorage
25
+ * and the root HTML element's class list ('light' or 'dark').
26
+ *
27
+ * @param initialTheme - Optional initial theme override.
28
+ * @param children - React children.
29
+ */
30
+ export declare const ThemeProvider: React.FC<ThemeProviderProps>;
31
+ /**
32
+ * Hook to access the theme context.
33
+ * @returns ThemeContextValue - Contains `theme`, `setTheme`, and `toggleTheme`.
34
+ * @throws If used outside of a ThemeProvider.
35
+ */
36
+ export declare function useTheme(): ThemeContextValue;
@@ -0,0 +1 @@
1
+ export { ThemeProvider, useTheme, type Theme, type ThemeContextValue, type ThemeProviderProps } from './ThemeContext';
@@ -0,0 +1 @@
1
+ export { default as useDebounce } from './useDebounce';
@@ -0,0 +1,42 @@
1
+ interface UseDebounceOptions<T> {
2
+ /**
3
+ * Delay in milliseconds
4
+ */
5
+ delay: number;
6
+ /**
7
+ * Callback called when debounced value changes
8
+ */
9
+ callback?: (value: T) => void;
10
+ /**
11
+ * If true, the value will be set immediately on first call
12
+ */
13
+ immediate?: boolean;
14
+ }
15
+ interface UseDebounceReturn<T> {
16
+ /**
17
+ * Current debounced value
18
+ */
19
+ debouncedValue: T;
20
+ /**
21
+ * Function to force flush debounce and immediately update value
22
+ */
23
+ flush: () => void;
24
+ /**
25
+ * Function to cancel current pending debounce
26
+ */
27
+ cancel: () => void;
28
+ /**
29
+ * Whether there's a pending change
30
+ */
31
+ isPending: boolean;
32
+ }
33
+ /**
34
+ * Hook for debouncing values with extended functionality
35
+ *
36
+ * @param value - Value to debounce
37
+ * @param options - Configuration options
38
+ * @returns Object with debounced value and control methods
39
+ */
40
+ declare const useDebounce: <T>(value: T, options: UseDebounceOptions<T> | number) => UseDebounceReturn<T>;
41
+ export default useDebounce;
42
+ export { useDebounce };