@liketysplit/react-luna 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/luna-avatar/LunaAvatar.d.ts +11 -0
- package/dist/components/luna-avatar/LunaAvatar.props.d.ts +10 -0
- package/dist/components/luna-avatar/index.d.ts +2 -0
- package/dist/components/luna-date-input/LunaDateInput.d.ts +10 -0
- package/dist/components/luna-date-input/LunaDateInput.props.d.ts +9 -0
- package/dist/components/luna-date-input/index.d.ts +2 -0
- package/dist/components/luna-date-picker/LunaDatePicker.d.ts +4 -0
- package/dist/components/luna-date-picker/LunaDatePicker.props.d.ts +28 -0
- package/dist/components/luna-date-picker/dateUtils.d.ts +19 -0
- package/dist/components/luna-date-picker/index.d.ts +2 -0
- package/dist/components/luna-slider/LunaSlider.d.ts +9 -0
- package/dist/components/luna-slider/LunaSlider.props.d.ts +8 -0
- package/dist/components/luna-slider/index.d.ts +2 -0
- package/dist/components/luna-switch/LunaSwitch.d.ts +8 -0
- package/dist/components/luna-switch/LunaSwitch.props.d.ts +7 -0
- package/dist/components/luna-switch/index.d.ts +2 -0
- package/dist/index.js +2579 -1677
- package/dist/style.css +1 -1
- package/dist/theme/types.d.ts +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
Statement
|
|
4
4
|
@liketysplit/react-luna is a self-sufficient React component library designed to be a durable foundation for personal applications. It targets a clean, lunar aesthetic with a default light and dark theme that can be overridden at the project level after installation.
|
|
5
5
|
|
|
6
|
+
Current direction:
|
|
7
|
+
- treat themeability as a first-class requirement
|
|
8
|
+
- use `LunaButton` as the baseline contract example for primitive quality
|
|
9
|
+
- keep primitives durable enough that downstream projects can make the library feel like their own
|
|
10
|
+
|
|
6
11
|
Goals
|
|
7
12
|
- Provide a complete set of reusable UI primitives and layouts.
|
|
8
13
|
- Keep the library independent from third-party UI frameworks.
|
|
9
14
|
- Ship a default Lunar theme with light and dark variants.
|
|
10
15
|
- Allow downstream projects to override theme tokens and component styling.
|
|
16
|
+
- Harden component contracts before broadening surface area.
|
|
17
|
+
- Keep Storybook, tests, and public docs aligned with meaningful component changes.
|
|
11
18
|
|
|
12
19
|
Non-goals
|
|
13
20
|
- Depending on external UI component libraries.
|
|
@@ -16,12 +23,25 @@ Design Approach
|
|
|
16
23
|
- Theme tokens first, component styles derived from tokens.
|
|
17
24
|
- Accessible defaults and consistent spacing/typography scales.
|
|
18
25
|
- Clear layering of primitives, composites, and templates.
|
|
26
|
+
- Primitive contracts should be small, explicit, and durable.
|
|
27
|
+
- `LunaButton` is the proving ground for contract quality and theme extensibility.
|
|
19
28
|
|
|
20
29
|
Tooling
|
|
21
30
|
- React for component implementation.
|
|
22
31
|
- Storybook for interactive component exploration and configuration.
|
|
23
32
|
- Changesets for package versioning and release notes.
|
|
24
33
|
|
|
34
|
+
Working Model
|
|
35
|
+
- Use GitHub Issues as the active backlog.
|
|
36
|
+
- Keep repository docs aligned with the actual issue and milestone direction.
|
|
37
|
+
- Treat implementation, Storybook, tests, and docs as one delivery slice when behavior changes.
|
|
38
|
+
|
|
39
|
+
Roadmap Shape
|
|
40
|
+
- `docs/ROADMAP.md` records the release-shape north star.
|
|
41
|
+
- `0.0.x` is for building the needed component base.
|
|
42
|
+
- `0.x.x` is for hardening the library.
|
|
43
|
+
- `1.1.x` is for building a real app with the library and correcting flaws found through actual use.
|
|
44
|
+
|
|
25
45
|
Release Flow
|
|
26
46
|
- Add a changeset with `npm run changeset` for any package change that should affect the published version.
|
|
27
47
|
- Merge to `main`.
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
export * from "./luna-avatar";
|
|
1
2
|
export * from "./luna-button";
|
|
2
3
|
export * from "./luna-card";
|
|
3
4
|
export * from "./luna-checkbox";
|
|
5
|
+
export * from "./luna-date-input";
|
|
6
|
+
export * from "./luna-date-picker";
|
|
4
7
|
export * from "./luna-radio";
|
|
5
8
|
export * from "./luna-divider";
|
|
6
9
|
export * from "./luna-header";
|
|
7
10
|
export * from "./luna-input";
|
|
11
|
+
export * from "./luna-slider";
|
|
8
12
|
export * from "./luna-textarea";
|
|
9
13
|
export * from "./luna-select";
|
|
10
14
|
export * from "./luna-multiselect";
|
|
11
15
|
export * from "./luna-autocomplete";
|
|
16
|
+
export * from "./luna-switch";
|
|
12
17
|
export * from "./luna-text";
|
|
13
18
|
export * from "./luna-row";
|
|
14
19
|
export * from "./luna-column";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LunaAvatar.css";
|
|
3
|
+
export declare const LunaAvatar: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children" | "color"> & {
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
src?: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
initials?: string;
|
|
9
|
+
fallback?: React.ReactNode;
|
|
10
|
+
size?: string;
|
|
11
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type LunaAvatarProps = Omit<React.HTMLAttributes<HTMLElement>, "children" | "color"> & {
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
initials?: string;
|
|
8
|
+
fallback?: React.ReactNode;
|
|
9
|
+
size?: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LunaDateInput.css";
|
|
3
|
+
export declare const LunaDateInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "prefix" | "type"> & {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
externalLabel?: boolean;
|
|
6
|
+
helpText?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
inputSize?: "sm" | "md" | "lg";
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type LunaDateInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "prefix" | "size" | "type"> & {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
externalLabel?: boolean;
|
|
5
|
+
helpText?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
inputSize?: "sm" | "md" | "lg";
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type LunaDateRangeValue = {
|
|
3
|
+
start?: string;
|
|
4
|
+
end?: string;
|
|
5
|
+
};
|
|
6
|
+
type LunaDatePickerBaseProps = {
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
externalLabel?: boolean;
|
|
9
|
+
helpText?: React.ReactNode;
|
|
10
|
+
error?: React.ReactNode;
|
|
11
|
+
inputSize?: "sm" | "md" | "lg";
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
buttonPosition?: "pre" | "post";
|
|
14
|
+
};
|
|
15
|
+
type LunaDatePickerSimpleOrPickerProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "prefix" | "size" | "type" | "value" | "defaultValue" | "onChange"> & LunaDatePickerBaseProps & {
|
|
16
|
+
mode?: "simple" | "picker";
|
|
17
|
+
value?: string;
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
onChange?: (value: string) => void;
|
|
20
|
+
};
|
|
21
|
+
type LunaDatePickerRangeProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "prefix" | "size" | "type" | "value" | "defaultValue" | "onChange"> & LunaDatePickerBaseProps & {
|
|
22
|
+
mode: "range";
|
|
23
|
+
value?: LunaDateRangeValue;
|
|
24
|
+
defaultValue?: LunaDateRangeValue;
|
|
25
|
+
onChange?: (value: LunaDateRangeValue) => void;
|
|
26
|
+
};
|
|
27
|
+
export type LunaDatePickerProps = LunaDatePickerSimpleOrPickerProps | LunaDatePickerRangeProps;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LunaDateRangeValue } from "./LunaDatePicker.props";
|
|
2
|
+
export declare function parseDateValue(value?: string): Date | null;
|
|
3
|
+
export declare function formatDateValue(date: Date): string;
|
|
4
|
+
export declare function formatInputDate(value?: string): string;
|
|
5
|
+
export declare function parseInputDate(value?: string): string | null;
|
|
6
|
+
export declare function formatDisplayDate(value?: string): string;
|
|
7
|
+
export declare function formatDisplayRange(value?: LunaDateRangeValue): string;
|
|
8
|
+
export declare function startOfMonth(date: Date): Date;
|
|
9
|
+
export declare function addMonths(date: Date, amount: number): Date;
|
|
10
|
+
export declare function isSameDay(left: Date | null, right: Date | null): boolean;
|
|
11
|
+
export declare function isBeforeDay(left: Date | null, right: Date | null): boolean;
|
|
12
|
+
export declare function isInRange(date: Date, start: Date | null, end: Date | null): boolean;
|
|
13
|
+
export declare function isOutsideLimits(date: Date, min?: string, max?: string): boolean;
|
|
14
|
+
export declare function buildMonthGrid(visibleMonth: Date): {
|
|
15
|
+
date: Date;
|
|
16
|
+
value: string;
|
|
17
|
+
day: number;
|
|
18
|
+
inMonth: boolean;
|
|
19
|
+
}[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LunaSlider.css";
|
|
3
|
+
export declare const LunaSlider: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
helpText?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
showValue?: boolean;
|
|
9
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type LunaSliderProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
3
|
+
label?: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
helpText?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
showValue?: boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./LunaSwitch.css";
|
|
3
|
+
export declare const LunaSwitch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
helpText?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
} & React.RefAttributes<HTMLInputElement>>;
|