@timeax/form-palette 0.0.25 → 0.0.26
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.
- package/Readme.md +347 -340
- package/dist/index.d.mts +23 -8
- package/dist/index.d.ts +23 -8
- package/dist/index.js +292 -215
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +292 -215
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1916,6 +1916,11 @@ interface RadioItem<TValue> {
|
|
|
1916
1916
|
description?: React.ReactNode;
|
|
1917
1917
|
disabled?: boolean;
|
|
1918
1918
|
key?: React.Key;
|
|
1919
|
+
/**
|
|
1920
|
+
* Option-level renderer (provided by the normaliser).
|
|
1921
|
+
* If present, it overrides the variant-level `renderOption` for this item.
|
|
1922
|
+
*/
|
|
1923
|
+
render?: (ctx: RadioRenderOptionContext<TValue>) => React.ReactNode;
|
|
1919
1924
|
}
|
|
1920
1925
|
/**
|
|
1921
1926
|
* Mapping functions used when TItem is not `RadioItem<TValue>`.
|
|
@@ -1975,7 +1980,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
|
|
|
1975
1980
|
* items = [{ id: "free", title: "Free" }]
|
|
1976
1981
|
* optionValue = "id"
|
|
1977
1982
|
*/
|
|
1978
|
-
optionValue?:
|
|
1983
|
+
optionValue?: keyof TItem | string;
|
|
1979
1984
|
/**
|
|
1980
1985
|
* Property name on TItem that holds the **label**.
|
|
1981
1986
|
*
|
|
@@ -1983,7 +1988,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
|
|
|
1983
1988
|
* items = [{ id: "free", title: "Free" }]
|
|
1984
1989
|
* optionLabel = "title"
|
|
1985
1990
|
*/
|
|
1986
|
-
optionLabel?:
|
|
1991
|
+
optionLabel?: keyof TItem | string;
|
|
1987
1992
|
/**
|
|
1988
1993
|
* Optional custom renderer for each option.
|
|
1989
1994
|
*
|
|
@@ -2091,6 +2096,11 @@ interface CheckboxItem<TValue> {
|
|
|
2091
2096
|
description?: React.ReactNode;
|
|
2092
2097
|
disabled?: boolean;
|
|
2093
2098
|
key?: React.Key;
|
|
2099
|
+
/**
|
|
2100
|
+
* Option-level renderer (provided by the normaliser).
|
|
2101
|
+
* If present, it should override the variant-level `renderOption` for this item.
|
|
2102
|
+
*/
|
|
2103
|
+
render?: (ctx: CheckboxRenderOptionContext<TValue>) => React.ReactNode;
|
|
2094
2104
|
/**
|
|
2095
2105
|
* Override tri-state behaviour for this item.
|
|
2096
2106
|
* If undefined, variant-level `tristate` is used.
|
|
@@ -2287,6 +2297,8 @@ type NormalizedMultiItem = {
|
|
|
2287
2297
|
description?: React.ReactNode;
|
|
2288
2298
|
disabled?: boolean;
|
|
2289
2299
|
icon?: React.ReactNode;
|
|
2300
|
+
/** Option-level renderer (falls back to global renderOption) */
|
|
2301
|
+
render?: (...args: any[]) => React.ReactNode;
|
|
2290
2302
|
raw: MultiSelectOption;
|
|
2291
2303
|
};
|
|
2292
2304
|
type MultiSelectBaseProps = Pick<VariantBaseProps<SelectPrimitive$1[] | undefined>, "value" | "onValue" | "error" | "disabled" | "readOnly" | "size" | "density"> & {
|
|
@@ -2735,22 +2747,22 @@ interface ShadcnCustomVariantProps<TValue = unknown> extends VariantBaseProps<TV
|
|
|
2735
2747
|
type TreeKey = string | number;
|
|
2736
2748
|
type TreeValue = TreeKey | TreeKey[] | undefined;
|
|
2737
2749
|
type TreeSelectOption = TreeKey | {
|
|
2738
|
-
label?:
|
|
2750
|
+
label?: React__default.ReactNode;
|
|
2739
2751
|
value?: TreeKey;
|
|
2740
|
-
description?:
|
|
2752
|
+
description?: React__default.ReactNode;
|
|
2741
2753
|
disabled?: boolean;
|
|
2742
|
-
icon?:
|
|
2754
|
+
icon?: React__default.ReactNode;
|
|
2743
2755
|
children?: TreeSelectOption[];
|
|
2744
2756
|
[key: string]: any;
|
|
2745
2757
|
};
|
|
2746
2758
|
type NormalizedTreeItem = {
|
|
2747
2759
|
key: string;
|
|
2748
2760
|
value: TreeKey;
|
|
2749
|
-
labelNode:
|
|
2761
|
+
labelNode: React__default.ReactNode;
|
|
2750
2762
|
labelText: string;
|
|
2751
|
-
description?:
|
|
2763
|
+
description?: React__default.ReactNode;
|
|
2752
2764
|
disabled?: boolean;
|
|
2753
|
-
icon?:
|
|
2765
|
+
icon?: React__default.ReactNode;
|
|
2754
2766
|
level: number;
|
|
2755
2767
|
parentValue?: TreeKey;
|
|
2756
2768
|
path: TreeKey[];
|
|
@@ -2758,6 +2770,7 @@ type NormalizedTreeItem = {
|
|
|
2758
2770
|
children: NormalizedTreeItem[];
|
|
2759
2771
|
raw: TreeSelectOption;
|
|
2760
2772
|
};
|
|
2773
|
+
|
|
2761
2774
|
type BadgeVariant$1 = "default" | "secondary" | "destructive" | "outline";
|
|
2762
2775
|
type TreeSelectBaseProps = Pick<VariantBaseProps<TreeValue>, "value" | "onValue" | "error" | "disabled" | "readOnly" | "size" | "density"> & {
|
|
2763
2776
|
options?: TreeSelectOption[];
|
|
@@ -2994,6 +3007,8 @@ type NormalizedSelectItem = {
|
|
|
2994
3007
|
description?: React.ReactNode;
|
|
2995
3008
|
disabled?: boolean;
|
|
2996
3009
|
icon?: React.ReactNode;
|
|
3010
|
+
/** Option-level renderer (falls back to global renderOption) */
|
|
3011
|
+
render?: (...args: any[]) => React.ReactNode;
|
|
2997
3012
|
raw: SelectOption;
|
|
2998
3013
|
};
|
|
2999
3014
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1916,6 +1916,11 @@ interface RadioItem<TValue> {
|
|
|
1916
1916
|
description?: React.ReactNode;
|
|
1917
1917
|
disabled?: boolean;
|
|
1918
1918
|
key?: React.Key;
|
|
1919
|
+
/**
|
|
1920
|
+
* Option-level renderer (provided by the normaliser).
|
|
1921
|
+
* If present, it overrides the variant-level `renderOption` for this item.
|
|
1922
|
+
*/
|
|
1923
|
+
render?: (ctx: RadioRenderOptionContext<TValue>) => React.ReactNode;
|
|
1919
1924
|
}
|
|
1920
1925
|
/**
|
|
1921
1926
|
* Mapping functions used when TItem is not `RadioItem<TValue>`.
|
|
@@ -1975,7 +1980,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
|
|
|
1975
1980
|
* items = [{ id: "free", title: "Free" }]
|
|
1976
1981
|
* optionValue = "id"
|
|
1977
1982
|
*/
|
|
1978
|
-
optionValue?:
|
|
1983
|
+
optionValue?: keyof TItem | string;
|
|
1979
1984
|
/**
|
|
1980
1985
|
* Property name on TItem that holds the **label**.
|
|
1981
1986
|
*
|
|
@@ -1983,7 +1988,7 @@ interface ShadcnRadioUiProps<TItem, TValue> {
|
|
|
1983
1988
|
* items = [{ id: "free", title: "Free" }]
|
|
1984
1989
|
* optionLabel = "title"
|
|
1985
1990
|
*/
|
|
1986
|
-
optionLabel?:
|
|
1991
|
+
optionLabel?: keyof TItem | string;
|
|
1987
1992
|
/**
|
|
1988
1993
|
* Optional custom renderer for each option.
|
|
1989
1994
|
*
|
|
@@ -2091,6 +2096,11 @@ interface CheckboxItem<TValue> {
|
|
|
2091
2096
|
description?: React.ReactNode;
|
|
2092
2097
|
disabled?: boolean;
|
|
2093
2098
|
key?: React.Key;
|
|
2099
|
+
/**
|
|
2100
|
+
* Option-level renderer (provided by the normaliser).
|
|
2101
|
+
* If present, it should override the variant-level `renderOption` for this item.
|
|
2102
|
+
*/
|
|
2103
|
+
render?: (ctx: CheckboxRenderOptionContext<TValue>) => React.ReactNode;
|
|
2094
2104
|
/**
|
|
2095
2105
|
* Override tri-state behaviour for this item.
|
|
2096
2106
|
* If undefined, variant-level `tristate` is used.
|
|
@@ -2287,6 +2297,8 @@ type NormalizedMultiItem = {
|
|
|
2287
2297
|
description?: React.ReactNode;
|
|
2288
2298
|
disabled?: boolean;
|
|
2289
2299
|
icon?: React.ReactNode;
|
|
2300
|
+
/** Option-level renderer (falls back to global renderOption) */
|
|
2301
|
+
render?: (...args: any[]) => React.ReactNode;
|
|
2290
2302
|
raw: MultiSelectOption;
|
|
2291
2303
|
};
|
|
2292
2304
|
type MultiSelectBaseProps = Pick<VariantBaseProps<SelectPrimitive$1[] | undefined>, "value" | "onValue" | "error" | "disabled" | "readOnly" | "size" | "density"> & {
|
|
@@ -2735,22 +2747,22 @@ interface ShadcnCustomVariantProps<TValue = unknown> extends VariantBaseProps<TV
|
|
|
2735
2747
|
type TreeKey = string | number;
|
|
2736
2748
|
type TreeValue = TreeKey | TreeKey[] | undefined;
|
|
2737
2749
|
type TreeSelectOption = TreeKey | {
|
|
2738
|
-
label?:
|
|
2750
|
+
label?: React__default.ReactNode;
|
|
2739
2751
|
value?: TreeKey;
|
|
2740
|
-
description?:
|
|
2752
|
+
description?: React__default.ReactNode;
|
|
2741
2753
|
disabled?: boolean;
|
|
2742
|
-
icon?:
|
|
2754
|
+
icon?: React__default.ReactNode;
|
|
2743
2755
|
children?: TreeSelectOption[];
|
|
2744
2756
|
[key: string]: any;
|
|
2745
2757
|
};
|
|
2746
2758
|
type NormalizedTreeItem = {
|
|
2747
2759
|
key: string;
|
|
2748
2760
|
value: TreeKey;
|
|
2749
|
-
labelNode:
|
|
2761
|
+
labelNode: React__default.ReactNode;
|
|
2750
2762
|
labelText: string;
|
|
2751
|
-
description?:
|
|
2763
|
+
description?: React__default.ReactNode;
|
|
2752
2764
|
disabled?: boolean;
|
|
2753
|
-
icon?:
|
|
2765
|
+
icon?: React__default.ReactNode;
|
|
2754
2766
|
level: number;
|
|
2755
2767
|
parentValue?: TreeKey;
|
|
2756
2768
|
path: TreeKey[];
|
|
@@ -2758,6 +2770,7 @@ type NormalizedTreeItem = {
|
|
|
2758
2770
|
children: NormalizedTreeItem[];
|
|
2759
2771
|
raw: TreeSelectOption;
|
|
2760
2772
|
};
|
|
2773
|
+
|
|
2761
2774
|
type BadgeVariant$1 = "default" | "secondary" | "destructive" | "outline";
|
|
2762
2775
|
type TreeSelectBaseProps = Pick<VariantBaseProps<TreeValue>, "value" | "onValue" | "error" | "disabled" | "readOnly" | "size" | "density"> & {
|
|
2763
2776
|
options?: TreeSelectOption[];
|
|
@@ -2994,6 +3007,8 @@ type NormalizedSelectItem = {
|
|
|
2994
3007
|
description?: React.ReactNode;
|
|
2995
3008
|
disabled?: boolean;
|
|
2996
3009
|
icon?: React.ReactNode;
|
|
3010
|
+
/** Option-level renderer (falls back to global renderOption) */
|
|
3011
|
+
render?: (...args: any[]) => React.ReactNode;
|
|
2997
3012
|
raw: SelectOption;
|
|
2998
3013
|
};
|
|
2999
3014
|
/**
|