@povio/ui 2.3.2 → 3.0.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.
- package/dist/assets/locales/sl/translation.json.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.js +11 -11
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +40 -14
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +21 -18
- package/dist/components/Menu/MenuItem.js +4 -4
- package/dist/components/Menu/MenuMobile.js +6 -6
- package/dist/components/Menu/MenuPopover.js +8 -8
- package/dist/components/Menu/menu.cva.d.ts +35 -13
- package/dist/components/Menu/menu.cva.js +30 -24
- package/dist/components/buttons/Button/Button.js +7 -7
- package/dist/components/buttons/Button/button.cva.d.ts +95 -26
- package/dist/components/buttons/Button/button.cva.js +601 -589
- package/dist/components/buttons/PillButton/PillButton.js +4 -4
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +247 -239
- package/dist/components/buttons/shared/ButtonContent.js +3 -3
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +3 -5
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -8
- package/dist/components/inputs/Checkbox/Checkbox.js +2 -2
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +4 -4
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +23 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +46 -40
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +150 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +4 -4
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +3 -3
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +4 -4
- package/dist/components/inputs/File/shared/InputUploadContent.js +3 -3
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -3
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +26 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.js +48 -40
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +23 -6
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +29 -20
- package/dist/components/inputs/FormField/FormFieldError.js +3 -3
- package/dist/components/inputs/FormField/FormFieldHelper.js +3 -3
- package/dist/components/inputs/FormField/FormFieldLabel.js +6 -6
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -8
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -8
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +3 -3
- package/dist/components/inputs/Input/TextArea/TextArea.js +4 -4
- package/dist/components/inputs/Input/TextInput/TextInput.js +3 -3
- package/dist/components/inputs/Input/shared/InputContent.js +5 -5
- package/dist/components/inputs/RadioGroup/RadioGroup.js +4 -4
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +12 -6
- package/dist/components/inputs/RadioGroup/radio.cva.js +27 -24
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +4 -4
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +3 -3
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -6
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +21 -18
- package/dist/components/inputs/TextEditor/TextEditor.js +3 -3
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +3 -3
- package/dist/components/inputs/Toggle/Toggle.js +4 -4
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +12 -6
- package/dist/components/inputs/Toggle/toggle.cva.js +24 -21
- package/dist/components/inputs/shared/CheckContent.js +3 -3
- package/dist/components/inputs/shared/input.cva.d.ts +55 -16
- package/dist/components/inputs/shared/input.cva.js +279 -271
- package/dist/components/inputs/shared/label.cva.d.ts +15 -6
- package/dist/components/inputs/shared/label.cva.js +28 -25
- package/dist/components/navigation/Accordion/Accordion.js +3 -3
- package/dist/components/navigation/Accordion/AccordionItem.js +11 -11
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +109 -44
- package/dist/components/navigation/Accordion/accordion.cva.js +114 -84
- package/dist/components/navigation/Stepper/Stepper.js +3 -3
- package/dist/components/navigation/Stepper/StepperItem.js +12 -12
- package/dist/components/navigation/Stepper/StepperSeparator.js +3 -3
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +86 -30
- package/dist/components/navigation/Stepper/stepper.cva.js +104 -83
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -9
- package/dist/components/overlays/Modal/modal.cva.js +38 -27
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +3 -3
- package/dist/components/overlays/Tooltip/Tooltip.js +9 -9
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +45 -17
- package/dist/components/overlays/Tooltip/tooltip.cva.js +38 -26
- package/dist/components/segment/Segment.js +4 -4
- package/dist/components/segment/SegmentItem.js +4 -4
- package/dist/components/segment/segment.cva.d.ts +18 -7
- package/dist/components/segment/segment.cva.js +24 -21
- package/dist/components/shared/popover.cva.d.ts +7 -3
- package/dist/components/shared/popover.cva.js +3 -3
- package/dist/components/status/Alert/Alert.js +6 -6
- package/dist/components/status/Alert/alert.cva.d.ts +18 -6
- package/dist/components/status/Alert/alert.cva.js +60 -57
- package/dist/components/status/Loader/loader.cva.d.ts +23 -4
- package/dist/components/status/Loader/loader.cva.js +22 -13
- package/dist/components/status/Toast/Toast.js +6 -7
- package/dist/components/status/Toast/toast.cva.d.ts +61 -10
- package/dist/components/status/Toast/toast.cva.js +129 -64
- package/dist/components/status/shared/status.cva.d.ts +30 -8
- package/dist/components/status/shared/status.cva.js +56 -50
- package/dist/components/table/CellText.js +3 -3
- package/dist/components/table/HeaderText.js +3 -3
- package/dist/components/table/Table.js +6 -6
- package/dist/components/table/table.cva.d.ts +52 -19
- package/dist/components/table/table.cva.js +44 -35
- package/dist/components/text/Link/Link.js +3 -3
- package/dist/components/text/Link/link.cva.d.ts +11 -5
- package/dist/components/text/Link/link.cva.js +8 -5
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/components/text/Tag/tag.cva.d.ts +15 -5
- package/dist/components/text/Tag/tag.cva.js +51 -48
- package/dist/components/text/Typography/Typography.js +3 -3
- package/dist/components/text/Typography/typography.cva.d.ts +48 -7
- package/dist/components/text/Typography/typography.cva.js +125 -122
- package/dist/config/uiOverrides.context.d.ts +174 -0
- package/dist/config/uiOverrides.context.js +73 -0
- package/dist/index.d.ts +29 -1
- package/dist/index.js +30 -2
- package/dist/utils/style-merge.util.d.ts +43 -0
- package/dist/utils/style-merge.util.js +233 -0
- package/dist/utils/style-merge.util.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/uiStyle.context.d.ts +0 -162
- package/dist/config/uiStyle.context.js +0 -30
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { ButtonConfig, ButtonContentConfig, ButtonIconSizeConfig, ButtonSizeConfig } from '../components/buttons/Button/button.cva';
|
|
4
|
+
import { StatusIconConfig, StatusSeparatorConfig, ToastConfig } from '../components/status/Toast/toast.cva';
|
|
5
|
+
import { CompoundMapper, ConfigSchema } from '../utils/compoundMapper';
|
|
6
|
+
import { StyleMergeUtils } from '../utils/style-merge.util';
|
|
7
|
+
export declare namespace UIOverrides {
|
|
8
|
+
export type Cva<T> = (props?: (T & ClassProp) | ClassProp) => string;
|
|
9
|
+
type GenericCva = Cva<unknown>;
|
|
10
|
+
type Mapper = CompoundMapper<unknown, ConfigSchema>;
|
|
11
|
+
type CvaOption<TConfig extends StyleMergeUtils.CvaConfigShape> = StyleMergeUtils.CvaConfigOverride<TConfig> | GenericCva;
|
|
12
|
+
type GenericCvaOption = StyleMergeUtils.CvaConfigOverride | GenericCva;
|
|
13
|
+
type OptionKey = {
|
|
14
|
+
[K in keyof Options]: Options[K] extends object ? `${K & string}.${keyof Options[K] & string}` : never;
|
|
15
|
+
}[keyof Options];
|
|
16
|
+
type OptionValue<K extends OptionKey> = K extends `${infer TSection}.${infer TSlot}` ? TSection extends keyof Options ? TSlot extends keyof Options[TSection] ? Options[TSection][TSlot] : never : never : never;
|
|
17
|
+
type ConfigFromOverride<TValue> = TValue extends StyleMergeUtils.CvaConfigOverride<infer TConfig> ? TConfig : never;
|
|
18
|
+
type OverrideConfig<TValue> = [ConfigFromOverride<TValue>] extends [never] ? never : ConfigFromOverride<TValue>;
|
|
19
|
+
type ExtractConfig<TValue> = [OverrideConfig<TValue>] extends [never] ? TValue extends {
|
|
20
|
+
config?: infer TConfig;
|
|
21
|
+
} ? NonNullable<TConfig> : TValue : OverrideConfig<TValue>;
|
|
22
|
+
type EmptyObject = {};
|
|
23
|
+
type VariantSchema<TConfig> = [TConfig] extends [never] ? EmptyObject : TConfig extends {
|
|
24
|
+
variants?: infer TVariants;
|
|
25
|
+
} ? [NonNullable<TVariants>] extends [never] ? EmptyObject : NonNullable<TVariants> : EmptyObject;
|
|
26
|
+
export type VariantProps<TConfig> = [keyof VariantSchema<ExtractConfig<TConfig>>] extends [never] ? EmptyObject : StyleMergeUtils.ConfigVariants<Extract<VariantSchema<ExtractConfig<TConfig>>, StyleMergeUtils.ConfigSchema>>;
|
|
27
|
+
export type OverrideVariantProps<TOverride> = VariantProps<ExtractConfig<TOverride>>;
|
|
28
|
+
export interface Options {
|
|
29
|
+
button: {
|
|
30
|
+
cva?: CvaOption<ButtonConfig>;
|
|
31
|
+
sizeCva?: CvaOption<ButtonSizeConfig>;
|
|
32
|
+
contentCva?: CvaOption<ButtonContentConfig>;
|
|
33
|
+
iconSize?: CvaOption<ButtonIconSizeConfig>;
|
|
34
|
+
typography?: Mapper;
|
|
35
|
+
};
|
|
36
|
+
pillButton: {
|
|
37
|
+
cva?: GenericCvaOption;
|
|
38
|
+
typography?: Mapper;
|
|
39
|
+
};
|
|
40
|
+
checkbox: {
|
|
41
|
+
cva?: GenericCvaOption;
|
|
42
|
+
iconCva?: GenericCvaOption;
|
|
43
|
+
typography?: Mapper;
|
|
44
|
+
};
|
|
45
|
+
radio: {
|
|
46
|
+
cva?: GenericCvaOption;
|
|
47
|
+
typography?: Mapper;
|
|
48
|
+
};
|
|
49
|
+
status: {
|
|
50
|
+
iconCva?: CvaOption<StatusIconConfig>;
|
|
51
|
+
separatorCva?: CvaOption<StatusSeparatorConfig>;
|
|
52
|
+
};
|
|
53
|
+
toast: {
|
|
54
|
+
cva?: CvaOption<ToastConfig>;
|
|
55
|
+
buttonColor?: Mapper;
|
|
56
|
+
};
|
|
57
|
+
alert: {
|
|
58
|
+
cva?: GenericCvaOption;
|
|
59
|
+
};
|
|
60
|
+
input: {
|
|
61
|
+
baseCva?: GenericCvaOption;
|
|
62
|
+
sizeCva?: GenericCvaOption;
|
|
63
|
+
sideCva?: GenericCvaOption;
|
|
64
|
+
};
|
|
65
|
+
label: {
|
|
66
|
+
cva?: GenericCvaOption;
|
|
67
|
+
typography?: Mapper;
|
|
68
|
+
};
|
|
69
|
+
toggle: {
|
|
70
|
+
cva?: GenericCvaOption;
|
|
71
|
+
typography?: Mapper;
|
|
72
|
+
};
|
|
73
|
+
typography: {
|
|
74
|
+
cva?: GenericCvaOption;
|
|
75
|
+
};
|
|
76
|
+
link: {
|
|
77
|
+
cva?: GenericCvaOption;
|
|
78
|
+
};
|
|
79
|
+
tag: {
|
|
80
|
+
cva?: GenericCvaOption;
|
|
81
|
+
};
|
|
82
|
+
table: {
|
|
83
|
+
headRowCva?: GenericCvaOption;
|
|
84
|
+
headDataCva?: GenericCvaOption;
|
|
85
|
+
rowCva?: GenericCvaOption;
|
|
86
|
+
dataCva?: GenericCvaOption;
|
|
87
|
+
headerTextCva?: GenericCvaOption;
|
|
88
|
+
cellTextCva?: GenericCvaOption;
|
|
89
|
+
};
|
|
90
|
+
tooltip: {
|
|
91
|
+
cva?: GenericCvaOption;
|
|
92
|
+
pointerHorizontalCva?: GenericCvaOption;
|
|
93
|
+
pointerVerticalCva?: GenericCvaOption;
|
|
94
|
+
textCva?: GenericCvaOption;
|
|
95
|
+
};
|
|
96
|
+
modal: {
|
|
97
|
+
contentCva?: GenericCvaOption;
|
|
98
|
+
overlayCva?: GenericCvaOption;
|
|
99
|
+
mainCva?: GenericCvaOption;
|
|
100
|
+
};
|
|
101
|
+
menu: {
|
|
102
|
+
cva?: GenericCvaOption;
|
|
103
|
+
itemCva?: GenericCvaOption;
|
|
104
|
+
popoverCva?: GenericCvaOption;
|
|
105
|
+
popoverWrapperCva?: GenericCvaOption;
|
|
106
|
+
};
|
|
107
|
+
segment: {
|
|
108
|
+
cva?: GenericCvaOption;
|
|
109
|
+
itemCva?: GenericCvaOption;
|
|
110
|
+
};
|
|
111
|
+
stepper: {
|
|
112
|
+
cva?: GenericCvaOption;
|
|
113
|
+
itemCva?: GenericCvaOption;
|
|
114
|
+
iconCva?: GenericCvaOption;
|
|
115
|
+
numberCva?: GenericCvaOption;
|
|
116
|
+
titleCva?: GenericCvaOption;
|
|
117
|
+
subtextCva?: GenericCvaOption;
|
|
118
|
+
separatorCva?: GenericCvaOption;
|
|
119
|
+
};
|
|
120
|
+
accordion: {
|
|
121
|
+
cva?: GenericCvaOption;
|
|
122
|
+
itemCva?: GenericCvaOption;
|
|
123
|
+
triggerCva?: GenericCvaOption;
|
|
124
|
+
headingCva?: GenericCvaOption;
|
|
125
|
+
headingTitleCva?: GenericCvaOption;
|
|
126
|
+
headingSubtitleCva?: GenericCvaOption;
|
|
127
|
+
chevronCva?: GenericCvaOption;
|
|
128
|
+
iconCva?: GenericCvaOption;
|
|
129
|
+
panelCva?: GenericCvaOption;
|
|
130
|
+
panelContentCva?: GenericCvaOption;
|
|
131
|
+
};
|
|
132
|
+
breadcrumbs: {
|
|
133
|
+
cva?: GenericCvaOption;
|
|
134
|
+
itemCva?: GenericCvaOption;
|
|
135
|
+
segmentCva?: GenericCvaOption;
|
|
136
|
+
chevronCva?: GenericCvaOption;
|
|
137
|
+
iconCva?: GenericCvaOption;
|
|
138
|
+
};
|
|
139
|
+
popover: {
|
|
140
|
+
cva?: GenericCvaOption;
|
|
141
|
+
};
|
|
142
|
+
formField: {
|
|
143
|
+
errorLabelCva?: GenericCvaOption;
|
|
144
|
+
helperLabelCva?: GenericCvaOption;
|
|
145
|
+
};
|
|
146
|
+
select: {
|
|
147
|
+
listBoxItemCva?: GenericCvaOption;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
export type Config = Partial<Options>;
|
|
151
|
+
interface ProviderProps {
|
|
152
|
+
config?: Config;
|
|
153
|
+
}
|
|
154
|
+
export const Provider: ({ children, config }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
export const useCvaOverride: <K extends OptionKey>(key: K) => undefined;
|
|
156
|
+
export function defineConfig(definition: {
|
|
157
|
+
base: string[];
|
|
158
|
+
}): {
|
|
159
|
+
base: string[];
|
|
160
|
+
config?: StyleMergeUtils.Config<Record<never, never>>;
|
|
161
|
+
};
|
|
162
|
+
export function defineConfig<const TSchema extends StyleMergeUtils.ConfigSchema>(definition: {
|
|
163
|
+
base: string[];
|
|
164
|
+
config: StyleMergeUtils.Config<TSchema>;
|
|
165
|
+
}): {
|
|
166
|
+
base: string[];
|
|
167
|
+
config: StyleMergeUtils.Config<TSchema>;
|
|
168
|
+
};
|
|
169
|
+
export const defineOverride: <K extends OptionKey, const TOverride extends NonNullable<OptionValue<K>>>(_key: K, override: TOverride) => TOverride;
|
|
170
|
+
export function useCva<K extends OptionKey>(key: K, fallback: StyleMergeUtils.CvaDefinition<ConfigFromOverride<NonNullable<OptionValue<K>>> & StyleMergeUtils.CvaConfigShape>): Cva<any>;
|
|
171
|
+
export function useCva<K extends OptionKey, TProps>(key: K, fallback: Cva<TProps>): Cva<TProps>;
|
|
172
|
+
export const useMapper: <T, K extends ConfigSchema>(key: OptionKey, fallback: CompoundMapper<T, K>) => CompoundMapper<T, K>;
|
|
173
|
+
export {};
|
|
174
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { StyleMergeUtils } from "../utils/style-merge.util.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { createContext, use, useMemo } from "react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/config/uiOverrides.context.tsx
|
|
7
|
+
var UIOverrides;
|
|
8
|
+
(function(_UIOverrides) {
|
|
9
|
+
const Context = createContext(null);
|
|
10
|
+
_UIOverrides.Provider = ({ children, config }) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
12
|
+
value: config,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
const useConfig = () => {
|
|
17
|
+
return use(Context);
|
|
18
|
+
};
|
|
19
|
+
const useCvaOverride = _UIOverrides.useCvaOverride = (key) => {
|
|
20
|
+
const uiOverrides = useConfig();
|
|
21
|
+
if (!uiOverrides) return;
|
|
22
|
+
const [k1, k2] = key.split(".");
|
|
23
|
+
const item = uiOverrides[k1]?.[k2];
|
|
24
|
+
if (!item) return;
|
|
25
|
+
return item;
|
|
26
|
+
};
|
|
27
|
+
function defineConfig(definition) {
|
|
28
|
+
return definition;
|
|
29
|
+
}
|
|
30
|
+
_UIOverrides.defineConfig = defineConfig;
|
|
31
|
+
_UIOverrides.defineOverride = (_key, override) => {
|
|
32
|
+
return override;
|
|
33
|
+
};
|
|
34
|
+
const isCvaFunction = (item) => {
|
|
35
|
+
return typeof item === "function";
|
|
36
|
+
};
|
|
37
|
+
const isCvaOverrideConfig = (item) => {
|
|
38
|
+
if (typeof item !== "object") return false;
|
|
39
|
+
if (item == null) return false;
|
|
40
|
+
return "mode" in item;
|
|
41
|
+
};
|
|
42
|
+
const isDefinition = (item) => {
|
|
43
|
+
if (typeof item !== "object") return false;
|
|
44
|
+
if (item == null) return false;
|
|
45
|
+
return "base" in item;
|
|
46
|
+
};
|
|
47
|
+
function useCva(key, fallback) {
|
|
48
|
+
const override = useCvaOverride(key);
|
|
49
|
+
return useMemo(() => {
|
|
50
|
+
if (isCvaFunction(override)) return override;
|
|
51
|
+
if (isCvaFunction(fallback)) return fallback;
|
|
52
|
+
if (!isDefinition(fallback)) return (() => "");
|
|
53
|
+
const definition = fallback;
|
|
54
|
+
const typedOverride = override;
|
|
55
|
+
if (isCvaOverrideConfig(typedOverride)) {
|
|
56
|
+
const mergedDefinition = StyleMergeUtils.mergeCvaDefinition(definition, typedOverride);
|
|
57
|
+
return cva(clsx(mergedDefinition.base), mergedDefinition.config);
|
|
58
|
+
}
|
|
59
|
+
return cva(clsx(definition.base), definition.config);
|
|
60
|
+
}, [fallback, override]);
|
|
61
|
+
}
|
|
62
|
+
_UIOverrides.useCva = useCva;
|
|
63
|
+
_UIOverrides.useMapper = (key, fallback) => {
|
|
64
|
+
const uiOverrides = useConfig();
|
|
65
|
+
if (!uiOverrides) return fallback;
|
|
66
|
+
const [k1, k2] = key.split(".");
|
|
67
|
+
const item = uiOverrides[k1]?.[k2];
|
|
68
|
+
if (typeof item !== "function") return fallback;
|
|
69
|
+
return item;
|
|
70
|
+
};
|
|
71
|
+
})(UIOverrides || (UIOverrides = {}));
|
|
72
|
+
//#endregion
|
|
73
|
+
export { UIOverrides };
|
package/dist/index.d.ts
CHANGED
|
@@ -171,7 +171,35 @@ export { LinkContext } from './config/link.context';
|
|
|
171
171
|
export { UIRouter } from './config/router.context';
|
|
172
172
|
export { ThemeContext } from './config/theme.context';
|
|
173
173
|
export { UIConfig } from './config/uiConfig.context';
|
|
174
|
-
export {
|
|
174
|
+
export { UIOverrides } from './config/uiOverrides.context';
|
|
175
|
+
export { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbsDefinition, breadcrumbSegmentDefinition, } from './components/Breadcrumbs/breadcrumbs.cva';
|
|
176
|
+
export { buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, } from './components/buttons/Button/button.cva';
|
|
177
|
+
export { pillButtonContentDefinition, pillButtonDefinition } from './components/buttons/PillButton/pillButton.cva';
|
|
178
|
+
export { checkboxDefinition, checkboxIconDefinition } from './components/inputs/Checkbox/checkbox.cva';
|
|
179
|
+
export { fileCardListDefinition, fileUploadDropZoneDefinition } from './components/inputs/File/shared/fileUpload.cva';
|
|
180
|
+
export { inputUploadButtonDefinition, inputUploadDropZoneDefinition, } from './components/inputs/File/shared/inputUploadButton.cva';
|
|
181
|
+
export { formFieldErrorDefinition } from './components/inputs/FormField/formFieldError.cva';
|
|
182
|
+
export { formFieldHelperDefinition } from './components/inputs/FormField/formFieldHelper.cva';
|
|
183
|
+
export { inputBaseDefinition, inputSideDefinition, inputSizeDefinition } from './components/inputs/shared/input.cva';
|
|
184
|
+
export { labelDefinition } from './components/inputs/shared/label.cva';
|
|
185
|
+
export { radioDefinition } from './components/inputs/RadioGroup/radio.cva';
|
|
186
|
+
export { selectListBoxItemDefinition } from './components/inputs/Selection/shared/selectItem.cva';
|
|
187
|
+
export { toggleDefinition } from './components/inputs/Toggle/toggle.cva';
|
|
188
|
+
export { menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, } from './components/Menu/menu.cva';
|
|
189
|
+
export { accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, } from './components/navigation/Accordion/accordion.cva';
|
|
190
|
+
export { stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition, } from './components/navigation/Stepper/stepper.cva';
|
|
191
|
+
export { modalContentDefinition, modalMainDefinition, modalOverlayDefinition, } from './components/overlays/Modal/modal.cva';
|
|
192
|
+
export { tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition, } from './components/overlays/Tooltip/tooltip.cva';
|
|
193
|
+
export { segmentDefinition, segmentItemDefinition } from './components/segment/segment.cva';
|
|
194
|
+
export { popoverDefinition } from './components/shared/popover.cva';
|
|
195
|
+
export { alertDefinition } from './components/status/Alert/alert.cva';
|
|
196
|
+
export { loaderDefinition, loaderWrapperDefinition } from './components/status/Loader/loader.cva';
|
|
197
|
+
export { statusIconDefinition, statusSeparatorDefinition } from './components/status/shared/status.cva';
|
|
198
|
+
export { toastDefinition, statusIconDefinition as toastStatusIconDefinition, statusSeparatorDefinition as toastStatusSeparatorDefinition, } from './components/status/Toast/toast.cva';
|
|
199
|
+
export { tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeaderTextDefinition, tableHeadRowDefinition, tableRowDefinition, } from './components/table/table.cva';
|
|
200
|
+
export { linkDefinition } from './components/text/Link/link.cva';
|
|
201
|
+
export { tagDefinition } from './components/text/Tag/tag.cva';
|
|
202
|
+
export { typographyDefinition } from './components/text/Typography/typography.cva';
|
|
175
203
|
export type { DynamicColumnsOptions } from './helpers/dynamicColumns';
|
|
176
204
|
export { dynamicColumns } from './helpers/dynamicColumns';
|
|
177
205
|
export type { DynamicInputsOptions } from './helpers/dynamicInputs';
|
package/dist/index.js
CHANGED
|
@@ -37,13 +37,18 @@ import { TextColorIcon } from "./assets/icons/TextColor.js";
|
|
|
37
37
|
import { UnderlinedIcon } from "./assets/icons/Underlined.js";
|
|
38
38
|
import { VisibilityIcon } from "./assets/icons/Visibility.js";
|
|
39
39
|
import { VisibilityOffIcon } from "./assets/icons/VisibilityOff.js";
|
|
40
|
-
import {
|
|
40
|
+
import { UIOverrides } from "./config/uiOverrides.context.js";
|
|
41
|
+
import { breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition } from "./components/Breadcrumbs/breadcrumbs.cva.js";
|
|
42
|
+
import { menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition } from "./components/Menu/menu.cva.js";
|
|
41
43
|
import { MenuItem } from "./components/Menu/MenuItem.js";
|
|
42
44
|
import { MenuPopover } from "./components/Menu/MenuPopover.js";
|
|
45
|
+
import { tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition } from "./components/overlays/Tooltip/tooltip.cva.js";
|
|
46
|
+
import { typographyDefinition } from "./components/text/Typography/typography.cva.js";
|
|
43
47
|
import { Typography } from "./components/text/Typography/Typography.js";
|
|
44
48
|
import { Tooltip } from "./components/overlays/Tooltip/Tooltip.js";
|
|
45
49
|
import { LinkContext } from "./config/link.context.js";
|
|
46
50
|
import { Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs.js";
|
|
51
|
+
import { loaderDefinition, loaderWrapperDefinition } from "./components/status/Loader/loader.cva.js";
|
|
47
52
|
import { Loader } from "./components/status/Loader/Loader.js";
|
|
48
53
|
import { ObjectUtils } from "./utils/object.utils.js";
|
|
49
54
|
import { isEqual } from "./utils/isEqual.js";
|
|
@@ -51,9 +56,11 @@ import { useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo }
|
|
|
51
56
|
import { UIConfig } from "./config/uiConfig.context.js";
|
|
52
57
|
import { uiOutlineClass } from "./components/outline.clsx.js";
|
|
53
58
|
import { compoundMapper } from "./utils/compoundMapper.js";
|
|
59
|
+
import { buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition } from "./components/buttons/Button/button.cva.js";
|
|
54
60
|
import { Button } from "./components/buttons/Button/Button.js";
|
|
55
61
|
import { IconButton } from "./components/buttons/IconButton/IconButton.js";
|
|
56
62
|
import { InlineIconButton } from "./components/buttons/InlineIconButton/InlineIconButton.js";
|
|
63
|
+
import { pillButtonContentDefinition, pillButtonDefinition } from "./components/buttons/PillButton/pillButton.cva.js";
|
|
57
64
|
import { PillButton } from "./components/buttons/PillButton/PillButton.js";
|
|
58
65
|
import { ns, resources } from "./config/i18n.js";
|
|
59
66
|
import { useStateAndRef } from "./hooks/useStateAndRef.js";
|
|
@@ -64,14 +71,22 @@ import { Menu } from "./components/Menu/Menu.js";
|
|
|
64
71
|
import { SplitButton } from "./components/buttons/SplitButton/SplitButton.js";
|
|
65
72
|
import { TextButton } from "./components/buttons/TextButton/TextButton.js";
|
|
66
73
|
import { ToggleButton } from "./components/buttons/ToggleButton/ToggleButton.js";
|
|
74
|
+
import { checkboxDefinition, checkboxIconDefinition } from "./components/inputs/Checkbox/checkbox.cva.js";
|
|
75
|
+
import { formFieldErrorDefinition } from "./components/inputs/FormField/formFieldError.cva.js";
|
|
67
76
|
import { Checkbox } from "./components/inputs/Checkbox/Checkbox.js";
|
|
68
77
|
import { useLongPressRepeat } from "./hooks/useLongPressRepeat.js";
|
|
69
78
|
import { useScrollableListBox } from "./hooks/useScrollableListBox.js";
|
|
70
79
|
import { DateTimeUtils } from "./utils/date-time.utils.js";
|
|
80
|
+
import { labelDefinition } from "./components/inputs/shared/label.cva.js";
|
|
81
|
+
import { inputBaseDefinition, inputSideDefinition, inputSizeDefinition } from "./components/inputs/shared/input.cva.js";
|
|
82
|
+
import { popoverDefinition } from "./components/shared/popover.cva.js";
|
|
83
|
+
import { formFieldHelperDefinition } from "./components/inputs/FormField/formFieldHelper.cva.js";
|
|
71
84
|
import { FormField } from "./components/inputs/FormField/FormField.js";
|
|
72
85
|
import { DatePicker } from "./components/inputs/DateTime/DatePicker/DatePicker.js";
|
|
86
|
+
import { tagDefinition } from "./components/text/Tag/tag.cva.js";
|
|
73
87
|
import { Tag } from "./components/text/Tag/Tag.js";
|
|
74
88
|
import { useDebounceCallback } from "./hooks/useDebounceCallback.js";
|
|
89
|
+
import { selectListBoxItemDefinition } from "./components/inputs/Selection/shared/selectItem.cva.js";
|
|
75
90
|
import { useIntersectionObserver } from "./hooks/useIntersectionObserver.js";
|
|
76
91
|
import { TextInput } from "./components/inputs/Input/TextInput/TextInput.js";
|
|
77
92
|
import { Select } from "./components/inputs/Selection/Select/Select.js";
|
|
@@ -81,8 +96,10 @@ import { TimePicker } from "./components/inputs/DateTime/TimePicker/TimePicker.j
|
|
|
81
96
|
import { RestUtils } from "./utils/rest.utils.js";
|
|
82
97
|
import { FileUtils } from "./utils/file.utils.js";
|
|
83
98
|
import { ProgressBar } from "./components/inputs/File/shared/ProgressBar.js";
|
|
99
|
+
import { fileCardListDefinition, fileUploadDropZoneDefinition } from "./components/inputs/File/shared/fileUpload.cva.js";
|
|
84
100
|
import { FileUpload } from "./components/inputs/File/FileUpload.js";
|
|
85
101
|
import { FileUploadContainer } from "./components/inputs/File/FileUploadContainer.js";
|
|
102
|
+
import { inputUploadButtonDefinition, inputUploadDropZoneDefinition } from "./components/inputs/File/shared/inputUploadButton.cva.js";
|
|
86
103
|
import { InputUpload } from "./components/inputs/File/InputUpload.js";
|
|
87
104
|
import { NumberInput } from "./components/inputs/Input/NumberInput/NumberInput.js";
|
|
88
105
|
import { PasswordInput } from "./components/inputs/Input/PasswordInput/PasswordInput.js";
|
|
@@ -90,15 +107,21 @@ import { TextArea } from "./components/inputs/Input/TextArea/TextArea.js";
|
|
|
90
107
|
import { Autocomplete } from "./components/inputs/Selection/Autocomplete/Autocomplete.js";
|
|
91
108
|
import { QueryAutocomplete } from "./components/inputs/Selection/Autocomplete/QueryAutocomplete.js";
|
|
92
109
|
import { Slider } from "./components/inputs/Slider/Slider.js";
|
|
110
|
+
import { toggleDefinition } from "./components/inputs/Toggle/toggle.cva.js";
|
|
93
111
|
import { Toggle } from "./components/inputs/Toggle/Toggle.js";
|
|
112
|
+
import { segmentDefinition, segmentItemDefinition } from "./components/segment/segment.cva.js";
|
|
94
113
|
import { Segment } from "./components/segment/Segment.js";
|
|
95
114
|
import { StringUtils } from "./utils/string.utils.js";
|
|
96
115
|
import { dynamicInputs } from "./helpers/dynamicInputs.js";
|
|
97
116
|
import { Form } from "./components/inputs/Inputs/Form.js";
|
|
98
117
|
import { Inputs } from "./components/inputs/Inputs/Inputs.js";
|
|
118
|
+
import { radioDefinition } from "./components/inputs/RadioGroup/radio.cva.js";
|
|
99
119
|
import { RadioGroup } from "./components/inputs/RadioGroup/RadioGroup.js";
|
|
120
|
+
import { accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition } from "./components/navigation/Accordion/accordion.cva.js";
|
|
100
121
|
import { Accordion } from "./components/navigation/Accordion/Accordion.js";
|
|
122
|
+
import { stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition } from "./components/navigation/Stepper/stepper.cva.js";
|
|
101
123
|
import { Stepper } from "./components/navigation/Stepper/Stepper.js";
|
|
124
|
+
import { modalContentDefinition, modalMainDefinition, modalOverlayDefinition } from "./components/overlays/Modal/modal.cva.js";
|
|
102
125
|
import { Modal } from "./components/overlays/Modal/Modal.js";
|
|
103
126
|
import { ActionModal } from "./components/overlays/ActionModal/ActionModal.js";
|
|
104
127
|
import { Drawer } from "./components/overlays/Drawer/Drawer.js";
|
|
@@ -106,9 +129,13 @@ import { ResponsivePopover } from "./components/overlays/ResponsivePopover/Respo
|
|
|
106
129
|
import { TooltipEllipsis } from "./components/overlays/Tooltip/TooltipEllipsis.js";
|
|
107
130
|
import { PaginationList } from "./components/shared/pagination/PaginationList.js";
|
|
108
131
|
import { Pagination } from "./components/shared/pagination/Pagination.js";
|
|
132
|
+
import { alertDefinition } from "./components/status/Alert/alert.cva.js";
|
|
133
|
+
import { statusIconDefinition, statusSeparatorDefinition } from "./components/status/shared/status.cva.js";
|
|
109
134
|
import { Alert } from "./components/status/Alert/Alert.js";
|
|
135
|
+
import { statusIconDefinition as statusIconDefinition$1, statusSeparatorDefinition as statusSeparatorDefinition$1, toastDefinition } from "./components/status/Toast/toast.cva.js";
|
|
110
136
|
import { Toast, ToastContainer } from "./components/status/Toast/Toast.js";
|
|
111
137
|
import { useToast } from "./components/status/Toast/useToast.js";
|
|
138
|
+
import { tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition } from "./components/table/table.cva.js";
|
|
112
139
|
import { CellText } from "./components/table/CellText.js";
|
|
113
140
|
import { HeaderText } from "./components/table/HeaderText.js";
|
|
114
141
|
import { logger } from "./utils/logger.js";
|
|
@@ -118,6 +145,7 @@ import { useTranslationMemo } from "./hooks/useTranslationMemo.js";
|
|
|
118
145
|
import { ColumnConfigModal } from "./components/table/ColumnConfig.js";
|
|
119
146
|
import { InfiniteTable } from "./components/table/InfiniteTable.js";
|
|
120
147
|
import { PaginatedTable } from "./components/table/PaginatedTable.js";
|
|
148
|
+
import { linkDefinition } from "./components/text/Link/link.cva.js";
|
|
121
149
|
import { Link } from "./components/text/Link/Link.js";
|
|
122
150
|
import { Confirmation } from "./config/confirmation.context.js";
|
|
123
151
|
import { UIRouter } from "./config/router.context.js";
|
|
@@ -135,4 +163,4 @@ import { useSorting } from "./hooks/useSorting.js";
|
|
|
135
163
|
import { useTableColumnConfig } from "./hooks/useTableColumnConfig.js";
|
|
136
164
|
import { ArrayUtils } from "./utils/array.utils.js";
|
|
137
165
|
import { QueriesUtils } from "./utils/queries.utils.js";
|
|
138
|
-
export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig,
|
|
166
|
+
export { Accordion, ActionModal, Alert, AlignCenterIcon, AlignLeftIcon, AlignLeftRightIcon, AlignRightIcon, ArrayUtils, ArrowDropDownIcon, ArrowDropUpIcon, ArrowLeftIcon, ArrowRightIcon, Autocomplete, BoldIcon, BottomSheet, Breadcrumbs, BulletedListIcon, Button, CalendarIcon, CellText, CheckIcon, Checkbox, CheckboxCheckmarkIcon, CheckboxIndeterminateIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsLeftIcon, ChevronsRightIcon, ClockIcon, CloseIcon, ColumnConfigModal, Confirmation, DatePicker, DateRangePicker, DateTimeIcon, DateTimePicker, DateTimeUtils, DateUtils, DomUtils, Drawer, FileUpload, FileUploadContainer, FileUtils, Form, FormField, HeaderText, HighlightIcon, HighlightOnIcon, HomeIcon, IconButton, InfiniteTable, InfoIcon, InlineIconButton, InputUpload, Inputs, ItalicIcon, Link, LinkContext, LinkIcon, Loader, Menu, MenuIcon, MenuItem, MenuPopover, Modal, NumberInput, NumberedListIcon, ObjectUtils, PaginatedTable, Pagination, PaginationList, PasswordInput, PillButton, PointerHorizontalIcon, PointerVerticalIcon, ProgressBar, QueriesUtils, QueryAutocomplete, RadioGroup, ResponsivePopover, RestUtils, RoutingUtils, Segment, Select, SendIcon, Slider, SplitButton, Stepper, StrikethroughIcon, StringUtils, Table, Tag, TextArea, TextButton, TextColorIcon, TextInput, ThemeContext, TimePicker, Toast, ToastContainer, Toggle, ToggleButton, Tooltip, TooltipEllipsis, Typography, UIConfig, UIOverrides, UIRouter, UnderlinedIcon, VisibilityIcon, VisibilityOffIcon, accordionChevronDefinition, accordionDefinition, accordionHeadingDefinition, accordionHeadingSubtitleDefinition, accordionHeadingTitleDefinition, accordionIconDefinition, accordionItemDefinition, accordionPanelContentDefinition, accordionPanelDefinition, accordionTriggerDefinition, alertDefinition, breadcrumbChevronDefinition, breadcrumbIconDefinition, breadcrumbItemDefinition, breadcrumbSegmentDefinition, breadcrumbsDefinition, buttonContentDefinition, buttonDefinition, buttonIconSizeDefinition, buttonSizeDefinition, checkboxDefinition, checkboxIconDefinition, compoundMapper, dynamicColumns, dynamicInputs, fileCardListDefinition, fileUploadDropZoneDefinition, formFieldErrorDefinition, formFieldHelperDefinition, inputBaseDefinition, inputSideDefinition, inputSizeDefinition, inputUploadButtonDefinition, inputUploadDropZoneDefinition, isEqual, labelDefinition, linkDefinition, loaderDefinition, loaderWrapperDefinition, logger, menuDefinition, menuItemDefinition, menuPopoverDefinition, menuPopoverWrapperDefinition, modalContentDefinition, modalMainDefinition, modalOverlayDefinition, ns, pillButtonContentDefinition, pillButtonDefinition, popoverDefinition, radioDefinition, resources, segmentDefinition, segmentItemDefinition, selectListBoxItemDefinition, statusIconDefinition, statusSeparatorDefinition, stepperDefinition, stepperIconDefinition, stepperItemDefinition, stepperNumberDefinition, stepperSeparatorDefinition, stepperSubtextDefinition, stepperTitleDefinition, tableCellTextDefinition, tableDataDefinition, tableHeadDataDefinition, tableHeadRowDefinition, tableHeaderTextDefinition, tableRowDefinition, tagDefinition, toastDefinition, statusIconDefinition$1 as toastStatusIconDefinition, statusSeparatorDefinition$1 as toastStatusSeparatorDefinition, toggleDefinition, tooltipDefinition, tooltipPointerHorizontalDefinition, tooltipPointerVerticalDefinition, tooltipTextDefinition, typographyDefinition, uiOutlineClass, useAutosave, useBreakpoint, useDebounceCallback, useDeepCompareEffect, useDeepCompareLayoutEffect, useDeepCompareMemo, useFilters, useForm, useFormAutosave, useIntersectionObserver, useLocalStorage, useLongPressRepeat, usePagination, useScrollableListBox, useSorting, useStateAndRef, useTableColumnConfig, useTableNav, useToast, useTranslationMemo };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ClassProp, ClassValue, StringToBoolean } from 'class-variance-authority/types';
|
|
2
|
+
export declare namespace StyleMergeUtils {
|
|
3
|
+
export type OverrideMode = "merge" | "overrideEntry" | "overrideCva";
|
|
4
|
+
export interface CvaVariantMap {
|
|
5
|
+
[variant: string]: {
|
|
6
|
+
[value: string]: ClassValue;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export type ConfigSchema = CvaVariantMap;
|
|
10
|
+
export type ConfigVariants<TSchema extends ConfigSchema> = {
|
|
11
|
+
[K in keyof TSchema]?: StringToBoolean<keyof NonNullable<TSchema[K]>> | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type ConfigVariantsMulti<TSchema extends ConfigSchema> = {
|
|
14
|
+
[K in keyof TSchema]?: StringToBoolean<keyof NonNullable<TSchema[K]>> | StringToBoolean<keyof NonNullable<TSchema[K]>>[] | undefined;
|
|
15
|
+
};
|
|
16
|
+
export interface Config<TSchema extends ConfigSchema> {
|
|
17
|
+
variants?: TSchema;
|
|
18
|
+
defaultVariants?: ConfigVariants<TSchema>;
|
|
19
|
+
compoundVariants?: Array<(ConfigVariants<TSchema> | ConfigVariantsMulti<TSchema>) & ClassProp>;
|
|
20
|
+
}
|
|
21
|
+
export interface CvaCompoundEntry {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
class?: ClassValue;
|
|
24
|
+
className?: ClassValue;
|
|
25
|
+
}
|
|
26
|
+
export interface CvaConfigShape {
|
|
27
|
+
variants?: CvaVariantMap;
|
|
28
|
+
compoundVariants?: CvaCompoundEntry[];
|
|
29
|
+
defaultVariants?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
export interface CvaDefinition<TConfig extends CvaConfigShape> {
|
|
32
|
+
base: string[];
|
|
33
|
+
config?: TConfig;
|
|
34
|
+
}
|
|
35
|
+
type DeepOptionalOverride<T> = T extends string ? string : T extends (infer U)[] ? DeepOptionalOverride<U>[] : T extends object ? {
|
|
36
|
+
[K in keyof T]?: DeepOptionalOverride<T[K]>;
|
|
37
|
+
} : T;
|
|
38
|
+
export type CvaConfigOverride<TConfig extends CvaConfigShape = CvaConfigShape> = DeepOptionalOverride<CvaDefinition<TConfig>> & {
|
|
39
|
+
mode: OverrideMode;
|
|
40
|
+
};
|
|
41
|
+
export const mergeCvaDefinition: <TConfig extends CvaConfigShape>(baseDefinition: CvaDefinition<TConfig>, override?: CvaConfigOverride<TConfig>) => CvaDefinition<TConfig>;
|
|
42
|
+
export {};
|
|
43
|
+
}
|