@liketysplit/react-luna 0.1.2 → 0.1.3
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/LICENSE +9 -9
- package/dist/components/index.d.ts +1 -0
- package/dist/components/luna-button/LunaButton.d.ts +28 -0
- package/dist/components/luna-button/LunaButton.props.d.ts +30 -0
- package/dist/components/luna-button/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/theme/base.d.ts +2 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/merge.d.ts +2 -0
- package/dist/theme/provider.d.ts +19 -0
- package/dist/theme/resolve.d.ts +5 -0
- package/dist/theme/types.d.ts +87 -0
- package/dist/theme/vars.d.ts +2 -0
- package/package.json +67 -67
package/LICENSE
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
All Rights Reserved
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Rick Boles
|
|
4
|
-
|
|
5
|
-
All rights reserved.
|
|
6
|
-
|
|
7
|
-
This source code and associated documentation are proprietary and confidential.
|
|
8
|
-
Unauthorized copying, modification, distribution, or use of this software,
|
|
9
|
-
in whole or in part, is strictly prohibited without prior written permission
|
|
1
|
+
All Rights Reserved
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rick Boles
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
This source code and associated documentation are proprietary and confidential.
|
|
8
|
+
Unauthorized copying, modification, distribution, or use of this software,
|
|
9
|
+
in whole or in part, is strictly prohibited without prior written permission
|
|
10
10
|
from the copyright holder.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./luna-button";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LunaButton.css";
|
|
3
|
+
export declare const LunaButton: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "color" | "size"> & {
|
|
4
|
+
absolute?: boolean;
|
|
5
|
+
animation?: import("./LunaButton.props").LunaButtonAnimation;
|
|
6
|
+
block?: boolean;
|
|
7
|
+
bottom?: boolean | string | number;
|
|
8
|
+
color?: string;
|
|
9
|
+
dark?: boolean;
|
|
10
|
+
depressed?: boolean;
|
|
11
|
+
fixed?: boolean;
|
|
12
|
+
flat?: boolean;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
iconDirection?: import("./LunaButton.props").LunaButtonIconDirection;
|
|
15
|
+
iconName?: string;
|
|
16
|
+
info?: boolean;
|
|
17
|
+
left?: boolean | string | number;
|
|
18
|
+
light?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
loadingAnimation?: import("./LunaButton.props").LunaButtonLoadingAnimation;
|
|
21
|
+
outline?: boolean;
|
|
22
|
+
right?: boolean | string | number;
|
|
23
|
+
rounded?: boolean;
|
|
24
|
+
size?: string;
|
|
25
|
+
top?: boolean | string | number;
|
|
26
|
+
value?: React.ReactNode;
|
|
27
|
+
fab?: boolean;
|
|
28
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type LunaButtonAnimation = string;
|
|
3
|
+
export type LunaButtonIconDirection = "left" | "right";
|
|
4
|
+
export type LunaButtonLoadingAnimation = "lunar" | "loading-star";
|
|
5
|
+
export type LunaButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "size" | "value"> & {
|
|
6
|
+
absolute?: boolean;
|
|
7
|
+
animation?: LunaButtonAnimation;
|
|
8
|
+
block?: boolean;
|
|
9
|
+
bottom?: boolean | string | number;
|
|
10
|
+
color?: string;
|
|
11
|
+
dark?: boolean;
|
|
12
|
+
depressed?: boolean;
|
|
13
|
+
fixed?: boolean;
|
|
14
|
+
flat?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
iconDirection?: LunaButtonIconDirection;
|
|
17
|
+
iconName?: string;
|
|
18
|
+
info?: boolean;
|
|
19
|
+
left?: boolean | string | number;
|
|
20
|
+
light?: boolean;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
loadingAnimation?: LunaButtonLoadingAnimation;
|
|
23
|
+
outline?: boolean;
|
|
24
|
+
right?: boolean | string | number;
|
|
25
|
+
rounded?: boolean;
|
|
26
|
+
size?: string;
|
|
27
|
+
top?: boolean | string | number;
|
|
28
|
+
value?: React.ReactNode;
|
|
29
|
+
fab?: boolean;
|
|
30
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DeepPartial, Theme, ThemeMode } from "./types";
|
|
3
|
+
export type ThemeProviderProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
mode?: ThemeMode;
|
|
6
|
+
theme?: DeepPartial<Theme>;
|
|
7
|
+
colors?: Record<string, string>;
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
type ThemeContextValue = {
|
|
12
|
+
theme: Theme;
|
|
13
|
+
mode: ThemeMode;
|
|
14
|
+
vars: Record<string, string>;
|
|
15
|
+
setMode: (mode: ThemeMode) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function ThemeProvider({ children, mode: controlledMode, theme, colors, className, style }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function useTheme(): ThemeContextValue;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Theme, ThemeMode, ThemeModeTokens } from "./types";
|
|
2
|
+
export declare function isRawColor(value: string): boolean;
|
|
3
|
+
export declare function resolveTokenValue(theme: Theme, token: string): string;
|
|
4
|
+
export declare function resolveModeTokens(theme: Theme, mode: ThemeMode): ThemeModeTokens;
|
|
5
|
+
export declare function resolveScaleValue(scale: Record<string, string>, value?: string): string | undefined;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type ColorScale = {
|
|
2
|
+
50: string;
|
|
3
|
+
100: string;
|
|
4
|
+
200: string;
|
|
5
|
+
300: string;
|
|
6
|
+
400: string;
|
|
7
|
+
500: string;
|
|
8
|
+
600: string;
|
|
9
|
+
700: string;
|
|
10
|
+
800: string;
|
|
11
|
+
900: string;
|
|
12
|
+
};
|
|
13
|
+
export type ThemeColors = {
|
|
14
|
+
scale: Record<string, ColorScale>;
|
|
15
|
+
custom: Record<string, string>;
|
|
16
|
+
};
|
|
17
|
+
export type ThemeModeTokens = {
|
|
18
|
+
background: string;
|
|
19
|
+
foreground: string;
|
|
20
|
+
surface: string;
|
|
21
|
+
border: string;
|
|
22
|
+
muted: string;
|
|
23
|
+
};
|
|
24
|
+
export type ThemeModes = {
|
|
25
|
+
light: ThemeModeTokens;
|
|
26
|
+
dark: ThemeModeTokens;
|
|
27
|
+
};
|
|
28
|
+
export type ThemeTypography = {
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
sizes: Record<string, string>;
|
|
31
|
+
weights: Record<string, number>;
|
|
32
|
+
lineHeights: Record<string, string>;
|
|
33
|
+
};
|
|
34
|
+
export type ThemeSpacing = Record<string, string>;
|
|
35
|
+
export type ThemeRadii = Record<string, string>;
|
|
36
|
+
export type ThemeShadows = Record<string, string>;
|
|
37
|
+
export type ThemeMotion = Record<string, string>;
|
|
38
|
+
export type ThemeButtonSizeProfile = {
|
|
39
|
+
paddingX?: string;
|
|
40
|
+
paddingY?: string;
|
|
41
|
+
fontSize?: string;
|
|
42
|
+
minHeight?: string;
|
|
43
|
+
gap?: string;
|
|
44
|
+
iconSize?: string;
|
|
45
|
+
};
|
|
46
|
+
export type ThemeButtonModeTokens = {
|
|
47
|
+
bg?: string;
|
|
48
|
+
fg?: string;
|
|
49
|
+
hoverBg?: string;
|
|
50
|
+
outlineFg?: string;
|
|
51
|
+
outlineBorder?: string;
|
|
52
|
+
outlineHoverBg?: string;
|
|
53
|
+
flatFg?: string;
|
|
54
|
+
infoFg?: string;
|
|
55
|
+
infoHoverFg?: string;
|
|
56
|
+
};
|
|
57
|
+
export type ThemeComponents = {
|
|
58
|
+
button?: {
|
|
59
|
+
defaultSize?: string;
|
|
60
|
+
defaultIconDirection?: "left" | "right";
|
|
61
|
+
radius?: string;
|
|
62
|
+
fontWeight?: number;
|
|
63
|
+
sizes?: Record<string, ThemeButtonSizeProfile>;
|
|
64
|
+
modes?: Partial<Record<ThemeMode, ThemeButtonModeTokens>>;
|
|
65
|
+
colors?: Record<string, {
|
|
66
|
+
bg?: string;
|
|
67
|
+
fg?: string;
|
|
68
|
+
border?: string;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type Theme = {
|
|
73
|
+
colors: ThemeColors;
|
|
74
|
+
modes: ThemeModes;
|
|
75
|
+
typography: ThemeTypography;
|
|
76
|
+
spacing: ThemeSpacing;
|
|
77
|
+
radii: ThemeRadii;
|
|
78
|
+
shadows: ThemeShadows;
|
|
79
|
+
motion: ThemeMotion;
|
|
80
|
+
components: ThemeComponents;
|
|
81
|
+
};
|
|
82
|
+
export type ThemeMode = "light" | "dark";
|
|
83
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
84
|
+
export type DeepPartial<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : {
|
|
85
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@liketysplit/react-luna",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "Self-sufficient React component library with a lunar theme.",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"module": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"README.md",
|
|
13
|
-
"LICENSE"
|
|
14
|
-
],
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"import": "./dist/index.js"
|
|
19
|
-
},
|
|
20
|
-
"./styles.css": "./dist/style.css"
|
|
21
|
-
},
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/liketysplit/react-luna.git"
|
|
25
|
-
},
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/liketysplit/react-luna/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/liketysplit/react-luna#readme",
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"access": "public"
|
|
32
|
-
},
|
|
33
|
-
"scripts": {
|
|
34
|
-
"dev": "vite",
|
|
35
|
-
"build": "tsc -p tsconfig.build.json && vite build",
|
|
36
|
-
"preview": "vite preview",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
-
"test:watch": "vitest",
|
|
39
|
-
"changeset": "changeset",
|
|
40
|
-
"version-packages": "changeset version",
|
|
41
|
-
"release": "changeset publish",
|
|
42
|
-
"storybook": "storybook dev -p 6006",
|
|
43
|
-
"storybook:build": "storybook build"
|
|
44
|
-
},
|
|
45
|
-
"peerDependencies": {
|
|
46
|
-
"react": ">=18.0.0",
|
|
47
|
-
"react-dom": ">=18.0.0"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@storybook/addon-essentials": "^8.5.0",
|
|
51
|
-
"@storybook/react": "^8.5.0",
|
|
52
|
-
"@storybook/react-vite": "^8.5.0",
|
|
53
|
-
"@changesets/cli": "^2.29.6",
|
|
54
|
-
"@testing-library/jest-dom": "^6.9.1",
|
|
55
|
-
"@testing-library/react": "^16.3.2",
|
|
56
|
-
"@testing-library/user-event": "^14.6.1",
|
|
57
|
-
"@types/react": "^18.2.0",
|
|
58
|
-
"@types/react-dom": "^18.2.0",
|
|
59
|
-
"@vitejs/plugin-react": "^4.3.0",
|
|
60
|
-
"jsdom": "^24.1.3",
|
|
61
|
-
"react": "^18.2.0",
|
|
62
|
-
"react-dom": "^18.2.0",
|
|
63
|
-
"typescript": "^5.5.0",
|
|
64
|
-
"vite": "^5.4.0",
|
|
65
|
-
"vitest": "^2.0.0"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@liketysplit/react-luna",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Self-sufficient React component library with a lunar theme.",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./styles.css": "./dist/style.css"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/liketysplit/react-luna.git"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/liketysplit/react-luna/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/liketysplit/react-luna#readme",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
35
|
+
"build": "tsc -p tsconfig.build.json && vite build",
|
|
36
|
+
"preview": "vite preview",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"changeset": "changeset",
|
|
40
|
+
"version-packages": "changeset version",
|
|
41
|
+
"release": "changeset publish",
|
|
42
|
+
"storybook": "storybook dev -p 6006",
|
|
43
|
+
"storybook:build": "storybook build"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": ">=18.0.0",
|
|
47
|
+
"react-dom": ">=18.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@storybook/addon-essentials": "^8.5.0",
|
|
51
|
+
"@storybook/react": "^8.5.0",
|
|
52
|
+
"@storybook/react-vite": "^8.5.0",
|
|
53
|
+
"@changesets/cli": "^2.29.6",
|
|
54
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
55
|
+
"@testing-library/react": "^16.3.2",
|
|
56
|
+
"@testing-library/user-event": "^14.6.1",
|
|
57
|
+
"@types/react": "^18.2.0",
|
|
58
|
+
"@types/react-dom": "^18.2.0",
|
|
59
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
60
|
+
"jsdom": "^24.1.3",
|
|
61
|
+
"react": "^18.2.0",
|
|
62
|
+
"react-dom": "^18.2.0",
|
|
63
|
+
"typescript": "^5.5.0",
|
|
64
|
+
"vite": "^5.4.0",
|
|
65
|
+
"vitest": "^2.0.0"
|
|
66
|
+
}
|
|
67
|
+
}
|