@data-slot/ui 0.2.85 → 0.2.87

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Headless UI components for vanilla JavaScript. Tiny, accessible, unstyled.
4
4
 
5
- **~3KB gzipped** for the full bundle. Zero dependencies. Tree-shakeable.
5
+ **Subpaths range from 614 B to 6.2 KB gzipped** (ESM `dist/index.js`). Zero dependencies. Tree-shakeable.
6
6
 
7
7
  ## Installation
8
8
 
@@ -16,16 +16,20 @@ This is a convenience package that re-exports all `@data-slot/*` packages:
16
16
 
17
17
  | Package | Size | Description |
18
18
  |---------|------|-------------|
19
- | `@data-slot/dialog` | 1.2 KB | Modal dialogs with focus management |
20
- | `@data-slot/tabs` | 1.1 KB | Tabbed interfaces with keyboard nav |
21
- | `@data-slot/accordion` | 938 B | Collapsible content sections |
22
- | `@data-slot/popover` | 856 B | Anchored floating content |
23
- | `@data-slot/hover-card` | 2.1 KB | Hover/focus preview cards |
24
- | `@data-slot/tooltip` | 772 B | Hover/focus tooltips |
25
- | `@data-slot/collapsible` | 710 B | Simple show/hide toggle |
26
- | `@data-slot/navigation-menu` | ~1.5 KB | Mega menus with hover/keyboard |
27
- | `@data-slot/combobox` | ~3 KB | Autocomplete input with filtering |
28
- | `@data-slot/core` | 452 B | Shared utilities |
19
+ | `@data-slot/navigation-menu` | 6.2 KB | Dropdown navigation menus |
20
+ | `@data-slot/core` | 4.5 KB | Shared utilities |
21
+ | `@data-slot/combobox` | 3.7 KB | Autocomplete input with filtering |
22
+ | `@data-slot/select` | 3.7 KB | Select input with keyboard navigation |
23
+ | `@data-slot/dropdown-menu` | 2.4 KB | Action menus with keyboard navigation |
24
+ | `@data-slot/hover-card` | 2.0 KB | Hover/focus preview cards |
25
+ | `@data-slot/tabs` | 1.8 KB | Tabbed interfaces with keyboard nav |
26
+ | `@data-slot/popover` | 1.8 KB | Anchored floating content |
27
+ | `@data-slot/dialog` | 1.8 KB | Modal dialogs with focus management |
28
+ | `@data-slot/toggle-group` | 1.5 KB | Single/multi toggle groups |
29
+ | `@data-slot/collapsible` | 1.5 KB | Simple show/hide toggle |
30
+ | `@data-slot/accordion` | 1.3 KB | Collapsible content sections |
31
+ | `@data-slot/tooltip` | 1.1 KB | Hover/focus tooltips |
32
+ | `@data-slot/toggle` | 614 B | Pressed-state toggle button |
29
33
 
30
34
  ## Usage
31
35
 
@@ -48,6 +52,10 @@ Available subpaths:
48
52
  - `@data-slot/ui/tooltip`
49
53
  - `@data-slot/ui/collapsible`
50
54
  - `@data-slot/ui/navigation-menu`
55
+ - `@data-slot/ui/dropdown-menu`
56
+ - `@data-slot/ui/toggle`
57
+ - `@data-slot/ui/toggle-group`
58
+ - `@data-slot/ui/select`
51
59
  - `@data-slot/ui/combobox`
52
60
 
53
61
  ### Direct Package Imports
package/dist/index4.d.cts CHANGED
@@ -7,7 +7,7 @@ interface HoverCardOptions {
7
7
  defaultOpen?: boolean;
8
8
  /** Controlled open state. Internal interactions do not mutate when set. */
9
9
  open?: boolean;
10
- /** Delay before opening on hover/focus (ms). @default 700 */
10
+ /** Delay before opening on hover/keyboard focus (ms). @default 700 */
11
11
  delay?: number;
12
12
  /** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. @default 300 */
13
13
  skipDelayDuration?: number;
package/dist/index4.d.ts CHANGED
@@ -7,7 +7,7 @@ interface HoverCardOptions {
7
7
  defaultOpen?: boolean;
8
8
  /** Controlled open state. Internal interactions do not mutate when set. */
9
9
  open?: boolean;
10
- /** Delay before opening on hover/focus (ms). @default 700 */
10
+ /** Delay before opening on hover/keyboard focus (ms). @default 700 */
11
11
  delay?: number;
12
12
  /** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. @default 300 */
13
13
  skipDelayDuration?: number;
package/dist/index7.d.cts CHANGED
@@ -7,10 +7,20 @@ interface TooltipOptions {
7
7
  delay?: number;
8
8
  /** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. Default: 300 */
9
9
  skipDelayDuration?: number;
10
- /** Side of tooltip relative to trigger. Default: 'top'. Set at bind time only. */
10
+ /** Preferred side of tooltip relative to trigger. Default: 'top'. */
11
11
  side?: TooltipSide;
12
- /** Alignment along the side. Default: 'center'. Set at bind time only. */
12
+ /** Preferred alignment along the side. Default: 'center'. */
13
13
  align?: TooltipAlign;
14
+ /** Distance from trigger in pixels. Default: 4 */
15
+ sideOffset?: number;
16
+ /** Alignment-axis offset in pixels. Default: 0 */
17
+ alignOffset?: number;
18
+ /** Enable collision handling. Default: true */
19
+ avoidCollisions?: boolean;
20
+ /** Viewport edge padding used by collision handling. Default: 8 */
21
+ collisionPadding?: number;
22
+ /** Portal content to body while open. Default: true */
23
+ portal?: boolean;
14
24
  /** Callback when visibility changes */
15
25
  onOpenChange?: (open: boolean) => void;
16
26
  }
@@ -38,15 +48,15 @@ interface TooltipController {
38
48
  * ```
39
49
  *
40
50
  * Data attributes (checked on content first, then root):
41
- * - `data-side`: 'top' | 'right' | 'bottom' | 'left' (bind-time only)
42
- * - `data-align`: 'start' | 'center' | 'end' (bind-time only)
51
+ * - `data-side`: 'top' | 'right' | 'bottom' | 'left' (bind-time preferred side)
52
+ * - `data-align`: 'start' | 'center' | 'end' (bind-time preferred align)
53
+ * - `data-side-offset`: number (px)
54
+ * - `data-align-offset`: number (px)
55
+ * - `data-avoid-collisions`: boolean
56
+ * - `data-collision-padding`: number (px)
43
57
  * - `data-delay`: number (ms)
44
58
  * - `data-skip-delay-duration`: number (ms)
45
59
  *
46
- * Note: side and align are resolved once at bind time. To change placement,
47
- * destroy and recreate the tooltip with new options.
48
- *
49
- * This tooltip uses simple CSS positioning (not collision-aware).
50
60
  * Opens on hover (non-touch) and focus. Touch devices: focus-only.
51
61
  * Content is hoverable: moving pointer from trigger to content keeps it open.
52
62
  * Tooltip stays open while trigger has focus, even if pointer leaves.
package/dist/index7.d.ts CHANGED
@@ -7,10 +7,20 @@ interface TooltipOptions {
7
7
  delay?: number;
8
8
  /** Duration to skip delay after closing (ms). Set to 0 to disable warm-up. Default: 300 */
9
9
  skipDelayDuration?: number;
10
- /** Side of tooltip relative to trigger. Default: 'top'. Set at bind time only. */
10
+ /** Preferred side of tooltip relative to trigger. Default: 'top'. */
11
11
  side?: TooltipSide;
12
- /** Alignment along the side. Default: 'center'. Set at bind time only. */
12
+ /** Preferred alignment along the side. Default: 'center'. */
13
13
  align?: TooltipAlign;
14
+ /** Distance from trigger in pixels. Default: 4 */
15
+ sideOffset?: number;
16
+ /** Alignment-axis offset in pixels. Default: 0 */
17
+ alignOffset?: number;
18
+ /** Enable collision handling. Default: true */
19
+ avoidCollisions?: boolean;
20
+ /** Viewport edge padding used by collision handling. Default: 8 */
21
+ collisionPadding?: number;
22
+ /** Portal content to body while open. Default: true */
23
+ portal?: boolean;
14
24
  /** Callback when visibility changes */
15
25
  onOpenChange?: (open: boolean) => void;
16
26
  }
@@ -38,15 +48,15 @@ interface TooltipController {
38
48
  * ```
39
49
  *
40
50
  * Data attributes (checked on content first, then root):
41
- * - `data-side`: 'top' | 'right' | 'bottom' | 'left' (bind-time only)
42
- * - `data-align`: 'start' | 'center' | 'end' (bind-time only)
51
+ * - `data-side`: 'top' | 'right' | 'bottom' | 'left' (bind-time preferred side)
52
+ * - `data-align`: 'start' | 'center' | 'end' (bind-time preferred align)
53
+ * - `data-side-offset`: number (px)
54
+ * - `data-align-offset`: number (px)
55
+ * - `data-avoid-collisions`: boolean
56
+ * - `data-collision-padding`: number (px)
43
57
  * - `data-delay`: number (ms)
44
58
  * - `data-skip-delay-duration`: number (ms)
45
59
  *
46
- * Note: side and align are resolved once at bind time. To change placement,
47
- * destroy and recreate the tooltip with new options.
48
- *
49
- * This tooltip uses simple CSS positioning (not collision-aware).
50
60
  * Opens on hover (non-touch) and focus. Touch devices: focus-only.
51
61
  * Content is hoverable: moving pointer from trigger to content keeps it open.
52
62
  * Tooltip stays open while trigger has focus, even if pointer leaves.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-slot/ui",
3
- "version": "0.2.85",
3
+ "version": "0.2.87",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Headless UI components for vanilla JavaScript. Convenience re-exports from @data-slot/* packages.",
@@ -166,20 +166,20 @@
166
166
  "build": "tsdown"
167
167
  },
168
168
  "dependencies": {
169
- "@data-slot/core": "0.2.85",
170
- "@data-slot/tabs": "0.2.85",
171
- "@data-slot/dialog": "0.2.85",
172
- "@data-slot/accordion": "0.2.85",
173
- "@data-slot/popover": "0.2.85",
174
- "@data-slot/hover-card": "0.2.85",
175
- "@data-slot/tooltip": "0.2.85",
176
- "@data-slot/collapsible": "0.2.85",
177
- "@data-slot/navigation-menu": "0.2.85",
178
- "@data-slot/dropdown-menu": "0.2.85",
179
- "@data-slot/toggle": "0.2.85",
180
- "@data-slot/toggle-group": "0.2.85",
181
- "@data-slot/select": "0.2.85",
182
- "@data-slot/combobox": "0.2.85"
169
+ "@data-slot/core": "0.2.87",
170
+ "@data-slot/tabs": "0.2.87",
171
+ "@data-slot/dialog": "0.2.87",
172
+ "@data-slot/accordion": "0.2.87",
173
+ "@data-slot/popover": "0.2.87",
174
+ "@data-slot/hover-card": "0.2.87",
175
+ "@data-slot/tooltip": "0.2.87",
176
+ "@data-slot/collapsible": "0.2.87",
177
+ "@data-slot/navigation-menu": "0.2.87",
178
+ "@data-slot/dropdown-menu": "0.2.87",
179
+ "@data-slot/toggle": "0.2.87",
180
+ "@data-slot/toggle-group": "0.2.87",
181
+ "@data-slot/select": "0.2.87",
182
+ "@data-slot/combobox": "0.2.87"
183
183
  },
184
184
  "keywords": [
185
185
  "headless",