diditui 0.0.1 → 0.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.
package/dist/diditui.d.ts CHANGED
@@ -1,16 +1,178 @@
1
1
  import { ClassProp } from 'class-variance-authority/types';
2
2
  import { ComponentProps } from 'react';
3
+ import { Config } from 'tailwindcss';
4
+ import { default as default_2 } from 'react';
5
+ import { FC } from 'react';
3
6
  import { JSX as JSX_2 } from 'react/jsx-runtime';
7
+ import { Props } from 'react-modal';
4
8
  import { VariantProps } from 'class-variance-authority';
5
9
 
6
- export declare function Button({ size, variant, colorScheme, className, children, ...props }: ButtonProps): JSX_2.Element;
10
+ declare type AsProp<C extends default_2.ElementType> = {
11
+ /**
12
+ * An override of the default HTML tag.
13
+ * Can also be another React component.
14
+ */
15
+ as?: C;
16
+ };
7
17
 
8
- declare type ButtonProps = ComponentProps<'button'> & VariantProps<typeof buttonStyles>;
18
+ export declare function Button({ size, variant, icon, isLoading, disabled, className, children, ...props }: ButtonProps): JSX_2.Element;
9
19
 
10
- declare const buttonStyles: (props?: ({
11
- variant?: "solid" | "outline" | "ghost" | null | undefined;
12
- size?: "sm" | "md" | "lg" | null | undefined;
13
- colorScheme?: "primary" | "secondary" | "danger" | null | undefined;
20
+ declare type ButtonProps = ComponentProps<'button'> & {
21
+ variant?: 'default' | 'primary' | 'soft';
22
+ size?: 'md' | 'lg';
23
+ icon?: IconType;
24
+ isLoading?: boolean;
25
+ };
26
+
27
+ export declare function Card({ className, padding, shadow, children, ...props }: CardProps): JSX_2.Element;
28
+
29
+ declare type CardProps = ComponentProps<'div'> & VariantProps<typeof cardStyles>;
30
+
31
+ declare const cardStyles: (props?: ({
32
+ padding?: "sm" | "md" | "lg" | "none" | null | undefined;
33
+ shadow?: boolean | null | undefined;
34
+ } & ClassProp) | undefined) => string;
35
+
36
+ export declare const didituiConfig: Config;
37
+
38
+ /**
39
+ * Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
40
+ * (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
41
+ * set of props.
42
+ */
43
+ declare type ExtendableProps<ExtendedProps = {}, OverrideProps = {}> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
44
+
45
+ export declare function Icon({ type, size, className, ...props }: IconProps): JSX_2.Element;
46
+
47
+ export declare function IconButton({ icon, label, size, className, ...props }: IconButtonProps): JSX_2.Element;
48
+
49
+ declare type IconButtonProps = ComponentProps<'button'> & VariantProps<typeof iconButtonStyles> & {
50
+ icon?: IconType;
51
+ label?: string;
52
+ };
53
+
54
+ declare const iconButtonStyles: (props?: ({
55
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
56
+ } & ClassProp) | undefined) => string;
57
+
58
+ declare type IconProps = ComponentProps<'span'> & VariantProps<typeof iconStyles> & {
59
+ type?: IconType;
60
+ };
61
+
62
+ declare const iconStyles: (props?: ({
63
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
64
+ } & ClassProp) | undefined) => string;
65
+
66
+ export declare type IconType = 'settings' | 'info' | 'arrowRight' | 'scan' | 'warning' | 'check' | 'copy' | 'connect' | 'passKey' | 'didit' | 'close';
67
+
68
+ /**
69
+ * Allows for inheriting the props from the specified element type so that
70
+ * props like children, className & style work, as well as element-specific
71
+ * attributes like aria roles. The component (`C`) must be passed in.
72
+ */
73
+ declare type InheritableElementProps<C extends default_2.ElementType, Props = {}> = ExtendableProps<PropsOf<C>, Props>;
74
+
75
+ export declare function Modal({ children, contentLabel, overlayClassName, className, onRequestClose, ...props }: Props): JSX_2.Element;
76
+
77
+ /**
78
+ * A more sophisticated version of `InheritableElementProps` where
79
+ * the passed in `as` prop will determine which props can be included
80
+ */
81
+ declare type PolymorphicComponentProps<C extends default_2.ElementType, Props = {}> = InheritableElementProps<C, Props & AsProp<C>>;
82
+
83
+ declare type PolymorphicComponentPropsWithRef<C extends default_2.ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
84
+ ref?: PolymorphicRef<C>;
85
+ };
86
+
87
+ declare type PolymorphicRef<C extends default_2.ElementType> = default_2.ComponentPropsWithRef<C>['ref'];
88
+
89
+ declare type PropsOf<C extends keyof JSX.IntrinsicElements | default_2.JSXElementConstructor<unknown>> = JSX.LibraryManagedAttributes<C, default_2.ComponentPropsWithoutRef<C>>;
90
+
91
+ export declare function QrCode({ uri, size, color, iconName, className, ...props }: QrCodeProps): JSX_2.Element;
92
+
93
+ declare type QrCodeProps = ComponentProps<'div'> & {
94
+ uri: string;
95
+ size?: 'sm' | 'md' | 'lg' | number;
96
+ color?: string;
97
+ iconName?: IconType;
98
+ };
99
+
100
+ export declare function Spinner({ size, variant, className, ...props }: SpinnerProps): JSX_2.Element;
101
+
102
+ declare type SpinnerProps = ComponentProps<'span'> & VariantProps<typeof spinnerStyles>;
103
+
104
+ declare const spinnerStyles: (props?: ({
105
+ variant?: "default" | "primary" | "soft" | "accent" | null | undefined;
106
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
107
+ } & ClassProp) | undefined) => string;
108
+
109
+ declare type SVGIcon = FC<React.SVGProps<SVGElement>>;
110
+
111
+ export declare const svgOptions: Record<IconType, SVGIcon>;
112
+
113
+ declare const Text_2: TextComponent;
114
+ export { Text_2 as Text }
115
+
116
+ declare type TextComponent = <C extends React.ElementType = 'span'>(props: TextProps<C>) => React.ReactElement | null;
117
+
118
+ declare type TextProps<C extends React.ElementType> = PolymorphicComponentPropsWithRef<C, VariantProps<typeof textStyles>>;
119
+
120
+ declare const textStyles: (props?: ({
121
+ variant?: "H1" | "H2" | "H3" | "H4" | "H5" | "H6" | "P1" | "P2" | "P3" | "Label1" | "Label2" | "Label3" | "Label4" | "StyledLabel" | null | undefined;
122
+ align?: "center" | "left" | "right" | null | undefined;
123
+ italic?: boolean | null | undefined;
124
+ underline?: boolean | null | undefined;
14
125
  } & ClassProp) | undefined) => string;
15
126
 
127
+ export declare function useLgMediaQuery(): boolean;
128
+
129
+ export declare function useMdMediaQuery(): boolean;
130
+
131
+ /**
132
+ * Custom hook that tracks the state of a media query using the [`Match Media API`](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia).
133
+ * @param {string} query - The media query to track.
134
+ * @param {?UseMediaQueryOptions} [options] - The options for customizing the behavior of the hook (optional).
135
+ * @returns {boolean} The current state of the media query (true if the query matches, false otherwise).
136
+ * @public
137
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-media-query)
138
+ * @example
139
+ * ```tsx
140
+ * const isSmallScreen = useMediaQuery('(max-width: 600px)');
141
+ * // Use `isSmallScreen` to conditionally apply styles or logic based on the screen size.
142
+ * ```
143
+ */
144
+ export declare function useMediaQuery(query: string, { defaultValue, initializeWithValue }?: UseMediaQueryOptions): boolean;
145
+
146
+ /** Hook options. */
147
+ declare type UseMediaQueryOptions = {
148
+ /**
149
+ * The default value to return if the hook is being run on the server.
150
+ * @default false
151
+ */
152
+ defaultValue?: boolean;
153
+ /**
154
+ * If `true` (default), the hook will initialize reading the media query. In SSR, you should set it to `false`, returning `options.defaultValue` or `false` initially.
155
+ * @default true
156
+ */
157
+ initializeWithValue?: boolean;
158
+ };
159
+
160
+ export declare function UserCard({ name, label, avatar, size, className, ...props }: UserCardProps): JSX_2.Element;
161
+
162
+ declare type UserCardProps = ComponentProps<'div'> & VariantProps<typeof userCardStyles> & {
163
+ name: string;
164
+ label?: string;
165
+ avatar?: string;
166
+ };
167
+
168
+ declare const userCardStyles: (props?: ({
169
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
170
+ } & ClassProp) | undefined) => string;
171
+
172
+ export declare function useSmMediaQuery(): boolean;
173
+
174
+ export declare function useXlMediaQuery(): boolean;
175
+
176
+ export declare function useXxlMediaQuery(): boolean;
177
+
16
178
  export { }