@kortix/ui 0.15.7 → 0.15.8

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 (181) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +36 -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/customize/connectors/catalog/connector-categories.d.ts +2 -2
  6. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  7. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  8. package/dist/customize/sections/gateway-view.d.ts +1 -1
  9. package/dist/customize/sections/gateway-view.js +1 -1
  10. package/dist/customize/sections/view/account-secret-resources-panel.js +4 -2
  11. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  12. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  13. package/dist/customize/sections/view/git-view.js +1 -1
  14. package/dist/customize/sections/view/permission-editor.js +1 -1
  15. package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
  16. package/dist/customize/sections/view/subscription-usage.js +2 -86
  17. package/dist/customize/shared/entity/entity-modal.js +8 -10
  18. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  19. package/dist/files/project/components/drive-toolbar.js +1 -1
  20. package/dist/files/project/store/version-store.d.ts +1 -1
  21. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  22. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  23. package/dist/files/renderers/shared/select-compat.js +3 -7
  24. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  25. package/dist/files/viewer/file-preview-modal.js +17 -18
  26. package/dist/i18n/en.d.ts +3 -0
  27. package/dist/i18n/en.js +7 -4
  28. package/dist/index.js +1 -1
  29. package/dist/internal/account-hub/account-hub-location.js +2 -2
  30. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  31. package/dist/internal/account-hub/use-account-members.js +27 -10
  32. package/dist/internal/components/agent-mark.d.ts +1 -8
  33. package/dist/internal/components/agent-mark.js +2 -19
  34. package/dist/internal/lib/navigation/modified-click.js +2 -2
  35. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  36. package/dist/internal/lib/pixel-mark.js +3 -34
  37. package/dist/internal/stores/active-space-store.d.ts +1 -1
  38. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  39. package/dist/internal/stores/current-account-store.d.ts +1 -1
  40. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  41. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  42. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  43. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  44. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  45. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  46. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  47. package/dist/internal/stores/session-hover-store.js +1 -1
  48. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  49. package/dist/internal/stores/sound-store.d.ts +1 -1
  50. package/dist/internal/stores/tab-store.d.ts +1 -1
  51. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  52. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  53. package/dist/lib/base-ui-compat.d.ts +149 -0
  54. package/dist/lib/base-ui-compat.js +339 -0
  55. package/dist/lib/portal-container.d.ts +3 -7
  56. package/dist/lib/portal-container.js +5 -3
  57. package/dist/lib/z-stack.d.ts +4 -4
  58. package/dist/lib/z-stack.js +5 -5
  59. package/dist/primitives/accordion.d.ts +36 -5
  60. package/dist/primitives/accordion.js +41 -8
  61. package/dist/primitives/alert-dialog.d.ts +33 -11
  62. package/dist/primitives/alert-dialog.js +41 -19
  63. package/dist/primitives/avatar.d.ts +5 -2
  64. package/dist/primitives/avatar.js +3 -3
  65. package/dist/primitives/badge.js +1 -1
  66. package/dist/primitives/breadcrumb.js +1 -1
  67. package/dist/primitives/button-group.js +3 -3
  68. package/dist/primitives/button.js +1 -1
  69. package/dist/primitives/checkbox.d.ts +14 -5
  70. package/dist/primitives/checkbox.js +24 -9
  71. package/dist/primitives/collapsible.d.ts +16 -4
  72. package/dist/primitives/collapsible.js +18 -7
  73. package/dist/primitives/command-core.d.ts +121 -0
  74. package/dist/primitives/command-core.js +642 -0
  75. package/dist/primitives/command.d.ts +38 -4
  76. package/dist/primitives/command.js +22 -13
  77. package/dist/primitives/context-menu.d.ts +61 -31
  78. package/dist/primitives/context-menu.js +40 -53
  79. package/dist/primitives/dialog.d.ts +48 -10
  80. package/dist/primitives/dialog.js +48 -19
  81. package/dist/primitives/disclosure.d.ts +1 -1
  82. package/dist/primitives/disclosure.js +2 -2
  83. package/dist/primitives/drawer.d.ts +28 -9
  84. package/dist/primitives/drawer.js +42 -18
  85. package/dist/primitives/dropdown-menu.d.ts +55 -33
  86. package/dist/primitives/dropdown-menu.js +46 -82
  87. package/dist/primitives/faded-scroll-area.js +2 -1
  88. package/dist/primitives/hint.js +3 -3
  89. package/dist/primitives/hover-card.d.ts +17 -5
  90. package/dist/primitives/hover-card.js +45 -8
  91. package/dist/primitives/item.js +2 -2
  92. package/dist/primitives/label.d.ts +5 -2
  93. package/dist/primitives/label.js +10 -3
  94. package/dist/primitives/menu-base.d.ts +150 -0
  95. package/dist/primitives/menu-base.js +171 -0
  96. package/dist/primitives/menu-recipe.d.ts +1 -1
  97. package/dist/primitives/menu-recipe.js +2 -7
  98. package/dist/primitives/modal.d.ts +19 -52
  99. package/dist/primitives/modal.js +24 -28
  100. package/dist/primitives/navigation-menu.d.ts +36 -11
  101. package/dist/primitives/navigation-menu.js +31 -12
  102. package/dist/primitives/popover.d.ts +31 -6
  103. package/dist/primitives/popover.js +79 -12
  104. package/dist/primitives/preview-image.d.ts +18 -7
  105. package/dist/primitives/preview-image.js +14 -11
  106. package/dist/primitives/progress.d.ts +4 -2
  107. package/dist/primitives/progress.js +4 -3
  108. package/dist/primitives/project-icon-picker.js +2 -2
  109. package/dist/primitives/radio-group.d.ts +28 -5
  110. package/dist/primitives/radio-group.js +18 -10
  111. package/dist/primitives/scroll-area.d.ts +2 -2
  112. package/dist/primitives/scroll-area.js +8 -3
  113. package/dist/primitives/select.d.ts +55 -12
  114. package/dist/primitives/select.js +93 -36
  115. package/dist/primitives/separator.d.ts +6 -2
  116. package/dist/primitives/separator.js +10 -2
  117. package/dist/primitives/sheet.d.ts +17 -10
  118. package/dist/primitives/sheet.js +19 -22
  119. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  120. package/dist/primitives/slider-native.d.ts +2 -2
  121. package/dist/primitives/slider-native.js +11 -9
  122. package/dist/primitives/slider.d.ts +24 -6
  123. package/dist/primitives/slider.js +26 -24
  124. package/dist/primitives/slot.d.ts +6 -0
  125. package/dist/primitives/slot.js +7 -0
  126. package/dist/primitives/split-sheet.js +1 -1
  127. package/dist/primitives/stepper.js +1 -1
  128. package/dist/primitives/switch.d.ts +16 -3
  129. package/dist/primitives/switch.js +7 -6
  130. package/dist/primitives/tabs.d.ts +36 -20
  131. package/dist/primitives/tabs.js +131 -102
  132. package/dist/primitives/toggle.d.ts +16 -3
  133. package/dist/primitives/toggle.js +8 -3
  134. package/dist/primitives/tooltip.d.ts +24 -5
  135. package/dist/primitives/tooltip.js +32 -10
  136. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  137. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  138. package/dist/session/composer/animated-placeholder.js +1 -1
  139. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  140. package/dist/session/composer/editor/composer-editor.js +1 -1
  141. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  142. package/dist/session/composer/menus/menu-shell.js +1 -1
  143. package/dist/session/composer/menus/mount.js +1 -1
  144. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  145. package/dist/session/header/session-site-header.js +2 -2
  146. package/dist/session/header/subagent-hover-card.js +2 -2
  147. package/dist/session/media/image-preview.js +1 -1
  148. package/dist/session/models/model-selector.d.ts +1 -1
  149. package/dist/session/models/model-selector.js +18 -12
  150. package/dist/session/models/subscription-switcher.d.ts +37 -0
  151. package/dist/session/models/subscription-switcher.js +97 -0
  152. package/dist/session/models/subscription-windows.d.ts +40 -0
  153. package/dist/session/models/subscription-windows.js +86 -0
  154. package/dist/session/overrides/session-overrides-control.js +3 -3
  155. package/dist/session/panel/diff-dialog.js +1 -1
  156. package/dist/session/panel/easy/detail-view.js +3 -3
  157. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  158. package/dist/session/panel/panel-fallback.js +1 -1
  159. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  160. package/dist/session/panel/session-files-explorer.js +1 -1
  161. package/dist/session/thread/session-chat.js +2 -2
  162. package/dist/session/thread/session-context-message-explorer.js +1 -1
  163. package/dist/session/thread/turn-share.js +3 -4
  164. package/dist/session/tool/shared/show-helpers.js +1 -1
  165. package/dist/session/turn/message-time-label.js +1 -1
  166. package/dist/styles.css +1 -1
  167. package/dist/test-utils/intl.d.ts +3 -0
  168. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  169. package/dist/workspace/review/review-center.js +1 -1
  170. package/dist/workspace/sessions/session-row.js +1 -1
  171. package/dist/workspace/sidebar/project-session-list.js +2 -2
  172. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  173. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  174. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  175. package/dist/workspace/sidebar/session-title.js +2 -2
  176. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  177. package/dist/workspace/spaces/space-links.js +1 -1
  178. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  179. package/package.json +16 -35
  180. package/skills/kortix-ui/SKILL.md +1 -1
  181. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Select as SelectPrimitive } from '@base-ui/react/select';
4
+ import { CheckIcon as Check, CaretDownIcon as ChevronDown, CaretUpIcon as ChevronUp, } from '@phosphor-icons/react';
5
+ import * as React from 'react';
6
+ import { checkedState, FLOATING_LAYER_ATTR, openState, radixPositionVars, splitPosition, stateRender, } from '../lib/base-ui-compat.js';
3
7
  import { withPortalContainer } from '../lib/portal-container.js';
4
8
  import { cn } from '../lib/utils.js';
5
9
  import { floatingZ, useDialogDepth } from '../lib/z-stack.js';
6
- import { CheckIcon as Check, CaretDownIcon as ChevronDown, CaretUpIcon as ChevronUp, } from '@phosphor-icons/react';
7
- import * as SelectPrimitive from '@radix-ui/react-select';
8
- import * as React from 'react';
9
10
  import { MENU_INDICATOR, MENU_INDICATOR_ICON, MENU_INSET_END, MENU_LABEL, MENU_PANEL_STATIC, MENU_SEPARATOR, menuRow, } from './menu-recipe.js';
10
11
  import { TRIGGER_CARET_CLASS, TRIGGER_ICON_SIZE, triggerVariants, } from './trigger-variants.js';
11
12
  const SelectPortal = withPortalContainer(SelectPrimitive.Portal);
@@ -13,7 +14,7 @@ const SelectPortal = withPortalContainer(SelectPrimitive.Portal);
13
14
  * A select is a menu: the same floating surface holding the same rows, and it
14
15
  * shares both with the dropdown and context menu through `./menu-recipe`.
15
16
  *
16
- * Local to a select: `max-h-96` plus the scroll buttons, because the option
17
+ * Local to a select: `max-h-96` plus the scroll arrows, because the option
17
18
  * list is data-length and a dropdown's is authored; and `min-w-56`, because a
18
19
  * select is anchored to a trigger it should not visibly undercut.
19
20
  *
@@ -21,41 +22,97 @@ const SelectPortal = withPortalContainer(SelectPrimitive.Portal);
21
22
  * on the frame it mounts and unmounts on the frame it closes. See
22
23
  * `dropdown-menu.tsx` for why.
23
24
  */
24
- const SELECT_PANEL = cn(MENU_PANEL_STATIC, 'max-h-96 min-w-56 overflow-hidden');
25
- const Select = SelectPrimitive.Root;
26
- const SelectGroup = SelectPrimitive.Group;
27
- const SelectValue = SelectPrimitive.Value;
28
- const SelectTrigger = React.forwardRef(({ className, children, variant, size, arrow = true, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn(triggerVariants({ variant, size }), className), ...props, children: [children, arrow && (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: cn(TRIGGER_CARET_CLASS, TRIGGER_ICON_SIZE[size ?? 'sm']) }) }))] })));
29
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
30
- const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', // cursor-default: hover-scroll area, not a control.
25
+ const SELECT_PANEL = cn(MENU_PANEL_STATIC, 'min-w-56 overflow-hidden');
26
+ const SelectLabelsContext = React.createContext(null);
27
+ function collectLabels(node, out) {
28
+ React.Children.forEach(node, (child) => {
29
+ if (!React.isValidElement(child))
30
+ return;
31
+ const props = child.props;
32
+ if (child.type === SelectItem && props.value != null) {
33
+ out[String(props.value)] = props.children;
34
+ return;
35
+ }
36
+ if (props.children)
37
+ collectLabels(props.children, out);
38
+ });
39
+ }
40
+ /** Radix treats `''` and `undefined` as "no value"; Base UI uses `null`. */
41
+ const toBaseValue = (value) => value === undefined || value === '' ? null : value;
42
+ function Select(allProps) {
43
+ const { value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, dir: _dir, children, ...props } = allProps;
44
+ const [mounted, setMounted] = React.useState({});
45
+ const register = React.useCallback((key, label) => {
46
+ setMounted((prev) => (prev[key] === label ? prev : { ...prev, [key]: label }));
47
+ }, []);
48
+ const items = React.useMemo(() => {
49
+ const fromTree = {};
50
+ collectLabels(children, fromTree);
51
+ return { ...mounted, ...fromTree };
52
+ }, [children, mounted]);
53
+ // A `value` key, even `value={undefined}`, means a controlled select that
54
+ // shows its placeholder; no key means uncontrolled.
55
+ const controlled = 'value' in allProps;
56
+ return (_jsx(SelectLabelsContext.Provider, { value: register, children: _jsx(SelectPrimitive.Root, { ...props, items: items, ...(controlled
57
+ ? { value: toBaseValue(value) }
58
+ : { defaultValue: toBaseValue(defaultValue) }), onValueChange: (next) => {
59
+ if (typeof next === 'string')
60
+ onValueChange?.(next);
61
+ }, open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange ? (next) => onOpenChange(next) : undefined, children: children }) }));
62
+ }
63
+ /* ---------- group and label ---------- */
64
+ const SelectGroupContext = React.createContext(false);
65
+ const SelectGroup = React.forwardRef((props, ref) => (_jsx(SelectGroupContext.Provider, { value: true, children: _jsx(SelectPrimitive.Group, { ref: ref, ...props }) })));
66
+ SelectGroup.displayName = 'SelectGroup';
67
+ const SelectLabel = React.forwardRef(({ className, ...props }, ref) => {
68
+ const inGroup = React.useContext(SelectGroupContext);
69
+ // Was `pl-8 text-sm font-semibold` — the `pl-8` reserved a left gutter for a
70
+ // leading check that this select does not have (its indicator is at
71
+ // `right-3`), so the label sat indented past every option under it.
72
+ const classes = cn(MENU_LABEL, className);
73
+ // `GroupLabel` labels its group; outside a group the label is plain text.
74
+ return inGroup ? (_jsx(SelectPrimitive.GroupLabel, { ref: ref, className: classes, ...props })) : (_jsx("div", { ref: ref, className: classes, ...props }));
75
+ });
76
+ SelectLabel.displayName = 'SelectLabel';
77
+ /* ---------- trigger and value ---------- */
78
+ const SelectValue = React.forwardRef(({ children, ...props }, ref) => (_jsx(SelectPrimitive.Value, { ref: ref, ...props, children: children ?? undefined })));
79
+ SelectValue.displayName = 'SelectValue';
80
+ const SelectTrigger = React.forwardRef(({ className, children, variant, size, arrow = true, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn(triggerVariants({ variant, size }), className), ...props, render: stateRender('button', openState), children: [children, arrow && (
81
+ // Children, not `render`: without children Base UI fills the icon with a `▼` glyph.
82
+ _jsx(SelectPrimitive.Icon, { className: "flex shrink-0", children: _jsx(ChevronDown, { className: cn(TRIGGER_CARET_CLASS, TRIGGER_ICON_SIZE[size ?? 'sm']) }) }))] })));
83
+ SelectTrigger.displayName = 'SelectTrigger';
84
+ /* ---------- content ---------- */
85
+ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpArrow, { ref: ref, className: cn('bg-popover absolute inset-x-0 top-0 z-[1] flex cursor-default items-center justify-center py-1', // cursor-default: hover-scroll area, not a control.
31
86
  className), ...props, children: _jsx(ChevronUp, { className: "size-4" }) })));
32
- SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
33
- const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', // cursor-default: hover-scroll area, not a control.
87
+ SelectScrollUpButton.displayName = 'SelectScrollUpButton';
88
+ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownArrow, { ref: ref, className: cn('bg-popover absolute inset-x-0 bottom-0 z-[1] flex cursor-default items-center justify-center py-1', // cursor-default: hover-scroll area, not a control.
34
89
  className), ...props, children: _jsx(ChevronDown, { className: "size-4" }) })));
35
- SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
36
- const SelectContent = React.forwardRef(({ className, children, position = 'popper', style, ...props }, ref) => {
90
+ SelectScrollDownButton.displayName = 'SelectScrollDownButton';
91
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', alignItemWithTrigger, container, style, onCloseAutoFocus: _onCloseAutoFocus, onEscapeKeyDown: _onEscapeKeyDown, onPointerDownOutside: _onPointerDownOutside, ...rest }, ref) => {
37
92
  const depth = useDialogDepth();
38
- return (_jsx(SelectPortal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn(SELECT_PANEL, position === 'popper' &&
39
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), style: { zIndex: floatingZ(depth), ...style }, position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn(position === 'popper' &&
40
- 'h-(--radix-select-trigger-height) w-full min-w-[calc(var(--radix-select-trigger-width)-8px)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
93
+ const { positioner, rest: props } = splitPosition(rest);
94
+ const aligned = alignItemWithTrigger ?? position === 'item-aligned';
95
+ return (_jsx(SelectPortal, { container: container, children: _jsx(SelectPrimitive.Positioner, { ...positioner, ...FLOATING_LAYER_ATTR, alignItemWithTrigger: aligned, className: "outline-none", style: { zIndex: floatingZ(depth), ...radixPositionVars('select') }, children: _jsxs(SelectPrimitive.Popup, { ref: ref, className: cn(SELECT_PANEL, !aligned &&
96
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), style: style, ...props, render: stateRender('div', openState), children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.List, { className: cn('max-h-[min(24rem,var(--available-height))] scroll-py-6 overflow-y-auto', !aligned && 'w-full min-w-[calc(var(--anchor-width)-8px)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) }) }));
97
+ });
98
+ SelectContent.displayName = 'SelectContent';
99
+ /* ---------- item ---------- */
100
+ const SelectItem = React.forwardRef(({ className, children, size = 'sm', description, value, textValue, ...props }, ref) => {
101
+ const register = React.useContext(SelectLabelsContext);
102
+ React.useEffect(() => {
103
+ register?.(value, children);
104
+ }, [register, value, children]);
105
+ return (_jsxs(SelectPrimitive.Item, { ref: ref, value: value, label: textValue,
106
+ // `MENU_INSET_END` reserves the trailing slot on every row, checked or
107
+ // not, so a long label truncates before the check instead of running
108
+ // under it, and the check column is the same x on every row.
109
+ className: cn(menuRow(size, 'default'), MENU_INSET_END, description && 'items-start', className), ...props, render: stateRender('div', (s) => checkedState({ checked: s.selected })), children: [_jsx("span", { "data-slot": "select-item-indicator",
110
+ // Absolute inside a flex row: its static position follows the row's
111
+ // `items-*`, so it centres on a one-line row. On a described row it tops
112
+ // out, and `mt-0.5` centres the ~15px slot on the 20px first line.
113
+ className: cn(MENU_INDICATOR, 'absolute right-2', description && 'mt-0.5'), children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: MENU_INDICATOR_ICON }) }) }), description ? (_jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { className: "text-muted-foreground max-w-64 text-xs whitespace-normal", children: description })] })) : (_jsx(SelectPrimitive.ItemText, { children: children }))] }));
41
114
  });
42
- SelectContent.displayName = SelectPrimitive.Content.displayName;
43
- const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (
44
- // Was `pl-8 text-sm font-semibold` — the `pl-8` reserved a left gutter for a
45
- // leading check that this select does not have (its indicator is at
46
- // `right-3`), so the label sat indented past every option under it.
47
- _jsx(SelectPrimitive.Label, { ref: ref, className: cn(MENU_LABEL, className), ...props })));
48
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
49
- const SelectItem = React.forwardRef(({ className, children, size = 'sm', description, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref,
50
- // `MENU_INSET_END` reserves the trailing slot on every row, checked or
51
- // not, so a long label truncates before the check instead of running
52
- // under it, and the check column is the same x on every row.
53
- className: cn(menuRow(size, 'default'), MENU_INSET_END, description && 'items-start', className), ...props, children: [_jsx("span", { "data-slot": "select-item-indicator",
54
- // Absolute inside a flex row: its static position follows the row's
55
- // `items-*`, so it centres on a one-line row. On a described row it tops
56
- // out, and `mt-0.5` centres the ~15px slot on the 20px first line.
57
- className: cn(MENU_INDICATOR, 'absolute right-2', description && 'mt-0.5'), children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: MENU_INDICATOR_ICON }) }) }), description ? (_jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx("span", { className: "text-muted-foreground max-w-64 text-xs whitespace-normal", children: description })] })) : (_jsx(SelectPrimitive.ItemText, { children: children }))] })));
58
- SelectItem.displayName = SelectPrimitive.Item.displayName;
115
+ SelectItem.displayName = 'SelectItem';
59
116
  const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn(MENU_SEPARATOR, className), ...props })));
60
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
117
+ SelectSeparator.displayName = 'SelectSeparator';
61
118
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -1,4 +1,8 @@
1
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
2
1
  import * as React from 'react';
3
- declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
2
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<'div'> & {
3
+ orientation?: 'horizontal' | 'vertical';
4
+ /** Purely visual: hidden from assistive tech (`role="none"`). */
5
+ decorative?: boolean;
6
+ asChild?: boolean;
7
+ }): React.JSX.Element;
4
8
  export { Separator };
@@ -1,8 +1,16 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
3
+ import { Slot } from '../lib/base-ui-compat.js';
4
4
  import { cn } from '../lib/utils.js';
5
5
  function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
6
- return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px', className), ...props }));
6
+ const { asChild, ...rest } = props;
7
+ const Comp = (asChild ? Slot : 'div');
8
+ // Base UI's Separator is never decorative, so this renders the Radix contract itself.
9
+ return (_jsx(Comp, { "data-slot": "separator", "data-orientation": orientation, ...(decorative
10
+ ? { role: 'none' }
11
+ : {
12
+ role: 'separator',
13
+ 'aria-orientation': orientation === 'vertical' ? 'vertical' : undefined,
14
+ }), className: cn('bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px', className), ...rest }));
7
15
  }
8
16
  export { Separator };
@@ -1,19 +1,22 @@
1
- import * as SheetPrimitive from '@radix-ui/react-dialog';
2
1
  import { type VariantProps } from 'class-variance-authority';
3
2
  import * as React from 'react';
4
- import { type TriggerVariantProps } from './trigger-variants.js';
5
- declare const Sheet: ({ open, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) => React.JSX.Element;
6
- declare const SheetTrigger: ({ className, variant, size, asChild, ...props }: Omit<React.ComponentProps<typeof SheetPrimitive.Trigger>, "size"> & TriggerVariantProps) => React.JSX.Element;
7
- declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
3
+ import { type DialogContentBaseProps } from './dialog.js';
4
+ declare const Sheet: ({ open, defaultOpen, onOpenChange, modal, children }: import("./dialog.js").DialogProps) => React.JSX.Element;
5
+ declare const SheetTrigger: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "size"> & {
6
+ asChild?: boolean;
7
+ } & import("./trigger-variants.js").TriggerVariantProps & React.RefAttributes<HTMLButtonElement>>;
8
+ declare const SheetClose: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "size"> & {
9
+ asChild?: boolean;
10
+ } & React.RefAttributes<HTMLButtonElement>>;
8
11
  declare const SheetPortal: {
9
- (props: SheetPrimitive.DialogPortalProps): React.JSX.Element;
12
+ (props: Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
10
13
  displayName: string;
11
14
  };
12
- declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
16
  declare const sheetVariants: (props?: ({
14
17
  side?: "bottom" | "left" | "right" | "top" | null | undefined;
15
18
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
- interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
19
+ interface SheetContentProps extends DialogContentBaseProps, VariantProps<typeof sheetVariants> {
17
20
  showCloseButton?: boolean;
18
21
  overlayClassName?: string;
19
22
  }
@@ -30,6 +33,10 @@ declare const SheetBody: {
30
33
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
31
34
  displayName: string;
32
35
  };
33
- declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
34
- declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
36
+ declare const SheetTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
37
+ asChild?: boolean;
38
+ } & React.RefAttributes<HTMLHeadingElement>>;
39
+ declare const SheetDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
40
+ asChild?: boolean;
41
+ } & React.RefAttributes<HTMLParagraphElement>>;
35
42
  export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
@@ -1,29 +1,26 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as SheetPrimitive from '@radix-ui/react-dialog';
3
+ import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import * as React from 'react';
6
6
  import { Close } from '../icons/close.js';
7
- import { withPortalContainer } from '../lib/portal-container.js';
7
+ import { asChildRender, openState, stateRender } from '../lib/base-ui-compat.js';
8
8
  import { cn } from '../lib/utils.js';
9
9
  import { useUiStrings } from '../providers/ui-provider.js';
10
- import { DialogDepthProvider, dialogContentZ, dialogOverlayZ, useDialogDepth, useDialogRootLayer, } from '../lib/z-stack.js';
10
+ import { dialogContentZ, dialogOverlayZ, useDialogDepth } from '../lib/z-stack.js';
11
11
  import { buttonVariants } from './button.js';
12
- import { triggerVariants } from './trigger-variants.js';
13
- const Sheet = ({ open, defaultOpen, onOpenChange, ...props }) => {
14
- const layer = useDialogRootLayer({ open, defaultOpen, onOpenChange });
15
- return (_jsx(DialogDepthProvider, { depth: layer.depth, children: _jsx(SheetPrimitive.Root, { ...props, open: layer.open, onOpenChange: layer.onOpenChange }) }));
16
- };
17
- const SheetTrigger = ({ className, variant, size, asChild, ...props }) => (_jsx(SheetPrimitive.Trigger, { asChild: asChild,
18
- // With `asChild` the child owns its styling — merging ours would double it.
19
- className: asChild ? className : cn(triggerVariants({ variant, size }), className), ...props }));
20
- const SheetClose = SheetPrimitive.Close;
21
- const SheetPortal = withPortalContainer(SheetPrimitive.Portal);
12
+ import { Dialog, DialogClose, DialogPopup, DialogPortal, DialogTrigger, } from './dialog.js';
13
+ // A sheet is a dialog that slides in from an edge: same root, trigger, close,
14
+ // portal and popup contract; only the surface and its motion differ.
15
+ const Sheet = Dialog;
16
+ const SheetTrigger = DialogTrigger;
17
+ const SheetClose = DialogClose;
18
+ const SheetPortal = DialogPortal;
22
19
  const SheetOverlay = React.forwardRef(({ className, style, ...props }, ref) => {
23
20
  const depth = useDialogDepth();
24
- return (_jsx(SheetPrimitive.Overlay, { className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/80', className), style: { zIndex: dialogOverlayZ(depth), ...style }, ...props, ref: ref }));
21
+ return (_jsx(SheetPrimitive.Backdrop, { className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/80', className), style: { zIndex: dialogOverlayZ(depth), ...style }, render: stateRender('div', openState), ...props, ref: ref }));
25
22
  });
26
- SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
23
+ SheetOverlay.displayName = 'SheetOverlay';
27
24
  const sheetVariants = cva('fixed flex min-h-0 flex-col gap-4 overflow-hidden bg-sidebar p-4 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out h-[calc(100vh-1.4rem)]', {
28
25
  variants: {
29
26
  side: {
@@ -37,20 +34,20 @@ const sheetVariants = cva('fixed flex min-h-0 flex-col gap-4 overflow-hidden bg-
37
34
  side: 'right',
38
35
  },
39
36
  });
40
- const SheetContent = React.forwardRef(({ side = 'right', className, children, showCloseButton = true, overlayClassName, style, ...props }, ref) => {
37
+ const SheetContent = React.forwardRef(({ side = 'right', className, children, showCloseButton = true, overlayClassName, style, forceMount, ...props }, ref) => {
41
38
  const depth = useDialogDepth();
42
39
  const strings = useUiStrings();
43
- return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, { className: overlayClassName }), _jsxs(SheetPrimitive.Content, { ref: ref, className: cn(sheetVariants({ side }), className), style: { zIndex: dialogContentZ(depth), ...style }, ...props, children: [children, showCloseButton && (_jsxs(SheetPrimitive.Close, { className: cn('absolute top-4 right-4', buttonVariants({ variant: 'ghost', size: 'icon' })), children: [_jsx(Close, { className: "size-[1.15rem] stroke-0" }), _jsx("span", { className: "sr-only", children: strings.close })] }))] })] }));
40
+ return (_jsxs(SheetPortal, { keepMounted: forceMount, children: [_jsx(SheetOverlay, { className: overlayClassName }), _jsxs(DialogPopup, { ref: ref, className: cn(sheetVariants({ side }), className), style: { zIndex: dialogContentZ(depth), ...style }, ...props, children: [children, showCloseButton && (_jsxs(SheetPrimitive.Close, { className: cn('absolute top-4 right-4', buttonVariants({ variant: 'ghost', size: 'icon' })), children: [_jsx(Close, { className: "size-[1.15rem] stroke-0" }), _jsx("span", { className: "sr-only", children: strings.close })] }))] })] }));
44
41
  });
45
- SheetContent.displayName = SheetPrimitive.Content.displayName;
42
+ SheetContent.displayName = 'SheetContent';
46
43
  const SheetHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex shrink-0 flex-col space-y-2 text-center sm:text-left', className), ...props }));
47
44
  SheetHeader.displayName = 'SheetHeader';
48
45
  const SheetFooter = ({ className, ...props }) => (_jsx("div", { className: cn('flex shrink-0 flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
49
46
  SheetFooter.displayName = 'SheetFooter';
50
47
  const SheetBody = ({ className, ...props }) => (_jsx("div", { className: cn('flex min-h-0 w-full flex-1 flex-col items-start justify-start gap-4 overflow-y-auto py-6', className), ...props }));
51
48
  SheetBody.displayName = 'SheetBody';
52
- const SheetTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Title, { ref: ref, className: cn('text-foreground text-lg font-semibold', className), ...props })));
53
- SheetTitle.displayName = SheetPrimitive.Title.displayName;
54
- const SheetDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(SheetPrimitive.Description, { ref: ref, className: cn('text-muted-foreground text-sm', className), ...props })));
55
- SheetDescription.displayName = SheetPrimitive.Description.displayName;
49
+ const SheetTitle = React.forwardRef(({ className, asChild, children, ...props }, ref) => (_jsx(SheetPrimitive.Title, { ...asChildRender(asChild, children), ref: ref, className: cn('text-foreground text-lg font-semibold', className), ...props })));
50
+ SheetTitle.displayName = 'SheetTitle';
51
+ const SheetDescription = React.forwardRef(({ className, asChild, children, ...props }, ref) => (_jsx(SheetPrimitive.Description, { ...asChildRender(asChild, children), ref: ref, className: cn('text-muted-foreground text-sm', className), ...props })));
52
+ SheetDescription.displayName = 'SheetDescription';
56
53
  export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
@@ -1,21 +1,21 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cva } from 'class-variance-authority';
4
- import { Slot } from 'radix-ui';
5
4
  import * as React from 'react';
5
+ import { Slot } from '../lib/base-ui-compat.js';
6
+ import { cn } from '../lib/utils.js';
6
7
  import { useSidebar } from './sidebar-context.js';
7
8
  import { Skeleton } from './skeleton.js';
8
9
  import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip.js';
9
- import { cn } from '../lib/utils.js';
10
10
  function SidebarGroup({ className, ...props }) {
11
11
  return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn('relative flex w-full min-w-0 flex-col p-2', className), ...props }));
12
12
  }
13
13
  function SidebarGroupLabel({ className, asChild = false, ...props }) {
14
- const Comp = asChild ? Slot.Root : 'div';
15
- return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn('text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-moderate ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className), ...props }));
14
+ const Comp = asChild ? Slot : 'div';
15
+ return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn('text-sidebar-foreground/70 ring-sidebar-ring duration-moderate flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className), ...props }));
16
16
  }
17
17
  function SidebarGroupAction({ className, asChild = false, ...props }) {
18
- const Comp = asChild ? Slot.Root : 'button';
18
+ const Comp = asChild ? Slot : 'button';
19
19
  return (_jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-hover hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
20
20
  // Increases the hit area of the button on mobile.
21
21
  'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className), ...props }));
@@ -52,7 +52,7 @@ const sidebarMenuButtonVariants = cva(
52
52
  },
53
53
  });
54
54
  function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
55
- const Comp = asChild ? Slot.Root : 'button';
55
+ const Comp = asChild ? Slot : 'button';
56
56
  const { isMobile, state } = useSidebar();
57
57
  const button = (_jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
58
58
  if (!tooltip) {
@@ -66,7 +66,7 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = 'defau
66
66
  return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== 'collapsed' || isMobile, ...tooltip })] }));
67
67
  }
68
68
  function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
69
- const Comp = asChild ? Slot.Root : 'button';
69
+ const Comp = asChild ? Slot : 'button';
70
70
  return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn('text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-hover hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
71
71
  // Increases the hit area of the button on mobile.
72
72
  'after:absolute after:-inset-2 md:after:hidden', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', showOnHover &&
@@ -91,7 +91,7 @@ function SidebarMenuSubItem({ className, ...props }) {
91
91
  return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn('group/menu-sub-item relative', className), ...props }));
92
92
  }
93
93
  function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, className, ...props }) {
94
- const Comp = asChild ? Slot.Root : 'a';
94
+ const Comp = asChild ? Slot : 'a';
95
95
  return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-hover hover:text-sidebar-accent-foreground active:bg-active active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', 'data-[active=true]:bg-active data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className), ...props }));
96
96
  }
97
97
  export { SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, };
@@ -1,6 +1,6 @@
1
- import { Slider as SliderPrimitive } from 'radix-ui';
2
1
  import * as React from 'react';
3
- declare function NativeSlider({ className, defaultValue, value, min, max, tooltip, ...props }: React.ComponentProps<typeof SliderPrimitive.Root> & {
2
+ import type { SliderRootProps } from './slider.js';
3
+ declare function NativeSlider({ className, defaultValue, value, min, max, tooltip, onValueChange, onValueCommit, minStepsBetweenThumbs, inverted: _inverted, orientation, ...props }: SliderRootProps & {
4
4
  /** Shown in a Hint above the thumb while hovering it. */
5
5
  tooltip?: React.ReactNode;
6
6
  }): React.JSX.Element;
@@ -1,16 +1,18 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Slider as SliderPrimitive } from 'radix-ui';
3
+ import { Slider as SliderPrimitive } from '@base-ui/react/slider';
4
4
  import * as React from 'react';
5
- import Hint from './hint.js';
6
5
  import { cn } from '../lib/utils.js';
7
- const thumb = (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "border-ring ring-ring/50 hit-area-4 relative block size-3.5 shrink-0 rounded-full border bg-white transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50" }));
8
- function NativeSlider({ className, defaultValue, value, min = 0, max = 100, tooltip, ...props }) {
6
+ import Hint from './hint.js';
7
+ // `has-focus-visible`: the thumb's focusable node is its hidden range input.
8
+ const thumb = (index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", index: index, className: "border-ring ring-ring/50 hit-area-4 relative block size-3.5 shrink-0 rounded-full border bg-white transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 has-focus-visible:ring-3 data-disabled:pointer-events-none data-disabled:opacity-50" }));
9
+ const asArray = (value) => (Array.isArray(value) ? [...value] : [value]);
10
+ function NativeSlider({ className, defaultValue, value, min = 0, max = 100, tooltip, onValueChange, onValueCommit, minStepsBetweenThumbs, inverted: _inverted, orientation, ...props }) {
9
11
  const _values = React.useMemo(() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]), [value, defaultValue, min, max]);
10
- return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, className: cn('relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', className), ...props, children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: "bg-kortix-base/60 relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1", children: _jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: "bg-kortix-blue absolute select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full" }) }), Array.from({ length: _values.length }, (_, index) => {
11
- if (tooltip == null)
12
- return _jsx(React.Fragment, { children: thumb }, index);
13
- return (_jsx(Hint, { side: "top", label: tooltip, children: thumb }, index));
14
- })] }));
12
+ return (_jsx(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, orientation: orientation, "data-orientation": orientation ?? 'horizontal', minStepsBetweenValues: minStepsBetweenThumbs, onValueChange: onValueChange ? (next) => onValueChange(asArray(next)) : undefined, onValueCommitted: onValueCommit ? (next) => onValueCommit(asArray(next)) : undefined, className: cn('relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', className), ...props, children: _jsxs(SliderPrimitive.Control, { "data-slot": "slider-control", className: "relative flex w-full grow items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: "bg-kortix-base/60 relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1", children: _jsx(SliderPrimitive.Indicator, { "data-slot": "slider-range", className: "bg-kortix-blue absolute select-none data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full" }) }), Array.from({ length: _values.length }, (_, index) => {
13
+ if (tooltip == null)
14
+ return _jsx(React.Fragment, { children: thumb(index) }, index);
15
+ return (_jsx(Hint, { side: "top", label: tooltip, children: thumb(index) }, index));
16
+ })] }) }));
15
17
  }
16
18
  export { NativeSlider };
@@ -1,14 +1,32 @@
1
- import * as SliderPrimitive from '@radix-ui/react-slider';
2
1
  import * as React from 'react';
3
- type SliderProps = React.ComponentProps<typeof SliderPrimitive.Root> & {
2
+ /** The Radix slider contract: values are always `number[]`, one per thumb. */
3
+ type SliderRootProps = Omit<React.ComponentProps<'div'>, 'defaultValue' | 'dir' | 'onChange'> & {
4
+ value?: number[];
5
+ defaultValue?: number[];
6
+ onValueChange?: (value: number[]) => void;
7
+ /** Fires once when a drag or key press ends. */
8
+ onValueCommit?: (value: number[]) => void;
9
+ min?: number;
10
+ max?: number;
11
+ step?: number;
12
+ minStepsBetweenThumbs?: number;
13
+ orientation?: 'horizontal' | 'vertical';
14
+ disabled?: boolean;
15
+ /** Accepted for Radix parity; Base UI does not invert. */
16
+ inverted?: boolean;
17
+ dir?: 'ltr' | 'rtl';
18
+ name?: string;
19
+ };
20
+ type SliderProps = SliderRootProps & {
4
21
  /**
5
- * Accessible name for the thumb(s). Radix renders each thumb as the
6
- * `role="slider"` node, so a name on the root is never announced — it has to
7
- * land here. Pass an array to name each thumb of a range slider.
22
+ * Accessible name for the thumb(s). Each thumb holds the `role="slider"`
23
+ * input, so a name on the root is never announced — it has to land here.
24
+ * Pass an array to name each thumb of a range slider.
8
25
  */
9
26
  thumbLabel?: string | string[];
10
27
  /** Announced in place of the raw number (`aria-valuetext`), e.g. `40%`, `0.85`. */
11
28
  formatValue?: (value: number, index: number) => string;
12
29
  };
13
- declare function Slider({ className, defaultValue, value, min, max, onValueChange, thumbLabel, formatValue, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: SliderProps): React.JSX.Element;
30
+ declare function Slider({ className, defaultValue, value, min, max, onValueChange, thumbLabel, formatValue, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, onValueCommit, minStepsBetweenThumbs, inverted: _inverted, orientation, ...props }: SliderProps): React.JSX.Element;
14
31
  export { Slider };
32
+ export type { SliderProps, SliderRootProps };
@@ -1,9 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as SliderPrimitive from '@radix-ui/react-slider';
3
+ import { Slider as SliderPrimitive } from '@base-ui/react/slider';
4
4
  import * as React from 'react';
5
5
  import { cn } from '../lib/utils.js';
6
- function Slider({ className, defaultValue, value, min = 0, max = 100, onValueChange, thumbLabel, formatValue, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }) {
6
+ const asArray = (value) => (Array.isArray(value) ? [...value] : [value]);
7
+ function Slider({ className, defaultValue, value, min = 0, max = 100, onValueChange, thumbLabel, formatValue, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, onValueCommit, minStepsBetweenThumbs, inverted: _inverted, orientation, ...props }) {
7
8
  const [uncontrolledValues, setUncontrolledValues] = React.useState(() => Array.isArray(defaultValue) ? defaultValue : [min, max]);
8
9
  const values = Array.isArray(value) ? value : uncontrolledValues;
9
10
  const handleValueChange = React.useCallback((next) => {
@@ -22,27 +23,28 @@ function Slider({ className, defaultValue, value, min = 0, max = 100, onValueCha
22
23
  return `${base} maximum`;
23
24
  return `${base} ${index + 1}`;
24
25
  };
25
- return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, onValueChange: handleValueChange, className: cn('group/slider relative flex w-full cursor-pointer touch-none items-center select-none', 'data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50', // cursor-default: disabled control.
26
- 'data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', className), ...props, children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn(
27
- // Hairline rail: the whole control is one thin ink stroke.
28
- 'bg-primary/10 relative grow overflow-hidden rounded-full', 'data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full', 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1'), children: _jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn('bg-primary absolute rounded-full data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full') }) }), values.map((_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", "aria-label": labelFor(index), "aria-labelledby": ariaLabelledBy, "aria-valuetext": formatValue ? formatValue(values[index] ?? min, index) : undefined, className: cn(
29
- // Caret thumb: a short vertical bar in the same ink as the fill, so
30
- // the range reads as one continuous stroke that rises into a handle.
31
- 'bg-primary block h-4 w-2 shrink-0 rounded-full', 'group-data-[orientation=vertical]/slider:h-1 group-data-[orientation=vertical]/slider:w-4',
32
- // 44x51px touch target without shifting layout.
33
- 'hit-area-x-4 hit-area-y-5 cursor-pointer',
34
- // `scale` composes with Radix's inline `translate(-50%)` (Tailwind v4
35
- // uses the standalone `scale` property), so the bar grows around its
36
- // own center without breaking thumb positioning.
37
- 'duration-fast ease-default transition-[scale,box-shadow] outline-none', 'active:scale-x-150 active:scale-y-125',
38
- // Focus: accent ring with a surface-coloured gap that punches through
39
- // the track, so the indicator reads as "on the thumb".
40
- // `:focus`, not `:focus-visible` — Chrome resolves focus-visible once, at
41
- // focus time, so a thumb grabbed by pointer would stay unringed for the
42
- // rest of the interaction even after the user switches to arrow keys.
43
- 'focus:ring-ring focus:ring-offset-background focus:ring-2 focus:ring-offset-2',
44
- // Forced-colors mode strips box-shadow rings; a transparent outline is
45
- // repainted there as a real system-coloured focus ring.
46
- 'focus:outline-2 focus:outline-offset-2 focus:outline-transparent focus:outline-solid', 'data-disabled:pointer-events-none data-disabled:cursor-default') }, index)))] }));
26
+ return (_jsx(SliderPrimitive.Root, { "data-slot": "slider", "data-orientation": orientation ?? 'horizontal', defaultValue: defaultValue, value: value, min: min, max: max, orientation: orientation, minStepsBetweenValues: minStepsBetweenThumbs, onValueChange: (next) => handleValueChange(asArray(next)), onValueCommitted: onValueCommit ? (next) => onValueCommit(asArray(next)) : undefined, className: cn('group/slider relative flex w-full cursor-pointer touch-none items-center select-none', 'data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:opacity-50', // cursor-default: disabled control.
27
+ 'data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', className), ...props, children: _jsxs(SliderPrimitive.Control, { "data-slot": "slider-control", className: "relative flex w-full grow items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn(
28
+ // Hairline rail: the whole control is one thin ink stroke.
29
+ 'bg-primary/10 relative grow overflow-hidden rounded-full', 'data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full', 'data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1'), children: _jsx(SliderPrimitive.Indicator, { "data-slot": "slider-range", className: cn('bg-primary absolute rounded-full data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full') }) }), values.map((_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", index: index, "aria-label": labelFor(index), "aria-labelledby": ariaLabelledBy, getAriaValueText: formatValue ? (_formatted, thumbValue) => formatValue(thumbValue, index) : undefined, className: cn(
30
+ // Caret thumb: a short vertical bar in the same ink as the fill, so
31
+ // the range reads as one continuous stroke that rises into a handle.
32
+ 'bg-primary block h-4 w-2 shrink-0 rounded-full', 'group-data-[orientation=vertical]/slider:h-1 group-data-[orientation=vertical]/slider:w-4',
33
+ // 44x51px touch target without shifting layout.
34
+ 'hit-area-x-4 hit-area-y-5 cursor-pointer',
35
+ // `scale` composes with the thumb's inline `translate: -50% -50%` (Tailwind v4
36
+ // uses the standalone `scale` property), so the bar grows around its
37
+ // own center without breaking thumb positioning.
38
+ 'duration-fast ease-default transition-[scale,box-shadow] outline-none', 'active:scale-x-150 active:scale-y-125',
39
+ // Focus: accent ring with a surface-coloured gap that punches through
40
+ // the track, so the indicator reads as "on the thumb".
41
+ // `:focus-within` — the thumb's focusable node is its hidden range input.
42
+ // Not `:focus-visible`: Chrome resolves focus-visible once, at
43
+ // focus time, so a thumb grabbed by pointer would stay unringed for the
44
+ // rest of the interaction even after the user switches to arrow keys.
45
+ 'focus-within:ring-ring focus-within:ring-offset-background focus-within:ring-2 focus-within:ring-offset-2',
46
+ // Forced-colors mode strips box-shadow rings; a transparent outline is
47
+ // repainted there as a real system-coloured focus ring.
48
+ 'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-transparent focus-within:outline-solid', 'data-disabled:pointer-events-none data-disabled:cursor-default') }, index)))] }) }));
47
49
  }
48
50
  export { Slider };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `Slot` renders its only child with the props it receives merged in:
3
+ * handlers chain, classes join, styles merge, refs compose. It is the
4
+ * `asChild` building block for components outside `@kortix/ui`.
5
+ */
6
+ export { Slot } from '../lib/base-ui-compat.js';
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ /**
3
+ * `Slot` renders its only child with the props it receives merged in:
4
+ * handlers chain, classes join, styles merge, refs compose. It is the
5
+ * `asChild` building block for components outside `@kortix/ui`.
6
+ */
7
+ export { Slot } from '../lib/base-ui-compat.js';
@@ -53,7 +53,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
53
53
  * ```
54
54
  */
55
55
  import { XIcon } from '@phosphor-icons/react';
56
- import { Slot } from '@radix-ui/react-slot';
56
+ import { Slot } from '../lib/base-ui-compat.js';
57
57
  import * as React from 'react';
58
58
  import { cn } from '../lib/utils.js';
59
59
  import { hasOpenFloatingLayer } from '../lib/z-stack.js';
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Slot } from '@radix-ui/react-slot';
4
3
  import * as React from 'react';
5
4
  import { createContext, useContext } from 'react';
5
+ import { Slot } from '../lib/base-ui-compat.js';
6
6
  import { cn } from '../lib/utils.js';
7
7
  const StepperContext = createContext(undefined);
8
8
  const StepItemContext = createContext(undefined);
@@ -1,8 +1,21 @@
1
- import * as SwitchPrimitive from '@radix-ui/react-switch';
2
1
  import { type ComponentProps } from 'react';
3
- type SwitchProps = Omit<ComponentProps<typeof SwitchPrimitive.Root>, 'asChild'> & {
2
+ type SwitchProps = Omit<ComponentProps<'button'>, 'value' | 'checked' | 'defaultChecked' | 'onChange' | 'ref'> & {
3
+ checked?: boolean;
4
+ defaultChecked?: boolean;
5
+ onCheckedChange?: (checked: boolean) => void;
6
+ name?: string;
7
+ value?: string;
8
+ required?: boolean;
4
9
  label?: string;
5
10
  };
6
- declare const Switch: import("react").ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
11
+ declare const Switch: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref" | "defaultChecked" | "onChange" | "value" | "checked"> & {
12
+ checked?: boolean;
13
+ defaultChecked?: boolean;
14
+ onCheckedChange?: (checked: boolean) => void;
15
+ name?: string;
16
+ value?: string;
17
+ required?: boolean;
18
+ label?: string;
19
+ } & import("react").RefAttributes<HTMLButtonElement>>;
7
20
  export { Switch };
8
21
  export type { SwitchProps };