@longline/aqua-ui 1.0.330 → 1.0.334

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 (162) hide show
  1. package/Types.d.ts +9 -1
  2. package/containers/Anchor/Anchor.d.ts +2 -1
  3. package/containers/Anchor/Anchor.js +1 -1
  4. package/containers/Dock/Dock.d.ts +2 -1
  5. package/containers/Dock/Dock.js +1 -1
  6. package/containers/Dock/Dockable.d.ts +2 -1
  7. package/containers/Dock/Dockable.js +1 -1
  8. package/containers/DragBar/DragBar.d.ts +2 -1
  9. package/containers/DragBar/DragBar.js +1 -1
  10. package/containers/Form/elements/BoxWrapper.js +1 -1
  11. package/containers/Form/elements/Hint.js +1 -1
  12. package/containers/Form/elements/SimpleWrapper.js +1 -1
  13. package/containers/GlassPane/GlassPane.d.ts +2 -1
  14. package/containers/GlassPane/GlassPane.js +1 -1
  15. package/containers/InfoBox/InfoBox.d.ts +2 -1
  16. package/containers/InfoBox/InfoBox.js +1 -1
  17. package/containers/InfoBox/elements/Content.d.ts +2 -1
  18. package/containers/InfoBox/elements/Content.js +1 -1
  19. package/containers/InfoBox/elements/Footer.d.ts +2 -1
  20. package/containers/InfoBox/elements/Footer.js +1 -1
  21. package/containers/InfoBox/elements/Header.d.ts +2 -1
  22. package/containers/InfoBox/elements/Header.js +1 -1
  23. package/containers/InfoBox/elements/Row.d.ts +4 -2
  24. package/containers/InfoBox/elements/Row.js +1 -1
  25. package/containers/List/List.d.ts +2 -1
  26. package/containers/List/List.js +1 -1
  27. package/containers/List/ListCell.d.ts +2 -1
  28. package/containers/List/ListCell.js +1 -1
  29. package/containers/List/ListRow.d.ts +2 -1
  30. package/containers/List/ListRow.js +1 -1
  31. package/containers/Message/Message.d.ts +2 -1
  32. package/containers/Message/Message.js +1 -1
  33. package/containers/Openable/Openable.d.ts +2 -1
  34. package/containers/Openable/Openable.js +2 -2
  35. package/containers/PublicRoute/Help.d.ts +2 -1
  36. package/containers/PublicRoute/Help.js +1 -1
  37. package/containers/PublicRoute/PublicRoute.d.ts +2 -1
  38. package/containers/PublicRoute/PublicRoute.js +1 -1
  39. package/containers/Tabs/Pane.d.ts +2 -1
  40. package/containers/Tabs/Pane.js +1 -1
  41. package/containers/Tabs/Tabs.d.ts +2 -1
  42. package/containers/Tabs/Tabs.js +1 -1
  43. package/controls/Chip/Chip.d.ts +2 -1
  44. package/controls/Chip/Chip.js +1 -1
  45. package/controls/CircularProgress/CircularProgress.d.ts +2 -1
  46. package/controls/CircularProgress/CircularProgress.js +1 -1
  47. package/controls/Dropzone/Dropzone.d.ts +2 -1
  48. package/controls/Dropzone/Dropzone.js +1 -1
  49. package/controls/Fab/Fab.d.ts +2 -1
  50. package/controls/Fab/Fab.js +1 -1
  51. package/controls/Ghost/Ghost.d.ts +2 -1
  52. package/controls/Ghost/Ghost.js +1 -1
  53. package/controls/Gradient/Gradient.d.ts +2 -2
  54. package/controls/Gradient/Gradient.js +1 -1
  55. package/controls/Histogram/Histogram.d.ts +2 -1
  56. package/controls/Histogram/Histogram.js +14 -14
  57. package/controls/Icon/Icon.d.ts +2 -2
  58. package/controls/Icon/Icon.js +1 -1
  59. package/controls/Key/Key.d.ts +2 -1
  60. package/controls/Key/Key.js +1 -1
  61. package/controls/LinearChart/LinearChart.d.ts +2 -1
  62. package/controls/LinearChart/LinearChart.js +1 -1
  63. package/controls/ListButton/ListButton.d.ts +2 -1
  64. package/controls/ListButton/ListButton.js +1 -1
  65. package/controls/ListView/ListView.d.ts +2 -1
  66. package/controls/ListView/ListView.js +1 -1
  67. package/controls/Mouse/Mouse.d.ts +2 -1
  68. package/controls/Mouse/Mouse.js +1 -1
  69. package/controls/PrimaryButton/PrimaryButton.d.ts +2 -1
  70. package/controls/PrimaryButton/PrimaryButton.js +1 -1
  71. package/controls/Progress/Progress.d.ts +2 -1
  72. package/controls/Progress/Progress.js +1 -1
  73. package/controls/SecondaryButton/SecondaryButton.d.ts +2 -1
  74. package/controls/SecondaryButton/SecondaryButton.js +1 -1
  75. package/controls/TabBar/Tab.d.ts +2 -1
  76. package/controls/TabBar/Tab.js +1 -1
  77. package/controls/TabBar/TabBar.d.ts +2 -1
  78. package/controls/TabBar/TabBar.js +1 -1
  79. package/controls/TertiaryButton/TertiaryButton.d.ts +2 -1
  80. package/controls/TertiaryButton/TertiaryButton.js +1 -1
  81. package/controls/ToggleButton/ToggleButton.d.ts +2 -1
  82. package/controls/ToggleButton/ToggleButton.js +1 -1
  83. package/controls/View/View.d.ts +2 -1
  84. package/controls/View/View.js +1 -1
  85. package/hooks/useSpeechAIRecorder/index.d.ts +1 -0
  86. package/hooks/useSpeechAIRecorder/index.js +1 -0
  87. package/hooks/useSpeechAIRecorder/stories/SpeechAIAudioInput.d.ts +6 -0
  88. package/hooks/{useAssemblyAIRecorder/stories/AssemblyAudioInput.js → useSpeechAIRecorder/stories/SpeechAIAudioInput.js} +4 -4
  89. package/hooks/useSpeechAIRecorder/useSpeechAIRecorder.d.ts +29 -0
  90. package/hooks/{useAssemblyAIRecorder/useAssemblyAIRecorder.js → useSpeechAIRecorder/useSpeechAIRecorder.js} +13 -11
  91. package/hooks/useTextAIStream/index.d.ts +1 -0
  92. package/hooks/useTextAIStream/index.js +1 -0
  93. package/hooks/{useOpenAIStream/stories/OpenAIStreamInput.d.ts → useTextAIStream/stories/TextAIStreamInput.d.ts} +3 -3
  94. package/hooks/{useOpenAIStream/stories/OpenAIStreamInput.js → useTextAIStream/stories/TextAIStreamInput.js} +6 -6
  95. package/hooks/useTextAIStream/useTextAIStream.d.ts +26 -0
  96. package/hooks/{useOpenAIStream/useOpenAIStream.js → useTextAIStream/useTextAIStream.js} +16 -4
  97. package/inputs/DateInput/DateInput.d.ts +2 -5
  98. package/inputs/Dropdown/Dropdown.d.ts +2 -5
  99. package/inputs/Editor/Editor.d.ts +10 -11
  100. package/inputs/Editor/Editor.js +1 -1
  101. package/inputs/Editor/buttons/{SpeechButton.d.ts → SpeechAIButton.d.ts} +2 -2
  102. package/inputs/Editor/buttons/{SpeechButton.js → SpeechAIButton.js} +5 -5
  103. package/inputs/Editor/buttons/TextAIButton.d.ts +28 -0
  104. package/inputs/Editor/buttons/{OpenAIButton.js → TextAIButton.js} +13 -14
  105. package/inputs/Editor/buttons/{OpenAIMenu.d.ts → TextAIMenu.d.ts} +2 -2
  106. package/inputs/Editor/buttons/{OpenAIMenu.js → TextAIMenu.js} +3 -3
  107. package/inputs/Editor/menu/MenuBar.d.ts +6 -6
  108. package/inputs/Editor/menu/MenuBar.js +7 -7
  109. package/inputs/Input/Input.d.ts +2 -5
  110. package/inputs/Input/InputWrapper.d.ts +2 -1
  111. package/inputs/Input/InputWrapper.js +1 -1
  112. package/inputs/MonthRange/MonthRange.d.ts +2 -5
  113. package/inputs/Selector/Selector.d.ts +2 -5
  114. package/inputs/Slider/Slider.d.ts +2 -5
  115. package/inputs/Textarea/Textarea.d.ts +2 -5
  116. package/map/Map/Map.d.ts +2 -1
  117. package/map/Map/Map.js +1 -1
  118. package/map/PositionsManager/PositionBox.d.ts +2 -1
  119. package/map/PositionsManager/PositionBox.js +1 -1
  120. package/map/controls/CompassButton/CompassButton.js +3 -3
  121. package/map/controls/FullscreenButton/FullscreenButton.js +1 -1
  122. package/map/controls/Geocoder/Geocoder.js +1 -1
  123. package/map/controls/MapLoader/MapLoader.js +1 -1
  124. package/map/controls/ScaleControl/ScaleControl.js +1 -1
  125. package/map/controls/ZoomInButton/ZoomInButton.js +1 -1
  126. package/map/controls/ZoomOutButton/ZoomOutButton.js +1 -1
  127. package/map/controls/base/MapButton/MapButton.d.ts +0 -4
  128. package/map/controls/base/MapButton/MapButton.js +2 -2
  129. package/map/controls/base/MapControl/MapControl.d.ts +2 -1
  130. package/map/controls/base/MapControl/MapControl.js +2 -2
  131. package/modules/Filter/Filter.d.ts +2 -1
  132. package/modules/Filter/Filter.js +1 -1
  133. package/modules/MainMenu/Item.d.ts +2 -1
  134. package/modules/MainMenu/Item.js +1 -1
  135. package/modules/MainMenu/MainMenu.d.ts +2 -1
  136. package/modules/MainMenu/MainMenu.js +1 -1
  137. package/modules/Root/Sidebar.js +1 -1
  138. package/package.json +4 -5
  139. package/services/Dialog/Dialog.d.ts +2 -1
  140. package/services/Dialog/Dialog.js +2 -2
  141. package/services/Dialog/DialogWindow.d.ts +2 -1
  142. package/services/Dialog/DialogWindow.js +1 -1
  143. package/hooks/useAssemblyAIRecorder/index.d.ts +0 -1
  144. package/hooks/useAssemblyAIRecorder/index.js +0 -1
  145. package/hooks/useAssemblyAIRecorder/stories/AssemblyAudioInput.d.ts +0 -6
  146. package/hooks/useAssemblyAIRecorder/useAssemblyAIRecorder.d.ts +0 -27
  147. package/hooks/useOpenAIRecorder/index.d.ts +0 -1
  148. package/hooks/useOpenAIRecorder/index.js +0 -1
  149. package/hooks/useOpenAIRecorder/old/AudioInputNoHook.d.ts +0 -8
  150. package/hooks/useOpenAIRecorder/old/AudioInputNoHook.js +0 -192
  151. package/hooks/useOpenAIRecorder/old/AudioInputStandardMedia.d.ts +0 -5
  152. package/hooks/useOpenAIRecorder/old/AudioInputStandardMedia.js +0 -170
  153. package/hooks/useOpenAIRecorder/stories/OpenAIAudioInput.d.ts +0 -8
  154. package/hooks/useOpenAIRecorder/stories/OpenAIAudioInput.js +0 -17
  155. package/hooks/useOpenAIRecorder/useOpenAIRecorder.d.ts +0 -22
  156. package/hooks/useOpenAIRecorder/useOpenAIRecorder.js +0 -223
  157. package/hooks/useOpenAIStream/index.d.ts +0 -1
  158. package/hooks/useOpenAIStream/index.js +0 -1
  159. package/hooks/useOpenAIStream/useOpenAIStream.d.ts +0 -14
  160. package/inputs/Editor/buttons/OpenAIButton.d.ts +0 -29
  161. /package/hooks/{useAssemblyAIRecorder → useSpeechAIRecorder}/SpeechManager.d.ts +0 -0
  162. /package/hooks/{useAssemblyAIRecorder → useSpeechAIRecorder}/SpeechManager.js +0 -0
@@ -30,30 +30,30 @@ import { HistogramNoData } from './HistogramNoData';
30
30
  import { HistogramBar } from './HistogramBar';
31
31
  import { HistogramTick } from './HistogramTick';
32
32
  import { DefaultHistogramAppearance } from './HistogramAppearance';
33
- var HistogramBase = function (p) {
33
+ var HistogramBase = function (props) {
34
34
  // Abort if there are no bins.
35
- if (p.bins.length === 0)
36
- return React.createElement(HistogramNoData, null, p.nodata);
35
+ if (props.bins.length === 0)
36
+ return React.createElement(HistogramNoData, null, props.nodata);
37
37
  // Find tallest bar. This is used to calculate the percentage height
38
38
  // of each bar.
39
- var maxHeight = Math.max.apply(Math, p.bins.map(function (b) { return b.count; }));
39
+ var maxHeight = Math.max.apply(Math, props.bins.map(function (b) { return b.count; }));
40
40
  // Abort if bins are all empty.
41
41
  if (maxHeight === 0)
42
- return React.createElement(HistogramNoData, null, p.nodata);
43
- return (React.createElement("div", { "data-testid": "Histogram", className: p.className },
42
+ return React.createElement(HistogramNoData, null, props.nodata);
43
+ return (React.createElement("div", { "data-testid": props['data-testid'] || "Histogram", className: props.className },
44
44
  React.createElement(ChartArea, null,
45
45
  React.createElement(Indent, null,
46
- React.createElement(BarArea, null, p.bins.map(function (bin, idx) {
47
- return React.createElement(HistogramBar, { key: idx, values: p.values, value: bin.count, label: bin.name, height: 100 * bin.count / maxHeight, onClick: p.onClick ? function () { return p.onClick(idx); } : null, loading: p.loading, appearance: p.appearance });
46
+ React.createElement(BarArea, null, props.bins.map(function (bin, idx) {
47
+ return React.createElement(HistogramBar, { key: idx, values: props.values, value: bin.count, label: bin.name, height: 100 * bin.count / maxHeight, onClick: props.onClick ? function () { return props.onClick(idx); } : null, loading: props.loading, appearance: props.appearance });
48
48
  })))),
49
- p.tickStyle !== 'none' && React.createElement(AxisArea, null,
49
+ props.tickStyle !== 'none' && React.createElement(AxisArea, null,
50
50
  React.createElement(Indent, null,
51
- p.bins.map(function (bin, idx) {
52
- return React.createElement(HistogramTick, { key: idx, showValue: p.tickStyle === 'value', left: 100 * idx / p.bins.length, value: bin.binStart });
51
+ props.bins.map(function (bin, idx) {
52
+ return React.createElement(HistogramTick, { key: idx, showValue: props.tickStyle === 'value', left: 100 * idx / props.bins.length, value: bin.binStart });
53
53
  }),
54
- p.bins.length > 0 &&
55
- React.createElement(HistogramTick, { left: 100, showValue: p.tickStyle === 'value', value: p.bins[p.bins.length - 1].binEnd }))),
56
- p.unit && React.createElement(UnitArea, null, p.unit)));
54
+ props.bins.length > 0 &&
55
+ React.createElement(HistogramTick, { left: 100, showValue: props.tickStyle === 'value', value: props.bins[props.bins.length - 1].binEnd }))),
56
+ props.unit && React.createElement(UnitArea, null, props.unit)));
57
57
  };
58
58
  var ChartArea = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
59
59
  var AxisArea = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { Size } from '../../Types';
3
- interface IIconProps {
2
+ import { ITestable, Size } from '../../Types';
3
+ interface IIconProps extends ITestable {
4
4
  /** @ignore */
5
5
  className?: string;
6
6
  /**
@@ -36,7 +36,7 @@ var IconBase = function (props) {
36
36
  if (props.onClick)
37
37
  props.onClick(e);
38
38
  };
39
- return (React.createElement("svg", { "data-testid": "Icon", className: props.className, onClick: handleClick, focusable: "false", role: "img" },
39
+ return (React.createElement("svg", { "data-testid": props['data-testid'] || "Icon", className: props.className, onClick: handleClick, focusable: "false", role: "img" },
40
40
  props.title && React.createElement("title", null, props.title),
41
41
  React.createElement("use", { xlinkHref: props.url })));
42
42
  };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IKeyProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IKeyProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -48,7 +48,7 @@ var KeyBase = function (props) {
48
48
  }
49
49
  return { symbol: sym, wide: isWide };
50
50
  }, [props.value, isMac]), symbol = _a.symbol, wide = _a.wide;
51
- return (React.createElement("span", { "data-testid": "Key", className: props.className, style: {
51
+ return (React.createElement("span", { "data-testid": props['data-testid'] || "Key", className: props.className, style: {
52
52
  maxWidth: wide ? 'auto' : '16px',
53
53
  minWidth: wide ? '36px' : 'auto'
54
54
  }, "aria-label": props.value },
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface ILinearChartProps {
2
+ import { ITestable } from '../../Types';
3
+ interface ILinearChartProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -29,7 +29,7 @@ import styled from 'styled-components';
29
29
  import { Ghost } from '../Ghost';
30
30
  var LinearChartBase = function (props) {
31
31
  var percentage = Math.round(Math.max(0, Math.min(100, props.value))) + "%";
32
- return (React.createElement("div", { "data-testid": "LinearChart", className: props.className, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(props.value) },
32
+ return (React.createElement("div", { "data-testid": props['data-testid'] || "LinearChart", className: props.className, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(props.value) },
33
33
  props.label && React.createElement(Label, null,
34
34
  props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: 0, top: '2px', right: 0, bottom: '2px' } }),
35
35
  !props.ghost && props.label),
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Placement } from '@popperjs/core';
3
- interface IListButtonProps {
3
+ import { ITestable } from '../../Types';
4
+ interface IListButtonProps extends ITestable {
4
5
  /** @ignore */
5
6
  children?: React.ReactNode;
6
7
  /** Toggle control that opens/closes the list. Receives an `onClick` handler. */
@@ -59,7 +59,7 @@ var ListButtonBase = function (props) {
59
59
  update();
60
60
  };
61
61
  return (React.createElement(React.Fragment, null,
62
- React.createElement("div", { "data-testid": "ListButton", ref: buttonRef, style: { display: 'inline-block' } }, React.cloneElement(props.toggle, { onClick: toggleOpen })),
62
+ React.createElement("div", { "data-testid": props['data-testid'] || "ListButton", ref: buttonRef, style: { display: 'inline-block' } }, React.cloneElement(props.toggle, { onClick: toggleOpen })),
63
63
  createPortal(React.createElement(Pane, __assign({ "$open": open, "$width": props.width, style: styles.popper }, attributes.popper, { ref: paneRef }), open && React.createElement(List, { maxItems: 6, contract: true }, props.children)), document.body)));
64
64
  };
65
65
  var Pane = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"], ["\n display: ", ";\n width: ", "px;\n z-index: 2500;\n"
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { IColumnProps } from './Column';
3
3
  import { IListViewProps } from './IListViewProps';
4
- interface IProps extends IListViewProps {
4
+ import { ITestable } from '../../Types';
5
+ interface IProps extends IListViewProps, ITestable {
5
6
  /**
6
7
  * Column specifications. These are a set of `Column` children,
7
8
  * each of which set a column name, width, sort key and sort direction, and
@@ -120,7 +120,7 @@ var ListViewBase = function (props) {
120
120
  if (props.ghost) {
121
121
  return React.createElement(Ghost, __assign({}, otherProps, { columns: columns }));
122
122
  }
123
- return (React.createElement(Table, __assign({ "data-testid": "ListView" }, otherProps, { data: data, columns: columns, sort: sort, reverse: reverse, onSortClick: handleSort, columnsMode: columnsMode, onOpenColumns: handleColumns, onCheck: props.onCheck ? handleCheck : null, onChangeColumns: handleChangeColumns, onCloseColumns: function () { return setColumnsMode(false); }, onResetColumns: handleResetColumns })));
123
+ return (React.createElement(Table, __assign({ "data-testid": props['data-testid'] || "ListView" }, otherProps, { data: data, columns: columns, sort: sort, reverse: reverse, onSortClick: handleSort, columnsMode: columnsMode, onOpenColumns: handleColumns, onCheck: props.onCheck ? handleCheck : null, onChangeColumns: handleChangeColumns, onCloseColumns: function () { return setColumnsMode(false); }, onResetColumns: handleResetColumns })));
124
124
  };
125
125
  /**
126
126
  * A data table with sorting, column management, virtualization, and row selection.
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IMouseProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IMouseProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -27,7 +27,7 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  var MouseBase = function (props) {
30
- return (React.createElement("svg", { "data-testid": "Mouse", className: props.className, viewBox: "3 0 22 29", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" // Hide from assistive tech (for non-interactive icons)
30
+ return (React.createElement("svg", { "data-testid": props['data-testid'] || "Mouse", className: props.className, viewBox: "3 0 22 29", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" // Hide from assistive tech (for non-interactive icons)
31
31
  , focusable: "false" },
32
32
  React.createElement("path", { d: "M14 1.75623C8.69307 1.75623 4.375 6.07429 4.375 11.3812V18.3812C4.375 23.6882 8.69307 28.0062 14 28.0062C19.3069 28.0062 23.625 23.6882 23.625 18.3812V11.3812C23.625 6.07429 19.3069 1.75623 14 1.75623ZM21.875 11.3812V12.2562H16.625V10.5062C16.625 9.36653 15.8911 8.40403 14.875 8.04199V3.55756C18.806 3.99506 21.875 7.33546 21.875 11.3812ZM14 9.63123C14.4834 9.63123 14.875 10.0239 14.875 10.5062V13.1312C14.875 13.6136 14.4834 14.0062 14 14.0062C13.5166 14.0062 13.125 13.6136 13.125 13.1312V10.5062C13.125 10.0239 13.5166 9.63123 14 9.63123ZM6.125 11.3812C6.125 7.33546 9.19403 3.99389 13.125 3.55779V8.04223C12.1089 8.40427 11.375 9.36677 11.375 10.5065V12.2565H6.125V11.3812ZM14 26.2562C9.65767 26.2562 6.125 22.7236 6.125 18.3812V14.0062H11.5358C11.8978 15.0223 12.8603 15.7562 14 15.7562C15.1397 15.7562 16.1022 15.0223 16.4642 14.0062H21.875V18.3812C21.875 22.7236 18.3423 26.2562 14 26.2562Z", fill: props.color }),
33
33
  props.left && React.createElement("path", { className: "left", d: "M13.125 3.55798C9.19403 3.99408 6.125 7.33565 6.125 11.3814V12.2567H11.375V10.5067C11.375 9.36696 12.1089 8.40446 13.125 8.04242V3.55798Z" }),
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { IIconProps } from '../Icon';
3
- interface IPrimaryButtonProps {
3
+ import { ITestable } from '../../Types';
4
+ interface IPrimaryButtonProps extends ITestable {
4
5
  /** @ignore */
5
6
  className?: string;
6
7
  /** Button content. Can be JSX. */
@@ -40,7 +40,7 @@ var PrimaryButtonBase = function (props) {
40
40
  // An IIconProps was provided. Use it as the props for the icon.
41
41
  return React.createElement(Icon, __assign({ color: theme.colors.neutral[100] }, props.icon));
42
42
  };
43
- return (React.createElement("button", { "data-testid": "PrimaryButton", className: props.className, type: "button", onClick: props.onClick, title: props.title, "aria-disabled": props.disabled, disabled: props.disabled },
43
+ return (React.createElement("button", { "data-testid": props['data-testid'] || "PrimaryButton", className: props.className, type: "button", onClick: props.onClick, title: props.title, "aria-disabled": props.disabled, disabled: props.disabled },
44
44
  icon(),
45
45
  props.children));
46
46
  };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IProgressProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IProgressProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -34,7 +34,7 @@ var getClampedValue = function (value) {
34
34
  return Math.round(Math.min(100, Math.max(0, value)));
35
35
  };
36
36
  var ProgressBase = function (props) {
37
- return React.createElement("div", { "data-testid": "Progress", className: props.className, role: "progressbar", "aria-valuenow": getClampedValue(props.value), "aria-valuemin": 0, "aria-valuemax": 100 },
37
+ return React.createElement("div", { "data-testid": props['data-testid'] || "Progress", className: props.className, role: "progressbar", "aria-valuenow": getClampedValue(props.value), "aria-valuemin": 0, "aria-valuemax": 100 },
38
38
  React.createElement(FillOuter, null,
39
39
  React.createElement(FillInner, { style: { transform: "scaleX(".concat(getClampedValue(props.value) / 100, ")") } })),
40
40
  props.numbered && React.createElement(Value, null, "".concat(getClampedValue(props.value), "%")));
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { IIconProps } from '../Icon';
3
- interface ISecondaryButtonProps {
3
+ import { ITestable } from '../../Types';
4
+ interface ISecondaryButtonProps extends ITestable {
4
5
  /** @ignore */
5
6
  className?: string;
6
7
  /**
@@ -29,7 +29,7 @@ import styled, { css, useTheme } from 'styled-components';
29
29
  import { Icon } from '../Icon';
30
30
  var SecondaryButtonBase = function (props) {
31
31
  var theme = useTheme();
32
- return (React.createElement("button", { "data-testid": "SecondaryButton", type: "button", className: props.className, disabled: props.disabled, onClick: props.onClick, title: props.title, "aria-label": props.title },
32
+ return (React.createElement("button", { "data-testid": props['data-testid'] || "SecondaryButton", type: "button", className: props.className, disabled: props.disabled, onClick: props.onClick, title: props.title, "aria-label": props.title },
33
33
  React.createElement(Icon, __assign({ color: theme.colors.neutral[100] }, (typeof props.icon === 'string' ? { url: props.icon } : props.icon)))));
34
34
  };
35
35
  //
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface ITabProps {
2
+ import { ITestable } from '../../Types';
3
+ interface ITabProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /** @ignore */
@@ -32,7 +32,7 @@ var TabBase = React.forwardRef(function (props, ref) {
32
32
  if (props.onClick)
33
33
  props.onClick();
34
34
  };
35
- return (React.createElement("div", { "data-testid": "TabBar.Tab", className: props.className, role: "tab", "aria-selected": props.active, ref: ref, onClick: handleClick },
35
+ return (React.createElement("div", { "data-testid": props['data-testid'] || "TabBar.Tab", className: props.className, role: "tab", "aria-selected": props.active, ref: ref, onClick: handleClick },
36
36
  props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: '5px', top: '9px', right: '5px', bottom: '9px', zIndex: 100 } }),
37
37
  React.createElement(Content, null,
38
38
  props.children,
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Tab } from './Tab';
3
- interface ITabBarProps {
3
+ import { ITestable } from '../../Types';
4
+ interface ITabBarProps extends ITestable {
4
5
  /** @ignore */
5
6
  className?: string;
6
7
  /**
@@ -190,7 +190,7 @@ var TabBarBase = function (props) {
190
190
  setActive(idx);
191
191
  (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, idx);
192
192
  };
193
- return (React.createElement("div", { "data-testid": "TabBar", className: props.className, ref: barRef, "aria-orientation": "horizontal" },
193
+ return (React.createElement("div", { "data-testid": props['data-testid'] || "TabBar", className: props.className, ref: barRef, "aria-orientation": "horizontal" },
194
194
  React.createElement(Slider, { ref: sliderRef, onMouseDown: handleMouseDown },
195
195
  React.Children.map(props.children, function (child, idx) {
196
196
  return React.cloneElement(child, {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { IIconProps } from '../Icon';
3
- interface ITertiaryButtonProps {
3
+ import { ITestable } from '../../Types';
4
+ interface ITertiaryButtonProps extends ITestable {
4
5
  /** @ignore */
5
6
  className?: string;
6
7
  /** Button content. Can be JSX. */
@@ -39,7 +39,7 @@ var TertiaryButtonBase = React.forwardRef(function (props, ref) {
39
39
  // An IIconProps was provided. Use it as the props for the icon.
40
40
  return React.createElement(Icon, __assign({ color: props.primary ? theme.colors.neutral[100] : theme.colors.primary[3] }, props.icon));
41
41
  };
42
- return (React.createElement("button", { "data-testid": "TertiaryButton", ref: ref, className: props.className, type: "button", disabled: props.disabled, onClick: props.onClick },
42
+ return (React.createElement("button", { "data-testid": props['data-testid'] || "TertiaryButton", ref: ref, className: props.className, type: "button", disabled: props.disabled, onClick: props.onClick },
43
43
  icon(),
44
44
  props.children));
45
45
  });
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IToggleButtonProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IToggleButtonProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -28,7 +28,7 @@ import * as React from 'react';
28
28
  import styled, { css } from 'styled-components';
29
29
  import { Icon } from '../Icon';
30
30
  var ToggleButtonBase = React.forwardRef(function (props, ref) {
31
- return React.createElement("button", { "data-testid": "ToggleButton", className: props.className, ref: ref, type: "button", onClick: props.onClick, title: props.title, disabled: props.disabled, "aria-pressed": props.active, "aria-expanded": props.open, "aria-disabled": props.disabled },
31
+ return React.createElement("button", { "data-testid": props['data-testid'] || "ToggleButton", className: props.className, ref: ref, type: "button", onClick: props.onClick, title: props.title, disabled: props.disabled, "aria-pressed": props.active, "aria-expanded": props.open, "aria-disabled": props.disabled },
32
32
  React.createElement(Icon, { url: props.url }));
33
33
  });
34
34
  var ToggleButtonStyled = styled(ToggleButtonBase).attrs(function (p) {
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IViewProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IViewProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -31,7 +31,7 @@ import { ScrollingContent } from './ScrollingContent';
31
31
  import { EllipsizedContent } from './EllipsizedContent';
32
32
  import { Ghost } from '../Ghost';
33
33
  var ViewBase = function (props) {
34
- return React.createElement("div", { "data-testid": "View", className: props.className },
34
+ return React.createElement("div", { "data-testid": props['data-testid'] || "View", className: props.className },
35
35
  props.ghost && React.createElement(Ghost, { style: { position: 'absolute', left: 0, top: 0, right: 0, bottom: 0, zIndex: 100 } }),
36
36
  React.createElement(Label, null, props.badge ? (React.createElement(BadgeWrapper, null,
37
37
  props.label,
@@ -0,0 +1 @@
1
+ export { useSpeechAIRecorder } from './useSpeechAIRecorder';
@@ -0,0 +1 @@
1
+ export { useSpeechAIRecorder } from './useSpeechAIRecorder';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ url: string;
4
+ }
5
+ declare const SpeechAIAudioInput: (props: IProps) => React.JSX.Element;
6
+ export { SpeechAIAudioInput };
@@ -1,8 +1,8 @@
1
1
  import React, { useState } from 'react';
2
- import { useAssemblyAIRecorder } from '../useAssemblyAIRecorder';
3
- var AssemblyAudioInput = function (props) {
2
+ import { useSpeechAIRecorder } from '../useSpeechAIRecorder';
3
+ var SpeechAIAudioInput = function (props) {
4
4
  var _a = useState('initial'), transcript = _a[0], setTranscript = _a[1];
5
- var _b = useAssemblyAIRecorder(props.url, setTranscript), recordingStatus = _b.recordingStatus, toggleRecording = _b.toggleRecording;
5
+ var _b = useSpeechAIRecorder(props.url, setTranscript), recordingStatus = _b.recordingStatus, toggleRecording = _b.toggleRecording;
6
6
  var getLabel = function (recordingStatus) {
7
7
  switch (recordingStatus) {
8
8
  case 'connecting': return "Connecting";
@@ -14,4 +14,4 @@ var AssemblyAudioInput = function (props) {
14
14
  React.createElement("button", { onClick: toggleRecording }, getLabel(recordingStatus)),
15
15
  React.createElement("p", { style: { border: 'solid 1px blue', minHeight: '200px', color: 'white' } }, transcript)));
16
16
  };
17
- export { AssemblyAudioInput };
17
+ export { SpeechAIAudioInput };
@@ -0,0 +1,29 @@
1
+ type TranscriptCallback = (text: string) => void;
2
+ type TRecordingStatus = 'idle' | 'connecting' | 'recording';
3
+ /**
4
+ * useSpeechAIRecorder
5
+ *
6
+ * A custom React hook for real-time audio transcription. The current
7
+ * implementation streams audio over a WebSocket to AssemblyAI's v3 streaming
8
+ * endpoint, having first obtained a temporary token from the supplied
9
+ * back-end URL. Switching providers would mean rewriting this hook's
10
+ * networking — the public interface is provider-agnostic.
11
+ *
12
+ * When recording is toggled on, it takes a few moments to establish a
13
+ * WebSocket connection. During this time, the recording status will be
14
+ * `'connecting'`.
15
+ *
16
+ * @param url - Back-end URL for obtaining a temporary streaming token.
17
+ * @param onTranscript - Callback that receives updated transcript text.
18
+ * @returns An object containing:
19
+ * - recordingStatus: 'idle' | 'connecting' | 'recording'
20
+ * - toggleRecording: function to start or stop recording
21
+ *
22
+ * The `SpeechManager` singleton tracks the active recorder; when a new
23
+ * recording is started, the previous one is stopped.
24
+ */
25
+ declare const useSpeechAIRecorder: (url: string, onTranscript: TranscriptCallback, authToken?: string) => {
26
+ recordingStatus: TRecordingStatus;
27
+ toggleRecording: () => Promise<void>;
28
+ };
29
+ export { useSpeechAIRecorder, TRecordingStatus };
@@ -46,26 +46,28 @@ import { SpeechManager } from './SpeechManager';
46
46
  //
47
47
  var moduleScript = /* js */ "\nconst MAX_16BIT_INT = 32767\nclass AudioProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n\n // Input is browser sample rate (typically 48000 Hz in Firefox)\n // This variable is globally available inside the AudioWorkletProcessor\n // scope.\n this.inputSampleRate = sampleRate;\n console.log('Detected input sample rate:', sampleRate);\n this.targetSampleRate = 16000;\n this.ratio = this.inputSampleRate / this.targetSampleRate;\n\n // Buffer of input samples for resampling\n this.buffer = [];\n\n // Number of samples per output chunk\n this.chunkSize = 1600; // ~100ms at 16kHz\n }\n\n /**\n * Resample the input buffer to the target sample rate using linear interpolation.\n */\n resample(inputBuffer) {\n const outputLength = Math.floor(inputBuffer.length / this.ratio);\n const output = new Float32Array(outputLength);\n\n for (let i = 0; i < outputLength; i++) {\n const idx = i * this.ratio;\n const idxInt = Math.floor(idx);\n const idxFrac = idx - idxInt;\n\n const sample1 = inputBuffer[idxInt] || 0;\n const sample2 = inputBuffer[idxInt + 1] || 0;\n output[i] = sample1 + (sample2 - sample1) * idxFrac;\n }\n\n return output;\n }\n\n /**\n * Converts Float32 PCM [-1, 1] to 16-bit signed PCM\n */\n floatTo16BitPCM(float32Array) {\n const int16Array = new Int16Array(float32Array.length);\n for (let i = 0; i < float32Array.length; i++) {\n let s = Math.max(-1, Math.min(1, float32Array[i]));\n int16Array[i] = s < 0 ? s * 0x8000 : s * 0x7FFF;\n }\n return int16Array;\n }\n\n /**\n * Called automatically by browser on each audio frame (128 samples per channel).\n */\n process(inputs, outputs, parameters) {\n try {\n const input = inputs[0];\n if (!input || input.length === 0) return true;\n\n // Read from mono channel\n const channelData = input[0];\n this.buffer.push(...channelData);\n\n // Only process if we have enough input to produce a full output chunk\n const neededInputSamples = this.chunkSize * this.ratio;\n if (this.buffer.length >= neededInputSamples) {\n const inputForChunk = this.buffer.slice(0, neededInputSamples);\n const resampled = this.resample(inputForChunk);\n const pcm = this.floatTo16BitPCM(resampled);\n\n this.port.postMessage({ audio_data: pcm }); // Send Int16Array to main thread\n\n // Remove consumed input samples\n this.buffer = this.buffer.slice(neededInputSamples);\n }\n\n return true; // Keep processor alive\n } catch (error) {\n console.error(error)\n return false\n }\n }\n}\n\nregisterProcessor('audio-processor', AudioProcessor);\n";
48
48
  /**
49
- * useAssemblyAIRecorder
49
+ * useSpeechAIRecorder
50
50
  *
51
- * A custom React hook for real-time audio transcription using AssemblyAI's
52
- * streaming API.
51
+ * A custom React hook for real-time audio transcription. The current
52
+ * implementation streams audio over a WebSocket to AssemblyAI's v3 streaming
53
+ * endpoint, having first obtained a temporary token from the supplied
54
+ * back-end URL. Switching providers would mean rewriting this hook's
55
+ * networking — the public interface is provider-agnostic.
53
56
  *
54
- * When recording is toggled on, it takes a few moments to establish a web
55
- * socket connection. During this time, the recording status will be
57
+ * When recording is toggled on, it takes a few moments to establish a
58
+ * WebSocket connection. During this time, the recording status will be
56
59
  * `'connecting'`.
57
60
  *
58
- * @param url - Back-end URL for obtaining temporary token
61
+ * @param url - Back-end URL for obtaining a temporary streaming token.
59
62
  * @param onTranscript - Callback that receives updated transcript text.
60
63
  * @returns An object containing:
61
64
  * - recordingStatus: 'idle' | 'connecting' | 'recording'
62
65
  * - toggleRecording: function to start or stop recording
63
66
  *
64
- * The `SpeechManager` singleton is use to keep track of which
65
- * AssemblyAIRecorder is currently recording; when a new recording is started,
66
- * the current one is stopped.
67
+ * The `SpeechManager` singleton tracks the active recorder; when a new
68
+ * recording is started, the previous one is stopped.
67
69
  */
68
- var useAssemblyAIRecorder = function (url, onTranscript, authToken) {
70
+ var useSpeechAIRecorder = function (url, onTranscript, authToken) {
69
71
  // State to track the current recording status
70
72
  var _a = useState('idle'), recordingStatus = _a[0], setRecordingStatus = _a[1];
71
73
  // WebSocket connection to AssemblyAI
@@ -294,4 +296,4 @@ var useAssemblyAIRecorder = function (url, onTranscript, authToken) {
294
296
  toggleRecording: toggleRecording,
295
297
  };
296
298
  };
297
- export { useAssemblyAIRecorder };
299
+ export { useSpeechAIRecorder };
@@ -0,0 +1 @@
1
+ export { useTextAIStream } from './useTextAIStream';
@@ -0,0 +1 @@
1
+ export { useTextAIStream } from './useTextAIStream';
@@ -5,7 +5,7 @@ interface IProps {
5
5
  */
6
6
  url: string;
7
7
  /**
8
- * Prompt to send to OpenAI.
8
+ * Prompt to send.
9
9
  */
10
10
  prompt: string;
11
11
  /**
@@ -19,5 +19,5 @@ interface IProps {
19
19
  */
20
20
  top_p?: number;
21
21
  }
22
- declare const OpenAIStreamInput: (props: IProps) => React.JSX.Element;
23
- export { OpenAIStreamInput };
22
+ declare const TextAIStreamInput: (props: IProps) => React.JSX.Element;
23
+ export { TextAIStreamInput };
@@ -35,16 +35,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import React, { useState } from 'react';
38
- import { useOpenAIStream } from '../useOpenAIStream';
39
- var OpenAIStreamInput = function (props) {
40
- var streamOpenAI = useOpenAIStream(props.url).stream;
38
+ import { useTextAIStream } from '../useTextAIStream';
39
+ var TextAIStreamInput = function (props) {
40
+ var stream = useTextAIStream(props.url).stream;
41
41
  var _a = useState(""), result = _a[0], setResult = _a[1];
42
42
  var handleClick = function () { return __awaiter(void 0, void 0, void 0, function () {
43
43
  return __generator(this, function (_a) {
44
44
  switch (_a.label) {
45
45
  case 0:
46
46
  setResult("");
47
- return [4 /*yield*/, streamOpenAI(props.prompt, function (chunk) { return __awaiter(void 0, void 0, void 0, function () {
47
+ return [4 /*yield*/, stream(props.prompt, function (chunk) { return __awaiter(void 0, void 0, void 0, function () {
48
48
  return __generator(this, function (_a) {
49
49
  setResult(function (prev) { return prev + chunk; });
50
50
  return [2 /*return*/];
@@ -60,7 +60,7 @@ var OpenAIStreamInput = function (props) {
60
60
  React.createElement("div", null,
61
61
  "Prompt: ",
62
62
  props.prompt),
63
- React.createElement("button", { onClick: handleClick }, "Call OpenAI"),
63
+ React.createElement("button", { onClick: handleClick }, "Stream"),
64
64
  React.createElement("p", { style: { border: 'solid 1px blue', minHeight: '200px', color: 'white' } }, result)));
65
65
  };
66
- export { OpenAIStreamInput };
66
+ export { TextAIStreamInput };
@@ -0,0 +1,26 @@
1
+ interface ITextAIStreamOptions {
2
+ temperature: number;
3
+ top_p: number;
4
+ }
5
+ /**
6
+ * Hook to stream text from a backend AI endpoint.
7
+ *
8
+ * The backend is expected to relay/translate its provider's output into
9
+ * OpenAI chat-completions Server-Sent Events:
10
+ *
11
+ * data: {"choices":[{"delta":{"content":"..."}}]}\n\n
12
+ * ...
13
+ * data: [DONE]\n\n
14
+ *
15
+ * This is the de-facto streaming format and is provider-agnostic in practice
16
+ * (many vendors expose OpenAI-compatible endpoints). Backends that wrap other
17
+ * providers (e.g. Anthropic) should translate their native SSE into this
18
+ * shape so the hook stays unchanged.
19
+ *
20
+ * @returns `stream`: a function that takes a prompt and streaming callback.
21
+ */
22
+ declare const useTextAIStream: (url: string, authToken?: string) => {
23
+ stream: (prompt: string, onText: (text: string) => Promise<void>, options?: ITextAIStreamOptions) => Promise<void>;
24
+ cancel: () => void;
25
+ };
26
+ export { useTextAIStream, ITextAIStreamOptions };
@@ -45,11 +45,23 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
45
45
  };
46
46
  import { useCallback, useRef } from 'react';
47
47
  /**
48
- * Hook to stream OpenAI responses via a backend endpoint that acts as a proxy.
48
+ * Hook to stream text from a backend AI endpoint.
49
+ *
50
+ * The backend is expected to relay/translate its provider's output into
51
+ * OpenAI chat-completions Server-Sent Events:
52
+ *
53
+ * data: {"choices":[{"delta":{"content":"..."}}]}\n\n
54
+ * ...
55
+ * data: [DONE]\n\n
56
+ *
57
+ * This is the de-facto streaming format and is provider-agnostic in practice
58
+ * (many vendors expose OpenAI-compatible endpoints). Backends that wrap other
59
+ * providers (e.g. Anthropic) should translate their native SSE into this
60
+ * shape so the hook stays unchanged.
49
61
  *
50
62
  * @returns `stream`: a function that takes a prompt and streaming callback.
51
63
  */
52
- var useOpenAIStream = function (url, authToken) {
64
+ var useTextAIStream = function (url, authToken) {
53
65
  var abortRef = useRef(null);
54
66
  /**
55
67
  * Streams a prompt to a backend AI endpoint and handles streamed chunks.
@@ -92,7 +104,7 @@ var useOpenAIStream = function (url, authToken) {
92
104
  case 1:
93
105
  response = _f.sent();
94
106
  if (!response.ok) {
95
- console.error("OpenAI stream request failed: ".concat(response.statusText));
107
+ console.error("Text AI stream request failed: ".concat(response.statusText));
96
108
  return [2 /*return*/];
97
109
  }
98
110
  if (!response.body) {
@@ -159,4 +171,4 @@ var useOpenAIStream = function (url, authToken) {
159
171
  }, []);
160
172
  return { stream: stream, cancel: cancel };
161
173
  };
162
- export { useOpenAIStream };
174
+ export { useTextAIStream };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IDateInputProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IDateInputProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /**
@@ -64,10 +65,6 @@ interface IDateInputProps {
64
65
  * Listeners are notified when the Input receives focus.
65
66
  */
66
67
  onFocus?: () => void;
67
- /**
68
- * Test ID for Playwright/testing. Forwarded to the root DOM element.
69
- */
70
- 'data-testid'?: string;
71
68
  }
72
69
  declare const DateInput: {
73
70
  ({ direction, noTabIndex, disabled, transparent, fluid, error, clearable, nofuture, ...props }: IDateInputProps): React.JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- interface IDropdownProps {
2
+ import { ITestable } from '../../Types';
3
+ interface IDropdownProps extends ITestable {
3
4
  /** @ignore */
4
5
  className?: string;
5
6
  /** @ignore */
@@ -112,10 +113,6 @@ interface IDropdownProps {
112
113
  * is closed.
113
114
  */
114
115
  onClose?: () => void;
115
- /**
116
- * Test ID for Playwright/testing. Forwarded to the root DOM element.
117
- */
118
- 'data-testid'?: string;
119
116
  }
120
117
  /**
121
118
  * A `Dropdown` is a replacement for `<select>` (select). It opens upwards or