@solostylist/ui-kit-native 1.0.2 → 1.0.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/** Base type constraint for select options - can be primitives or objects */
|
|
3
|
-
type BaseOption = string | number | Record<string,
|
|
3
|
+
type BaseOption = string | number | Record<string, unknown>;
|
|
4
4
|
/**
|
|
5
5
|
* Props interface for SSelect component
|
|
6
6
|
*/
|
|
@@ -37,10 +37,12 @@ export interface SSelectProps<T extends BaseOption = string> {
|
|
|
37
37
|
size?: 'small' | 'medium';
|
|
38
38
|
/** Help text shown below the input */
|
|
39
39
|
hint?: string;
|
|
40
|
+
/** Custom render function for options */
|
|
41
|
+
renderOption?: (option: T) => React.ReactNode;
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* A flexible select component that handles both primitive and object options with form integration.
|
|
43
45
|
*/
|
|
44
|
-
export declare function SSelect<T extends BaseOption = string>({ options, optionLabel, optionValue, placeholder, label, error, required, value: controlledValue, onChange, variant, searchable, searchPlaceholder, multiple, disabled, size, hint, }: SSelectProps<T>): React.JSX.Element;
|
|
46
|
+
export declare function SSelect<T extends BaseOption = string>({ options, optionLabel, optionValue, placeholder, label, error, required, value: controlledValue, onChange, variant, searchable, searchPlaceholder, multiple, disabled, size, hint, renderOption, }: SSelectProps<T>): React.JSX.Element;
|
|
45
47
|
export {};
|
|
46
48
|
//# sourceMappingURL=s-select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s-select.d.ts","sourceRoot":"","sources":["../../src/s-select/s-select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAStE,6EAA6E;AAC7E,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"s-select.d.ts","sourceRoot":"","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IAC1B,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CAC/C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,EAAE,EACrD,OAAY,EACZ,WAA0D,EAC1D,WAAwD,EACxD,WAAyB,EACzB,KAAK,EACL,KAAK,EACL,QAAgB,EAChB,KAAK,EAAE,eAAe,EACtB,QAAQ,EACR,OAAoB,EACpB,UAAkB,EAClB,iBAA+B,EAC/B,QAAgB,EAChB,QAAgB,EAChB,IAAe,EACf,IAAI,EACJ,YAAY,GACb,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsRrC"}
|
|
@@ -11,7 +11,7 @@ import { useSTheme } from '../theme';
|
|
|
11
11
|
/**
|
|
12
12
|
* A flexible select component that handles both primitive and object options with form integration.
|
|
13
13
|
*/
|
|
14
|
-
export function SSelect({ options = [], optionLabel = 'name', optionValue = 'id', placeholder = 'Select...', label, error, required = false, value: controlledValue, onChange, variant = 'outlined', searchable = false, searchPlaceholder = 'Search...', multiple = false, disabled = false, size = 'medium', hint, }) {
|
|
14
|
+
export function SSelect({ options = [], optionLabel = 'name', optionValue = 'id', placeholder = 'Select...', label, error, required = false, value: controlledValue, onChange, variant = 'outlined', searchable = false, searchPlaceholder = 'Search...', multiple = false, disabled = false, size = 'medium', hint, renderOption, }) {
|
|
15
15
|
const { theme } = useSTheme();
|
|
16
16
|
// State management
|
|
17
17
|
const isControlled = controlledValue !== undefined;
|
|
@@ -189,7 +189,7 @@ export function SSelect({ options = [], optionLabel = 'name', optionValue = 'id'
|
|
|
189
189
|
: Color(theme.colors.secondary[300]).alpha(0.2).rgb().string(),
|
|
190
190
|
},
|
|
191
191
|
];
|
|
192
|
-
}, children: [multiple && (_jsx(SCheckbox, { checked: isSelected, disabled: isDisabled, style: { marginRight: theme.spacing.sm } })), _jsx(SText, { variant: "body1", children: itemLabel })] }, `${itemValue}-${index}`));
|
|
192
|
+
}, children: [multiple && (_jsx(SCheckbox, { checked: isSelected, disabled: isDisabled, style: { marginRight: theme.spacing.sm } })), renderOption ? renderOption(item) : _jsx(SText, { variant: "body1", children: itemLabel })] }, `${itemValue}-${index}`));
|
|
193
193
|
})) : (_jsx(View, { style: {
|
|
194
194
|
padding: theme.spacing.lg,
|
|
195
195
|
alignItems: 'center',
|