@vuu-ui/vuu-ui-controls 4.0.0-alpha.8 → 4.0.0-beta.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 (197) hide show
  1. package/package.json +16 -14
  2. package/src/context-panel-provider/ContextPanelProvider.js +40 -28
  3. package/src/drag-drop/Draggable.css.js +2 -2
  4. package/src/expando-input/ExpandoInput.css.js +1 -1
  5. package/src/icon-button/Icon.js +0 -1
  6. package/src/icon-button/IconButton.js +1 -1
  7. package/src/icon-button/ToggleIconButton.css.js +1 -1
  8. package/src/index.js +1 -1
  9. package/src/instrument-picker/useTablePicker.js +2 -3
  10. package/src/item-picker/ItemPicker.css.js +1 -1
  11. package/src/item-picker/ItemPicker.js +53 -79
  12. package/src/price-ticker/PriceTicker.css.js +4 -4
  13. package/src/split-pane/SplitPane.css.js +82 -0
  14. package/src/split-pane/SplitPane.js +60 -0
  15. package/src/split-pane/Splitter.js +82 -0
  16. package/src/split-pane/index.js +1 -0
  17. package/src/split-pane/useSplitPane.js +101 -0
  18. package/src/tabstrip/Tab.css.js +3 -3
  19. package/src/tabstrip/Tabstrip.css.js +2 -2
  20. package/src/tabstrip/Tabstrip.js +1 -1
  21. package/src/time-input/MaskedInput.js +176 -156
  22. package/src/time-input/TimeInput.css.js +41 -18
  23. package/src/time-input/TimeInput.js +25 -14
  24. package/src/time-input/useTimeInput.js +57 -47
  25. package/src/toolbar/Toolbar.css.js +1 -1
  26. package/src/vuu-date-picker/VuuDatePicker.js +46 -52
  27. package/src/vuu-time-picker/VuuTimePicker.js +6 -5
  28. package/types/context-panel-provider/ContextPanelProvider.d.ts +7 -4
  29. package/types/drag-drop/DragDropProvider.d.ts +1 -1
  30. package/types/hover-overlay/HoverOverlay.d.ts +1 -1
  31. package/types/icon-button/Icon.d.ts +2 -2
  32. package/types/icon-button/IconButton.d.ts +1 -1
  33. package/types/icon-button/ToggleIconButton.d.ts +1 -1
  34. package/types/index.d.ts +4 -3
  35. package/types/instrument-picker/SearchCell.d.ts +1 -1
  36. package/types/instrument-picker/TablePicker.d.ts +1 -1
  37. package/types/instrument-picker/useTablePicker.d.ts +1 -1
  38. package/types/item-picker/ItemPicker.d.ts +5 -26
  39. package/types/item-picker/useItemPicker.d.ts +3 -4
  40. package/types/modal-provider/ModalProvider.d.ts +1 -1
  41. package/types/price-ticker/PriceTicker.d.ts +1 -1
  42. package/types/prompt/Prompt.d.ts +1 -1
  43. package/types/sortable-list/SortableList.d.ts +2 -2
  44. package/types/split-button/useSplitButton.d.ts +12 -12
  45. package/types/split-pane/SplitPane.d.ts +44 -0
  46. package/types/split-pane/Splitter.d.ts +10 -0
  47. package/types/split-pane/index.d.ts +2 -0
  48. package/types/split-pane/useSplitPane.d.ts +18 -0
  49. package/types/table-search/SearchCell.d.ts +1 -1
  50. package/types/table-search/TableSearch.d.ts +1 -1
  51. package/types/tabstrip/TabMenu.d.ts +1 -1
  52. package/types/tabstrip/Tabstrip.d.ts +2 -3
  53. package/types/time-input/MaskedInput.d.ts +60 -10
  54. package/types/time-input/TimeInput.d.ts +4 -3
  55. package/types/time-input/useTimeInput.d.ts +24 -5
  56. package/types/toolbar/Toolbar.d.ts +1 -2
  57. package/types/vuu-date-picker/VuuDatePicker.d.ts +19 -3
  58. package/types/vuu-time-picker/VuuTimePicker.d.ts +8 -6
  59. package/types/vuu-typeahead-input/VuuTypeaheadInput.d.ts +1 -1
  60. package/types/src/calendar/Calendar.d.ts +0 -13
  61. package/types/src/calendar/index.d.ts +0 -4
  62. package/types/src/calendar/internal/CalendarCarousel.d.ts +0 -3
  63. package/types/src/calendar/internal/CalendarContext.d.ts +0 -8
  64. package/types/src/calendar/internal/CalendarDay.d.ts +0 -14
  65. package/types/src/calendar/internal/CalendarMonth.d.ts +0 -10
  66. package/types/src/calendar/internal/CalendarNavigation.d.ts +0 -16
  67. package/types/src/calendar/internal/CalendarWeekHeader.d.ts +0 -3
  68. package/types/src/calendar/internal/useFocusManagement.d.ts +0 -9
  69. package/types/src/calendar/internal/utils.d.ts +0 -15
  70. package/types/src/calendar/useCalendar.d.ts +0 -54
  71. package/types/src/calendar/useCalendarDay.d.ts +0 -22
  72. package/types/src/calendar/useSelection.d.ts +0 -78
  73. package/types/src/column-picker/ColumnPicker.d.ts +0 -7
  74. package/types/src/column-picker/ColumnSearch.d.ts +0 -12
  75. package/types/src/column-picker/index.d.ts +0 -2
  76. package/types/src/column-picker/moving-window.d.ts +0 -14
  77. package/types/src/common-hooks/index.d.ts +0 -3
  78. package/types/src/common-hooks/selectionTypes.d.ts +0 -70
  79. package/types/src/common-hooks/use-resize-observer.d.ts +0 -16
  80. package/types/src/common-hooks/useControlled.d.ts +0 -24
  81. package/types/src/context-panel-provider/ContextPanelProvider.d.ts +0 -17
  82. package/types/src/cycle-state-button/CycleStateButton.d.ts +0 -11
  83. package/types/src/cycle-state-button/index.d.ts +0 -1
  84. package/types/src/date-input/DateInput.d.ts +0 -60
  85. package/types/src/date-input/index.d.ts +0 -1
  86. package/types/src/date-picker/DatePicker.d.ts +0 -66
  87. package/types/src/date-picker/DatePickerContext.d.ts +0 -19
  88. package/types/src/date-picker/DatePickerPanel.d.ts +0 -10
  89. package/types/src/date-picker/index.d.ts +0 -1
  90. package/types/src/drag-drop/DragDropProvider.d.ts +0 -38
  91. package/types/src/drag-drop/DragDropState.d.ts +0 -15
  92. package/types/src/drag-drop/Draggable.d.ts +0 -13
  93. package/types/src/drag-drop/DropIndicator.d.ts +0 -5
  94. package/types/src/drag-drop/dragDropTypes.d.ts +0 -100
  95. package/types/src/drag-drop/drop-target-utils.d.ts +0 -82
  96. package/types/src/drag-drop/index.d.ts +0 -6
  97. package/types/src/drag-drop/useAutoScroll.d.ts +0 -11
  98. package/types/src/drag-drop/useDragDisplacers.d.ts +0 -17
  99. package/types/src/drag-drop/useDragDrop.d.ts +0 -2
  100. package/types/src/drag-drop/useDragDropCopy.d.ts +0 -6
  101. package/types/src/drag-drop/useDragDropIndicator.d.ts +0 -2
  102. package/types/src/drag-drop/useDragDropNaturalMovement.d.ts +0 -2
  103. package/types/src/drag-drop/useDropIndicator.d.ts +0 -8
  104. package/types/src/drag-drop/useGlobalDragDrop.d.ts +0 -11
  105. package/types/src/drag-drop/useTransition.d.ts +0 -3
  106. package/types/src/editable/index.d.ts +0 -1
  107. package/types/src/editable/useEditableText.d.ts +0 -21
  108. package/types/src/editable-label/EditableLabel.d.ts +0 -19
  109. package/types/src/editable-label/index.d.ts +0 -1
  110. package/types/src/expando-input/ExpandoInput.d.ts +0 -6
  111. package/types/src/expando-input/index.d.ts +0 -1
  112. package/types/src/highlighter/Highlighter.d.ts +0 -6
  113. package/types/src/highlighter/index.d.ts +0 -1
  114. package/types/src/hover-overlay/HoverOverlay.d.ts +0 -8
  115. package/types/src/icon-button/Icon.d.ts +0 -6
  116. package/types/src/icon-button/IconButton.d.ts +0 -6
  117. package/types/src/icon-button/ToggleIconButton.d.ts +0 -5
  118. package/types/src/icon-button/index.d.ts +0 -3
  119. package/types/src/index.d.ts +0 -33
  120. package/types/src/instrument-picker/SearchCell.d.ts +0 -2
  121. package/types/src/instrument-picker/TablePicker.d.ts +0 -11
  122. package/types/src/instrument-picker/index.d.ts +0 -1
  123. package/types/src/instrument-picker/moving-window.d.ts +0 -14
  124. package/types/src/instrument-picker/useDataSource.d.ts +0 -6
  125. package/types/src/instrument-picker/useTablePicker.d.ts +0 -47
  126. package/types/src/item-picker/ItemPicker.d.ts +0 -14
  127. package/types/src/item-picker/useItemPicker.d.ts +0 -35
  128. package/types/src/measured-container/MeasuredContainer.d.ts +0 -16
  129. package/types/src/measured-container/index.d.ts +0 -2
  130. package/types/src/measured-container/useMeasuredContainer.d.ts +0 -23
  131. package/types/src/modal-provider/ModalProvider.d.ts +0 -13
  132. package/types/src/overflow-container/OverflowContainer.d.ts +0 -15
  133. package/types/src/overflow-container/index.d.ts +0 -2
  134. package/types/src/overflow-container/overflow-utils.d.ts +0 -48
  135. package/types/src/overflow-container/useOverflowContainer.d.ts +0 -19
  136. package/types/src/price-ticker/PriceTicker.d.ts +0 -7
  137. package/types/src/price-ticker/index.d.ts +0 -1
  138. package/types/src/prompt/Prompt.d.ts +0 -53
  139. package/types/src/sortable-list/SortableList.d.ts +0 -8
  140. package/types/src/split-button/SplitButton.d.ts +0 -11
  141. package/types/src/split-button/SplitStateButton.d.ts +0 -5
  142. package/types/src/split-button/index.d.ts +0 -2
  143. package/types/src/split-button/useSplitButton.d.ts +0 -311
  144. package/types/src/table-search/SearchCell.d.ts +0 -2
  145. package/types/src/table-search/TableSearch.d.ts +0 -9
  146. package/types/src/table-search/index.d.ts +0 -1
  147. package/types/src/table-search/moving-window.d.ts +0 -14
  148. package/types/src/table-search/useTableSearch.d.ts +0 -15
  149. package/types/src/tabs-next/TabBar.d.ts +0 -12
  150. package/types/src/tabs-next/TabListNext.d.ts +0 -12
  151. package/types/src/tabs-next/TabNext.d.ts +0 -12
  152. package/types/src/tabs-next/TabNextAction.d.ts +0 -5
  153. package/types/src/tabs-next/TabNextContext.d.ts +0 -12
  154. package/types/src/tabs-next/TabNextPanel.d.ts +0 -8
  155. package/types/src/tabs-next/TabNextTrigger.d.ts +0 -5
  156. package/types/src/tabs-next/TabOverflowList.d.ts +0 -11
  157. package/types/src/tabs-next/TabsNext.d.ts +0 -17
  158. package/types/src/tabs-next/TabsNextContext.d.ts +0 -21
  159. package/types/src/tabs-next/hooks/useCollection.d.ts +0 -18
  160. package/types/src/tabs-next/hooks/useFocusOutside.d.ts +0 -2
  161. package/types/src/tabs-next/hooks/useOverflow.d.ts +0 -11
  162. package/types/src/tabs-next/index.d.ts +0 -7
  163. package/types/src/tabstrip/Tab.d.ts +0 -27
  164. package/types/src/tabstrip/TabMenu.d.ts +0 -23
  165. package/types/src/tabstrip/TabMenuOptions.d.ts +0 -10
  166. package/types/src/tabstrip/TabsTypes.d.ts +0 -127
  167. package/types/src/tabstrip/Tabstrip.d.ts +0 -3
  168. package/types/src/tabstrip/index.d.ts +0 -5
  169. package/types/src/tabstrip/tabstrip-dom-utils.d.ts +0 -2
  170. package/types/src/tabstrip/useAnimatedSelectionThumb.d.ts +0 -7
  171. package/types/src/tabstrip/useKeyboardNavigation.d.ts +0 -29
  172. package/types/src/tabstrip/useSelection.d.ts +0 -13
  173. package/types/src/tabstrip/useTabstrip.d.ts +0 -55
  174. package/types/src/time-input/MaskedInput.d.ts +0 -49
  175. package/types/src/time-input/TimeInput.d.ts +0 -5
  176. package/types/src/time-input/useTimeInput.d.ts +0 -21
  177. package/types/src/toolbar/Toolbar.d.ts +0 -20
  178. package/types/src/toolbar/index.d.ts +0 -1
  179. package/types/src/toolbar/toolbar-dom-utils.d.ts +0 -3
  180. package/types/src/toolbar/useKeyboardNavigation.d.ts +0 -32
  181. package/types/src/toolbar/useSelection.d.ts +0 -22
  182. package/types/src/toolbar/useToolbar.d.ts +0 -28
  183. package/types/src/utils/deprecated-types.d.ts +0 -2
  184. package/types/src/utils/escapeRegExp.d.ts +0 -1
  185. package/types/src/utils/forwardCallbackProps.d.ts +0 -3
  186. package/types/src/utils/index.d.ts +0 -5
  187. package/types/src/utils/isOverflowElement.d.ts +0 -1
  188. package/types/src/utils/isPlainObject.d.ts +0 -1
  189. package/types/src/vuu-date-picker/VuuDatePicker.d.ts +0 -7
  190. package/types/src/vuu-date-picker/index.d.ts +0 -1
  191. package/types/src/vuu-input/VuuInput.d.ts +0 -18
  192. package/types/src/vuu-input/index.d.ts +0 -1
  193. package/types/src/vuu-time-picker/TimeRangePicker.d.ts +0 -0
  194. package/types/src/vuu-time-picker/VuuTimePicker.d.ts +0 -7
  195. package/types/src/vuu-typeahead-input/VuuTypeaheadInput.d.ts +0 -6
  196. package/types/src/vuu-typeahead-input/index.d.ts +0 -1
  197. package/types/src/vuu-typeahead-input/useVuuTypeaheadInput.d.ts +0 -49
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
- "version": "4.0.0-alpha.8",
2
+ "version": "4.0.0-beta.1",
3
3
  "description": "VUU UI Controls",
4
4
  "main": "./src/index.js",
5
5
  "author": "heswell",
6
6
  "license": "Apache-2.0",
7
- "type": "module",
8
7
  "scripts": {
9
8
  "build:dev": "node ../../scripts/run-build.mjs",
10
9
  "build": "node ../../scripts/run-build-rslib.ts",
11
10
  "type-defs": "node ../../scripts/build-type-defs.mjs"
12
11
  },
13
12
  "devDependencies": {
14
- "@vuu-ui/vuu-data-types": "4.0.0-alpha.8",
15
- "@vuu-ui/vuu-protocol-types": "4.0.0-alpha.8",
16
- "@vuu-ui/vuu-table-types": "4.0.0-alpha.8"
13
+ "@vuu-ui/vuu-data-types": "4.0.0-beta.1",
14
+ "@vuu-ui/vuu-protocol-types": "4.0.0-beta.1",
15
+ "@vuu-ui/vuu-table-types": "4.0.0-beta.1"
17
16
  },
18
17
  "dependencies": {
19
- "@vuu-ui/vuu-context-menu": "4.0.0-alpha.8",
20
- "@vuu-ui/vuu-data-react": "4.0.0-alpha.8",
21
- "@vuu-ui/vuu-popups": "4.0.0-alpha.8",
22
- "@vuu-ui/vuu-table": "4.0.0-alpha.8",
23
- "@vuu-ui/vuu-utils": "4.0.0-alpha.8",
24
- "@salt-ds/core": "1.67.0",
25
- "@salt-ds/icons": "1.16.0",
26
- "@salt-ds/styles": "0.2.1",
27
- "@salt-ds/window": "0.1.1",
18
+ "@vuu-ui/vuu-context-menu": "4.0.0-beta.1",
19
+ "@vuu-ui/vuu-data-react": "4.0.0-beta.1",
20
+ "@vuu-ui/vuu-layout": "4.0.0-beta.1",
21
+ "@vuu-ui/vuu-popups": "4.0.0-beta.1",
22
+ "@vuu-ui/vuu-table": "4.0.0-beta.1",
23
+ "@vuu-ui/vuu-utils": "4.0.0-beta.1",
24
+ "@salt-ds/core": "1.72.0",
25
+ "@salt-ds/icons": "1.18.3",
26
+ "@salt-ds/styles": "0.4.1",
27
+ "@salt-ds/window": "0.1.2",
28
28
  "tabbable": "^6.0.0"
29
29
  },
30
30
  "peerDependencies": {
@@ -35,6 +35,7 @@
35
35
  "react-dom": "^19.2.3"
36
36
  },
37
37
  "sideEffects": false,
38
+ "type": "module",
38
39
  "files": [
39
40
  "README.md",
40
41
  "src",
@@ -43,6 +44,7 @@
43
44
  "exports": {
44
45
  ".": {
45
46
  "import": "./src/index.js",
47
+ "default": "./src/index.js",
46
48
  "types": "./types/index.d.ts"
47
49
  }
48
50
  },
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { createContext, isValidElement, useCallback, useContext, useState } from "react";
2
+ import { createContext, useCallback, useContext, useState } from "react";
3
+ import { isUnconfiguredProperty, layoutFromJson, useLayoutOperation } from "@vuu-ui/vuu-layout";
3
4
  import { Dialog, DialogCloseButton, DialogContent, DialogHeader } from "@salt-ds/core";
4
5
  const UndefinedShowContextPanel = ()=>{
5
6
  console.warn("[ContextPanelContext] no implementation for showContextPanel, you need to add a ContextPanelProvider");
@@ -7,43 +8,54 @@ const UndefinedShowContextPanel = ()=>{
7
8
  const ContextPanelContext = /*#__PURE__*/ createContext({
8
9
  showContextPanel: UndefinedShowContextPanel
9
10
  });
10
- const ContextPanelProvider = ({ children, hideContextPanel: hideContextPanelProp, resolveComponent, showContextPanel: showContextPanelProp })=>{
11
+ const ContextPanelProvider = ({ children, hideContextPanel: hideContextPanelProp, showContextPanel: showContextPanelProp })=>{
11
12
  const { hideContextPanel: inheritedHideContextPanel, showContextPanel: inheritedShowContextPanel } = useContext(ContextPanelContext);
13
+ const { showComponentInContextPanel } = useLayoutOperation();
12
14
  const [dialog, setDialog] = useState(null);
13
15
  const handleOpenChange = useCallback((isOpen)=>{
14
16
  if (!isOpen) setDialog(null);
15
17
  }, []);
16
18
  const hideContextPanel = hideContextPanelProp ?? inheritedHideContextPanel;
17
- const showContextPanel = useCallback((component, title, componentProps)=>{
18
- const resolvedComponent = "string" == typeof component && resolveComponent ? resolveComponent(component, componentProps) : component;
19
- if (showContextPanelProp) showContextPanelProp(resolvedComponent, title, componentProps);
20
- else if (inheritedShowContextPanel !== UndefinedShowContextPanel) inheritedShowContextPanel(resolvedComponent, title, componentProps);
21
- else {
22
- if (!/*#__PURE__*/ isValidElement(resolvedComponent)) throw new Error(`Context panel component "${component}" requires a configured resolver`);
23
- setDialog(/*#__PURE__*/ jsxs(Dialog, {
24
- open: true,
25
- onOpenChange: handleOpenChange,
26
- children: [
27
- /*#__PURE__*/ jsx(DialogCloseButton, {
28
- appearance: "transparent",
29
- "data-embedded": true,
30
- "data-icon": "close",
31
- onClick: ()=>setDialog(null),
32
- sentiment: "neutral"
33
- }),
34
- /*#__PURE__*/ jsx(DialogHeader, {
35
- header: title
36
- }),
37
- /*#__PURE__*/ jsx(DialogContent, {
38
- children: resolvedComponent
39
- })
40
- ]
41
- }));
19
+ const showContextPanel = useCallback((elementOrComponentType, title, props)=>{
20
+ if (showContextPanelProp) showContextPanelProp(elementOrComponentType, title, props);
21
+ else if (inheritedShowContextPanel !== UndefinedShowContextPanel) inheritedShowContextPanel(elementOrComponentType, title, props);
22
+ else if (isUnconfiguredProperty(showComponentInContextPanel)) {
23
+ if ("string" == typeof elementOrComponentType) {
24
+ const component = "string" == typeof elementOrComponentType ? layoutFromJson({
25
+ type: elementOrComponentType,
26
+ props
27
+ }, "") : elementOrComponentType;
28
+ setDialog(/*#__PURE__*/ jsxs(Dialog, {
29
+ open: true,
30
+ onOpenChange: handleOpenChange,
31
+ children: [
32
+ /*#__PURE__*/ jsx(DialogCloseButton, {
33
+ appearance: "transparent",
34
+ "data-embedded": true,
35
+ "data-icon": "close",
36
+ onClick: ()=>setDialog(null),
37
+ sentiment: "neutral"
38
+ }),
39
+ /*#__PURE__*/ jsx(DialogHeader, {
40
+ header: title
41
+ }),
42
+ /*#__PURE__*/ jsx(DialogContent, {
43
+ children: component
44
+ })
45
+ ]
46
+ }));
47
+ }
48
+ } else {
49
+ const component = "string" == typeof elementOrComponentType ? {
50
+ type: elementOrComponentType,
51
+ props
52
+ } : elementOrComponentType;
53
+ showComponentInContextPanel(component, title);
42
54
  }
43
55
  }, [
44
56
  handleOpenChange,
45
57
  inheritedShowContextPanel,
46
- resolveComponent,
58
+ showComponentInContextPanel,
47
59
  showContextPanelProp
48
60
  ]);
49
61
  return /*#__PURE__*/ jsxs(ContextPanelContext.Provider, {
@@ -26,14 +26,14 @@ const css = `
26
26
  }
27
27
 
28
28
  .vuuDraggable-dropIndicator {
29
- background-color: var(--salt-palette-accent-background);
29
+ background-color: var(--salt-sentiment-accent-background);
30
30
  width: 100%;
31
31
  height: 2px;
32
32
  }
33
33
 
34
34
  .vuuDraggable-dropIndicator:before {
35
35
  content: "";
36
- background-color: var(--salt-palette-accent-background);
36
+ background-color: var(--salt-sentiment-accent-background);
37
37
  border-radius: 3px;
38
38
  width: 6px;
39
39
  height: 6px;
@@ -31,7 +31,7 @@ const css = `
31
31
  }
32
32
 
33
33
  .vuuExpandoInput-error {
34
- border-color: var(--vuu-color-red-50);
34
+ border-color: var(--salt-color-red-500);
35
35
  }
36
36
 
37
37
  .vuuExpandoInput .saltInput {
@@ -17,7 +17,6 @@ const Icon_Icon = ({ className, name, size, style: styleProp, ...htmlAttributes
17
17
  } : styleProp;
18
18
  return /*#__PURE__*/ jsx("span", {
19
19
  ...htmlAttributes,
20
- "aria-hidden": true,
21
20
  className: clsx(classBase, className),
22
21
  "data-icon": name,
23
22
  role: "img",
@@ -16,10 +16,10 @@ const IconButton_IconButton = /*#__PURE__*/ forwardRef(function({ "aria-label":
16
16
  });
17
17
  return /*#__PURE__*/ jsx(Button, {
18
18
  ...buttonProps,
19
- "aria-label": ariaLabel,
20
19
  className: clsx(classBase, className),
21
20
  ref: ref,
22
21
  children: /*#__PURE__*/ jsx(Icon, {
22
+ "aria-label": ariaLabel,
23
23
  name: icon,
24
24
  size: size
25
25
  })
@@ -37,7 +37,7 @@ const css = `
37
37
  .vuuTableGroupCell:hover {
38
38
  & .vuuToggleIconButton {
39
39
  & .vuuIcon:after {
40
- --vuu-icon-color: var(--salt-palette-interact-cta-background-hover);
40
+ --vuu-icon-color: var(--salt-sentiment-accent-background);
41
41
  }
42
42
  }
43
43
  }
package/src/index.js CHANGED
@@ -14,6 +14,7 @@ export * from "./measured-container/index.js";
14
14
  export * from "./overflow-container/index.js";
15
15
  export * from "./price-ticker/index.js";
16
16
  export * from "./split-button/index.js";
17
+ export * from "./split-pane/index.js";
17
18
  export * from "./table-search/index.js";
18
19
  export * from "./tabs-next/index.js";
19
20
  export * from "./tabstrip/index.js";
@@ -25,7 +26,6 @@ export * from "./vuu-typeahead-input/index.js";
25
26
  export { ContextPanelProvider, useContextPanel, useHideContextPanel } from "./context-panel-provider/ContextPanelProvider.js";
26
27
  export { HoverOverlay } from "./hover-overlay/HoverOverlay.js";
27
28
  export { ItemPicker } from "./item-picker/ItemPicker.js";
28
- export { SelectedItemsChangeHandler as SelectedItemChangeHandler } from "./item-picker/useItemPicker.js";
29
29
  export { ModalProvider, useModal } from "./modal-provider/ModalProvider.js";
30
30
  export { Prompt } from "./prompt/Prompt.js";
31
31
  export { SortableList, SortableOption } from "./sortable-list/SortableList.js";
@@ -1,9 +1,8 @@
1
1
  import { flip, size, useClick, useDismiss, useInteractions } from "@floating-ui/react";
2
2
  import { useFloatingUI } from "@salt-ds/core";
3
- import { isNavigationKey, isRowSelectionKey, useControlledTableNavigation } from "@vuu-ui/vuu-table";
4
- import { isStringColumn, toColumnName } from "@vuu-ui/vuu-utils";
5
- import { useData } from "@vuu-ui/core";
6
3
  import { useCallback, useMemo, useRef, useState } from "react";
4
+ import { isStringColumn, toColumnName, useData } from "@vuu-ui/vuu-utils";
5
+ import { isNavigationKey, isRowSelectionKey, useControlledTableNavigation } from "@vuu-ui/vuu-table";
7
6
  const defaultRowToString = (dataRow)=>Object.values(dataRow).join(" ");
8
7
  const useTablePicker = ({ TableProps, onSelect, rowToString = defaultRowToString, schema, searchColumns = schema.columns.filter(isStringColumn).map(toColumnName) })=>{
9
8
  const { VuuDataSource } = useData();
@@ -35,7 +35,7 @@ const css = `
35
35
  }
36
36
 
37
37
  & .vuuHighlight {
38
- color: var(--vuu-color-blue-40);
38
+ color: var(--salt-color-blue-400);
39
39
  text-decoration: underline;
40
40
  }
41
41
 
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Input, ListBox, Option } from "@salt-ds/core";
3
3
  import { useComponentCssInjection } from "@salt-ds/styles";
4
4
  import { useWindow } from "@salt-ds/window";
@@ -32,7 +32,7 @@ const useSorting = (id, index)=>{
32
32
  ref
33
33
  };
34
34
  };
35
- const DefaultSelectedListItem = ({ className: classNameProp, index, item, onRemove, searchPattern = "", ...optionProps })=>{
35
+ const SelectedListItem = ({ className: classNameProp, index, item, onRemove, searchPattern = "", ...optionProps })=>{
36
36
  const { handleRef, ref } = useSorting(item.name, index);
37
37
  const value = getItemLabel(item);
38
38
  const valueWithHighlighting = applyHighlighting(value, searchPattern);
@@ -73,7 +73,7 @@ const DefaultSelectedListItem = ({ className: classNameProp, index, item, onRemo
73
73
  ]
74
74
  });
75
75
  };
76
- const DefaultAvailableListItem = ({ className: classNameProp, index, item, onAdd, searchPattern = "", disabled, ...optionProps })=>{
76
+ const AvailableListItem = ({ className: classNameProp, index, item, onAdd, searchPattern = "", disabled, ...optionProps })=>{
77
77
  const value = getItemLabel(item);
78
78
  const valueWithHighlighting = applyHighlighting(value, searchPattern);
79
79
  return /*#__PURE__*/ jsxs(Option, {
@@ -98,14 +98,7 @@ const DefaultAvailableListItem = ({ className: classNameProp, index, item, onAdd
98
98
  ]
99
99
  });
100
100
  };
101
- const getOptionName = (option)=>{
102
- if (option) {
103
- const { name } = option.dataset;
104
- if (name) return name;
105
- }
106
- throw Error("[ItemPicker] list option has no data-name");
107
- };
108
- const ItemPicker_ItemPicker = /*#__PURE__*/ forwardRef(function({ AvailableListItem = DefaultAvailableListItem, SelectedListItem = DefaultSelectedListItem, className, itemTypeName = 'Item', searchForm = true, allItems, layout = 'v-selected-available', selectedItems, maxSelections, onSelectedItemsChange, onSelectionChange, selected = NO_SELECTION, ...htmlAttributes }, forwardedRef) {
101
+ const ItemPicker_ItemPicker = /*#__PURE__*/ forwardRef(function({ className, itemTypeName, allItems, selectedItems, maxSelections, onSelectedItemsChange, onSelectionChange, selected = NO_SELECTION, ...htmlAttributes }, forwardedRef) {
109
102
  const targetWindow = useWindow();
110
103
  useComponentCssInjection({
111
104
  testId: "vuu-item-picker",
@@ -124,6 +117,13 @@ const ItemPicker_ItemPicker = /*#__PURE__*/ forwardRef(function({ AvailableListI
124
117
  maxSelections
125
118
  });
126
119
  const listRef = useRef(null);
120
+ const getOptionName = (option)=>{
121
+ if (option) {
122
+ const { name } = option.dataset;
123
+ if (name) return name;
124
+ }
125
+ throw Error("[ItemPicker] list option has no data-name");
126
+ };
127
127
  const handleDragEnd = useCallback(()=>{
128
128
  setTimeout(()=>{
129
129
  const listItems = listRef.current?.querySelectorAll(".saltOption");
@@ -133,72 +133,19 @@ const ItemPicker_ItemPicker = /*#__PURE__*/ forwardRef(function({ AvailableListI
133
133
  }
134
134
  }, 300);
135
135
  }, [
136
- onReorderSelectedItems
136
+ availableItemsFiltered,
137
+ selectedItemsFiltered
137
138
  ]);
138
139
  const searchPlaceholderText = `Find ${singularForm(itemTypeName)}`;
139
140
  const maxSelectionsSubHeading = maxSelections ? `(${maxSelections} max)` : "";
140
141
  const selectedItemsHeading = `${selectedItemsCount} ${1 === selectedItemsCount ? singularForm(itemTypeName) : pluralForm(itemTypeName)} in view ${maxSelectionsSubHeading}`;
141
142
  const availableItemsHeading = `${availableItemsCount} available ${1 === availableItemsCount ? singularForm(itemTypeName) : pluralForm(itemTypeName)}`;
142
- const selectedList = /*#__PURE__*/ jsxs(Fragment, {
143
- children: [
144
- /*#__PURE__*/ jsx("div", {
145
- className: `${classBase}-sectionHeader`,
146
- children: selectedItemsHeading
147
- }),
148
- /*#__PURE__*/ jsx(DragDropProvider, {
149
- onDragEnd: handleDragEnd,
150
- children: /*#__PURE__*/ jsx(ListBox, {
151
- className: `${classBase}-selectedList`,
152
- onSelectionChange: onSelectionChange,
153
- ref: listRef,
154
- selected: selected,
155
- children: selectedItemsFiltered.map((item, index)=>/*#__PURE__*/ jsx(SelectedListItem, {
156
- item: item,
157
- index: index,
158
- onRemove: onRemoveItemFromSelectedList,
159
- searchPattern: searchText.toLowerCase(),
160
- value: item
161
- }, item.name))
162
- })
163
- })
164
- ]
165
- });
166
- const availableList = /*#__PURE__*/ jsxs(Fragment, {
167
- children: [
168
- /*#__PURE__*/ jsx("div", {
169
- className: clsx(`${classBase}-sectionHeader`, `${classBase}-availableHeader`),
170
- children: availableItemsHeading
171
- }),
172
- /*#__PURE__*/ jsx(ListBox, {
173
- className: `${classBase}-availableList`,
174
- selected: NO_SELECTION,
175
- children: availableItemsFiltered.map((item, index)=>/*#__PURE__*/ jsx(AvailableListItem, {
176
- item: item,
177
- index: index,
178
- onAdd: onAddItemToSelectedList,
179
- searchPattern: searchText.toLowerCase(),
180
- value: item,
181
- disabled: selectedItemsCount === maxSelections
182
- }, item.name))
183
- })
184
- ]
185
- });
186
143
  return /*#__PURE__*/ jsxs("div", {
187
144
  ...htmlAttributes,
188
145
  className: clsx(classBase, className),
189
146
  ref: forwardedRef,
190
147
  children: [
191
- searchForm ? /*#__PURE__*/ jsx("form", {
192
- className: `${classBase}-search`,
193
- role: "search",
194
- children: /*#__PURE__*/ jsx(Input, {
195
- startAdornment: searchIcon,
196
- placeholder: searchPlaceholderText,
197
- ref: searchCallbackRef,
198
- value: searchText,
199
- onChange: onChangeSearchInput
200
- })
201
- }) : /*#__PURE__*/ jsx("div", {
148
+ /*#__PURE__*/ jsx("form", {
202
149
  className: `${classBase}-search`,
203
150
  role: "search",
204
151
  children: /*#__PURE__*/ jsx(Input, {
@@ -209,19 +156,46 @@ const ItemPicker_ItemPicker = /*#__PURE__*/ forwardRef(function({ AvailableListI
209
156
  onChange: onChangeSearchInput
210
157
  })
211
158
  }),
212
- /*#__PURE__*/ jsx("div", {
159
+ /*#__PURE__*/ jsxs("div", {
213
160
  className: `${classBase}-scrollContainer vuuScrollable`,
214
- children: 'v-selected-available' === layout ? /*#__PURE__*/ jsxs(Fragment, {
215
- children: [
216
- selectedList,
217
- availableList
218
- ]
219
- }) : /*#__PURE__*/ jsxs(Fragment, {
220
- children: [
221
- availableList,
222
- selectedList
223
- ]
224
- })
161
+ children: [
162
+ /*#__PURE__*/ jsx("div", {
163
+ className: `${classBase}-sectionHeader`,
164
+ children: selectedItemsHeading
165
+ }),
166
+ /*#__PURE__*/ jsx(DragDropProvider, {
167
+ onDragEnd: handleDragEnd,
168
+ children: /*#__PURE__*/ jsx(ListBox, {
169
+ className: `${classBase}-selectedList`,
170
+ onSelectionChange: onSelectionChange,
171
+ ref: listRef,
172
+ selected: selected,
173
+ children: selectedItemsFiltered.map((item, index)=>/*#__PURE__*/ jsx(SelectedListItem, {
174
+ item: item,
175
+ index: index,
176
+ onRemove: onRemoveItemFromSelectedList,
177
+ searchPattern: searchText.toLowerCase(),
178
+ value: item
179
+ }, item.name))
180
+ })
181
+ }),
182
+ /*#__PURE__*/ jsx("div", {
183
+ className: clsx(`${classBase}-sectionHeader`, `${classBase}-availableHeader`),
184
+ children: availableItemsHeading
185
+ }),
186
+ /*#__PURE__*/ jsx(ListBox, {
187
+ className: `${classBase}-availableList`,
188
+ selected: NO_SELECTION,
189
+ children: availableItemsFiltered.map((item, index)=>/*#__PURE__*/ jsx(AvailableListItem, {
190
+ item: item,
191
+ index: index,
192
+ onAdd: onAddItemToSelectedList,
193
+ searchPattern: searchText.toLowerCase(),
194
+ value: item,
195
+ disabled: selectedItemsCount === maxSelections
196
+ }, item.name))
197
+ })
198
+ ]
225
199
  })
226
200
  ]
227
201
  });
@@ -15,15 +15,15 @@ const css = `
15
15
  }
16
16
 
17
17
  .vuuPriceTicker.up1, .vuuPriceTicker.up2 {
18
- --vuu-icon-color: var(--vuu-color-green-50);
19
- color: var(--vuu-color-green-50);
18
+ --vuu-icon-color: var(--salt-color-green-500);
19
+ color: var(--salt-color-green-500);
20
20
  animation-duration: 30s;
21
21
  }
22
22
 
23
23
  .vuuPriceTicker.down1, .vuuPriceTicker.down2 {
24
24
  --vuu-icon-transform: rotate(180deg);
25
- --vuu-icon-color: var(--vuu-color-red-50);
26
- color: var(--vuu-color-red-50);
25
+ --vuu-icon-color: var(--salt-color-red-500);
26
+ color: var(--salt-color-red-500);
27
27
  animation-duration: 30s;
28
28
  }
29
29
 
@@ -0,0 +1,82 @@
1
+ const css = `
2
+ .vuuSplitPane {
3
+ --vuuSplitPane-align: stretch;
4
+ --vuuSplitPane-direction: row;
5
+ --vuuSplitPane-gap: 0;
6
+ --vuuSplitPane-justify: flex-start;
7
+ --vuuSplitPane-margin: 0;
8
+ --vuuSplitPane-padding: 0;
9
+ --vuuSplitPane-splitterSize: 3px;
10
+ --vuuSplitPane-splitter-background: var(--salt-separable-secondary-borderColor);
11
+ --vuuSplitPane-splitter-background-active: var(--salt-separable-primary-borderColor);
12
+ --vuuSplitPane-splitter-grabZone: 4px;
13
+ align-items: var(--vuuSplitPane-align);
14
+ box-sizing: border-box;
15
+ flex-direction: var(--vuuSplitPane-direction);
16
+ gap: var(--vuuSplitPane-gap);
17
+ justify-content: var(--vuuSplitPane-justify);
18
+ margin: var(--vuuSplitPane-margin);
19
+ min-width: 0;
20
+ min-height: 0;
21
+ padding: var(--vuuSplitPane-padding);
22
+ flex-wrap: nowrap;
23
+ display: flex;
24
+ overflow: hidden;
25
+ }
26
+
27
+ :where(.vuuSplitPane) > :where(:not(.vuuSplitPane-splitter)) {
28
+ box-sizing: border-box;
29
+ }
30
+
31
+ :where(.vuuSplitPane-row) > :where(:not(.vuuSplitPane-splitter)) {
32
+ min-width: 0;
33
+ }
34
+
35
+ :where(.vuuSplitPane-column) > :where(:not(.vuuSplitPane-splitter)) {
36
+ min-height: 0;
37
+ }
38
+
39
+ .vuuSplitPane-splitter {
40
+ background-color: var(--vuuSplitPane-splitter-background);
41
+ flex: 0 0 var(--vuuSplitPane-splitterSize);
42
+ touch-action: none;
43
+ z-index: 1;
44
+ outline: none;
45
+ position: relative;
46
+ }
47
+
48
+ .vuuSplitPane-splitter:before {
49
+ content: "";
50
+ position: absolute;
51
+ inset: 0;
52
+ }
53
+
54
+ .vuuSplitPane-row > .vuuSplitPane-splitter {
55
+ cursor: ew-resize;
56
+ }
57
+
58
+ .vuuSplitPane-row > .vuuSplitPane-splitter:before {
59
+ left: calc(-1 * var(--vuuSplitPane-splitter-grabZone));
60
+ right: calc(-1 * var(--vuuSplitPane-splitter-grabZone));
61
+ }
62
+
63
+ .vuuSplitPane-column > .vuuSplitPane-splitter {
64
+ cursor: ns-resize;
65
+ }
66
+
67
+ .vuuSplitPane-column > .vuuSplitPane-splitter:before {
68
+ bottom: calc(-1 * var(--vuuSplitPane-splitter-grabZone));
69
+ top: calc(-1 * var(--vuuSplitPane-splitter-grabZone));
70
+ }
71
+
72
+ .vuuSplitPane-splitter:hover, .vuuSplitPane-splitter-active {
73
+ --vuuSplitPane-splitter-background: var(--vuuSplitPane-splitter-background-active);
74
+ }
75
+
76
+ .vuuSplitPane-splitter:focus-visible {
77
+ outline: var(--salt-focused-outline);
78
+ }
79
+
80
+
81
+ `;
82
+ export default css;
@@ -0,0 +1,60 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { resolveResponsiveValue, useBreakpoint, useForkRef } from "@salt-ds/core";
3
+ import { useComponentCssInjection } from "@salt-ds/styles";
4
+ import { useWindow } from "@salt-ds/window";
5
+ import clsx from "clsx";
6
+ import { Children, forwardRef } from "react";
7
+ import { Splitter } from "./Splitter.js";
8
+ import { useSplitPane } from "./useSplitPane.js";
9
+ import SplitPane_0 from "./SplitPane.css";
10
+ const classBase = "vuuSplitPane";
11
+ const parseSpacing = (value)=>"number" == typeof value ? `calc(var(--salt-spacing-100) * ${value})` : value;
12
+ const parseAlignment = (value)=>"start" === value || "end" === value ? `flex-${value}` : value;
13
+ const SplitPane_SplitPane = /*#__PURE__*/ forwardRef(function({ align, children, className, direction = "row", gap = 0, justify, margin = 0, onSplitterMoved, padding = 0, splitterSize, style, ...htmlAttributes }, forwardedRef) {
14
+ const targetWindow = useWindow();
15
+ useComponentCssInjection({
16
+ testId: "vuu-split-pane",
17
+ css: SplitPane_0,
18
+ window: targetWindow
19
+ });
20
+ const { matchedBreakpoints } = useBreakpoint();
21
+ const flexDirection = resolveResponsiveValue(direction, matchedBreakpoints) ?? "row";
22
+ const flexGap = resolveResponsiveValue(gap, matchedBreakpoints);
23
+ const flexMargin = resolveResponsiveValue(margin, matchedBreakpoints);
24
+ const flexPadding = resolveResponsiveValue(padding, matchedBreakpoints);
25
+ const panes = Children.toArray(children);
26
+ if (panes.length > 2) throw Error(`[SplitPane] supports a maximum of two children, ${panes.length} were provided`);
27
+ const { beginResize, endResize, resize, rootRef, splitterPosition } = useSplitPane({
28
+ direction: flexDirection,
29
+ onSplitterMoved,
30
+ paneCount: panes.length
31
+ });
32
+ const splitPaneStyle = {
33
+ ...style,
34
+ "--vuuSplitPane-align": parseAlignment(align),
35
+ "--vuuSplitPane-direction": flexDirection,
36
+ "--vuuSplitPane-gap": parseSpacing(flexGap),
37
+ "--vuuSplitPane-justify": parseAlignment(justify),
38
+ "--vuuSplitPane-margin": parseSpacing(flexMargin),
39
+ "--vuuSplitPane-padding": parseSpacing(flexPadding),
40
+ "--vuuSplitPane-splitterSize": void 0 === splitterSize ? void 0 : `${splitterSize}px`
41
+ };
42
+ return /*#__PURE__*/ jsxs("div", {
43
+ ...htmlAttributes,
44
+ className: clsx(classBase, `${classBase}-${flexDirection}`, className),
45
+ ref: useForkRef(rootRef, forwardedRef),
46
+ style: splitPaneStyle,
47
+ children: [
48
+ panes[0],
49
+ 2 === panes.length ? /*#__PURE__*/ jsx(Splitter, {
50
+ direction: flexDirection,
51
+ onResize: resize,
52
+ onResizeEnd: endResize,
53
+ onResizeStart: beginResize,
54
+ position: splitterPosition
55
+ }) : null,
56
+ panes[1]
57
+ ]
58
+ });
59
+ });
60
+ export { SplitPane_SplitPane as SplitPane };