@uipath/apollo-wind 2.55.0 → 2.57.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 (111) hide show
  1. package/dist/components/ui/combobox.cjs +33 -15
  2. package/dist/components/ui/combobox.js +33 -15
  3. package/dist/components/ui/date-picker.cjs +62 -26
  4. package/dist/components/ui/date-picker.js +62 -26
  5. package/dist/components/ui/datetime-picker.cjs +29 -12
  6. package/dist/components/ui/datetime-picker.js +29 -12
  7. package/dist/components/ui/dropdown-menu.cjs +12 -8
  8. package/dist/components/ui/dropdown-menu.js +12 -8
  9. package/dist/components/ui/field-actions/ai-assist-action.cjs +121 -0
  10. package/dist/components/ui/field-actions/ai-assist-action.d.ts +21 -0
  11. package/dist/components/ui/field-actions/ai-assist-action.js +84 -0
  12. package/dist/components/ui/field-actions/collapse.cjs +44 -0
  13. package/dist/components/ui/field-actions/collapse.d.ts +6 -0
  14. package/dist/components/ui/field-actions/collapse.js +4 -0
  15. package/dist/components/ui/field-actions/index.cjs +46 -0
  16. package/dist/components/ui/field-actions/index.d.ts +2 -0
  17. package/dist/components/ui/field-actions/index.js +3 -0
  18. package/dist/components/ui/field-actions/insert-variable-action.cjs +94 -0
  19. package/dist/components/ui/field-actions/insert-variable-action.d.ts +22 -0
  20. package/dist/components/ui/field-actions/insert-variable-action.js +57 -0
  21. package/dist/components/ui/field-addons/index.cjs +50 -0
  22. package/dist/components/ui/field-addons/index.d.ts +3 -0
  23. package/dist/components/ui/field-addons/index.js +4 -0
  24. package/dist/components/ui/field-addons/value-mode-indicator.cjs +57 -0
  25. package/dist/components/ui/field-addons/value-mode-indicator.d.ts +13 -0
  26. package/dist/components/ui/field-addons/value-mode-indicator.js +23 -0
  27. package/dist/components/ui/field-addons/value-mode-menu.cjs +149 -0
  28. package/dist/components/ui/field-addons/value-mode-menu.d.ts +69 -0
  29. package/dist/components/ui/field-addons/value-mode-menu.js +112 -0
  30. package/dist/components/ui/field-addons/value-mode-strings.cjs +69 -0
  31. package/dist/components/ui/field-addons/value-mode-strings.d.ts +32 -0
  32. package/dist/components/ui/field-addons/value-mode-strings.js +29 -0
  33. package/dist/components/ui/form-field.cjs +42 -5
  34. package/dist/components/ui/form-field.d.ts +21 -1
  35. package/dist/components/ui/form-field.js +36 -2
  36. package/dist/components/ui/index.cjs +156 -126
  37. package/dist/components/ui/index.d.ts +3 -0
  38. package/dist/components/ui/index.js +3 -0
  39. package/dist/components/ui/input-group-context.cjs +91 -0
  40. package/dist/components/ui/input-group-context.d.ts +69 -0
  41. package/dist/components/ui/input-group-context.js +42 -0
  42. package/dist/components/ui/input-group.cjs +303 -56
  43. package/dist/components/ui/input-group.d.ts +70 -3
  44. package/dist/components/ui/input-group.js +285 -56
  45. package/dist/components/ui/input.cjs +28 -17
  46. package/dist/components/ui/input.js +28 -17
  47. package/dist/components/ui/lockable-value-field/components/field-header.cjs +16 -114
  48. package/dist/components/ui/lockable-value-field/components/field-header.js +14 -112
  49. package/dist/components/ui/lockable-value-field/lockable-value-field.cjs +4 -12
  50. package/dist/components/ui/lockable-value-field/lockable-value-field.js +4 -12
  51. package/dist/components/ui/model-picker/ModelPicker.cjs +495 -0
  52. package/dist/components/ui/model-picker/ModelPicker.d.ts +304 -0
  53. package/dist/components/ui/model-picker/ModelPicker.js +451 -0
  54. package/dist/components/ui/model-picker/ModelTagChip.cjs +101 -0
  55. package/dist/components/ui/model-picker/ModelTagChip.d.ts +29 -0
  56. package/dist/components/ui/model-picker/ModelTagChip.js +67 -0
  57. package/dist/components/ui/model-picker/badges.cjs +52 -0
  58. package/dist/components/ui/model-picker/badges.d.ts +41 -0
  59. package/dist/components/ui/model-picker/badges.js +18 -0
  60. package/dist/components/ui/model-picker/index.cjs +117 -0
  61. package/dist/components/ui/model-picker/index.d.ts +27 -0
  62. package/dist/components/ui/model-picker/index.js +14 -0
  63. package/dist/components/ui/model-picker/labels.cjs +107 -0
  64. package/dist/components/ui/model-picker/labels.d.ts +81 -0
  65. package/dist/components/ui/model-picker/labels.js +67 -0
  66. package/dist/components/ui/model-picker/primitives/FolderSwitcher.cjs +108 -0
  67. package/dist/components/ui/model-picker/primitives/FolderSwitcher.d.ts +38 -0
  68. package/dist/components/ui/model-picker/primitives/FolderSwitcher.js +74 -0
  69. package/dist/components/ui/model-picker/primitives/GroupHeader.cjs +84 -0
  70. package/dist/components/ui/model-picker/primitives/GroupHeader.d.ts +64 -0
  71. package/dist/components/ui/model-picker/primitives/GroupHeader.js +50 -0
  72. package/dist/components/ui/model-picker/primitives/ModelOptionRow.cjs +178 -0
  73. package/dist/components/ui/model-picker/primitives/ModelOptionRow.d.ts +95 -0
  74. package/dist/components/ui/model-picker/primitives/ModelOptionRow.js +135 -0
  75. package/dist/components/ui/model-picker/primitives/OptionList.cjs +295 -0
  76. package/dist/components/ui/model-picker/primitives/OptionList.d.ts +87 -0
  77. package/dist/components/ui/model-picker/primitives/OptionList.js +242 -0
  78. package/dist/components/ui/{lockable-value-field/components/mode-menu-item.cjs → model-picker/primitives/PickerPopup.cjs} +25 -24
  79. package/dist/components/ui/model-picker/primitives/PickerPopup.d.ts +39 -0
  80. package/dist/components/ui/model-picker/primitives/PickerPopup.js +30 -0
  81. package/dist/components/ui/model-picker/primitives/PickerSearchInput.cjs +77 -0
  82. package/dist/components/ui/model-picker/primitives/PickerSearchInput.d.ts +43 -0
  83. package/dist/components/ui/model-picker/primitives/PickerSearchInput.js +43 -0
  84. package/dist/components/ui/model-picker/primitives/PickerTrigger.cjs +112 -0
  85. package/dist/components/ui/model-picker/primitives/PickerTrigger.d.ts +73 -0
  86. package/dist/components/ui/model-picker/primitives/PickerTrigger.js +78 -0
  87. package/dist/components/ui/model-picker/types.cjs +18 -0
  88. package/dist/components/ui/model-picker/types.d.ts +154 -0
  89. package/dist/components/ui/model-picker/types.js +0 -0
  90. package/dist/components/ui/model-picker/useModelPickerState.cjs +250 -0
  91. package/dist/components/ui/model-picker/useModelPickerState.d.ts +135 -0
  92. package/dist/components/ui/model-picker/useModelPickerState.js +216 -0
  93. package/dist/components/ui/model-picker/utils.cjs +327 -0
  94. package/dist/components/ui/model-picker/utils.d.ts +121 -0
  95. package/dist/components/ui/model-picker/utils.js +272 -0
  96. package/dist/components/ui/multi-select.cjs +82 -58
  97. package/dist/components/ui/multi-select.js +84 -60
  98. package/dist/components/ui/popover.cjs +13 -9
  99. package/dist/components/ui/popover.js +13 -9
  100. package/dist/components/ui/select.cjs +89 -27
  101. package/dist/components/ui/select.d.ts +4 -0
  102. package/dist/components/ui/select.js +90 -28
  103. package/dist/components/ui/textarea.cjs +16 -11
  104. package/dist/components/ui/textarea.js +16 -11
  105. package/dist/index.cjs +144 -21
  106. package/dist/index.d.ts +10 -4
  107. package/dist/index.js +6 -3
  108. package/dist/styles.css +350 -5
  109. package/package.json +2 -1
  110. package/dist/components/ui/lockable-value-field/components/mode-menu-item.d.ts +0 -9
  111. package/dist/components/ui/lockable-value-field/components/mode-menu-item.js +0 -29
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ MODEL_BADGES: ()=>MODEL_BADGES
28
+ });
29
+ const MODEL_BADGES = {
30
+ 'cost-basic': {
31
+ label: 'costBasic',
32
+ tooltip: 'costTooltip',
33
+ variant: 'mini'
34
+ },
35
+ 'cost-standard': {
36
+ label: 'costStandard',
37
+ tooltip: 'costTooltip',
38
+ variant: 'mini'
39
+ },
40
+ 'cost-premium': {
41
+ label: 'costPremium',
42
+ tooltip: 'costTooltip',
43
+ variant: 'mini'
44
+ }
45
+ };
46
+ exports.MODEL_BADGES = __webpack_exports__.MODEL_BADGES;
47
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
48
+ "MODEL_BADGES"
49
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
50
+ Object.defineProperty(exports, '__esModule', {
51
+ value: true
52
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The Apollo badge pool.
3
+ *
4
+ * Products do not invent their own badge kinds: they stamp badges from
5
+ * this shared pool (via the `badgesFor` prop), and grow the pool here
6
+ * when a new badge is needed. That keeps labels, colors, and semantics
7
+ * consistent across every product surface, and every pool label is
8
+ * localized once, centrally.
9
+ *
10
+ * Adding a badge is a design-system PR: one entry below plus its
11
+ * entry in `labels.ts`. The pool starts with the cost tiers
12
+ * (Basic / Standard / Premium).
13
+ *
14
+ * `customTagsFor` remains as an escape hatch for experiments, but the
15
+ * expectation is that anything worth shipping graduates into the pool.
16
+ */
17
+ import type { StaticLabelKey } from './labels';
18
+ /** Kinds available in the pool. Grows by design-system PR. */
19
+ export type ModelBadgeKind = 'cost-basic' | 'cost-standard' | 'cost-premium';
20
+ export interface ModelBadgeDefinition {
21
+ /**
22
+ * Which label the chip renders. A key rather than a string, so the pool
23
+ * stays declarative and the host's `labels` supply the wording.
24
+ */
25
+ label: StaticLabelKey;
26
+ /** Optional tooltip, same indirection. */
27
+ tooltip?: StaticLabelKey;
28
+ /**
29
+ * Semantic chip variant (`mini | info-mini | success-mini |
30
+ * warning-mini | error-mini`). These are the same tokens the
31
+ * apollo-react picker uses, so the prop surface matches; `ModelTagChip`
32
+ * maps them onto wind `Badge` variants.
33
+ */
34
+ variant: string;
35
+ }
36
+ /**
37
+ * Cost tiers render as neutral gray mini chips deliberately: the
38
+ * semantic warning/error palette would imply that high-cost models are
39
+ * risky, which they are not.
40
+ */
41
+ export declare const MODEL_BADGES: Record<ModelBadgeKind, ModelBadgeDefinition>;
@@ -0,0 +1,18 @@
1
+ const MODEL_BADGES = {
2
+ 'cost-basic': {
3
+ label: 'costBasic',
4
+ tooltip: 'costTooltip',
5
+ variant: 'mini'
6
+ },
7
+ 'cost-standard': {
8
+ label: 'costStandard',
9
+ tooltip: 'costTooltip',
10
+ variant: 'mini'
11
+ },
12
+ 'cost-premium': {
13
+ label: 'costPremium',
14
+ tooltip: 'costTooltip',
15
+ variant: 'mini'
16
+ }
17
+ };
18
+ export { MODEL_BADGES };
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ ModelTagChip: ()=>external_ModelTagChip_cjs_namespaceObject.ModelTagChip,
28
+ PickerSearchInput: ()=>PickerSearchInput_cjs_namespaceObject.PickerSearchInput,
29
+ defaultRowActions: ()=>ModelOptionRow_cjs_namespaceObject.defaultRowActions,
30
+ deriveModelTags: ()=>external_utils_cjs_namespaceObject.deriveModelTags,
31
+ filterModels: ()=>external_utils_cjs_namespaceObject.filterModels,
32
+ ModelOptionRow: ()=>ModelOptionRow_cjs_namespaceObject.ModelOptionRow,
33
+ formatContextWindow: ()=>external_labels_cjs_namespaceObject.formatContextWindow,
34
+ getSubstitutionTarget: ()=>external_utils_cjs_namespaceObject.getSubstitutionTarget,
35
+ groupModels: ()=>external_utils_cjs_namespaceObject.groupModels,
36
+ useModelPickerState: ()=>external_useModelPickerState_cjs_namespaceObject.useModelPickerState,
37
+ FolderSwitcher: ()=>FolderSwitcher_cjs_namespaceObject.FolderSwitcher,
38
+ defaultCostTier: ()=>external_utils_cjs_namespaceObject.defaultCostTier,
39
+ resolveHomeGeography: ()=>external_utils_cjs_namespaceObject.resolveHomeGeography,
40
+ PickerTrigger: ()=>PickerTrigger_cjs_namespaceObject.PickerTrigger,
41
+ isTextGenerationModel: ()=>external_utils_cjs_namespaceObject.isTextGenerationModel,
42
+ GroupedOptionList: ()=>OptionList_cjs_namespaceObject.GroupedOptionList,
43
+ GroupHeader: ()=>GroupHeader_cjs_namespaceObject.GroupHeader,
44
+ MODEL_BADGES: ()=>external_badges_cjs_namespaceObject.MODEL_BADGES,
45
+ optionDomId: ()=>OptionList_cjs_namespaceObject.optionDomId,
46
+ DEFAULT_MODEL_PICKER_LABELS: ()=>external_labels_cjs_namespaceObject.DEFAULT_MODEL_PICKER_LABELS,
47
+ PickerPopup: ()=>PickerPopup_cjs_namespaceObject.PickerPopup,
48
+ ModelPicker: ()=>external_ModelPicker_cjs_namespaceObject.ModelPicker,
49
+ VirtualOptionList: ()=>OptionList_cjs_namespaceObject.VirtualOptionList,
50
+ resolveLabels: ()=>external_labels_cjs_namespaceObject.resolveLabels
51
+ });
52
+ const external_badges_cjs_namespaceObject = require("./badges.cjs");
53
+ const external_labels_cjs_namespaceObject = require("./labels.cjs");
54
+ const external_ModelPicker_cjs_namespaceObject = require("./ModelPicker.cjs");
55
+ const external_ModelTagChip_cjs_namespaceObject = require("./ModelTagChip.cjs");
56
+ const FolderSwitcher_cjs_namespaceObject = require("./primitives/FolderSwitcher.cjs");
57
+ const GroupHeader_cjs_namespaceObject = require("./primitives/GroupHeader.cjs");
58
+ const ModelOptionRow_cjs_namespaceObject = require("./primitives/ModelOptionRow.cjs");
59
+ const OptionList_cjs_namespaceObject = require("./primitives/OptionList.cjs");
60
+ const PickerPopup_cjs_namespaceObject = require("./primitives/PickerPopup.cjs");
61
+ const PickerSearchInput_cjs_namespaceObject = require("./primitives/PickerSearchInput.cjs");
62
+ const PickerTrigger_cjs_namespaceObject = require("./primitives/PickerTrigger.cjs");
63
+ const external_useModelPickerState_cjs_namespaceObject = require("./useModelPickerState.cjs");
64
+ const external_utils_cjs_namespaceObject = require("./utils.cjs");
65
+ exports.DEFAULT_MODEL_PICKER_LABELS = __webpack_exports__.DEFAULT_MODEL_PICKER_LABELS;
66
+ exports.FolderSwitcher = __webpack_exports__.FolderSwitcher;
67
+ exports.GroupHeader = __webpack_exports__.GroupHeader;
68
+ exports.GroupedOptionList = __webpack_exports__.GroupedOptionList;
69
+ exports.MODEL_BADGES = __webpack_exports__.MODEL_BADGES;
70
+ exports.ModelOptionRow = __webpack_exports__.ModelOptionRow;
71
+ exports.ModelPicker = __webpack_exports__.ModelPicker;
72
+ exports.ModelTagChip = __webpack_exports__.ModelTagChip;
73
+ exports.PickerPopup = __webpack_exports__.PickerPopup;
74
+ exports.PickerSearchInput = __webpack_exports__.PickerSearchInput;
75
+ exports.PickerTrigger = __webpack_exports__.PickerTrigger;
76
+ exports.VirtualOptionList = __webpack_exports__.VirtualOptionList;
77
+ exports.defaultCostTier = __webpack_exports__.defaultCostTier;
78
+ exports.defaultRowActions = __webpack_exports__.defaultRowActions;
79
+ exports.deriveModelTags = __webpack_exports__.deriveModelTags;
80
+ exports.filterModels = __webpack_exports__.filterModels;
81
+ exports.formatContextWindow = __webpack_exports__.formatContextWindow;
82
+ exports.getSubstitutionTarget = __webpack_exports__.getSubstitutionTarget;
83
+ exports.groupModels = __webpack_exports__.groupModels;
84
+ exports.isTextGenerationModel = __webpack_exports__.isTextGenerationModel;
85
+ exports.optionDomId = __webpack_exports__.optionDomId;
86
+ exports.resolveHomeGeography = __webpack_exports__.resolveHomeGeography;
87
+ exports.resolveLabels = __webpack_exports__.resolveLabels;
88
+ exports.useModelPickerState = __webpack_exports__.useModelPickerState;
89
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
90
+ "DEFAULT_MODEL_PICKER_LABELS",
91
+ "FolderSwitcher",
92
+ "GroupHeader",
93
+ "GroupedOptionList",
94
+ "MODEL_BADGES",
95
+ "ModelOptionRow",
96
+ "ModelPicker",
97
+ "ModelTagChip",
98
+ "PickerPopup",
99
+ "PickerSearchInput",
100
+ "PickerTrigger",
101
+ "VirtualOptionList",
102
+ "defaultCostTier",
103
+ "defaultRowActions",
104
+ "deriveModelTags",
105
+ "filterModels",
106
+ "formatContextWindow",
107
+ "getSubstitutionTarget",
108
+ "groupModels",
109
+ "isTextGenerationModel",
110
+ "optionDomId",
111
+ "resolveHomeGeography",
112
+ "resolveLabels",
113
+ "useModelPickerState"
114
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
115
+ Object.defineProperty(exports, '__esModule', {
116
+ value: true
117
+ });
@@ -0,0 +1,27 @@
1
+ export type { ModelBadgeDefinition, ModelBadgeKind } from './badges';
2
+ export { MODEL_BADGES } from './badges';
3
+ export type { ModelPickerLabels, StaticLabelKey } from './labels';
4
+ export { DEFAULT_MODEL_PICKER_LABELS, formatContextWindow, resolveLabels } from './labels';
5
+ export type { ModelPickerChangeHandler, ModelPickerProps, ModelPickerSlotContext, ModelPickerSlots, ModelPickerVariant, } from './ModelPicker';
6
+ export { ModelPicker } from './ModelPicker';
7
+ export type { ModelTagChipProps } from './ModelTagChip';
8
+ export { ModelTagChip } from './ModelTagChip';
9
+ export type { FolderSwitcherFolder, FolderSwitcherProps } from './primitives/FolderSwitcher';
10
+ export { FolderSwitcher } from './primitives/FolderSwitcher';
11
+ export type { GroupHeaderProps } from './primitives/GroupHeader';
12
+ export { GroupHeader } from './primitives/GroupHeader';
13
+ export type { ModelOptionRowProps } from './primitives/ModelOptionRow';
14
+ export { defaultRowActions, ModelOptionRow } from './primitives/ModelOptionRow';
15
+ export type { AnnotatedModel, OptionListProps } from './primitives/OptionList';
16
+ export { GroupedOptionList, optionDomId, VirtualOptionList } from './primitives/OptionList';
17
+ export type { PickerPopupProps } from './primitives/PickerPopup';
18
+ export { PickerPopup } from './primitives/PickerPopup';
19
+ export type { PickerSearchInputProps } from './primitives/PickerSearchInput';
20
+ export { PickerSearchInput } from './primitives/PickerSearchInput';
21
+ export type { PickerTriggerProps } from './primitives/PickerTrigger';
22
+ export { PickerTrigger } from './primitives/PickerTrigger';
23
+ export type { ByomDetails, CostTier, DeprecationDetails, DiscoveryModel, ModelCostDetails, ModelFlatCosts, ModelTieredCost, ModelType, ModelDetails, ModelGeography, ModelGroup, ModelSubscriptionType, ModelTag, ModelTagKind, ModelVendor, RoutingDetails, } from './types';
24
+ export type { UseModelPickerStateOptions, UseModelPickerStateResult } from './useModelPickerState';
25
+ export { useModelPickerState } from './useModelPickerState';
26
+ export type { DeriveModelTagsContext, GroupModelsContext, GroupStrategy } from './utils';
27
+ export { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, isTextGenerationModel, resolveHomeGeography, } from './utils';
@@ -0,0 +1,14 @@
1
+ import { MODEL_BADGES } from "./badges.js";
2
+ import { DEFAULT_MODEL_PICKER_LABELS, formatContextWindow, resolveLabels } from "./labels.js";
3
+ import { ModelPicker } from "./ModelPicker.js";
4
+ import { ModelTagChip } from "./ModelTagChip.js";
5
+ import { FolderSwitcher } from "./primitives/FolderSwitcher.js";
6
+ import { GroupHeader } from "./primitives/GroupHeader.js";
7
+ import { ModelOptionRow, defaultRowActions } from "./primitives/ModelOptionRow.js";
8
+ import { GroupedOptionList, VirtualOptionList, optionDomId } from "./primitives/OptionList.js";
9
+ import { PickerPopup } from "./primitives/PickerPopup.js";
10
+ import { PickerSearchInput } from "./primitives/PickerSearchInput.js";
11
+ import { PickerTrigger } from "./primitives/PickerTrigger.js";
12
+ import { useModelPickerState } from "./useModelPickerState.js";
13
+ import { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, isTextGenerationModel, resolveHomeGeography } from "./utils.js";
14
+ export { DEFAULT_MODEL_PICKER_LABELS, FolderSwitcher, GroupHeader, GroupedOptionList, MODEL_BADGES, ModelOptionRow, ModelPicker, ModelTagChip, PickerPopup, PickerSearchInput, PickerTrigger, VirtualOptionList, defaultCostTier, defaultRowActions, deriveModelTags, filterModels, formatContextWindow, getSubstitutionTarget, groupModels, isTextGenerationModel, optionDomId, resolveHomeGeography, resolveLabels, useModelPickerState };
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ DEFAULT_MODEL_PICKER_LABELS: ()=>DEFAULT_MODEL_PICKER_LABELS,
28
+ formatContextWindow: ()=>formatContextWindow,
29
+ resolveLabels: ()=>resolveLabels
30
+ });
31
+ function formatContextWindow(tokens) {
32
+ if (tokens >= 1000000) {
33
+ const m = tokens / 1000000;
34
+ return `${m % 1 === 0 ? m.toFixed(0) : m.toFixed(1)}M context`;
35
+ }
36
+ if (tokens >= 1000) return `${Math.round(tokens / 1000)}K context`;
37
+ return `${tokens} context`;
38
+ }
39
+ const DEFAULT_MODEL_PICKER_LABELS = {
40
+ fieldLabel: 'Model',
41
+ placeholder: 'Select a model',
42
+ searchPlaceholder: 'Search models',
43
+ listboxLabel: 'Models',
44
+ loading: 'Loading models',
45
+ emptyNoModels: 'No models available.',
46
+ emptyNoMatch: (query)=>`No models match "${query}".`,
47
+ resultCount: (count)=>`${count} ${1 === count ? 'model' : 'models'}`,
48
+ unknownValueTooltip: (value)=>`"${value}" is no longer available in this catalog. Pick a replacement to ensure your workflow continues to run.`,
49
+ recommendedTag: 'Recommended',
50
+ recommendedTagTooltip: 'Based on evaluation runs for this product',
51
+ previewTag: 'Preview',
52
+ customTag: 'Custom',
53
+ deprecatingTag: (date)=>`Deprecating ${date}`,
54
+ deprecatingTagTooltip: (replacement)=>`Will be replaced by ${replacement}`,
55
+ substitutedTag: (target)=>`Routes to ${target}`,
56
+ substitutedTagTooltip: (target)=>`This model is retired. Your traffic is currently being routed to ${target}. Update your configuration to make this explicit.`,
57
+ outOfRegionTag: (geography)=>`Out of region (${geography})`,
58
+ outOfRegionTagTooltip: (homeRegion)=>`Routes traffic outside ${homeRegion}`,
59
+ costBasic: 'Basic',
60
+ costStandard: 'Standard',
61
+ costPremium: 'Premium',
62
+ costTooltip: 'Relative cost tier for this product',
63
+ recommendedGroup: 'Recommended',
64
+ recommendedGroupHint: 'Based on evaluation runs for this product',
65
+ previewGroup: 'Preview',
66
+ previewGroupHint: 'Newer models in early access',
67
+ moreGroup: 'More models',
68
+ moreGroupHint: 'Available, not currently promoted by this product',
69
+ deprecatingGroup: 'Deprecating soon',
70
+ deprecatingGroupHint: 'Migrate before the usage end date',
71
+ byoGroup: 'Custom Models (BYO)',
72
+ byoGroupHint: 'Models you brought via your own connections',
73
+ otherGroup: 'Other',
74
+ allModelsGroup: 'All models',
75
+ modelCount: (count)=>`${count} ${1 === count ? 'model' : 'models'}`,
76
+ groupByAriaLabel: 'Group models by',
77
+ groupByCategory: 'Category',
78
+ groupByProvider: 'Provider',
79
+ allFolders: 'All folders',
80
+ editConfiguration: 'Edit configuration',
81
+ deleteConfiguration: 'Delete configuration',
82
+ deleteConfirmTitle: 'Delete custom model',
83
+ deleteConfirmMessage: (name)=>`This permanently deletes the "${name}" configuration for everyone in this tenant. This action cannot be undone.`,
84
+ deleteConfirmCancel: 'Cancel',
85
+ deleteConfirmConfirm: 'Delete',
86
+ useCustomModelTitle: 'Use custom model',
87
+ useCustomModelSubtitle: 'Bring a model from your own connection',
88
+ useCustomModelDisabledHint: 'Pass onUseCustomModel to wire this action.',
89
+ contextWindow: formatContextWindow
90
+ };
91
+ function resolveLabels(labels) {
92
+ return labels ? {
93
+ ...DEFAULT_MODEL_PICKER_LABELS,
94
+ ...labels
95
+ } : DEFAULT_MODEL_PICKER_LABELS;
96
+ }
97
+ exports.DEFAULT_MODEL_PICKER_LABELS = __webpack_exports__.DEFAULT_MODEL_PICKER_LABELS;
98
+ exports.formatContextWindow = __webpack_exports__.formatContextWindow;
99
+ exports.resolveLabels = __webpack_exports__.resolveLabels;
100
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
101
+ "DEFAULT_MODEL_PICKER_LABELS",
102
+ "formatContextWindow",
103
+ "resolveLabels"
104
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
105
+ Object.defineProperty(exports, '__esModule', {
106
+ value: true
107
+ });
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Every user-visible string the picker renders.
3
+ *
4
+ * The component is presentation-only: it holds no i18n machinery and resolves
5
+ * nothing itself. A host passes whatever its own catalog produced, and the
6
+ * English below fills in the rest — so an unlocalized host still renders real
7
+ * copy rather than raw keys.
8
+ *
9
+ * Strings that interpolate are functions rather than templates so a translator
10
+ * controls word order, which a `{name}`-style placeholder cannot express in
11
+ * every language.
12
+ */
13
+ export interface ModelPickerLabels {
14
+ fieldLabel: string;
15
+ placeholder: string;
16
+ searchPlaceholder: string;
17
+ listboxLabel: string;
18
+ loading: string;
19
+ emptyNoModels: string;
20
+ emptyNoMatch: (query: string) => string;
21
+ resultCount: (count: number) => string;
22
+ unknownValueTooltip: (value: string) => string;
23
+ recommendedTag: string;
24
+ recommendedTagTooltip: string;
25
+ previewTag: string;
26
+ customTag: string;
27
+ deprecatingTag: (date: string) => string;
28
+ deprecatingTagTooltip: (replacement: string) => string;
29
+ substitutedTag: (target: string) => string;
30
+ substitutedTagTooltip: (target: string) => string;
31
+ outOfRegionTag: (geography: string) => string;
32
+ outOfRegionTagTooltip: (homeRegion: string) => string;
33
+ costBasic: string;
34
+ costStandard: string;
35
+ costPremium: string;
36
+ costTooltip: string;
37
+ recommendedGroup: string;
38
+ recommendedGroupHint: string;
39
+ previewGroup: string;
40
+ previewGroupHint: string;
41
+ moreGroup: string;
42
+ moreGroupHint: string;
43
+ deprecatingGroup: string;
44
+ deprecatingGroupHint: string;
45
+ byoGroup: string;
46
+ byoGroupHint: string;
47
+ otherGroup: string;
48
+ allModelsGroup: string;
49
+ /** Right-aligned count on a section header. */
50
+ modelCount: (count: number) => string;
51
+ groupByAriaLabel: string;
52
+ groupByCategory: string;
53
+ groupByProvider: string;
54
+ allFolders: string;
55
+ editConfiguration: string;
56
+ deleteConfiguration: string;
57
+ deleteConfirmTitle: string;
58
+ deleteConfirmMessage: (name: string) => string;
59
+ deleteConfirmCancel: string;
60
+ deleteConfirmConfirm: string;
61
+ useCustomModelTitle: string;
62
+ useCustomModelSubtitle: string;
63
+ useCustomModelDisabledHint: string;
64
+ /** The context-window column, e.g. "1M context". */
65
+ contextWindow: (tokens: number) => string;
66
+ }
67
+ /**
68
+ * The label keys whose value is a plain string — the ones a declarative
69
+ * lookup (the badge pool) can name without knowing an argument to pass.
70
+ */
71
+ export type StaticLabelKey = {
72
+ [K in keyof ModelPickerLabels]: ModelPickerLabels[K] extends string ? K : never;
73
+ }[keyof ModelPickerLabels];
74
+ /**
75
+ * Format a token count the way the column reads: "1M context", "128K context".
76
+ * Exported so a host can reuse the rounding and only translate the suffix.
77
+ */
78
+ export declare function formatContextWindow(tokens: number): string;
79
+ export declare const DEFAULT_MODEL_PICKER_LABELS: ModelPickerLabels;
80
+ /** Fill the gaps in a host's partial override. */
81
+ export declare function resolveLabels(labels?: Partial<ModelPickerLabels>): ModelPickerLabels;
@@ -0,0 +1,67 @@
1
+ function formatContextWindow(tokens) {
2
+ if (tokens >= 1000000) {
3
+ const m = tokens / 1000000;
4
+ return `${m % 1 === 0 ? m.toFixed(0) : m.toFixed(1)}M context`;
5
+ }
6
+ if (tokens >= 1000) return `${Math.round(tokens / 1000)}K context`;
7
+ return `${tokens} context`;
8
+ }
9
+ const DEFAULT_MODEL_PICKER_LABELS = {
10
+ fieldLabel: 'Model',
11
+ placeholder: 'Select a model',
12
+ searchPlaceholder: 'Search models',
13
+ listboxLabel: 'Models',
14
+ loading: 'Loading models',
15
+ emptyNoModels: 'No models available.',
16
+ emptyNoMatch: (query)=>`No models match "${query}".`,
17
+ resultCount: (count)=>`${count} ${1 === count ? 'model' : 'models'}`,
18
+ unknownValueTooltip: (value)=>`"${value}" is no longer available in this catalog. Pick a replacement to ensure your workflow continues to run.`,
19
+ recommendedTag: 'Recommended',
20
+ recommendedTagTooltip: 'Based on evaluation runs for this product',
21
+ previewTag: 'Preview',
22
+ customTag: 'Custom',
23
+ deprecatingTag: (date)=>`Deprecating ${date}`,
24
+ deprecatingTagTooltip: (replacement)=>`Will be replaced by ${replacement}`,
25
+ substitutedTag: (target)=>`Routes to ${target}`,
26
+ substitutedTagTooltip: (target)=>`This model is retired. Your traffic is currently being routed to ${target}. Update your configuration to make this explicit.`,
27
+ outOfRegionTag: (geography)=>`Out of region (${geography})`,
28
+ outOfRegionTagTooltip: (homeRegion)=>`Routes traffic outside ${homeRegion}`,
29
+ costBasic: 'Basic',
30
+ costStandard: 'Standard',
31
+ costPremium: 'Premium',
32
+ costTooltip: 'Relative cost tier for this product',
33
+ recommendedGroup: 'Recommended',
34
+ recommendedGroupHint: 'Based on evaluation runs for this product',
35
+ previewGroup: 'Preview',
36
+ previewGroupHint: 'Newer models in early access',
37
+ moreGroup: 'More models',
38
+ moreGroupHint: 'Available, not currently promoted by this product',
39
+ deprecatingGroup: 'Deprecating soon',
40
+ deprecatingGroupHint: 'Migrate before the usage end date',
41
+ byoGroup: 'Custom Models (BYO)',
42
+ byoGroupHint: 'Models you brought via your own connections',
43
+ otherGroup: 'Other',
44
+ allModelsGroup: 'All models',
45
+ modelCount: (count)=>`${count} ${1 === count ? 'model' : 'models'}`,
46
+ groupByAriaLabel: 'Group models by',
47
+ groupByCategory: 'Category',
48
+ groupByProvider: 'Provider',
49
+ allFolders: 'All folders',
50
+ editConfiguration: 'Edit configuration',
51
+ deleteConfiguration: 'Delete configuration',
52
+ deleteConfirmTitle: 'Delete custom model',
53
+ deleteConfirmMessage: (name)=>`This permanently deletes the "${name}" configuration for everyone in this tenant. This action cannot be undone.`,
54
+ deleteConfirmCancel: 'Cancel',
55
+ deleteConfirmConfirm: 'Delete',
56
+ useCustomModelTitle: 'Use custom model',
57
+ useCustomModelSubtitle: 'Bring a model from your own connection',
58
+ useCustomModelDisabledHint: 'Pass onUseCustomModel to wire this action.',
59
+ contextWindow: formatContextWindow
60
+ };
61
+ function resolveLabels(labels) {
62
+ return labels ? {
63
+ ...DEFAULT_MODEL_PICKER_LABELS,
64
+ ...labels
65
+ } : DEFAULT_MODEL_PICKER_LABELS;
66
+ }
67
+ export { DEFAULT_MODEL_PICKER_LABELS, formatContextWindow, resolveLabels };
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ "use client";
3
+ var __webpack_require__ = {};
4
+ (()=>{
5
+ __webpack_require__.d = (exports1, definition)=>{
6
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ get: definition[key]
9
+ });
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.r = (exports1)=>{
17
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
+ value: 'Module'
19
+ });
20
+ Object.defineProperty(exports1, '__esModule', {
21
+ value: true
22
+ });
23
+ };
24
+ })();
25
+ var __webpack_exports__ = {};
26
+ __webpack_require__.r(__webpack_exports__);
27
+ __webpack_require__.d(__webpack_exports__, {
28
+ FolderSwitcher: ()=>FolderSwitcher
29
+ });
30
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_lucide_react_namespaceObject = require("lucide-react");
32
+ const external_react_namespaceObject = require("react");
33
+ const external_dropdown_menu_cjs_namespaceObject = require("../../dropdown-menu.cjs");
34
+ const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
35
+ const FolderSwitcher = ({ folders, value, onChange, allFoldersLabel = 'All folders', showAllFolders = true, container })=>{
36
+ const [open, setOpen] = external_react_namespaceObject.useState(false);
37
+ const current = folders.find((f)=>f.id === value);
38
+ const isAll = null == value;
39
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenu, {
40
+ modal: false,
41
+ onOpenChange: setOpen,
42
+ open: open,
43
+ children: [
44
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuTrigger, {
45
+ asChild: true,
46
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", {
47
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-popover px-3 py-1.5 text-xs leading-4 font-semibold text-brand hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
48
+ "data-slot": "model-picker-folder-switcher",
49
+ type: "button",
50
+ children: [
51
+ isAll ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.LayoutGrid, {
52
+ className: "size-3.5"
53
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Folder, {
54
+ className: "size-3.5"
55
+ }),
56
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
57
+ className: "whitespace-nowrap",
58
+ children: isAll ? allFoldersLabel : current?.label ?? allFoldersLabel
59
+ }),
60
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
61
+ "aria-hidden": true,
62
+ className: (0, index_cjs_namespaceObject.cn)('size-3.5 text-foreground-muted transition-transform duration-150', open && 'rotate-180')
63
+ })
64
+ ]
65
+ })
66
+ }),
67
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuContent, {
68
+ align: "start",
69
+ className: "min-w-[200px]",
70
+ container: container,
71
+ children: [
72
+ showAllFolders && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
73
+ children: [
74
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
75
+ className: "cursor-pointer",
76
+ onSelect: ()=>onChange(null),
77
+ children: [
78
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.LayoutGrid, {
79
+ className: "size-3.5 text-foreground-muted"
80
+ }),
81
+ allFoldersLabel
82
+ ]
83
+ }),
84
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuSeparator, {})
85
+ ]
86
+ }),
87
+ folders.map((f)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dropdown_menu_cjs_namespaceObject.DropdownMenuItem, {
88
+ className: "cursor-pointer",
89
+ onSelect: ()=>onChange(f.id),
90
+ children: [
91
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Folder, {
92
+ className: "size-3.5 text-foreground-muted"
93
+ }),
94
+ f.label
95
+ ]
96
+ }, f.id))
97
+ ]
98
+ })
99
+ ]
100
+ });
101
+ };
102
+ exports.FolderSwitcher = __webpack_exports__.FolderSwitcher;
103
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
104
+ "FolderSwitcher"
105
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
106
+ Object.defineProperty(exports, '__esModule', {
107
+ value: true
108
+ });