@gamecrafters/base-ui 0.0.37 → 0.0.39
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/build/components/date-input/DateInput.d.ts +4 -0
- package/build/components/date-input/DateInput.types.d.ts +137 -0
- package/build/components/date-input/DateInputContext.d.ts +11 -0
- package/build/components/date-input/DateInputControl.d.ts +5 -0
- package/build/components/date-input/DateInputHiddenInput.d.ts +7 -0
- package/build/components/date-input/DateInputLabel.d.ts +5 -0
- package/build/components/date-input/DateInputRootProvider.d.ts +10 -0
- package/build/components/date-input/DateInputSegment.d.ts +6 -0
- package/build/components/date-input/DateInputSegmentGroup.d.ts +7 -0
- package/build/components/date-input/dateInputFields.d.ts +49 -0
- package/build/components/date-input/dateInputSegments.d.ts +26 -0
- package/build/components/date-input/index.d.ts +41 -0
- package/build/components/date-input/useDateInput.d.ts +2 -0
- package/build/components/globe/Globe.d.ts +18 -0
- package/build/components/globe/Globe.types.d.ts +20 -0
- package/build/components/globe/globeAppearance.d.ts +2 -0
- package/build/components/globe/index.d.ts +20 -0
- package/build/components/globe/useReducedMotion.d.ts +1 -0
- package/build/components/index.d.ts +2 -0
- package/build/lib/react-globe/Globe.d.ts +7 -0
- package/build/lib/react-globe/GlobeContext.d.ts +2 -0
- package/build/lib/react-globe/GlobeOverlay.d.ts +7 -0
- package/build/lib/react-globe/anchor.d.ts +13 -0
- package/build/lib/react-globe/index.d.ts +32 -0
- package/build/lib/react-globe/projection.d.ts +18 -0
- package/build/lib/react-globe/renderer.d.ts +4 -0
- package/build/lib/react-globe/shaders/arc.d.ts +2 -0
- package/build/lib/react-globe/shaders/globe.d.ts +2 -0
- package/build/lib/react-globe/shaders/marker.d.ts +2 -0
- package/build/lib/react-globe/texture.d.ts +1 -0
- package/build/lib/react-globe/types/index.d.ts +69 -0
- package/build/lib/react-globe/useGlobe.d.ts +1 -0
- package/build/lib/react-globe/webgl.d.ts +3 -0
- package/build/main.cjs.js +374 -70
- package/build/main.esm.js +372 -68
- package/build/styles/main.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { CalendarDateInput, CalendarDateMatcher, CalendarMode, CalendarRange, CalendarRangeInput } from "../calendar/Calendar.types";
|
|
3
|
+
import type { TextInputSize } from "../text-input/TextInput.types";
|
|
4
|
+
export type DateInputGranularity = "day" | "hour" | "minute" | "second";
|
|
5
|
+
export type DateInputHourCycle = 12 | 24;
|
|
6
|
+
export type DateInputEditableSegmentType = "year" | "month" | "day" | "hour" | "minute" | "second" | "dayPeriod";
|
|
7
|
+
export type DateInputSegmentType = DateInputEditableSegmentType | "literal";
|
|
8
|
+
export type DateInputSegmentDetails = {
|
|
9
|
+
type: DateInputSegmentType;
|
|
10
|
+
text: string;
|
|
11
|
+
value?: number;
|
|
12
|
+
minValue?: number;
|
|
13
|
+
maxValue?: number;
|
|
14
|
+
placeholder: string;
|
|
15
|
+
placeholderShown: boolean;
|
|
16
|
+
entered: boolean;
|
|
17
|
+
filled: boolean;
|
|
18
|
+
editable: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type DateInputIds = {
|
|
21
|
+
root?: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
control?: string;
|
|
24
|
+
segmentGroup?: (index: number) => string;
|
|
25
|
+
hiddenInput?: (index: number) => string;
|
|
26
|
+
};
|
|
27
|
+
export type DateInputSegmentLabels = Partial<Record<DateInputEditableSegmentType, string>>;
|
|
28
|
+
export type DateInputPropsForOneDay = {
|
|
29
|
+
mode?: "single";
|
|
30
|
+
value?: CalendarDateInput | null;
|
|
31
|
+
defaultValue?: CalendarDateInput | null;
|
|
32
|
+
onChange?: (date: Date | null) => void;
|
|
33
|
+
};
|
|
34
|
+
export type DateInputPropsForARange = {
|
|
35
|
+
mode: "range";
|
|
36
|
+
value?: CalendarRangeInput | null;
|
|
37
|
+
defaultValue?: CalendarRangeInput | null;
|
|
38
|
+
onChange?: (range: CalendarRange) => void;
|
|
39
|
+
};
|
|
40
|
+
export type DateInputSelectionConfig = DateInputPropsForOneDay | DateInputPropsForARange;
|
|
41
|
+
type DateInputStoreProps = {
|
|
42
|
+
locale?: string;
|
|
43
|
+
granularity?: DateInputGranularity;
|
|
44
|
+
hourCycle?: DateInputHourCycle;
|
|
45
|
+
leadingZeros?: boolean;
|
|
46
|
+
placeholderValue?: CalendarDateInput;
|
|
47
|
+
min?: CalendarDateInput;
|
|
48
|
+
max?: CalendarDateInput;
|
|
49
|
+
isDateUnavailable?: CalendarDateMatcher;
|
|
50
|
+
format?: string;
|
|
51
|
+
segmentLabels?: DateInputSegmentLabels;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
readOnly?: boolean;
|
|
54
|
+
required?: boolean;
|
|
55
|
+
invalid?: boolean;
|
|
56
|
+
name?: string;
|
|
57
|
+
form?: string;
|
|
58
|
+
id?: string;
|
|
59
|
+
ids?: DateInputIds;
|
|
60
|
+
onFocusChange?: (focused: boolean) => void;
|
|
61
|
+
};
|
|
62
|
+
export type UseDateInputProps = DateInputStoreProps & DateInputSelectionConfig;
|
|
63
|
+
export type UseDateInputElementProps = DateInputStoreProps & {
|
|
64
|
+
mode?: CalendarMode;
|
|
65
|
+
value?: CalendarDateInput | CalendarRangeInput | null;
|
|
66
|
+
defaultValue?: CalendarDateInput | CalendarRangeInput | null;
|
|
67
|
+
onChange?: ((date: Date | null) => void) | ((range: CalendarRange) => void);
|
|
68
|
+
};
|
|
69
|
+
export type UseDateInputReturn = {
|
|
70
|
+
mode: CalendarMode;
|
|
71
|
+
locale: string;
|
|
72
|
+
value: (Date | null)[];
|
|
73
|
+
valueAsString: string[];
|
|
74
|
+
placeholderValue: Date;
|
|
75
|
+
focused: boolean;
|
|
76
|
+
activeIndex: number;
|
|
77
|
+
disabled: boolean;
|
|
78
|
+
readOnly: boolean;
|
|
79
|
+
required: boolean;
|
|
80
|
+
invalid: boolean;
|
|
81
|
+
name?: string;
|
|
82
|
+
form?: string;
|
|
83
|
+
ids: Required<DateInputIds>;
|
|
84
|
+
describedBy?: string;
|
|
85
|
+
segmentLabels: Record<DateInputEditableSegmentType, string>;
|
|
86
|
+
focus: (index?: number) => void;
|
|
87
|
+
setValue: (value: (CalendarDateInput | null)[]) => void;
|
|
88
|
+
clearValue: () => void;
|
|
89
|
+
getSegments: (index?: number) => DateInputSegmentDetails[];
|
|
90
|
+
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
91
|
+
handleSegmentFocus: (index: number, event: React.FocusEvent<HTMLElement>) => void;
|
|
92
|
+
handleSegmentPointerDown: () => void;
|
|
93
|
+
handleSegmentBlur: (event: React.FocusEvent<HTMLElement>) => void;
|
|
94
|
+
handleSegmentKeyDown: (index: number, event: React.KeyboardEvent<HTMLElement>) => void;
|
|
95
|
+
handleSegmentInput: (index: number, event: React.InputEvent<HTMLElement>) => void;
|
|
96
|
+
handleSegmentPaste: (index: number, event: React.ClipboardEvent<HTMLElement>) => void;
|
|
97
|
+
};
|
|
98
|
+
type DateInputFieldProps = {
|
|
99
|
+
size?: TextInputSize;
|
|
100
|
+
block?: boolean;
|
|
101
|
+
contrast?: boolean;
|
|
102
|
+
className?: string;
|
|
103
|
+
};
|
|
104
|
+
export type DateInputProps = Omit<React.ComponentPropsWithoutRef<"div">, keyof UseDateInputElementProps> & UseDateInputProps & DateInputFieldProps;
|
|
105
|
+
export type DateInputElementProps = Omit<React.ComponentPropsWithoutRef<"div">, keyof UseDateInputElementProps> & UseDateInputElementProps & DateInputFieldProps;
|
|
106
|
+
export type DateInputRootProviderProps = Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "defaultValue"> & DateInputFieldProps & {
|
|
107
|
+
value: UseDateInputReturn;
|
|
108
|
+
};
|
|
109
|
+
export type DateInputLabelProps = React.ComponentPropsWithoutRef<"label"> & {
|
|
110
|
+
className?: string;
|
|
111
|
+
};
|
|
112
|
+
export type DateInputControlProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
113
|
+
className?: string;
|
|
114
|
+
};
|
|
115
|
+
export type DateInputSegmentGroupChildren = React.ReactNode | ((segments: DateInputSegmentDetails[]) => React.ReactNode);
|
|
116
|
+
export type DateInputSegmentGroupProps = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
|
|
117
|
+
index?: number;
|
|
118
|
+
children?: DateInputSegmentGroupChildren;
|
|
119
|
+
className?: string;
|
|
120
|
+
};
|
|
121
|
+
export type DateInputSegmentProps = Omit<React.ComponentPropsWithoutRef<"span">, "children"> & {
|
|
122
|
+
segment: DateInputSegmentDetails;
|
|
123
|
+
className?: string;
|
|
124
|
+
};
|
|
125
|
+
export type DateInputHiddenInputProps = Omit<React.ComponentPropsWithoutRef<"input">, "type" | "value" | "defaultValue"> & {
|
|
126
|
+
index?: number;
|
|
127
|
+
name?: string;
|
|
128
|
+
className?: string;
|
|
129
|
+
};
|
|
130
|
+
export type DateInputContextValue = Partial<UseDateInputReturn> & Omit<DateInputFieldProps, "className"> & {
|
|
131
|
+
ariaLabel?: string;
|
|
132
|
+
ariaLabelledBy?: string;
|
|
133
|
+
};
|
|
134
|
+
export type DateInputSegmentGroupContextValue = {
|
|
135
|
+
index: number;
|
|
136
|
+
};
|
|
137
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DateInputContextValue, DateInputSegmentGroupContextValue } from "./DateInput.types";
|
|
2
|
+
export declare const DateInputContext: import("react").Context<DateInputContextValue>;
|
|
3
|
+
export declare const useDateInputContext: () => DateInputContextValue;
|
|
4
|
+
export declare const DateInputSegmentGroupContext: import("react").Context<DateInputSegmentGroupContextValue>;
|
|
5
|
+
export declare const useDateInputSegmentGroupContext: () => DateInputSegmentGroupContextValue;
|
|
6
|
+
export declare const getStateAttributes: ({ disabled, readOnly, required, invalid, }: DateInputContextValue) => {
|
|
7
|
+
"data-disabled": true | undefined;
|
|
8
|
+
"data-readonly": true | undefined;
|
|
9
|
+
"data-required": true | undefined;
|
|
10
|
+
"data-invalid": true | undefined;
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "defaultValue" | "type"> & {
|
|
3
|
+
index?: number;
|
|
4
|
+
name?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange" | "defaultValue"> & {
|
|
3
|
+
size?: import("..").TextInputSize;
|
|
4
|
+
block?: boolean;
|
|
5
|
+
contrast?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
} & {
|
|
8
|
+
value: import("./DateInput.types").UseDateInputReturn;
|
|
9
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
|
|
3
|
+
segment: import("./DateInput.types").DateInputSegmentDetails;
|
|
4
|
+
className?: string;
|
|
5
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const _default: (props: Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
|
|
3
|
+
index?: number;
|
|
4
|
+
children?: import("./DateInput.types").DateInputSegmentGroupChildren;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import type { DateInputEditableSegmentType, DateInputSegmentDetails, DateInputSegmentType } from "./DateInput.types";
|
|
3
|
+
export type DateInputHourCycleId = "h11" | "h12" | "h23" | "h24";
|
|
4
|
+
export type DateInputFields = {
|
|
5
|
+
year: number | null;
|
|
6
|
+
month: number | null;
|
|
7
|
+
day: number | null;
|
|
8
|
+
hour: number | null;
|
|
9
|
+
minute: number | null;
|
|
10
|
+
second: number | null;
|
|
11
|
+
dayPeriod: number | null;
|
|
12
|
+
};
|
|
13
|
+
export type DateInputFieldLimits = {
|
|
14
|
+
minValue: number;
|
|
15
|
+
maxValue: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const createFields: () => DateInputFields;
|
|
18
|
+
export declare const toHourCycle: (hour: number, hourCycle: DateInputHourCycleId) => [dayPeriod: number | null, hour: number];
|
|
19
|
+
export declare const fromHourCycle: (hour: number, dayPeriod: number, hourCycle: DateInputHourCycleId) => number;
|
|
20
|
+
export declare const getFieldLimits: (type: DateInputEditableSegmentType, hourCycle: DateInputHourCycleId) => DateInputFieldLimits;
|
|
21
|
+
export declare const fieldsFromDate: (date: Dayjs, hourCycle: DateInputHourCycleId) => DateInputFields;
|
|
22
|
+
export declare const fieldsToDate: (fields: DateInputFields, base: Dayjs, hourCycle: DateInputHourCycleId) => Dayjs;
|
|
23
|
+
export declare const withHourCycle: (fields: DateInputFields, from: DateInputHourCycleId, to: DateInputHourCycleId) => DateInputFields;
|
|
24
|
+
export declare const isComplete: (fields: DateInputFields, types: DateInputEditableSegmentType[]) => boolean;
|
|
25
|
+
export declare const isCleared: (fields: DateInputFields, types: DateInputEditableSegmentType[]) => boolean;
|
|
26
|
+
export declare const setField: (fields: DateInputFields, type: DateInputEditableSegmentType, value: number, base: Dayjs, hourCycle: DateInputHourCycleId) => DateInputFields;
|
|
27
|
+
export declare const clearField: (fields: DateInputFields, type: DateInputEditableSegmentType) => DateInputFields;
|
|
28
|
+
export declare const cycleValue: (value: number, amount: number, min: number, max: number, round?: boolean) => number;
|
|
29
|
+
export declare const cycleField: (fields: DateInputFields, type: DateInputEditableSegmentType, amount: number, base: Dayjs, hourCycle: DateInputHourCycleId) => DateInputFields;
|
|
30
|
+
export declare const constrainDate: (date: Dayjs, min: Dayjs | null, max: Dayjs | null) => Dayjs;
|
|
31
|
+
export type TypedInputOptions = {
|
|
32
|
+
fields: DateInputFields;
|
|
33
|
+
segment: DateInputSegmentDetails;
|
|
34
|
+
input: string;
|
|
35
|
+
enteredKeys: string;
|
|
36
|
+
base: Dayjs;
|
|
37
|
+
hourCycle: DateInputHourCycleId;
|
|
38
|
+
hour12: boolean;
|
|
39
|
+
dayPeriodNames: [am: string, pm: string];
|
|
40
|
+
};
|
|
41
|
+
export type TypedInputResult = {
|
|
42
|
+
fields: DateInputFields | null;
|
|
43
|
+
enteredKeys: string;
|
|
44
|
+
advance: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare const readTypedInput: ({ fields, segment, input, enteredKeys, base, hourCycle, hour12, dayPeriodNames, }: TypedInputOptions) => TypedInputResult | null;
|
|
47
|
+
export declare const parsePastedDate: (text: string, formats: string[]) => Dayjs | null;
|
|
48
|
+
export declare const isFocusableSegment: (segment: DateInputSegmentDetails) => boolean;
|
|
49
|
+
export declare const isEditableType: (type: DateInputSegmentType) => type is DateInputEditableSegmentType;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import type { DateInputFields, DateInputHourCycleId } from "./dateInputFields";
|
|
3
|
+
import type { DateInputEditableSegmentType, DateInputGranularity, DateInputHourCycle, DateInputSegmentDetails } from "./DateInput.types";
|
|
4
|
+
export declare const DEFAULT_SEGMENT_LABELS: Record<DateInputEditableSegmentType, string>;
|
|
5
|
+
export declare const PAGE_STEPS: Partial<Record<DateInputEditableSegmentType, number>>;
|
|
6
|
+
export declare const DEFAULT_FORMATS: Record<DateInputGranularity, string>;
|
|
7
|
+
export declare const getPastedFormats: (format: string) => string[];
|
|
8
|
+
export declare const getPlaceholders: (locale: string) => Record<DateInputEditableSegmentType, string>;
|
|
9
|
+
export type SegmentFormatterOptions = {
|
|
10
|
+
granularity: DateInputGranularity;
|
|
11
|
+
leadingZeros: boolean;
|
|
12
|
+
hourCycle?: DateInputHourCycle;
|
|
13
|
+
};
|
|
14
|
+
export declare const createSegmentFormatter: (locale: string, options: SegmentFormatterOptions) => Intl.DateTimeFormat;
|
|
15
|
+
export declare const resolveHourCycle: (formatter: Intl.DateTimeFormat) => DateInputHourCycleId;
|
|
16
|
+
export declare const getDayPeriodNames: (locale: string) => [am: string, pm: string];
|
|
17
|
+
export declare const getSegmentTypes: (formatter: Intl.DateTimeFormat) => DateInputEditableSegmentType[];
|
|
18
|
+
export type BuildSegmentsOptions = {
|
|
19
|
+
fields: DateInputFields;
|
|
20
|
+
date: Dayjs;
|
|
21
|
+
formatter: Intl.DateTimeFormat;
|
|
22
|
+
placeholders: Record<DateInputEditableSegmentType, string>;
|
|
23
|
+
granularity: DateInputGranularity;
|
|
24
|
+
hourCycle: DateInputHourCycleId;
|
|
25
|
+
};
|
|
26
|
+
export declare const buildSegments: ({ fields, date, formatter, placeholders, granularity, hourCycle, }: BuildSegmentsOptions) => DateInputSegmentDetails[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import DateInputControl from "./DateInputControl";
|
|
2
|
+
import DateInputHiddenInput from "./DateInputHiddenInput";
|
|
3
|
+
import DateInputLabel from "./DateInputLabel";
|
|
4
|
+
import DateInputRootProvider from "./DateInputRootProvider";
|
|
5
|
+
import DateInputSegment from "./DateInputSegment";
|
|
6
|
+
import DateInputSegmentGroup from "./DateInputSegmentGroup";
|
|
7
|
+
export declare const DateInput: ((props: import("./DateInput.types").DateInputProps & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
8
|
+
Root: (props: import("./DateInput.types").DateInputProps & import("react").RefAttributes<any>) => React.ReactNode;
|
|
9
|
+
RootProvider: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "onChange" | "defaultValue"> & {
|
|
10
|
+
size?: import("..").TextInputSize;
|
|
11
|
+
block?: boolean;
|
|
12
|
+
contrast?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & {
|
|
15
|
+
value: import("./DateInput.types").UseDateInputReturn;
|
|
16
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
17
|
+
Label: (props: Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
18
|
+
className?: string;
|
|
19
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
20
|
+
Control: (props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
21
|
+
className?: string;
|
|
22
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
23
|
+
SegmentGroup: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "children"> & {
|
|
24
|
+
index?: number;
|
|
25
|
+
children?: import("./DateInput.types").DateInputSegmentGroupChildren;
|
|
26
|
+
className?: string;
|
|
27
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
28
|
+
Segment: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children"> & {
|
|
29
|
+
segment: import("./DateInput.types").DateInputSegmentDetails;
|
|
30
|
+
className?: string;
|
|
31
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
32
|
+
HiddenInput: (props: Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "value" | "defaultValue" | "type"> & {
|
|
33
|
+
index?: number;
|
|
34
|
+
name?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
} & import("react").RefAttributes<any>) => React.ReactNode;
|
|
37
|
+
};
|
|
38
|
+
export { DateInputRootProvider, DateInputLabel, DateInputControl, DateInputSegmentGroup, DateInputSegment, DateInputHiddenInput, };
|
|
39
|
+
export { DateInputContext, DateInputSegmentGroupContext, useDateInputContext, useDateInputSegmentGroupContext, } from "./DateInputContext";
|
|
40
|
+
export { useDateInput } from "./useDateInput";
|
|
41
|
+
export * from "./DateInput.types";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobeArc, GlobeMarker } from "./Globe.types";
|
|
3
|
+
export declare const DEFAULT_GLOBE_MARKER_SIZE = 0.05;
|
|
4
|
+
export declare const DEFAULT_GLOBE_SPEED = 0.3;
|
|
5
|
+
declare const _default: (props: Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
latitude?: number;
|
|
7
|
+
longitude?: number;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
markers?: readonly GlobeMarker[];
|
|
10
|
+
arcs?: readonly GlobeArc[];
|
|
11
|
+
markerSize?: number;
|
|
12
|
+
spin?: boolean;
|
|
13
|
+
speed?: number;
|
|
14
|
+
interactive?: boolean;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
} & React.RefAttributes<any>) => React.ReactNode;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type { GlobeArc as GlobeSurfaceArc, GlobeMarker as GlobeSurfaceMarker } from "../../lib/react-globe";
|
|
3
|
+
export type { GlobeColor, GlobeLocation, GlobeOverlayProps } from "../../lib/react-globe";
|
|
4
|
+
export type GlobeMarker = Omit<GlobeSurfaceMarker, "size"> & {
|
|
5
|
+
size?: number;
|
|
6
|
+
};
|
|
7
|
+
export type GlobeArc = GlobeSurfaceArc;
|
|
8
|
+
export type GlobeProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
9
|
+
latitude?: number;
|
|
10
|
+
longitude?: number;
|
|
11
|
+
size?: number | string;
|
|
12
|
+
markers?: readonly GlobeMarker[];
|
|
13
|
+
arcs?: readonly GlobeArc[];
|
|
14
|
+
markerSize?: number;
|
|
15
|
+
spin?: boolean;
|
|
16
|
+
speed?: number;
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GlobeOverlay } from "../../lib/react-globe";
|
|
2
|
+
export declare const Globe: ((props: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
|
+
latitude?: number;
|
|
4
|
+
longitude?: number;
|
|
5
|
+
size?: number | string;
|
|
6
|
+
markers?: readonly import("./Globe.types").GlobeMarker[];
|
|
7
|
+
arcs?: readonly import("./Globe.types").GlobeArc[];
|
|
8
|
+
markerSize?: number;
|
|
9
|
+
spin?: boolean;
|
|
10
|
+
speed?: number;
|
|
11
|
+
interactive?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & import("react").RefAttributes<any>) => React.ReactNode) & {
|
|
15
|
+
Overlay: typeof GlobeOverlay;
|
|
16
|
+
};
|
|
17
|
+
export { GlobeOverlay };
|
|
18
|
+
export { DEFAULT_GLOBE_MARKER_SIZE, DEFAULT_GLOBE_SPEED } from "./Globe";
|
|
19
|
+
export { useGlobe } from "../../lib/react-globe";
|
|
20
|
+
export * from "./Globe.types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useReducedMotion: () => boolean;
|
|
@@ -36,6 +36,7 @@ export * from "./confirmation-dialog";
|
|
|
36
36
|
export * from "./context-menu";
|
|
37
37
|
export * from "./counter-label";
|
|
38
38
|
export * from "./data-table";
|
|
39
|
+
export * from "./date-input";
|
|
39
40
|
export * from "./date-picker";
|
|
40
41
|
export * from "./details";
|
|
41
42
|
export * from "./dialog";
|
|
@@ -50,6 +51,7 @@ export * from "./form-control";
|
|
|
50
51
|
export * from "./format-byte";
|
|
51
52
|
export * from "./format-number";
|
|
52
53
|
export * from "./frame";
|
|
54
|
+
export * from "./globe";
|
|
53
55
|
export * from "./header";
|
|
54
56
|
export * from "./heading";
|
|
55
57
|
export * from "./hidden";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobeProps } from "./types";
|
|
3
|
+
declare function Globe({ children, className, style, width, height, devicePixelRatio, context, onRender, ...state }: GlobeProps): React.JSX.Element;
|
|
4
|
+
declare namespace Globe {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export { Globe };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobeOverlayProps } from "./types";
|
|
3
|
+
declare function GlobeOverlay({ marker, arc, className, style, children, ...rest }: GlobeOverlayProps): React.JSX.Element | null;
|
|
4
|
+
declare namespace GlobeOverlay {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
7
|
+
export { GlobeOverlay };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GlobeArc, GlobeLocation, GlobeMarker, GlobeProjection } from "./types";
|
|
2
|
+
export declare const markerAnchorName: (id: string) => string;
|
|
3
|
+
export declare const arcAnchorName: (id: string) => string;
|
|
4
|
+
export declare const markerVisibilityVariable: (id: string) => string;
|
|
5
|
+
export declare const arcVisibilityVariable: (id: string) => string;
|
|
6
|
+
export declare const supportsAnchorPositioning: () => boolean;
|
|
7
|
+
export type AnchorManager = {
|
|
8
|
+
updateMarkers: (markers: readonly GlobeMarker[], project: (location: GlobeLocation) => GlobeProjection) => void;
|
|
9
|
+
updateArcs: (arcs: readonly GlobeArc[], project: (arc: GlobeArc) => GlobeProjection | null) => void;
|
|
10
|
+
applyVisibility: () => void;
|
|
11
|
+
remove: () => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function createAnchorManager(container: HTMLElement | null): AnchorManager;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Globe library
|
|
3
|
+
*
|
|
4
|
+
* A dotted globe drawn with WebGL onto a canvas, with markers and arcs standing on it and any
|
|
5
|
+
* element of the page held over them. The globe is drawn once for every state it is told, so a
|
|
6
|
+
* still globe costs nothing after it is drawn and a turning one is drawn as often as the caller
|
|
7
|
+
* says.
|
|
8
|
+
*
|
|
9
|
+
* <Globe
|
|
10
|
+
* markers={[{ id: "sf", location: [37.78, -122.44], size: 0.03 }]}
|
|
11
|
+
* onRender={(state) => {
|
|
12
|
+
* state.phi = phi += 0.005;
|
|
13
|
+
* }}
|
|
14
|
+
* >
|
|
15
|
+
* <GlobeOverlay marker="sf">San Francisco</GlobeOverlay>
|
|
16
|
+
* </Globe>
|
|
17
|
+
*
|
|
18
|
+
* The overlays are held in place by CSS anchor positioning: every named marker and arc has an
|
|
19
|
+
* anchor called `--globe-{id}` or `--globe-arc-{id}` moved under it on every frame, and a
|
|
20
|
+
* variable called `--globe-visible-{id}` or `--globe-visible-arc-{id}` that is set while it is
|
|
21
|
+
* in view and unset while it is round the back.
|
|
22
|
+
*
|
|
23
|
+
* Ported from cobe (MIT).
|
|
24
|
+
*/
|
|
25
|
+
export { createGlobe, DEFAULT_GLOBE_STATE, GLOBE_STATE_KEYS } from "./renderer";
|
|
26
|
+
export { Globe } from "./Globe";
|
|
27
|
+
export { GlobeContext } from "./GlobeContext";
|
|
28
|
+
export { useGlobe } from "./useGlobe";
|
|
29
|
+
export { GlobeOverlay } from "./GlobeOverlay";
|
|
30
|
+
export { latLonTo3D, GLOBE_RADIUS } from "./projection";
|
|
31
|
+
export { arcAnchorName, arcVisibilityVariable, markerAnchorName, markerVisibilityVariable, supportsAnchorPositioning, } from "./anchor";
|
|
32
|
+
export type { GlobeArc, GlobeColor, GlobeInstance, GlobeLocation, GlobeMarker, GlobeOptions, GlobeOverlayProps, GlobeProjection, GlobeProps, GlobeRenderCallback, GlobeState, } from "./types";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GlobeArc, GlobeLocation, GlobeProjection } from "./types";
|
|
2
|
+
export type GlobePosition = [x: number, y: number, z: number];
|
|
3
|
+
export type GlobeView = {
|
|
4
|
+
phi: number;
|
|
5
|
+
theta: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
devicePixelRatio: number;
|
|
9
|
+
scale: number;
|
|
10
|
+
offset: [x: number, y: number];
|
|
11
|
+
markerElevation: number;
|
|
12
|
+
arcHeight: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const GLOBE_RADIUS = 0.8;
|
|
15
|
+
export declare function latLonTo3D([latitude, longitude]: GlobeLocation): GlobePosition;
|
|
16
|
+
export declare function applyRotation([x, y, z]: GlobePosition, view: GlobeView): GlobeProjection;
|
|
17
|
+
export declare function project(location: GlobeLocation, view: GlobeView): GlobeProjection;
|
|
18
|
+
export declare function projectArcMidpoint(arc: GlobeArc, view: GlobeView): GlobeProjection | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { GlobeInstance, GlobeOptions, GlobeState } from "./types";
|
|
2
|
+
export declare const DEFAULT_GLOBE_STATE: Required<Omit<GlobeState, "width" | "height">>;
|
|
3
|
+
export declare const GLOBE_STATE_KEYS: ReadonlyArray<keyof typeof DEFAULT_GLOBE_STATE>;
|
|
4
|
+
export declare function createGlobe(canvas: HTMLCanvasElement, options: GlobeOptions): GlobeInstance;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ARC_VERTEX_SHADER = "\nconst float GLOBE_R = 0.8;\n\nattribute vec2 aPosition;\nattribute vec3 aArcFrom;\nattribute vec3 aArcTo;\nattribute float aArcHeight;\nattribute float aArcWidth;\nattribute vec3 aArcColor;\nattribute float aHasColor;\n\nuniform float phi;\nuniform float theta;\nuniform vec2 uResolution;\nuniform float scale;\nuniform vec2 offset;\nuniform float markerElevation;\n\nvarying vec3 vArcColor;\nvarying float vHasColor;\nvarying float vDepth;\nvarying float vRadialDist;\n\nmat3 rotate(float theta, float phi) {\n float cx = cos(theta);\n float cy = cos(phi);\n float sx = sin(theta);\n float sy = sin(phi);\n return mat3(\n cy, sy * sx, -sy * cx,\n 0.0, cx, sx,\n sy, cy * -sx, cy * cx\n );\n}\n\nvec3 bezierPoint(vec3 p0, vec3 p1, vec3 p2, float t) {\n float u = 1.0 - t;\n return u * u * p0 + 2.0 * u * t * p1 + t * t * p2;\n}\n\nvec3 bezierTangent(vec3 p0, vec3 p1, vec3 p2, float t) {\n float u = 1.0 - t;\n return 2.0 * u * (p1 - p0) + 2.0 * t * (p2 - p1);\n}\n\nvoid main() {\n mat3 rot = rotate(theta, phi);\n\n float endpointR = GLOBE_R + markerElevation;\n vec3 from = aArcFrom * endpointR;\n vec3 to = aArcTo * endpointR;\n\n vec3 midSum = aArcFrom + aArcTo;\n float midLen = length(midSum);\n vec3 midDir = midLen > 0.001 ? midSum / midLen : vec3(0.0, 1.0, 0.0);\n vec3 mid = midDir * (GLOBE_R + aArcHeight);\n\n float t = aPosition.x;\n vec3 arcPoint = bezierPoint(from, mid, to, t);\n\n vec3 rotatedPoint = rot * arcPoint;\n\n vec3 rawTangent = bezierTangent(from, mid, to, t);\n vec3 rotatedTangent = rot * rawTangent;\n\n vec2 screenTangent = rotatedTangent.xy;\n float screenTangentLen = length(screenTangent);\n\n vec2 screenPerp = screenTangentLen > 0.001\n ? vec2(-screenTangent.y, screenTangent.x) / screenTangentLen\n : vec2(1.0, 0.0);\n\n float aspect = uResolution.x / uResolution.y;\n vec2 baseScreenPos = rotatedPoint.xy * vec2(1.0 / aspect, 1.0) * scale\n + offset * vec2(1.0, -1.0) * scale / uResolution;\n\n vec2 screenPos = baseScreenPos + screenPerp * aArcWidth * aPosition.y * scale;\n\n gl_Position = vec4(screenPos, 0.0, 1.0);\n\n vArcColor = aArcColor;\n vHasColor = aHasColor;\n vDepth = rotatedPoint.z;\n vRadialDist = length(rotatedPoint.xy);\n}\n";
|
|
2
|
+
export declare const ARC_FRAGMENT_SHADER = "\nprecision highp float;\n\nconst float GLOBE_R = 0.8;\n\nuniform vec3 arcColor;\n\nvarying vec3 vArcColor;\nvarying float vHasColor;\nvarying float vDepth;\nvarying float vRadialDist;\n\nvoid main() {\n if (vDepth < 0.0 && vRadialDist < GLOBE_R) discard;\n\n vec3 col = vHasColor > 0.5 ? vArcColor : arcColor;\n gl_FragColor = vec4(col, 1.0);\n}\n";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const GLOBE_VERTEX_SHADER = "\nattribute vec2 aPosition;\n\nvoid main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}\n";
|
|
2
|
+
export declare const GLOBE_FRAGMENT_SHADER = "\nprecision highp float;\n\nuniform vec2 uResolution;\nuniform vec2 offset;\nuniform vec2 rotation;\nuniform float dots;\nuniform float scale;\nuniform vec3 baseColor;\nuniform vec3 glowColor;\nuniform vec4 renderParams;\nuniform float mapBaseBrightness;\nuniform sampler2D uTexture;\n\nconst float sqrt5 = 2.236068;\nconst float PI = 3.141593;\nconst float kTau = 6.283185;\nconst float kPhi = 1.618034;\nconst float r = 0.8;\n\nfloat byDots;\n\nmat3 rotate(float theta, float phi) {\n float cx = cos(theta);\n float cy = cos(phi);\n float sx = sin(theta);\n float sy = sin(phi);\n return mat3(\n cy, sy * sx, -sy * cx,\n 0.0, cx, sx,\n sy, cy * -sx, cy * cx\n );\n}\n\nvec3 nearestFibonacciLattice(vec3 p, out float m) {\n p = p.xzy;\n\n float k = max(2.0, floor(log2(sqrt5 * dots * PI * (1.0 - p.z * p.z)) * 0.72021));\n\n vec2 f = floor(pow(kPhi, k) / sqrt5 * vec2(1.0, kPhi) + 0.5);\n vec2 br1 = fract((f + 1.0) * (kPhi - 1.0)) * kTau - 3.883222;\n vec2 br2 = -2.0 * f;\n vec2 sp = vec2(atan(p.y, p.x), p.z - 1.0);\n vec2 c = floor(vec2(\n br2.y * sp.x - br1.y * (sp.y * dots + 1.0),\n -br2.x * sp.x + br1.x * (sp.y * dots + 1.0)\n ) / (br1.x * br2.y - br2.x * br1.y));\n\n float mindist = PI;\n vec3 minip;\n for (float s = 0.0; s < 4.0; s += 1.0) {\n vec2 o = vec2(mod(s, 2.0), floor(s * 0.5));\n float idx = dot(f, c + o);\n if (idx > dots) continue;\n\n float a = idx, b = 0.0;\n if (a >= 16384.0) a -= 16384.0, b += 0.868872;\n if (a >= 8192.0) a -= 8192.0, b += 0.934436;\n if (a >= 4096.0) a -= 4096.0, b += 0.467218;\n if (a >= 2048.0) a -= 2048.0, b += 0.733609;\n if (a >= 1024.0) a -= 1024.0, b += 0.866804;\n if (a >= 512.0) a -= 512.0, b += 0.433402;\n if (a >= 256.0) a -= 256.0, b += 0.216701;\n if (a >= 128.0) a -= 128.0, b += 0.108351;\n if (a >= 64.0) a -= 64.0, b += 0.554175;\n if (a >= 32.0) a -= 32.0, b += 0.777088;\n if (a >= 16.0) a -= 16.0, b += 0.888544;\n if (a >= 8.0) a -= 8.0, b += 0.944272;\n if (a >= 4.0) a -= 4.0, b += 0.472136;\n if (a >= 2.0) a -= 2.0, b += 0.236068;\n if (a >= 1.0) a -= 1.0, b += 0.618034;\n\n float theta = fract(b) * kTau;\n\n float cosphi = 1.0 - 2.0 * idx * byDots;\n float sinphi = sqrt(1.0 - cosphi * cosphi);\n vec3 candidate = vec3(cos(theta) * sinphi, sin(theta) * sinphi, cosphi);\n\n float dist = length(p - candidate);\n\n if (dist < mindist) {\n mindist = dist;\n minip = candidate;\n }\n }\n\n m = mindist;\n return minip.xzy;\n}\n\nvoid main() {\n byDots = 1.0 / dots;\n\n vec2 invResolution = 1.0 / uResolution;\n\n vec2 uv = ((gl_FragCoord.xy * invResolution) * 2.0 - 1.0) / scale\n - offset * vec2(1.0, -1.0) * invResolution;\n uv.x *= uResolution.x * invResolution.y;\n\n float l = dot(uv, uv);\n float glowFactor = 0.0;\n\n vec4 color = vec4(0.0);\n\n if (l <= r * r) {\n float dis;\n vec4 layer = vec4(0.0);\n vec3 p = normalize(vec3(uv, sqrt(r * r - l)));\n mat3 rot = rotate(rotation.y, rotation.x);\n float dotNL = p.z;\n\n vec3 gP = nearestFibonacciLattice(p * rot, dis);\n\n float gPhi = asin(gP.y);\n float gTheta = acos(-gP.x / cos(gPhi));\n if (gP.z < 0.0) gTheta = -gTheta;\n\n vec2 mapUV = vec2((gTheta * 0.5) / PI, -(gPhi / PI + 0.5));\n float mapColor = max(texture2D(uTexture, mapUV).x, mapBaseBrightness);\n\n float land = mapColor\n * smoothstep(0.008, 0.0, dis)\n * pow(dotNL, renderParams.y)\n * renderParams.x;\n layer += vec4(baseColor\n * (mix((1.0 - land) * pow(dotNL, 0.4), land, renderParams.z) + 0.1)\n + pow(1.0 - dotNL, 4.0) * glowColor\n , 1.0);\n\n color += layer * (1.0 + renderParams.w) * 0.5;\n\n glowFactor = (1.0 - l) * (1.0 - l) * smoothstep(0.0, 1.0, 0.2 / (l - r * r));\n } else {\n float outD = sqrt(0.2 / (l - r * r));\n glowFactor = smoothstep(0.5, 1.0, outD / (outD + 1.0));\n }\n\n gl_FragColor = color + vec4(glowFactor * glowColor, glowFactor);\n}\n";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const MARKER_VERTEX_SHADER = "\nattribute vec2 aPosition;\nattribute vec3 aMarkerPos;\nattribute float aMarkerSize;\nattribute vec3 aMarkerColor;\nattribute float aHasColor;\n\nuniform float phi;\nuniform float theta;\nuniform vec2 uResolution;\nuniform float scale;\nuniform vec2 offset;\nuniform float markerElevation;\n\nvarying vec2 vUV;\nvarying vec3 vMarkerColor;\nvarying float vHasColor;\n\nvoid main() {\n float cx = cos(theta), sx = sin(theta);\n float cy = cos(phi), sy = sin(phi);\n vec3 p = aMarkerPos * (0.8 + markerElevation);\n vec3 rp = vec3(\n cy * p.x + sy * p.z,\n sy * sx * p.x + cx * p.y - cy * sx * p.z,\n -sy * cx * p.x + sx * p.y + cy * cx * p.z\n );\n\n if (rp.z < 0.0 && length(rp.xy) < 0.8) {\n gl_Position = vec4(2.0, 2.0, 0.0, 1.0);\n return;\n }\n\n float ia = uResolution.y / uResolution.x;\n vec2 pos = (rp.xy + aPosition * aMarkerSize * 2.0) * vec2(ia, 1.0) * scale\n + offset * vec2(1.0, -1.0) * scale / uResolution;\n gl_Position = vec4(pos, 0.0, 1.0);\n\n vUV = aPosition;\n vMarkerColor = aMarkerColor;\n vHasColor = aHasColor;\n}\n";
|
|
2
|
+
export declare const MARKER_FRAGMENT_SHADER = "\nprecision highp float;\n\nuniform vec3 markerColor;\n\nvarying vec2 vUV;\nvarying vec3 vMarkerColor;\nvarying float vHasColor;\n\nvoid main() {\n if (length(vUV) > 0.25) discard;\n vec3 col = vHasColor > 0.5 ? vMarkerColor : markerColor;\n gl_FragColor = vec4(col, 1.0);\n}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GLOBE_TEXTURE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAACAAQAAAADMzoqnAAAECklEQVR42u3VsW4jRRzH8d94gzfF4Q0VQaC4vBLTRTp0mze4ggfAPAE5XQEFsGNAVIjwBrmW7h7gJE+giKjyABTZE4g06LKJETdRJvtD65kdz6yduKABiW+TVfzRf2bXYxtcE/59YJCz6YdbgQF6ACSRrwYKYImmh5PbwOewlV3wlQNbAN6SEExjUOO+BU0aCSnxReHABUlK4YFQeJeUT3da8IIkZ6NGoSnFY5KsMoVzMKfECUnqxgPYRArarmUCndHwzIEaQEpg5xVdBXROl8mpAQx5dUgPiHoYAAkg5w3JABR06byGAVgcRGAz5bznj6phBQNRFwyqgdxebH6gshJAesWoFhgYpApAFoG8BIZ/fEhSox5jDjQXmV0Ar5XJfAIrALi3URVs09gHIL4XJCkLC5LH9JWiArABFCSrQjdgkBzRJ0WJeUOSNyQAfJJwUSWUBRlJQ8oGHATACGlBynnzy2kEYLNjrxouigD8BZcgOeVPqh12RtufaCN5wCPVDpvQ9lsIrqndsJtDcWqBCpf4hWN7OdWHBw58FwIaNOU/n1TpMW2DFaD48cmr4185T8NHkpUFX749pQPVdgRKC/DGoQPVeAEKv+WHvY8OOWNTPRp5kHuwSf8wzXtVBKR7YwEH9H3lQUaypUfSATOALyVNu5vZJW31Bnx98nkLfDUWJaz6ixvm+RIQRdl3kmRxxiaDoGnZW4CpPfkaQadlcPim1xOSvETQo7Lv75enVAXJ3xGUlony4KQBBWUM1NiDc6qhyS8RgQs18OCMMtPDaAUIyg0PZkRWDqs+wnKJBTDI1Js6BolegOsKmUxNDBAAKqQyMQmidhegBlLZ+wwKYdv5M/8x1khkb1cgKqP2H+MKyV5vS+whrE8DQDgAlUAoRBX056EElJCjJVACeJBZgNfVp+iCCm4RBWCgKsRxASSA9KgDhDtCiTuMyfHsKXzhC6wNAIjjWb8LKAOA2ctk3FmCOlgKFy8f1N0JJtgsxinYnVAHt4t3gPzZXSCTyCWCQmBT91QE3B5yarSN40dNHYPka4TlDhTUI8zLvl0JSL3vZn6DsCFZOeB2yROEpR68sECQQA++xIGCR2X7DwlEoLRgUrZrqlUg50S1uy43YqDcN6UFBVkhAjWiCV2Q0jgQPdplMKxvBXodcOfAwJYvgdL+1etA1YJJfBcZlQV7sO1i2gHoNiyxtQ5sBsCgWyoxCHiFFd2L5nUTCqMAqGUgsQ9f5kCcCiZgRYkMgMTd5WsB1rTzj0Em14BE4r+QxN1lCEsVur2PoF5Wbg8RJXR4djgvBgauhLywoEZQrt1KKRdVS4CdlJ8qafyP+9KIj/nE/d7kKwH9jgS72e9DV+kvfTWgct4ZyP8Byb8BPG7MaaIIkAQAAAAASUVORK5CYII=";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type GlobeLocation = [latitude: number, longitude: number];
|
|
3
|
+
export type GlobeColor = [red: number, green: number, blue: number];
|
|
4
|
+
export type GlobeMarker = {
|
|
5
|
+
location: GlobeLocation;
|
|
6
|
+
size: number;
|
|
7
|
+
color?: GlobeColor;
|
|
8
|
+
id?: string;
|
|
9
|
+
};
|
|
10
|
+
export type GlobeArc = {
|
|
11
|
+
from: GlobeLocation;
|
|
12
|
+
to: GlobeLocation;
|
|
13
|
+
color?: GlobeColor;
|
|
14
|
+
id?: string;
|
|
15
|
+
};
|
|
16
|
+
export type GlobeState = {
|
|
17
|
+
width?: number;
|
|
18
|
+
height?: number;
|
|
19
|
+
phi?: number;
|
|
20
|
+
theta?: number;
|
|
21
|
+
markers?: readonly GlobeMarker[];
|
|
22
|
+
arcs?: readonly GlobeArc[];
|
|
23
|
+
mapSamples?: number;
|
|
24
|
+
mapBrightness?: number;
|
|
25
|
+
mapBaseBrightness?: number;
|
|
26
|
+
baseColor?: GlobeColor;
|
|
27
|
+
markerColor?: GlobeColor;
|
|
28
|
+
glowColor?: GlobeColor;
|
|
29
|
+
arcColor?: GlobeColor;
|
|
30
|
+
arcWidth?: number;
|
|
31
|
+
arcHeight?: number;
|
|
32
|
+
markerElevation?: number;
|
|
33
|
+
diffuse?: number;
|
|
34
|
+
dark?: number;
|
|
35
|
+
opacity?: number;
|
|
36
|
+
offset?: [x: number, y: number];
|
|
37
|
+
scale?: number;
|
|
38
|
+
};
|
|
39
|
+
export type GlobeOptions = GlobeState & {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
devicePixelRatio?: number;
|
|
43
|
+
context?: WebGLContextAttributes;
|
|
44
|
+
};
|
|
45
|
+
export type GlobeInstance = {
|
|
46
|
+
update: (state: GlobeState) => void;
|
|
47
|
+
destroy: () => void;
|
|
48
|
+
};
|
|
49
|
+
export type GlobeRenderCallback = (state: GlobeState) => GlobeState | void;
|
|
50
|
+
export type GlobeProjection = {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
visible: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type GlobeProps = Omit<GlobeOptions, "width" | "height"> & {
|
|
56
|
+
width?: number | string;
|
|
57
|
+
height?: number | string;
|
|
58
|
+
onRender?: GlobeRenderCallback;
|
|
59
|
+
children?: React.ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
style?: React.CSSProperties;
|
|
62
|
+
};
|
|
63
|
+
export type GlobeOverlayProps = React.ComponentPropsWithoutRef<"div"> & ({
|
|
64
|
+
marker: string;
|
|
65
|
+
arc?: never;
|
|
66
|
+
} | {
|
|
67
|
+
arc: string;
|
|
68
|
+
marker?: never;
|
|
69
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGlobe: () => import("./types").GlobeInstance | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function createProgram(gl: WebGLRenderingContext, vertexSource: string, fragmentSource: string): WebGLProgram | null;
|
|
2
|
+
export declare function getUniformLocations<TName extends string>(gl: WebGLRenderingContext, program: WebGLProgram, names: readonly TName[]): Record<TName, WebGLUniformLocation | null>;
|
|
3
|
+
export declare function getAttribLocations<TName extends string>(gl: WebGLRenderingContext, program: WebGLProgram, names: readonly TName[]): Record<TName, number>;
|