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.
Files changed (58) hide show
  1. package/README.md +33 -15
  2. package/dist/components/Badge/index.d.ts +13 -0
  3. package/dist/components/Badge/styles.d.ts +3 -0
  4. package/dist/components/Badge/types.d.ts +13 -0
  5. package/dist/components/Button/index.d.ts +14 -0
  6. package/dist/components/Button/styles.d.ts +6 -0
  7. package/dist/components/Button/types.d.ts +22 -0
  8. package/dist/components/Card/index.d.ts +14 -0
  9. package/dist/components/Card/styles.d.ts +16 -0
  10. package/dist/components/Card/types.d.ts +18 -0
  11. package/dist/components/Input/index.d.ts +13 -0
  12. package/dist/components/Input/styles.d.ts +3 -0
  13. package/dist/components/Input/types.d.ts +8 -0
  14. package/dist/components/Menu/index.d.ts +13 -0
  15. package/dist/components/Menu/styles.d.ts +9 -0
  16. package/dist/components/Menu/types.d.ts +26 -0
  17. package/dist/components/Modal/index.d.ts +14 -0
  18. package/dist/components/Modal/styles.d.ts +14 -0
  19. package/dist/components/Modal/types.d.ts +18 -0
  20. package/dist/components/Popover/index.d.ts +13 -0
  21. package/dist/components/Popover/styles.d.ts +4 -0
  22. package/dist/components/Popover/types.d.ts +16 -0
  23. package/dist/components/Provider/GlobalStyles.d.ts +10 -0
  24. package/dist/components/Provider/StoopProvider.d.ts +41 -0
  25. package/dist/components/Provider/index.d.ts +2 -0
  26. package/dist/components/Section/index.d.ts +15 -0
  27. package/dist/components/Section/styles.d.ts +5 -0
  28. package/dist/components/Section/types.d.ts +20 -0
  29. package/dist/components/Select/index.d.ts +13 -0
  30. package/dist/components/Select/styles.d.ts +7 -0
  31. package/dist/components/Select/types.d.ts +30 -0
  32. package/dist/components/Stack/index.d.ts +16 -0
  33. package/dist/components/Stack/styles.d.ts +10 -0
  34. package/dist/components/Stack/types.d.ts +42 -0
  35. package/dist/components/Tabs/index.d.ts +13 -0
  36. package/dist/components/Tabs/styles.d.ts +8 -0
  37. package/dist/components/Tabs/types.d.ts +20 -0
  38. package/dist/components/Text/index.d.ts +14 -0
  39. package/dist/components/Text/styles.d.ts +4 -0
  40. package/dist/components/Text/types.d.ts +21 -0
  41. package/dist/components/Textarea/index.d.ts +15 -0
  42. package/dist/components/Textarea/styles.d.ts +3 -0
  43. package/dist/components/Textarea/types.d.ts +10 -0
  44. package/dist/components/index.d.ts +27 -0
  45. package/dist/hooks/index.d.ts +5 -0
  46. package/dist/hooks/useBreakpoints.d.ts +14 -0
  47. package/dist/hooks/useEventListener.d.ts +6 -0
  48. package/dist/hooks/useFloating.d.ts +18 -0
  49. package/dist/hooks/useOutsideClick.d.ts +6 -0
  50. package/dist/hooks/usePortal.d.ts +9 -0
  51. package/dist/index.d.ts +6 -0
  52. package/dist/index.js +156 -36
  53. package/dist/styles/compiler.d.ts +25 -0
  54. package/dist/styles/index.d.ts +2 -0
  55. package/dist/styles/theme.d.ts +495 -0
  56. package/dist/styles/types.d.ts +66 -0
  57. package/package.json +31 -28
  58. package/dist/index.css +0 -1
package/README.md CHANGED
@@ -1,45 +1,63 @@
1
1
  # [stoop](https://github.com/dolmios/stoop)
2
2
 
3
- > A small component library for quickly spinning up a pretty Next.js project.
3
+ > A lightweight, polymorphic React component library with intuitive design tokens and built-in theming system.
4
4
 
5
5
  ![Stoop Kid Steps Off](https://nomeatballs.files.wordpress.com/2012/08/stoop-kid-steps-off.png)
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```sh
10
+ npm install stoop
11
+ # or
10
12
  bun add stoop
11
13
  ```
12
14
 
13
15
  ## Usage
14
16
 
15
- ### Global Styles
17
+ ### Setup Provider
16
18
 
17
- Import the global styles in your app:
19
+ Wrap your app with the `StoopProvider`:
18
20
 
19
21
  ```tsx
20
- import "stoop/globalStyles";
22
+ import { StoopProvider } from "stoop";
23
+
24
+ function App() {
25
+ return (
26
+ <StoopProvider theme="light">
27
+ {/* Your app content */}
28
+ </StoopProvider>
29
+ );
30
+ }
21
31
  ```
22
32
 
23
33
  ### Using Components
24
34
 
25
35
  ```tsx
26
- import { Button } from "stoop";
36
+ import { Stack, Text, Button } from "stoop";
27
37
 
28
38
  function MyComponent() {
29
- return <Button>Click me</Button>;
39
+ return (
40
+ <Stack gap="medium">
41
+ <Text as="h1">Welcome</Text>
42
+ <Button>Click me</Button>
43
+ </Stack>
44
+ );
30
45
  }
31
46
  ```
32
47
 
33
- ### Using CSS Variables
34
-
35
- The theme system provides CSS variables that you can use in your components:
48
+ ### Theme Switching
36
49
 
37
- ```css
38
- .my-component {
39
- color: var(--color-text);
40
- background-color: var(--color-background);
41
- padding: var(--space-medium);
42
- border-radius: var(--radius-small);
50
+ ```tsx
51
+ import { useTheme, Button } from "stoop";
52
+
53
+ function ThemeToggle() {
54
+ const { themeName, setTheme } = useTheme();
55
+
56
+ return (
57
+ <Button onClick={() => setTheme(themeName === 'light' ? 'dark' : 'light')}>
58
+ Switch to {themeName === 'light' ? 'Dark' : 'Light'}
59
+ </Button>
60
+ );
43
61
  }
44
62
  ```
45
63
 
@@ -0,0 +1,13 @@
1
+ import type { JSX } from "react";
2
+ import type { BadgeProps } from "./types";
3
+ /**
4
+ * Badge - Display component for labels, status, and categories
5
+ *
6
+ * Solid color design with dark background and light text
7
+ * Can be clickable with hover states
8
+ *
9
+ * Examples:
10
+ * <Badge>New</Badge>
11
+ * <Badge clickable>Interactive</Badge>
12
+ */
13
+ export declare function Badge({ bottom, clickable, css, top, ...props }: BadgeProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const BadgeStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ clickable?: boolean | "false" | "true";
3
+ } & import("react").RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,13 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ import type { SpacingToken } from "../../styles/theme";
3
+ import type { CSSObject } from "../../styles/types";
4
+ export interface BadgeProps extends ComponentPropsWithoutRef<"span"> {
5
+ /** Whether the badge is clickable */
6
+ clickable?: boolean;
7
+ /** Add margin-top */
8
+ top?: SpacingToken;
9
+ /** Add margin-bottom */
10
+ bottom?: SpacingToken;
11
+ /** Custom CSS styles */
12
+ css?: CSSObject;
13
+ }
@@ -0,0 +1,14 @@
1
+ import type { JSX } from "react";
2
+ import type { ButtonProps } from "./types";
3
+ /**
4
+ * Button - Interactive button component
5
+ *
6
+ * Sharp edges design with brand colors and multiple variants
7
+ * Supports loading states, sizing, and polymorphic rendering
8
+ *
9
+ * Examples:
10
+ * <Button variant="primary">Primary Action</Button>
11
+ * <Button variant="secondary" size="small">Secondary</Button>
12
+ * <Button as="a" href="/link">Link Button</Button>
13
+ */
14
+ export declare function Button({ block, bottom, children, css, disabled, loading, size, top, variant, ...props }: ButtonProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ export declare const ButtonStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ variant?: boolean | "minimal" | "primary" | "secondary";
3
+ block?: boolean | "false" | "true";
4
+ loading?: boolean | "false" | "true";
5
+ size?: boolean | "small" | "normal";
6
+ } & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,22 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ import type { SpacingToken } from "../../styles/theme";
3
+ import type { CSSObject } from "../../styles/types";
4
+ /**
5
+ * Button component props
6
+ */
7
+ export interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
8
+ /** Button variant */
9
+ variant?: "primary" | "secondary" | "minimal";
10
+ /** Button size */
11
+ size?: "normal" | "small";
12
+ /** Full width button */
13
+ block?: boolean;
14
+ /** Loading state */
15
+ loading?: boolean;
16
+ /** Add margin-top */
17
+ top?: SpacingToken;
18
+ /** Add margin-bottom */
19
+ bottom?: SpacingToken;
20
+ /** Custom CSS styles */
21
+ css?: CSSObject;
22
+ }
@@ -0,0 +1,14 @@
1
+ import type { JSX } from "react";
2
+ import type { CardProps } from "./types";
3
+ /**
4
+ * Card - Container component for grouping related content
5
+ *
6
+ * Sharp edges design with multiple variants and optional header/footer
7
+ * Supports interactive states and flexible padding
8
+ *
9
+ * Examples:
10
+ * <Card variant="default">Basic card content</Card>
11
+ * <Card variant="bordered" header="Title">Card with header</Card>
12
+ * <Card clickable padding="default">Interactive card</Card>
13
+ */
14
+ export declare function Card({ as, children, clickable, css, footer, header, onClick, padding, variant, ...props }: CardProps): JSX.Element;
@@ -0,0 +1,16 @@
1
+ export declare const CardStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ variant?: boolean | "default" | "bordered";
3
+ padding?: boolean | "small" | "default" | "minimal";
4
+ clickable?: boolean | "false" | "true";
5
+ } & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const CardHeaderStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
7
+ padding?: boolean | "small" | "default" | "minimal";
8
+ } & import("react").RefAttributes<HTMLDivElement>>;
9
+ export declare const CardFooterStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
10
+ padding?: boolean | "small" | "default" | "minimal";
11
+ } & import("react").RefAttributes<HTMLDivElement>>;
12
+ export declare const CardContentStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
13
+ padding?: boolean | "small" | "default" | "minimal";
14
+ hasFooter?: boolean | "false" | "true";
15
+ hasHeader?: boolean | "false" | "true";
16
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode, JSX } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
4
+ /** HTML element to render as */
5
+ as?: keyof JSX.IntrinsicElements;
6
+ /** Header content */
7
+ header?: ReactNode;
8
+ /** Footer content */
9
+ footer?: ReactNode;
10
+ /** Card variant */
11
+ variant?: "default" | "bordered";
12
+ /** Padding size */
13
+ padding?: "default" | "small" | "minimal";
14
+ /** Whether the card is interactive/clickable */
15
+ clickable?: boolean;
16
+ /** Custom CSS styles */
17
+ css?: CSSObject;
18
+ }
@@ -0,0 +1,13 @@
1
+ import { JSX } from "react";
2
+ import type { InputProps } from "./types";
3
+ /**
4
+ * Input - Form input component with clean, accessible design
5
+ *
6
+ * Sharp edges design with consistent styling and form validation support
7
+ * Supports all native input attributes
8
+ *
9
+ * Examples:
10
+ * <Input placeholder="Enter text" />
11
+ * <Input state="error" />
12
+ */
13
+ export declare function Input({ state, ...props }: InputProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const InputStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ variant?: boolean | "error" | "default";
3
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface InputProps extends ComponentPropsWithoutRef<"input"> {
4
+ /** Input state */
5
+ state?: "default" | "error";
6
+ /** Custom CSS styles */
7
+ css?: CSSObject;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "react";
2
+ import type { MenuProps } from "./types";
3
+ /**
4
+ * Menu - Dropdown menu component with trigger and options
5
+ *
6
+ * Sharp edges design with customizable triggers and option handling
7
+ * Supports keyboard navigation and outside click to close
8
+ *
9
+ * Examples:
10
+ * <Menu trigger={<Button>Open Menu</Button>} options={menuOptions} />
11
+ * <Menu trigger="Click me" options={options} onSelection={handleSelect} />
12
+ */
13
+ export declare function Menu({ children, css, initial, logo, onSelection, options, trigger, triggerCss, ...props }: MenuProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare const MenuTriggerStyled: 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 MenuOverlayStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const MenuStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
4
+ variant?: boolean | "default" | "elevated";
5
+ } & import("react").RefAttributes<HTMLDivElement>>;
6
+ export declare const MenuItemStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
7
+ variant?: boolean | "default" | "danger";
8
+ } & import("react").RefAttributes<HTMLDivElement>>;
9
+ export declare const MenuDividerStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,26 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface MenuOption {
4
+ value: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ iconPosition?: "left" | "right";
8
+ }
9
+ export interface MenuProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
10
+ /** Trigger element that opens the menu */
11
+ trigger: ReactNode;
12
+ /** Array of menu options */
13
+ options: MenuOption[];
14
+ /** Initially selected option value */
15
+ initial?: string;
16
+ /** Logo or header content */
17
+ logo?: ReactNode;
18
+ /** Custom content (can be function that receives close callback) */
19
+ children?: ReactNode | ((close: () => void) => ReactNode);
20
+ /** Called when menu option is selected */
21
+ onSelection?: (value: string, label: string) => void;
22
+ /** Custom CSS for trigger */
23
+ triggerCss?: CSSObject;
24
+ /** Custom CSS for menu content */
25
+ css?: CSSObject;
26
+ }
@@ -0,0 +1,14 @@
1
+ import { type JSX } from "react";
2
+ import type { ModalProps } from "./types";
3
+ /**
4
+ * Modal - Overlay modal component with trigger interaction
5
+ *
6
+ * Provides a trigger element that opens a modal when clicked.
7
+ * Uses portal rendering and manages focus/escape behavior automatically.
8
+ * Includes built-in header with title and close button.
9
+ *
10
+ * Examples:
11
+ * <Modal trigger={<Button>Open Modal</Button>} title="My Modal">Modal content</Modal>
12
+ * <Modal trigger="Custom trigger" title="Settings" small>Small modal form</Modal>
13
+ */
14
+ export declare function Modal({ children, css, disabled, small, title, trigger, triggerCss, ...props }: ModalProps): JSX.Element;
@@ -0,0 +1,14 @@
1
+ export declare const ModalTriggerStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ disabled?: boolean | "true";
3
+ } & import("react").RefAttributes<HTMLDivElement>>;
4
+ export declare const ModalBackdropStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
5
+ export declare const ModalStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
6
+ small?: boolean | "true";
7
+ variant?: boolean | "default" | "bordered";
8
+ isOpen?: boolean | "true";
9
+ } & import("react").RefAttributes<HTMLDivElement>>;
10
+ export declare const ModalHeaderStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
11
+ export declare const ModalTitleStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLHeadingElement>>;
12
+ export declare const ModalCloseButtonStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLButtonElement>>;
13
+ export declare const ModalContentStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
14
+ export declare const ModalFooterStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface ModalProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
4
+ /** Trigger element that opens the modal */
5
+ trigger: ReactNode;
6
+ /** Modal title displayed in header */
7
+ title: string;
8
+ /** Content to display in modal (can be function that receives close callback) */
9
+ children: ReactNode | ((close: () => void) => ReactNode);
10
+ /** Whether to use small modal size (280px vs 600px max-width) */
11
+ small?: boolean;
12
+ /** Whether the modal is disabled */
13
+ disabled?: boolean;
14
+ /** Custom CSS styles for the modal content */
15
+ css?: CSSObject;
16
+ /** Custom CSS styles for the trigger */
17
+ triggerCss?: CSSObject;
18
+ }
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "react";
2
+ import type { PopoverProps } from "./types";
3
+ /**
4
+ * Popover - Floating content overlay with trigger interaction
5
+ *
6
+ * Provides a trigger element that opens floating content when clicked.
7
+ * Uses portal rendering and manages focus/escape behavior automatically.
8
+ *
9
+ * Examples:
10
+ * <Popover trigger={<Button>Click me</Button>}>Popover content</Popover>
11
+ * <Popover trigger="Custom trigger" variant="minimal">Content</Popover>
12
+ */
13
+ export declare function Popover({ children, css, disabled, trigger, triggerCss, variant, ...props }: PopoverProps): JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const PopoverTriggerStyled: 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 PopoverStyled: 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>>;
@@ -0,0 +1,16 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface PopoverProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
4
+ /** Trigger element that opens the popover */
5
+ trigger: ReactNode;
6
+ /** Content to display in popover (can be function that receives close callback) */
7
+ children: ReactNode | ((close: () => void) => ReactNode);
8
+ /** Popover variant - default has padding, minimal has no padding */
9
+ variant?: "default" | "minimal";
10
+ /** Whether popover is disabled */
11
+ disabled?: boolean;
12
+ /** Custom CSS for trigger */
13
+ triggerCss?: CSSObject;
14
+ /** Custom CSS for popover content */
15
+ css?: CSSObject;
16
+ }
@@ -0,0 +1,10 @@
1
+ import type { Theme } from "../../styles/types";
2
+ /**
3
+ * Generate global CSS styles based on current theme
4
+ */
5
+ export declare function createGlobalStyles(theme?: Theme): string;
6
+ /**
7
+ * Inject global styles into the document head with theme support
8
+ * Automatically removes previous styles when theme changes
9
+ */
10
+ export declare function injectGlobalStyles(theme?: Theme): void;
@@ -0,0 +1,41 @@
1
+ import { type JSX, type ReactNode } from "react";
2
+ import type { ThemeName, Theme } from "../../styles/types";
3
+ export interface StoopProviderConfig {
4
+ /** Whether to inject global styles and CSS reset */
5
+ injectGlobalStyles?: boolean;
6
+ /** Custom CSS to inject */
7
+ customCSS?: string;
8
+ /** Initial theme (defaults to 'light') */
9
+ theme?: ThemeName;
10
+ }
11
+ interface StoopContextValue extends StoopProviderConfig {
12
+ currentTheme: Theme;
13
+ themeName: ThemeName;
14
+ toggleTheme: () => void;
15
+ setTheme: (theme: ThemeName) => void;
16
+ }
17
+ declare const StoopContext: import("react").Context<StoopContextValue>;
18
+ export interface StoopProviderProps {
19
+ children: ReactNode;
20
+ config?: StoopProviderConfig;
21
+ }
22
+ /**
23
+ * Stoop UI Provider - Sets up global styles, configuration, and theming
24
+ * Wrap your app with this component to enable Stoop UI components
25
+ * Theme choice persists across browser sessions
26
+ */
27
+ export declare function StoopProvider({ children, config, }: StoopProviderProps): JSX.Element;
28
+ /**
29
+ * Hook to access Stoop UI configuration
30
+ */
31
+ export declare function useStoopConfig(): StoopContextValue;
32
+ /**
33
+ * Hook to access current theme and theme controls
34
+ */
35
+ export declare function useTheme(): {
36
+ theme: Theme;
37
+ themeName: ThemeName;
38
+ toggleTheme: () => void;
39
+ setTheme: (theme: ThemeName) => void;
40
+ };
41
+ export { StoopContext };
@@ -0,0 +1,2 @@
1
+ export { StoopProvider, useStoopConfig, useTheme, StoopContext, type StoopProviderProps, type StoopProviderConfig, } from "./StoopProvider";
2
+ export { createGlobalStyles, injectGlobalStyles } from "./GlobalStyles";
@@ -0,0 +1,15 @@
1
+ import type { JSX } from "react";
2
+ import type { SectionProps } from "./types";
3
+ /**
4
+ * Section - Page layout wrapper component
5
+ *
6
+ * Creates a standardized page section with optional max-width container
7
+ * Similar to the old View component but simplified for our design system
8
+ *
9
+ * Examples:
10
+ * <Section>Content with standard container</Section>
11
+ * <Section container={false}>Full-width content</Section>
12
+ * <Section wide>Wider container for app layouts</Section>
13
+ * <Section as="main" top="large" bottom="huge">Semantic HTML with spacing</Section>
14
+ */
15
+ export declare function Section({ as, bottom, children, container, css, top, wide, ...props }: SectionProps): JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const SectionStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLElement>>;
2
+ export declare const ContainerStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
3
+ container?: boolean | "false" | "true";
4
+ wide?: boolean | "false" | "true";
5
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ import type { ComponentPropsWithoutRef, ElementType } from "react";
2
+ import type { SpacingToken } from "../../styles/theme";
3
+ import type { CSSObject } from "../../styles/types";
4
+ /**
5
+ * Section component props - page layout wrapper
6
+ */
7
+ export interface SectionProps extends ComponentPropsWithoutRef<"section"> {
8
+ /** Override the HTML element */
9
+ as?: ElementType;
10
+ /** Apply standard max-width container (default: true) */
11
+ container?: boolean;
12
+ /** Wide container for app-level layouts */
13
+ wide?: boolean;
14
+ /** Top padding using spacing tokens */
15
+ top?: SpacingToken;
16
+ /** Bottom padding using spacing tokens */
17
+ bottom?: SpacingToken;
18
+ /** Custom CSS */
19
+ css?: CSSObject;
20
+ }
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "react";
2
+ import type { SelectProps } from "./types";
3
+ /**
4
+ * Select - Dropdown selection component with filtering and search
5
+ *
6
+ * Provides a searchable dropdown with keyboard navigation and portal rendering.
7
+ * Supports custom options with icons and loading states.
8
+ *
9
+ * Examples:
10
+ * <Select options={options} onSelection={handleSelect} />
11
+ * <Select options={options} filter label="Choose option" />
12
+ */
13
+ export declare function Select({ css, disabled, filter, initial, label, loading, onSelection, options, trigger, triggerCss, ...props }: SelectProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ export declare const SelectTriggerStyled: 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 SelectDropdownStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
3
+ export declare const SelectLabelStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
4
+ export declare const SelectFilterStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
5
+ export declare const SelectItemStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export declare const SelectEmptyStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
7
+ export declare const SelectLoadingStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {} & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,30 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import type { CSSObject } from "../../styles/types";
3
+ export interface SelectOption {
4
+ value: string;
5
+ label: string;
6
+ icon?: ReactNode;
7
+ iconPosition?: "left" | "right";
8
+ }
9
+ export interface SelectProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
10
+ /** Trigger element that opens the select */
11
+ trigger: ReactNode;
12
+ /** Array of select options */
13
+ options: SelectOption[];
14
+ /** Initially selected option value */
15
+ initial?: string;
16
+ /** Optional label for the dropdown */
17
+ label?: string;
18
+ /** Whether to show filter/search */
19
+ filter?: boolean;
20
+ /** Whether the select is loading */
21
+ loading?: boolean;
22
+ /** Whether the select is disabled */
23
+ disabled?: boolean;
24
+ /** Called when option is selected */
25
+ onSelection?: (value: string, label: string) => void;
26
+ /** Custom CSS for trigger */
27
+ triggerCss?: CSSObject;
28
+ /** Custom CSS for dropdown content */
29
+ css?: CSSObject;
30
+ }
@@ -0,0 +1,16 @@
1
+ import { JSX } from "react";
2
+ import type { StackProps } from "./types";
3
+ /**
4
+ * Stack - Comprehensive layout component
5
+ *
6
+ * Handles all flexbox layouts - replaces the need for separate Flex component
7
+ * Supports both container properties (direction, gap, align) and item properties (grow, shrink, basis)
8
+ * Can be used as any HTML element via 'as' prop
9
+ *
10
+ * Examples:
11
+ * <Stack direction="row" gap="large" justify="between"> // Horizontal layout
12
+ * <Stack align="center" textAlign="center"> // Vertical centered
13
+ * <Stack as="section" direction="row" minimal> // Semantic HTML
14
+ * <Stack grow={1} shrink={0} basis="200px"> // As flex item
15
+ */
16
+ export declare function Stack({ align, alignContent, as, basis, bottom, children, css, direction, gap, grow, inline, justify, minimal, shrink, textAlign, top, wrap, ...props }: StackProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ export declare const StackStyled: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../../styles/types").StyledBaseProps & {
2
+ inline?: boolean | "false" | "true";
3
+ alignContent?: boolean | "center" | "end" | "start" | "stretch" | "between" | "around";
4
+ direction?: boolean | "column" | "column-reverse" | "row" | "row-reverse";
5
+ textAlign?: boolean | "center" | "left" | "right" | "justify";
6
+ wrap?: boolean | "reverse" | "false" | "true";
7
+ justify?: boolean | "center" | "end" | "start" | "between" | "around" | "evenly";
8
+ align?: boolean | "center" | "end" | "start" | "stretch" | "baseline";
9
+ minimal?: boolean | "false" | "true";
10
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,42 @@
1
+ import type { ComponentPropsWithoutRef, ElementType } from "react";
2
+ import type { SpacingToken } from "../../styles/theme";
3
+ import type { CSSObject } from "../../styles/types";
4
+ /**
5
+ * Stack component props - comprehensive layout component
6
+ */
7
+ export interface StackProps extends ComponentPropsWithoutRef<"div"> {
8
+ /** Override the HTML element */
9
+ as?: ElementType;
10
+ /** Direction of the stack */
11
+ direction?: "row" | "column" | "row-reverse" | "column-reverse";
12
+ /** Render as inline-flex instead of flex */
13
+ inline?: boolean;
14
+ /** Gap between items */
15
+ gap?: SpacingToken;
16
+ /** Remove default padding (useful for row direction) */
17
+ minimal?: boolean;
18
+ /** Alignment of items along cross-axis */
19
+ align?: "start" | "center" | "end" | "stretch" | "baseline";
20
+ /** Justification along main axis */
21
+ justify?: "start" | "center" | "end" | "between" | "around" | "evenly";
22
+ /** Whether items should wrap */
23
+ wrap?: boolean | "reverse";
24
+ /** Align multiple lines (when wrapped) */
25
+ alignContent?: "start" | "center" | "end" | "between" | "around" | "stretch";
26
+ /** Flex grow factor */
27
+ grow?: number;
28
+ /** Flex shrink factor */
29
+ shrink?: number;
30
+ /** Flex basis */
31
+ basis?: string;
32
+ /** Order in flex container */
33
+ order?: number;
34
+ /** Text alignment */
35
+ textAlign?: "left" | "center" | "right" | "justify";
36
+ /** Add padding-top and remove margin-top */
37
+ top?: SpacingToken;
38
+ /** Add padding-bottom and remove margin-bottom */
39
+ bottom?: SpacingToken;
40
+ /** Custom CSS */
41
+ css?: CSSObject;
42
+ }