@luscii-healthtech/web-ui 54.3.2 → 54.3.3

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.
@@ -32,6 +32,31 @@ export interface SelectProps<Option extends OptionMinimal = OptionMinimal, IsMul
32
32
  * way, without any processing of the value.
33
33
  */
34
34
  skipValueProcessing?: boolean;
35
+ /**
36
+ * Enable the user to create new options by typing and pressing Enter.
37
+ * When enabled, the select becomes "creatable" - if no matching options are found,
38
+ * the user can add the typed value as a new option.
39
+ */
40
+ isCreatable?: boolean;
41
+ /**
42
+ * Callback fired when a new option is created. Only applies when `isCreatable` is true.
43
+ * @param inputValue - The text input that the user typed to create the new option
44
+ */
45
+ onCreateOption?: (inputValue: string) => void;
46
+ /**
47
+ * Formats the label shown to users when they can create a new option.
48
+ * Only applies when `isCreatable` is true.
49
+ * Use this for translations or custom messaging.
50
+ * @param inputValue - The text the user has typed
51
+ * @returns The label to display (e.g., 'Create "inputValue"' or t('select.create', { inputValue }))
52
+ * @example
53
+ * // With translations
54
+ * formatCreateLabel={(value) => t('select.create', { value })}
55
+ * @example
56
+ * // Custom text
57
+ * formatCreateLabel={(value) => `Add "${value}" as new option`}
58
+ */
59
+ formatCreateLabel?: (inputValue: string) => string;
35
60
  }
36
61
  /**
37
62
  * A searchable select component powered by `react-select`, styled to match Luscii's design.
@@ -32,6 +32,31 @@ export interface SelectProps<Option extends OptionMinimal = OptionMinimal, IsMul
32
32
  * way, without any processing of the value.
33
33
  */
34
34
  skipValueProcessing?: boolean;
35
+ /**
36
+ * Enable the user to create new options by typing and pressing Enter.
37
+ * When enabled, the select becomes "creatable" - if no matching options are found,
38
+ * the user can add the typed value as a new option.
39
+ */
40
+ isCreatable?: boolean;
41
+ /**
42
+ * Callback fired when a new option is created. Only applies when `isCreatable` is true.
43
+ * @param inputValue - The text input that the user typed to create the new option
44
+ */
45
+ onCreateOption?: (inputValue: string) => void;
46
+ /**
47
+ * Formats the label shown to users when they can create a new option.
48
+ * Only applies when `isCreatable` is true.
49
+ * Use this for translations or custom messaging.
50
+ * @param inputValue - The text the user has typed
51
+ * @returns The label to display (e.g., 'Create "inputValue"' or t('select.create', { inputValue }))
52
+ * @example
53
+ * // With translations
54
+ * formatCreateLabel={(value) => t('select.create', { value })}
55
+ * @example
56
+ * // Custom text
57
+ * formatCreateLabel={(value) => `Add "${value}" as new option`}
58
+ */
59
+ formatCreateLabel?: (inputValue: string) => string;
35
60
  }
36
61
  /**
37
62
  * A searchable select component powered by `react-select`, styled to match Luscii's design.
@@ -146,6 +146,7 @@ export declare const MultiSelectWithDefault: {
146
146
  onChange: import("storybook/actions").HandlerFunction;
147
147
  };
148
148
  };
149
+ export declare const CreatableSelect: Story;
149
150
  export declare const GroupedOptions: {
150
151
  args: {
151
152
  options: ({