@adamosuiteservices/ui 1.6.6 → 1.7.7

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.
@@ -51,19 +51,22 @@ type ComboboxClassNames = {
51
51
  /**
52
52
  * Render prop functions for customizing component rendering.
53
53
  * Each render prop receives relevant data and allows complete control over that part of the UI.
54
+ * All render props also receive an 'Original' component that renders the default implementation,
55
+ * allowing you to wrap or enhance the default behavior without reimplementing it.
54
56
  */
55
57
  type ComboboxRenderProps = {
56
58
  /**
57
59
  * Custom renderer for the entire trigger button.
60
+ * @param props.Original - Default trigger button component
58
61
  * @param props.open - Whether the popover is open
59
62
  * @param props.value - Current selected value(s)
60
63
  * @param props.displayText - Formatted display text for selected value(s)
61
64
  * @param props.placeholder - Placeholder text
62
65
  * @param props.hasValue - Whether any value is selected
63
66
  * @param props.icon - Optional icon component
64
- * @param props.showIcon - Whether to show the icon
65
67
  */
66
68
  trigger?: (props: {
69
+ Original: ComponentType;
67
70
  open: boolean;
68
71
  value: string | string[];
69
72
  displayText: string | null;
@@ -72,74 +75,89 @@ type ComboboxRenderProps = {
72
75
  icon?: ComponentType<{
73
76
  className?: string;
74
77
  }>;
75
- showIcon?: boolean;
76
78
  }) => ReactNode;
77
79
  /**
78
80
  * Custom renderer for the trigger dropdown icon.
81
+ * @param props.Original - Default chevron icon component
79
82
  * @param props.open - Whether the popover is open
80
83
  */
81
84
  triggerIcon?: (props: {
85
+ Original: ComponentType;
82
86
  open: boolean;
83
87
  }) => ReactNode;
84
88
  /**
85
89
  * Custom renderer for the placeholder text.
90
+ * @param props.Original - Default placeholder component
86
91
  * @param props.text - The placeholder text
87
92
  * @param props.hasValue - Whether any value is selected
88
93
  */
89
94
  placeholder?: (props: {
95
+ Original: ComponentType;
90
96
  text: string;
91
97
  hasValue: boolean;
92
98
  }) => ReactNode;
93
99
  /**
94
100
  * Custom renderer for displaying selected value(s).
101
+ * @param props.Original - Default display value component
95
102
  * @param props.text - Formatted display text
96
103
  * @param props.value - Current selected value(s)
97
104
  */
98
105
  displayValue?: (props: {
106
+ Original: ComponentType;
99
107
  text: string | null;
100
108
  value: string | string[];
101
109
  }) => ReactNode;
102
110
  /**
103
111
  * Custom renderer for an entire option item.
112
+ * @param props.Original - Default option item component
104
113
  * @param props.option - The option data
105
114
  * @param props.isSelected - Whether this option is currently selected
106
115
  * @param props.selectedFeedback - Type of selection feedback ("checkbox" or "check")
107
116
  */
108
117
  option?: (props: {
118
+ Original: ComponentType;
109
119
  option: ComboboxOption;
110
120
  isSelected: boolean;
111
121
  selectedFeedback: "checkbox" | "check";
112
122
  }) => ReactNode;
113
123
  /**
114
124
  * Custom renderer for just the option label text.
125
+ * @param props.Original - Default option label component
115
126
  * @param props.option - The option data
116
127
  */
117
128
  optionLabel?: (props: {
129
+ Original: ComponentType;
118
130
  option: ComboboxOption;
119
131
  }) => ReactNode;
120
132
  /**
121
133
  * Custom renderer for the selection feedback indicator (checkbox or check).
134
+ * @param props.Original - Default feedback indicator component
122
135
  * @param props.option - The option data
123
136
  * @param props.isSelected - Whether this option is currently selected
124
137
  * @param props.type - Type of feedback indicator
125
138
  */
126
139
  selectedFeedback?: (props: {
140
+ Original: ComponentType;
127
141
  option: ComboboxOption;
128
142
  isSelected: boolean;
129
143
  type: "checkbox" | "check";
130
144
  }) => ReactNode;
131
145
  /**
132
146
  * Custom renderer for the empty state when no options match.
147
+ * @param props.Original - Default empty state component
133
148
  * @param props.text - The "no items found" message
134
149
  */
135
150
  empty?: (props: {
151
+ Original: ComponentType;
136
152
  text: string;
137
153
  }) => ReactNode;
138
154
  /**
139
155
  * Custom renderer for the search input field.
156
+ * @param props.Original - Default search input component
140
157
  * @param props.placeholder - Placeholder text for the search input
141
158
  */
142
159
  searchInput?: (props: {
160
+ Original: ComponentType;
143
161
  placeholder: string;
144
162
  }) => ReactNode;
145
163
  };
@@ -155,8 +173,6 @@ type ComboboxProps = Readonly<{
155
173
  icon?: ComponentType<{
156
174
  className?: string;
157
175
  }>;
158
- /** Whether to show the icon in the trigger */
159
- showIcon?: boolean;
160
176
  /** Controlled value for the combobox. Can be a single value or array of values for multiple selection. */
161
177
  value?: string | string[];
162
178
  /** Callback fired when the selected value changes */
@@ -171,6 +187,8 @@ type ComboboxProps = Readonly<{
171
187
  selectedFeedback?: "checkbox" | "check";
172
188
  /** Always show the placeholder text even when a value is selected. When enabled, both placeholder and value are displayed. */
173
189
  alwaysShowPlaceholder?: boolean;
190
+ /** Position where the selected value is displayed when alwaysShowPlaceholder is true ("left" next to placeholder or "right" next to trigger icon) */
191
+ valuePosition?: "left" | "right";
174
192
  /** Render prop functions for customizing component rendering */
175
193
  renders?: ComboboxRenderProps;
176
194
  }>;
@@ -227,5 +245,5 @@ type ComboboxProps = Readonly<{
227
245
  * />
228
246
  * ```
229
247
  */
230
- declare function Combobox({ searchable, multiple, icon: Icon, showIcon, value: controlledValue, onValueChange, labels, options, classNames, selectedFeedback, alwaysShowPlaceholder, renders, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
248
+ declare function Combobox({ searchable, multiple, icon: Icon, value: controlledValue, onValueChange, labels, options, classNames, selectedFeedback, alwaysShowPlaceholder, valuePosition, renders, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
231
249
  export { Combobox };
@@ -33,3 +33,9 @@ export declare const CustomTrigger: Story;
33
33
  export declare const CustomEmptyState: Story;
34
34
  export declare const CustomSelectedFeedback: Story;
35
35
  export declare const WithIconAndPlaceholder: Story;
36
+ export declare const ValuePositionLeft: Story;
37
+ export declare const WrappedTrigger: Story;
38
+ export declare const EnhancedDisplayValue: Story;
39
+ export declare const ConditionalFallback: Story;
40
+ export declare const WrappedOptions: Story;
41
+ export declare const EnhancedEmptyState: Story;