@huponx/x-core-ui 0.1.0 → 0.1.2

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.
@@ -0,0 +1,9 @@
1
+ import type { FieldProps, SelectItem } from "../types";
2
+ export type AutocompleteProps = FieldProps & {
3
+ items: SelectItem[];
4
+ value?: string;
5
+ onValueChange?: (value: string) => void;
6
+ placeholder?: string;
7
+ loading?: boolean;
8
+ };
9
+ export declare function Autocomplete({ items, value, onValueChange, placeholder, loading, label, hint, error, fullWidth, disabled, size, }: AutocompleteProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function CalendarGrid({ value, onSelect, }: {
2
+ value?: Date;
3
+ onSelect?: (day: Date | undefined) => void;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { FieldProps } from "../types";
2
+ export type DatePickerProps = FieldProps & {
3
+ value?: Date;
4
+ onValueChange?: (value: Date | undefined) => void;
5
+ };
6
+ export declare function DatePicker({ value, onValueChange, label, hint, error, fullWidth, disabled, size, }: DatePickerProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { FieldProps } from "../types";
2
+ export type DateTimePickerProps = FieldProps & {
3
+ value?: Date;
4
+ onValueChange?: (value: Date | undefined) => void;
5
+ };
6
+ export declare function DateTimePicker({ value, onValueChange, label, hint, error, fullWidth, disabled, size, }: DateTimePickerProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { FieldProps, SelectItem } from "../types";
2
+ export type DropdownProps = FieldProps & {
3
+ items: SelectItem[];
4
+ value?: string;
5
+ defaultValue?: string;
6
+ onValueChange?: (value: string) => void;
7
+ placeholder?: string;
8
+ };
9
+ export declare function Dropdown({ items, value, defaultValue, onValueChange, placeholder, label, hint, error, fullWidth, disabled, size, }: DropdownProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ export declare function PickerOverlay({ open, onOpenChange, title, trigger, children, }: {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ title: ReactNode;
6
+ trigger: ReactNode;
7
+ children: ReactNode;
8
+ }): import("react").JSX.Element;
9
+ export declare const PickerTrigger: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
10
+ export declare function PickerActions({ children }: {
11
+ children: ReactNode;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare function parseTime(value?: string): {
2
+ hour: string;
3
+ minute: string;
4
+ };
5
+ export declare function TimeField({ value, onChange, collapsible, }: {
6
+ value?: string;
7
+ onChange?: (next: string) => void;
8
+ collapsible?: boolean;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { FieldProps } from "../types";
2
+ export type TimePickerProps = FieldProps & {
3
+ value?: string;
4
+ onValueChange?: (value: string | undefined) => void;
5
+ };
6
+ export declare function TimePicker({ value, onValueChange, label, hint, error, fullWidth, disabled, size, }: TimePickerProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { SelectItem } from "../types";
2
+ export declare function ItemRow({ item, className, }: {
3
+ item: SelectItem;
4
+ className?: string;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ import type { Size } from "../types";
3
+ export type ButtonVariant = "primary" | "ghost" | "danger";
4
+ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ variant?: ButtonVariant;
6
+ size?: Size;
7
+ icon?: ReactNode;
8
+ fullWidth?: boolean;
9
+ };
10
+ export declare function Button({ variant, size, icon, fullWidth, className, children, type, ...props }: ButtonProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from "react";
2
+ import type { FieldProps, Size } from "../types";
3
+ export declare function Field({ label, hint, error, fullWidth, size, children, htmlFor, }: FieldProps & {
4
+ children: ReactNode;
5
+ htmlFor?: string;
6
+ }): import("react").JSX.Element;
7
+ export declare function controlSize(size: Size): string;
8
+ export declare function controlChrome(error?: ReactNode): string;
@@ -0,0 +1,9 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ import type { FieldProps } from "../types";
3
+ export type InputType = "text" | "number";
4
+ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & FieldProps & {
5
+ type?: InputType;
6
+ prefix?: ReactNode;
7
+ suffix?: ReactNode;
8
+ };
9
+ export declare function Input({ type, label, hint, error, fullWidth, disabled, size, prefix, suffix, className, id, value, defaultValue, onChange, ...props }: InputProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function Panel({ title, actions, children, className, }: {
3
+ title?: ReactNode;
4
+ actions?: ReactNode;
5
+ children: ReactNode;
6
+ className?: string;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function ProgressBar({ value, indeterminate, className, }: {
2
+ value?: number;
3
+ indeterminate?: boolean;
4
+ className?: string;
5
+ }): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from "react";
2
+ export type TabItem = {
3
+ value: string;
4
+ label: ReactNode;
5
+ content: ReactNode;
6
+ disabled?: boolean;
7
+ };
8
+ export declare function Tabs({ items, value, defaultValue, onValueChange, className, }: {
9
+ items: TabItem[];
10
+ value?: string;
11
+ defaultValue?: string;
12
+ onValueChange?: (value: string) => void;
13
+ className?: string;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type TextareaHTMLAttributes } from "react";
2
+ import type { FieldProps } from "../types";
3
+ export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> & FieldProps & {
4
+ maxLength?: number;
5
+ showCount?: boolean;
6
+ };
7
+ export declare function Textarea({ label, hint, error, fullWidth, disabled, size, className, id, maxLength, showCount, value, ...props }: TextareaProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from "react";
2
+ export type Theme = "dark" | "light";
3
+ type ThemeContextValue = {
4
+ theme: Theme;
5
+ setTheme: (theme: Theme) => void;
6
+ toggleTheme: () => void;
7
+ };
8
+ export declare function ThemeProvider({ children, theme: themeProp, storageKey, }: {
9
+ children: ReactNode;
10
+ theme?: Theme;
11
+ storageKey?: string;
12
+ }): import("react").JSX.Element;
13
+ export declare function useTheme(): ThemeContextValue;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ export type Size = "sm" | "md" | "lg";
3
+ export type SelectItem = {
4
+ value: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ disabled?: boolean;
8
+ };
9
+ export type FieldProps = {
10
+ label?: ReactNode;
11
+ hint?: ReactNode;
12
+ error?: ReactNode;
13
+ fullWidth?: boolean;
14
+ disabled?: boolean;
15
+ size?: Size;
16
+ };
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,19 @@
1
+ import type { Locale } from "../i18n/messages";
2
+ export declare function numberSeparators(locale: Locale): {
3
+ group: string;
4
+ decimal: string;
5
+ };
6
+ type Parsed = {
7
+ sign: string;
8
+ intDigits: string;
9
+ fracDigits: string | null;
10
+ trailingDecimal: boolean;
11
+ };
12
+ export declare function parseLocaleNumber(raw: string, locale: Locale): Parsed | null;
13
+ export declare function formatLocaleNumber(parsed: Parsed, locale: Locale): string;
14
+ export declare function dropEmptyFraction(parsed: Parsed): Parsed;
15
+ export declare function toCanonicalNumber(parsed: Parsed): string;
16
+ export declare function toLocaleNumberDisplay(value: string | number | readonly string[] | undefined, locale: Locale): string;
17
+ export declare function restoreNumberCaret(formatted: string, digitsBeforeCaret: number): number;
18
+ export declare function countDigitsBefore(value: string, caret: number): number;
19
+ export {};
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@huponx/x-core-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/huponx/x-core-ui"
7
+ },
4
8
  "type": "module",
5
- "license": "UNLICENSED",
9
+ "license": "MIT",
6
10
  "files": [
7
11
  "dist",
8
12
  "src/theme.css"
@@ -47,5 +51,8 @@
47
51
  "tailwindcss": "^4.1.13",
48
52
  "typescript": "^5.9.2",
49
53
  "vite": "^7.1.5"
54
+ },
55
+ "publishConfig": {
56
+ "registry": "https://registry.npmjs.org"
50
57
  }
51
- }
58
+ }