@tight-embedded/react 1.0.0-alpha.0
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/README.md +11 -0
- package/dist/duplet.css +60 -0
- package/dist/duplet.css.gz +0 -0
- package/dist/fonts/Duplet-Bold.woff +0 -0
- package/dist/fonts/Duplet-Bold.woff.gz +0 -0
- package/dist/fonts/Duplet-Bold.woff2 +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff.gz +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff2 +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff2.gz +0 -0
- package/dist/fonts/Duplet-Italic.woff +0 -0
- package/dist/fonts/Duplet-Italic.woff.gz +0 -0
- package/dist/fonts/Duplet-Italic.woff2 +0 -0
- package/dist/fonts/Duplet-Regular.woff +0 -0
- package/dist/fonts/Duplet-Regular.woff.gz +0 -0
- package/dist/fonts/Duplet-Regular.woff2 +0 -0
- package/dist/fonts/Duplet-Semibold.woff +0 -0
- package/dist/fonts/Duplet-Semibold.woff.gz +0 -0
- package/dist/fonts/Duplet-Semibold.woff2 +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff.gz +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff2 +0 -0
- package/dist/fonts/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter-Bold.ttf.gz +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf.gz +0 -0
- package/dist/fonts/Inter-Light.ttf +0 -0
- package/dist/fonts/Inter-Light.ttf.gz +0 -0
- package/dist/fonts/Inter-Medium.ttf +0 -0
- package/dist/fonts/Inter-Medium.ttf.gz +0 -0
- package/dist/fonts/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter-Regular.ttf.gz +0 -0
- package/dist/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/Inter-SemiBold.ttf.gz +0 -0
- package/dist/index.css +2974 -0
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +3285 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -0
- package/dist/index.js.map.gz +0 -0
- package/dist/inter.css +36 -0
- package/dist/inter.css.gz +0 -0
- package/package.json +110 -0
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function BusinessOwnerDashboard(props: BusinessOwnerDashboardProps): JSX.Element;
|
|
5
|
+
|
|
6
|
+
declare type BusinessOwnerDashboardProps = {
|
|
7
|
+
period?: Period;
|
|
8
|
+
onChangePeriod?: (period: Period) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export declare type Environment = ValueOf<typeof Environments>;
|
|
12
|
+
|
|
13
|
+
declare const Environments: {
|
|
14
|
+
readonly PRODUCTION: "PRODUCTION";
|
|
15
|
+
readonly SANDBOX: "SANDBOX";
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
declare type ExternalOptions = {
|
|
19
|
+
dataVisualizationColors?: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
declare type ObjectKey = string | number | symbol;
|
|
23
|
+
|
|
24
|
+
declare type OptionSetter = (options: Partial<ExternalOptions>, replace?: boolean) => void;
|
|
25
|
+
|
|
26
|
+
declare type Period = {
|
|
27
|
+
month: number;
|
|
28
|
+
year: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export declare function Tight({ children, environment, accessToken }: TightProps): JSX.Element;
|
|
32
|
+
|
|
33
|
+
declare type TightProps = PropsWithChildren<{
|
|
34
|
+
environment: Environment;
|
|
35
|
+
accessToken: string;
|
|
36
|
+
}>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Set library-wide options for various components.
|
|
40
|
+
*
|
|
41
|
+
* For Developers:
|
|
42
|
+
* This hook subscribes a component to Tight Embedded's option store, which is shared across all Tight Components
|
|
43
|
+
* The initial options passed into the hook will be set as the value of options on the hook's first render.
|
|
44
|
+
* When a component modifies these options by calling setOptions, all subscribed components will re-render with the new options
|
|
45
|
+
*
|
|
46
|
+
* @param initialOptions - options to pass into the store on first render of this hook.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```TypeScript
|
|
50
|
+
* const { options, setOptions } = useOptions({ accessToken: "my-token" })
|
|
51
|
+
*
|
|
52
|
+
* <button onClick={() => setOptions(someValue)} />
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function useOptions(initialOptions?: Partial<ExternalOptions>): {
|
|
56
|
+
options: ExternalOptions;
|
|
57
|
+
setOptions: OptionSetter;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A type for making string unions out of faux enum 'as const' objects or extracting element types from arrays
|
|
62
|
+
* Usage with objects:
|
|
63
|
+
* ```
|
|
64
|
+
* const MyObject = {
|
|
65
|
+
* EntryOne: "ENTRY_ONE",
|
|
66
|
+
* EntryTwo: "ENTRY_TWO",
|
|
67
|
+
* EntryThree: "ENTRY_THREE",
|
|
68
|
+
* } as const;
|
|
69
|
+
*
|
|
70
|
+
* type MyType = ValueOf<typeof MyObject>;
|
|
71
|
+
* // "ENTRY_ONE" | "ENTRY_TWO" | "ENTRY_THREE"
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* Usage with arrays:
|
|
75
|
+
* ```
|
|
76
|
+
* type MyArray = ValueOf<string[]>;
|
|
77
|
+
* // string
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare type ValueOf<T> = T extends Array<infer U> ? U : (T extends Record<ObjectKey, unknown> ? T[keyof T] : never);
|
|
81
|
+
|