@febkosq8/arc 0.3.0 → 0.6.7
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 +64 -5
- package/components/index.css +263 -114
- package/dist/arc.js +1115 -0
- package/dist/avatar.d.ts +18 -0
- package/dist/button-double-click.d.ts +18 -0
- package/dist/button-group.d.ts +8 -0
- package/dist/button-long-press.d.ts +20 -0
- package/dist/button.d.ts +21 -0
- package/dist/card.d.ts +17 -0
- package/dist/date-handler.d.ts +13 -0
- package/dist/divider.d.ts +2 -0
- package/dist/dropdown-multi.d.ts +16 -0
- package/dist/dropdown.d.ts +19 -0
- package/dist/error-text.d.ts +5 -0
- package/dist/hash-navigation.d.ts +34 -0
- package/dist/index.d.ts +41 -0
- package/dist/input-timestamp.d.ts +7 -0
- package/dist/input.d.ts +19 -0
- package/dist/menu.d.ts +29 -0
- package/dist/modal.d.ts +15 -0
- package/dist/pill-link.d.ts +8 -0
- package/dist/pill.d.ts +5 -0
- package/dist/preview-card.d.ts +12 -0
- package/dist/select.d.ts +18 -0
- package/dist/switch.d.ts +10 -0
- package/dist/tag.d.ts +6 -0
- package/dist/text-link.d.ts +6 -0
- package/dist/theme-switcher.d.ts +5 -0
- package/dist/typing-animation.d.ts +23 -0
- package/package.json +49 -35
- package/.prettierrc +0 -8
- package/components/button.tsx +0 -42
- package/components/card.tsx +0 -32
- package/components/index.ts +0 -8
- package/components/input.tsx +0 -21
- package/components/menu.tsx +0 -80
- package/components/pill.tsx +0 -20
- package/components/switch.tsx +0 -82
- package/components/text-area.tsx +0 -21
- package/components/theme-switcher.tsx +0 -81
- package/eslint.config.mjs +0 -36
- package/index.html +0 -11
- package/tsconfig.json +0 -27
- package/vite.config.ts +0 -37
package/dist/avatar.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type VariantClassProps = {
|
|
2
|
+
class?: never;
|
|
3
|
+
className?: never;
|
|
4
|
+
} | {
|
|
5
|
+
class?: never;
|
|
6
|
+
className: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
type AvatarVariantOptions = VariantClassProps & {
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null;
|
|
10
|
+
};
|
|
11
|
+
export type AvatarSize = NonNullable<AvatarVariantOptions["size"]>;
|
|
12
|
+
export interface AvatarProps extends React.ComponentPropsWithoutRef<"span"> {
|
|
13
|
+
name?: string | null;
|
|
14
|
+
image?: string | null;
|
|
15
|
+
size?: AvatarSize;
|
|
16
|
+
}
|
|
17
|
+
declare const Avatar: ({ name, image: imageSource, size, className, ...props }: AvatarProps) => import('react').JSX.Element;
|
|
18
|
+
export default Avatar;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './button';
|
|
3
|
+
export interface DoubleClickButtonFeedbackContext {
|
|
4
|
+
isWaiting: boolean;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
doubleClickMsDuration: number;
|
|
7
|
+
remainingTime: number;
|
|
8
|
+
variant: ButtonProps["variant"];
|
|
9
|
+
feedbackVariant: "primary" | "secondary" | "destructive" | "warning";
|
|
10
|
+
}
|
|
11
|
+
export type DoubleClickButtonFeedbackContent = ReactNode | ((context: DoubleClickButtonFeedbackContext) => ReactNode);
|
|
12
|
+
export interface DoubleClickButtonProps extends ButtonProps {
|
|
13
|
+
doubleClickMsDuration?: number;
|
|
14
|
+
feedbackVariant?: "primary" | "secondary" | "destructive" | "warning";
|
|
15
|
+
feedbackContent?: DoubleClickButtonFeedbackContent;
|
|
16
|
+
}
|
|
17
|
+
declare const DoubleClickButton: ({ doubleClickMsDuration, feedbackVariant, feedbackContent, variant, children, onClick, onDoubleClick, className, style, ...props }: DoubleClickButtonProps) => import('react').JSX.Element;
|
|
18
|
+
export default DoubleClickButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type ButtonVariant = "primary" | "secondary" | "destructive" | "ghost" | "warning" | "outline-primary" | "outline-secondary" | "outline-destructive" | "outline-ghost" | "outline-warning";
|
|
3
|
+
export interface ButtonGroupProps extends ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
selectedVariant?: ButtonVariant;
|
|
6
|
+
}
|
|
7
|
+
declare const ButtonGroup: ({ className, orientation, selectedVariant, children, ...props }: ButtonGroupProps) => import('react').JSX.Element;
|
|
8
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from './button';
|
|
3
|
+
export interface LongPressButtonFeedbackContext {
|
|
4
|
+
isPressing: boolean;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
longPressMsDuration: number;
|
|
7
|
+
remainingTime: number;
|
|
8
|
+
variant: ButtonProps["variant"];
|
|
9
|
+
feedbackVariant: "primary" | "secondary" | "destructive" | "warning";
|
|
10
|
+
}
|
|
11
|
+
export type LongPressButtonFeedbackContent = ReactNode | ((context: LongPressButtonFeedbackContext) => ReactNode);
|
|
12
|
+
export interface LongPressButtonProps extends ButtonProps {
|
|
13
|
+
longPressMsDuration?: number;
|
|
14
|
+
onLongPress?: (event: React.PointerEvent<HTMLButtonElement>) => void;
|
|
15
|
+
preventClick?: boolean;
|
|
16
|
+
feedbackVariant?: LongPressButtonFeedbackContext["feedbackVariant"];
|
|
17
|
+
feedbackContent?: LongPressButtonFeedbackContent;
|
|
18
|
+
}
|
|
19
|
+
declare const LongPressButton: ({ longPressMsDuration, onLongPress, onClick, preventClick, feedbackVariant, feedbackContent, variant, children, ...props }: LongPressButtonProps) => import('react').JSX.Element;
|
|
20
|
+
export default LongPressButton;
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as ButtonGroup } from './button-group';
|
|
2
|
+
type VariantClassProps = {
|
|
3
|
+
class?: never;
|
|
4
|
+
className?: never;
|
|
5
|
+
} | {
|
|
6
|
+
class?: never;
|
|
7
|
+
className: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
type ButtonVariantOptions = VariantClassProps & {
|
|
10
|
+
variant?: "primary" | "secondary" | "destructive" | "ghost" | "warning" | "outline-primary" | "outline-secondary" | "outline-destructive" | "outline-ghost" | "outline-warning" | null;
|
|
11
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl" | null;
|
|
12
|
+
};
|
|
13
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
|
+
variant?: ButtonVariantOptions["variant"];
|
|
15
|
+
size?: ButtonVariantOptions["size"];
|
|
16
|
+
}
|
|
17
|
+
interface ButtonComponent extends React.FC<ButtonProps> {
|
|
18
|
+
Group: typeof ButtonGroup;
|
|
19
|
+
}
|
|
20
|
+
declare const Button: ButtonComponent;
|
|
21
|
+
export default Button;
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type CardVariant = "primary" | "secondary" | "destructive" | "warning" | "outline-primary" | "outline-secondary" | "outline-destructive" | "outline-warning";
|
|
2
|
+
interface CardProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
3
|
+
variant?: CardVariant;
|
|
4
|
+
hoverable?: boolean;
|
|
5
|
+
hoverLift?: boolean;
|
|
6
|
+
hoverBorder?: boolean;
|
|
7
|
+
hoverGradient?: boolean;
|
|
8
|
+
postHeaderBorder?: boolean;
|
|
9
|
+
preFooterBorder?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Card: {
|
|
12
|
+
(props: CardProps): import('react').JSX.Element;
|
|
13
|
+
Header: (props: CardProps) => import('react').JSX.Element;
|
|
14
|
+
Content: (props: CardProps) => import('react').JSX.Element;
|
|
15
|
+
Footer: (props: CardProps) => import('react').JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export default Card;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DurationLike, ToRelativeOptions } from 'luxon';
|
|
2
|
+
export declare class DateHandler {
|
|
3
|
+
private static toDateTime;
|
|
4
|
+
static getDateTime(date: unknown, format?: string): string;
|
|
5
|
+
static getRelativeTime(date: unknown, options?: ToRelativeOptions): string;
|
|
6
|
+
static getTimeDiff(date: unknown): string | null;
|
|
7
|
+
static generateOffsetDateTime({ offset, future, format, }: {
|
|
8
|
+
offset: DurationLike;
|
|
9
|
+
future?: boolean;
|
|
10
|
+
format?: string | null;
|
|
11
|
+
}): string;
|
|
12
|
+
static getFormattedTime(date: unknown, format?: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DropdownItem } from './dropdown';
|
|
2
|
+
export interface MultiDropdownProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
items: DropdownItem[];
|
|
5
|
+
value: string[];
|
|
6
|
+
onChange?: (items: DropdownItem[]) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
preventEmpty?: boolean;
|
|
12
|
+
"data-name"?: string;
|
|
13
|
+
"data-required"?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const MultiDropdown: ({ id, items, value, onChange, className, placeholder, disabled, name, preventEmpty, "data-name": dataName, "data-required": dataRequired, }: MultiDropdownProps) => import('react').JSX.Element;
|
|
16
|
+
export default MultiDropdown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type DropdownItem = {
|
|
2
|
+
key: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export interface DropdownProps {
|
|
7
|
+
items: DropdownItem[];
|
|
8
|
+
value: number | string;
|
|
9
|
+
onChange?: (item: DropdownItem | null) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
preventEmpty?: boolean;
|
|
15
|
+
"data-name"?: string;
|
|
16
|
+
"data-required"?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Dropdown: ({ items, value, onChange, className, placeholder, disabled, name, preventEmpty, "data-name": dataName, "data-required": dataRequired, }: DropdownProps) => import('react').JSX.Element;
|
|
19
|
+
export default Dropdown;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type HashNavigationOptions = {
|
|
2
|
+
/** Delay between attempts to find the hash target, in milliseconds. */
|
|
3
|
+
intervalMs?: number;
|
|
4
|
+
/** Maximum number of attempts before giving up. */
|
|
5
|
+
maxAttempts?: number;
|
|
6
|
+
/** Scroll behavior used when the target is found. */
|
|
7
|
+
behavior?: ScrollBehavior;
|
|
8
|
+
/** Scroll alignment used when the target is found. */
|
|
9
|
+
block?: ScrollLogicalPosition;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Scrolls to the element matching the current URL hash once it exists in the DOM.
|
|
13
|
+
* Retries until the element renders, the hash is cleared or the attempts run out.
|
|
14
|
+
* Returns a cleanup function that cancels any pending attempt.
|
|
15
|
+
*/
|
|
16
|
+
export declare function navigateToHashOnLoad({ intervalMs, maxAttempts, behavior, block, }?: HashNavigationOptions): () => void;
|
|
17
|
+
/** Runs {@link navigateToHashOnLoad} once on mount. */
|
|
18
|
+
export declare function useHashNavigationOnLoad(options?: HashNavigationOptions): void;
|
|
19
|
+
export type UpdateHashOnScrollOptions = {
|
|
20
|
+
/** Scrollable element that contains the sections. */
|
|
21
|
+
container: HTMLElement;
|
|
22
|
+
/** Section element ids in display order. */
|
|
23
|
+
sectionIds: string[];
|
|
24
|
+
/** Defaults to true. When false, the first section maps to an empty hash instead of its own (e.g. `#intro`). */
|
|
25
|
+
hashFirstSection?: boolean;
|
|
26
|
+
/** Called on every scroll with the active section index (-1 if none) and the resolved sections. */
|
|
27
|
+
onActiveChange?: (activeIndex: number, sections: HTMLElement[]) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Keeps the URL hash in sync with the section vertically centered in the container.
|
|
31
|
+
* While an initial hash navigation is still scrolling toward its target, the first section
|
|
32
|
+
* does not clear the hash. Returns a cleanup function that removes the scroll listener.
|
|
33
|
+
*/
|
|
34
|
+
export declare function updateHashOnScroll({ container, sectionIds, hashFirstSection, onActiveChange, }: UpdateHashOnScrollOptions): () => void;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export { default as Button } from './button';
|
|
2
|
+
export { default as ButtonGroup } from './button-group';
|
|
3
|
+
export { default as DoubleClickButton } from './button-double-click';
|
|
4
|
+
export type { DoubleClickButtonFeedbackContent, DoubleClickButtonFeedbackContext, DoubleClickButtonProps, } from './button-double-click';
|
|
5
|
+
export { default as LongPressButton } from './button-long-press';
|
|
6
|
+
export type { LongPressButtonFeedbackContent, LongPressButtonFeedbackContext, LongPressButtonProps, } from './button-long-press';
|
|
7
|
+
export { navigateToHashOnLoad, updateHashOnScroll, useHashNavigationOnLoad } from './hash-navigation';
|
|
8
|
+
export type { HashNavigationOptions, UpdateHashOnScrollOptions } from './hash-navigation';
|
|
9
|
+
export { default as Avatar } from './avatar';
|
|
10
|
+
export type { AvatarProps, AvatarSize } from './avatar';
|
|
11
|
+
export { default as Divider } from './divider';
|
|
12
|
+
export { default as Dropdown } from './dropdown';
|
|
13
|
+
export type { DropdownItem, DropdownProps } from './dropdown';
|
|
14
|
+
export { default as ErrorText } from './error-text';
|
|
15
|
+
export type { ErrorTextProps } from './error-text';
|
|
16
|
+
export { default as Input } from './input';
|
|
17
|
+
export { default as Card } from './card';
|
|
18
|
+
export { DateHandler } from './date-handler';
|
|
19
|
+
export { default as InputTimestamp } from './input-timestamp';
|
|
20
|
+
export type { InputTimestampProps } from './input-timestamp';
|
|
21
|
+
export { default as PillLink } from './pill-link';
|
|
22
|
+
export type { PillLinkProps } from './pill-link';
|
|
23
|
+
export { default as Menu } from './menu';
|
|
24
|
+
export { default as Modal } from './modal';
|
|
25
|
+
export type { ModalProps } from './modal';
|
|
26
|
+
export { default as MultiDropdown } from './dropdown-multi';
|
|
27
|
+
export type { MultiDropdownProps } from './dropdown-multi';
|
|
28
|
+
export { default as Pill } from './pill';
|
|
29
|
+
export { default as PreviewCard } from './preview-card';
|
|
30
|
+
export type { PreviewCardProps } from './preview-card';
|
|
31
|
+
export { default as Select } from './select';
|
|
32
|
+
export type { SelectItem, SelectProps } from './select';
|
|
33
|
+
export { default as Tag } from './tag';
|
|
34
|
+
export type { TagProps, TagVariant } from './tag';
|
|
35
|
+
export { default as TextLink } from './text-link';
|
|
36
|
+
export type { TextLinkProps } from './text-link';
|
|
37
|
+
export { default as Switch } from './switch';
|
|
38
|
+
export { default as ThemeSwitcher } from './theme-switcher';
|
|
39
|
+
export type { ThemeSwitcherProps } from './theme-switcher';
|
|
40
|
+
export { default as TypingAnimation } from './typing-animation';
|
|
41
|
+
export type { TypingAnimationPerTickUnit, TypingAnimationAfterString, TypingAnimationProps } from './typing-animation';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface InputTimestampProps extends Omit<ComponentPropsWithoutRef<"input">, "value"> {
|
|
3
|
+
value?: unknown;
|
|
4
|
+
format?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const InputTimestamp: ({ value, format, ...rest }: InputTimestampProps) => import('react').JSX.Element;
|
|
7
|
+
export default InputTimestamp;
|
package/dist/input.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type VariantClassProps = {
|
|
3
|
+
class?: never;
|
|
4
|
+
className?: never;
|
|
5
|
+
} | {
|
|
6
|
+
class?: never;
|
|
7
|
+
className: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
type InputVariantOptions = VariantClassProps & {
|
|
10
|
+
variant?: "default" | "ghost" | null;
|
|
11
|
+
as?: "input" | "textarea" | null;
|
|
12
|
+
};
|
|
13
|
+
export type InputProps = (ComponentPropsWithoutRef<"input"> & Omit<InputVariantOptions, "class" | "className"> & {
|
|
14
|
+
as?: "input";
|
|
15
|
+
}) | (ComponentPropsWithoutRef<"textarea"> & Omit<InputVariantOptions, "class" | "className"> & {
|
|
16
|
+
as: "textarea";
|
|
17
|
+
});
|
|
18
|
+
declare const Input: ({ as, className, variant, ...rest }: InputProps) => import('react').JSX.Element;
|
|
19
|
+
export default Input;
|
package/dist/menu.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Menu as BaseMenu } from '@base-ui/react/menu';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
+
interface MenuProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
contentClassName?: string;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
activeClassName?: string;
|
|
8
|
+
buttonText: string | ReactNode;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface MenuComponent extends React.FC<MenuProps> {
|
|
12
|
+
Item: typeof MenuItem;
|
|
13
|
+
Sub: typeof MenuSub;
|
|
14
|
+
}
|
|
15
|
+
type MenuItemProps = Omit<ComponentPropsWithoutRef<typeof BaseMenu.Item>, "className" | "render"> & {
|
|
16
|
+
active?: boolean;
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
};
|
|
20
|
+
declare const MenuItem: ({ active, asChild, className, nativeButton, children, ...props }: MenuItemProps) => import('react').JSX.Element;
|
|
21
|
+
declare const MenuComponent: ({ className, contentClassName, active, activeClassName, buttonText, children }: MenuProps) => import('react').JSX.Element;
|
|
22
|
+
interface MenuSubProps {
|
|
23
|
+
active?: boolean;
|
|
24
|
+
buttonText: string | ReactNode;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
declare const MenuSub: ({ active, buttonText, children }: MenuSubProps) => import('react').JSX.Element;
|
|
28
|
+
declare const Menu: MenuComponent;
|
|
29
|
+
export default Menu;
|
package/dist/modal.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ModalProps {
|
|
2
|
+
open?: boolean;
|
|
3
|
+
setOpen: (open: boolean) => void;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
initialFocus?: React.RefObject<HTMLElement | null>;
|
|
6
|
+
headerContent?: React.ReactNode;
|
|
7
|
+
footerContent?: React.ReactNode;
|
|
8
|
+
width?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Called with a normalized key name (`esc` or `ctrl+s`) while the modal is open. */
|
|
12
|
+
customKeyHandler?: (keyname: string, e: KeyboardEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const Modal: ({ open, setOpen, children, initialFocus, headerContent, footerContent, width, height, className, customKeyHandler, }: ModalProps) => import('react').JSX.Element;
|
|
15
|
+
export default Modal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PillLinkProps extends React.ComponentPropsWithoutRef<"a"> {
|
|
2
|
+
href: string;
|
|
3
|
+
active?: boolean;
|
|
4
|
+
variant?: "pill" | "primary" | "outline";
|
|
5
|
+
size?: "sm" | "md";
|
|
6
|
+
}
|
|
7
|
+
declare const PillLink: ({ active, className, size, variant, ...props }: PillLinkProps) => import('react').JSX.Element;
|
|
8
|
+
export default PillLink;
|
package/dist/pill.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export interface PreviewCardProps {
|
|
3
|
+
cardContent: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
trigger?: "hover" | "click";
|
|
6
|
+
triggerRender?: ReactElement;
|
|
7
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
8
|
+
align?: "start" | "center" | "end";
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const PreviewCard: ({ cardContent, children, trigger, triggerRender, side, align, className, }: PreviewCardProps) => import('react').JSX.Element;
|
|
12
|
+
export default PreviewCard;
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type SelectItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
id?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
data: SelectItem[];
|
|
12
|
+
className?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
"data-name"?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const Select: ({ id, value, onChange, data, className, disabled, placeholder, ...rest }: SelectProps) => import('react').JSX.Element;
|
|
18
|
+
export default Select;
|
package/dist/switch.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
variant?: "primary" | "secondary" | "danger" | "success";
|
|
7
|
+
children?: (checked: boolean) => JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
declare const Switch: ({ checked, onChange, disabled, variant, children, ...rest }: SwitchProps) => JSX.Element;
|
|
10
|
+
export default Switch;
|
package/dist/tag.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type TagVariant = "primary" | "secondary" | "success" | "warning" | "destructive" | "outline";
|
|
2
|
+
export interface TagProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
3
|
+
variant?: TagVariant;
|
|
4
|
+
}
|
|
5
|
+
declare const Tag: ({ className, variant, ...props }: TagProps) => import('react').JSX.Element;
|
|
6
|
+
export default Tag;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface TextLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">, "children"> {
|
|
2
|
+
href: string;
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
declare const TextLink: ({ className, href, text, target, rel, ...props }: TextLinkProps) => import('react').JSX.Element;
|
|
6
|
+
export default TextLink;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TypingAnimationPerTickUnit = "character" | "word";
|
|
2
|
+
export type TypingAnimationAfterString = "clear" | "newline" | "comma";
|
|
3
|
+
export interface TypingAnimationProps {
|
|
4
|
+
strings: string[];
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
perTick?: {
|
|
7
|
+
amount?: number;
|
|
8
|
+
unit?: TypingAnimationPerTickUnit;
|
|
9
|
+
};
|
|
10
|
+
msDelay?: {
|
|
11
|
+
typing?: number;
|
|
12
|
+
deleting?: number;
|
|
13
|
+
hold?: number;
|
|
14
|
+
dot?: number;
|
|
15
|
+
};
|
|
16
|
+
waitTillVisible?: boolean;
|
|
17
|
+
pauseWhenHidden?: boolean;
|
|
18
|
+
loop?: boolean;
|
|
19
|
+
minVisiblePercent?: number;
|
|
20
|
+
afterString?: TypingAnimationAfterString;
|
|
21
|
+
trailingDot?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export default function TypingAnimation({ strings, placeholder, perTick, msDelay, waitTillVisible, pauseWhenHidden, loop, minVisiblePercent, afterString, trailingDot, }: TypingAnimationProps): import('react').JSX.Element;
|
package/package.json
CHANGED
|
@@ -2,50 +2,64 @@
|
|
|
2
2
|
"name": "@febkosq8/arc",
|
|
3
3
|
"description": "A React components library for febkosq8",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.6.7",
|
|
6
6
|
"type": "module",
|
|
7
|
+
"main": "./dist/arc.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/arc.js"
|
|
13
|
+
},
|
|
14
|
+
"./styles.css": "./components/index.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"components/index.css"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://www.npmjs.com/package/@febkosq8/arc",
|
|
7
21
|
"repository": "https://github.com/febkosq8/arc",
|
|
22
|
+
"packageManager": "pnpm@12.14.0",
|
|
8
23
|
"scripts": {
|
|
9
24
|
"build": "vite build",
|
|
10
|
-
|
|
11
|
-
"
|
|
25
|
+
"storybook": "storybook dev -p 6006",
|
|
26
|
+
"build-storybook": "storybook build",
|
|
27
|
+
"prettier": "prettier --write .",
|
|
28
|
+
"push-npm": "npm publish --access public",
|
|
29
|
+
"prepublishOnly": "pnpm run build"
|
|
12
30
|
},
|
|
13
31
|
"peerDependencies": {
|
|
14
|
-
"react": "19.
|
|
15
|
-
"react-dom": "19.
|
|
32
|
+
"react": "19.3.1",
|
|
33
|
+
"react-dom": "19.3.1"
|
|
16
34
|
},
|
|
17
35
|
"dependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"@radix-ui/react-dropdown-menu": "2.1.2",
|
|
23
|
-
"@radix-ui/react-slot": "1.1.0",
|
|
24
|
-
"@radix-ui/react-switch": "1.1.1",
|
|
25
|
-
"@rinzai/zen": "0.0.16",
|
|
26
|
-
"tailwind-merge": "2.5.5"
|
|
36
|
+
"@base-ui/react": "1.8.0",
|
|
37
|
+
"@rinzai/zen": "0.14.0",
|
|
38
|
+
"luxon": "3.7.2",
|
|
39
|
+
"react-icons": "5.7.0"
|
|
27
40
|
},
|
|
28
41
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@types/
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"eslint
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"prettier": "
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
42
|
+
"@storybook/addon-docs": "10.6.2",
|
|
43
|
+
"@storybook/react-vite": "10.6.2",
|
|
44
|
+
"@tailwindcss/postcss": "4.3.3",
|
|
45
|
+
"@types/luxon": "3.7.6",
|
|
46
|
+
"@types/node": "26.6.5",
|
|
47
|
+
"@types/react": "19.3.0",
|
|
48
|
+
"@types/react-dom": "19.3.0",
|
|
49
|
+
"@typescript/typescript6": "6.0.2",
|
|
50
|
+
"@vitejs/plugin-react": "6.1.2",
|
|
51
|
+
"eslint": "10.12.0",
|
|
52
|
+
"prettier": "3.9.10",
|
|
53
|
+
"prettier-plugin-css-order": "2.2.0",
|
|
54
|
+
"prettier-plugin-organize-attributes": "1.0.0",
|
|
55
|
+
"prettier-plugin-organize-imports": "4.3.0",
|
|
56
|
+
"prettier-plugin-tailwindcss": "0.8.1",
|
|
57
|
+
"react": "19.3.1",
|
|
58
|
+
"react-dom": "19.3.1",
|
|
59
|
+
"storybook": "10.6.2",
|
|
60
|
+
"tailwindcss": "4.3.3",
|
|
61
|
+
"typescript": "7.0.2",
|
|
62
|
+
"unplugin-dts": "1.1.2",
|
|
63
|
+
"vite": "8.3.4"
|
|
50
64
|
}
|
|
51
65
|
}
|
package/.prettierrc
DELETED
package/components/button.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import { cva, cx, VariantProps } from "@rinzai/zen";
|
|
3
|
-
|
|
4
|
-
const buttonVariants = cva(
|
|
5
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 truncate",
|
|
6
|
-
{
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
10
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
11
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
12
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
link: " border text-primary underline-offset-4 hover:underline",
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: "h-10 px-4 py-2",
|
|
18
|
-
sm: "h-9 rounded-md px-3",
|
|
19
|
-
lg: "h-11 rounded-md px-8",
|
|
20
|
-
icon: "h-10 w-10",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
defaultVariants: {
|
|
24
|
-
variant: "default",
|
|
25
|
-
size: "default",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
export interface ButtonProps
|
|
31
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
32
|
-
VariantProps<typeof buttonVariants> {
|
|
33
|
-
asChild?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const Button =({ className, variant, size, asChild = false, ...props }:ButtonProps) => {
|
|
37
|
-
const Comp = asChild ? Slot : "button";
|
|
38
|
-
return <Comp className={cx(buttonVariants({ variant, size, className }))} {...props} />;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Button
|
|
42
|
-
|
package/components/card.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { cx } from "@rinzai/zen";
|
|
2
|
-
interface CardProps extends React.ComponentPropsWithoutRef<"div"> {}
|
|
3
|
-
const Card = (props: CardProps) => {
|
|
4
|
-
const { className, ...rest } = props;
|
|
5
|
-
return <div className={cx("card p-4 rounded-lg border shadow-sm", className)} {...rest} />;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const Header = (props: CardProps) => {
|
|
9
|
-
const { className, ...rest } = props;
|
|
10
|
-
return <h2 className={cx("card-header flex flex-col typography-heading-2", className)} {...rest} />;
|
|
11
|
-
};
|
|
12
|
-
const Content = (props: CardProps) => {
|
|
13
|
-
const { className, ...rest } = props;
|
|
14
|
-
return (
|
|
15
|
-
<div
|
|
16
|
-
className={cx("card-content typography-heading-4 justify-between whitespace-pre-wrap py-2", className)}
|
|
17
|
-
{...rest}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
const Footer = (props: CardProps) => {
|
|
22
|
-
const { className, ...rest } = props;
|
|
23
|
-
return (
|
|
24
|
-
<div className="border-t flex justify-start items-center pt-2">
|
|
25
|
-
<h2 className={cx("card-footer text-2xl", className)} {...rest} />
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
Card.Header = Header;
|
|
30
|
-
Card.Content = Content;
|
|
31
|
-
Card.Footer = Footer;
|
|
32
|
-
export default Card;
|
package/components/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export {default as Button} from './button';
|
|
2
|
-
export {default as Input} from './input';
|
|
3
|
-
export {default as Card} from './card';
|
|
4
|
-
export {default as Menu} from './menu';
|
|
5
|
-
export {default as Pill} from './pill';
|
|
6
|
-
export {default as Switch} from './switch';
|
|
7
|
-
export {default as TextArea} from './text-area';
|
|
8
|
-
export {default as ThemeSwitcher} from './theme-switcher';
|