@orcestr/ui 0.0.3 → 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 (176) 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 +2 -0
  5. package/dist/components/AppShell/AppShell.d.ts.map +1 -1
  6. package/dist/components/AppShell/AppShell.js +9 -6
  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 +53 -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/CommandPalette/CommandPalette.d.ts.map +1 -1
  29. package/dist/components/CommandPalette/CommandPalette.js +10 -9
  30. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
  31. package/dist/components/ConfirmDialog/ConfirmDialog.js +5 -2
  32. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  33. package/dist/components/ContextMenu/ContextMenu.js +2 -2
  34. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  35. package/dist/components/DatePicker/DatePicker.js +9 -1
  36. package/dist/components/Dialog/Dialog.d.ts +69 -1
  37. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  38. package/dist/components/Dialog/Dialog.js +48 -1
  39. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  40. package/dist/components/Drawer/Drawer.js +2 -2
  41. package/dist/components/EntityPicker/EntityPicker.d.ts +2 -1
  42. package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
  43. package/dist/components/EntityPicker/EntityPicker.js +2 -2
  44. package/dist/components/Flex/Flex.d.ts +5 -1
  45. package/dist/components/Flex/Flex.d.ts.map +1 -1
  46. package/dist/components/Flex/Flex.js +16 -3
  47. package/dist/components/Grid/Grid.d.ts +9 -2
  48. package/dist/components/Grid/Grid.d.ts.map +1 -1
  49. package/dist/components/Grid/Grid.js +22 -1
  50. package/dist/components/IconButton/IconButton.d.ts +19 -7
  51. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  52. package/dist/components/IconButton/IconButton.js +40 -5
  53. package/dist/components/IconTextButton/IconTextButton.d.ts +20 -0
  54. package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -0
  55. package/dist/components/IconTextButton/IconTextButton.js +24 -0
  56. package/dist/components/InlineEdit/InlineEdit.d.ts +63 -0
  57. package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -0
  58. package/dist/components/InlineEdit/InlineEdit.js +98 -0
  59. package/dist/components/LinkButton/LinkButton.d.ts +25 -0
  60. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
  61. package/dist/components/LinkButton/LinkButton.js +12 -0
  62. package/dist/components/Modal/Modal.d.ts +29 -6
  63. package/dist/components/Modal/Modal.d.ts.map +1 -1
  64. package/dist/components/Modal/Modal.js +37 -13
  65. package/dist/components/Overlay/OverlayProvider.d.ts +1 -0
  66. package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
  67. package/dist/components/Overlay/OverlayProvider.js +18 -1
  68. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +2 -1
  69. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
  70. package/dist/components/PaginatedCombobox/PaginatedCombobox.js +3 -3
  71. package/dist/components/Popover/Popover.d.ts +37 -3
  72. package/dist/components/Popover/Popover.d.ts.map +1 -1
  73. package/dist/components/Popover/Popover.js +56 -9
  74. package/dist/components/ScrollArea/ScrollArea.d.ts +4 -0
  75. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
  76. package/dist/components/ScrollArea/ScrollArea.js +30 -4
  77. package/dist/components/Section/Section.d.ts +2 -0
  78. package/dist/components/Section/Section.d.ts.map +1 -1
  79. package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -1
  80. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  81. package/dist/components/SegmentedControl/SegmentedControl.js +28 -2
  82. package/dist/components/Select/Select.d.ts +36 -4
  83. package/dist/components/Select/Select.d.ts.map +1 -1
  84. package/dist/components/Select/Select.js +70 -3
  85. package/dist/components/Separator/Separator.d.ts +3 -1
  86. package/dist/components/Separator/Separator.d.ts.map +1 -1
  87. package/dist/components/Separator/Separator.js +4 -2
  88. package/dist/components/SpecialModal/SpecialModal.d.ts +43 -0
  89. package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -0
  90. package/dist/components/SpecialModal/SpecialModal.js +34 -0
  91. package/dist/components/Spinner/Spinner.d.ts +3 -1
  92. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  93. package/dist/components/Spinner/Spinner.js +2 -2
  94. package/dist/components/State/State.d.ts +8 -1
  95. package/dist/components/State/State.d.ts.map +1 -1
  96. package/dist/components/State/State.js +2 -2
  97. package/dist/components/Switch/Switch.d.ts +2 -0
  98. package/dist/components/Switch/Switch.d.ts.map +1 -1
  99. package/dist/components/Switch/Switch.js +2 -1
  100. package/dist/components/Table/Table.d.ts +64 -0
  101. package/dist/components/Table/Table.d.ts.map +1 -0
  102. package/dist/components/Table/Table.js +38 -0
  103. package/dist/components/Tabs/Tabs.d.ts +33 -2
  104. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  105. package/dist/components/Tabs/Tabs.js +189 -4
  106. package/dist/components/Text/Text.d.ts +13 -3
  107. package/dist/components/Text/Text.d.ts.map +1 -1
  108. package/dist/components/Text/Text.js +16 -3
  109. package/dist/components/TextArea/TextArea.d.ts.map +1 -1
  110. package/dist/components/TextArea/TextArea.js +1 -1
  111. package/dist/components/TextField/TextField.d.ts.map +1 -1
  112. package/dist/components/TextField/TextField.js +1 -1
  113. package/dist/components/Toast/Toast.d.ts +1 -0
  114. package/dist/components/Toast/Toast.d.ts.map +1 -1
  115. package/dist/components/Toast/Toast.js +19 -8
  116. package/dist/components/Tooltip/Tooltip.d.ts +11 -3
  117. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  118. package/dist/components/Tooltip/Tooltip.js +58 -9
  119. package/dist/example/CodePreview.d.ts.map +1 -1
  120. package/dist/example/CodePreview.js +3 -3
  121. package/dist/example/ExampleActionsSection.d.ts.map +1 -1
  122. package/dist/example/ExampleActionsSection.js +3 -3
  123. package/dist/example/ExampleApplicationSection.d.ts +7 -0
  124. package/dist/example/ExampleApplicationSection.d.ts.map +1 -0
  125. package/dist/example/ExampleApplicationSection.js +68 -0
  126. package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
  127. package/dist/example/ExampleBasicsSections.js +5 -9
  128. package/dist/example/ExampleDataSection.d.ts.map +1 -1
  129. package/dist/example/ExampleDataSection.js +31 -30
  130. package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
  131. package/dist/example/ExampleFieldsSection.js +51 -3
  132. package/dist/example/ExampleFoundationsSection.js +1 -1
  133. package/dist/example/ExampleOverlays.d.ts.map +1 -1
  134. package/dist/example/ExampleOverlays.js +7 -2
  135. package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
  136. package/dist/example/ExampleOverlaysSection.js +5 -2
  137. package/dist/example/ExampleSelectionSection.d.ts +3 -1
  138. package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
  139. package/dist/example/ExampleSelectionSection.js +10 -3
  140. package/dist/example/ExampleStateSection.d.ts +3 -0
  141. package/dist/example/ExampleStateSection.d.ts.map +1 -1
  142. package/dist/example/ExampleStateSection.js +58 -3
  143. package/dist/example/ExampleThemePlayground.d.ts +83 -53
  144. package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
  145. package/dist/example/ExampleThemePlayground.js +119 -56
  146. package/dist/example/UiExamplePage.d.ts.map +1 -1
  147. package/dist/example/UiExamplePage.js +39 -10
  148. package/dist/example/codeSamples.d.ts +7 -0
  149. package/dist/example/codeSamples.d.ts.map +1 -1
  150. package/dist/example/codeSamples.js +429 -60
  151. package/dist/example/exampleData.d.ts.map +1 -1
  152. package/dist/example/exampleData.js +16 -2
  153. package/dist/example/styles.css +245 -74
  154. package/dist/hooks/useFloatingPosition.js +1 -1
  155. package/dist/hooks/usePresence.d.ts.map +1 -1
  156. package/dist/hooks/usePresence.js +9 -7
  157. package/dist/index.d.ts +8 -1
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +8 -1
  160. package/dist/styles/orcestr-ui.css +2544 -671
  161. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  162. package/dist/theme/ThemeProvider.js +90 -36
  163. package/dist/theme/defaultTheme.d.ts.map +1 -1
  164. package/dist/theme/defaultTheme.js +322 -194
  165. package/dist/theme/systemProps.d.ts +48 -28
  166. package/dist/theme/systemProps.d.ts.map +1 -1
  167. package/dist/theme/systemProps.js +103 -1
  168. package/dist/theme/themeTypes.d.ts +21 -17
  169. package/dist/theme/themeTypes.d.ts.map +1 -1
  170. package/dist/utils/slot.d.ts +11 -0
  171. package/dist/utils/slot.d.ts.map +1 -0
  172. package/dist/utils/slot.js +18 -0
  173. package/package.json +1 -1
  174. package/dist/components/Workflow/Workflow.d.ts +0 -82
  175. package/dist/components/Workflow/Workflow.d.ts.map +0 -1
  176. package/dist/components/Workflow/Workflow.js +0 -73
@@ -44,14 +44,19 @@ export const themePlaygroundPresets = [
44
44
  panel: '#0d2119',
45
45
  panelSoft: '#133126',
46
46
  floating: '#0d2119',
47
- brand: '#34d399',
48
- brandStrong: '#86efac',
49
- brandSolid: '#059669',
50
- brandSolidHover: '#10b981',
51
- brandSoft: 'rgb(52 211 153 / 16%)',
47
+ primary: {
48
+ base: '#059669',
49
+ text: '#86efac',
50
+ surface: 'rgb(52 211 153 / 16%)',
51
+ border: 'rgb(52 211 153 / 16%)',
52
+ contrast: '#ffffff',
53
+ },
52
54
  selected: 'rgb(52 211 153 / 14%)',
53
- info: '#7dd3fc',
54
- infoSoft: '#0b3240',
55
+ info: {
56
+ base: '#7dd3fc',
57
+ text: '#7dd3fc',
58
+ surface: '#0b3240',
59
+ },
55
60
  },
56
61
  },
57
62
  },
@@ -87,11 +92,13 @@ export const themePlaygroundPresets = [
87
92
  borderStrong: 'rgb(255 255 255 / 12%)',
88
93
  text: '#f7f7f7',
89
94
  muted: '#9a9a9a',
90
- brand: '#8ab4ff',
91
- brandStrong: '#b7d1ff',
92
- brandSolid: '#2759c7',
93
- brandSolidHover: '#3369e6',
94
- brandSoft: 'rgb(138 180 255 / 17%)',
95
+ primary: {
96
+ base: '#2759c7',
97
+ text: '#b7d1ff',
98
+ surface: 'rgb(138 180 255 / 17%)',
99
+ border: 'rgb(138 180 255 / 17%)',
100
+ contrast: '#ffffff',
101
+ },
95
102
  selected: 'rgb(138 180 255 / 14%)',
96
103
  focusRing: '0 0 0 3px rgb(138 180 255 / 20%)',
97
104
  skeletonShimmer: 'rgb(255 255 255 / 7%)',
@@ -130,14 +137,19 @@ export const themePlaygroundPresets = [
130
137
  panel: '#1a1a1a',
131
138
  panelSoft: '#242424',
132
139
  floating: '#1b1b1b',
133
- brand: '#c4d3e8',
134
- brandStrong: '#e4edf8',
135
- brandSolid: '#5d6f87',
136
- brandSolidHover: '#71839b',
137
- brandSoft: 'rgb(196 211 232 / 14%)',
140
+ primary: {
141
+ base: '#5d6f87',
142
+ text: '#e4edf8',
143
+ surface: 'rgb(196 211 232 / 14%)',
144
+ border: 'rgb(196 211 232 / 14%)',
145
+ contrast: '#ffffff',
146
+ },
138
147
  selected: 'rgb(196 211 232 / 12%)',
139
- info: '#8ecae6',
140
- infoSoft: '#122f3a',
148
+ info: {
149
+ base: '#8ecae6',
150
+ text: '#8ecae6',
151
+ surface: '#122f3a',
152
+ },
141
153
  },
142
154
  radii: {
143
155
  md: '5px',
@@ -169,14 +181,19 @@ export const themePlaygroundPresets = [
169
181
  panel: '#1d1820',
170
182
  panelSoft: '#29212d',
171
183
  floating: '#1d1820',
172
- brand: '#f0a6d8',
173
- brandStrong: '#ffc1e7',
174
- brandSolid: '#a84486',
175
- brandSolidHover: '#bc5399',
176
- brandSoft: 'rgb(240 166 216 / 17%)',
184
+ primary: {
185
+ base: '#a84486',
186
+ text: '#ffc1e7',
187
+ surface: 'rgb(240 166 216 / 17%)',
188
+ border: 'rgb(240 166 216 / 17%)',
189
+ contrast: '#ffffff',
190
+ },
177
191
  selected: 'rgb(240 166 216 / 16%)',
178
- warning: '#fbbf24',
179
- warningSoft: '#49371c',
192
+ warning: {
193
+ base: '#fbbf24',
194
+ text: '#fbbf24',
195
+ surface: '#49371c',
196
+ },
180
197
  },
181
198
  },
182
199
  },
@@ -221,14 +238,19 @@ export const themePlaygroundPresets = [
221
238
  panel: '#101a2b',
222
239
  panelSoft: '#172338',
223
240
  floating: '#101a2b',
224
- brand: '#7dd3fc',
225
- brandStrong: '#bae6fd',
226
- brandSolid: '#0369a1',
227
- brandSolidHover: '#0284c7',
228
- brandSoft: 'rgb(125 211 252 / 16%)',
241
+ primary: {
242
+ base: '#0369a1',
243
+ text: '#bae6fd',
244
+ surface: 'rgb(125 211 252 / 16%)',
245
+ border: 'rgb(125 211 252 / 16%)',
246
+ contrast: '#ffffff',
247
+ },
229
248
  selected: 'rgb(125 211 252 / 13%)',
230
- info: '#22d3ee',
231
- infoSoft: '#083344',
249
+ info: {
250
+ base: '#22d3ee',
251
+ text: '#22d3ee',
252
+ surface: '#083344',
253
+ },
232
254
  },
233
255
  },
234
256
  },
@@ -272,11 +294,13 @@ export const themePlaygroundPresets = [
272
294
  bg: '#eefbf4',
273
295
  panel: '#ffffff',
274
296
  panelSoft: '#ddf4e8',
275
- brand: '#047857',
276
- brandStrong: '#065f46',
277
- brandSolid: '#047857',
278
- brandSolidHover: '#065f46',
279
- brandSoft: 'rgb(4 120 87 / 12%)',
297
+ primary: {
298
+ base: '#047857',
299
+ text: '#065f46',
300
+ surface: 'rgb(4 120 87 / 12%)',
301
+ border: 'rgb(4 120 87 / 12%)',
302
+ contrast: '#ffffff',
303
+ },
280
304
  selected: 'rgb(4 120 87 / 10%)',
281
305
  },
282
306
  },
@@ -303,11 +327,13 @@ export const themePlaygroundPresets = [
303
327
  bg: '#fff1f8',
304
328
  panel: '#ffffff',
305
329
  panelSoft: '#ffe4f2',
306
- brand: '#db2777',
307
- brandStrong: '#be185d',
308
- brandSolid: '#db2777',
309
- brandSolidHover: '#be185d',
310
- brandSoft: 'rgb(219 39 119 / 12%)',
330
+ primary: {
331
+ base: '#db2777',
332
+ text: '#be185d',
333
+ surface: 'rgb(219 39 119 / 12%)',
334
+ border: 'rgb(219 39 119 / 12%)',
335
+ contrast: '#ffffff',
336
+ },
311
337
  selected: 'rgb(219 39 119 / 10%)',
312
338
  },
313
339
  },
@@ -352,11 +378,13 @@ export const themePlaygroundPresets = [
352
378
  bg: '#f8f5ff',
353
379
  panel: '#ffffff',
354
380
  panelSoft: '#ede9fe',
355
- brand: '#7c3aed',
356
- brandStrong: '#5b21b6',
357
- brandSolid: '#7c3aed',
358
- brandSolidHover: '#6d28d9',
359
- brandSoft: 'rgb(124 58 237 / 10%)',
381
+ primary: {
382
+ base: '#7c3aed',
383
+ text: '#5b21b6',
384
+ surface: 'rgb(124 58 237 / 10%)',
385
+ border: 'rgb(124 58 237 / 10%)',
386
+ contrast: '#ffffff',
387
+ },
360
388
  selected: 'rgb(124 58 237 / 8%)',
361
389
  section: 'rgb(124 58 237 / 3%)',
362
390
  sectionNested: 'rgb(124 58 237 / 2%)',
@@ -388,11 +416,13 @@ export const themePlaygroundPresets = [
388
416
  bg: '#f4fbf8',
389
417
  panel: '#ffffff',
390
418
  panelSoft: '#eaf7f1',
391
- brand: '#0f9f6e',
392
- brandStrong: '#087a54',
393
- brandSolid: '#0f9f6e',
394
- brandSolidHover: '#0b8a5e',
395
- brandSoft: 'rgb(15 159 110 / 11%)',
419
+ primary: {
420
+ base: '#0f9f6e',
421
+ text: '#087a54',
422
+ surface: 'rgb(15 159 110 / 11%)',
423
+ border: 'rgb(15 159 110 / 11%)',
424
+ contrast: '#ffffff',
425
+ },
396
426
  selected: 'rgb(15 159 110 / 9%)',
397
427
  },
398
428
  },
@@ -425,7 +455,7 @@ const flatTokenSections = [
425
455
  'zIndex',
426
456
  'components',
427
457
  ];
428
- const statusKeys = ['neutral', 'brand', 'success', 'warning', 'danger', 'info'];
458
+ const statusKeys = ['neutral', 'primary', 'secondary', 'success', 'warning', 'danger', 'info'];
429
459
  const COLOR_TOKEN_COMMIT_DELAY_MS = 180;
430
460
  const themePlaygroundCopy = {
431
461
  ru: {
@@ -492,7 +522,7 @@ export function ExampleThemePlayground({ activePresetId, theme, locale, onPreset
492
522
  start: 2,
493
523
  fadeDistance: 28,
494
524
  maxOpacity: 0.94,
495
- }, children: [_jsxs("div", { className: 'oui-theme-token-editor', children: [flatTokenSections.map((section) => (_jsx(TokenSection, { title: tokenSectionLabel(section, locale), section: section, values: theme[section], onTokenChange: (key, value) => updateFlatToken(onThemeOverridesChange, section, key, value) }, section))), statusKeys.map((statusKey) => (_jsx(TokenSection, { title: `${copy.statuses} / ${statusKey}`, section: 'status', statusKey: statusKey, values: theme.status[statusKey], onTokenChange: (key, value) => updateStatusToken(onThemeOverridesChange, statusKey, key, String(value)) }, `status-${statusKey}`)))] }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Button, { size: 1, children: copy.primaryAction }), _jsx(Button, { size: 1, v: 'surface', children: copy.surface }), _jsx(Button, { size: 1, v: 'ghost', children: copy.secondary }), _jsx(Badge, { tone: 'success', children: copy.ready }), _jsx(Badge, { tone: 'warning', children: copy.warning })] })] })] })] })] }));
525
+ }, children: [_jsxs("div", { className: 'oui-theme-token-editor', children: [flatTokenSections.map((section) => (_jsx(TokenSection, { title: tokenSectionLabel(section, locale), section: section, values: tokenSectionValues(theme, section), onTokenChange: (key, value) => updateFlatToken(onThemeOverridesChange, section, key, value) }, section))), statusKeys.map((statusKey) => (_jsx(TokenSection, { title: `${copy.statuses} / ${statusKey}`, section: 'status', statusKey: statusKey, values: theme.status[statusKey], onTokenChange: (key, value) => updateStatusToken(onThemeOverridesChange, statusKey, key, String(value)) }, `status-${statusKey}`)))] }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Button, { size: 1, children: copy.primaryAction }), _jsx(Button, { size: 1, v: 'surface', children: copy.surface }), _jsx(Button, { size: 1, v: 'ghost', children: copy.secondary }), _jsx(Badge, { tone: 'success', children: copy.ready }), _jsx(Badge, { tone: 'warning', children: copy.warning })] })] })] })] })] }));
496
526
  }
497
527
  export function ThemePresetSelector({ activePresetId, locale, onPresetChange, }) {
498
528
  return (_jsx("div", { className: 'oui-theme-preset-grid', children: themePresetGroups.map((group) => (_jsxs("div", { className: 'oui-theme-preset-group', children: [_jsx("div", { className: 'oui-theme-preset-group-label', children: group.label[locale] }), _jsx(ScrollArea, { className: 'oui-theme-preset-scroll', highlights: true, highlightColor: 'var(--oui-section-solid-bg)', highlightTop: {
@@ -541,10 +571,24 @@ function ThemeTokenControl({ label, path, section, value, onChange, }) {
541
571
  return (_jsxs("div", { className: 'oui-theme-token oui-theme-token-control', children: [_jsx("span", { className: 'oui-theme-token-swatch', style: {
542
572
  background: visibleColorValue ?? (section === 'colors' || section === 'status'
543
573
  ? valueText
544
- : 'var(--oui-brand-soft)'),
574
+ : 'var(--oui-primary-surface)'),
545
575
  }, children: colorInputValue ? (_jsx("input", { className: 'oui-theme-token-swatch-input', type: 'color', value: visibleColorValue ?? colorInputValue, "aria-label": `${label} color`, onChange: (event) => setColorDraft(event.target.value), onBlur: commitColorDraft })) : null }), _jsxs("span", { className: 'oui-theme-token-text', children: [_jsx(Text, { fs: '12px', fw: 700, children: label }), _jsx(Text, { fs: '11px', tone: 'muted', children: path })] }), _jsx("span", { className: 'oui-theme-token-control-field', children: selectOptions ? (_jsx("select", { value: valueText, "aria-label": label, onChange: (event) => onChange(event.target.value), children: selectOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })) : (_jsx("input", { type: typeof value === 'number' ? 'number' : 'text', value: valueText, "aria-label": label, onChange: (event) => onChange(typeof value === 'number' ? Number(event.target.value) : event.target.value) })) })] }));
546
576
  }
547
577
  function updateFlatToken(updateOverrides, section, key, value) {
578
+ if (section === 'colors' && key.includes('.')) {
579
+ const [roleKey, slotKey] = key.split('.', 2);
580
+ updateOverrides((current) => ({
581
+ ...current,
582
+ colors: {
583
+ ...current.colors,
584
+ [roleKey]: {
585
+ ...current.colors?.[roleKey],
586
+ [slotKey]: value,
587
+ },
588
+ },
589
+ }));
590
+ return;
591
+ }
548
592
  updateOverrides((current) => ({
549
593
  ...current,
550
594
  [section]: {
@@ -553,6 +597,25 @@ function updateFlatToken(updateOverrides, section, key, value) {
553
597
  },
554
598
  }));
555
599
  }
600
+ function tokenSectionValues(theme, section) {
601
+ const values = theme[section];
602
+ if (section !== 'colors')
603
+ return values;
604
+ return flattenTokenValues(values);
605
+ }
606
+ function flattenTokenValues(values, prefix = '') {
607
+ return Object.entries(values).reduce((result, [key, value]) => {
608
+ const path = prefix ? `${prefix}.${key}` : key;
609
+ if (typeof value === 'string' || typeof value === 'number' || value === false) {
610
+ result[path] = value;
611
+ return result;
612
+ }
613
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
614
+ Object.assign(result, flattenTokenValues(value, path));
615
+ }
616
+ return result;
617
+ }, {});
618
+ }
556
619
  function updateStatusToken(updateOverrides, statusKey, key, value) {
557
620
  updateOverrides((current) => ({
558
621
  ...current,
@@ -1 +1 @@
1
- {"version":3,"file":"UiExamplePage.d.ts","sourceRoot":"","sources":["../../src/example/UiExamplePage.tsx"],"names":[],"mappings":"AAWA,OAAO,EAYH,KAAK,eAAe,EACvB,MAAM,IAAI,CAAC;AA4lBZ,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EAAE,gBAAgB,EACxB,aAAoB,EACpB,cAAc,GACjB,GAAE,kBAAuB,2CA8CzB"}
1
+ {"version":3,"file":"UiExamplePage.d.ts","sourceRoot":"","sources":["../../src/example/UiExamplePage.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAWH,KAAK,eAAe,EACvB,MAAM,IAAI,CAAC;AA2mBZ,MAAM,MAAM,kBAAkB,GAAG;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EAAE,gBAAgB,EACxB,aAAoB,EACpB,cAAc,GACjB,GAAE,kBAAuB,2CA8CzB"}
@@ -1,16 +1,17 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
4
- import { LuBell, LuCheck, LuExternalLink, LuRefreshCw, LuTrash2, } from 'react-icons/lu';
5
- import { AppShell, AppShellContent, AppShellHeader, AppShellNav, AppShellSidebar, OrcestrUiProvider, ScrollArea, useOrcestrTheme, useToast, } from '..';
4
+ import { LuBell, LuBox, LuCalendar, LuCheck, LuClipboardList, LuExternalLink, LuFileText, LuLayoutDashboard, LuMousePointerClick, LuPanelTop, LuRefreshCw, LuSettings, LuTrash2, } from 'react-icons/lu';
5
+ import { AppShell, AppShellContent, AppShellHeader, AppSidebar, OrcestrUiProvider, ScrollArea, useOrcestrTheme, useToast, } from '..';
6
6
  import { LayoutSection, TypographySection } from './ExampleBasicsSections';
7
7
  import { ActionsSection } from './ExampleActionsSection';
8
+ import { ApplicationSection } from './ExampleApplicationSection';
8
9
  import { FieldsSection } from './ExampleFieldsSection';
9
10
  import { SelectionSection } from './ExampleSelectionSection';
10
11
  import { DataSection } from './ExampleDataSection';
11
12
  import { OverlaysSection } from './ExampleOverlaysSection';
12
13
  import { FoundationsSection } from './ExampleFoundationsSection';
13
- import { IconTextSection, StateCardSection } from './ExampleStateSection';
14
+ import { BadgeSection, IconTextSection, StateCardSection } from './ExampleStateSection';
14
15
  import { ExampleThemePlayground, getThemePlaygroundPreset, themePlaygroundPresets, themePresetLabel, themePresetPreviewStyle, } from './ExampleThemePlayground';
15
16
  import { CodePreviewModal } from './CodePreview';
16
17
  import { ExampleOverlays } from './ExampleOverlays';
@@ -56,6 +57,7 @@ function UiExampleContent({ activePresetId, onThemePresetChange, onThemeOverride
56
57
  const [selectPlainValue, setSelectPlainValue] = useState('blocked');
57
58
  const [comboValue, setComboValue] = useState('ready');
58
59
  const [entityValue, setEntityValue] = useState(null);
60
+ const [paginatedValue, setPaginatedValue] = useState(null);
59
61
  const [ownerValues, setOwnerValues] = useState(['anna', 'ops']);
60
62
  const [radioValue, setRadioValue] = useState('manual');
61
63
  const [tabValue, setTabValue] = useState('overview');
@@ -171,7 +173,7 @@ function UiExampleContent({ activePresetId, onThemePresetChange, onThemeOverride
171
173
  },
172
174
  ];
173
175
  }, [locale, toast]);
174
- return (_jsxs(AppShell, { sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, header: _jsx(AppShellHeader, { visibility: 'mobile', sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, actions: _jsx(UiExampleHeaderActions, { compact: true, locale: locale, onLocaleChange: onLocaleChange }), children: _jsx(UiExampleBrand, { compact: true }) }), sidebar: _jsx(AppShellSidebar, { title: _jsx(UiExampleBrand, {}), onClose: () => setMobileNavOpen(false), children: _jsx(UiExampleSidebar, { onNavigate: () => setMobileNavOpen(false) }) }), children: [_jsxs("div", { className: 'oui-ui-workspace', children: [_jsxs("div", { className: 'oui-ui-workspace-main', children: [_jsx(UiExampleTopBar, { locale: locale, onLocaleChange: onLocaleChange }), _jsxs(AppShellContent, { children: [_jsx(ExampleThemePlayground, { activePresetId: activePresetId, theme: theme, locale: locale, onPresetChange: onThemePresetChange, onThemeOverridesChange: onThemeOverridesChange }), _jsx(FoundationsSection, { onOpenCode: setCodeExample }), _jsx(TypographySection, { onOpenCode: setCodeExample }), _jsx(IconTextSection, { onOpenCode: setCodeExample }), _jsx(LayoutSection, { onOpenCode: setCodeExample }), _jsx(ActionsSection, { menuItems: menuItems, onOpenCode: setCodeExample, onOpenPalette: () => setPaletteOpen(true) }), _jsx(FieldsSection, { stepperValue: stepperValue, onStepperValueChange: setStepperValue, dateValue: dateValue, onDateValueChange: setDateValue, dateRange: dateRange, onDateRangeChange: setDateRange, onOpenCode: setCodeExample }), _jsx(SelectionSection, { locale: locale, segment: segment, onSegmentChange: setSegment, selectValue: selectValue, onSelectValueChange: setSelectValue, selectNoChevronValue: selectNoChevronValue, onSelectNoChevronValueChange: setSelectNoChevronValue, selectPlainValue: selectPlainValue, onSelectPlainValueChange: setSelectPlainValue, comboValue: comboValue, onComboValueChange: setComboValue, entityValue: entityValue, onEntityValueChange: setEntityValue, ownerValues: ownerValues, onOwnerValuesChange: setOwnerValues, radioValue: radioValue, onRadioValueChange: setRadioValue, tabValue: tabValue, onTabValueChange: setTabValue, onOpenCode: setCodeExample, onToast: toast.push }), _jsx(StateCardSection, { onOpenCode: setCodeExample }), _jsx(DataSection, { onOpenCode: setCodeExample }), _jsx(OverlaysSection, { setModalOpen: setModalOpen, setBlurModalOpen: setBlurModalOpen, setFastModalOpen: setFastModalOpen, setRiseModalOpen: setRiseModalOpen, setSlowModalOpen: setSlowModalOpen, setDangerModalOpen: setDangerModalOpen, onOpenCode: setCodeExample })] })] }), _jsx(UiExampleThemeRail, { activePresetId: activePresetId, locale: locale, onThemePresetChange: onThemePresetChange })] }), _jsx(CodePreviewModal, { example: codeExample, onClose: () => setCodeExample(null) }), _jsx(ExampleOverlays, { locale: locale, modalOpen: modalOpen, setModalOpen: setModalOpen, nestedOpen: nestedOpen, setNestedOpen: setNestedOpen, blurModalOpen: blurModalOpen, setBlurModalOpen: setBlurModalOpen, blurNestedOpen: blurNestedOpen, setBlurNestedOpen: setBlurNestedOpen, blurFinalOpen: blurFinalOpen, setBlurFinalOpen: setBlurFinalOpen, fastModalOpen: fastModalOpen, setFastModalOpen: setFastModalOpen, slowModalOpen: slowModalOpen, setSlowModalOpen: setSlowModalOpen, riseModalOpen: riseModalOpen, setRiseModalOpen: setRiseModalOpen, dangerModalOpen: dangerModalOpen, setDangerModalOpen: setDangerModalOpen, paletteOpen: paletteOpen, setPaletteOpen: setPaletteOpen, onToast: toast.push })] }));
176
+ return (_jsxs(AppShell, { sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, header: _jsx(AppShellHeader, { visibility: 'mobile', sidebarOpen: mobileNavOpen, onSidebarOpenChange: setMobileNavOpen, actions: _jsx(UiExampleHeaderActions, { compact: true, locale: locale, onLocaleChange: onLocaleChange }), children: _jsx(UiExampleHeaderTitle, { locale: locale }) }), sidebar: _jsx(UiExampleSidebar, { onNavigate: () => setMobileNavOpen(false) }), children: [_jsxs("div", { className: 'oui-ui-workspace', children: [_jsx("div", { className: 'oui-ui-workspace-main', children: _jsxs(AppShellContent, { children: [_jsx(ExampleThemePlayground, { activePresetId: activePresetId, theme: theme, locale: locale, onPresetChange: onThemePresetChange, onThemeOverridesChange: onThemeOverridesChange }), _jsx(FoundationsSection, { onOpenCode: setCodeExample }), _jsx(TypographySection, { onOpenCode: setCodeExample }), _jsx(IconTextSection, { onOpenCode: setCodeExample }), _jsx(LayoutSection, { onOpenCode: setCodeExample }), _jsx(ActionsSection, { menuItems: menuItems, onOpenCode: setCodeExample, onOpenPalette: () => setPaletteOpen(true) }), _jsx(FieldsSection, { stepperValue: stepperValue, onStepperValueChange: setStepperValue, dateValue: dateValue, onDateValueChange: setDateValue, dateRange: dateRange, onDateRangeChange: setDateRange, onOpenCode: setCodeExample }), _jsx(SelectionSection, { locale: locale, segment: segment, onSegmentChange: setSegment, selectValue: selectValue, onSelectValueChange: setSelectValue, selectNoChevronValue: selectNoChevronValue, onSelectNoChevronValueChange: setSelectNoChevronValue, selectPlainValue: selectPlainValue, onSelectPlainValueChange: setSelectPlainValue, comboValue: comboValue, onComboValueChange: setComboValue, entityValue: entityValue, onEntityValueChange: setEntityValue, paginatedValue: paginatedValue, onPaginatedValueChange: setPaginatedValue, ownerValues: ownerValues, onOwnerValuesChange: setOwnerValues, radioValue: radioValue, onRadioValueChange: setRadioValue, tabValue: tabValue, onTabValueChange: setTabValue, onOpenCode: setCodeExample, onToast: toast.push }), _jsx(StateCardSection, { onOpenCode: setCodeExample }), _jsx(BadgeSection, { onOpenCode: setCodeExample }), _jsx(DataSection, { onOpenCode: setCodeExample }), _jsx(OverlaysSection, { setModalOpen: setModalOpen, setBlurModalOpen: setBlurModalOpen, setFastModalOpen: setFastModalOpen, setRiseModalOpen: setRiseModalOpen, setSlowModalOpen: setSlowModalOpen, setDangerModalOpen: setDangerModalOpen, onOpenCode: setCodeExample }), _jsx(ApplicationSection, { onOpenCode: setCodeExample })] }) }), _jsx(UiExampleThemeRail, { activePresetId: activePresetId, locale: locale, onThemePresetChange: onThemePresetChange })] }), _jsx(CodePreviewModal, { example: codeExample, onClose: () => setCodeExample(null) }), _jsx(ExampleOverlays, { locale: locale, modalOpen: modalOpen, setModalOpen: setModalOpen, nestedOpen: nestedOpen, setNestedOpen: setNestedOpen, blurModalOpen: blurModalOpen, setBlurModalOpen: setBlurModalOpen, blurNestedOpen: blurNestedOpen, setBlurNestedOpen: setBlurNestedOpen, blurFinalOpen: blurFinalOpen, setBlurFinalOpen: setBlurFinalOpen, fastModalOpen: fastModalOpen, setFastModalOpen: setFastModalOpen, slowModalOpen: slowModalOpen, setSlowModalOpen: setSlowModalOpen, riseModalOpen: riseModalOpen, setRiseModalOpen: setRiseModalOpen, dangerModalOpen: dangerModalOpen, setDangerModalOpen: setDangerModalOpen, paletteOpen: paletteOpen, setPaletteOpen: setPaletteOpen, onToast: toast.push })] }));
175
177
  }
176
178
  function UiExampleThemeRail({ activePresetId, locale, onThemePresetChange, }) {
177
179
  const presets = useMemo(() => {
@@ -277,34 +279,61 @@ function UiExampleSidebar({ onNavigate }) {
277
279
  setActiveSectionValue(id);
278
280
  lockScrollNavigationTarget(id);
279
281
  window.history.replaceState(null, '', `#${id}`);
280
- scrollUiExampleSection(id);
282
+ scrollUiExampleSection(id, 'smooth');
281
283
  onNavigate();
282
284
  }, [lockScrollNavigationTarget, onNavigate, setActiveSectionValue]);
283
285
  const sidebarNavGroups = useMemo(() => navGroups.map((group) => ({
284
- ...group,
286
+ key: group.key,
285
287
  items: group.items.map((item) => ({
286
288
  key: item.id,
287
289
  label: item.label,
290
+ icon: uiExampleNavIcon(item.id),
288
291
  active: activeSection === item.id,
289
292
  onSelect: () => navigateToSection(item.id),
290
293
  })),
291
294
  })), [activeSection, navigateToSection]);
292
- return (_jsx("div", { className: 'oui-ui-sidebar-groups', children: sidebarNavGroups.map((group) => (_jsxs("div", { className: 'oui-ui-sidebar-group', children: [_jsx("div", { className: 'oui-ui-sidebar-group-label', children: group.label }), _jsx(AppShellNav, { className: 'oui-ui-sidebar-nav', items: group.items })] }, group.key))) }));
295
+ return (_jsx(AppSidebar, { className: 'oui-ui-main-sidebar', header: _jsx(UiExampleBrand, {}), itemH: 34, groups: sidebarNavGroups, footer: (_jsxs("button", { type: 'button', className: 'oui-ui-sidebar-footer-action', onClick: () => navigateToSection('app-shell-example'), children: [_jsx(LuSettings, { size: 15, "aria-hidden": true }), _jsx("span", { children: "Application components" })] })) }));
293
296
  }
294
- function UiExampleTopBar({ locale, onLocaleChange, }) {
297
+ function UiExampleHeaderTitle({ locale }) {
295
298
  const title = locale === 'ru'
296
299
  ? 'Единый язык компонентов для всех модулей.'
297
300
  : 'One component language for every module.';
298
301
  const subtitle = locale === 'ru'
299
302
  ? 'Одна тема, предсказуемый интерфейс.'
300
303
  : 'One theme, predictable interface.';
301
- return (_jsxs("header", { className: 'oui-ui-topbar', children: [_jsxs("div", { className: 'oui-ui-topbar-slogan', children: [_jsx("strong", { children: title }), _jsx("span", { children: subtitle })] }), _jsx(UiExampleHeaderActions, { locale: locale, onLocaleChange: onLocaleChange })] }));
304
+ return (_jsxs("div", { className: 'oui-ui-header-title', children: [_jsx("strong", { children: title }), _jsx("span", { children: subtitle })] }));
305
+ }
306
+ function uiExampleNavIcon(id) {
307
+ const size = 16;
308
+ if (id === 'theme')
309
+ return _jsx(LuSettings, { size: size });
310
+ if (id === 'foundations')
311
+ return _jsx(LuLayoutDashboard, { size: size });
312
+ if (id === 'buttons-example')
313
+ return _jsx(LuMousePointerClick, { size: size });
314
+ if (id === 'text-fields-example')
315
+ return _jsx(LuFileText, { size: size });
316
+ if (id === 'selects-example')
317
+ return _jsx(LuCheck, { size: size });
318
+ if (id === 'data-table-example')
319
+ return _jsx(LuClipboardList, { size: size });
320
+ if (id === 'toast-example')
321
+ return _jsx(LuBell, { size: size });
322
+ if (id === 'app-shell-example')
323
+ return _jsx(LuPanelTop, { size: size });
324
+ if (id === 'app-sidebar-example')
325
+ return _jsx(LuLayoutDashboard, { size: size });
326
+ if (id === 'special-modal-example')
327
+ return _jsx(LuBox, { size: size });
328
+ if (id === 'date-range-example')
329
+ return _jsx(LuCalendar, { size: size });
330
+ return null;
302
331
  }
303
332
  function UiExampleBrand({ compact = false }) {
304
333
  return (_jsxs("div", { className: 'oui-ui-brand', "data-compact": compact ? 'true' : undefined, children: [_jsx("span", { className: 'oui-ui-brand-mark', "aria-hidden": 'true', children: _jsx("img", { className: 'oui-ui-brand-logo', src: ORCESTR_LOGO_SRC, alt: '' }) }), _jsx("span", { className: 'oui-ui-brand-text', children: _jsx("strong", { children: "Orcestr UI" }) })] }));
305
334
  }
306
335
  function UiExampleHeaderActions({ compact = false, locale, onLocaleChange, }) {
307
- return (_jsxs("div", { className: 'oui-ui-topbar-actions', "data-compact": compact ? 'true' : undefined, children: [_jsxs("span", { className: 'oui-ui-language-switch', "aria-label": 'UI example language', children: [_jsx("span", { className: 'oui-ui-language-label', children: locale === 'ru' ? 'Язык' : 'Language' }), ['ru', 'en'].map((item) => (_jsx("button", { type: 'button', className: 'oui-ui-language-option', "data-active": locale === item ? 'true' : undefined, "aria-pressed": locale === item, onClick: () => onLocaleChange(item), children: item.toUpperCase() }, item)))] }), _jsxs("a", { className: 'oui-ui-topbar-link', href: 'https://github.com/Artasov/orcestr', target: '_blank', rel: 'noreferrer', children: [_jsx(LuExternalLink, { size: 14, "aria-hidden": true }), _jsx("span", { children: "GitHub" })] })] }));
336
+ return (_jsxs("div", { className: 'oui-ui-header-actions', "data-compact": compact ? 'true' : undefined, children: [_jsxs("span", { className: 'oui-ui-language-switch', "aria-label": 'UI example language', children: [_jsx("span", { className: 'oui-ui-language-label', children: locale === 'ru' ? 'Язык' : 'Language' }), ['ru', 'en'].map((item) => (_jsx("button", { type: 'button', className: 'oui-ui-language-option', "data-active": locale === item ? 'true' : undefined, "aria-pressed": locale === item, onClick: () => onLocaleChange(item), children: item.toUpperCase() }, item)))] }), _jsxs("a", { className: 'oui-ui-header-link', href: 'https://github.com/Artasov/orcestr', target: '_blank', rel: 'noreferrer', children: [_jsx(LuExternalLink, { size: 14, "aria-hidden": true }), _jsx("span", { children: "GitHub" })] })] }));
308
337
  }
309
338
  export function UiExamplePage({ locale: controlledLocale, defaultLocale = 'ru', onLocaleChange, } = {}) {
310
339
  const firstPreset = getThemePlaygroundPreset('orcestr-dark');
@@ -13,9 +13,13 @@ export declare const codeSamples: {
13
13
  highlights: string;
14
14
  scrollArea: string;
15
15
  systemRadius: string;
16
+ surfaces: string;
16
17
  buttons: string;
17
18
  iconButtons: string;
19
+ iconTextButton: string;
20
+ contextMenu: string;
18
21
  textFields: string;
22
+ inlineEdit: string;
19
23
  groupedFields: string;
20
24
  numberAndDateFields: string;
21
25
  dateRangeFields: string;
@@ -25,6 +29,9 @@ export declare const codeSamples: {
25
29
  overlays: string;
26
30
  toast: string;
27
31
  overlaySettings: string;
32
+ tablePagination: string;
33
+ appSidebar: string;
34
+ specialModal: string;
28
35
  data: string;
29
36
  };
30
37
  //# sourceMappingURL=codeSamples.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeSamples.d.ts","sourceRoot":"","sources":["../../src/example/codeSamples.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;CA88Bc,CAAC"}
1
+ {"version":3,"file":"codeSamples.d.ts","sourceRoot":"","sources":["../../src/example/codeSamples.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+zCc,CAAC"}