@efolusi/meridian 1.19.1 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +1 -1
  2. package/ai/Bubble.d.ts +16 -0
  3. package/ai/Bubble.js +71 -0
  4. package/ai/ChatMessage.js +2 -5
  5. package/ai/Confirmation.d.ts +0 -7
  6. package/ai/Confirmation.js +3 -6
  7. package/ai/GeneratedImage.d.ts +0 -2
  8. package/ai/GeneratedImage.js +2 -4
  9. package/ai/Marker.d.ts +26 -0
  10. package/ai/Marker.js +67 -0
  11. package/ai/Message.d.ts +13 -0
  12. package/ai/Message.js +68 -0
  13. package/ai/MessageScroller.d.ts +21 -0
  14. package/ai/MessageScroller.js +283 -0
  15. package/ai/ModelSelector.d.ts +2 -2
  16. package/ai/ModelSelector.js +1 -2
  17. package/ai/Player.js +1 -1
  18. package/ai/PromptSteps.js +4 -2
  19. package/ai/Sandbox.d.ts +0 -2
  20. package/ai/Sandbox.js +2 -4
  21. package/ai/Suggestions.d.ts +0 -2
  22. package/ai/Suggestions.js +1 -4
  23. package/ai/WebPreview.d.ts +0 -2
  24. package/ai/WebPreview.js +2 -4
  25. package/code/Console.js +1 -1
  26. package/code/EnvList.d.ts +0 -2
  27. package/code/EnvList.js +2 -3
  28. package/components.css +660 -423
  29. package/data/BarChart.d.ts +0 -2
  30. package/data/BarChart.js +1 -4
  31. package/data/Chart.d.ts +14 -0
  32. package/data/Chart.js +149 -0
  33. package/data/EmptyState.d.ts +8 -13
  34. package/data/EmptyState.js +62 -24
  35. package/data/LineChart.js +7 -4
  36. package/data/Skeleton.d.ts +2 -11
  37. package/data/Skeleton.js +8 -38
  38. package/data/Sparkline.js +4 -1
  39. package/data/StatusDot.d.ts +0 -4
  40. package/data/StatusDot.js +3 -6
  41. package/data/Table.d.ts +11 -4
  42. package/data/Table.js +39 -7
  43. package/dates/Calendar.d.ts +10 -27
  44. package/dates/Calendar.js +250 -184
  45. package/dates/TimePicker.js +2 -2
  46. package/display/Accordion.d.ts +47 -15
  47. package/display/Accordion.js +257 -27
  48. package/display/AspectRatio.d.ts +4 -6
  49. package/display/AspectRatio.js +7 -5
  50. package/display/Avatar.d.ts +17 -14
  51. package/display/Avatar.js +68 -43
  52. package/display/Badge.d.ts +9 -8
  53. package/display/Badge.js +32 -14
  54. package/display/Card.d.ts +11 -13
  55. package/display/Card.js +74 -29
  56. package/display/Carousel.d.ts +23 -15
  57. package/display/Carousel.js +217 -66
  58. package/display/Collapsible.d.ts +19 -9
  59. package/display/Collapsible.js +140 -28
  60. package/display/Direction.d.ts +10 -0
  61. package/display/Direction.js +24 -0
  62. package/display/Item.d.ts +19 -0
  63. package/display/Item.js +152 -0
  64. package/display/Kbd.d.ts +5 -7
  65. package/display/Kbd.js +22 -10
  66. package/display/Link.js +2 -4
  67. package/display/Resizable.d.ts +6 -16
  68. package/display/Resizable.js +141 -58
  69. package/display/ScrollArea.d.ts +3 -1
  70. package/display/ScrollArea.js +30 -5
  71. package/display/Separator.d.ts +9 -0
  72. package/display/Separator.js +18 -0
  73. package/display/Timeline.d.ts +24 -0
  74. package/display/Timeline.js +51 -0
  75. package/display/Toolbar.js +5 -4
  76. package/display/TreeList.d.ts +0 -2
  77. package/display/TreeList.js +2 -5
  78. package/feedback/Alert.d.ts +13 -13
  79. package/feedback/Alert.js +40 -36
  80. package/feedback/AlertDialog.d.ts +30 -0
  81. package/feedback/AlertDialog.js +249 -0
  82. package/feedback/Banner.d.ts +1 -3
  83. package/feedback/Banner.js +1 -5
  84. package/feedback/ConfirmDialog.d.ts +1 -1
  85. package/feedback/ConfirmDialog.js +18 -20
  86. package/feedback/Dialog.d.ts +13 -16
  87. package/feedback/Dialog.js +204 -62
  88. package/feedback/Progress.d.ts +8 -9
  89. package/feedback/Progress.js +42 -24
  90. package/feedback/Sonner.d.ts +8 -0
  91. package/feedback/Sonner.js +238 -0
  92. package/feedback/Spinner.d.ts +2 -9
  93. package/feedback/Spinner.js +19 -28
  94. package/feedback/Tooltip.d.ts +9 -10
  95. package/feedback/Tooltip.js +147 -96
  96. package/files/Attachment.d.ts +27 -0
  97. package/files/Attachment.js +111 -0
  98. package/files/FileDrop.js +3 -1
  99. package/finance/PaymentCard.js +3 -3
  100. package/forms/Button.d.ts +6 -5
  101. package/forms/Button.js +42 -8
  102. package/forms/ButtonGroup.d.ts +11 -3
  103. package/forms/ButtonGroup.js +57 -6
  104. package/forms/Checkbox.d.ts +14 -3
  105. package/forms/Checkbox.js +84 -16
  106. package/forms/Combobox.d.ts +24 -16
  107. package/forms/Combobox.js +466 -135
  108. package/forms/Field.d.ts +14 -0
  109. package/forms/Field.js +99 -0
  110. package/forms/IconButton.d.ts +1 -1
  111. package/forms/IconButton.js +4 -3
  112. package/forms/Input.d.ts +8 -8
  113. package/forms/Input.js +46 -33
  114. package/forms/InputGroup.d.ts +8 -15
  115. package/forms/InputGroup.js +74 -35
  116. package/forms/InputOTP.d.ts +13 -0
  117. package/forms/InputOTP.js +125 -0
  118. package/forms/Label.d.ts +2 -6
  119. package/forms/Label.js +6 -4
  120. package/forms/NativeSelect.d.ts +16 -0
  121. package/forms/NativeSelect.js +35 -0
  122. package/forms/NumberInput.js +2 -2
  123. package/forms/Radio.d.ts +12 -1
  124. package/forms/Radio.js +76 -6
  125. package/forms/Select.d.ts +12 -9
  126. package/forms/Select.js +254 -42
  127. package/forms/Slider.d.ts +10 -17
  128. package/forms/Slider.js +78 -39
  129. package/forms/Switch.d.ts +8 -2
  130. package/forms/Switch.js +46 -15
  131. package/forms/Textarea.d.ts +1 -1
  132. package/forms/Textarea.js +26 -18
  133. package/forms/Toggle.d.ts +18 -15
  134. package/forms/Toggle.js +96 -42
  135. package/icons/_svg.js +2 -0
  136. package/index.d.ts +20 -8
  137. package/index.js +50 -38
  138. package/navigation/Breadcrumbs.d.ts +18 -11
  139. package/navigation/Breadcrumbs.js +99 -26
  140. package/navigation/Menubar.d.ts +52 -10
  141. package/navigation/Menubar.js +191 -146
  142. package/navigation/NavigationMenu.d.ts +15 -0
  143. package/navigation/NavigationMenu.js +296 -0
  144. package/navigation/Pagination.d.ts +10 -9
  145. package/navigation/Pagination.js +94 -51
  146. package/navigation/SideNav.js +4 -3
  147. package/navigation/Sidebar.d.ts +29 -0
  148. package/navigation/Sidebar.js +311 -0
  149. package/navigation/Tabs.d.ts +9 -5
  150. package/navigation/Tabs.js +132 -44
  151. package/overlay/Command.d.ts +32 -0
  152. package/overlay/Command.js +257 -0
  153. package/overlay/ContextMenu.d.ts +40 -8
  154. package/overlay/ContextMenu.js +468 -107
  155. package/overlay/Drawer.d.ts +29 -14
  156. package/overlay/Drawer.js +178 -80
  157. package/overlay/DropdownMenu.d.ts +43 -0
  158. package/overlay/DropdownMenu.js +502 -0
  159. package/overlay/HoverCard.d.ts +21 -12
  160. package/overlay/HoverCard.js +129 -61
  161. package/overlay/Popover.d.ts +11 -13
  162. package/overlay/Popover.js +138 -65
  163. package/overlay/Portal.js +21 -7
  164. package/overlay/Sheet.d.ts +11 -0
  165. package/overlay/Sheet.js +62 -0
  166. package/package.json +4 -1
  167. package/tokens/base.css +1 -1
  168. package/dates/DatePicker.d.ts +0 -14
  169. package/dates/DatePicker.js +0 -111
  170. package/dates/DateRangePicker.d.ts +0 -23
  171. package/dates/DateRangePicker.js +0 -150
  172. package/display/ListItem.d.ts +0 -19
  173. package/display/ListItem.js +0 -50
  174. package/feedback/Toast.d.ts +0 -78
  175. package/feedback/Toast.js +0 -192
  176. package/forms/DigitEntry.d.ts +0 -15
  177. package/forms/DigitEntry.js +0 -79
  178. package/forms/FormField.d.ts +0 -82
  179. package/forms/FormField.js +0 -209
  180. package/overlay/CommandPalette.d.ts +0 -21
  181. package/overlay/CommandPalette.js +0 -148
  182. package/overlay/Menu.d.ts +0 -24
  183. package/overlay/Menu.js +0 -139
@@ -0,0 +1,10 @@
1
+ export interface DirectionProviderProps {
2
+ /** Standard reading-direction prop. */
3
+ dir?: 'ltr' | 'rtl';
4
+ /** Reading direction supplied to direction-aware Meridian components. @default 'ltr' */
5
+ direction?: 'ltr' | 'rtl';
6
+ children?: React.ReactNode;
7
+ }
8
+
9
+ export declare function DirectionProvider(props: DirectionProviderProps): React.JSX.Element;
10
+ export declare function useDirection(): 'ltr' | 'rtl';
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ const DirectionContext = /*#__PURE__*/React.createContext(undefined);
4
+
5
+ /** Supply reading direction to components whose keyboard behavior must mirror. */
6
+ export function DirectionProvider({
7
+ dir,
8
+ direction,
9
+ children
10
+ }) {
11
+ const requested = direction ?? dir ?? 'ltr';
12
+ const value = requested === 'rtl' ? 'rtl' : 'ltr';
13
+ return /*#__PURE__*/React.createElement(DirectionContext.Provider, {
14
+ value: value
15
+ }, children);
16
+ }
17
+
18
+ /** Read the nearest provider, falling back to the document direction. */
19
+ export function useDirection() {
20
+ const provided = React.useContext(DirectionContext);
21
+ if (provided) return provided;
22
+ if (typeof document !== 'undefined' && document.documentElement.dir === 'rtl') return 'rtl';
23
+ return 'ltr';
24
+ }
@@ -0,0 +1,19 @@
1
+ export type ItemVariant = 'default' | 'outline' | 'muted';
2
+ export type ItemSize = 'default' | 'sm' | 'xs';
3
+ export interface ItemProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ variant?: ItemVariant;
5
+ size?: ItemSize;
6
+ render?: React.ReactElement | ((props: React.HTMLAttributes<HTMLElement> & { ref?: React.Ref<HTMLElement> }) => React.ReactElement);
7
+ asChild?: boolean;
8
+ }
9
+ export interface ItemMediaProps extends React.HTMLAttributes<HTMLDivElement> { variant?: 'default' | 'icon' | 'image' }
10
+ export declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLElement>>;
11
+ export declare const ItemGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const ItemSeparator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
13
+ export declare const ItemMedia: React.ForwardRefExoticComponent<ItemMediaProps & React.RefAttributes<HTMLDivElement>>;
14
+ export declare const ItemContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
+ export declare const ItemTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
+ export declare const ItemDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
17
+ export declare const ItemActions: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
18
+ export declare const ItemHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
19
+ export declare const ItemFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,152 @@
1
+ 'use client';
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ import React from 'react';
4
+ import { mergeRefs } from "../forms/Button.js";
5
+ import { Separator } from "./Separator.js";
6
+ function classes(...values) {
7
+ return values.filter(Boolean).join(' ');
8
+ }
9
+ function renderRoot({
10
+ render,
11
+ asChild,
12
+ children,
13
+ rootProps,
14
+ ref
15
+ }) {
16
+ const candidate = render || (asChild ? React.Children.only(children) : null);
17
+ if (typeof candidate === 'function') return candidate({
18
+ ...rootProps,
19
+ ref
20
+ });
21
+ if (/*#__PURE__*/React.isValidElement(candidate)) {
22
+ return /*#__PURE__*/React.cloneElement(candidate, {
23
+ ...rootProps,
24
+ ...candidate.props,
25
+ className: classes(rootProps.className, candidate.props.className),
26
+ ref: mergeRefs(ref, candidate.ref),
27
+ children: candidate.props.children ?? children
28
+ });
29
+ }
30
+ return /*#__PURE__*/React.createElement("div", _extends({}, rootProps, {
31
+ ref: ref
32
+ }), children);
33
+ }
34
+ export const ItemGroup = /*#__PURE__*/React.forwardRef(function ItemGroup({
35
+ className,
36
+ ...props
37
+ }, ref) {
38
+ return /*#__PURE__*/React.createElement("div", _extends({
39
+ ref: ref,
40
+ role: "list",
41
+ "data-slot": "item-group",
42
+ className: classes('ef-item-group', className)
43
+ }, props));
44
+ });
45
+ export const ItemSeparator = /*#__PURE__*/React.forwardRef(function ItemSeparator({
46
+ className,
47
+ ...props
48
+ }, ref) {
49
+ return /*#__PURE__*/React.createElement(Separator, _extends({
50
+ ref: ref,
51
+ "data-slot": "item-separator",
52
+ orientation: "horizontal",
53
+ className: classes('ef-item-separator', className)
54
+ }, props));
55
+ });
56
+ export const Item = /*#__PURE__*/React.forwardRef(function Item({
57
+ variant = 'default',
58
+ size = 'default',
59
+ render,
60
+ asChild = false,
61
+ className,
62
+ children,
63
+ ...props
64
+ }, ref) {
65
+ const rootProps = {
66
+ ...props,
67
+ 'data-slot': 'item',
68
+ 'data-variant': variant,
69
+ 'data-size': size,
70
+ className: classes('ef-item', className),
71
+ children
72
+ };
73
+ return renderRoot({
74
+ render,
75
+ asChild,
76
+ children,
77
+ rootProps,
78
+ ref
79
+ });
80
+ });
81
+ export const ItemMedia = /*#__PURE__*/React.forwardRef(function ItemMedia({
82
+ variant = 'default',
83
+ className,
84
+ ...props
85
+ }, ref) {
86
+ return /*#__PURE__*/React.createElement("div", _extends({
87
+ ref: ref,
88
+ "data-slot": "item-media",
89
+ "data-variant": variant,
90
+ className: classes('ef-item__media', className)
91
+ }, props));
92
+ });
93
+ export const ItemContent = /*#__PURE__*/React.forwardRef(function ItemContent({
94
+ className,
95
+ ...props
96
+ }, ref) {
97
+ return /*#__PURE__*/React.createElement("div", _extends({
98
+ ref: ref,
99
+ "data-slot": "item-content",
100
+ className: classes('ef-item__content', className)
101
+ }, props));
102
+ });
103
+ export const ItemTitle = /*#__PURE__*/React.forwardRef(function ItemTitle({
104
+ className,
105
+ ...props
106
+ }, ref) {
107
+ return /*#__PURE__*/React.createElement("div", _extends({
108
+ ref: ref,
109
+ "data-slot": "item-title",
110
+ className: classes('ef-item__title', className)
111
+ }, props));
112
+ });
113
+ export const ItemDescription = /*#__PURE__*/React.forwardRef(function ItemDescription({
114
+ className,
115
+ ...props
116
+ }, ref) {
117
+ return /*#__PURE__*/React.createElement("p", _extends({
118
+ ref: ref,
119
+ "data-slot": "item-description",
120
+ className: classes('ef-item__description', className)
121
+ }, props));
122
+ });
123
+ export const ItemActions = /*#__PURE__*/React.forwardRef(function ItemActions({
124
+ className,
125
+ ...props
126
+ }, ref) {
127
+ return /*#__PURE__*/React.createElement("div", _extends({
128
+ ref: ref,
129
+ "data-slot": "item-actions",
130
+ className: classes('ef-item__actions', className)
131
+ }, props));
132
+ });
133
+ export const ItemHeader = /*#__PURE__*/React.forwardRef(function ItemHeader({
134
+ className,
135
+ ...props
136
+ }, ref) {
137
+ return /*#__PURE__*/React.createElement("div", _extends({
138
+ ref: ref,
139
+ "data-slot": "item-header",
140
+ className: classes('ef-item__header', className)
141
+ }, props));
142
+ });
143
+ export const ItemFooter = /*#__PURE__*/React.forwardRef(function ItemFooter({
144
+ className,
145
+ ...props
146
+ }, ref) {
147
+ return /*#__PURE__*/React.createElement("div", _extends({
148
+ ref: ref,
149
+ "data-slot": "item-footer",
150
+ className: classes('ef-item__footer', className)
151
+ }, props));
152
+ });
package/display/Kbd.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- export interface KbdProps {
2
- /** Key label, e.g. "⌘", "K", "Esc" */
3
- children?: React.ReactNode;
4
- style?: React.CSSProperties;
5
- className?: string;
6
- }
7
- export declare function Kbd(props: KbdProps): React.JSX.Element;
1
+ export type KbdProps = React.HTMLAttributes<HTMLElement>;
2
+ export type KbdGroupProps = React.HTMLAttributes<HTMLSpanElement>;
3
+
4
+ export declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
5
+ export declare const KbdGroup: React.ForwardRefExoticComponent<KbdGroupProps & React.RefAttributes<HTMLSpanElement>>;
package/display/Kbd.js CHANGED
@@ -1,14 +1,26 @@
1
1
  'use client';
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  import React from 'react';
4
- export function Kbd({
5
- children,
6
- style,
4
+ function joinClasses(base, className) {
5
+ return `${base}${className ? ' ' + className : ''}`;
6
+ }
7
+ export const Kbd = /*#__PURE__*/React.forwardRef(function Kbd({
7
8
  className,
8
- ...rest
9
- }) {
10
- return /*#__PURE__*/React.createElement("kbd", _extends({}, rest, {
11
- className: `ef-kbd${className ? ' ' + className : ''}`,
12
- style: style
13
- }), children);
14
- }
9
+ ...props
10
+ }, ref) {
11
+ return /*#__PURE__*/React.createElement("kbd", _extends({}, props, {
12
+ ref: ref,
13
+ "data-slot": "kbd",
14
+ className: joinClasses('ef-kbd', className)
15
+ }));
16
+ });
17
+ export const KbdGroup = /*#__PURE__*/React.forwardRef(function KbdGroup({
18
+ className,
19
+ ...props
20
+ }, ref) {
21
+ return /*#__PURE__*/React.createElement("span", _extends({}, props, {
22
+ ref: ref,
23
+ "data-slot": "kbd-group",
24
+ className: joinClasses('ef-kbd-group', className)
25
+ }));
26
+ });
package/display/Link.js CHANGED
@@ -3,10 +3,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
3
3
  import React from 'react';
4
4
  import { Icon } from "../icons/Icon.js";
5
5
 
6
- // Hover deepens the link's own hue. It used to jump to --accent-hover, which is
7
- // near-black in the light theme — a warm brown link turning almost black on
8
- // hover reads as broken, not emphasised. The underline stays: colour alone is
9
- // not a safe affordance (WCAG 1.4.1).
6
+ // Hover deepens the link's own hue without changing text decoration. Link
7
+ // identity stays stable across pointer, keyboard, and touch interaction.
10
8
 
11
9
  export function Link({
12
10
  href = '#',
@@ -1,16 +1,6 @@
1
- export interface ResizableProps {
2
- /** @default 'horizontal' */
3
- direction?: 'horizontal' | 'vertical';
4
- /** First pane share, 0-1 @default 0.5 */
5
- defaultRatio?: number;
6
- /** @default 0.15 */
7
- min?: number;
8
- /** @default 0.85 */
9
- max?: number;
10
- onRatioChange?: (ratio: number) => void;
11
- /** Exactly two panes */
12
- children: React.ReactNode;
13
- style?: React.CSSProperties;
14
- className?: string;
15
- }
16
- export declare function Resizable(props: ResizableProps): React.JSX.Element;
1
+ export interface ResizablePanelGroupProps extends React.HTMLAttributes<HTMLDivElement> { orientation?: 'horizontal' | 'vertical'; direction?: 'ltr' | 'rtl'; onLayoutChange?: (sizes: number[]) => void; }
2
+ export interface ResizablePanelProps extends React.HTMLAttributes<HTMLDivElement> { defaultSize?: number | string; minSize?: number | string; maxSize?: number | string; }
3
+ export interface ResizableHandleProps extends React.HTMLAttributes<HTMLDivElement> { withHandle?: boolean; disabled?: boolean; }
4
+ export declare const ResizablePanelGroup: React.ForwardRefExoticComponent<ResizablePanelGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ export declare const ResizablePanel: React.ForwardRefExoticComponent<ResizablePanelProps & React.RefAttributes<HTMLDivElement>>;
6
+ export declare const ResizableHandle: React.ForwardRefExoticComponent<ResizableHandleProps & React.RefAttributes<HTMLDivElement>>;
@@ -2,76 +2,159 @@
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  import React from 'react';
4
4
  import { cssPct } from "../forms/Button.js";
5
- export function Resizable({
6
- direction = 'horizontal',
7
- defaultRatio = 0.5,
8
- min = 0.15,
9
- max = 0.85,
10
- onRatioChange,
5
+ import { useDirection } from "./Direction.js";
6
+ const ResizableCtx = /*#__PURE__*/React.createContext(null);
7
+ function sizeNumber(value, fallback) {
8
+ const parsed = typeof value === 'string' ? Number.parseFloat(value) : Number(value);
9
+ return Number.isFinite(parsed) ? parsed : fallback;
10
+ }
11
+ function initialPanelSizes(panels) {
12
+ const declared = panels.map(panel => panel.props.defaultSize == null ? null : sizeNumber(panel.props.defaultSize, null));
13
+ const knownTotal = declared.reduce((sum, value) => sum + (value ?? 0), 0);
14
+ const missing = declared.filter(value => value == null).length;
15
+ const fill = missing ? Math.max(0, 100 - knownTotal) / missing : 0;
16
+ const values = declared.map(value => value ?? fill);
17
+ const total = values.reduce((sum, value) => sum + value, 0) || 100;
18
+ return values.map(value => value / total * 100);
19
+ }
20
+ export const ResizablePanelGroup = /*#__PURE__*/React.forwardRef(function ResizablePanelGroup({
21
+ orientation = 'horizontal',
22
+ direction,
23
+ onLayoutChange,
11
24
  children,
12
- style,
13
25
  className,
14
- ...rest
15
- }) {
16
- const [ratio, setRatio] = React.useState(defaultRatio);
17
- const [drag, setDrag] = React.useState(false);
18
- const ref = React.useRef(null);
19
- const clamp = v => Math.min(max, Math.max(min, v));
20
- const apply = v => {
21
- const r = clamp(v);
22
- setRatio(r);
23
- if (onRatioChange) onRatioChange(r);
24
- };
25
- const down = e => {
26
- e.preventDefault();
27
- setDrag(true);
28
- const move = ev => {
29
- const rect = ref.current.getBoundingClientRect();
30
- apply(direction === 'horizontal' ? (ev.clientX - rect.left) / rect.width : (ev.clientY - rect.top) / rect.height);
26
+ ...props
27
+ }, ref) {
28
+ const readingDirection = useDirection();
29
+ const nodes = React.Children.toArray(children);
30
+ const panels = nodes.filter(child => /*#__PURE__*/React.isValidElement(child) && child.type === ResizablePanel);
31
+ const [sizes, setSizes] = React.useState(() => initialPanelSizes(panels));
32
+ const updatePair = React.useCallback((index, delta) => {
33
+ setSizes(current => {
34
+ const next = [...current];
35
+ const before = panels[index]?.props || {};
36
+ const after = panels[index + 1]?.props || {};
37
+ const combined = next[index] + next[index + 1];
38
+ const minBefore = sizeNumber(before.minSize, 0);
39
+ const maxBefore = sizeNumber(before.maxSize, combined);
40
+ const minAfter = sizeNumber(after.minSize, 0);
41
+ const maxAfter = sizeNumber(after.maxSize, combined);
42
+ const proposed = Math.max(minBefore, Math.min(maxBefore, next[index] + delta));
43
+ const bounded = Math.max(combined - maxAfter, Math.min(combined - minAfter, proposed));
44
+ next[index] = bounded;
45
+ next[index + 1] = combined - bounded;
46
+ onLayoutChange?.(next);
47
+ return next;
48
+ });
49
+ }, [onLayoutChange, panels]);
50
+ let panelIndex = 0;
51
+ let handleIndex = 0;
52
+ const value = React.useMemo(() => ({
53
+ orientation,
54
+ direction: direction || readingDirection,
55
+ sizes,
56
+ updatePair
57
+ }), [orientation, direction, readingDirection, sizes, updatePair]);
58
+ return /*#__PURE__*/React.createElement(ResizableCtx.Provider, {
59
+ value: value
60
+ }, /*#__PURE__*/React.createElement("div", _extends({}, props, {
61
+ ref: ref,
62
+ "data-slot": "resizable-panel-group",
63
+ "data-orientation": orientation,
64
+ "aria-orientation": orientation,
65
+ className: `ef-resizable${className ? ' ' + className : ''}`
66
+ }), nodes.map((child, index) => {
67
+ if (! /*#__PURE__*/React.isValidElement(child)) return child;
68
+ if (child.type === ResizablePanel) return /*#__PURE__*/React.cloneElement(child, {
69
+ key: child.key ?? index,
70
+ _panelIndex: panelIndex++
71
+ });
72
+ if (child.type === ResizableHandle) return /*#__PURE__*/React.cloneElement(child, {
73
+ key: child.key ?? index,
74
+ _handleIndex: handleIndex++
75
+ });
76
+ return child;
77
+ })));
78
+ });
79
+ export const ResizablePanel = /*#__PURE__*/React.forwardRef(function ResizablePanel({
80
+ _panelIndex = 0,
81
+ defaultSize,
82
+ minSize,
83
+ maxSize,
84
+ className,
85
+ ...props
86
+ }, ref) {
87
+ const ctx = React.useContext(ResizableCtx);
88
+ const size = ctx?.sizes[_panelIndex] ?? sizeNumber(defaultSize, 50);
89
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
90
+ ref: ref,
91
+ "data-slot": "resizable-panel",
92
+ "data-panel-index": _panelIndex,
93
+ className: `ef-resizable__pane${className ? ' ' + className : ''}`,
94
+ style: {
95
+ flexBasis: cssPct(size),
96
+ flexGrow: 0,
97
+ flexShrink: 0,
98
+ ...props.style
99
+ }
100
+ }));
101
+ });
102
+ export const ResizableHandle = /*#__PURE__*/React.forwardRef(function ResizableHandle({
103
+ _handleIndex = 0,
104
+ withHandle = false,
105
+ disabled = false,
106
+ className,
107
+ ...props
108
+ }, ref) {
109
+ const ctx = React.useContext(ResizableCtx);
110
+ const [active, setActive] = React.useState(false);
111
+ const down = event => {
112
+ props.onPointerDown?.(event);
113
+ if (event.defaultPrevented || disabled || !ctx) return;
114
+ event.preventDefault();
115
+ setActive(true);
116
+ const root = event.currentTarget.parentElement;
117
+ let previous = ctx.orientation === 'horizontal' ? event.clientX : event.clientY;
118
+ const dimension = ctx.orientation === 'horizontal' ? root.clientWidth : root.clientHeight;
119
+ const move = nextEvent => {
120
+ const current = ctx.orientation === 'horizontal' ? nextEvent.clientX : nextEvent.clientY;
121
+ let delta = (current - previous) / Math.max(1, dimension) * 100;
122
+ previous = current;
123
+ if (ctx.orientation === 'horizontal' && ctx.direction === 'rtl') delta *= -1;
124
+ ctx.updatePair(_handleIndex, delta);
31
125
  };
32
126
  const up = () => {
33
- setDrag(false);
127
+ setActive(false);
34
128
  window.removeEventListener('pointermove', move);
35
129
  window.removeEventListener('pointerup', up);
36
130
  };
37
131
  window.addEventListener('pointermove', move);
38
132
  window.addEventListener('pointerup', up);
39
133
  };
40
- const key = e => {
41
- const d = {
42
- ArrowLeft: -0.02,
43
- ArrowRight: 0.02,
44
- ArrowUp: -0.02,
45
- ArrowDown: 0.02
46
- }[e.key];
47
- if (d === undefined) return;
48
- e.preventDefault();
49
- apply(ratio + d);
134
+ const key = event => {
135
+ props.onKeyDown?.(event);
136
+ if (event.defaultPrevented || disabled || !ctx) return;
137
+ const horizontal = ctx.orientation === 'horizontal';
138
+ const rtl = ctx.direction === 'rtl';
139
+ const delta = event.key === (horizontal ? 'ArrowLeft' : 'ArrowUp') ? horizontal && rtl ? 2 : -2 : event.key === (horizontal ? 'ArrowRight' : 'ArrowDown') ? horizontal && rtl ? -2 : 2 : null;
140
+ if (delta == null) return;
141
+ event.preventDefault();
142
+ ctx.updatePair(_handleIndex, delta);
50
143
  };
51
- const kids = React.Children.toArray(children);
52
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
144
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
53
145
  ref: ref,
54
- className: `ef-resizable ef-resizable--${direction}${className ? ' ' + className : ''}`,
55
- style: style
56
- }), /*#__PURE__*/React.createElement("div", {
57
- className: "ef-resizable__pane",
58
- style: {
59
- flexBasis: cssPct(ratio * 100),
60
- flexGrow: 0,
61
- flexShrink: 0
62
- }
63
- }, kids[0]), /*#__PURE__*/React.createElement("button", {
64
- type: "button",
65
146
  role: "separator",
66
- "aria-orientation": direction === 'horizontal' ? 'vertical' : 'horizontal',
67
- "aria-label": "Resize panes",
68
- className: `ef-resizable__handle${drag ? ' ef-resizable__handle--drag' : ''}`,
147
+ tabIndex: disabled ? undefined : 0,
148
+ "aria-label": props['aria-label'] || 'Resize panes',
149
+ "aria-disabled": disabled || undefined,
150
+ "aria-orientation": ctx?.orientation === 'horizontal' ? 'vertical' : 'horizontal',
151
+ "data-slot": "resizable-handle",
152
+ "data-resize-handle-active": active ? '' : undefined,
153
+ className: `ef-resizable__handle${className ? ' ' + className : ''}`,
69
154
  onPointerDown: down,
70
155
  onKeyDown: key
71
- }), /*#__PURE__*/React.createElement("div", {
72
- className: "ef-resizable__pane",
73
- style: {
74
- flex: 1
75
- }
76
- }, kids[1]));
77
- }
156
+ }), withHandle ? /*#__PURE__*/React.createElement("span", {
157
+ className: "ef-resizable__grip",
158
+ "aria-hidden": "true"
159
+ }) : null);
160
+ });
@@ -5,4 +5,6 @@ export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  height?: number | string;
6
6
  children?: React.ReactNode;
7
7
  }
8
- export declare function ScrollArea(props: ScrollAreaProps): React.JSX.Element;
8
+ export interface ScrollBarProps extends React.HTMLAttributes<HTMLSpanElement> { orientation?: 'horizontal' | 'vertical'; }
9
+ export declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps & React.RefAttributes<HTMLDivElement>>;
10
+ export declare const ScrollBar: React.ForwardRefExoticComponent<ScrollBarProps & React.RefAttributes<HTMLSpanElement>>;
@@ -1,20 +1,45 @@
1
1
  'use client';
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  import React from 'react';
4
- export function ScrollArea({
4
+ export const ScrollArea = /*#__PURE__*/React.forwardRef(function ScrollArea({
5
5
  maxHeight,
6
6
  height,
7
7
  children,
8
8
  style,
9
9
  className,
10
10
  ...rest
11
- }) {
12
- return /*#__PURE__*/React.createElement("div", _extends({
11
+ }, ref) {
12
+ const nodes = React.Children.toArray(children);
13
+ const bars = nodes.filter(child => /*#__PURE__*/React.isValidElement(child) && child.type === ScrollBar);
14
+ const content = nodes.filter(child => !(/*#__PURE__*/React.isValidElement(child) && child.type === ScrollBar));
15
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
16
+ ref: ref,
17
+ "data-slot": "scroll-area",
13
18
  className: `ef-scrollarea${className ? ' ' + className : ''}`,
14
19
  style: {
15
20
  maxHeight,
16
21
  height,
17
22
  ...style
18
23
  }
19
- }, rest), children);
20
- }
24
+ }), /*#__PURE__*/React.createElement("div", {
25
+ "data-slot": "scroll-area-viewport",
26
+ className: "ef-scrollarea__viewport",
27
+ style: {
28
+ maxHeight,
29
+ height
30
+ }
31
+ }, content), bars);
32
+ });
33
+ export const ScrollBar = /*#__PURE__*/React.forwardRef(function ScrollBar({
34
+ orientation = 'vertical',
35
+ className,
36
+ ...props
37
+ }, ref) {
38
+ return /*#__PURE__*/React.createElement("span", _extends({}, props, {
39
+ ref: ref,
40
+ "aria-hidden": "true",
41
+ "data-slot": "scroll-area-scrollbar",
42
+ "data-orientation": orientation,
43
+ className: `ef-scrollarea__bar${className ? ' ' + className : ''}`
44
+ }));
45
+ });
@@ -0,0 +1,9 @@
1
+ export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ /** Axis of the dividing rule. @default 'horizontal' */
3
+ orientation?: 'horizontal' | 'vertical';
4
+ /** Remove separator semantics when the rule is only visual. @default true */
5
+ decorative?: boolean;
6
+ }
7
+ export declare const Separator: React.ForwardRefExoticComponent<
8
+ SeparatorProps & React.RefAttributes<HTMLDivElement>
9
+ >;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ import React from 'react';
4
+ export const Separator = /*#__PURE__*/React.forwardRef(function Separator({
5
+ orientation = 'horizontal',
6
+ decorative = true,
7
+ className,
8
+ ...rest
9
+ }, ref) {
10
+ const axis = orientation === 'vertical' ? 'vertical' : 'horizontal';
11
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
12
+ ref: ref,
13
+ role: decorative ? 'none' : 'separator',
14
+ "aria-orientation": !decorative && axis === 'vertical' ? 'vertical' : undefined,
15
+ "data-orientation": axis,
16
+ className: `ef-separator${className ? ` ${className}` : ''}`
17
+ }));
18
+ });
@@ -0,0 +1,24 @@
1
+ export type TimelineTone = 'neutral' | 'success' | 'warning' | 'danger';
2
+
3
+ export interface TimelineItem {
4
+ id?: React.Key;
5
+ title: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ /** Human-readable time shown in the UI. */
8
+ time?: React.ReactNode;
9
+ /** Machine-readable ISO date/time passed to the native time element. */
10
+ dateTime?: string;
11
+ actor?: React.ReactNode;
12
+ meta?: React.ReactNode;
13
+ tone?: TimelineTone;
14
+ /** Lucide icon name. Defaults from tone. */
15
+ icon?: string;
16
+ }
17
+
18
+ export interface TimelineProps extends Omit<React.OlHTMLAttributes<HTMLOListElement>, 'children'> {
19
+ items: TimelineItem[];
20
+ compact?: boolean;
21
+ }
22
+
23
+ export declare function Timeline(props: TimelineProps): React.JSX.Element;
24
+