@orcestr/ui 0.0.1 → 0.1.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 (179) hide show
  1. package/README.md +4 -0
  2. package/README.ru.md +4 -0
  3. package/dist/components/Alert/Alert.d.ts +5 -4
  4. package/dist/components/Alert/Alert.d.ts.map +1 -1
  5. package/dist/components/Alert/Alert.js +5 -2
  6. package/dist/components/AppShell/AppShell.d.ts +2 -0
  7. package/dist/components/AppShell/AppShell.d.ts.map +1 -1
  8. package/dist/components/AppShell/AppShell.js +9 -6
  9. package/dist/components/AppSidebar/AppSidebar.d.ts +36 -0
  10. package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -0
  11. package/dist/components/AppSidebar/AppSidebar.js +53 -0
  12. package/dist/components/Badge/Badge.d.ts +8 -6
  13. package/dist/components/Badge/Badge.d.ts.map +1 -1
  14. package/dist/components/Badge/Badge.js +4 -4
  15. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts +22 -0
  16. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -0
  17. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +50 -0
  18. package/dist/components/Box/Box.d.ts +2 -0
  19. package/dist/components/Box/Box.d.ts.map +1 -1
  20. package/dist/components/Box/Box.js +15 -2
  21. package/dist/components/Button/Button.d.ts +7 -3
  22. package/dist/components/Button/Button.d.ts.map +1 -1
  23. package/dist/components/Button/Button.js +23 -3
  24. package/dist/components/Card/Card.d.ts +26 -0
  25. package/dist/components/Card/Card.d.ts.map +1 -0
  26. package/dist/components/Card/Card.js +25 -0
  27. package/dist/components/Checkbox/Checkbox.d.ts +6 -2
  28. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  29. package/dist/components/Checkbox/Checkbox.js +13 -4
  30. package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
  31. package/dist/components/CommandPalette/CommandPalette.js +10 -9
  32. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
  33. package/dist/components/ConfirmDialog/ConfirmDialog.js +5 -2
  34. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  35. package/dist/components/ContextMenu/ContextMenu.js +2 -2
  36. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  37. package/dist/components/DatePicker/DatePicker.js +9 -1
  38. package/dist/components/Dialog/Dialog.d.ts +69 -1
  39. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  40. package/dist/components/Dialog/Dialog.js +48 -1
  41. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  42. package/dist/components/Drawer/Drawer.js +2 -2
  43. package/dist/components/EntityPicker/EntityPicker.d.ts +2 -1
  44. package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
  45. package/dist/components/EntityPicker/EntityPicker.js +2 -2
  46. package/dist/components/Flex/Flex.d.ts +5 -1
  47. package/dist/components/Flex/Flex.d.ts.map +1 -1
  48. package/dist/components/Flex/Flex.js +16 -3
  49. package/dist/components/Grid/Grid.d.ts +9 -2
  50. package/dist/components/Grid/Grid.d.ts.map +1 -1
  51. package/dist/components/Grid/Grid.js +22 -1
  52. package/dist/components/IconButton/IconButton.d.ts +19 -7
  53. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  54. package/dist/components/IconButton/IconButton.js +40 -5
  55. package/dist/components/IconTextButton/IconTextButton.d.ts +20 -0
  56. package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -0
  57. package/dist/components/IconTextButton/IconTextButton.js +24 -0
  58. package/dist/components/InlineEdit/InlineEdit.d.ts +63 -0
  59. package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -0
  60. package/dist/components/InlineEdit/InlineEdit.js +98 -0
  61. package/dist/components/LinkButton/LinkButton.d.ts +25 -0
  62. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
  63. package/dist/components/LinkButton/LinkButton.js +12 -0
  64. package/dist/components/Modal/Modal.d.ts +29 -6
  65. package/dist/components/Modal/Modal.d.ts.map +1 -1
  66. package/dist/components/Modal/Modal.js +37 -13
  67. package/dist/components/Overlay/OverlayProvider.d.ts +1 -0
  68. package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
  69. package/dist/components/Overlay/OverlayProvider.js +18 -1
  70. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +2 -1
  71. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
  72. package/dist/components/PaginatedCombobox/PaginatedCombobox.js +3 -3
  73. package/dist/components/Popover/Popover.d.ts +37 -3
  74. package/dist/components/Popover/Popover.d.ts.map +1 -1
  75. package/dist/components/Popover/Popover.js +56 -9
  76. package/dist/components/ScrollArea/ScrollArea.d.ts +4 -0
  77. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  78. package/dist/components/ScrollArea/ScrollArea.js +30 -4
  79. package/dist/components/Section/Section.d.ts +2 -0
  80. package/dist/components/Section/Section.d.ts.map +1 -1
  81. package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -1
  82. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  83. package/dist/components/SegmentedControl/SegmentedControl.js +28 -2
  84. package/dist/components/Select/Select.d.ts +36 -4
  85. package/dist/components/Select/Select.d.ts.map +1 -1
  86. package/dist/components/Select/Select.js +70 -3
  87. package/dist/components/Separator/Separator.d.ts +3 -1
  88. package/dist/components/Separator/Separator.d.ts.map +1 -1
  89. package/dist/components/Separator/Separator.js +4 -2
  90. package/dist/components/SpecialModal/SpecialModal.d.ts +43 -0
  91. package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -0
  92. package/dist/components/SpecialModal/SpecialModal.js +34 -0
  93. package/dist/components/Spinner/Spinner.d.ts +3 -1
  94. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  95. package/dist/components/Spinner/Spinner.js +2 -2
  96. package/dist/components/State/State.d.ts +8 -1
  97. package/dist/components/State/State.d.ts.map +1 -1
  98. package/dist/components/State/State.js +2 -2
  99. package/dist/components/Switch/Switch.d.ts +2 -0
  100. package/dist/components/Switch/Switch.d.ts.map +1 -1
  101. package/dist/components/Switch/Switch.js +2 -1
  102. package/dist/components/Table/Table.d.ts +64 -0
  103. package/dist/components/Table/Table.d.ts.map +1 -0
  104. package/dist/components/Table/Table.js +38 -0
  105. package/dist/components/Tabs/Tabs.d.ts +33 -2
  106. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  107. package/dist/components/Tabs/Tabs.js +189 -4
  108. package/dist/components/Text/Text.d.ts +13 -3
  109. package/dist/components/Text/Text.d.ts.map +1 -1
  110. package/dist/components/Text/Text.js +16 -3
  111. package/dist/components/TextArea/TextArea.d.ts.map +1 -1
  112. package/dist/components/TextArea/TextArea.js +1 -1
  113. package/dist/components/TextField/TextField.d.ts.map +1 -1
  114. package/dist/components/TextField/TextField.js +1 -1
  115. package/dist/components/Toast/Toast.d.ts +1 -0
  116. package/dist/components/Toast/Toast.d.ts.map +1 -1
  117. package/dist/components/Toast/Toast.js +19 -8
  118. package/dist/components/Tooltip/Tooltip.d.ts +11 -3
  119. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  120. package/dist/components/Tooltip/Tooltip.js +58 -9
  121. package/dist/example/CodePreview.d.ts.map +1 -1
  122. package/dist/example/CodePreview.js +3 -3
  123. package/dist/example/ExampleActionsSection.d.ts.map +1 -1
  124. package/dist/example/ExampleActionsSection.js +3 -3
  125. package/dist/example/ExampleApplicationSection.d.ts +7 -0
  126. package/dist/example/ExampleApplicationSection.d.ts.map +1 -0
  127. package/dist/example/ExampleApplicationSection.js +68 -0
  128. package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
  129. package/dist/example/ExampleBasicsSections.js +5 -9
  130. package/dist/example/ExampleDataSection.d.ts.map +1 -1
  131. package/dist/example/ExampleDataSection.js +31 -30
  132. package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
  133. package/dist/example/ExampleFieldsSection.js +51 -3
  134. package/dist/example/ExampleFoundationsSection.js +1 -1
  135. package/dist/example/ExampleOverlays.d.ts.map +1 -1
  136. package/dist/example/ExampleOverlays.js +7 -2
  137. package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
  138. package/dist/example/ExampleOverlaysSection.js +5 -2
  139. package/dist/example/ExampleSelectionSection.d.ts +3 -1
  140. package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
  141. package/dist/example/ExampleSelectionSection.js +10 -3
  142. package/dist/example/ExampleStateSection.d.ts +3 -0
  143. package/dist/example/ExampleStateSection.d.ts.map +1 -1
  144. package/dist/example/ExampleStateSection.js +58 -3
  145. package/dist/example/ExampleThemePlayground.d.ts +101 -71
  146. package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
  147. package/dist/example/ExampleThemePlayground.js +137 -74
  148. package/dist/example/UiExamplePage.d.ts +7 -1
  149. package/dist/example/UiExamplePage.d.ts.map +1 -1
  150. package/dist/example/UiExamplePage.js +72 -27
  151. package/dist/example/codeSamples.d.ts +7 -0
  152. package/dist/example/codeSamples.d.ts.map +1 -1
  153. package/dist/example/codeSamples.js +429 -60
  154. package/dist/example/exampleData.d.ts.map +1 -1
  155. package/dist/example/exampleData.js +16 -2
  156. package/dist/example/styles.css +245 -74
  157. package/dist/hooks/useFloatingPosition.js +1 -1
  158. package/dist/hooks/usePresence.d.ts.map +1 -1
  159. package/dist/hooks/usePresence.js +9 -7
  160. package/dist/index.d.ts +8 -1
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +8 -1
  163. package/dist/styles/orcestr-ui.css +2545 -672
  164. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  165. package/dist/theme/ThemeProvider.js +90 -36
  166. package/dist/theme/defaultTheme.d.ts.map +1 -1
  167. package/dist/theme/defaultTheme.js +322 -194
  168. package/dist/theme/systemProps.d.ts +48 -28
  169. package/dist/theme/systemProps.d.ts.map +1 -1
  170. package/dist/theme/systemProps.js +103 -1
  171. package/dist/theme/themeTypes.d.ts +21 -17
  172. package/dist/theme/themeTypes.d.ts.map +1 -1
  173. package/dist/utils/slot.d.ts +11 -0
  174. package/dist/utils/slot.d.ts.map +1 -0
  175. package/dist/utils/slot.js +18 -0
  176. package/package.json +2 -2
  177. package/dist/components/Workflow/Workflow.d.ts +0 -82
  178. package/dist/components/Workflow/Workflow.d.ts.map +0 -1
  179. package/dist/components/Workflow/Workflow.js +0 -73
@@ -1,16 +1,19 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cloneElement, isValidElement, useCallback, useEffect, useRef, } from 'react';
3
+ import { cloneElement, Children, forwardRef, isValidElement, useCallback, useContext, useEffect, useRef, } from 'react';
4
4
  import { useDisclosure } from '../../hooks/useDisclosure';
5
5
  import {} from '../../hooks/useFloatingPosition';
6
6
  import { useFloatingLayer } from '../../hooks/useFloatingLayer';
7
7
  import { useOutsidePointerDown } from '../../hooks/useOutsidePointerDown';
8
+ import { splitSystemProps } from '../../theme/systemProps';
9
+ import { OrcestrThemeContext } from '../../theme/useTheme';
8
10
  import { composeRefs } from '../../utils/composeRefs';
9
11
  import { cn } from '../../utils/cn';
10
- import { useOverlayContext, useOverlayLayerIndex } from '../Overlay/OverlayProvider';
12
+ import { overlayLayerZIndex, useOverlayContext, useOverlayLayerIndex, } from '../Overlay/OverlayProvider';
11
13
  import { Portal } from '../Portal/Portal';
12
- export function Popover({ trigger, children, open, defaultOpen, onOpenChange, side = 'bottom', align = 'start', sideOffset = 8, collisionPadding = 8, matchTriggerWidth = false, disabled = false, className, testId, }) {
14
+ export function Popover({ trigger, children, open, defaultOpen, onOpenChange, side = 'bottom', align = 'start', sideOffset = 8, collisionPadding = 8, matchTriggerWidth = false, disabled = false, className, contentStyle, contentRef: externalContentRef, style: contentStyleProp, onOpenAutoFocus, onInteractOutside, testId, ...props }) {
13
15
  const overlay = useOverlayContext();
16
+ const themeContext = useContext(OrcestrThemeContext);
14
17
  const disclosure = useDisclosure({ open, defaultOpen, onOpenChange });
15
18
  const { open: isOpen, close: closeDisclosure, toggle } = disclosure;
16
19
  const previousFocusRef = useRef(null);
@@ -22,12 +25,19 @@ export function Popover({ trigger, children, open, defaultOpen, onOpenChange, si
22
25
  collisionPadding,
23
26
  matchTriggerWidth,
24
27
  });
25
- const close = useCallback(() => closeDisclosure(), [closeDisclosure]);
26
28
  const layerIndex = useOverlayLayerIndex(present);
27
- useOutsidePointerDown([triggerRef, contentRef], isOpen, close);
29
+ const { systemStyle, restProps } = splitSystemProps(props);
30
+ const handleOutsidePointerDown = useCallback((event) => {
31
+ onInteractOutside?.(event);
32
+ if (event.defaultPrevented)
33
+ return;
34
+ closeDisclosure();
35
+ }, [closeDisclosure, onInteractOutside]);
36
+ useOutsidePointerDown([triggerRef, contentRef], isOpen, handleOutsidePointerDown);
28
37
  useEffect(() => {
29
38
  if (!isOpen)
30
39
  return;
40
+ onOpenAutoFocus?.({ preventDefault: () => undefined });
31
41
  previousFocusRef.current =
32
42
  document.activeElement instanceof HTMLElement ? document.activeElement : null;
33
43
  const onKeyDown = (event) => {
@@ -41,7 +51,7 @@ export function Popover({ trigger, children, open, defaultOpen, onOpenChange, si
41
51
  document.removeEventListener('keydown', onKeyDown, true);
42
52
  previousFocusRef.current?.focus?.();
43
53
  };
44
- }, [closeDisclosure, isOpen]);
54
+ }, [closeDisclosure, isOpen, onOpenAutoFocus]);
45
55
  const handleTriggerClick = useCallback((event) => {
46
56
  if (event.defaultPrevented || disabled)
47
57
  return;
@@ -63,11 +73,48 @@ export function Popover({ trigger, children, open, defaultOpen, onOpenChange, si
63
73
  toggle();
64
74
  }
65
75
  }, children: trigger }));
66
- return (_jsxs(_Fragment, { children: [triggerNode, present ? (_jsx(Portal, { children: _jsx("div", { ref: contentRef, className: cn('oui-popover-content', className), "data-state": state, "data-layer": 'dropdown', "data-testid": testId ? `${testId}-content` : undefined, style: {
76
+ return (_jsxs(_Fragment, { children: [triggerNode, present ? (_jsx(Portal, { children: _jsx("div", { ref: composeRefs(contentRef, externalContentRef), className: cn('oui-popover-content', className), "data-state": state, "data-layer": 'dropdown', "data-oui-theme": themeContext?.mode, "data-oui-surface": themeContext?.surface, "data-testid": testId ? `${testId}-content` : undefined, style: {
77
+ ...themeContext?.cssVariables,
67
78
  ...style,
68
- zIndex: overlay.zIndex.dropdown + layerIndex * 10,
69
- }, children: children }) })) : null] }));
79
+ ...systemStyle,
80
+ ...contentStyle,
81
+ ...contentStyleProp,
82
+ zIndex: overlayLayerZIndex(overlay.zIndex, 'dropdown', layerIndex),
83
+ }, ...restProps, children: children }) })) : null] }));
84
+ }
85
+ function PopoverRoot({ children, ...props }) {
86
+ const trigger = findPopoverChild(children, PopoverTrigger);
87
+ const content = findPopoverChild(children, PopoverContent);
88
+ if (!trigger || !content)
89
+ return null;
90
+ const { children: contentChildren, width, size: _size, ref: contentRef, ...contentProps } = content.props;
91
+ return (_jsx(Popover, { ...props, ...contentProps, w: width, contentRef: contentRef, trigger: trigger.props.children, children: contentChildren }));
92
+ }
93
+ function PopoverTrigger(_props) {
94
+ return null;
95
+ }
96
+ const PopoverContent = forwardRef(function PopoverContent(_props, _ref) {
97
+ return null;
98
+ });
99
+ function findPopoverChild(children, type) {
100
+ let found = null;
101
+ Children.forEach(children, (child) => {
102
+ if (!found && isValidElement(child) && child.type === type) {
103
+ found = child;
104
+ }
105
+ });
106
+ return found;
70
107
  }
108
+ Object.assign(Popover, {
109
+ Root: PopoverRoot,
110
+ Trigger: PopoverTrigger,
111
+ Content: PopoverContent,
112
+ });
113
+ (function (Popover) {
114
+ Popover.Root = PopoverRoot;
115
+ Popover.Trigger = PopoverTrigger;
116
+ Popover.Content = PopoverContent;
117
+ })(Popover || (Popover = {}));
71
118
  function clonePopoverTrigger(trigger, { ref, open, disabled, testId, onClick, }) {
72
119
  return cloneElement(trigger, {
73
120
  ref: composeRefs(trigger.props.ref, ref),
@@ -10,6 +10,8 @@ export type ScrollHighlightConfig = {
10
10
  maxOpacity?: number;
11
11
  };
12
12
  export type ScrollAreaProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
13
+ scrollbars?: 'vertical' | 'horizontal' | 'both';
14
+ type?: 'auto' | 'always' | 'scroll' | 'hover';
13
15
  highlights?: boolean;
14
16
  highlightH?: number | string;
15
17
  highlightColor?: string;
@@ -22,6 +24,8 @@ export type ScrollAreaProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
22
24
  testId?: string;
23
25
  };
24
26
  export declare const ScrollArea: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
27
+ scrollbars?: "vertical" | "horizontal" | "both";
28
+ type?: "auto" | "always" | "scroll" | "hover";
25
29
  highlights?: boolean;
26
30
  highlightH?: number | string;
27
31
  highlightColor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../../src/components/ScrollArea/ScrollArea.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQH,KAAK,wBAAwB,EAChC,MAAM,OAAO,CAAC;AAGf,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAG3E,MAAM,MAAM,qBAAqB,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACzD,WAAW,GAAG;IACV,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM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E,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,UAAU;iBAdF,UAAU,GAAG,YAAY,GAAG,MAAM;WACxC,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO;iBAChC,OAAO;iBACP,MAAM,GAAG,MAAM;qBACX,MAAM;uBACJ,OAAO;qBACT,MAAM;4BACC,MAAM;0BACR,MAAM;mBACb,qBAAqB;sBAClB,qBAAqB;aAC9B,MAAM;kDAuNtB,CAAC"}
@@ -4,13 +4,14 @@ import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRe
4
4
  import { cn } from '../../utils/cn';
5
5
  import { splitSystemProps } from '../../theme/systemProps';
6
6
  import { BottomHighlight, TopHighlight } from '../Highlight/Highlight';
7
- export const ScrollArea = forwardRef(function ScrollArea({ className, style, children, highlights = false, highlightH = 32, highlightColor, highlightVisible = true, highlightStart = 0, highlightFadeDistance = 100, highlightMaxOpacity = 1, highlightTop, highlightBottom, testId, ...props }, ref) {
7
+ export const ScrollArea = forwardRef(function ScrollArea({ className, style, children, highlights = false, highlightH = 32, highlightColor, highlightVisible = true, highlightStart = 0, highlightFadeDistance = 100, highlightMaxOpacity = 1, highlightTop, highlightBottom, scrollbars = 'both', type = 'auto', testId, ...props }, ref) {
8
8
  const { systemStyle, restProps } = splitSystemProps(props);
9
9
  const { onScroll, ...outerProps } = restProps;
10
10
  const showHighlights = highlights && highlightVisible;
11
11
  const scrollRef = useRef(null);
12
12
  const frameRef = useRef(null);
13
13
  const [opacity, setOpacity] = useState({ top: 0, bottom: 0 });
14
+ const [overflow, setOverflow] = useState({ x: false, y: false });
14
15
  const topConfig = useMemo(() => normalizeHighlightConfig({
15
16
  h: highlightH,
16
17
  color: highlightColor,
@@ -46,8 +47,24 @@ export const ScrollArea = forwardRef(function ScrollArea({ className, style, chi
46
47
  useImperativeHandle(ref, () => scrollRef.current, []);
47
48
  const updateOpacity = useCallback(() => {
48
49
  const node = scrollRef.current;
49
- if (!node || !showHighlights) {
50
- setOpacity({ top: 0, bottom: 0 });
50
+ if (!node) {
51
+ setOpacity((current) => current.top === 0 && current.bottom === 0
52
+ ? current
53
+ : { top: 0, bottom: 0 });
54
+ setOverflow((current) => !current.x && !current.y ? current : { x: false, y: false });
55
+ return;
56
+ }
57
+ const nextOverflow = {
58
+ x: node.scrollWidth > node.clientWidth + 1,
59
+ y: node.scrollHeight > node.clientHeight + 1,
60
+ };
61
+ setOverflow((current) => current.x === nextOverflow.x && current.y === nextOverflow.y
62
+ ? current
63
+ : nextOverflow);
64
+ if (!showHighlights) {
65
+ setOpacity((current) => current.top === 0 && current.bottom === 0
66
+ ? current
67
+ : { top: 0, bottom: 0 });
51
68
  return;
52
69
  }
53
70
  const maxScroll = Math.max(0, node.scrollHeight - node.clientHeight);
@@ -79,6 +96,9 @@ export const ScrollArea = forwardRef(function ScrollArea({ className, style, chi
79
96
  const observer = typeof ResizeObserver === 'undefined'
80
97
  ? null
81
98
  : new ResizeObserver(scheduleUpdate);
99
+ const mutationObserver = typeof MutationObserver === 'undefined'
100
+ ? null
101
+ : new MutationObserver(scheduleUpdate);
82
102
  observer?.observe(node);
83
103
  Array.from(node.children).forEach((child) => {
84
104
  if (child instanceof HTMLElement &&
@@ -86,9 +106,15 @@ export const ScrollArea = forwardRef(function ScrollArea({ className, style, chi
86
106
  observer?.observe(child);
87
107
  }
88
108
  });
109
+ mutationObserver?.observe(node, {
110
+ attributes: true,
111
+ childList: true,
112
+ subtree: true,
113
+ });
89
114
  window.addEventListener('resize', scheduleUpdate);
90
115
  return () => {
91
116
  observer?.disconnect();
117
+ mutationObserver?.disconnect();
92
118
  window.removeEventListener('resize', scheduleUpdate);
93
119
  if (frameRef.current !== null) {
94
120
  window.cancelAnimationFrame(frameRef.current);
@@ -96,7 +122,7 @@ export const ScrollArea = forwardRef(function ScrollArea({ className, style, chi
96
122
  }
97
123
  };
98
124
  }, [scheduleUpdate]);
99
- return (_jsxs("div", { className: cn('oui-scroll-area', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...outerProps, children: [_jsx("div", { ref: scrollRef, className: 'oui-scroll-area-viewport', "data-testid": testId ? `${testId}-viewport` : undefined, onScroll: (event) => {
125
+ return (_jsxs("div", { className: cn('oui-scroll-area', className), "data-scrollbars": scrollbars, "data-type": type, "data-overflow-x": overflow.x ? 'true' : undefined, "data-overflow-y": overflow.y ? 'true' : undefined, "data-testid": testId, style: { ...systemStyle, ...style }, ...outerProps, children: [_jsx("div", { ref: scrollRef, className: 'oui-scroll-area-viewport', "data-testid": testId ? `${testId}-viewport` : undefined, onScroll: (event) => {
100
126
  onScroll?.(event);
101
127
  scheduleUpdate();
102
128
  }, children: children }), showHighlights ? (_jsxs("div", { className: 'oui-scroll-area-highlight-overlay', "aria-hidden": 'true', children: [topConfig.visible ? (_jsx(TopHighlight, { h: topConfig.h, color: topConfig.color, style: { opacity: opacity.top } })) : null, bottomConfig.visible ? (_jsx(BottomHighlight, { h: bottomConfig.h, color: bottomConfig.color, style: { opacity: opacity.bottom } })) : null] })) : null] }));
@@ -5,6 +5,8 @@ export type SectionProps = FlexProps & {
5
5
  testId?: string;
6
6
  };
7
7
  export declare const Section: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("../..").SystemProps & {
8
+ as?: import("react").ElementType;
9
+ asChild?: boolean;
8
10
  testId?: string;
9
11
  } & {
10
12
  sectionColor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/Section/Section.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAaF,eAAO,MAAM,OAAO;;;mBAhBD,MAAM;qBACJ,MAAM,GAAG,MAAM;aACvB,MAAM;kDAuCjB,CAAC"}
1
+ {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/Section/Section.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAaF,eAAO,MAAM,OAAO;;;;;mBAhBD,MAAM;qBACJ,MAAM,GAAG,MAAM;aACvB,MAAM;kDAuCjB,CAAC"}
@@ -1,13 +1,36 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { UiSize } from '../../theme/systemProps';
1
3
  export type SegmentedControlItem = {
2
4
  value: string;
3
5
  label: string;
4
6
  disabled?: boolean;
5
7
  };
6
- export declare function SegmentedControl({ value, onValueChange, items, className, testId, }: {
8
+ export declare function SegmentedControl({ value, onValueChange, items, size, className, testId, }: {
7
9
  value: string;
8
10
  onValueChange: (value: string) => void;
9
11
  items: ReadonlyArray<SegmentedControlItem>;
12
+ size?: UiSize;
10
13
  className?: string;
11
14
  testId?: string;
12
15
  }): import("react/jsx-runtime").JSX.Element;
16
+ type SegmentedRootProps = {
17
+ value: string;
18
+ onValueChange: (value: string) => void;
19
+ children: ReactNode;
20
+ size?: UiSize;
21
+ className?: string;
22
+ testId?: string;
23
+ };
24
+ type SegmentedItemProps = {
25
+ value: string;
26
+ disabled?: boolean;
27
+ children: ReactNode;
28
+ };
29
+ declare function SegmentedRoot({ value, onValueChange, children, size, className, testId, }: SegmentedRootProps): import("react/jsx-runtime").JSX.Element;
30
+ declare function SegmentedItem(_props: SegmentedItemProps): null;
31
+ export declare namespace SegmentedControl {
32
+ const Root: typeof SegmentedRoot;
33
+ const Item: typeof SegmentedItem;
34
+ }
35
+ export {};
13
36
  //# sourceMappingURL=SegmentedControl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC7B,KAAK,EACL,aAAa,EACb,KAAK,EACL,SAAS,EACT,MAAM,GACT,EAAE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAkBA"}
1
+ {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE/D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAGpD,MAAM,MAAM,oBAAoB,GA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{ Children, isValidElement } from 'react';
3
4
  import { cn } from '../../utils/cn';
4
- export function SegmentedControl({ value, onValueChange, items, className, testId, }) {
5
- return (_jsx("div", { className: cn('oui-segmented', className), "data-testid": testId, children: items.map((item) => (_jsx("button", { type: 'button', className: 'oui-segmented-item', "data-active": value === item.value ? 'true' : undefined, "data-testid": testId ? `${testId}-${item.value}` : undefined, disabled: item.disabled, onClick: () => onValueChange(item.value), children: item.label }, item.value))) }));
5
+ export function SegmentedControl({ value, onValueChange, items, size, className, testId, }) {
6
+ return (_jsx("div", { className: cn('oui-segmented', className), "data-size": size, "data-testid": testId, children: items.map((item) => (_jsx("button", { type: 'button', className: 'oui-segmented-item', "data-active": value === item.value ? 'true' : undefined, "data-testid": testId ? `${testId}-${item.value}` : undefined, disabled: item.disabled, onClick: () => onValueChange(item.value), children: item.label }, item.value))) }));
6
7
  }
8
+ function SegmentedRoot({ value, onValueChange, children, size, className, testId, }) {
9
+ const items = [];
10
+ Children.forEach(children, (child) => {
11
+ if (!isValidElement(child) || child.type !== SegmentedItem)
12
+ return;
13
+ const props = child.props;
14
+ items.push({
15
+ value: props.value,
16
+ label: String(props.children ?? ''),
17
+ disabled: props.disabled,
18
+ });
19
+ });
20
+ return (_jsx(SegmentedControl, { value: value, onValueChange: onValueChange, items: items, size: size, className: className, testId: testId }));
21
+ }
22
+ function SegmentedItem(_props) {
23
+ return null;
24
+ }
25
+ Object.assign(SegmentedControl, {
26
+ Root: SegmentedRoot,
27
+ Item: SegmentedItem,
28
+ });
29
+ (function (SegmentedControl) {
30
+ SegmentedControl.Root = SegmentedRoot;
31
+ SegmentedControl.Item = SegmentedItem;
32
+ })(SegmentedControl || (SegmentedControl = {}));
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
- import type { UiSize } from '../../theme/systemProps';
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type SystemProps, type UiSize } from '../../theme/systemProps';
3
3
  export type SelectItem<V extends string = string> = {
4
4
  value: V;
5
5
  label: ReactNode;
@@ -7,7 +7,7 @@ export type SelectItem<V extends string = string> = {
7
7
  triggerLabel?: ReactNode;
8
8
  disabled?: boolean;
9
9
  };
10
- export declare function Select<V extends string = string>({ items, value, onValueChange, placeholder, selectedFallbackLabel, clearable, disabled, emptyText, size, maxHeight, onClear, className, showChevron, clearLabel, testId, }: {
10
+ export declare function Select<V extends string = string>({ items, value, onValueChange, placeholder, selectedFallbackLabel, clearable, disabled, emptyText, size, maxHeight, onClear, className, style, showChevron, clearLabel, testId, ...props }: {
11
11
  items: ReadonlyArray<SelectItem<V>>;
12
12
  value: V | null;
13
13
  onValueChange: (value: V | null) => void;
@@ -20,8 +20,40 @@ export declare function Select<V extends string = string>({ items, value, onValu
20
20
  maxHeight?: number;
21
21
  onClear?: () => void;
22
22
  className?: string;
23
+ style?: CSSProperties;
23
24
  showChevron?: boolean;
24
25
  clearLabel?: string;
25
26
  testId?: string;
26
- }): import("react/jsx-runtime").JSX.Element;
27
+ } & SystemProps): import("react/jsx-runtime").JSX.Element;
28
+ type SelectRootProps<V extends string = string> = {
29
+ value: V | null;
30
+ onValueChange?: (value: V) => void;
31
+ disabled?: boolean;
32
+ children: ReactNode;
33
+ };
34
+ type SelectTriggerProps = {
35
+ placeholder?: string;
36
+ style?: CSSProperties;
37
+ width?: number | string;
38
+ size?: UiSize;
39
+ };
40
+ type SelectContentProps = {
41
+ children: ReactNode;
42
+ };
43
+ type SelectItemProps<V extends string = string> = {
44
+ value: V;
45
+ disabled?: boolean;
46
+ children: ReactNode;
47
+ };
48
+ declare function SelectRoot<V extends string = string>({ value, onValueChange, disabled, children, }: SelectRootProps<V>): import("react/jsx-runtime").JSX.Element;
49
+ declare function SelectTrigger(_props: SelectTriggerProps): null;
50
+ declare function SelectContent(_props: SelectContentProps): null;
51
+ declare function SelectItem<V extends string = string>(_props: SelectItemProps<V>): null;
52
+ export declare namespace Select {
53
+ const Root: typeof SelectRoot;
54
+ const Trigger: typeof SelectTrigger;
55
+ const Content: typeof SelectContent;
56
+ const Item: typeof SelectItem;
57
+ }
58
+ export {};
27
59
  //# sourceMappingURL=Select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAKpD,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAChD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC9C,KAAK,EACL,KAAK,EACL,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,SAAS,EACT,IAAQ,EACR,SAAe,EACf,OAAO,EACP,SAAS,EACT,WAAkB,EAClB,UAAU,EACV,MAAM,GACT,EAAE;IACC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAoNA"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,EASH,KAAK,aAAa,EAGlB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAKxF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAChD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC9C,KAAK,EACL,KAAK,EACL,aAAa,EACb,WAAW,EACX,qBAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,SAAS,EACT,IAAQ,EACR,SAAe,EACf,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAkB,EAClB,UAAU,EACV,MAAM,EACN,GAAG,KAAK,EACX,EAAE;IACC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAA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S,aAAa,CAAC,MAAM,EAAE,kBAAkB,QAEhD;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,kBAAkB,QAEhD;AAED,iBAAS,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,QAExE;AAwCD,yBAAiB,MAAM,CAAC;IACb,MAAM,IAAI,mBAAa,CAAC;IACxB,MAAM,OAAO,sBAAgB,CAAC;IAC9B,MAAM,OAAO,sBAAgB,CAAC;IAC9B,MAAM,IAAI,mBAAa,CAAC;CAClC"}
@@ -1,13 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useId, useMemo, useRef, useState, } from 'react';
3
+ import { useCallback, useEffect, useId, useMemo, useRef, useState, Children, isValidElement, } from 'react';
4
4
  import { LuCheck, LuChevronsUpDown, LuX } from 'react-icons/lu';
5
5
  import { Button } from '../Button/Button';
6
6
  import { Popover } from '../Popover/Popover';
7
+ import { splitSystemProps } from '../../theme/systemProps';
7
8
  import { useOrcestrUiLocale } from '../../locale/LocaleProvider';
8
9
  import { useListNavigation } from '../../hooks/useListNavigation';
9
10
  import { useTypeahead } from '../../hooks/useTypeahead';
10
- export function Select({ items, value, onValueChange, placeholder, selectedFallbackLabel, clearable = false, disabled = false, emptyText, size = 3, maxHeight = 280, onClear, className, showChevron = true, clearLabel, testId, }) {
11
+ export function Select({ items, value, onValueChange, placeholder, selectedFallbackLabel, clearable = false, disabled = false, emptyText, size = 3, maxHeight = 280, onClear, className, style, showChevron = true, clearLabel, testId, ...props }) {
11
12
  const { copy } = useOrcestrUiLocale();
12
13
  const actualPlaceholder = placeholder ?? copy.common.selectValue;
13
14
  const actualEmptyText = emptyText ?? copy.common.noOptions;
@@ -89,11 +90,12 @@ export function Select({ items, value, onValueChange, placeholder, selectedFallb
89
90
  const hasSelectedValue = value !== null;
90
91
  const canClear = clearable && hasSelectedValue && !disabled;
91
92
  const triggerLabel = selected?.triggerLabel ?? selected?.label ?? selectedFallbackLabel ?? null;
93
+ const { systemStyle } = splitSystemProps(props);
92
94
  return (_jsx(Popover, { open: open, onOpenChange: (next) => {
93
95
  setOpen(next);
94
96
  if (!next)
95
97
  navigation.reset();
96
- }, trigger: _jsx(Button, { type: 'button', v: 'surface', size: size, disabled: disabled, fullWidth: true, pressAnimation: 'none', className: 'oui-combobox-trigger', "data-state": open ? 'open' : 'closed', testId: testId, "aria-haspopup": 'listbox', "aria-expanded": open, "aria-controls": listboxId, onKeyDown: handleKeyDown, rightIcon: _jsxs("span", { className: 'oui-combobox-trigger-actions', children: [canClear ? (_jsx("span", { "aria-label": clearLabel ?? copy.common.clear, className: 'oui-combobox-clear', onPointerDown: (event) => {
98
+ }, trigger: _jsx(Button, { type: 'button', v: 'surface', size: size, disabled: disabled, fullWidth: true, pressAnimation: 'none', className: 'oui-combobox-trigger', "data-state": open ? 'open' : 'closed', testId: testId, style: { ...systemStyle, ...style }, "aria-haspopup": 'listbox', "aria-expanded": open, "aria-controls": listboxId, onKeyDown: handleKeyDown, rightIcon: _jsxs("span", { className: 'oui-combobox-trigger-actions', children: [canClear ? (_jsx("span", { "aria-label": clearLabel ?? copy.common.clear, className: 'oui-combobox-clear', onPointerDown: (event) => {
97
99
  event.preventDefault();
98
100
  event.stopPropagation();
99
101
  }, onClick: (event) => {
@@ -117,6 +119,71 @@ export function Select({ items, value, onValueChange, placeholder, selectedFallb
117
119
  }, children: [_jsx("span", { className: 'oui-combobox-option-main', children: item.label }), isSelected ? (_jsx(LuCheck, { className: 'oui-combobox-check', size: 15 })) : null] }, item.value));
118
120
  })) }) }));
119
121
  }
122
+ function SelectRoot({ value, onValueChange, disabled, children, }) {
123
+ const trigger = findChild(children, SelectTrigger);
124
+ const content = findChild(children, SelectContent);
125
+ const items = collectSelectItems(content?.props.children);
126
+ const triggerStyle = {
127
+ ...trigger?.props.style,
128
+ width: trigger?.props.width,
129
+ };
130
+ return (_jsx(Select, { items: items, value: value, onValueChange: (next) => {
131
+ if (next !== null)
132
+ onValueChange?.(next);
133
+ }, disabled: disabled, placeholder: trigger?.props.placeholder, size: trigger?.props.size, style: triggerStyle }));
134
+ }
135
+ function SelectTrigger(_props) {
136
+ return null;
137
+ }
138
+ function SelectContent(_props) {
139
+ return null;
140
+ }
141
+ function SelectItem(_props) {
142
+ return null;
143
+ }
144
+ function collectSelectItems(children) {
145
+ const items = [];
146
+ Children.forEach(children, (child) => {
147
+ if (!isValidElement(child))
148
+ return;
149
+ if (child.type === SelectItem) {
150
+ const props = child.props;
151
+ items.push({
152
+ value: props.value,
153
+ label: props.children,
154
+ disabled: props.disabled,
155
+ });
156
+ }
157
+ else {
158
+ const props = child.props;
159
+ if (props && 'children' in props) {
160
+ items.push(...collectSelectItems(props.children));
161
+ }
162
+ }
163
+ });
164
+ return items;
165
+ }
166
+ function findChild(children, type) {
167
+ let found = null;
168
+ Children.forEach(children, (child) => {
169
+ if (!found && isValidElement(child) && child.type === type) {
170
+ found = child;
171
+ }
172
+ });
173
+ return found;
174
+ }
175
+ Object.assign(Select, {
176
+ Root: SelectRoot,
177
+ Trigger: SelectTrigger,
178
+ Content: SelectContent,
179
+ Item: SelectItem,
180
+ });
181
+ (function (Select) {
182
+ Select.Root = SelectRoot;
183
+ Select.Trigger = SelectTrigger;
184
+ Select.Content = SelectContent;
185
+ Select.Item = SelectItem;
186
+ })(Select || (Select = {}));
120
187
  function labelText(item) {
121
188
  if (item.searchText)
122
189
  return item.searchText;
@@ -1,4 +1,6 @@
1
- export declare function Separator({ orientation, className, testId, }: {
1
+ import type { HTMLAttributes } from 'react';
2
+ import { type SystemProps } from '../../theme/systemProps';
3
+ export declare function Separator({ orientation, className, style, testId, ...props }: HTMLAttributes<HTMLSpanElement> & SystemProps & {
2
4
  orientation?: 'horizontal' | 'vertical';
3
5
  className?: string;
4
6
  testId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,EACtB,WAA0B,EAC1B,SAAS,EACT,MAAM,GACT,EAAE;IACC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAUA"}
1
+ {"version":3,"file":"Separator.d.ts","sourceRoot":"","sources":["../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAG3E,wBAAgB,SAAS,CAAC,EACtB,WAA0B,EAC1B,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACX,EAAE,cAAc,CAAC,eAAe,CAAC,GAAG,WAAW,GAAG;IAC/C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAaA"}
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { splitSystemProps } from '../../theme/systemProps';
2
3
  import { cn } from '../../utils/cn';
3
- export function Separator({ orientation = 'horizontal', className, testId, }) {
4
- return (_jsx("span", { className: cn('oui-separator', className), "data-orientation": orientation, "data-testid": testId, role: 'separator', "aria-orientation": orientation }));
4
+ export function Separator({ orientation = 'horizontal', className, style, testId, ...props }) {
5
+ const { systemStyle, restProps } = splitSystemProps(props);
6
+ return (_jsx("span", { className: cn('oui-separator', className), "data-orientation": orientation, "data-testid": testId, role: 'separator', "aria-orientation": orientation, style: { ...systemStyle, ...style }, ...restProps }));
5
7
  }
@@ -0,0 +1,43 @@
1
+ import { type ComponentPropsWithoutRef, type CSSProperties, type ReactNode } from 'react';
2
+ import { type ModalProps } from '../Modal/Modal';
3
+ export type SpecialModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
4
+ export type SpecialModalScroll = 'body' | 'content';
5
+ export type SpecialModalDensity = 'regular' | 'compact';
6
+ export type SpecialModalProps = Omit<ModalProps, 'maxWidth'> & {
7
+ size?: SpecialModalSize;
8
+ maxW?: number | string;
9
+ scroll?: SpecialModalScroll;
10
+ density?: SpecialModalDensity;
11
+ };
12
+ declare function SpecialModalRoot({ size, maxW, scroll, density, className, contentClassName, children, ...props }: SpecialModalProps): import("react/jsx-runtime").JSX.Element;
13
+ type SpecialModalPartProps = ComponentPropsWithoutRef<'div'> & {
14
+ testId?: string;
15
+ };
16
+ export type SpecialModalHeaderProps = SpecialModalPartProps & {
17
+ title?: ReactNode;
18
+ meta?: ReactNode;
19
+ actions?: ReactNode;
20
+ };
21
+ type SpecialModalCloseProps = Omit<ComponentPropsWithoutRef<'button'>, 'children'> & {
22
+ children?: ReactNode;
23
+ };
24
+ declare function SpecialModalClose({ className, children, 'aria-label': ariaLabel, ...props }: SpecialModalCloseProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare const SpecialModal: typeof SpecialModalRoot & {
26
+ Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
27
+ testId?: string;
28
+ } & {
29
+ title?: ReactNode;
30
+ meta?: ReactNode;
31
+ actions?: ReactNode;
32
+ } & import("react").RefAttributes<HTMLDivElement>>;
33
+ Body: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
+ testId?: string;
35
+ } & import("react").RefAttributes<HTMLDivElement>>;
36
+ Footer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
37
+ testId?: string;
38
+ } & import("react").RefAttributes<HTMLDivElement>>;
39
+ Close: typeof SpecialModalClose;
40
+ };
41
+ export type SpecialModalContentStyle = CSSProperties;
42
+ export {};
43
+ //# sourceMappingURL=SpecialModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpecialModal.d.ts","sourceRoot":"","sources":["../../../src/components/SpecialModal/SpecialModal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAQ,KAAK,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;IAC3D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,OAAO,CAAC,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAUF,iBAAS,gBAAgB,CAAC,EACtB,IAAW,EACX,IAAI,EACJ,MAAe,EACf,OAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,iBAAiB,2CAiBnB;AAED,KAAK,qBAAqB,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAAG;IAC1D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AA4DF,KAAK,sBAAsB,GAAG,IAAI,CAC9B,wBAAwB,CAAC,QAAQ,CAAC,EAClC,UAAU,CACb,GAAG;IACA,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EAAE,SAAmB,EACjC,GAAG,KAAK,EACX,EAAE,sBAAsB,2CAcxB;AAED,eAAO,MAAM,YAAY;;iBA/FZ,MAAM;;gBAIP,SAAS;eACV,SAAS;kBACN,SAAS;;;iBANV,MAAM;;;iBAAN,MAAM;;;CAoGjB,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,34 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { forwardRef, } from 'react';
4
+ import { LuX } from 'react-icons/lu';
5
+ import { cn } from '../../utils/cn';
6
+ import { Modal } from '../Modal/Modal';
7
+ const sizeMaxWidth = {
8
+ sm: '420px',
9
+ md: '640px',
10
+ lg: '960px',
11
+ xl: 'min(1480px, calc(100vw - 48px))',
12
+ full: 'calc(100vw - 48px)',
13
+ };
14
+ function SpecialModalRoot({ size = 'lg', maxW, scroll = 'body', density = 'regular', className, contentClassName, children, ...props }) {
15
+ return (_jsx(Modal, { ...props, maxWidth: maxW ?? sizeMaxWidth[size], className: cn('oui-special-modal-layer', className), contentClassName: cn('oui-special-modal', `oui-special-modal-size-${size}`, `oui-special-modal-scroll-${scroll}`, `oui-special-modal-density-${density}`, contentClassName), children: children }));
16
+ }
17
+ const SpecialModalHeader = forwardRef(function SpecialModalHeader({ className, title, meta, actions, children, testId, ...props }, ref) {
18
+ return (_jsx("div", { ref: ref, className: cn('oui-special-modal-header', className), "data-testid": testId, ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("div", { className: 'oui-special-modal-title-wrap', children: [title ? (_jsx("h2", { className: 'oui-special-modal-title', children: title })) : null, meta ? (_jsx("div", { className: 'oui-special-modal-meta', children: meta })) : null] }), actions ? (_jsx("div", { className: 'oui-special-modal-actions', children: actions })) : null] })) }));
19
+ });
20
+ const SpecialModalBody = forwardRef(function SpecialModalBody({ className, testId, ...props }, ref) {
21
+ return (_jsx("div", { ref: ref, className: cn('oui-special-modal-body', className), "data-testid": testId, ...props }));
22
+ });
23
+ const SpecialModalFooter = forwardRef(function SpecialModalFooter({ className, testId, ...props }, ref) {
24
+ return (_jsx("div", { ref: ref, className: cn('oui-special-modal-footer', className), "data-testid": testId, ...props }));
25
+ });
26
+ function SpecialModalClose({ className, children, 'aria-label': ariaLabel = 'Close', ...props }) {
27
+ return (_jsx(Modal.Close, { ...props, className: cn('oui-icon-button oui-special-modal-close', className), "aria-label": ariaLabel, "data-size": '2', "data-variant": 'ghost', "data-tone": 'neutral', "data-round": 'true', children: children ?? _jsx(LuX, { size: 18 }) }));
28
+ }
29
+ export const SpecialModal = Object.assign(SpecialModalRoot, {
30
+ Header: SpecialModalHeader,
31
+ Body: SpecialModalBody,
32
+ Footer: SpecialModalFooter,
33
+ Close: SpecialModalClose,
34
+ });
@@ -1,7 +1,9 @@
1
1
  import type { UiSize } from '../../theme/systemProps';
2
- export declare function Spinner({ size, className, testId, }: {
2
+ import type { CSSProperties } from 'react';
3
+ export declare function Spinner({ size, className, style, testId, }: {
3
4
  size?: UiSize;
4
5
  className?: string;
6
+ style?: CSSProperties;
5
7
  testId?: string;
6
8
  }): import("react/jsx-runtime").JSX.Element;
7
9
  //# sourceMappingURL=Spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,wBAAgB,OAAO,CAAC,EACpB,IAAQ,EACR,SAAS,EACT,MAAM,GACT,EAAE;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAEA"}
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,wBAAgB,OAAO,CAAC,EACpB,IAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,GACT,EAAE;IACC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAEA"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn } from '../../utils/cn';
3
- export function Spinner({ size = 2, className, testId, }) {
4
- return _jsx("span", { className: cn('oui-spinner', className), "data-size": size, "data-testid": testId });
3
+ export function Spinner({ size = 2, className, style, testId, }) {
4
+ return _jsx("span", { className: cn('oui-spinner', className), "data-size": size, "data-testid": testId, style: style });
5
5
  }