@stackloop/ui 4.0.6 → 4.0.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 +26 -0
- package/dist/Tooltip.d.ts +19 -0
- package/dist/assets/index-DHBqG65w.js +17 -0
- package/dist/assets/index-Z5A9fp3I.css +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.html +2 -2
- package/dist/index.js +1766 -1627
- package/dist/index.js.map +1 -1
- package/dist/stackloop-ui.css +1 -1
- package/package.json +1 -1
- package/dist/assets/index-ClujkPIe.js +0 -17
- package/dist/assets/index-dTMgJbB4.css +0 -1
package/README.md
CHANGED
|
@@ -616,6 +616,32 @@ Call `setupRippleEffects()` only once per app (for example in `main.tsx`) to avo
|
|
|
616
616
|
<Dropdown options={[{value:'a',label:'A'}]} value={val} onChange={setVal} searchable />
|
|
617
617
|
```
|
|
618
618
|
|
|
619
|
+
**Tooltip**:
|
|
620
|
+
- **Description:** Portal-based tooltip for short hints and context text. It renders outside normal layout flow (so it does not affect element positioning), supports top/bottom/left/right placement, auto-flips when space is limited, and stays visible above overflow-clipped containers.
|
|
621
|
+
- **Props:**
|
|
622
|
+
- **`children`**: `ReactNode` — required. Trigger element.
|
|
623
|
+
- **`content`**: `ReactNode` — required. Tooltip body.
|
|
624
|
+
- **`side`**: `'top' | 'bottom' | 'left' | 'right'` — preferred side (default: `'bottom'`).
|
|
625
|
+
- **`offset`**: `number` — gap between trigger and tooltip (default: `10`).
|
|
626
|
+
- **`delay`**: `number` — open delay in ms (default: `120`).
|
|
627
|
+
- **`showArrow`**: `boolean` — default: `true`.
|
|
628
|
+
- **`arrowSize`**: `number` — default: `10`.
|
|
629
|
+
- **`open`**, **`defaultOpen`**, **`onOpenChange`** — controlled/uncontrolled visibility.
|
|
630
|
+
- **`className`**, **`arrowClassName`**, **`disabled`** — optional styling/behavior controls.
|
|
631
|
+
- **Usage:**
|
|
632
|
+
|
|
633
|
+
```jsx
|
|
634
|
+
import { Tooltip, Button } from '@stackloop/ui'
|
|
635
|
+
|
|
636
|
+
<Tooltip content="More actions">
|
|
637
|
+
<Button variant="ghost">Hover me</Button>
|
|
638
|
+
</Tooltip>
|
|
639
|
+
|
|
640
|
+
<Tooltip content="Delete item" side="top" showArrow>
|
|
641
|
+
<Button variant="danger">Delete</Button>
|
|
642
|
+
</Tooltip>
|
|
643
|
+
```
|
|
644
|
+
|
|
619
645
|
**Select**:
|
|
620
646
|
- **Description:** **Form-specific** select component with label, error, hint, and validation support. Specifically designed for use in forms with proper semantics, accessibility, and validation integration. Use this component when building forms. For general UI selections (navigation, filters, etc.), use the **Dropdown** component instead. Based on Dropdown but includes form-specific features like `required` prop, hint text, and better integration with form libraries (React Hook Form, Formik, etc.).
|
|
621
647
|
- **Props:**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
side?: TooltipSide;
|
|
7
|
+
offset?: number;
|
|
8
|
+
delay?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
showArrow?: boolean;
|
|
15
|
+
arrowSize?: number;
|
|
16
|
+
arrowClassName?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
19
|
+
export {};
|