@galaxy-io/dls 1.4.10 → 1.4.11
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/accordion/Accordion.d.ts +19 -2
- package/dist/accordion/Accordion.js +8 -0
- package/dist/avatar/Avatar.d.ts +9 -0
- package/dist/avatar/Avatar.js +4 -0
- package/dist/avatar/AvatarShimmer.d.ts +2 -0
- package/dist/avatar/AvatarShimmer.js +1 -0
- package/dist/backgrounds/CellGridBackground.d.ts +12 -1
- package/dist/backgrounds/CellGridBackground.js +5 -0
- package/dist/backgrounds/CrossGridBackground.d.ts +13 -1
- package/dist/backgrounds/CrossGridBackground.js +4 -0
- package/dist/backgrounds/DotGridBackground.d.ts +12 -1
- package/dist/backgrounds/DotGridBackground.js +4 -0
- package/dist/badge/Badge.d.ts +12 -0
- package/dist/badge/Badge.js +7 -0
- package/dist/beacons/Beacon.d.ts +7 -13
- package/dist/beacons/Beacon.js +3 -0
- package/dist/buttons/Button.d.ts +18 -0
- package/dist/buttons/Button.js +10 -1
- package/dist/charts/BarChart.js +3 -1
- package/dist/charts/ChartFrame.js +5 -7
- package/dist/charts/ChartLegend.js +1 -5
- package/dist/charts/ChartPrimitives.d.ts +1 -14
- package/dist/charts/ChartPrimitives.js +50 -69
- package/dist/charts/DashboardProvider.d.ts +47 -0
- package/dist/charts/DashboardProvider.js +52 -0
- package/dist/charts/LineChart.js +1 -0
- package/dist/charts/ProgressBar.d.ts +13 -1
- package/dist/charts/ProgressBar.js +7 -0
- package/dist/charts/StatChart.d.ts +10 -1
- package/dist/charts/StatChart.js +5 -0
- package/dist/charts/constants.d.ts +4 -18
- package/dist/charts/constants.js +5 -19
- package/dist/charts/useChartInteraction.d.ts +25 -8
- package/dist/charts/useChartInteraction.js +61 -6
- package/dist/chips/Chip.d.ts +20 -1
- package/dist/chips/Chip.js +9 -1
- package/dist/containers/FlexItem.d.ts +14 -12
- package/dist/containers/FlexItem.js +4 -0
- package/dist/containers/FlexWrapper.d.ts +29 -96
- package/dist/containers/FlexWrapper.js +12 -0
- package/dist/containers/GridWrapper.d.ts +25 -66
- package/dist/containers/GridWrapper.js +8 -0
- package/dist/containers/Spacing.d.ts +10 -0
- package/dist/containers/Spacing.js +7 -0
- package/dist/containers/Wrapper.d.ts +11 -1
- package/dist/containers/Wrapper.js +4 -0
- package/dist/dividers/HorizontalDivider.d.ts +2 -0
- package/dist/dividers/HorizontalDivider.js +1 -0
- package/dist/dividers/VerticalDivider.d.ts +4 -0
- package/dist/dividers/VerticalDivider.js +4 -0
- package/dist/drawer/Drawer.d.ts +11 -4
- package/dist/drawer/Drawer.js +7 -0
- package/dist/dropdown/Dropdown.d.ts +24 -0
- package/dist/dropdown/Dropdown.js +9 -0
- package/dist/editor/CodeEditor.d.ts +23 -42
- package/dist/editor/CodeEditor.js +9 -1
- package/dist/hooks/useDismiss.d.ts +6 -0
- package/dist/hooks/useDismiss.js +6 -0
- package/dist/hooks/useElementClientSize.d.ts +2 -2
- package/dist/hooks/useResize.d.ts +5 -2
- package/dist/icons/GalaxyLogomark.d.ts +9 -1
- package/dist/icons/GalaxyLogomark.js +7 -1
- package/dist/icons/GalaxyLogomark3D.d.ts +15 -0
- package/dist/icons/GalaxyLogomark3D.js +9 -0
- package/dist/icons/GalaxyLogomarkAnimation.d.ts +10 -0
- package/dist/icons/GalaxyLogomarkAnimation.js +7 -1
- package/dist/icons/GalaxyWordmark.d.ts +7 -1
- package/dist/icons/GalaxyWordmark.js +5 -1
- package/dist/icons/Icon.d.ts +10 -0
- package/dist/icons/Icon.js +5 -0
- package/dist/inputs/CheckboxInput.d.ts +13 -0
- package/dist/inputs/CheckboxInput.js +8 -0
- package/dist/inputs/ColorInput.d.ts +15 -0
- package/dist/inputs/ColorInput.js +6 -0
- package/dist/inputs/CopyInput.d.ts +9 -0
- package/dist/inputs/CopyInput.js +4 -0
- package/dist/inputs/DateInput.d.ts +13 -0
- package/dist/inputs/DateInput.js +5 -0
- package/dist/inputs/Input.d.ts +37 -0
- package/dist/inputs/Input.js +13 -0
- package/dist/inputs/MultiSelectInput.d.ts +26 -0
- package/dist/inputs/MultiSelectInput.js +6 -0
- package/dist/inputs/MultiTextInput.d.ts +16 -0
- package/dist/inputs/MultiTextInput.js +9 -0
- package/dist/inputs/NumberInput.d.ts +7 -1
- package/dist/inputs/NumberInput.js +5 -0
- package/dist/inputs/PasswordInput.d.ts +9 -1
- package/dist/inputs/PasswordInput.js +4 -0
- package/dist/inputs/RadioInput.d.ts +13 -0
- package/dist/inputs/RadioInput.js +8 -0
- package/dist/inputs/SelectInput.d.ts +30 -0
- package/dist/inputs/SelectInput.js +8 -0
- package/dist/inputs/SliderInput.d.ts +15 -0
- package/dist/inputs/SliderInput.js +6 -0
- package/dist/inputs/SwitcherInput.d.ts +10 -1
- package/dist/inputs/SwitcherInput.js +4 -0
- package/dist/inputs/TextAreaInput.d.ts +24 -0
- package/dist/inputs/TextAreaInput.js +9 -0
- package/dist/inputs/TextInput.d.ts +8 -1
- package/dist/inputs/TextInput.js +6 -0
- package/dist/inputs/ToggleInput.d.ts +11 -0
- package/dist/inputs/ToggleInput.js +6 -0
- package/dist/lists/BulletedList.d.ts +4 -0
- package/dist/lists/BulletedList.js +2 -0
- package/dist/modal/Modal.d.ts +8 -0
- package/dist/modal/Modal.js +6 -0
- package/dist/overlay/OverlayProvider.d.ts +11 -0
- package/dist/overlay/OverlayProvider.js +7 -0
- package/dist/overlay/constants.d.ts +1 -0
- package/dist/overlay/constants.js +1 -0
- package/dist/overlay/useOverlay.d.ts +11 -0
- package/dist/overlay/useOverlay.js +9 -0
- package/dist/resizable/HorizontalResizeHandle.d.ts +8 -1
- package/dist/resizable/HorizontalResizeHandle.js +6 -0
- package/dist/resizable/VerticalResizeHandle.d.ts +8 -1
- package/dist/resizable/VerticalResizeHandle.js +6 -0
- package/dist/shapes/Circle.d.ts +4 -1
- package/dist/shapes/Circle.js +1 -0
- package/dist/shapes/Square.d.ts +4 -1
- package/dist/shapes/Square.js +1 -0
- package/dist/styles.css +20 -21
- package/dist/table/InfiniteSpreadsheet.d.ts +7 -0
- package/dist/table/InfiniteSpreadsheet.js +7 -0
- package/dist/table/InfiniteTable.d.ts +8 -0
- package/dist/table/InfiniteTable.js +8 -0
- package/dist/table/VirtualizedInfiniteTable.d.ts +7 -0
- package/dist/table/VirtualizedInfiniteTable.js +7 -0
- package/dist/text/Bold.d.ts +4 -0
- package/dist/text/Bold.js +4 -0
- package/dist/text/Code.d.ts +4 -0
- package/dist/text/Code.js +4 -0
- package/dist/text/EditableText.d.ts +10 -1
- package/dist/text/EditableText.js +7 -0
- package/dist/text/Ellipsis.d.ts +6 -4
- package/dist/text/Ellipsis.js +4 -0
- package/dist/text/HotKeys.d.ts +10 -0
- package/dist/text/HotKeys.js +6 -0
- package/dist/text/MarkdownText.d.ts +9 -1
- package/dist/text/MarkdownText.js +6 -0
- package/dist/text/Paragraph.d.ts +17 -0
- package/dist/text/Paragraph.js +7 -0
- package/dist/text/RequiredMarker.d.ts +3 -1
- package/dist/text/RequiredMarker.js +1 -0
- package/dist/text/Selectable.d.ts +4 -0
- package/dist/text/Selectable.js +4 -0
- package/dist/text/Text.d.ts +19 -0
- package/dist/text/Text.js +10 -0
- package/dist/text/TextShimmer.d.ts +7 -0
- package/dist/text/TextShimmer.js +4 -0
- package/dist/theme/GalaxyTheme.d.ts +35 -4
- package/dist/theme/GalaxyTheme.js +13 -1
- package/dist/theme/constants.d.ts +1 -6
- package/dist/theme/constants.js +10 -15
- package/dist/theme/index.js +2 -1
- package/dist/theme/types.d.ts +21 -0
- package/dist/theme/types.js +10 -0
- package/dist/toast/Toast.d.ts +11 -0
- package/dist/toast/Toast.js +5 -0
- package/dist/toast/ToastProvider.d.ts +9 -0
- package/dist/toast/ToastProvider.js +4 -0
- package/dist/toast/useToast.d.ts +7 -0
- package/dist/toast/useToast.js +7 -0
- package/dist/tooltip/Tooltip.d.ts +19 -1
- package/dist/tooltip/Tooltip.js +9 -0
- package/dist/transform/Fade.d.ts +7 -0
- package/dist/transform/Fade.js +6 -0
- package/dist/transform/Flash.d.ts +4 -0
- package/dist/transform/Flash.js +4 -0
- package/dist/transform/Rotate.d.ts +7 -0
- package/dist/transform/Rotate.js +4 -0
- package/dist/transform/ScaleFade.d.ts +7 -0
- package/dist/transform/ScaleFade.js +6 -0
- package/dist/transform/Spin.d.ts +7 -0
- package/dist/transform/Spin.js +5 -0
- package/dist/widget/Widget.d.ts +18 -1
- package/dist/widget/Widget.js +5 -0
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
|
-
import { GalaxyTheme } from "./
|
|
3
|
-
import type { Theme } from "./types";
|
|
2
|
+
import { GalaxyTheme, type Theme } from "./types";
|
|
4
3
|
declare const ThemeProvider: import("react").ComponentType<{
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
theme?: Theme | undefined;
|
|
@@ -9,28 +8,60 @@ declare const ThemeProvider: import("react").ComponentType<{
|
|
|
9
8
|
}, C>(WrappedComponent: import("react").ComponentType<Props> & C) => import("react").ComponentType<import("@callstack/react-theme-provider").$Without<Props, "theme"> & {
|
|
10
9
|
theme?: import("@callstack/react-theme-provider").$DeepPartial<Theme> | undefined;
|
|
11
10
|
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<Props> & C, {}>, useTheme: <T = Theme>(overrides?: import("@callstack/react-theme-provider").$DeepPartial<T> | undefined) => T;
|
|
11
|
+
/**
|
|
12
|
+
* How the provider learns the OS theme. Supply your own on platforms where
|
|
13
|
+
* `prefers-color-scheme` isn't the source of truth (Electron, React Native).
|
|
14
|
+
*/
|
|
12
15
|
export interface ThemeDetector {
|
|
16
|
+
/** Read the OS theme once, at mount. */
|
|
13
17
|
detectInitialTheme(): Promise<GalaxyTheme.DARK | GalaxyTheme.LIGHT>;
|
|
18
|
+
/** Subscribe to OS theme changes. Returns an unsubscribe function. */
|
|
14
19
|
onThemeChange(callback: (theme: GalaxyTheme.DARK | GalaxyTheme.LIGHT) => void): () => void;
|
|
15
20
|
}
|
|
21
|
+
/** Default detector — reads `prefers-color-scheme`. Falls back to DARK off-browser. */
|
|
16
22
|
export declare const BrowserThemeDetector: ThemeDetector;
|
|
17
|
-
|
|
23
|
+
/** What `useGalaxyTheme()` returns. */
|
|
24
|
+
export interface GalaxyThemeContextValue {
|
|
25
|
+
/** The resolved token set. Read colors and fonts from here. */
|
|
18
26
|
theme: Theme;
|
|
27
|
+
/** The theme actually rendering. Never `SYSTEM` — that's already resolved. */
|
|
19
28
|
activeTheme: Exclude<GalaxyTheme, GalaxyTheme.SYSTEM>;
|
|
29
|
+
/** The user's stored preference. Can be `SYSTEM`. Bind theme pickers to this. */
|
|
20
30
|
selectedTheme: GalaxyTheme;
|
|
31
|
+
/** What the OS reports. Use it to label "System (Dark)" in a picker. */
|
|
21
32
|
systemTheme: GalaxyTheme.DARK | GalaxyTheme.LIGHT;
|
|
33
|
+
/** Whether the detector can read an OS theme at all. */
|
|
22
34
|
isSystemThemeSupported: boolean;
|
|
35
|
+
/** Update the preference. Persists through `storage` when one is supplied. */
|
|
23
36
|
setTheme: (theme: GalaxyTheme) => void;
|
|
24
37
|
}
|
|
25
|
-
interface GalaxyThemeProviderProps {
|
|
38
|
+
export interface GalaxyThemeProviderProps {
|
|
39
|
+
/** Theme to start on when nothing is stored. @default GalaxyTheme.SYSTEM */
|
|
26
40
|
initialTheme?: GalaxyTheme;
|
|
41
|
+
/** Key the preference is stored under. @default "galaxy-theme" */
|
|
27
42
|
storageKey?: string;
|
|
43
|
+
/** How the OS theme is read. @default BrowserThemeDetector */
|
|
28
44
|
themeDetector?: ThemeDetector;
|
|
45
|
+
/**
|
|
46
|
+
* Where the preference persists. Omit and the choice is lost on reload.
|
|
47
|
+
* Pass your own adapter — DLS never touches `localStorage` directly, so it
|
|
48
|
+
* stays safe to render on a server.
|
|
49
|
+
*/
|
|
29
50
|
storage?: {
|
|
30
51
|
get: (key: string) => GalaxyTheme | null;
|
|
31
52
|
set: (key: string, theme: GalaxyTheme) => void;
|
|
32
53
|
};
|
|
33
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Root provider. Wrap the app once, above everything that renders DLS.
|
|
57
|
+
*
|
|
58
|
+
* Resolves `SYSTEM` to the OS theme and feeds the token set to every
|
|
59
|
+
* `withTheme(styled.x)` component. Without it `useGalaxyTheme()` throws.
|
|
60
|
+
*/
|
|
34
61
|
declare const GalaxyThemeProvider: ({ children, initialTheme, storageKey, themeDetector, storage, }: PropsWithChildren<GalaxyThemeProviderProps>) => import("react").JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* Read the active theme, the user's preference, and `setTheme`.
|
|
64
|
+
* Throws when called outside a `GalaxyThemeProvider`.
|
|
65
|
+
*/
|
|
35
66
|
export declare const useGalaxyTheme: () => GalaxyThemeContextValue;
|
|
36
67
|
export { GalaxyThemeProvider, ThemeProvider, useTheme, withTheme };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GalaxyTheme } from "./types.js";
|
|
2
|
+
import { DEFAULT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_STORAGE_KEY } from "./constants.js";
|
|
2
3
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
3
4
|
import { createTheming } from "@callstack/react-theme-provider";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/theme/GalaxyTheme.tsx
|
|
6
7
|
var { ThemeProvider, withTheme, useTheme } = createTheming(DEFAULT_THEME);
|
|
8
|
+
/** Default detector — reads `prefers-color-scheme`. Falls back to DARK off-browser. */
|
|
7
9
|
var BrowserThemeDetector = {
|
|
8
10
|
detectInitialTheme: () => {
|
|
9
11
|
if (typeof window !== "undefined" && window.matchMedia) {
|
|
@@ -26,6 +28,12 @@ var BrowserThemeDetector = {
|
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
30
|
var GalaxyThemeContext = createContext(void 0);
|
|
31
|
+
/**
|
|
32
|
+
* Root provider. Wrap the app once, above everything that renders DLS.
|
|
33
|
+
*
|
|
34
|
+
* Resolves `SYSTEM` to the OS theme and feeds the token set to every
|
|
35
|
+
* `withTheme(styled.x)` component. Without it `useGalaxyTheme()` throws.
|
|
36
|
+
*/
|
|
29
37
|
var GalaxyThemeProvider = ({ children, initialTheme, storageKey = GALAXY_THEME_STORAGE_KEY, themeDetector = BrowserThemeDetector, storage }) => {
|
|
30
38
|
const [systemTheme, setSystemTheme] = useState(() => {
|
|
31
39
|
return GalaxyTheme.DARK;
|
|
@@ -98,6 +106,10 @@ var GalaxyThemeProvider = ({ children, initialTheme, storageKey = GALAXY_THEME_S
|
|
|
98
106
|
})
|
|
99
107
|
});
|
|
100
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* Read the active theme, the user's preference, and `setTheme`.
|
|
111
|
+
* Throws when called outside a `GalaxyThemeProvider`.
|
|
112
|
+
*/
|
|
101
113
|
var useGalaxyTheme = () => {
|
|
102
114
|
const context = useContext(GalaxyThemeContext);
|
|
103
115
|
if (context === void 0) throw new Error("useGalaxyTheme must be used within a GalaxyThemeProvider");
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { SelectInputOption } from "../inputs/SelectInput";
|
|
2
|
-
import type
|
|
2
|
+
import { GalaxyTheme, type Theme } from "./types";
|
|
3
3
|
export declare const GALAXY_THEME_STORAGE_KEY = "galaxy:theme";
|
|
4
|
-
export declare enum GalaxyTheme {
|
|
5
|
-
SYSTEM = "SYSTEM",
|
|
6
|
-
DARK = "DARK",
|
|
7
|
-
LIGHT = "LIGHT"
|
|
8
|
-
}
|
|
9
4
|
export declare const GALAXY_DARK_THEME: Theme;
|
|
10
5
|
export declare const GALAXY_LIGHT_THEME: Theme;
|
|
11
6
|
export declare const GALAXY_THEME_OPTIONS: SelectInputOption[];
|
package/dist/theme/constants.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import { GalaxyTheme } from "./types.js";
|
|
1
2
|
import { GALAXY_FONT } from "./typography.js";
|
|
2
3
|
import { GALAXY_DARK_COLOR } from "./variants/dark.js";
|
|
3
4
|
import { GALAXY_LIGHT_COLOR } from "./variants/light.js";
|
|
4
5
|
//#region src/theme/constants.ts
|
|
5
6
|
var GALAXY_THEME_STORAGE_KEY = "galaxy:theme";
|
|
6
|
-
var GalaxyTheme = /* @__PURE__ */ function(GalaxyTheme) {
|
|
7
|
-
GalaxyTheme["SYSTEM"] = "SYSTEM";
|
|
8
|
-
GalaxyTheme["DARK"] = "DARK";
|
|
9
|
-
GalaxyTheme["LIGHT"] = "LIGHT";
|
|
10
|
-
return GalaxyTheme;
|
|
11
|
-
}({});
|
|
12
7
|
var GALAXY_DARK_THEME = {
|
|
13
8
|
color: GALAXY_DARK_COLOR,
|
|
14
9
|
font: GALAXY_FONT
|
|
@@ -19,25 +14,25 @@ var GALAXY_LIGHT_THEME = {
|
|
|
19
14
|
};
|
|
20
15
|
var GALAXY_THEME_OPTIONS = [
|
|
21
16
|
{
|
|
22
|
-
id:
|
|
17
|
+
id: GalaxyTheme.SYSTEM,
|
|
23
18
|
label: "System",
|
|
24
|
-
value:
|
|
19
|
+
value: GalaxyTheme.SYSTEM
|
|
25
20
|
},
|
|
26
21
|
{
|
|
27
|
-
id:
|
|
22
|
+
id: GalaxyTheme.DARK,
|
|
28
23
|
label: "Dark",
|
|
29
|
-
value:
|
|
24
|
+
value: GalaxyTheme.DARK
|
|
30
25
|
},
|
|
31
26
|
{
|
|
32
|
-
id:
|
|
27
|
+
id: GalaxyTheme.LIGHT,
|
|
33
28
|
label: "Light",
|
|
34
|
-
value:
|
|
29
|
+
value: GalaxyTheme.LIGHT
|
|
35
30
|
}
|
|
36
31
|
];
|
|
37
32
|
var GALAXY_THEME_MAP = {
|
|
38
|
-
[
|
|
39
|
-
[
|
|
33
|
+
[GalaxyTheme.DARK]: GALAXY_DARK_THEME,
|
|
34
|
+
[GalaxyTheme.LIGHT]: GALAXY_LIGHT_THEME
|
|
40
35
|
};
|
|
41
36
|
var DEFAULT_THEME = GALAXY_DARK_THEME;
|
|
42
37
|
//#endregion
|
|
43
|
-
export { DEFAULT_THEME, GALAXY_DARK_THEME, GALAXY_LIGHT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_OPTIONS, GALAXY_THEME_STORAGE_KEY
|
|
38
|
+
export { DEFAULT_THEME, GALAXY_DARK_THEME, GALAXY_LIGHT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_OPTIONS, GALAXY_THEME_STORAGE_KEY };
|
package/dist/theme/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { GalaxyTheme } from "./types.js";
|
|
1
2
|
import { GALAXY_FONT } from "./typography.js";
|
|
2
3
|
import { GALAXY_DARK_COLOR } from "./variants/dark.js";
|
|
3
4
|
import { GALAXY_LIGHT_COLOR } from "./variants/light.js";
|
|
4
|
-
import { DEFAULT_THEME, GALAXY_DARK_THEME, GALAXY_LIGHT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_OPTIONS, GALAXY_THEME_STORAGE_KEY
|
|
5
|
+
import { DEFAULT_THEME, GALAXY_DARK_THEME, GALAXY_LIGHT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_OPTIONS, GALAXY_THEME_STORAGE_KEY } from "./constants.js";
|
|
5
6
|
import { BrowserThemeDetector, GalaxyThemeProvider, ThemeProvider, useGalaxyTheme, useTheme, withTheme } from "./GalaxyTheme.js";
|
|
6
7
|
export { BrowserThemeDetector, DEFAULT_THEME, GALAXY_DARK_COLOR, GALAXY_DARK_THEME, GALAXY_FONT, GALAXY_LIGHT_COLOR, GALAXY_LIGHT_THEME, GALAXY_THEME_MAP, GALAXY_THEME_OPTIONS, GALAXY_THEME_STORAGE_KEY, GalaxyTheme, GalaxyThemeProvider, ThemeProvider, useGalaxyTheme, useTheme, withTheme };
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** Theme preference. `SYSTEM` follows the OS and resolves to `DARK` or `LIGHT`. */
|
|
2
|
+
export declare enum GalaxyTheme {
|
|
3
|
+
SYSTEM = "SYSTEM",
|
|
4
|
+
DARK = "DARK",
|
|
5
|
+
LIGHT = "LIGHT"
|
|
6
|
+
}
|
|
7
|
+
/** Text colors. Target of `TextVariant`; `*Alt` inverts against the theme. */
|
|
1
8
|
export type ThemeTextColor = {
|
|
2
9
|
primary: string;
|
|
3
10
|
primaryAlt: string;
|
|
@@ -20,6 +27,7 @@ export type ThemeTextColor = {
|
|
|
20
27
|
galaxy: string;
|
|
21
28
|
galaxyAlt: string;
|
|
22
29
|
};
|
|
30
|
+
/** Surface colors. `base`/`primary`/`secondary` are the neutral stack; accents are for status only. */
|
|
23
31
|
export type ThemeBackgroundColor = {
|
|
24
32
|
base: string;
|
|
25
33
|
baseAlt: string;
|
|
@@ -54,6 +62,7 @@ export type ThemeBackgroundColor = {
|
|
|
54
62
|
galaxy: string;
|
|
55
63
|
galaxyAlt: string;
|
|
56
64
|
};
|
|
65
|
+
/** Border colors. Always paired with a `0.5px solid` hairline — DLS uses borders, not shadows. */
|
|
57
66
|
export type ThemeBorderColor = {
|
|
58
67
|
primary: string;
|
|
59
68
|
secondary: string;
|
|
@@ -73,6 +82,7 @@ export type ThemeBorderColor = {
|
|
|
73
82
|
galaxy: string;
|
|
74
83
|
galaxyAlt: string;
|
|
75
84
|
};
|
|
85
|
+
/** Icon colors. Target of `IconVariant`. */
|
|
76
86
|
export type ThemeIconColor = {
|
|
77
87
|
primary: string;
|
|
78
88
|
primaryAlt: string;
|
|
@@ -94,6 +104,7 @@ export type ThemeIconColor = {
|
|
|
94
104
|
galaxy: string;
|
|
95
105
|
galaxyAlt: string;
|
|
96
106
|
};
|
|
107
|
+
/** Black/white overlay tints. `bw<N>` is N% opacity; `*Alt` is the inverse. */
|
|
97
108
|
export type ThemeOpacityColor = {
|
|
98
109
|
bw100: string;
|
|
99
110
|
bw100Alt: string;
|
|
@@ -118,10 +129,12 @@ export type ThemeOpacityColor = {
|
|
|
118
129
|
bw0: string;
|
|
119
130
|
bw0Alt: string;
|
|
120
131
|
};
|
|
132
|
+
/** Numeric font weights. Target of `TextWeight`. */
|
|
121
133
|
export type ThemeFontWeight = {
|
|
122
134
|
regular: number;
|
|
123
135
|
medium: number;
|
|
124
136
|
};
|
|
137
|
+
/** Font sizes per `TextSize` step. */
|
|
125
138
|
export type ThemeFontSize = {
|
|
126
139
|
caption: string;
|
|
127
140
|
body_sm: string;
|
|
@@ -131,6 +144,7 @@ export type ThemeFontSize = {
|
|
|
131
144
|
heading_md: string;
|
|
132
145
|
heading_lg: string;
|
|
133
146
|
};
|
|
147
|
+
/** Line heights per `TextSize` step. */
|
|
134
148
|
export type ThemeFontHeight = {
|
|
135
149
|
caption: string;
|
|
136
150
|
body_sm: string;
|
|
@@ -140,6 +154,7 @@ export type ThemeFontHeight = {
|
|
|
140
154
|
heading_md: string;
|
|
141
155
|
heading_lg: string;
|
|
142
156
|
};
|
|
157
|
+
/** Letter spacing per `TextSize` step. */
|
|
143
158
|
export type ThemeFontSpacing = {
|
|
144
159
|
caption: string;
|
|
145
160
|
body_sm: string;
|
|
@@ -149,6 +164,7 @@ export type ThemeFontSpacing = {
|
|
|
149
164
|
heading_md: string;
|
|
150
165
|
heading_lg: string;
|
|
151
166
|
};
|
|
167
|
+
/** One font family plus its full metric scale. */
|
|
152
168
|
export type ThemeFont = {
|
|
153
169
|
family: string;
|
|
154
170
|
weight: ThemeFontWeight;
|
|
@@ -156,6 +172,10 @@ export type ThemeFont = {
|
|
|
156
172
|
height: ThemeFontHeight;
|
|
157
173
|
spacing: ThemeFontSpacing;
|
|
158
174
|
};
|
|
175
|
+
/**
|
|
176
|
+
* The resolved token set for the active theme. Reach it via `useGalaxyTheme()`,
|
|
177
|
+
* or as the `theme` prop inside a `withTheme(styled.x)` component.
|
|
178
|
+
*/
|
|
159
179
|
export type Theme = {
|
|
160
180
|
color: {
|
|
161
181
|
text: ThemeTextColor;
|
|
@@ -169,6 +189,7 @@ export type Theme = {
|
|
|
169
189
|
mono: ThemeFont;
|
|
170
190
|
};
|
|
171
191
|
};
|
|
192
|
+
/** Adds the injected `theme` prop to a styled component's own props. */
|
|
172
193
|
export type PropsWithTheme<P = unknown> = P & {
|
|
173
194
|
theme: Theme;
|
|
174
195
|
};
|
package/dist/theme/types.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/theme/types.ts
|
|
2
|
+
/** Theme preference. `SYSTEM` follows the OS and resolves to `DARK` or `LIGHT`. */
|
|
3
|
+
var GalaxyTheme = /* @__PURE__ */ function(GalaxyTheme) {
|
|
4
|
+
GalaxyTheme["SYSTEM"] = "SYSTEM";
|
|
5
|
+
GalaxyTheme["DARK"] = "DARK";
|
|
6
|
+
GalaxyTheme["LIGHT"] = "LIGHT";
|
|
7
|
+
return GalaxyTheme;
|
|
8
|
+
}({});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { GalaxyTheme };
|
package/dist/toast/Toast.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Icon as PhosphorIcon } from "@phosphor-icons/react";
|
|
2
2
|
import { ButtonProps } from "../buttons/Button";
|
|
3
|
+
/** Severity. Sets the border tint and the default icon. */
|
|
3
4
|
export declare enum ToastVariant {
|
|
4
5
|
PRIMARY = "PRIMARY",
|
|
5
6
|
SUCCESS = "SUCCESS",
|
|
@@ -7,12 +8,22 @@ export declare enum ToastVariant {
|
|
|
7
8
|
ERROR = "ERROR"
|
|
8
9
|
}
|
|
9
10
|
export interface ToastProps {
|
|
11
|
+
/** @default ToastVariant.PRIMARY */
|
|
10
12
|
variant?: ToastVariant;
|
|
13
|
+
/** Overrides the icon the variant would pick. Pass the component, not an element. */
|
|
11
14
|
icon?: PhosphorIcon;
|
|
15
|
+
/** Headline. A string is wrapped in `Text`; a node renders as-is. */
|
|
12
16
|
header: string | React.ReactNode;
|
|
17
|
+
/** Supporting line under the header. */
|
|
13
18
|
subheader: string | React.ReactNode;
|
|
19
|
+
/** Buttons in a row along the bottom. Each entry is full `ButtonProps`. */
|
|
14
20
|
actions?: ButtonProps[];
|
|
21
|
+
/** Adds a dismiss ×. `ToastProvider` supplies this — don't set it by hand. */
|
|
15
22
|
onClose?: () => void;
|
|
16
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* The toast card itself. You rarely render this directly — call `showToast`
|
|
26
|
+
* from `useToast()` and let `ToastProvider` mount, stack and time it out.
|
|
27
|
+
*/
|
|
17
28
|
declare const Toast: ({ variant, icon, header, subheader, actions, onClose, }: ToastProps) => import("react").JSX.Element;
|
|
18
29
|
export default Toast;
|
package/dist/toast/Toast.js
CHANGED
|
@@ -10,6 +10,7 @@ import { match } from "ts-pattern";
|
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { CheckCircleIcon, SpinnerGapIcon, WarningIcon, XIcon } from "@phosphor-icons/react";
|
|
12
12
|
//#region src/toast/Toast.tsx
|
|
13
|
+
/** Severity. Sets the border tint and the default icon. */
|
|
13
14
|
var ToastVariant = /* @__PURE__ */ function(ToastVariant) {
|
|
14
15
|
ToastVariant["PRIMARY"] = "PRIMARY";
|
|
15
16
|
ToastVariant["SUCCESS"] = "SUCCESS";
|
|
@@ -30,6 +31,10 @@ var StyledToast = withTheme(/*#__PURE__*/ styled("div")({
|
|
|
30
31
|
"sgmrm4-2": [_exp3()]
|
|
31
32
|
}
|
|
32
33
|
}));
|
|
34
|
+
/**
|
|
35
|
+
* The toast card itself. You rarely render this directly — call `showToast`
|
|
36
|
+
* from `useToast()` and let `ToastProvider` mount, stack and time it out.
|
|
37
|
+
*/
|
|
33
38
|
var Toast = ({ variant = "PRIMARY", icon, header, subheader, actions, onClose }) => {
|
|
34
39
|
const renderIcon = () => {
|
|
35
40
|
if (icon) return /* @__PURE__ */ jsx(Icon, {
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
import { ToastVariant, type ToastProps } from "./Toast";
|
|
3
|
+
/** What you pass to `showToast`. Every `ToastProps` field except `onClose`, which the provider owns. */
|
|
3
4
|
export type ShowToastProps = Omit<ToastProps, "onClose"> & {
|
|
5
|
+
/** Milliseconds before auto-dismiss. Pass `0` to make it stay. @default 3000 */
|
|
4
6
|
timeout?: number;
|
|
7
|
+
/** Viewport offset. Toasts sharing the same four values stack together. */
|
|
5
8
|
top?: number | string;
|
|
6
9
|
left?: number | string;
|
|
7
10
|
right?: number | string;
|
|
8
11
|
bottom?: number | string;
|
|
9
12
|
};
|
|
10
13
|
export interface ToastContextProps {
|
|
14
|
+
/** Queue a toast. Returns its id, for dismissing it early via `hideToast`. */
|
|
11
15
|
showToast: (options: ShowToastProps) => string;
|
|
16
|
+
/** Dismiss one toast by id, or every toast when called with no argument. */
|
|
12
17
|
hideToast: (id?: string) => void;
|
|
13
18
|
}
|
|
14
19
|
export declare const ToastContext: import("react").Context<ToastContextProps | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Owns the toast queue. Mount it once near the root, then call `showToast` from
|
|
22
|
+
* `useToast()` anywhere below. Handles stacking, timers and dismissal.
|
|
23
|
+
*/
|
|
15
24
|
export declare const ToastProvider: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
16
25
|
export { ToastVariant };
|
|
@@ -16,6 +16,10 @@ var positionKey = (toast) => JSON.stringify([
|
|
|
16
16
|
toast.bottom,
|
|
17
17
|
toast.left
|
|
18
18
|
]);
|
|
19
|
+
/**
|
|
20
|
+
* Owns the toast queue. Mount it once near the root, then call `showToast` from
|
|
21
|
+
* `useToast()` anywhere below. Handles stacking, timers and dismissal.
|
|
22
|
+
*/
|
|
19
23
|
var ToastProvider = ({ children }) => {
|
|
20
24
|
const [toasts, setToasts] = useState([]);
|
|
21
25
|
const timeoutRefs = useRef(/* @__PURE__ */ new Map());
|
package/dist/toast/useToast.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `{ showToast, hideToast }`. `showToast` returns the new toast's id,
|
|
3
|
+
* which you can pass to `hideToast` to dismiss that one early — call it with no
|
|
4
|
+
* argument to clear them all.
|
|
5
|
+
*
|
|
6
|
+
* Throws when called outside a `ToastProvider`.
|
|
7
|
+
*/
|
|
1
8
|
export declare const useToast: () => import("./ToastProvider").ToastContextProps;
|
package/dist/toast/useToast.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ToastContext } from "./ToastProvider.js";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
//#region src/toast/useToast.ts
|
|
4
|
+
/**
|
|
5
|
+
* Returns `{ showToast, hideToast }`. `showToast` returns the new toast's id,
|
|
6
|
+
* which you can pass to `hideToast` to dismiss that one early — call it with no
|
|
7
|
+
* argument to clear them all.
|
|
8
|
+
*
|
|
9
|
+
* Throws when called outside a `ToastProvider`.
|
|
10
|
+
*/
|
|
4
11
|
var useToast = () => {
|
|
5
12
|
const context = useContext(ToastContext);
|
|
6
13
|
if (!context) throw new Error("useToast must be used within a ToastProvider");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
/** Placement relative to the trigger. The `AUTO_*` values pick a side that fits. */
|
|
2
3
|
export declare enum TooltipPosition {
|
|
3
4
|
TOP = "top",
|
|
4
5
|
BOTTOM = "bottom",
|
|
@@ -16,22 +17,39 @@ export declare enum TooltipPosition {
|
|
|
16
17
|
AUTO_START = "auto-start",
|
|
17
18
|
AUTO_END = "auto-end"
|
|
18
19
|
}
|
|
20
|
+
/** Surface treatment of the tooltip bubble. */
|
|
19
21
|
export declare enum TooltipVariant {
|
|
20
22
|
BASE = "BASE",
|
|
21
23
|
PRIMARY = "PRIMARY",
|
|
22
24
|
SECONDARY = "SECONDARY",
|
|
23
25
|
TERTIARY = "TERTIARY"
|
|
24
26
|
}
|
|
25
|
-
interface TooltipProps {
|
|
27
|
+
export interface TooltipProps {
|
|
28
|
+
/** Tooltip content. A string is wrapped in `Text`; a node renders as-is. */
|
|
26
29
|
body: string | React.ReactNode;
|
|
30
|
+
/** @default TooltipVariant.SECONDARY */
|
|
27
31
|
variant?: TooltipVariant;
|
|
32
|
+
/** @default TooltipPosition.TOP */
|
|
28
33
|
position?: TooltipPosition;
|
|
34
|
+
/** Milliseconds to hover before it appears. @default 0 */
|
|
29
35
|
delay?: number;
|
|
36
|
+
/** `[skidding, distance]` in px from the trigger. @default [0, 4] */
|
|
30
37
|
offset?: [number, number];
|
|
38
|
+
/** Keep it open while the pointer is over it, so links inside stay reachable. */
|
|
31
39
|
isInteractive?: boolean;
|
|
40
|
+
/** Drop the 8px inset — for tooltips that host their own layout. */
|
|
32
41
|
noPadding?: boolean;
|
|
42
|
+
/** Drop the hairline border. */
|
|
33
43
|
noBorder?: boolean;
|
|
44
|
+
/** Render children bare, with no tooltip at all. */
|
|
34
45
|
isDisabled?: boolean;
|
|
35
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Wraps a trigger and shows `body` on hover or keyboard focus. Children are the
|
|
49
|
+
* trigger, wrapped in an inline-block span.
|
|
50
|
+
*
|
|
51
|
+
* Sits at z-index 10000, above modals and drawers. Set `isInteractive` if the
|
|
52
|
+
* body contains anything clickable.
|
|
53
|
+
*/
|
|
36
54
|
declare const Tooltip: ({ children, variant, body, position, delay, offset, isInteractive, noPadding, noBorder, isDisabled, }: PropsWithChildren<TooltipProps>) => string | number | boolean | Iterable<import("react").ReactNode> | import("react").JSX.Element | null | undefined;
|
|
37
55
|
export default Tooltip;
|
package/dist/tooltip/Tooltip.js
CHANGED
|
@@ -6,6 +6,7 @@ import { match } from "ts-pattern";
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import Tippy from "@tippyjs/react";
|
|
8
8
|
//#region src/tooltip/Tooltip.tsx
|
|
9
|
+
/** Placement relative to the trigger. The `AUTO_*` values pick a side that fits. */
|
|
9
10
|
var TooltipPosition = /* @__PURE__ */ function(TooltipPosition) {
|
|
10
11
|
TooltipPosition["TOP"] = "top";
|
|
11
12
|
TooltipPosition["BOTTOM"] = "bottom";
|
|
@@ -24,6 +25,7 @@ var TooltipPosition = /* @__PURE__ */ function(TooltipPosition) {
|
|
|
24
25
|
TooltipPosition["AUTO_END"] = "auto-end";
|
|
25
26
|
return TooltipPosition;
|
|
26
27
|
}({});
|
|
28
|
+
/** Surface treatment of the tooltip bubble. */
|
|
27
29
|
var TooltipVariant = /* @__PURE__ */ function(TooltipVariant) {
|
|
28
30
|
TooltipVariant["BASE"] = "BASE";
|
|
29
31
|
TooltipVariant["PRIMARY"] = "PRIMARY";
|
|
@@ -54,6 +56,13 @@ var TooltipContent = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
54
56
|
"tjda4tq-2": [_exp3()]
|
|
55
57
|
}
|
|
56
58
|
}));
|
|
59
|
+
/**
|
|
60
|
+
* Wraps a trigger and shows `body` on hover or keyboard focus. Children are the
|
|
61
|
+
* trigger, wrapped in an inline-block span.
|
|
62
|
+
*
|
|
63
|
+
* Sits at z-index 10000, above modals and drawers. Set `isInteractive` if the
|
|
64
|
+
* body contains anything clickable.
|
|
65
|
+
*/
|
|
57
66
|
var Tooltip = ({ children, variant = "SECONDARY", body, position = "top", delay = 0, offset = [0, 4], isInteractive = false, noPadding = false, noBorder = false, isDisabled = false }) => {
|
|
58
67
|
if (isDisabled) return children;
|
|
59
68
|
return /* @__PURE__ */ jsx(Tippy, {
|
package/dist/transform/Fade.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
2
|
export interface FadeProps {
|
|
3
|
+
/** Seconds to wait before starting. @default 0 */
|
|
3
4
|
delay?: number;
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Fades children in on mount and out on unmount, over 200ms.
|
|
8
|
+
*
|
|
9
|
+
* The exit half only runs inside a framer-motion `AnimatePresence`. Fills its
|
|
10
|
+
* parent (100% × 100%).
|
|
11
|
+
*/
|
|
5
12
|
declare const Fade: ({ children, delay }: PropsWithChildren<FadeProps>) => import("react").JSX.Element;
|
|
6
13
|
export default Fade;
|
package/dist/transform/Fade.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { motion } from "framer-motion";
|
|
3
3
|
//#region src/transform/Fade.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Fades children in on mount and out on unmount, over 200ms.
|
|
6
|
+
*
|
|
7
|
+
* The exit half only runs inside a framer-motion `AnimatePresence`. Fills its
|
|
8
|
+
* parent (100% × 100%).
|
|
9
|
+
*/
|
|
4
10
|
var Fade = ({ children, delay = 0 }) => {
|
|
5
11
|
return /* @__PURE__ */ jsx(motion.div, {
|
|
6
12
|
initial: { opacity: 0 },
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Pulses children between full and 40% opacity, forever, on a 1s cycle.
|
|
4
|
+
* Signals "in progress" — pair it with a real completion state.
|
|
5
|
+
*/
|
|
2
6
|
declare const Flash: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
3
7
|
export default Flash;
|
package/dist/transform/Flash.js
CHANGED
|
@@ -7,6 +7,10 @@ var StyledFlash = /*#__PURE__*/ styled("span")({
|
|
|
7
7
|
class: "s18o9ih0",
|
|
8
8
|
propsAsIs: false
|
|
9
9
|
});
|
|
10
|
+
/**
|
|
11
|
+
* Pulses children between full and 40% opacity, forever, on a 1s cycle.
|
|
12
|
+
* Signals "in progress" — pair it with a real completion state.
|
|
13
|
+
*/
|
|
10
14
|
var Flash = ({ children }) => {
|
|
11
15
|
return /* @__PURE__ */ jsx(StyledFlash, { children });
|
|
12
16
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
2
|
export interface RotateProps {
|
|
3
|
+
/** Rotated to `deg` when true, back to 0 when false. */
|
|
3
4
|
isRotated: boolean;
|
|
5
|
+
/** Angle in degrees at the rotated end. @default 180 */
|
|
4
6
|
deg?: number;
|
|
7
|
+
/** Transition duration in seconds. @default 0.075 */
|
|
5
8
|
speed?: number;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Tweens children between 0° and `deg` as `isRotated` flips. State-driven, not
|
|
12
|
+
* looping — the usual case is a chevron on an expand/collapse toggle.
|
|
13
|
+
*/
|
|
7
14
|
declare const Rotate: ({ children, isRotated, deg, speed }: PropsWithChildren<RotateProps>) => import("react").JSX.Element;
|
|
8
15
|
export default Rotate;
|
package/dist/transform/Rotate.js
CHANGED
|
@@ -16,6 +16,10 @@ var RotateWrapper = /*#__PURE__*/ styled("div")({
|
|
|
16
16
|
"r530s5l-1": [_exp2()]
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
/**
|
|
20
|
+
* Tweens children between 0° and `deg` as `isRotated` flips. State-driven, not
|
|
21
|
+
* looping — the usual case is a chevron on an expand/collapse toggle.
|
|
22
|
+
*/
|
|
19
23
|
var Rotate = ({ children, isRotated, deg = 180, speed }) => {
|
|
20
24
|
return /* @__PURE__ */ jsx(RotateWrapper, {
|
|
21
25
|
$isRotated: isRotated,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
2
|
export interface ScaleFadeProps {
|
|
3
|
+
/** Seconds to wait before starting. @default 0 */
|
|
3
4
|
delay?: number;
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Fades children in while scaling from 95% to 100%, over 200ms. The entrance for
|
|
8
|
+
* things that pop: menus, popovers, toasts.
|
|
9
|
+
*
|
|
10
|
+
* The exit half only runs inside a framer-motion `AnimatePresence`.
|
|
11
|
+
*/
|
|
5
12
|
declare const ScaleFade: ({ children, delay }: PropsWithChildren<ScaleFadeProps>) => import("react").JSX.Element;
|
|
6
13
|
export default ScaleFade;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { motion } from "framer-motion";
|
|
3
3
|
//#region src/transform/ScaleFade.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Fades children in while scaling from 95% to 100%, over 200ms. The entrance for
|
|
6
|
+
* things that pop: menus, popovers, toasts.
|
|
7
|
+
*
|
|
8
|
+
* The exit half only runs inside a framer-motion `AnimatePresence`.
|
|
9
|
+
*/
|
|
4
10
|
var ScaleFade = ({ children, delay = 0 }) => {
|
|
5
11
|
return /* @__PURE__ */ jsx(motion.div, {
|
|
6
12
|
initial: {
|
package/dist/transform/Spin.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
2
|
export interface SpinProps {
|
|
3
|
+
/** Rotations per second. Higher is faster. @default 1 */
|
|
3
4
|
speed?: number;
|
|
5
|
+
/** @default true */
|
|
4
6
|
isSpinning?: boolean;
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Rotates children continuously — the loading spinner, usually wrapping an
|
|
10
|
+
* `Icon`. When `isSpinning` is false the children render bare, with no wrapper
|
|
11
|
+
* element, so toggling it does not shift layout.
|
|
12
|
+
*/
|
|
6
13
|
declare const Spin: ({ children, speed, isSpinning }: PropsWithChildren<SpinProps>) => import("react").JSX.Element;
|
|
7
14
|
export default Spin;
|
package/dist/transform/Spin.js
CHANGED
|
@@ -9,6 +9,11 @@ var StyledSpin = /*#__PURE__*/ styled("div")({
|
|
|
9
9
|
propsAsIs: false,
|
|
10
10
|
vars: { "sonzivr-0": [_exp(), "s"] }
|
|
11
11
|
});
|
|
12
|
+
/**
|
|
13
|
+
* Rotates children continuously — the loading spinner, usually wrapping an
|
|
14
|
+
* `Icon`. When `isSpinning` is false the children render bare, with no wrapper
|
|
15
|
+
* element, so toggling it does not shift layout.
|
|
16
|
+
*/
|
|
12
17
|
var Spin = ({ children, speed = 1, isSpinning = true }) => {
|
|
13
18
|
if (isSpinning) return /* @__PURE__ */ jsx(StyledSpin, {
|
|
14
19
|
$speed: speed,
|