@orcestr/ui 0.0.3 → 0.1.1

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 (184) hide show
  1. package/dist/components/Alert/Alert.d.ts +5 -4
  2. package/dist/components/Alert/Alert.d.ts.map +1 -1
  3. package/dist/components/Alert/Alert.js +5 -2
  4. package/dist/components/AppShell/AppShell.d.ts +13 -0
  5. package/dist/components/AppShell/AppShell.d.ts.map +1 -1
  6. package/dist/components/AppShell/AppShell.js +14 -9
  7. package/dist/components/AppSidebar/AppSidebar.d.ts +36 -0
  8. package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -0
  9. package/dist/components/AppSidebar/AppSidebar.js +117 -0
  10. package/dist/components/Badge/Badge.d.ts +8 -6
  11. package/dist/components/Badge/Badge.d.ts.map +1 -1
  12. package/dist/components/Badge/Badge.js +4 -4
  13. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts +22 -0
  14. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -0
  15. package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +50 -0
  16. package/dist/components/Box/Box.d.ts +2 -0
  17. package/dist/components/Box/Box.d.ts.map +1 -1
  18. package/dist/components/Box/Box.js +15 -2
  19. package/dist/components/Button/Button.d.ts +7 -3
  20. package/dist/components/Button/Button.d.ts.map +1 -1
  21. package/dist/components/Button/Button.js +23 -3
  22. package/dist/components/Card/Card.d.ts +26 -0
  23. package/dist/components/Card/Card.d.ts.map +1 -0
  24. package/dist/components/Card/Card.js +25 -0
  25. package/dist/components/Checkbox/Checkbox.d.ts +6 -2
  26. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  27. package/dist/components/Checkbox/Checkbox.js +13 -4
  28. package/dist/components/Collapse/Collapse.d.ts.map +1 -1
  29. package/dist/components/Collapse/Collapse.js +5 -25
  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/CopyButton/CopyButton.d.ts +24 -0
  37. package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
  38. package/dist/components/CopyButton/CopyButton.js +81 -0
  39. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  40. package/dist/components/DatePicker/DatePicker.js +9 -1
  41. package/dist/components/Dialog/Dialog.d.ts +69 -1
  42. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  43. package/dist/components/Dialog/Dialog.js +48 -1
  44. package/dist/components/Drawer/Drawer.d.ts +2 -1
  45. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  46. package/dist/components/Drawer/Drawer.js +4 -4
  47. package/dist/components/EntityPicker/EntityPicker.d.ts +2 -1
  48. package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
  49. package/dist/components/EntityPicker/EntityPicker.js +2 -2
  50. package/dist/components/Flex/Flex.d.ts +5 -1
  51. package/dist/components/Flex/Flex.d.ts.map +1 -1
  52. package/dist/components/Flex/Flex.js +16 -3
  53. package/dist/components/Grid/Grid.d.ts +9 -2
  54. package/dist/components/Grid/Grid.d.ts.map +1 -1
  55. package/dist/components/Grid/Grid.js +22 -1
  56. package/dist/components/IconButton/IconButton.d.ts +19 -7
  57. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  58. package/dist/components/IconButton/IconButton.js +40 -5
  59. package/dist/components/IconTextButton/IconTextButton.d.ts +20 -0
  60. package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -0
  61. package/dist/components/IconTextButton/IconTextButton.js +24 -0
  62. package/dist/components/InlineEdit/InlineEdit.d.ts +63 -0
  63. package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -0
  64. package/dist/components/InlineEdit/InlineEdit.js +98 -0
  65. package/dist/components/LinkButton/LinkButton.d.ts +25 -0
  66. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
  67. package/dist/components/LinkButton/LinkButton.js +12 -0
  68. package/dist/components/Modal/Modal.d.ts +29 -6
  69. package/dist/components/Modal/Modal.d.ts.map +1 -1
  70. package/dist/components/Modal/Modal.js +37 -13
  71. package/dist/components/Overlay/OverlayProvider.d.ts +1 -0
  72. package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
  73. package/dist/components/Overlay/OverlayProvider.js +18 -1
  74. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +2 -1
  75. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
  76. package/dist/components/PaginatedCombobox/PaginatedCombobox.js +3 -3
  77. package/dist/components/Popover/Popover.d.ts +37 -3
  78. package/dist/components/Popover/Popover.d.ts.map +1 -1
  79. package/dist/components/Popover/Popover.js +56 -9
  80. package/dist/components/ScrollArea/ScrollArea.d.ts +4 -0
  81. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  82. package/dist/components/ScrollArea/ScrollArea.js +30 -4
  83. package/dist/components/Section/Section.d.ts +2 -0
  84. package/dist/components/Section/Section.d.ts.map +1 -1
  85. package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -1
  86. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  87. package/dist/components/SegmentedControl/SegmentedControl.js +28 -2
  88. package/dist/components/Select/Select.d.ts +36 -4
  89. package/dist/components/Select/Select.d.ts.map +1 -1
  90. package/dist/components/Select/Select.js +70 -3
  91. package/dist/components/Separator/Separator.d.ts +3 -1
  92. package/dist/components/Separator/Separator.d.ts.map +1 -1
  93. package/dist/components/Separator/Separator.js +4 -2
  94. package/dist/components/SpecialModal/SpecialModal.d.ts +43 -0
  95. package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -0
  96. package/dist/components/SpecialModal/SpecialModal.js +34 -0
  97. package/dist/components/Spinner/Spinner.d.ts +3 -1
  98. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  99. package/dist/components/Spinner/Spinner.js +2 -2
  100. package/dist/components/State/State.d.ts +8 -1
  101. package/dist/components/State/State.d.ts.map +1 -1
  102. package/dist/components/State/State.js +2 -2
  103. package/dist/components/Switch/Switch.d.ts +2 -0
  104. package/dist/components/Switch/Switch.d.ts.map +1 -1
  105. package/dist/components/Switch/Switch.js +2 -1
  106. package/dist/components/Table/Table.d.ts +64 -0
  107. package/dist/components/Table/Table.d.ts.map +1 -0
  108. package/dist/components/Table/Table.js +38 -0
  109. package/dist/components/Tabs/Tabs.d.ts +33 -2
  110. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  111. package/dist/components/Tabs/Tabs.js +201 -5
  112. package/dist/components/Text/Text.d.ts +13 -3
  113. package/dist/components/Text/Text.d.ts.map +1 -1
  114. package/dist/components/Text/Text.js +16 -3
  115. package/dist/components/TextArea/TextArea.d.ts.map +1 -1
  116. package/dist/components/TextArea/TextArea.js +1 -1
  117. package/dist/components/TextField/TextField.d.ts.map +1 -1
  118. package/dist/components/TextField/TextField.js +1 -1
  119. package/dist/components/Toast/Toast.d.ts +1 -4
  120. package/dist/components/Toast/Toast.d.ts.map +1 -1
  121. package/dist/components/Toast/Toast.js +72 -37
  122. package/dist/components/Tooltip/Tooltip.d.ts +11 -3
  123. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  124. package/dist/components/Tooltip/Tooltip.js +58 -9
  125. package/dist/example/CodePreview.d.ts +2 -1
  126. package/dist/example/CodePreview.d.ts.map +1 -1
  127. package/dist/example/CodePreview.js +16 -51
  128. package/dist/example/ExampleActionsSection.d.ts.map +1 -1
  129. package/dist/example/ExampleActionsSection.js +3 -3
  130. package/dist/example/ExampleApplicationSection.d.ts +7 -0
  131. package/dist/example/ExampleApplicationSection.d.ts.map +1 -0
  132. package/dist/example/ExampleApplicationSection.js +88 -0
  133. package/dist/example/ExampleBasicsSections.d.ts +1 -1
  134. package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
  135. package/dist/example/ExampleBasicsSections.js +15 -13
  136. package/dist/example/ExampleDataSection.d.ts.map +1 -1
  137. package/dist/example/ExampleDataSection.js +31 -30
  138. package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
  139. package/dist/example/ExampleFieldsSection.js +51 -3
  140. package/dist/example/ExampleFoundationsSection.js +1 -1
  141. package/dist/example/ExampleOverlays.d.ts.map +1 -1
  142. package/dist/example/ExampleOverlays.js +7 -2
  143. package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
  144. package/dist/example/ExampleOverlaysSection.js +20 -30
  145. package/dist/example/ExampleSelectionSection.d.ts +3 -1
  146. package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
  147. package/dist/example/ExampleSelectionSection.js +10 -3
  148. package/dist/example/ExampleStateSection.d.ts +3 -0
  149. package/dist/example/ExampleStateSection.d.ts.map +1 -1
  150. package/dist/example/ExampleStateSection.js +65 -9
  151. package/dist/example/ExampleThemePlayground.d.ts +84 -54
  152. package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
  153. package/dist/example/ExampleThemePlayground.js +129 -63
  154. package/dist/example/UiExamplePage.d.ts.map +1 -1
  155. package/dist/example/UiExamplePage.js +39 -19
  156. package/dist/example/codeSamples.d.ts +8 -1
  157. package/dist/example/codeSamples.d.ts.map +1 -1
  158. package/dist/example/codeSamples.js +590 -119
  159. package/dist/example/exampleData.d.ts.map +1 -1
  160. package/dist/example/exampleData.js +18 -10
  161. package/dist/example/styles.css +277 -146
  162. package/dist/hooks/useFloatingPosition.js +1 -1
  163. package/dist/hooks/usePresence.d.ts.map +1 -1
  164. package/dist/hooks/usePresence.js +9 -7
  165. package/dist/index.d.ts +9 -1
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js +9 -1
  168. package/dist/styles/orcestr-ui.css +3002 -872
  169. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  170. package/dist/theme/ThemeProvider.js +109 -53
  171. package/dist/theme/defaultTheme.d.ts.map +1 -1
  172. package/dist/theme/defaultTheme.js +356 -223
  173. package/dist/theme/systemProps.d.ts +48 -28
  174. package/dist/theme/systemProps.d.ts.map +1 -1
  175. package/dist/theme/systemProps.js +103 -1
  176. package/dist/theme/themeTypes.d.ts +44 -35
  177. package/dist/theme/themeTypes.d.ts.map +1 -1
  178. package/dist/utils/slot.d.ts +11 -0
  179. package/dist/utils/slot.d.ts.map +1 -0
  180. package/dist/utils/slot.js +18 -0
  181. package/package.json +4 -1
  182. package/dist/components/Workflow/Workflow.d.ts +0 -82
  183. package/dist/components/Workflow/Workflow.d.ts.map +0 -1
  184. package/dist/components/Workflow/Workflow.js +0 -73
@@ -1,24 +1,73 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState } from 'react';
3
+ import { cloneElement, forwardRef, isValidElement, useState, } from 'react';
4
4
  import {} from '../../hooks/useFloatingPosition';
5
5
  import { useFloatingLayer } from '../../hooks/useFloatingLayer';
6
+ import { composeRefs } from '../../utils/composeRefs';
6
7
  import { cn } from '../../utils/cn';
7
- import { useOverlayContext, useOverlayLayerIndex } from '../Overlay/OverlayProvider';
8
+ import { overlayLayerZIndex, useOverlayContext, useOverlayLayerIndex, } from '../Overlay/OverlayProvider';
8
9
  import { Portal } from '../Portal/Portal';
9
- export function Tooltip({ content, children, side = 'top', className, testId, }) {
10
+ export const Tooltip = forwardRef(function Tooltip({ content, children, side = 'top', align = 'center', sideOffset = 8, avoidCollisions: _avoidCollisions, collisionPadding: _collisionPadding, open, defaultOpen = false, onOpenChange, className, testId, }, ref) {
10
11
  const overlay = useOverlayContext();
11
- const [open, setOpen] = useState(false);
12
+ const [internalOpen, setInternalOpen] = useState(defaultOpen);
13
+ const actualOpen = open ?? internalOpen;
14
+ const setOpen = (nextOpen) => {
15
+ if (open === undefined)
16
+ setInternalOpen(nextOpen);
17
+ onOpenChange?.(nextOpen);
18
+ };
12
19
  const { triggerRef, contentRef, present, state, style, } = useFloatingLayer({
13
- open,
20
+ open: actualOpen,
14
21
  presenceDuration: 140,
15
22
  side,
16
- align: 'center',
17
- sideOffset: 8,
23
+ align,
24
+ sideOffset,
18
25
  });
19
26
  const layerIndex = useOverlayLayerIndex(present);
20
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: triggerRef, className: 'oui-tooltip-trigger', "data-testid": testId, onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false), onFocus: () => setOpen(true), onBlur: () => setOpen(false), children: children }), present ? (_jsx(Portal, { children: _jsx("div", { ref: contentRef, role: 'tooltip', className: cn('oui-tooltip-content', className), "data-state": state, "data-layer": 'dropdown', "data-testid": testId ? `${testId}-content` : undefined, style: {
27
+ const triggerHandlers = {
28
+ onMouseEnter: () => setOpen(true),
29
+ onMouseLeave: () => setOpen(false),
30
+ onFocus: (event) => {
31
+ if (isKeyboardFocus(event.currentTarget))
32
+ setOpen(true);
33
+ },
34
+ onBlur: () => setOpen(false),
35
+ };
36
+ const trigger = isValidElement(children)
37
+ ? cloneTooltipTrigger(children, {
38
+ ref: composeRefs(triggerRef, ref),
39
+ testId,
40
+ ...triggerHandlers,
41
+ })
42
+ : (_jsx("span", { ref: composeRefs(triggerRef, ref), className: 'oui-tooltip-trigger', "data-testid": testId, ...triggerHandlers, children: children }));
43
+ return (_jsxs(_Fragment, { children: [trigger, present ? (_jsx(Portal, { children: _jsx("div", { ref: contentRef, role: 'tooltip', className: cn('oui-tooltip-content', className), "data-state": state, "data-layer": 'dropdown', "data-testid": testId ? `${testId}-content` : undefined, style: {
21
44
  ...style,
22
- zIndex: overlay.zIndex.dropdown + layerIndex * 10,
45
+ zIndex: overlayLayerZIndex(overlay.zIndex, 'dropdown', layerIndex),
23
46
  }, children: content }) })) : null] }));
47
+ });
48
+ function cloneTooltipTrigger(trigger, { ref, testId, onMouseEnter, onMouseLeave, onFocus, onBlur, }) {
49
+ return cloneElement(trigger, {
50
+ ref: composeRefs(trigger.props.ref, ref),
51
+ className: cn('oui-tooltip-trigger', trigger.props.className),
52
+ 'data-testid': testId,
53
+ onMouseEnter: (event) => {
54
+ trigger.props.onMouseEnter?.(event);
55
+ onMouseEnter?.(event);
56
+ },
57
+ onMouseLeave: (event) => {
58
+ trigger.props.onMouseLeave?.(event);
59
+ onMouseLeave?.(event);
60
+ },
61
+ onFocus: (event) => {
62
+ trigger.props.onFocus?.(event);
63
+ onFocus?.(event);
64
+ },
65
+ onBlur: (event) => {
66
+ trigger.props.onBlur?.(event);
67
+ onBlur?.(event);
68
+ },
69
+ });
70
+ }
71
+ function isKeyboardFocus(element) {
72
+ return element.matches(':focus-visible');
24
73
  }
@@ -15,8 +15,9 @@ export declare function ExampleTile({ id, title, code, onOpen, className, childr
15
15
  export declare function InlineCodeBlock({ code }: {
16
16
  code: string;
17
17
  }): import("react/jsx-runtime").JSX.Element;
18
- export declare function CodeBlock({ code }: {
18
+ export declare function CodeBlock({ code, mode }: {
19
19
  code: string;
20
+ mode?: 'scroll' | 'inline';
20
21
  }): import("react/jsx-runtime").JSX.Element;
21
22
  export declare function CodePreviewModal({ example, onClose, }: {
22
23
  example: CodeExample | null;
@@ -1 +1 @@
1
- {"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../src/example/CodePreview.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKH,KAAK,SAAS,EAEjB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AA+B/C,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAYA;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAMA;AAED,wBAAgB,WAAW,CAAC,EACxB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,GACX,EAAE,WAAW,GAAG;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACvB,2CAUA;AAED,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAC,EAAE;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,2CA+DrD;AAQD,wBAAgB,SAAS,CAAC,EAAC,IAAI,EAAC,EAAE;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,2CAQ/C;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,OAAO,EACP,OAAO,GACV,EAAE;IACC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,2CAcA"}
1
+ {"version":3,"file":"CodePreview.d.ts","sourceRoot":"","sources":["../../src/example/CodePreview.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AA+B/C,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAYA;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,IAAI,EACJ,MAAM,GACT,EAAE,WAAW,GAAG;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C,2CAMA;AAED,wBAAgB,WAAW,CAAC,EACxB,EAAE,EACF,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,GACX,EAAE,WAAW,GAAG;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACvB,2CAUA;AAED,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAC,EAAE;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,2CA4BrD;AAED,wBAAgB,SAAS,CAAC,EAAC,IAAI,EAAE,IAAe,EAAC,EAAE;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAC,2CA4C5F;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,OAAO,EACP,OAAO,GACV,EAAE;IACC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,2CA8BA"}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useLayoutEffect, useRef, useState, } from 'react';
4
- import { LuInfo } from 'react-icons/lu';
5
- import { Flex, IconButton, Modal, ScrollArea } from '..';
3
+ import { useMemo, useState, } from 'react';
4
+ import { LuInfo, LuX } from 'react-icons/lu';
5
+ import { CopyIconButton, Flex, IconButton, Modal, ScrollArea } from '..';
6
6
  import { cn } from '../utils/cn';
7
7
  import {} from './codeSamples';
8
8
  function highlightedCode(code) {
@@ -38,56 +38,21 @@ export function ExampleTile({ id, title, code, onOpen, className, children, }) {
38
38
  }
39
39
  export function InlineCodeBlock({ code }) {
40
40
  const [expanded, setExpanded] = useState(false);
41
- const [contentHeight, setContentHeight] = useState(0);
42
- const contentRef = useRef(null);
43
- const collapsedHeight = 180;
44
- const collapsible = contentHeight > collapsedHeight;
45
- const panelHeight = collapsible
46
- ? expanded ? contentHeight + 38 : collapsedHeight
47
- : contentHeight;
48
- const measure = useCallback(() => {
49
- const element = contentRef.current;
50
- if (!element)
51
- return;
52
- const nextHeight = element.scrollHeight;
53
- setContentHeight((current) => current === nextHeight ? current : nextHeight);
54
- }, []);
55
- useLayoutEffect(() => {
56
- measure();
57
- }, [code, measure]);
58
- useLayoutEffect(() => {
59
- const element = contentRef.current;
60
- if (!element || typeof ResizeObserver === 'undefined')
61
- return;
62
- const observer = new ResizeObserver(() => measure());
63
- observer.observe(element);
64
- return () => observer.disconnect();
65
- }, [measure]);
66
- const handleWheelCapture = useCallback((event) => {
67
- if (event.ctrlKey || event.shiftKey || Math.abs(event.deltaY) <= Math.abs(event.deltaX))
68
- return;
69
- const scrollRoot = document.querySelector('.oui-app-shell-content-scroll .oui-scroll-area-viewport');
70
- if (!scrollRoot)
71
- return;
72
- event.preventDefault();
73
- event.stopPropagation();
74
- scrollRoot.scrollTop += normalizedWheelDeltaY(event);
75
- }, []);
76
- return (_jsxs("div", { className: 'oui-code-inline-panel', "data-expanded": expanded ? 'true' : 'false', "data-collapsible": collapsible ? 'true' : 'false', style: { height: panelHeight || undefined }, onWheelCapture: handleWheelCapture, children: [_jsx("div", { ref: contentRef, className: 'oui-code-inline-content', children: _jsx(CodeBlock, { code: code }) }), collapsible && !expanded ? _jsx("div", { className: 'oui-code-inline-fade', "aria-hidden": true }) : null, collapsible ? (_jsx("button", { type: 'button', className: 'oui-code-inline-toggle', "aria-expanded": expanded, onClick: () => setExpanded((current) => !current), children: expanded ? 'Hide code' : 'Show code' })) : null] }));
77
- }
78
- function normalizedWheelDeltaY(event) {
79
- if (event.deltaMode === 1)
80
- return event.deltaY * 16;
81
- if (event.deltaMode === 2)
82
- return event.deltaY * window.innerHeight;
83
- return event.deltaY;
84
- }
85
- export function CodeBlock({ code }) {
86
- return (_jsx(ScrollArea, { className: 'oui-code-preview-scroll', children: _jsx("pre", { className: 'oui-code-preview', children: _jsx("code", { children: highlightedCode(code) }) }) }));
41
+ const lineCount = code.split('\n').length;
42
+ const collapsible = lineCount > 9;
43
+ return (_jsxs("div", { className: 'oui-code-inline-panel', "data-expanded": expanded ? 'true' : 'false', "data-collapsible": collapsible ? 'true' : 'false', style: { '--oui-code-lines': lineCount }, children: [_jsx("div", { className: 'oui-code-inline-content', children: _jsx(CodeBlock, { code: code, mode: 'inline' }) }), collapsible ? _jsx("div", { className: 'oui-code-inline-fade', "aria-hidden": true }) : null, collapsible ? (_jsx("button", { type: 'button', className: 'oui-code-inline-toggle', "aria-expanded": expanded, onClick: () => setExpanded((current) => !current), children: expanded ? 'Hide code' : 'Show code' })) : null] }));
44
+ }
45
+ export function CodeBlock({ code, mode = 'scroll' }) {
46
+ const content = useMemo(() => highlightedCode(code), [code]);
47
+ const codeNode = (_jsx("pre", { className: 'oui-code-preview', children: _jsx("code", { children: content }) }));
48
+ if (mode === 'inline') {
49
+ return (_jsxs("div", { className: 'oui-code-preview-wrap', children: [_jsx(CopyIconButton, { className: 'oui-code-preview-copy', text: code, label: 'Copy code', successMessage: 'Code copied', size: 1, v: 'soft' }), _jsx(ScrollArea, { className: 'oui-code-preview-scroll oui-code-preview-scroll-inline', scrollbars: 'horizontal', children: codeNode })] }));
50
+ }
51
+ return (_jsxs("div", { className: 'oui-code-preview-wrap', children: [_jsx(CopyIconButton, { className: 'oui-code-preview-copy', text: code, label: 'Copy code', successMessage: 'Code copied', size: 1, v: 'soft' }), _jsx(ScrollArea, { className: 'oui-code-preview-scroll', children: codeNode })] }));
87
52
  }
88
53
  export function CodePreviewModal({ example, onClose, }) {
89
- return (_jsx(Modal, { open: example !== null, onOpenChange: (open) => {
54
+ return (_jsxs(Modal, { open: example !== null, onOpenChange: (open) => {
90
55
  if (!open)
91
56
  onClose();
92
- }, title: example?.title ?? 'Component code', description: 'Import and usage example.', maxWidth: 760, children: example ? _jsx(CodeBlock, { code: example.code }) : null }));
57
+ }, maxWidth: 760, children: [_jsxs(Modal.Header, { children: [_jsxs("div", { className: 'oui-modal-title-wrap', children: [_jsx("h2", { className: 'oui-modal-title', children: example?.title ?? 'Component code' }), _jsx("p", { className: 'oui-modal-description', children: "Import and usage example." })] }), _jsx(IconButton, { v: 'ghost', icon: _jsx(LuX, { size: 18 }), "aria-label": 'Close', onClick: onClose })] }), _jsx(Modal.Body, { children: example ? _jsx(CodeBlock, { code: example.code }) : null })] }));
93
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleActionsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleActionsSection.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAmD,KAAK,QAAQ,EAAC,MAAM,IAAI,CAAC;AAEnF,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC3B,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,mBAAmB,2CA6GrB"}
1
+ {"version":3,"file":"ExampleActionsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleActionsSection.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAYH,KAAK,QAAQ,EAChB,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC3B,SAAS,EACT,UAAU,EACV,aAAa,GAChB,EAAE,mBAAmB,2CA2LrB"}
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { LuBell, LuCheck, LuCommand, LuEllipsis, LuInfo, LuTrash2, LuTriangleAlert, } from 'react-icons/lu';
4
- import { Button, Flex, IconButton, Menu, Spinner, Tooltip } from '..';
3
+ import { LuBell, LuCheck, LuCommand, LuCopy, LuDownload, LuEllipsis, LuExternalLink, LuInfo, LuMessageSquare, LuPackagePlus, LuRefreshCw, LuSearch, LuSettings, LuShield, LuTrash2, LuTriangleAlert, LuUpload, } from 'react-icons/lu';
4
+ import { Button, ContextMenu, CopyButton, CopyIconButton, Flex, IconButton, IconTextButton, Menu, Spinner, Text, Tooltip, } from '..';
5
5
  import { ExampleTile } from './CodePreview';
6
6
  import { codeSamples } from './codeSamples';
7
7
  import { UiExampleSection } from './UiExampleSection';
8
8
  export function ActionsSection({ menuItems, onOpenCode, onOpenPalette, }) {
9
- return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'buttons-example', title: 'Buttons', description: 'Button variants, tones, sizes, loading states and press animation.', children: _jsxs(ExampleTile, { title: 'Buttons', code: codeSamples.buttons, onOpen: onOpenCode, children: [_jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 3, children: "Solid" }), _jsx(Button, { size: 3, v: 'soft', children: "Soft" }), _jsx(Button, { size: 3, v: 'surface', children: "Surface" }), _jsx(Button, { size: 3, v: 'pad', children: "Pad" }), _jsx(Button, { size: 3, v: 'outline', children: "Outline" }), _jsx(Button, { size: 3, v: 'ghost', children: "Ghost" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 3, tone: 'success', leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Button, { size: 3, tone: 'warning', v: 'soft', leftIcon: _jsx(LuTriangleAlert, { size: 16 }), children: "Warning" }), _jsx(Button, { size: 3, tone: 'info', v: 'soft', leftIcon: _jsx(LuInfo, { size: 16 }), children: "Info" }), _jsx(Button, { size: 3, tone: 'danger', v: 'soft', leftIcon: _jsx(LuTrash2, { size: 16 }), children: "Delete" }), _jsx(Button, { size: 3, loading: true, children: "Loading" }), _jsx(Button, { size: 3, v: 'surface', loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Save" }), _jsx(Button, { size: 3, tone: 'success', loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Spinner, {})] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 1, v: 'surface', children: "Size 1" }), _jsx(Button, { size: 2, v: 'surface', children: "Size 2" }), _jsx(Button, { size: 3, v: 'surface', children: "Size 3" }), _jsx(Button, { size: 4, v: 'surface', children: "Size 4" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 1, children: "Solid 1" }), _jsx(Button, { size: 2, v: 'soft', children: "Soft 2" }), _jsx(Button, { size: 3, v: 'surface', children: "Surface 3" }), _jsx(Button, { size: 3, v: 'pad', children: "Pad 3" }), _jsx(Button, { size: 4, v: 'outline', children: "Outline 4" }), _jsx(Button, { size: 2, v: 'ghost', children: "Ghost 2" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { v: 'surface', pressAnimation: 'translate', children: "Press translate" }), _jsx(Button, { v: 'surface', pressAnimation: 'scale', children: "Press scale" }), _jsx(Button, { v: 'surface', pressAnimation: 'soft', children: "Press soft" }), _jsx(Button, { v: 'surface', pressAnimation: 'none', children: "Press none" })] })] }) }), _jsx(UiExampleSection, { id: 'icon-buttons-example', title: 'Icon buttons', description: 'Icon-only actions, loading state, menu trigger and command entry.', children: _jsxs(ExampleTile, { title: 'Icon buttons', code: codeSamples.iconButtons, onOpen: onOpenCode, children: [_jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { v: 'solid', icon: _jsx(LuCheck, { size: 17 }), "aria-label": 'Solid icon' }), _jsx(IconButton, { v: 'soft', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Soft icon' }), _jsx(IconButton, { v: 'surface', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Surface icon' }), _jsx(IconButton, { v: 'pad', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Pad icon' }), _jsx(IconButton, { v: 'outline', icon: _jsx(LuInfo, { size: 17 }), "aria-label": 'Outline icon' }), _jsx(IconButton, { v: 'ghost', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Ghost icon' })] }), _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { size: 1, v: 'surface', icon: _jsx(LuBell, { size: 13 }), "aria-label": 'Size 1 icon' }), _jsx(IconButton, { size: 2, v: 'surface', icon: _jsx(LuBell, { size: 15 }), "aria-label": 'Size 2 icon' }), _jsx(IconButton, { size: 3, v: 'surface', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Size 3 icon' }), _jsx(IconButton, { size: 4, v: 'surface', icon: _jsx(LuBell, { size: 19 }), "aria-label": 'Size 4 icon' }), _jsx(IconButton, { size: 3, v: 'pad', round: false, r: 3, icon: _jsx(LuCommand, { size: 17 }), "aria-label": 'Square pad icon' }), _jsx(IconButton, { size: 3, v: 'outline', loading: true, icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Loading icon' })] }), _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { size: 1, v: 'ghost', icon: _jsx(LuEllipsis, { size: 13 }), "aria-label": 'Ghost size 1' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuEllipsis, { size: 15 }), "aria-label": 'Ghost size 2' }), _jsx(IconButton, { size: 3, v: 'ghost', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Ghost size 3' }), _jsx(IconButton, { size: 4, v: 'ghost', icon: _jsx(LuEllipsis, { size: 19 }), "aria-label": 'Ghost size 4' })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Tooltip, { content: 'Notifications', children: _jsx(IconButton, { v: 'surface', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Notifications' }) }), _jsx(IconButton, { v: 'surface', loading: true, icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Loading action' }), _jsx(IconButton, { v: 'pad', icon: _jsx(LuBell, { size: 17 }), "aria-label": 'Pad action' }), _jsx(Menu, { trigger: _jsx(IconButton, { v: 'surface', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Actions' }), items: menuItems }), _jsx(Button, { v: 'surface', leftIcon: _jsx(LuCommand, { size: 16 }), onClick: onOpenPalette, children: "Commands" })] })] }) })] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'buttons-example', title: 'Buttons', description: 'Button variants, tones, sizes, loading states and press animation.', children: _jsxs(ExampleTile, { title: 'Buttons', code: codeSamples.buttons, onOpen: onOpenCode, children: [_jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 3, children: "Solid" }), _jsx(Button, { size: 3, v: 'soft', children: "Soft" }), _jsx(Button, { size: 3, v: 'surface', children: "Surface" }), _jsx(Button, { size: 3, v: 'pad', children: "Pad" }), _jsx(Button, { size: 3, v: 'outline', children: "Outline" }), _jsx(Button, { size: 3, v: 'ghost', children: "Ghost" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 3, tone: 'success', leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Button, { size: 3, tone: 'warning', v: 'soft', leftIcon: _jsx(LuTriangleAlert, { size: 16 }), children: "Warning" }), _jsx(Button, { size: 3, tone: 'info', v: 'soft', leftIcon: _jsx(LuInfo, { size: 16 }), children: "Info" }), _jsx(Button, { size: 3, tone: 'danger', v: 'soft', leftIcon: _jsx(LuTrash2, { size: 16 }), children: "Delete" }), _jsx(Button, { size: 3, loading: true, children: "Loading" }), _jsx(Button, { size: 3, v: 'surface', loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Save" }), _jsx(Button, { size: 3, tone: 'success', loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Spinner, {})] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 1, v: 'surface', children: "Size 1" }), _jsx(Button, { size: 2, v: 'surface', children: "Size 2" }), _jsx(Button, { size: 3, v: 'surface', children: "Size 3" }), _jsx(Button, { size: 4, v: 'surface', children: "Size 4" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { size: 1, children: "Solid 1" }), _jsx(Button, { size: 2, v: 'soft', children: "Soft 2" }), _jsx(Button, { size: 3, v: 'surface', children: "Surface 3" }), _jsx(Button, { size: 3, v: 'pad', children: "Pad 3" }), _jsx(Button, { size: 4, v: 'outline', children: "Outline 4" }), _jsx(Button, { size: 2, v: 'ghost', children: "Ghost 2" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Button, { v: 'surface', pressAnimation: 'translate', children: "Press translate" }), _jsx(Button, { v: 'surface', pressAnimation: 'scale', children: "Press scale" }), _jsx(Button, { v: 'surface', pressAnimation: 'soft', children: "Press soft" }), _jsx(Button, { v: 'surface', pressAnimation: 'none', children: "Press none" })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(CopyButton, { text: 'https://orcestr.dev/requests/PR-2026-0900', label: 'Copy link', successMessage: 'Link copied', v: 'surface' }), _jsx(CopyIconButton, { text: 'PR-2026-0900', label: 'Copy request number', successMessage: 'Request number copied', v: 'surface' })] })] }) }), _jsx(UiExampleSection, { id: 'icon-text-buttons-example', title: 'Icon text buttons', description: 'Button and link-button behavior with library-owned icon spacing.', children: _jsx(ExampleTile, { title: 'IconTextButton', code: codeSamples.iconTextButton, onOpen: onOpenCode, children: _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconTextButton, { icon: _jsx(LuPackagePlus, { size: 16 }), children: "Create PO" }), _jsx(IconTextButton, { v: 'soft', tone: 'info', icon: _jsx(LuCopy, { size: 16 }), children: "Duplicate" }), _jsx(IconTextButton, { href: '#icon-text-buttons-example', v: 'surface', icon: _jsx(LuExternalLink, { size: 16 }), children: "Link action" }), _jsx(IconTextButton, { v: 'outline', iconSide: 'end', icon: _jsx(LuExternalLink, { size: 16 }), children: "Open details" })] }) }) }), _jsx(UiExampleSection, { id: 'icon-buttons-example', title: 'Icon buttons', description: 'Icon-only actions, loading state, menu trigger and command entry.', children: _jsxs(ExampleTile, { title: 'Icon buttons', code: codeSamples.iconButtons, onOpen: onOpenCode, children: [_jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { v: 'solid', icon: _jsx(LuCheck, { size: 17 }), "aria-label": 'Solid icon' }), _jsx(IconButton, { v: 'soft', icon: _jsx(LuSearch, { size: 17 }), "aria-label": 'Search icon' }), _jsx(IconButton, { v: 'surface', icon: _jsx(LuUpload, { size: 17 }), "aria-label": 'Upload icon' }), _jsx(IconButton, { v: 'pad', icon: _jsx(LuShield, { size: 17 }), "aria-label": 'Security icon' }), _jsx(IconButton, { v: 'outline', icon: _jsx(LuInfo, { size: 17 }), "aria-label": 'Outline icon' }), _jsx(IconButton, { v: 'ghost', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Ghost icon' })] }), _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { size: 1, v: 'surface', icon: _jsx(LuSearch, { size: 13 }), "aria-label": 'Size 1 search' }), _jsx(IconButton, { size: 2, v: 'surface', icon: _jsx(LuDownload, { size: 15 }), "aria-label": 'Size 2 download' }), _jsx(IconButton, { size: 3, v: 'surface', icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": 'Size 3 refresh' }), _jsx(IconButton, { size: 4, v: 'surface', icon: _jsx(LuSettings, { size: 19 }), "aria-label": 'Size 4 settings' }), _jsx(IconButton, { size: 3, v: 'pad', round: false, r: 3, icon: _jsx(LuCommand, { size: 17 }), "aria-label": 'Square pad icon' }), _jsx(IconButton, { size: 3, v: 'outline', loading: true, icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": 'Loading icon' })] }), _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { v: 'surface', icon: _jsx(LuBell, { size: 17 }), badge: 64, "aria-label": 'Notifications' }), _jsx(IconButton, { v: 'surface', icon: _jsx(LuMessageSquare, { size: 17 }), badge: 99, "aria-label": 'Unread chats' }), _jsx(IconButton, { v: 'pad', icon: _jsx(LuShield, { size: 17 }), badge: 3, badgeTone: 'warning', "aria-label": 'Security warnings' }), _jsx(IconButton, { v: 'ghost', icon: _jsx(LuDownload, { size: 17 }), badge: 'new', badgeTone: 'info', "aria-label": 'New export' })] }), _jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(IconButton, { size: 1, v: 'ghost', icon: _jsx(LuEllipsis, { size: 13 }), "aria-label": 'Ghost size 1' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuEllipsis, { size: 15 }), "aria-label": 'Ghost size 2' }), _jsx(IconButton, { size: 3, v: 'ghost', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Ghost size 3' }), _jsx(IconButton, { size: 4, v: 'ghost', icon: _jsx(LuEllipsis, { size: 19 }), "aria-label": 'Ghost size 4' })] }), _jsxs("div", { className: 'oui-ui-row', children: [_jsx(Tooltip, { content: 'Notifications', children: _jsx(IconButton, { v: 'surface', icon: _jsx(LuBell, { size: 17 }), badge: 8, "aria-label": 'Notifications' }) }), _jsx(IconButton, { v: 'surface', loading: true, icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": 'Loading action' }), _jsx(IconButton, { v: 'pad', icon: _jsx(LuSettings, { size: 17 }), "aria-label": 'Pad action' }), _jsx(Menu, { trigger: _jsx(IconButton, { v: 'surface', icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": 'Actions' }), items: menuItems }), _jsx(Button, { v: 'surface', leftIcon: _jsx(LuCommand, { size: 16 }), onClick: onOpenPalette, children: "Commands" })] })] }) }), _jsx(UiExampleSection, { id: 'context-menu-example', title: 'Context menu', description: 'Right-click menu layer using shared action menu items.', children: _jsx(ExampleTile, { title: 'ContextMenu', code: codeSamples.contextMenu, onOpen: onOpenCode, children: _jsx(ContextMenu, { items: menuItems, children: _jsxs("div", { className: 'oui-ui-context-menu-demo', children: [_jsx(Text, { fs: '13px', fw: 760, children: "Right-click this row" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "ContextMenu reuses Menu item sizing, tones and confirm actions." })] }) }) }) })] }));
10
10
  }
@@ -0,0 +1,7 @@
1
+ import { type CodeExample } from './codeSamples';
2
+ type ExampleSectionProps = {
3
+ onOpenCode: (example: CodeExample) => void;
4
+ };
5
+ export declare function ApplicationSection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=ExampleApplicationSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExampleApplicationSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleApplicationSection.tsx"],"names":[],"mappings":"AAgDA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,mBAAmB,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,EAAC,UAAU,EAAC,EAAE,mBAAmB,2CA8OnE"}
@@ -0,0 +1,88 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { LuArrowLeft, LuArrowLeftRight, LuBell, LuBox, LuBraces, LuCalendar, LuCheck, LuClipboardList, LuCog, LuEllipsis, LuFlaskConical, LuHeadphones, LuLanguages, LuLayoutDashboard, LuMessageSquare, LuSearch, LuSettings, LuShield, LuSun, LuTruck, } from 'react-icons/lu';
5
+ import { AppShell, AppShellContent, AppShellHeader, AppSidebar, Badge, Button, Flex, IconButton, IconTextButton, Menu, PageTitleBlock, SpecialModal, Stack, Text, Tooltip, } from '..';
6
+ import { ExampleTile } from './CodePreview';
7
+ import { codeSamples } from './codeSamples';
8
+ import { UiExampleSection } from './UiExampleSection';
9
+ export function ApplicationSection({ onOpenCode }) {
10
+ const [appShellOpen, setAppShellOpen] = useState(false);
11
+ const [appShellPreviewMode, setAppShellPreviewMode] = useState('desktop');
12
+ const [appShellSidebarSide, setAppShellSidebarSide] = useState('left');
13
+ const [specialModalOpen, setSpecialModalOpen] = useState(false);
14
+ const [shellMobileOpen, setShellMobileOpen] = useState(false);
15
+ const [shellActiveKey, setShellActiveKey] = useState('requests');
16
+ const [sidebarActiveKey, setSidebarActiveKey] = useState('requests');
17
+ const shellGroups = [
18
+ {
19
+ key: 'demand',
20
+ items: [
21
+ { key: 'overview', label: 'Overview', icon: _jsx(LuLayoutDashboard, { size: 17 }), active: shellActiveKey === 'overview' },
22
+ { key: 'requests', label: 'Requests', icon: _jsx(LuTruck, { size: 17 }), active: shellActiveKey === 'requests' },
23
+ { key: 'orders', label: 'Supplier orders', icon: _jsx(LuClipboardList, { size: 17 }), active: shellActiveKey === 'orders' },
24
+ ],
25
+ },
26
+ {
27
+ key: 'operations',
28
+ items: [
29
+ { key: 'products', label: 'Products', icon: _jsx(LuBox, { size: 17 }), active: shellActiveKey === 'products' },
30
+ { key: 'calendar', label: 'Calendar', icon: _jsx(LuCalendar, { size: 17 }), active: shellActiveKey === 'calendar' },
31
+ ],
32
+ },
33
+ ];
34
+ return (_jsxs(_Fragment, { children: [_jsxs(UiExampleSection, { id: 'app-shell-example', title: 'AppShell', description: 'Application shell primitives for module frames.', children: [_jsx(ExampleTile, { title: 'Fullscreen AppShell preview', code: codeSamples.appShell, onOpen: onOpenCode, children: _jsx(IconTextButton, { icon: _jsx(LuLayoutDashboard, { size: 16 }), onClick: () => setAppShellOpen(true), children: "Open AppShell preview" }) }), _jsxs(SpecialModal, { open: appShellOpen, onOpenChange: setAppShellOpen, size: 'full', scroll: 'body', density: 'compact', contentClassName: 'oui-ui-app-shell-modal', children: [_jsxs(SpecialModal.Header, { className: 'oui-ui-app-shell-modal-header', children: [_jsx(Flex, { a: 'c', g: 2, minW: 0, children: _jsx(Text, { fw: 760, children: "AppShell preview" }) }), _jsxs(Flex, { a: 'c', g: 1, children: [_jsx(Button, { className: 'oui-ui-app-shell-mode-toggle', size: 2, v: 'surface', onClick: () => {
35
+ setShellMobileOpen(false);
36
+ setAppShellPreviewMode((mode) => mode === 'desktop' ? 'phone' : 'desktop');
37
+ }, children: appShellPreviewMode === 'desktop'
38
+ ? 'Phone view'
39
+ : 'Desktop view' }), _jsx(SpecialModal.Close, {})] })] }), _jsx(SpecialModal.Body, { className: 'oui-ui-app-shell-modal-body', children: _jsx("div", { className: 'oui-ui-app-shell-preview-stage', "data-mode": appShellPreviewMode, children: _jsx(DemoAppShellPreview, { mode: appShellPreviewMode, mobileOpen: shellMobileOpen, onMobileOpenChange: setShellMobileOpen, sidebarSide: appShellSidebarSide, onToggleSidebarSide: () => setAppShellSidebarSide((side) => side === 'left' ? 'right' : 'left'), groups: shellGroups, onNavigate: (item) => setShellActiveKey(item.key) }) }) })] })] }), _jsx(UiExampleSection, { id: 'app-sidebar-example', title: 'AppSidebar', description: 'Deliveries-style sidebar with active indicator and footer actions.', children: _jsx(ExampleTile, { title: 'AppSidebar', code: codeSamples.appSidebar, onOpen: onOpenCode, children: _jsx("div", { className: 'oui-ui-app-sidebar-demo', children: _jsx(AppSidebar, { header: (_jsxs(_Fragment, { children: [_jsxs("div", { className: 'oui-app-sidebar-brand', children: [_jsx("span", { className: 'oui-app-sidebar-logo', children: _jsx("span", { className: 'oui-ui-demo-logo', children: "O" }) }), _jsx("span", { className: 'oui-app-sidebar-title', children: "Deliveries" })] }), _jsx("div", { className: 'oui-app-sidebar-actions', children: _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": 'Sidebar actions' }) })] })), itemH: 38, onNavigate: (item) => setSidebarActiveKey(item.key), groups: [
40
+ {
41
+ key: 'main',
42
+ items: [
43
+ { key: 'overview', label: 'Overview', icon: _jsx(LuLayoutDashboard, { size: 17 }), active: sidebarActiveKey === 'overview' },
44
+ { key: 'requests', label: 'Requests', icon: _jsx(LuTruck, { size: 17 }), active: sidebarActiveKey === 'requests' },
45
+ { key: 'orders', label: 'Supplier orders', icon: _jsx(LuClipboardList, { size: 17 }), active: sidebarActiveKey === 'orders' },
46
+ ],
47
+ },
48
+ {
49
+ key: 'inventory',
50
+ items: [
51
+ { key: 'products', label: 'Products', icon: _jsx(LuBox, { size: 17 }), active: sidebarActiveKey === 'products' },
52
+ { key: 'calendar', label: 'Calendar', icon: _jsx(LuCalendar, { size: 17 }), disabled: true },
53
+ ],
54
+ },
55
+ ], footer: (_jsxs(Flex, { col: true, g: 2, children: [_jsxs(Flex, { g: 1, a: 'c', children: [_jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuBell, { size: 15 }), badge: 64, "aria-label": 'Notifications' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuSettings, { size: 15 }), "aria-label": 'Settings' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuCog, { size: 15 }), "aria-label": 'Developer tools' })] }), _jsx(Text, { fs: '12px', tone: 'muted', children: "Admin workspace" })] })) }) }) }) }), _jsxs(UiExampleSection, { id: 'special-modal-example', title: 'SpecialModal', description: 'Large entity modal shell for rich operational dialogs.', children: [_jsx(ExampleTile, { title: 'SpecialModal', code: codeSamples.specialModal, onOpen: onOpenCode, children: _jsx(Button, { onClick: () => setSpecialModalOpen(true), children: "Open special modal" }) }), _jsxs(SpecialModal, { open: specialModalOpen, onOpenChange: setSpecialModalOpen, size: 'lg', scroll: 'body', children: [_jsx(SpecialModal.Header, { title: 'Request PR-2026-0900', meta: (_jsxs(Flex, { g: 2, a: 'c', wrap: true, children: [_jsx(Badge, { tone: 'success', children: "Closed" }), _jsx(Badge, { tone: 'neutral', children: "RUB" })] })), actions: _jsx(SpecialModal.Close, {}) }), _jsx(SpecialModal.Body, { children: _jsxs(Stack, { g: 3, children: [_jsxs(Flex, { g: 4, wrap: true, children: [_jsxs(Stack, { g: 0, w: 'min(100%, 220px)', children: [_jsx(Text, { fs: '12px', tone: 'muted', children: "Supplier" }), _jsx(Text, { fw: 760, children: "Northwind Trading LLC" })] }), _jsxs(Stack, { g: 0, w: 'min(100%, 180px)', children: [_jsx(Text, { fs: '12px', tone: 'muted', children: "Plan arrival" }), _jsx(Text, { fw: 760, children: "25.06.2026" })] })] }), _jsx(TableLikePreview, {})] }) }), _jsx(SpecialModal.Footer, { children: _jsxs(Flex, { g: 2, j: 'e', w: '100%', children: [_jsx(Button, { v: 'surface', onClick: () => setSpecialModalOpen(false), children: "Close" }), _jsx(Button, { children: "Save" })] }) })] })] })] }));
56
+ }
57
+ function DemoAppShellPreview({ mode, mobileOpen, onMobileOpenChange, sidebarSide, onToggleSidebarSide, groups, onNavigate, }) {
58
+ const isPhone = mode === 'phone';
59
+ const isRight = sidebarSide === 'right';
60
+ return (_jsx(AppShell, { className: 'oui-ui-app-shell-preview', sidebarMode: isPhone ? 'mobile' : 'desktop', sidebarSide: sidebarSide, sidebarWidth: 300, maxWidth: '100%', contentInset: 0, sidebarOpen: mobileOpen, desktopSidebarOpen: true, onSidebarOpenChange: onMobileOpenChange, header: (_jsx(AppShellHeader, { visibility: 'always', sidebarOpen: mobileOpen, onSidebarOpenChange: onMobileOpenChange, navigationVisibility: 'mobile', actions: _jsx(DemoHeaderActions, {}) })), sidebar: (_jsx(AppSidebar, { side: sidebarSide, header: (_jsxs(_Fragment, { children: [_jsx(DemoShellBrand, {}), _jsxs("div", { className: 'oui-app-sidebar-actions', children: [_jsx(Tooltip, { content: 'Back', children: _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuArrowLeft, { size: 17 }), "aria-label": 'Back' }) }), _jsx(Tooltip, { content: isRight ? 'Move sidebar left' : 'Move sidebar right', children: _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuArrowLeftRight, { size: 17 }), "aria-label": isRight ? 'Move sidebar left' : 'Move sidebar right', onClick: onToggleSidebarSide }) }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": 'Sidebar actions' })] })] })), itemH: 38, onNavigate: onNavigate, groups: groups, footer: _jsx(DemoSidebarFooter, {}) })), children: _jsxs(AppShellContent, { scroll: false, children: [_jsx(PageTitleBlock, { title: 'Requests', caption: 'Module workspace with responsive header and AppSidebar navigation.', action: (_jsx(IconButton, { size: 2, v: 'pad', icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": 'More actions' })) }), _jsx(TableLikePreview, {})] }) }));
61
+ }
62
+ function DemoShellBrand() {
63
+ return (_jsxs("div", { className: 'oui-app-sidebar-brand', children: [_jsx("span", { className: 'oui-app-sidebar-logo', children: _jsx("span", { className: 'oui-ui-demo-logo', children: "O" }) }), _jsx("span", { className: 'oui-app-sidebar-title', children: "Deliveries" })] }));
64
+ }
65
+ function DemoHeaderActions() {
66
+ const [locale, setLocale] = useState('en');
67
+ const languageItems = [
68
+ {
69
+ key: 'ru',
70
+ label: 'RU',
71
+ icon: locale === 'ru' ? _jsx(LuCheck, { size: 14 }) : undefined,
72
+ onSelect: () => setLocale('ru'),
73
+ },
74
+ {
75
+ key: 'en',
76
+ label: 'EN',
77
+ icon: locale === 'en' ? _jsx(LuCheck, { size: 14 }) : undefined,
78
+ onSelect: () => setLocale('en'),
79
+ },
80
+ ];
81
+ return (_jsxs(Flex, { className: 'oui-ui-app-shell-header-actions-demo', a: 'c', g: 1, children: [_jsx(IconTextButton, { className: 'oui-ui-app-shell-quick-jump', size: 2, v: 'soft', tone: 'neutral', icon: _jsx(LuSearch, { size: 14 }), children: "Quick jump" }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuBell, { size: 18 }), badge: 64, "aria-label": 'Notifications' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuMessageSquare, { size: 18 }), badge: 99, "aria-label": 'Messages' }), _jsx(Menu, { align: 'end', items: languageItems, trigger: _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuLanguages, { size: 18 }), "aria-label": `Language: ${locale.toUpperCase()}` }) }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuSun, { size: 18 }), "aria-label": 'Theme' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuShield, { size: 18 }), "aria-label": 'Admin' })] }));
82
+ }
83
+ function DemoSidebarFooter() {
84
+ return (_jsxs(Flex, { col: true, g: 2, children: [_jsxs(Flex, { g: 1, a: 'c', children: [_jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuHeadphones, { size: 15 }), "aria-label": 'Support' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuBell, { size: 15 }), badge: 64, "aria-label": 'Notifications' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuSettings, { size: 15 }), "aria-label": 'Settings' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuFlaskConical, { size: 15 }), "aria-label": 'Demo data' }), _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuBraces, { size: 15 }), "aria-label": 'API' })] }), _jsx(Text, { fs: '12px', tone: 'muted', children: "Admin workspace" })] }));
85
+ }
86
+ function TableLikePreview() {
87
+ return (_jsxs("div", { className: 'oui-ui-application-table-preview', children: [['Brand', 'Name', 'Article', 'Qty', 'Price'].map((item) => (_jsx(Text, { fs: '12px', fw: 760, children: item }, item))), ['Stalex', 'Lathe machine', 'LATHE-8191', '22', '1250'].map((item) => (_jsx(Text, { fs: '13px', children: item }, item)))] }));
88
+ }
@@ -2,7 +2,7 @@ import { type CodeExample } from './codeSamples';
2
2
  type ExampleSectionProps = {
3
3
  onOpenCode: (example: CodeExample) => void;
4
4
  };
5
- export declare function TypographySection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function TextSection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
6
6
  export declare function LayoutSection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
7
7
  export {};
8
8
  //# sourceMappingURL=ExampleBasicsSections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleBasicsSections.d.ts","sourceRoot":"","sources":["../../src/example/ExampleBasicsSections.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,mBAAmB,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAC,UAAU,EAAC,EAAE,mBAAmB,2CAwElE;AAED,wBAAgB,aAAa,CAAC,EAAC,UAAU,EAAC,EAAE,mBAAmB,2CA2U9D"}
1
+ {"version":3,"file":"ExampleBasicsSections.d.ts","sourceRoot":"","sources":["../../src/example/ExampleBasicsSections.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,mBAAmB,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAC,UAAU,EAAC,EAAE,mBAAmB,2CAwE5D;AAED,wBAAgB,aAAa,CAAC,EAAC,UAAU,EAAC,EAAE,mBAAmB,2CAoW9D"}
@@ -1,24 +1,26 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useState } from 'react';
4
- import { AppShellNav, Badge, Box, Button, Collapse, Flex, Grid, PageTitleBlock, ScrollArea, Skeleton, Stack, Text, TopHighlight, BottomHighlight, } from '..';
4
+ import { Alert, Badge, Box, Button, Card, Collapse, Flex, Grid, ScrollArea, Section, Separator, Skeleton, Stack, Text, TopHighlight, BottomHighlight, } from '..';
5
5
  import { ExampleTile } from './CodePreview';
6
6
  import { codeSamples } from './codeSamples';
7
7
  import { UiExampleSection } from './UiExampleSection';
8
- export function TypographySection({ onOpenCode }) {
9
- return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'typography', title: 'Typography', description: 'Text and shared system props.', children: _jsx(ExampleTile, { title: 'Typography', code: codeSamples.typography, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsxs(Stack, { g: 1, children: [_jsx(Text, { as: 'h1', fs: '28px', fw: 780, lh: 1.1, children: "Workflow review" }), _jsx(Text, { as: 'h2', fs: '20px', fw: 720, lh: 1.2, children: "Review window and status" }), _jsx(Text, { tone: 'muted', fs: '13px', lh: 1.5, children: "Compact operational text with muted metadata and predictable line height." })] }), _jsxs(Stack, { g: 1, children: [_jsx(Text, { fs: '15px', fw: 700, children: "Body strong text" }), _jsx(Text, { fs: '14px', lh: 1.55, children: "Body regular text for dense forms and tables." }), _jsx(Text, { fs: '12px', tone: 'muted', lh: 1.4, children: "Caption text, helper text and quiet labels." })] }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Text, { tone: 'brand', fw: 700, children: "Brand" }), _jsx(Text, { tone: 'success', fw: 700, children: "Success" }), _jsx(Text, { tone: 'warning', fw: 700, children: "Warning" }), _jsx(Text, { tone: 'danger', fw: 700, children: "Danger" }), _jsx(Text, { tone: 'info', fw: 700, children: "Info" })] }), _jsx(Box, { w: '100%', p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { display: 'block', truncate: true, children: "This is a long single line value that truncates cleanly inside a constrained row." }) }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Badge, { children: "Neutral" }), _jsx(Badge, { tone: 'brand', children: "Brand" }), _jsx(Badge, { tone: 'success', children: "Success" }), _jsx(Badge, { tone: 'warning', children: "Warning" }), _jsx(Badge, { tone: 'danger', children: "Danger" }), _jsx(Badge, { tone: 'info', children: "Info" })] })] }) }) }), _jsx(UiExampleSection, { id: 'skeleton-example', title: 'Skeleton', description: 'Loading placeholder primitives.', children: _jsx(ExampleTile, { title: 'Skeleton', code: codeSamples.skeleton, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(Skeleton, { h: 16, w: '80%' }), _jsx(Skeleton, { h: 16, w: '64%' }), _jsx(Skeleton, { h: 36 })] }) }) })] }));
8
+ export function TextSection({ onOpenCode }) {
9
+ return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'text', title: 'Text', description: 'Text and shared system props.', children: _jsx(ExampleTile, { title: 'Text', code: codeSamples.text, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsxs(Stack, { g: 1, children: [_jsx(Text, { as: 'h1', fs: '28px', fw: 780, lh: 1.1, children: "Operations review" }), _jsx(Text, { as: 'h2', fs: '20px', fw: 720, lh: 1.2, children: "Review window and status" }), _jsx(Text, { tone: 'muted', fs: '13px', lh: 1.5, children: "Compact operational text with muted metadata and predictable line height." })] }), _jsxs(Stack, { g: 1, children: [_jsx(Text, { fs: '15px', fw: 700, children: "Body strong text" }), _jsx(Text, { fs: '14px', lh: 1.55, children: "Body regular text for dense forms and tables." }), _jsx(Text, { fs: '12px', tone: 'muted', lh: 1.4, children: "Caption text, helper text and quiet labels." })] }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Text, { tone: 'primary', fw: 700, children: "Primary" }), _jsx(Text, { tone: 'success', fw: 700, children: "Success" }), _jsx(Text, { tone: 'warning', fw: 700, children: "Warning" }), _jsx(Text, { tone: 'danger', fw: 700, children: "Danger" }), _jsx(Text, { tone: 'info', fw: 700, children: "Info" })] }), _jsx(Box, { w: '100%', p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { display: 'block', truncate: true, children: "This is a long single line value that truncates cleanly inside a constrained row." }) }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Badge, { children: "Neutral" }), _jsx(Badge, { tone: 'primary', children: "Primary" }), _jsx(Badge, { tone: 'success', children: "Success" }), _jsx(Badge, { tone: 'warning', children: "Warning" }), _jsx(Badge, { tone: 'danger', children: "Danger" }), _jsx(Badge, { tone: 'info', children: "Info" })] })] }) }) }), _jsx(UiExampleSection, { id: 'skeleton-example', title: 'Skeleton', description: 'Loading placeholder primitives.', children: _jsx(ExampleTile, { title: 'Skeleton', code: codeSamples.skeleton, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(Skeleton, { h: 16, w: '80%' }), _jsx(Skeleton, { h: 16, w: '64%' }), _jsx(Skeleton, { h: 36 })] }) }) })] }));
10
10
  }
11
11
  export function LayoutSection({ onOpenCode }) {
12
12
  const [detailsOpen, setDetailsOpen] = useState(true);
13
- return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'app-shell-example', title: 'AppShell', description: 'Shared module frame primitives.', children: _jsx(ExampleTile, { title: 'AppShell primitives', code: codeSamples.appShell, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsx(PageTitleBlock, { title: 'Operations', caption: 'Shared module frame with themed navigation and page actions.', badge: 'shell', action: _jsx(Button, { size: 1, children: "Create" }) }), _jsx(AppShellNav, { items: [
14
- { key: 'queue', label: 'Queue', caption: 'Daily operations', active: true },
15
- { key: 'status', label: 'Status', caption: 'Inventory control', badge: 12 },
16
- { key: 'reports', label: 'Reports', caption: 'Exports and analytics' },
17
- ] })] }) }) }), _jsx(UiExampleSection, { id: 'flex-example', title: 'Flex', description: 'Row and column alignment primitive.', children: _jsx(ExampleTile, { title: 'Flex', code: codeSamples.layoutFlex, onOpen: onOpenCode, children: _jsxs(Flex, { col: true, g: 3, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', j: 'sb', wrap: true, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', wrap: true, children: [_jsx(Badge, { tone: 'brand', children: "status" }), _jsx(Text, { fw: 700, children: "Task TASK-2048" })] }), _jsxs(Flex, { row: true, g: 1, a: 'c', children: [_jsx(Button, { size: 1, v: 'surface', children: "Cancel" }), _jsx(Button, { size: 1, children: "Apply" })] })] }), _jsx(Flex, { row: true, g: 2, wrap: true, children: ['Intake', 'Review', 'Complete'].map((item, index) => (_jsxs(Flex, { col: true, g: 1, p: 2, r: 3, flex: '1 1 150px', style: { background: 'var(--oui-gray-a3)' }, children: [_jsxs(Text, { fs: '12px', tone: 'muted', children: ["Step ", index + 1] }), _jsx(Text, { fw: 700, children: item })] }, item))) })] }) }) }), _jsx(UiExampleSection, { id: 'stack-example', title: 'Stack', description: 'Vertical spacing primitive.', children: _jsx(ExampleTile, { title: 'Stack', code: codeSamples.layoutStack, onOpen: onOpenCode, children: _jsx(Stack, { g: 2, children: [
18
- ['Created', 'Draft created from intake'],
19
- ['Reserved', 'Capacity is reserved for review'],
20
- ['Scheduled', 'Review window is confirmed'],
21
- ].map(([title, description]) => (_jsxs(Flex, { row: true, g: 2, p: 2, r: 3, a: 's', style: { background: 'var(--oui-gray-a3)' }, children: [_jsx(Box, { size: 8, r: 7, mt: 1, style: { background: 'var(--oui-brand)' } }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: '13px', fw: 700, children: title }), _jsx(Text, { fs: '12px', tone: 'muted', lh: 1.45, children: description })] })] }, title))) }) }) }), _jsx(UiExampleSection, { id: 'collapse-example', title: 'Collapse', description: 'Expandable content primitive.', children: _jsx(ExampleTile, { title: 'Collapse', code: codeSamples.layoutCollapse, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', j: 'sb', children: [_jsx(Text, { fw: 700, children: "Item details" }), _jsx(Button, { size: 1, v: 'surface', onClick: () => setDetailsOpen((open) => !open), children: detailsOpen ? 'Hide' : 'Show' })] }), _jsx(Collapse, { open: detailsOpen, children: _jsxs(Stack, { g: 2, p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: [_jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Owner" }), _jsx(Text, { fw: 700, children: "Core team" })] }), _jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Window" }), _jsx(Text, { fw: 700, children: "09:00 - 12:00" })] }), _jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Priority" }), _jsx(Badge, { tone: 'warning', children: "High" })] })] }) })] }) }) }), _jsx(UiExampleSection, { id: 'grid-example', title: 'Grid', description: 'Grid layout primitive.', children: _jsx(ExampleTile, { title: 'Grid', code: codeSamples.layoutGrid, onOpen: onOpenCode, children: _jsx(Grid, { columns: 'repeat(3, minmax(0, 1fr))', g: 2, children: ['A', 'B', 'C', 'D', 'E', 'F'].map((item) => (_jsx(Box, { p: 2, r: 3, ta: 'center', style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { fs: '13px', fw: 700, children: item }) }, item))) }) }) }), _jsx(UiExampleSection, { id: 'highlight-primitives-example', title: 'Highlight primitives', description: 'Standalone edge mask primitives.', children: _jsx(ExampleTile, { title: 'Highlight primitives', code: codeSamples.highlights, onOpen: onOpenCode, children: _jsxs("div", { className: 'oui-highlight-demo-surface', style: { background: 'var(--oui-section-nested-solid-bg)' }, children: [_jsx(TopHighlight, { h: 32, color: 'var(--oui-section-nested-solid-bg)', position: 'absolute' }), _jsx(Text, { fs: '13px', fw: 700, children: "Top and bottom highlights" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "One surface shows both edge masks at the same time." }), _jsx(BottomHighlight, { h: 32, color: 'var(--oui-section-nested-solid-bg)', position: 'absolute' })] }) }) }), _jsx(UiExampleSection, { id: 'scroll-area-example', title: 'ScrollArea', description: 'Themed scroll container with optional edge highlights.', children: _jsx(ExampleTile, { title: 'ScrollArea', code: codeSamples.scrollArea, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(ScrollArea, { h: 116, pr: 1, children: _jsx(Stack, { g: 1, children: Array.from({ length: 10 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsxs(Text, { fs: '13px', children: ["Scroll row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 112, pr: 1, highlights: true, highlightColor: 'var(--oui-section-nested-solid-bg)', highlightTop: { h: 28, mode: 'static', maxOpacity: 0.96 }, highlightBottom: { h: 28, mode: 'static', maxOpacity: 0.96 }, children: _jsx(Stack, { g: 1, children: Array.from({ length: 8 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsxs(Text, { fs: '13px', children: ["Both edges row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 176, pr: 1, highlights: true, highlightColor: 'var(--oui-section-nested-solid-bg)', highlightTop: {
13
+ return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'flex-example', title: 'Flex', description: 'Row and column alignment primitive.', children: _jsx(ExampleTile, { title: 'Flex', code: codeSamples.layoutFlex, onOpen: onOpenCode, children: _jsxs(Flex, { col: true, g: 3, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', j: 'sb', wrap: true, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', wrap: true, children: [_jsx(Badge, { tone: 'primary', children: "status" }), _jsx(Text, { fw: 700, children: "Task TASK-2048" })] }), _jsxs(Flex, { row: true, g: 1, a: 'c', children: [_jsx(Button, { size: 1, v: 'surface', children: "Cancel" }), _jsx(Button, { size: 1, children: "Apply" })] })] }), _jsx(Flex, { row: true, g: 2, wrap: true, children: ['Intake', 'Review', 'Complete'].map((item, index) => (_jsxs(Flex, { col: true, g: 1, p: 2, r: 3, flex: '1 1 150px', style: { background: 'var(--oui-gray-a3)' }, children: [_jsxs(Text, { fs: '12px', tone: 'muted', children: ["Step ", index + 1] }), _jsx(Text, { fw: 700, children: item })] }, item))) })] }) }) }), _jsx(UiExampleSection, { id: 'stack-example', title: 'Stack', description: 'Vertical spacing primitive.', children: _jsx(ExampleTile, { title: 'Stack', code: codeSamples.layoutStack, onOpen: onOpenCode, children: _jsx(Stack, { g: 2, children: [
14
+ ['/gallery/cyberpunk-rain.webp', 'Created', 'Draft created from intake'],
15
+ ['/gallery/hollywood-star.webp', 'Reserved', 'Capacity is reserved for review'],
16
+ ['/gallery/ice-cave.webp', 'Scheduled', 'Review window is confirmed'],
17
+ ].map(([image, title, description]) => (_jsxs(Flex, { row: true, g: 2, a: 'c', w: 'min(100%, 360px)', p: '8px 10px', r: 2, style: { background: 'var(--oui-gray-a3)' }, children: [_jsx("img", { src: image, alt: '', style: {
18
+ width: 34,
19
+ height: 34,
20
+ flex: '0 0 34px',
21
+ borderRadius: 999,
22
+ objectFit: 'cover',
23
+ } }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: '13px', fw: 700, children: title }), _jsx(Text, { fs: '12px', tone: 'muted', lh: 1.45, children: description })] })] }, title))) }) }) }), _jsx(UiExampleSection, { id: 'collapse-example', title: 'Collapse', description: 'Expandable content primitive.', children: _jsx(ExampleTile, { title: 'Collapse', code: codeSamples.layoutCollapse, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsxs(Flex, { row: true, g: 2, a: 'c', j: 'sb', children: [_jsx(Text, { fw: 700, children: "Item details" }), _jsx(Button, { size: 1, v: 'surface', onClick: () => setDetailsOpen((open) => !open), children: detailsOpen ? 'Hide' : 'Show' })] }), _jsx(Collapse, { open: detailsOpen, children: _jsxs(Stack, { g: 2, p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: [_jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Owner" }), _jsx(Text, { fw: 700, children: "Core team" })] }), _jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Window" }), _jsx(Text, { fw: 700, children: "09:00 - 12:00" })] }), _jsxs(Flex, { row: true, g: 2, j: 'sb', children: [_jsx(Text, { tone: 'muted', children: "Priority" }), _jsx(Badge, { tone: 'warning', children: "High" })] })] }) })] }) }) }), _jsx(UiExampleSection, { id: 'surfaces-example', title: 'Surfaces', description: 'Card, Section, Separator and Alert primitives.', children: _jsx(ExampleTile, { title: 'Surfaces', code: codeSamples.surfaces, onOpen: onOpenCode, children: _jsxs(Section, { g: 3, children: [_jsxs(Grid, { columns: 'repeat(auto-fit, minmax(min(100%, 180px), 1fr))', g: 2, children: [_jsx(Card, { v: 'surface', interactive: true, children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Surface card" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "Default operational surface." })] }) }), _jsx(Card, { v: 'soft', children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Soft card" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "Quiet grouped content." })] }) }), _jsx(Card, { v: 'classic', children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Classic card" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "More explicit border and background." })] }) })] }), _jsx(Separator, {}), _jsx(Alert, { title: 'Inventory sync delayed', action: _jsx(Button, { size: 1, v: 'surface', children: "Retry" }), children: "Check this status before creating the next shipment." })] }) }) }), _jsx(UiExampleSection, { id: 'grid-example', title: 'Grid', description: 'Grid layout primitive.', children: _jsx(ExampleTile, { title: 'Grid', code: codeSamples.layoutGrid, onOpen: onOpenCode, children: _jsx(Grid, { columns: 'repeat(3, minmax(0, 1fr))', g: 2, children: ['A', 'B', 'C', 'D', 'E', 'F'].map((item) => (_jsx(Box, { p: 2, r: 3, ta: 'center', style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { fs: '13px', fw: 700, children: item }) }, item))) }) }) }), _jsx(UiExampleSection, { id: 'highlight-primitives-example', title: 'Highlight primitives', description: 'Standalone edge mask primitives.', children: _jsx(ExampleTile, { title: 'Highlight primitives', code: codeSamples.highlights, onOpen: onOpenCode, children: _jsxs("div", { className: 'oui-highlight-demo-surface', style: { background: 'var(--oui-section-nested-solid-bg)' }, children: [_jsx(TopHighlight, { h: 32, color: 'var(--oui-section-nested-solid-bg)', position: 'absolute' }), _jsx(Text, { fs: '13px', fw: 700, children: "Top and bottom highlights" }), _jsx(Text, { fs: '12px', tone: 'muted', children: "One surface shows both edge masks at the same time." }), _jsx(BottomHighlight, { h: 32, color: 'var(--oui-section-nested-solid-bg)', position: 'absolute' })] }) }) }), _jsx(UiExampleSection, { id: 'scroll-area-example', title: 'ScrollArea', description: 'Themed scroll container with optional edge highlights.', children: _jsx(ExampleTile, { title: 'ScrollArea', code: codeSamples.scrollArea, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(ScrollArea, { h: 116, pr: 1, children: _jsx(Stack, { g: 1, children: Array.from({ length: 10 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsxs(Text, { fs: '13px', children: ["Scroll row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 112, pr: 1, highlights: true, highlightColor: 'var(--oui-section-nested-solid-bg)', highlightTop: { h: 28, mode: 'static', maxOpacity: 0.96 }, highlightBottom: { h: 28, mode: 'static', maxOpacity: 0.96 }, children: _jsx(Stack, { g: 1, children: Array.from({ length: 8 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-gray-a3)' }, children: _jsxs(Text, { fs: '13px', children: ["Both edges row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 176, pr: 1, highlights: true, highlightColor: 'var(--oui-section-nested-solid-bg)', highlightTop: {
22
24
  h: 42,
23
25
  mode: 'scroll',
24
26
  start: 50,
@@ -39,5 +41,5 @@ export function LayoutSection({ onOpenCode }) {
39
41
  ['Delivered', 'The gradient uses the solid surface color.'],
40
42
  ['Checked', 'Content remains readable under the fade.'],
41
43
  ['Archived', 'The bottom edge disappears at the end.'],
42
- ].map(([title, description], index) => (_jsxs(Flex, { row: true, g: 2, p: 2, r: 3, a: 'c', style: { background: 'var(--oui-gray-a3)' }, children: [_jsx(Badge, { tone: index < 3 ? 'brand' : 'info', children: index + 1 }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: '13px', fw: 700, children: title }), _jsx(Text, { fs: '12px', tone: 'muted', children: description })] })] }, title))) }) })] }) }) }), _jsx(UiExampleSection, { id: 'system-radius-example', title: 'System radius', description: 'Radius system prop scale.', children: _jsxs(ExampleTile, { title: 'System radius', code: codeSamples.systemRadius, onOpen: onOpenCode, children: [_jsx(Flex, { g: 2, a: 'c', wrap: true, children: [0, 2, 4, 6, 7].map((radius) => (_jsx(Box, { size: 32, r: radius, display: 'flex', a: 'c', j: 'c', style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { fs: '12px', fw: 700, children: radius }) }, radius))) }), _jsx(Button, { mt: 2, v: 'pad', r: 7, children: "Button r=7" })] }) })] }));
44
+ ].map(([title, description], index) => (_jsxs(Flex, { row: true, g: 2, p: 2, r: 3, a: 'c', style: { background: 'var(--oui-gray-a3)' }, children: [_jsx(Badge, { tone: index < 3 ? 'primary' : 'info', children: index + 1 }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: '13px', fw: 700, children: title }), _jsx(Text, { fs: '12px', tone: 'muted', children: description })] })] }, title))) }) })] }) }) }), _jsx(UiExampleSection, { id: 'system-radius-example', title: 'System radius', description: 'Radius system prop scale.', children: _jsxs(ExampleTile, { title: 'System radius', code: codeSamples.systemRadius, onOpen: onOpenCode, children: [_jsx(Flex, { g: 2, a: 'c', wrap: true, children: [0, 2, 4, 6, 7].map((radius) => (_jsx(Box, { size: 32, r: radius, display: 'flex', a: 'c', j: 'c', style: { background: 'var(--oui-gray-a3)' }, children: _jsx(Text, { fs: '12px', fw: 700, children: radius }) }, radius))) }), _jsx(Button, { mt: 2, v: 'pad', r: 7, children: "Button r=7" })] }) })] }));
43
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleDataSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleDataSection.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,gBAAgB,GAAG;IACpB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AA2DF,wBAAgB,WAAW,CAAC,EAAC,UAAU,EAAC,EAAE,gBAAgB,2CAuHzD"}
1
+ {"version":3,"file":"ExampleDataSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleDataSection.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,gBAAgB,GAAG;IACpB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AA2DF,wBAAgB,WAAW,CAAC,EAAC,UAAU,EAAC,EAAE,gBAAgB,2CA0KzD"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMemo, useState } from 'react';
4
- import { Badge, Button, DataTable, Text, TextField, } from '..';
4
+ import { Badge, Button, DataTable, Flex, Pagination, Stack, Table, Text, TextField, } from '..';
5
5
  import { ExampleTile } from './CodePreview';
6
6
  import { codeSamples } from './codeSamples';
7
7
  import { UiExampleSection } from './UiExampleSection';
@@ -62,39 +62,40 @@ export function DataSection({ onOpenCode }) {
62
62
  const [visibleColumnKeys, setVisibleColumnKeys] = useState(defaultVisibleColumnKeys);
63
63
  const [columnOrder, setColumnOrder] = useState(defaultColumnOrder);
64
64
  const [columnWidths, setColumnWidths] = useState({});
65
+ const [page, setPage] = useState(2);
65
66
  const filteredRows = useMemo(() => sortRows(rows.filter((row) => rowMatches(row, query)), sort), [query, sort]);
66
- return (_jsx(UiExampleSection, { id: 'data-table-example', title: 'DataTable', description: 'Reusable DataTable without CRUD or page-level entity logic.', children: _jsx(ExampleTile, { className: 'oui-ui-table-tile', title: 'DataTable', code: codeSamples.data, onOpen: onOpenCode, children: _jsxs("div", { className: 'oui-ui-table-demo', children: [_jsx(DataTable, { toolbar: (_jsxs(_Fragment, { children: [_jsx(TextField, { value: query, placeholder: 'Filter rows', clearable: true, onChange: (event) => setQuery(event.target.value), onClear: () => setQuery('') }), _jsx(Button, { size: 3, v: 'surface', onClick: () => {
67
+ return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: 'data-table-example', title: 'DataTable', description: 'Reusable DataTable without CRUD or page-level entity logic.', children: _jsx(ExampleTile, { className: 'oui-ui-table-tile', title: 'DataTable', code: codeSamples.data, onOpen: onOpenCode, children: _jsxs("div", { className: 'oui-ui-table-demo', children: [_jsx(DataTable, { toolbar: (_jsxs(_Fragment, { children: [_jsx(TextField, { value: query, placeholder: 'Filter rows', clearable: true, onChange: (event) => setQuery(event.target.value), onClear: () => setQuery('') }), _jsx(Button, { size: 3, v: 'surface', onClick: () => {
68
+ setVisibleColumnKeys(defaultVisibleColumnKeys);
69
+ setColumnOrder(defaultColumnOrder);
70
+ setColumnWidths({});
71
+ }, children: "Reset" })] })), rowKey: (row) => row.name, rows: filteredRows, columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort) ? nextSort[0] ?? null : nextSort), selectable: true, selectedRowKeys: selectedRowKeys, onSelectedRowKeysChange: setSelectedRowKeys, total: rows.length, emptyText: 'No rows match the filter.', columnSettings: {
72
+ columns,
73
+ visibleColumnKeys,
74
+ onVisibleColumnKeysChange: setVisibleColumnKeys,
75
+ columnOrder,
76
+ onColumnOrderChange: setColumnOrder,
77
+ columnWidths,
78
+ onColumnWidthsChange: setColumnWidths,
79
+ onReset: () => {
67
80
  setVisibleColumnKeys(defaultVisibleColumnKeys);
68
81
  setColumnOrder(defaultColumnOrder);
69
82
  setColumnWidths({});
70
- }, children: "Reset" })] })), rowKey: (row) => row.name, rows: filteredRows, columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort) ? nextSort[0] ?? null : nextSort), selectable: true, selectedRowKeys: selectedRowKeys, onSelectedRowKeysChange: setSelectedRowKeys, total: rows.length, emptyText: 'No rows match the filter.', columnSettings: {
71
- columns,
72
- visibleColumnKeys,
73
- onVisibleColumnKeysChange: setVisibleColumnKeys,
74
- columnOrder,
75
- onColumnOrderChange: setColumnOrder,
76
- columnWidths,
77
- onColumnWidthsChange: setColumnWidths,
78
- onReset: () => {
79
- setVisibleColumnKeys(defaultVisibleColumnKeys);
80
- setColumnOrder(defaultColumnOrder);
81
- setColumnWidths({});
82
- },
83
- }, rowContextMenuActions: (row) => [
84
- {
85
- key: 'open',
86
- label: `Open ${row.name}`,
87
- onSelect: () => undefined,
88
- },
89
- {
90
- key: 'archive',
91
- label: 'Archive',
92
- tone: 'danger',
93
- onSelect: () => undefined,
94
- },
95
- ] }), _jsx("div", { className: 'oui-ui-table-variants', children: _jsxs("div", { className: 'oui-ui-table-variant', children: [_jsx(Text, { fs: '13px', fw: 760, children: "Plain table" }), _jsx(DataTable, { rowKey: (row) => row.name, rows: rows.slice(0, 4), columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort)
96
- ? nextSort[0] ?? null
97
- : nextSort), total: rows.length, emptyText: 'No rows.' })] }) })] }) }) }));
83
+ },
84
+ }, rowContextMenuActions: (row) => [
85
+ {
86
+ key: 'open',
87
+ label: `Open ${row.name}`,
88
+ onSelect: () => undefined,
89
+ },
90
+ {
91
+ key: 'archive',
92
+ label: 'Archive',
93
+ tone: 'danger',
94
+ onSelect: () => undefined,
95
+ },
96
+ ] }), _jsx("div", { className: 'oui-ui-table-variants', children: _jsxs("div", { className: 'oui-ui-table-variant', children: [_jsx(Text, { fs: '13px', fw: 760, children: "Plain table" }), _jsx(DataTable, { rowKey: (row) => row.name, rows: rows.slice(0, 4), columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort)
97
+ ? nextSort[0] ?? null
98
+ : nextSort), total: rows.length, emptyText: 'No rows.' })] }) })] }) }) }), _jsx(UiExampleSection, { id: 'table-primitives-example', title: 'Table and pagination', description: 'Low-level Table primitive and page navigation.', children: _jsx(ExampleTile, { title: 'Table and pagination', code: codeSamples.tablePagination, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsxs(Table, { v: 'surface', w: '100%', children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.ColumnHeaderCell, { children: "Document" }), _jsx(Table.ColumnHeaderCell, { children: "Status" }), _jsx(Table.ColumnHeaderCell, { align: 'right', children: "Qty" })] }) }), _jsx(Table.Body, { children: rows.slice(0, 3).map((row) => (_jsxs(Table.Row, { children: [_jsx(Table.RowHeaderCell, { children: row.name }), _jsx(Table.Cell, { children: _jsx(Badge, { tone: statusTone(row.status), children: row.status }) }), _jsx(Table.Cell, { align: 'right', children: row.quantity })] }, row.name))) })] }), _jsxs(Flex, { j: 'sb', a: 'c', wrap: true, g: 2, children: [_jsx(Text, { fs: '13px', tone: 'muted', children: "Showing 25 items per page" }), _jsx(Pagination, { page: page, pageCount: 4, onPageChange: setPage })] })] }) }) })] }));
98
99
  }
99
100
  function sortRows(rows, sort) {
100
101
  if (!sort)
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleFieldsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleFieldsSection.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,cAAc,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,cAAc,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,GACb,EAAE,kBAAkB,2CA2HpB"}
1
+ {"version":3,"file":"ExampleFieldsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleFieldsSection.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAc,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAG5D,KAAK,cAAc,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,cAAc,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAqBF,wBAAgB,aAAa,CAAC,EAC1B,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,GACb,EAAE,kBAAkB,2CA4SpB"}