@kortix/ui 0.15.7 → 0.15.9

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 (262) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +39 -1
  3. package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
  4. package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
  5. package/dist/access/access/access-dialog-share.js +12 -6
  6. package/dist/access/access/share-selection.d.ts +9 -0
  7. package/dist/access/access/share-selection.js +64 -0
  8. package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
  9. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  10. package/dist/customize/connectors/connector-identity.js +3 -3
  11. package/dist/customize/connectors/detail/app-page.js +2 -2
  12. package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
  13. package/dist/customize/connectors/detail/connector-accounts.js +2 -2
  14. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  15. package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
  16. package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
  17. package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
  18. package/dist/customize/connectors/detail/connector-notice.js +23 -4
  19. package/dist/customize/connectors/detail/connector-page.js +27 -7
  20. package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
  21. package/dist/customize/connectors/detail/connector-status.js +11 -0
  22. package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
  23. package/dist/customize/connectors/detail/status-badge.js +2 -1
  24. package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
  25. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
  26. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
  27. package/dist/customize/providers/provider-accordion.js +5 -4
  28. package/dist/customize/providers/provider-connect.js +3 -1
  29. package/dist/customize/providers/provider-sheet.js +9 -4
  30. package/dist/customize/sections/component/email-connect-form.js +4 -2
  31. package/dist/customize/sections/connectors-view.d.ts +4 -1
  32. package/dist/customize/sections/connectors-view.js +42 -7
  33. package/dist/customize/sections/gateway-view.d.ts +1 -1
  34. package/dist/customize/sections/gateway-view.js +1 -1
  35. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
  36. package/dist/customize/sections/view/account-secret-resources-panel.js +48 -7
  37. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  38. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  39. package/dist/customize/sections/view/git-view.js +1 -1
  40. package/dist/customize/sections/view/permission-editor.js +1 -1
  41. package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
  42. package/dist/customize/sections/view/secret-delivery.js +14 -4
  43. package/dist/customize/sections/view/secrets-view.js +21 -5
  44. package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
  45. package/dist/customize/sections/view/subscription-usage.js +2 -86
  46. package/dist/customize/shared/entity/entity-modal.js +8 -10
  47. package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
  48. package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
  49. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
  50. package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
  51. package/dist/customize/triggers/schedule/then-fields.js +8 -4
  52. package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
  53. package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
  54. package/dist/customize/triggers/schedule/trigger-list.js +18 -2
  55. package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
  56. package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
  57. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  58. package/dist/files/project/components/drive-toolbar.js +1 -1
  59. package/dist/files/project/store/version-store.d.ts +1 -1
  60. package/dist/files/renderers/pptx-renderer.js +5 -20
  61. package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
  62. package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
  63. package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
  64. package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
  65. package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
  66. package/dist/files/renderers/presentation/presentation-utils.js +4 -0
  67. package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
  68. package/dist/files/renderers/presentation/slide-iframe.js +61 -0
  69. package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
  70. package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
  71. package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
  72. package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
  73. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  74. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  75. package/dist/files/renderers/shared/select-compat.js +3 -7
  76. package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
  77. package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
  78. package/dist/files/renderers/show-content-renderer.js +16 -11
  79. package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
  80. package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
  81. package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
  82. package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
  83. package/dist/files/viewer/file-content-renderer.js +1 -4
  84. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  85. package/dist/files/viewer/file-preview-modal.js +17 -18
  86. package/dist/files/viewer/use-file-content-state.js +10 -9
  87. package/dist/i18n/en.d.ts +51 -0
  88. package/dist/i18n/en.js +58 -7
  89. package/dist/index.js +1 -1
  90. package/dist/internal/account-hub/account-hub-location.js +2 -2
  91. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  92. package/dist/internal/account-hub/use-account-members.js +27 -10
  93. package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
  94. package/dist/internal/chrome/use-chrome-offered.js +4 -2
  95. package/dist/internal/components/agent-mark.d.ts +1 -8
  96. package/dist/internal/components/agent-mark.js +2 -19
  97. package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
  98. package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
  99. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
  100. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
  101. package/dist/internal/lib/error-handler.js +33 -0
  102. package/dist/internal/lib/navigation/modified-click.js +2 -2
  103. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  104. package/dist/internal/lib/pixel-mark.js +3 -34
  105. package/dist/internal/lib/trigger-clock.d.ts +7 -2
  106. package/dist/internal/lib/trigger-clock.js +17 -3
  107. package/dist/internal/stores/active-space-store.d.ts +1 -1
  108. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  109. package/dist/internal/stores/current-account-store.d.ts +1 -1
  110. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  111. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  112. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  113. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  114. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  115. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  116. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  117. package/dist/internal/stores/session-hover-store.js +1 -1
  118. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  119. package/dist/internal/stores/sound-store.d.ts +1 -1
  120. package/dist/internal/stores/tab-store.d.ts +1 -1
  121. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  122. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  123. package/dist/lib/base-ui-compat.d.ts +149 -0
  124. package/dist/lib/base-ui-compat.js +339 -0
  125. package/dist/lib/portal-container.d.ts +3 -7
  126. package/dist/lib/portal-container.js +5 -3
  127. package/dist/lib/z-stack.d.ts +9 -5
  128. package/dist/lib/z-stack.js +17 -7
  129. package/dist/primitives/accordion.d.ts +36 -5
  130. package/dist/primitives/accordion.js +41 -8
  131. package/dist/primitives/alert-dialog.d.ts +33 -11
  132. package/dist/primitives/alert-dialog.js +41 -19
  133. package/dist/primitives/avatar.d.ts +5 -2
  134. package/dist/primitives/avatar.js +3 -3
  135. package/dist/primitives/badge.js +1 -1
  136. package/dist/primitives/breadcrumb.js +1 -1
  137. package/dist/primitives/button-group.js +3 -3
  138. package/dist/primitives/button.js +1 -1
  139. package/dist/primitives/checkbox.d.ts +14 -5
  140. package/dist/primitives/checkbox.js +24 -9
  141. package/dist/primitives/collapsible.d.ts +16 -4
  142. package/dist/primitives/collapsible.js +18 -7
  143. package/dist/primitives/command-core.d.ts +121 -0
  144. package/dist/primitives/command-core.js +642 -0
  145. package/dist/primitives/command.d.ts +38 -4
  146. package/dist/primitives/command.js +22 -13
  147. package/dist/primitives/context-menu.d.ts +61 -31
  148. package/dist/primitives/context-menu.js +40 -53
  149. package/dist/primitives/dialog.d.ts +48 -10
  150. package/dist/primitives/dialog.js +48 -19
  151. package/dist/primitives/disclosure.d.ts +1 -1
  152. package/dist/primitives/disclosure.js +2 -2
  153. package/dist/primitives/drawer.d.ts +28 -9
  154. package/dist/primitives/drawer.js +42 -18
  155. package/dist/primitives/dropdown-menu.d.ts +55 -33
  156. package/dist/primitives/dropdown-menu.js +46 -82
  157. package/dist/primitives/faded-scroll-area.js +2 -1
  158. package/dist/primitives/hint.js +3 -3
  159. package/dist/primitives/hover-card.d.ts +17 -5
  160. package/dist/primitives/hover-card.js +45 -8
  161. package/dist/primitives/item.js +2 -2
  162. package/dist/primitives/label.d.ts +5 -2
  163. package/dist/primitives/label.js +10 -3
  164. package/dist/primitives/menu-base.d.ts +150 -0
  165. package/dist/primitives/menu-base.js +171 -0
  166. package/dist/primitives/menu-recipe.d.ts +1 -1
  167. package/dist/primitives/menu-recipe.js +2 -7
  168. package/dist/primitives/modal.d.ts +19 -52
  169. package/dist/primitives/modal.js +24 -28
  170. package/dist/primitives/navigation-menu.d.ts +36 -11
  171. package/dist/primitives/navigation-menu.js +31 -12
  172. package/dist/primitives/popover.d.ts +31 -6
  173. package/dist/primitives/popover.js +79 -12
  174. package/dist/primitives/preview-image.d.ts +18 -7
  175. package/dist/primitives/preview-image.js +14 -11
  176. package/dist/primitives/progress.d.ts +4 -2
  177. package/dist/primitives/progress.js +4 -3
  178. package/dist/primitives/project-icon-picker.js +2 -2
  179. package/dist/primitives/radio-group.d.ts +28 -5
  180. package/dist/primitives/radio-group.js +18 -10
  181. package/dist/primitives/scroll-area.d.ts +2 -2
  182. package/dist/primitives/scroll-area.js +8 -3
  183. package/dist/primitives/select.d.ts +55 -12
  184. package/dist/primitives/select.js +93 -36
  185. package/dist/primitives/separator.d.ts +6 -2
  186. package/dist/primitives/separator.js +10 -2
  187. package/dist/primitives/sheet.d.ts +17 -10
  188. package/dist/primitives/sheet.js +19 -22
  189. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  190. package/dist/primitives/slider-native.d.ts +2 -2
  191. package/dist/primitives/slider-native.js +11 -9
  192. package/dist/primitives/slider.d.ts +24 -6
  193. package/dist/primitives/slider.js +26 -24
  194. package/dist/primitives/slot.d.ts +6 -0
  195. package/dist/primitives/slot.js +7 -0
  196. package/dist/primitives/split-sheet.js +1 -1
  197. package/dist/primitives/stepper.js +1 -1
  198. package/dist/primitives/switch.d.ts +16 -3
  199. package/dist/primitives/switch.js +7 -6
  200. package/dist/primitives/tabs.d.ts +36 -20
  201. package/dist/primitives/tabs.js +131 -102
  202. package/dist/primitives/toggle.d.ts +16 -3
  203. package/dist/primitives/toggle.js +8 -3
  204. package/dist/primitives/tooltip.d.ts +24 -5
  205. package/dist/primitives/tooltip.js +32 -10
  206. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  207. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  208. package/dist/session/composer/animated-placeholder.js +1 -1
  209. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  210. package/dist/session/composer/editor/composer-editor.js +1 -1
  211. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  212. package/dist/session/composer/menus/menu-shell.js +1 -1
  213. package/dist/session/composer/menus/mount.js +1 -1
  214. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  215. package/dist/session/header/session-site-header.js +2 -2
  216. package/dist/session/header/subagent-hover-card.js +2 -2
  217. package/dist/session/media/image-preview.js +1 -1
  218. package/dist/session/models/model-connection-gate.js +16 -3
  219. package/dist/session/models/model-picker-panel.js +6 -2
  220. package/dist/session/models/model-selector.d.ts +1 -1
  221. package/dist/session/models/model-selector.js +18 -12
  222. package/dist/session/models/provider-key-action.d.ts +10 -0
  223. package/dist/session/models/provider-key-action.js +35 -0
  224. package/dist/session/models/provider-key-slot.d.ts +9 -0
  225. package/dist/session/models/provider-key-slot.js +19 -0
  226. package/dist/session/models/subscription-switcher.d.ts +37 -0
  227. package/dist/session/models/subscription-switcher.js +97 -0
  228. package/dist/session/models/subscription-windows.d.ts +40 -0
  229. package/dist/session/models/subscription-windows.js +86 -0
  230. package/dist/session/overrides/session-overrides-control.js +3 -3
  231. package/dist/session/panel/diff-dialog.js +1 -1
  232. package/dist/session/panel/easy/detail-view.js +3 -3
  233. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  234. package/dist/session/panel/panel-fallback.js +1 -1
  235. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  236. package/dist/session/panel/session-files-explorer.js +1 -1
  237. package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
  238. package/dist/session/prompts/session-connect-prompt.js +126 -0
  239. package/dist/session/status/session-error-banner.d.ts +1 -1
  240. package/dist/session/status/session-error-banner.js +12 -4
  241. package/dist/session/thread/session-chat.js +9 -4
  242. package/dist/session/thread/session-context-message-explorer.js +1 -1
  243. package/dist/session/thread/transcript.js +31 -7
  244. package/dist/session/thread/turn-share.js +3 -4
  245. package/dist/session/tool/shared/show-helpers.js +1 -1
  246. package/dist/session/turn/message-time-label.js +1 -1
  247. package/dist/styles.css +1 -1
  248. package/dist/test-utils/intl.d.ts +51 -0
  249. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  250. package/dist/workspace/review/review-center.js +1 -1
  251. package/dist/workspace/sessions/session-row.js +1 -1
  252. package/dist/workspace/sidebar/project-session-list.js +2 -2
  253. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  254. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  255. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  256. package/dist/workspace/sidebar/session-title.js +2 -2
  257. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  258. package/dist/workspace/spaces/space-links.js +1 -1
  259. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  260. package/package.json +16 -35
  261. package/skills/kortix-ui/SKILL.md +1 -1
  262. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
@@ -1,10 +1,11 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { spring } from '../lib/springs.js';
4
- import { cn } from '../lib/utils.js';
5
- import * as SwitchPrimitive from '@radix-ui/react-switch';
3
+ import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
6
4
  import { animate, m, useMotionValue } from 'motion/react';
7
5
  import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
6
+ import { checkedState, stateRender, controlRender } from '../lib/base-ui-compat.js';
7
+ import { spring } from '../lib/springs.js';
8
+ import { cn } from '../lib/utils.js';
8
9
  // Track is `w-[34px] h-[20px]` in the className — keep it in sync with these.
9
10
  const TRACK_WIDTH = 34;
10
11
  const THUMB_SIZE = 16;
@@ -102,7 +103,7 @@ const Switch = forwardRef(({ label, checked, onCheckedChange, disabled = false,
102
103
  }, [isChecked, onCheckedChange, motionX]);
103
104
  const switchControl = (_jsx(SwitchPrimitive.Root, { ref: ref, id: id, checked: checked, disabled: disabled, tabIndex: 0, className: cn('group/switch relative h-[20px] w-[34px] shrink-0 touch-none rounded-full outline-none', // pointer comes from the global rule; disabled keeps the default cursor
104
105
  'transition-colors duration-80', 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-1 focus-visible:ring-offset-2',
105
- // Colours come from Radix's `data-state`, never from JS state.
106
+ // Colours come from `data-state` (checked / unchecked), never from JS state.
106
107
  // Off is translucent ink, so one class reads in both themes and on
107
108
  // any panel. Thumb vs track (WCAG 1.4.11, 3:1), worst of page /
108
109
  // card / muted: rest 3.13:1, hover 4.13:1. On: white thumb 3.23:1.
@@ -113,7 +114,7 @@ const Switch = forwardRef(({ label, checked, onCheckedChange, disabled = false,
113
114
  if (didDrag.current)
114
115
  return;
115
116
  onCheckedChange?.(nextChecked);
116
- }, ...props, children: _jsx(SwitchPrimitive.Thumb, { asChild: true, children: _jsx(m.span, { className: cn('duration-fast absolute top-0 left-0 rounded-full shadow-sm transition-colors', 'data-[state=checked]:bg-white',
117
+ }, ...props, nativeButton: true, render: controlRender(checkedState), children: _jsx(SwitchPrimitive.Thumb, { render: stateRender('span', checkedState, _jsx(m.span, { className: cn('duration-fast absolute top-0 left-0 rounded-full shadow-sm transition-colors', 'data-[state=checked]:bg-white',
117
118
  // A white thumb on the light off track would be ~1.25:1.
118
119
  'data-[state=unchecked]:bg-foreground/45 group-hover/switch:data-[state=unchecked]:bg-foreground/55'), initial: false,
119
120
  // Motion value binding for drag, not a colour or layout style.
@@ -121,7 +122,7 @@ const Switch = forwardRef(({ label, checked, onCheckedChange, disabled = false,
121
122
  y: thumbY,
122
123
  width: thumbWidth,
123
124
  height: thumbHeight,
124
- }, transition: hasMounted.current ? spring.moderate : { duration: 0 } }) }) }));
125
+ }, transition: hasMounted.current ? spring.moderate : { duration: 0 } })) }) }));
125
126
  if (!label) {
126
127
  return switchControl;
127
128
  }
@@ -1,5 +1,4 @@
1
- import * as TabsPrimitive from "@radix-ui/react-tabs";
2
- import * as React from "react";
1
+ import * as React from 'react';
3
2
  declare const tabsTriggerPaddingVariants: (props?: ({
4
3
  size?: "default" | "xs" | "sm" | "lg" | "md" | null | undefined;
5
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -10,22 +9,22 @@ declare const tabsTriggerHeightVariants: (props?: ({
10
9
  declare const tabsTriggerTextVariants: (props?: ({
11
10
  size?: "default" | "xs" | "sm" | "lg" | "md" | null | undefined;
12
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
- type TabsTriggerSize = "xs" | "sm" | "default" | "md";
14
- type TabsSize = TabsTriggerSize | "lg";
12
+ type TabsTriggerSize = 'xs' | 'sm' | 'default' | 'md';
13
+ type TabsSize = TabsTriggerSize | 'lg';
15
14
  /**
16
15
  * `default` is the filled pill; `outline` is a bordered active chip;
17
16
  * `segmented` is the raised surface chip of a segmented control.
18
17
  */
19
- type TabsTriggerVariant = "default" | "outline" | "secondary" | "segmented";
18
+ type TabsTriggerVariant = 'default' | 'outline' | 'secondary' | 'segmented';
20
19
  /** Stroke thickness of the active underline rule (`type="underline"` only). */
21
- type TabsUnderlineSize = "xs" | "sm" | "md" | "lg";
20
+ type TabsUnderlineSize = 'xs' | 'sm' | 'md' | 'lg';
22
21
  /**
23
22
  * `default` is the segmented control: a recessed track whose active tab is a
24
23
  * raised surface chip. `segmented` is the same control, kept as an explicit
25
24
  * name. `underline` is the flat rule. A vertical list (a settings rail) is
26
25
  * never segmented.
27
26
  */
28
- type TabsListType = "default" | "underline" | "secondary" | "segmented";
27
+ type TabsListType = 'default' | 'underline' | 'secondary' | 'segmented';
29
28
  /**
30
29
  * Segmented track + chip. Radii are concentric: the track is `rounded-md` (8px)
31
30
  * with 2px of padding, so the chip is `rounded-sm` (6px). The chip lifts with a
@@ -39,36 +38,53 @@ type TabsListType = "default" | "underline" | "secondary" | "segmented";
39
38
  */
40
39
  declare const tabsSegmentedTrackClasses = "bg-muted rounded-md p-[2px]";
41
40
  declare const tabsSegmentedChipClasses = "bg-popover ring-border rounded-sm shadow-xs ring-1";
42
- declare function Tabs({ className, value, defaultValue, onValueChange, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
43
- interface TabsListProps extends React.ComponentProps<typeof TabsPrimitive.List> {
41
+ type TabsProps = Omit<React.ComponentProps<'div'>, 'defaultValue' | 'dir'> & {
42
+ value?: string;
43
+ defaultValue?: string;
44
+ onValueChange?: (value: string) => void;
45
+ orientation?: 'horizontal' | 'vertical';
46
+ activationMode?: 'automatic' | 'manual';
47
+ dir?: 'ltr' | 'rtl';
48
+ };
49
+ declare function Tabs({ className, value, defaultValue, onValueChange, activationMode, orientation, ...props }: TabsProps): React.JSX.Element;
50
+ interface TabsListProps extends React.ComponentProps<'div'> {
51
+ /** Radix `loop`: arrow keys wrap from the last tab to the first. Default `true`. */
52
+ loop?: boolean;
44
53
  type?: TabsListType;
45
54
  /**
46
55
  * `segmented` renders the segmented control (recessed track + raised chip):
47
56
  * `<TabsList variant="segmented">`. Same as `type="segmented"`; `variant`
48
57
  * wins when both are set.
49
58
  */
50
- variant?: "default" | "secondary" | "segmented";
59
+ variant?: 'default' | 'secondary' | 'segmented';
51
60
  size?: TabsSize;
52
61
  /** Active underline stroke. Only applies when `type="underline"`. Default `sm`. */
53
62
  underlineSize?: TabsUnderlineSize;
54
- animate?: "fluid" | "none";
63
+ animate?: 'fluid' | 'none';
55
64
  /**
56
65
  * `vertical` stacks triggers full-width in a column (e.g. a settings
57
66
  * rail) instead of laying them out inline. This is a styling switch only —
58
- * `aria-orientation` still comes from `orientation` on the `Tabs` root, per
59
- * Radix. Default `horizontal`.
67
+ * `aria-orientation` still comes from `orientation` on the `Tabs` root.
68
+ * Default `horizontal`.
60
69
  */
61
- orientation?: "horizontal" | "vertical";
70
+ orientation?: 'horizontal' | 'vertical';
62
71
  }
63
72
  declare function TabsList(props: TabsListProps): React.JSX.Element;
64
- declare function TabsTrigger({ className, size: sizeProp, variant, value, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
73
+ declare function TabsTrigger({ className, size: sizeProp, variant, value, asChild, children, onMouseDown, disabled, ref, ...props }: Omit<React.ComponentProps<'button'>, 'value'> & {
74
+ value: string;
75
+ asChild?: boolean;
65
76
  size?: TabsTriggerSize;
66
77
  variant?: TabsTriggerVariant;
67
78
  }): React.JSX.Element;
68
- declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
79
+ declare function TabsContent({ className, forceMount, asChild, children, ...props }: Omit<React.ComponentProps<'div'>, 'value'> & {
80
+ value: string;
81
+ /** Keep the panel's content mounted while inactive (hidden). */
82
+ forceMount?: true;
83
+ asChild?: boolean;
84
+ }): React.JSX.Element;
69
85
  /** Standalone filter pill bar — works WITHOUT a <Tabs> root. Use for filter bars, mode toggles. */
70
- declare function FilterBar({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
86
+ declare function FilterBar({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
71
87
  /** Standalone filter pill — works WITHOUT a <Tabs> root. Pair with FilterBar. */
72
- declare function FilterBarItem({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
73
- export { tabsSegmentedChipClasses, tabsSegmentedTrackClasses, FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, TabsTrigger, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
74
- export type { TabsListType, TabsSize, TabsTriggerSize, TabsTriggerVariant, TabsUnderlineSize, };
88
+ declare function FilterBarItem({ className, ...props }: React.ComponentProps<'button'>): React.JSX.Element;
89
+ export { FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, tabsSegmentedChipClasses, tabsSegmentedTrackClasses, TabsTrigger, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
90
+ export type { TabsListProps, TabsListType, TabsProps, TabsSize, TabsTriggerSize, TabsTriggerVariant, TabsUnderlineSize, };
@@ -1,65 +1,66 @@
1
- "use client";
1
+ 'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as TabsPrimitive from "@radix-ui/react-tabs";
4
- import { cva } from "class-variance-authority";
5
- import * as React from "react";
6
- import { SlidingTabIndicator } from "./sliding-tab-indicator.js";
7
- import { cn } from "../lib/utils.js";
8
- const tabsTriggerPaddingVariants = cva("", {
3
+ import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
4
+ import { cva } from 'class-variance-authority';
5
+ import * as React from 'react';
6
+ import { asChildRender, composeRefs, controlRender, stateRender, useNativeButton, } from '../lib/base-ui-compat.js';
7
+ import { cn } from '../lib/utils.js';
8
+ import { SlidingTabIndicator } from './sliding-tab-indicator.js';
9
+ const tabsTriggerPaddingVariants = cva('', {
9
10
  variants: {
10
11
  size: {
11
- default: "gap-2 px-4 py-2 has-[>svg]:px-3",
12
- xs: "gap-1.5 px-2.5 has-[>svg]:px-2",
13
- sm: "gap-1.5 px-3 has-[>svg]:px-2.5",
14
- md: "gap-2 px-5 has-[>svg]:px-4",
15
- lg: "gap-2 px-6 has-[>svg]:px-4",
12
+ default: 'gap-2 px-4 py-2 has-[>svg]:px-3',
13
+ xs: 'gap-1.5 px-2.5 has-[>svg]:px-2',
14
+ sm: 'gap-1.5 px-3 has-[>svg]:px-2.5',
15
+ md: 'gap-2 px-5 has-[>svg]:px-4',
16
+ lg: 'gap-2 px-6 has-[>svg]:px-4',
16
17
  },
17
18
  },
18
19
  defaultVariants: {
19
- size: "default",
20
+ size: 'default',
20
21
  },
21
22
  });
22
- const tabsTriggerHeightVariants = cva("", {
23
+ const tabsTriggerHeightVariants = cva('', {
23
24
  variants: {
24
25
  size: {
25
- default: "h-8",
26
- xs: "h-7",
27
- sm: "h-8",
28
- md: "h-10",
29
- lg: "h-10",
26
+ default: 'h-8',
27
+ xs: 'h-7',
28
+ sm: 'h-8',
29
+ md: 'h-10',
30
+ lg: 'h-10',
30
31
  },
31
32
  },
32
33
  defaultVariants: {
33
- size: "default",
34
+ size: 'default',
34
35
  },
35
36
  });
36
37
  /** Shared tab typography for web and desktop. */
37
- const tabsTriggerTextVariants = cva("font-medium", {
38
+ const tabsTriggerTextVariants = cva('font-medium', {
38
39
  variants: {
39
40
  size: {
40
- default: "text-sm",
41
- xs: "text-xs rounded-sm",
42
- sm: "text-xs",
43
- md: "text-sm",
44
- lg: "text-sm",
41
+ default: 'text-sm',
42
+ xs: 'text-xs rounded-sm',
43
+ sm: 'text-xs',
44
+ md: 'text-sm',
45
+ lg: 'text-sm',
45
46
  },
46
47
  },
47
48
  defaultVariants: {
48
- size: "default",
49
+ size: 'default',
49
50
  },
50
51
  });
51
52
  const tabsListHeightClasses = {
52
- default: "h-9",
53
- xs: "h-6",
54
- sm: "h-8",
55
- md: "h-10",
56
- lg: "h-10",
53
+ default: 'h-9',
54
+ xs: 'h-6',
55
+ sm: 'h-8',
56
+ md: 'h-10',
57
+ lg: 'h-10',
57
58
  };
58
59
  const tabsUnderlineBorderClasses = {
59
- xs: "**:data-[slot=tabs-trigger]:after:h-px",
60
- sm: "**:data-[slot=tabs-trigger]:after:h-[1.5px]",
61
- md: "**:data-[slot=tabs-trigger]:after:h-0.5",
62
- lg: "**:data-[slot=tabs-trigger]:after:h-[3px]",
60
+ xs: '**:data-[slot=tabs-trigger]:after:h-px',
61
+ sm: '**:data-[slot=tabs-trigger]:after:h-[1.5px]',
62
+ md: '**:data-[slot=tabs-trigger]:after:h-0.5',
63
+ lg: '**:data-[slot=tabs-trigger]:after:h-[3px]',
63
64
  };
64
65
  /** Shared underline-list chrome; indicator height comes from `underlineSize`. */
65
66
  const tabsListUnderlineBaseClasses = "border-border **:data-[slot=tabs-trigger]:data-[state=inactive]:text-muted-foreground text-muted-foreground **:data-[slot=tabs-trigger]:data-[state=active]:text-foreground inline-flex w-fit items-center justify-center gap-0 rounded-none border-b **:data-[slot=tabs-trigger]:relative **:data-[slot=tabs-trigger]:h-full **:data-[slot=tabs-trigger]:rounded-none **:data-[slot=tabs-trigger]:border-0 **:data-[slot=tabs-trigger]:bg-transparent **:data-[slot=tabs-trigger]:shadow-none **:data-[slot=tabs-trigger]:after:pointer-events-none **:data-[slot=tabs-trigger]:after:absolute **:data-[slot=tabs-trigger]:after:inset-x-0 **:data-[slot=tabs-trigger]:after:bottom-0 **:data-[slot=tabs-trigger]:after:rounded-full **:data-[slot=tabs-trigger]:after:bg-transparent **:data-[slot=tabs-trigger]:after:content-[''] **:data-[slot=tabs-trigger]:data-[state=active]:bg-transparent **:data-[slot=tabs-trigger]:data-[state=active]:shadow-none **:data-[slot=tabs-trigger]:data-[state=active]:after:bg-foreground **:data-[slot=tabs-trigger]:data-[state=inactive]:bg-transparent";
@@ -74,132 +75,160 @@ const tabsListUnderlineBaseClasses = "border-border **:data-[slot=tabs-trigger]:
74
75
  * a pixel rounds differently on each side — 1px of track on one end and none on
75
76
  * the other at 1x. A whole 2px leaves exactly 1px on every side.
76
77
  */
77
- const tabsSegmentedTrackClasses = "bg-muted rounded-md p-[2px]";
78
- const tabsSegmentedChipClasses = "bg-popover ring-border rounded-sm shadow-xs ring-1";
78
+ const tabsSegmentedTrackClasses = 'bg-muted rounded-md p-[2px]';
79
+ const tabsSegmentedChipClasses = 'bg-popover ring-border rounded-sm shadow-xs ring-1';
79
80
  function resolveTabsTriggerSize(sizeProp, listSize) {
80
81
  if (sizeProp)
81
82
  return sizeProp;
82
- if (listSize === "xs")
83
- return "xs";
84
- if (listSize === "lg")
85
- return "md";
83
+ if (listSize === 'xs')
84
+ return 'xs';
85
+ if (listSize === 'lg')
86
+ return 'md';
86
87
  return listSize;
87
88
  }
88
- const TabsActiveValueContext = React.createContext("");
89
- const TabsListTypeContext = React.createContext("default");
90
- const TabsAnimateContext = React.createContext("none");
91
- const TabsSizeContext = React.createContext("default");
89
+ const TabsActiveValueContext = React.createContext('');
90
+ const TabsListTypeContext = React.createContext('default');
91
+ const TabsAnimateContext = React.createContext('none');
92
+ const TabsSizeContext = React.createContext('default');
92
93
  /** Lets `TabsTrigger` adapt to a vertical `TabsList` without every caller re-passing orientation. */
93
- const TabsOrientationContext = React.createContext("horizontal");
94
- function Tabs({ className, value, defaultValue, onValueChange, ...props }) {
95
- const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? "");
94
+ const TabsOrientationContext = React.createContext('horizontal');
95
+ /** Radix: `automatic` selects a tab when it gets focus, `manual` on press only. */
96
+ const TabsActivationContext = React.createContext('automatic');
97
+ const TabsRootOrientationContext = React.createContext('horizontal');
98
+ /** Radix's ids: `<base>-trigger-<value>` and `<base>-content-<value>`, so SSR markup links tab and panel. */
99
+ const TabsBaseIdContext = React.createContext('');
100
+ /** Selects a tab. Radix selects on primary-button mousedown, before the click. */
101
+ const TabsSelectContext = React.createContext(() => { });
102
+ const tabId = (base, value) => `${base}-trigger-${value}`;
103
+ const panelId = (base, value) => `${base}-content-${value}`;
104
+ const activeState = (s) => s.active === false || s.hidden ? 'inactive' : 'active';
105
+ function Tabs({ className, value, defaultValue, onValueChange, activationMode = 'automatic', orientation = 'horizontal', ...props }) {
106
+ const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? '');
96
107
  const activeValue = value !== undefined ? value : uncontrolledValue;
108
+ const baseId = React.useId();
97
109
  const handleValueChange = React.useCallback((next) => {
110
+ if (next === activeValue)
111
+ return;
98
112
  if (value === undefined) {
99
113
  setUncontrolledValue(next);
100
114
  }
101
115
  onValueChange?.(next);
102
- }, [onValueChange, value]);
103
- return (_jsx(TabsActiveValueContext.Provider, { value: activeValue, children: _jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn("flex flex-col gap-2", className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, ...props }) }));
116
+ }, [activeValue, onValueChange, value]);
117
+ return (_jsx(TabsActiveValueContext.Provider, { value: activeValue, children: _jsx(TabsActivationContext.Provider, { value: activationMode, children: _jsx(TabsRootOrientationContext.Provider, { value: orientation, children: _jsx(TabsBaseIdContext.Provider, { value: baseId, children: _jsx(TabsSelectContext.Provider, { value: handleValueChange, children: _jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, className: cn('flex flex-col gap-2', className), orientation: orientation, ...props,
118
+ // Always controlled: Base UI selects its first tab when it owns an empty value; Radix selects none.
119
+ value: activeValue, onValueChange: (next) => handleValueChange(String(next)) }) }) }) }) }) }));
104
120
  }
105
121
  function TabsList(props) {
106
- return (_jsx(TabsListRenderer, { ...props, orientation: props.orientation ?? "horizontal" }));
122
+ return _jsx(TabsListRenderer, { ...props, orientation: props.orientation ?? 'horizontal' });
107
123
  }
108
- function TabsListRenderer({ className, type: typeProp = "default", variant, size = "default", underlineSize = "sm", animate = "none", orientation, children, ...props }) {
124
+ function TabsListRenderer({ className, type: typeProp = 'default', variant, size = 'default', underlineSize = 'sm', animate = 'none', orientation, children, loop = true, ...props }) {
109
125
  const activeValue = React.useContext(TabsActiveValueContext);
110
- const isVertical = orientation === "vertical";
111
- const requested = variant === "secondary"
112
- ? "secondary"
113
- : variant === "segmented"
114
- ? "segmented"
115
- : typeProp;
126
+ const activationMode = React.useContext(TabsActivationContext);
127
+ const rootOrientation = React.useContext(TabsRootOrientationContext);
128
+ const isVertical = orientation === 'vertical';
129
+ const requested = variant === 'secondary' ? 'secondary' : variant === 'segmented' ? 'segmented' : typeProp;
116
130
  // Every horizontal list that is not `underline` is the segmented control.
117
131
  // Triggers read the resolved type from context, so a vertical rail keeps its
118
132
  // own row styling.
119
- const type = requested === "underline" || requested === "secondary"
133
+ const type = requested === 'underline' || requested === 'secondary'
120
134
  ? requested
121
135
  : isVertical
122
- ? "default"
123
- : "segmented";
124
- const isSegmented = type === "segmented";
125
- const useSlidingIndicator = isSegmented && animate === "fluid";
126
- const trackClassName = cn("text-muted-foreground inline-flex w-fit items-center justify-center", tabsListHeightClasses[size], tabsSegmentedTrackClasses, className);
127
- const list = (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn(type === "secondary" &&
128
- cn("inline-flex w-fit items-center gap-0.5", tabsListHeightClasses[size]), isSegmented &&
129
- "relative z-10 flex h-full w-full items-stretch justify-center gap-0.5", !isVertical && type === "underline" && tabsListUnderlineBaseClasses, !isVertical &&
130
- type === "underline" &&
131
- tabsUnderlineBorderClasses[underlineSize], !isVertical && type === "underline" && tabsListHeightClasses[size], isVertical &&
132
- "flex h-auto w-full flex-col items-stretch gap-0.5 rounded-none bg-transparent p-0", className), ...props, children: children }));
136
+ ? 'default'
137
+ : 'segmented';
138
+ const isSegmented = type === 'segmented';
139
+ const useSlidingIndicator = isSegmented && animate === 'fluid';
140
+ const trackClassName = cn('text-muted-foreground inline-flex w-fit items-center justify-center', tabsListHeightClasses[size], tabsSegmentedTrackClasses, className);
141
+ const list = (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn(type === 'secondary' &&
142
+ cn('inline-flex w-fit items-center gap-0.5', tabsListHeightClasses[size]), isSegmented && 'relative z-10 flex h-full w-full items-stretch justify-center gap-0.5', !isVertical && type === 'underline' && tabsListUnderlineBaseClasses, !isVertical && type === 'underline' && tabsUnderlineBorderClasses[underlineSize], !isVertical && type === 'underline' && tabsListHeightClasses[size], isVertical &&
143
+ 'flex h-auto w-full flex-col items-stretch gap-0.5 rounded-none bg-transparent p-0', className), ...props, "aria-orientation": rootOrientation, activateOnFocus: activationMode === 'automatic', loopFocus: loop, children: children }));
133
144
  // The sliding pill indicator only measures the x-axis (see
134
145
  // SlidingTabIndicator) — in a column it would collapse to a
135
146
  // zero-width bar, so vertical lists render without it.
136
- const content = isVertical || type === "underline" || type === "secondary" ? (list) : useSlidingIndicator ? (_jsx(SlidingTabIndicator, { activeId: activeValue, className: trackClassName, indicatorClassName: tabsSegmentedChipClasses, children: list })) : (_jsx("div", { className: trackClassName, children: list }));
137
- return (_jsx(TabsListTypeContext.Provider, { value: type, children: _jsx(TabsAnimateContext.Provider, { value: animate, children: _jsx(TabsSizeContext.Provider, { value: size, children: _jsx(TabsOrientationContext.Provider, { value: orientation ?? "horizontal", children: content }) }) }) }));
147
+ const content = isVertical || type === 'underline' || type === 'secondary' ? (list) : useSlidingIndicator ? (_jsx(SlidingTabIndicator, { activeId: activeValue, className: trackClassName, indicatorClassName: tabsSegmentedChipClasses, children: list })) : (_jsx("div", { className: trackClassName, children: list }));
148
+ return (_jsx(TabsListTypeContext.Provider, { value: type, children: _jsx(TabsAnimateContext.Provider, { value: animate, children: _jsx(TabsSizeContext.Provider, { value: size, children: _jsx(TabsOrientationContext.Provider, { value: orientation ?? 'horizontal', children: content }) }) }) }));
138
149
  }
139
- function TabsTrigger({ className, size: sizeProp, variant = "default", value, ...props }) {
150
+ function TabsTrigger({ className, size: sizeProp, variant = 'default', value, asChild, children, onMouseDown, disabled, ref, ...props }) {
151
+ const slot = asChildRender(asChild, children);
152
+ const baseId = React.useContext(TabsBaseIdContext);
153
+ const select = React.useContext(TabsSelectContext);
154
+ // Radix sets the native `disabled` attribute on a disabled trigger. Base UI
155
+ // clears it (in a layout effect and its ref) to keep the tab focusable; this
156
+ // effect runs after both, because a child's layout effects run first.
157
+ const buttonRef = React.useRef(null);
158
+ const native = useNativeButton(asChild, children);
159
+ const mergedRef = React.useMemo(() => composeRefs(ref, buttonRef, native.ref), [ref, native.ref]);
160
+ React.useLayoutEffect(() => {
161
+ const node = buttonRef.current;
162
+ if (node?.tagName === 'BUTTON')
163
+ node.disabled = Boolean(disabled);
164
+ }, [disabled]);
140
165
  const listType = React.useContext(TabsListTypeContext);
141
166
  const animate = React.useContext(TabsAnimateContext);
142
167
  const listSize = React.useContext(TabsSizeContext);
143
168
  const listOrientation = React.useContext(TabsOrientationContext);
144
169
  const size = resolveTabsTriggerSize(sizeProp, listSize);
145
- const isUnderlineList = listType === "underline";
170
+ const isUnderlineList = listType === 'underline';
146
171
  // A segmented trigger either sits in a segmented list (the list's sliding
147
172
  // chip paints the active state) or asks for it alone with
148
173
  // `variant="segmented"` (it paints its own chip — there is no track to slide in).
149
- const isSegmentedList = listType === "segmented";
174
+ const isSegmentedList = listType === 'segmented';
150
175
  // An explicit `variant="outline"` keeps its bordered chip even in a segmented list.
151
- const isSecondary = !isUnderlineList && (variant === "secondary" || listType === "secondary");
152
- const isOutline = !isUnderlineList && !isSecondary && variant === "outline";
153
- const isSegmented = !isUnderlineList &&
154
- !isOutline &&
155
- !isSecondary &&
156
- (isSegmentedList || variant === "segmented");
176
+ const isSecondary = !isUnderlineList && (variant === 'secondary' || listType === 'secondary');
177
+ const isOutline = !isUnderlineList && !isSecondary && variant === 'outline';
178
+ const isSegmented = !isUnderlineList && !isOutline && !isSecondary && (isSegmentedList || variant === 'segmented');
157
179
  // Outline paints its own border; the sliding pill fill would fight it.
158
180
  const useSlidingIndicator = !isUnderlineList &&
159
181
  !isSecondary &&
160
182
  !isOutline &&
161
183
  (!isSegmented || isSegmentedList) &&
162
- animate === "fluid";
163
- const isVertical = listOrientation === "vertical";
164
- return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", "data-sliding-tab": useSlidingIndicator ? value : undefined, "data-variant": variant, value: value, className: cn("focus-visible:ring-kortix-blue duration-normal ease-default inline-flex flex-1 cursor-pointer items-center justify-center rounded-[calc(var(--radius)-2.5px)] border border-transparent whitespace-nowrap transition-[color,background-color,border-color,box-shadow] focus-visible:ring-[0.6px] focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", tabsTriggerTextVariants({ size }), tabsTriggerPaddingVariants({ size }), isUnderlineList || isSegmentedList
165
- ? "h-full"
166
- : tabsTriggerHeightVariants({ size }),
184
+ animate === 'fluid';
185
+ const isVertical = listOrientation === 'vertical';
186
+ return (_jsx(TabsPrimitive.Tab, { "data-slot": "tabs-trigger", "data-sliding-tab": useSlidingIndicator ? value : undefined, "data-variant": variant, value: value, className: cn("focus-visible:ring-kortix-blue duration-normal ease-default inline-flex flex-1 cursor-pointer items-center justify-center rounded-[calc(var(--radius)-2.5px)] border border-transparent whitespace-nowrap transition-[color,background-color,border-color,box-shadow] focus-visible:ring-[0.6px] focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", tabsTriggerTextVariants({ size }), tabsTriggerPaddingVariants({ size }), isUnderlineList || isSegmentedList ? 'h-full' : tabsTriggerHeightVariants({ size }),
167
187
  // Segmented: the chip sits inside the track's padding, so the trigger
168
188
  // fills the track and takes the chip's concentric radius.
169
- isSegmented && "rounded-sm",
189
+ isSegmented && 'rounded-sm',
170
190
  // Without the sliding indicator the active trigger paints the chip itself.
171
191
  isSegmented &&
172
192
  !useSlidingIndicator &&
173
- "data-[state=active]:bg-popover data-[state=active]:ring-border data-[state=active]:shadow-xs data-[state=active]:ring-1", isUnderlineList &&
174
- "data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground rounded-none bg-transparent shadow-none data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=inactive]:bg-transparent",
193
+ 'data-[state=active]:bg-popover data-[state=active]:ring-border data-[state=active]:shadow-xs data-[state=active]:ring-1', isUnderlineList &&
194
+ 'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground rounded-none bg-transparent shadow-none data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=inactive]:bg-transparent',
175
195
  // Default: a secondary-coloured pill. With animate="fluid" the sliding
176
196
  // indicator paints the pill behind the trigger, so the trigger itself
177
197
  // stays transparent; otherwise the trigger paints its own.
178
198
  !isUnderlineList &&
179
199
  !isOutline &&
180
- "data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground relative z-10 data-[state=inactive]:bg-transparent", !isUnderlineList &&
200
+ 'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:text-foreground relative z-10 data-[state=inactive]:bg-transparent', !isUnderlineList &&
181
201
  !isOutline &&
182
202
  !isSegmented &&
183
203
  !isSecondary &&
184
204
  (useSlidingIndicator
185
- ? "data-[state=active]:bg-transparent"
186
- : "data-[state=active]:bg-input"), isSegmented &&
187
- useSlidingIndicator &&
188
- "data-[state=active]:bg-transparent",
205
+ ? 'data-[state=active]:bg-transparent'
206
+ : 'data-[state=active]:bg-input'), isSegmented && useSlidingIndicator && 'data-[state=active]:bg-transparent',
189
207
  // Outline: bordered active chip — matches Button `outline` (border + transparent fill).
190
208
  isOutline &&
191
- "data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-foreground/5 hover:data-[state=inactive]:text-foreground data-[state=active]:border-border relative z-10 bg-transparent data-[state=active]:bg-transparent data-[state=inactive]:bg-transparent", isSecondary &&
192
- "rounded-sm data-[state=active]:bg-secondary data-[state=active]:text-foreground data-[state=inactive]:bg-transparent data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-hover", isVertical && "w-full justify-start text-left", className), ...props }));
209
+ 'data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-foreground/5 hover:data-[state=inactive]:text-foreground data-[state=active]:border-border relative z-10 bg-transparent data-[state=active]:bg-transparent data-[state=inactive]:bg-transparent', isSecondary &&
210
+ 'data-[state=active]:bg-secondary data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground hover:data-[state=inactive]:bg-hover rounded-sm data-[state=inactive]:bg-transparent', isVertical && 'w-full justify-start text-left', className), ref: mergedRef, id: tabId(baseId, value), "aria-controls": panelId(baseId, value), disabled: disabled, ...props, onMouseDown: (event) => {
211
+ onMouseDown?.(event);
212
+ // Radix: primary button without Ctrl selects on mousedown.
213
+ if (!disabled && event.button === 0 && !event.ctrlKey && !event.defaultPrevented) {
214
+ select(value);
215
+ }
216
+ }, nativeButton: native.nativeButton, render: slot.render ? stateRender('button', activeState, slot.render) : controlRender(activeState), children: slot.children }));
193
217
  }
194
- function TabsContent({ className, ...props }) {
195
- return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props }));
218
+ function TabsContent({ className, forceMount, asChild, children, ...props }) {
219
+ const slot = asChildRender(asChild, children);
220
+ const baseId = React.useContext(TabsBaseIdContext);
221
+ const active = React.useContext(TabsActiveValueContext) === props.value;
222
+ // Radix renders every panel element (inactive ones empty and `hidden`) and
223
+ // mounts the content only while active or with `forceMount`.
224
+ return (_jsx(TabsPrimitive.Panel, { "data-slot": "tabs-content", id: panelId(baseId, props.value), "aria-labelledby": tabId(baseId, props.value), className: cn('flex-1 outline-none', className), ...props, keepMounted: true, render: stateRender('div', activeState, slot.render), children: active || forceMount ? slot.children : null }));
196
225
  }
197
226
  /** Standalone filter pill bar — works WITHOUT a <Tabs> root. Use for filter bars, mode toggles. */
198
227
  function FilterBar({ className, ...props }) {
199
- return (_jsx("div", { "data-slot": "filter-bar", role: "tablist", className: cn("bg-foreground/5 text-muted-foreground inline-flex h-9 w-fit items-center justify-center gap-0.5 p-0.5", className), ...props }));
228
+ return (_jsx("div", { "data-slot": "filter-bar", role: "tablist", className: cn('bg-foreground/5 text-muted-foreground inline-flex h-9 w-fit items-center justify-center gap-0.5 p-0.5', className), ...props }));
200
229
  }
201
230
  /** Standalone filter pill — works WITHOUT a <Tabs> root. Pair with FilterBar. */
202
231
  function FilterBarItem({ className, ...props }) {
203
- return (_jsx("button", { "data-slot": "filter-bar-item", role: "tab", type: "button", className: cn("inline-flex h-[calc(100%-4px)] flex-1 cursor-pointer items-center justify-center gap-1.5 border border-transparent px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors duration-normal", "text-muted-foreground/60 hover:text-foreground/80", "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:ring-foreground/6 data-[state=active]:shadow-sm data-[state=active]:ring-1", "disabled:pointer-events-none disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", className), ...props }));
232
+ return (_jsx("button", { "data-slot": "filter-bar-item", role: "tab", type: "button", className: cn('duration-normal inline-flex h-[calc(100%-4px)] flex-1 cursor-pointer items-center justify-center gap-1.5 border border-transparent px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-colors', 'text-muted-foreground/60 hover:text-foreground/80', 'data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:ring-foreground/6 data-[state=active]:shadow-sm data-[state=active]:ring-1', 'disabled:pointer-events-none disabled:opacity-50', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5", className), ...props }));
204
233
  }
205
- export { tabsSegmentedChipClasses, tabsSegmentedTrackClasses, FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, TabsTrigger, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
234
+ export { FilterBar, FilterBarItem, Tabs, TabsContent, TabsList, tabsSegmentedChipClasses, tabsSegmentedTrackClasses, TabsTrigger, tabsTriggerHeightVariants, tabsTriggerPaddingVariants, tabsTriggerTextVariants, };
@@ -1,12 +1,25 @@
1
- import * as TogglePrimitive from '@radix-ui/react-toggle';
2
1
  import { type VariantProps } from 'class-variance-authority';
3
2
  import * as React from 'react';
4
3
  declare const toggleVariants: (props?: ({
5
4
  variant?: "outline" | "secondary" | "default" | null | undefined;
6
5
  size?: "default" | "sm" | "lg" | null | undefined;
7
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
- declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
7
+ type ToggleProps = Omit<React.ComponentPropsWithoutRef<'button'>, 'value'> & VariantProps<typeof toggleVariants> & {
8
+ pressed?: boolean;
9
+ defaultPressed?: boolean;
10
+ onPressedChange?: (pressed: boolean) => void;
11
+ value?: string;
12
+ asChild?: boolean;
13
+ };
14
+ declare const Toggle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "value"> & VariantProps<(props?: ({
9
15
  variant?: "outline" | "secondary" | "default" | null | undefined;
10
16
  size?: "default" | "sm" | "lg" | null | undefined;
11
- } & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
18
+ pressed?: boolean;
19
+ defaultPressed?: boolean;
20
+ onPressedChange?: (pressed: boolean) => void;
21
+ value?: string;
22
+ asChild?: boolean;
23
+ } & React.RefAttributes<HTMLButtonElement>>;
12
24
  export { Toggle, toggleVariants };
25
+ export type { ToggleProps };
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as TogglePrimitive from '@radix-ui/react-toggle';
2
+ import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
3
3
  import { cva } from 'class-variance-authority';
4
4
  import * as React from 'react';
5
+ import { asChildRender, composeRefs, stateRender, useNativeButton } from '../lib/base-ui-compat.js';
5
6
  import { cn } from '../lib/utils.js';
6
7
  const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounded-md bg-transparent text-sm font-medium text-muted-foreground transition-colors hover:bg-foreground/[0.06] hover:text-foreground focus-visible:outline-none focus-visible:ring-kortix-base focus-visible:ring-[0.6px] disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary/10 data-[state=on]:text-primary data-[state=on]:hover:bg-primary/[0.14] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
7
8
  variants: {
@@ -21,6 +22,10 @@ const toggleVariants = cva('inline-flex items-center justify-center gap-2 rounde
21
22
  size: 'default',
22
23
  },
23
24
  });
24
- const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => (_jsx(TogglePrimitive.Root, { ref: ref, className: cn(toggleVariants({ variant, size, className })), ...props })));
25
- Toggle.displayName = TogglePrimitive.Root.displayName;
25
+ const Toggle = React.forwardRef(({ className, variant, size, asChild, children, onPressedChange, ...props }, ref) => {
26
+ const slot = asChildRender(asChild, children);
27
+ const native = useNativeButton(asChild, children);
28
+ return (_jsx(TogglePrimitive, { ref: composeRefs(ref, native.ref), className: cn(toggleVariants({ variant, size, className })), ...props, onPressedChange: (pressed) => onPressedChange?.(pressed), nativeButton: native.nativeButton, render: stateRender('button', (s) => (s.pressed ? 'on' : 'off'), slot.render), children: slot.children }));
29
+ });
30
+ Toggle.displayName = 'Toggle';
26
31
  export { Toggle, toggleVariants };
@@ -1,9 +1,28 @@
1
- import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
1
  import * as React from 'react';
3
- declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
2
+ import { type LegacyPositionProps } from '../lib/base-ui-compat.js';
3
+ declare function TooltipProvider({ delayDuration, skipDelayDuration, children, }: {
4
+ delayDuration?: number;
5
+ skipDelayDuration?: number;
6
+ /** Accepted for Radix parity; Base UI popups are hoverable unless the root disables it. */
7
+ disableHoverableContent?: boolean;
8
+ children?: React.ReactNode;
9
+ }): React.JSX.Element;
10
+ export interface TooltipProps {
11
+ open?: boolean;
12
+ defaultOpen?: boolean;
13
+ onOpenChange?: (open: boolean) => void;
14
+ delayDuration?: number;
15
+ disableHoverableContent?: boolean;
16
+ children?: React.ReactNode;
17
+ }
4
18
  /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). `Tooltip` is the primitive `Hint` builds on. */
5
- declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
6
- declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
19
+ declare function Tooltip({ open, defaultOpen, onOpenChange, delayDuration, disableHoverableContent, children, }: TooltipProps): React.JSX.Element;
20
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
21
+ asChild?: boolean;
22
+ } & React.RefAttributes<HTMLButtonElement>>;
7
23
  /** @deprecated In feature code use `Hint` (`@kortix/ui/hint`). */
8
- declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
24
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LegacyPositionProps & {
25
+ asChild?: boolean;
26
+ forceMount?: true;
27
+ } & React.RefAttributes<HTMLDivElement>>;
9
28
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };