stoop 0.0.19 → 0.1.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 +33 -15
- package/dist/components/Badge/index.d.ts +13 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/types.d.ts +13 -0
- package/dist/components/Button/index.d.ts +14 -0
- package/dist/components/Button/styles.d.ts +6 -0
- package/dist/components/Button/types.d.ts +22 -0
- package/dist/components/Card/index.d.ts +14 -0
- package/dist/components/Card/styles.d.ts +16 -0
- package/dist/components/Card/types.d.ts +18 -0
- package/dist/components/Input/index.d.ts +13 -0
- package/dist/components/Input/styles.d.ts +3 -0
- package/dist/components/Input/types.d.ts +8 -0
- package/dist/components/Menu/index.d.ts +13 -0
- package/dist/components/Menu/styles.d.ts +9 -0
- package/dist/components/Menu/types.d.ts +26 -0
- package/dist/components/Modal/index.d.ts +14 -0
- package/dist/components/Modal/styles.d.ts +14 -0
- package/dist/components/Modal/types.d.ts +18 -0
- package/dist/components/Popover/index.d.ts +13 -0
- package/dist/components/Popover/styles.d.ts +4 -0
- package/dist/components/Popover/types.d.ts +16 -0
- package/dist/components/Provider/GlobalStyles.d.ts +10 -0
- package/dist/components/Provider/StoopProvider.d.ts +41 -0
- package/dist/components/Provider/index.d.ts +2 -0
- package/dist/components/Section/index.d.ts +15 -0
- package/dist/components/Section/styles.d.ts +5 -0
- package/dist/components/Section/types.d.ts +20 -0
- package/dist/components/Select/index.d.ts +13 -0
- package/dist/components/Select/styles.d.ts +7 -0
- package/dist/components/Select/types.d.ts +30 -0
- package/dist/components/Stack/index.d.ts +16 -0
- package/dist/components/Stack/styles.d.ts +10 -0
- package/dist/components/Stack/types.d.ts +42 -0
- package/dist/components/Tabs/index.d.ts +13 -0
- package/dist/components/Tabs/styles.d.ts +8 -0
- package/dist/components/Tabs/types.d.ts +20 -0
- package/dist/components/Text/index.d.ts +14 -0
- package/dist/components/Text/styles.d.ts +4 -0
- package/dist/components/Text/types.d.ts +21 -0
- package/dist/components/Textarea/index.d.ts +15 -0
- package/dist/components/Textarea/styles.d.ts +3 -0
- package/dist/components/Textarea/types.d.ts +10 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useBreakpoints.d.ts +14 -0
- package/dist/hooks/useEventListener.d.ts +6 -0
- package/dist/hooks/useFloating.d.ts +18 -0
- package/dist/hooks/useOutsideClick.d.ts +6 -0
- package/dist/hooks/usePortal.d.ts +9 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +156 -36
- package/dist/styles/compiler.d.ts +25 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/theme.d.ts +495 -0
- package/dist/styles/types.d.ts +66 -0
- package/package.json +31 -28
- package/dist/index.css +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { TabsProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Tabs - Tab navigation component
|
|
5
|
+
*
|
|
6
|
+
* Sharp edges design with clean tab switching
|
|
7
|
+
* Supports keyboard navigation and custom content
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
* <Tabs items={[{label: 'Tab 1', content: <div>Content 1</div>}]} />
|
|
11
|
+
* <Tabs items={tabs} defaultActive={1} variant="minimal" />
|
|
12
|
+
*/
|
|
13
|
+
export declare function Tabs({ css, defaultActive, items, onTabChange, variant, ...props }: TabsProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TabsStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
|
|
2
|
+
export declare const TabListStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
|
|
3
|
+
variant?: boolean | "default" | "minimal";
|
|
4
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const TabButtonStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
|
|
6
|
+
active?: boolean | "false" | "true";
|
|
7
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const TabPanelStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import type { CSSObject } from "../../styles/types";
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TabsProps extends ComponentPropsWithoutRef<"div"> {
|
|
10
|
+
/** Array of tab items */
|
|
11
|
+
items: TabItem[];
|
|
12
|
+
/** Initially active tab index */
|
|
13
|
+
defaultActive?: number;
|
|
14
|
+
/** Tab variant */
|
|
15
|
+
variant?: "default" | "minimal";
|
|
16
|
+
/** Called when tab selection changes */
|
|
17
|
+
onTabChange?: (index: number) => void;
|
|
18
|
+
/** Custom CSS styles */
|
|
19
|
+
css?: CSSObject;
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { TextProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Text - Typography component
|
|
5
|
+
*
|
|
6
|
+
* Provides consistent typography with semantic HTML elements
|
|
7
|
+
* Supports size override, muted styling, and spacing props
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
* <Text as="h1">Page Title</Text>
|
|
11
|
+
* <Text as="p" size="small" muted>Subtitle</Text>
|
|
12
|
+
* <Text as="span" size="h3">Custom sized span</Text>
|
|
13
|
+
*/
|
|
14
|
+
export declare function Text({ as, bottom, children, css, muted, size, top, ...props }: TextProps): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const TextStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
|
|
2
|
+
size?: boolean | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | "strong";
|
|
3
|
+
muted?: boolean | "false" | "true";
|
|
4
|
+
} & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType } from "react";
|
|
2
|
+
import type { SpacingToken } from "../../styles/theme";
|
|
3
|
+
import type { CSSObject } from "../../styles/types";
|
|
4
|
+
export type TextElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "strong" | "small" | "label";
|
|
5
|
+
/**
|
|
6
|
+
* Text component props
|
|
7
|
+
*/
|
|
8
|
+
export interface TextProps extends ComponentPropsWithoutRef<"div"> {
|
|
9
|
+
/** HTML element to render as (also determines default size) */
|
|
10
|
+
as?: TextElement | ElementType;
|
|
11
|
+
/** Override the default size from 'as' prop */
|
|
12
|
+
size?: TextElement;
|
|
13
|
+
/** Apply muted styling (reduced opacity) */
|
|
14
|
+
muted?: boolean;
|
|
15
|
+
/** Add padding-top and remove margin-top */
|
|
16
|
+
top?: SpacingToken;
|
|
17
|
+
/** Add padding-bottom and remove margin-bottom */
|
|
18
|
+
bottom?: SpacingToken;
|
|
19
|
+
/** Custom CSS styles */
|
|
20
|
+
css?: CSSObject;
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { TextareaProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Textarea - Multi-line text input component
|
|
5
|
+
*
|
|
6
|
+
* Sharp edges design with consistent styling
|
|
7
|
+
* Supports various states and accessibility features
|
|
8
|
+
* Use cols/rows attributes for sizing
|
|
9
|
+
*
|
|
10
|
+
* Examples:
|
|
11
|
+
* <Textarea placeholder="Enter your message..." />
|
|
12
|
+
* <Textarea variant="minimal" />
|
|
13
|
+
* <Textarea disabled rows={5} cols={50} />
|
|
14
|
+
*/
|
|
15
|
+
export declare function Textarea({ css, variant, ...props }: TextareaProps): JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const TextareaStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
|
|
2
|
+
variant?: boolean | "default" | "minimal";
|
|
3
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import type { CSSObject } from "../../styles/types";
|
|
3
|
+
export interface TextareaProps extends ComponentPropsWithoutRef<"textarea"> {
|
|
4
|
+
/** Textarea variant */
|
|
5
|
+
variant?: "default" | "minimal";
|
|
6
|
+
/** Whether to allow manual resizing */
|
|
7
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
8
|
+
/** Custom CSS styles */
|
|
9
|
+
css?: CSSObject;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { Stack } from "./Stack";
|
|
2
|
+
export type { StackProps } from "./Stack/types";
|
|
3
|
+
export { Section } from "./Section";
|
|
4
|
+
export type { SectionProps } from "./Section/types";
|
|
5
|
+
export { Text } from "./Text";
|
|
6
|
+
export type { TextProps, TextElement } from "./Text/types";
|
|
7
|
+
export { Button } from "./Button";
|
|
8
|
+
export type { ButtonProps } from "./Button/types";
|
|
9
|
+
export { Badge } from "./Badge";
|
|
10
|
+
export type { BadgeProps } from "./Badge/types";
|
|
11
|
+
export { Card } from "./Card";
|
|
12
|
+
export type { CardProps } from "./Card/types";
|
|
13
|
+
export { Input } from "./Input";
|
|
14
|
+
export type { InputProps } from "./Input/types";
|
|
15
|
+
export { Textarea } from "./Textarea";
|
|
16
|
+
export type { TextareaProps } from "./Textarea/types";
|
|
17
|
+
export { Tabs } from "./Tabs";
|
|
18
|
+
export type { TabsProps, TabItem } from "./Tabs/types";
|
|
19
|
+
export { Menu } from "./Menu";
|
|
20
|
+
export type { MenuProps, MenuOption } from "./Menu/types";
|
|
21
|
+
export { Select } from "./Select";
|
|
22
|
+
export type { SelectProps, SelectOption } from "./Select/types";
|
|
23
|
+
export { Popover } from "./Popover";
|
|
24
|
+
export type { PopoverProps } from "./Popover/types";
|
|
25
|
+
export { Modal } from "./Modal";
|
|
26
|
+
export type { ModalProps } from "./Modal/types";
|
|
27
|
+
export { StoopProvider } from "./Provider";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useBreakpoints, type BreakpointSize } from "./useBreakpoints";
|
|
2
|
+
export { usePortal } from "./usePortal";
|
|
3
|
+
export { useEventListener } from "./useEventListener";
|
|
4
|
+
export { useOutsideClick } from "./useOutsideClick";
|
|
5
|
+
export { useFloating, type UseFloatingReturn } from "./useFloating";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BreakpointSize = "small" | "medium" | "large";
|
|
2
|
+
/**
|
|
3
|
+
* Single hook to handle all breakpoint functionality
|
|
4
|
+
* Returns: current state + helper methods for all breakpoint checks
|
|
5
|
+
*/
|
|
6
|
+
export declare function useBreakpoints(): {
|
|
7
|
+
current: BreakpointSize;
|
|
8
|
+
down: (size: BreakpointSize) => boolean;
|
|
9
|
+
is: (size: BreakpointSize) => boolean;
|
|
10
|
+
isLarge: boolean;
|
|
11
|
+
isMedium: boolean;
|
|
12
|
+
isSmall: boolean;
|
|
13
|
+
up: (size: BreakpointSize) => boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for efficiently adding event listeners to elements or window
|
|
4
|
+
* Automatically handles cleanup and re-binding when dependencies change
|
|
5
|
+
*/
|
|
6
|
+
export declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: RefObject<HTMLElement | Window | null> | HTMLElement | Window | null, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
export interface UseFloatingReturn {
|
|
3
|
+
/** Ref for the trigger element */
|
|
4
|
+
triggerRef: RefObject<HTMLDivElement | null>;
|
|
5
|
+
/** Ref for the floating element */
|
|
6
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
/** Whether floating element is open */
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/** Whether floating element is mounted */
|
|
10
|
+
isMounted: boolean;
|
|
11
|
+
/** Open the floating element */
|
|
12
|
+
handleOpen: () => void;
|
|
13
|
+
/** Close the floating element */
|
|
14
|
+
handleClose: () => void;
|
|
15
|
+
/** Toggle the floating element */
|
|
16
|
+
handleClick: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function useFloating(): UseFloatingReturn;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for detecting clicks outside of a specific element
|
|
4
|
+
* Useful for closing dropdowns, modals, or other overlay components
|
|
5
|
+
*/
|
|
6
|
+
export declare function useOutsideClick<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: (event: MouseEvent | TouchEvent) => void, eventType?: "mousedown" | "mouseup" | "click" | "touchstart"): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode, type ReactPortal } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Hook for rendering content in a portal (outside the normal DOM tree)
|
|
4
|
+
* Useful for modals, tooltips, dropdowns that need to escape parent containers
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePortal(container?: HTMLElement | string): {
|
|
7
|
+
renderPortal: (children: ReactNode) => ReactPortal | null;
|
|
8
|
+
portalElement: HTMLDivElement | null;
|
|
9
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./components/Provider";
|
|
2
|
+
export * from "./styles";
|
|
3
|
+
export * from "./hooks";
|
|
4
|
+
export { Stack, Section, Text, Button, Badge, Card, Input, Textarea, Tabs, Menu, Select, Popover, Modal, StoopProvider, } from "./components";
|
|
5
|
+
export { useTheme } from "./components/Provider";
|
|
6
|
+
export type { StackProps, SectionProps, TextProps, TextElement, ButtonProps, BadgeProps, CardProps, InputProps, TextareaProps, TabsProps, TabItem, MenuProps, MenuOption, SelectProps, SelectOption, PopoverProps, ModalProps, } from "./components";
|