@veracity/vui 2.0.6 → 2.2.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/cjs/avatar/theme.d.ts +1 -0
- package/dist/cjs/avatar/theme.d.ts.map +1 -1
- package/dist/cjs/avatar/theme.js +2 -1
- package/dist/cjs/badge/theme.d.ts +1 -0
- package/dist/cjs/badge/theme.d.ts.map +1 -1
- package/dist/cjs/badge/theme.js +5 -4
- package/dist/cjs/button/theme.d.ts +1 -0
- package/dist/cjs/button/theme.d.ts.map +1 -1
- package/dist/cjs/button/theme.js +2 -1
- package/dist/cjs/divider/divider.js +1 -1
- package/dist/cjs/dragAndDrop/dragAndDrop.d.ts +1 -1
- package/dist/cjs/dragAndDrop/dragAndDrop.d.ts.map +1 -1
- package/dist/cjs/dragAndDrop/dragAndDrop.js +3 -3
- package/dist/cjs/dragAndDrop/dragAndDrop.types.d.ts +1 -1
- package/dist/cjs/dragAndDrop/dragAndDrop.types.d.ts.map +1 -1
- package/dist/cjs/dragAndDrop/theme.d.ts +18 -3
- package/dist/cjs/dragAndDrop/theme.d.ts.map +1 -1
- package/dist/cjs/dragAndDrop/theme.js +23 -3
- package/dist/cjs/icons/baseIcons/conc/conCreateDataset.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conCreateDataset.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conDataSearchAlt.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conDataSearchAlt.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conDataSearchAlt.js +7 -0
- package/dist/cjs/icons/baseIcons/conc/conDataSearchPlus.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conDataSearchPlus.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conDataSearchPlus.js +7 -0
- package/dist/cjs/icons/baseIcons/conc/conDatabase.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conDatabase.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conDatabasePlus.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conDatabasePlus.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conDataset.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conDataset.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conFolderPlus.js +1 -1
- package/dist/cjs/icons/baseIcons/conc/conLNGBunkering.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conLNGBunkering.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conLNGBunkering.js +8 -0
- package/dist/cjs/icons/baseIcons/conc/conReport.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conReport.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conReport1.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conReport1.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conReport1.js +8 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorAlt.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorAlt.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorAlt.js +8 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorPlus.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorPlus.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conSensorPlus.js +8 -0
- package/dist/cjs/icons/baseIcons/conc/conUploadFile.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/conc/conUploadFile.js +3 -2
- package/dist/cjs/icons/baseIcons/conc/conUploadFile1.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/conc/conUploadFile1.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/conc/conUploadFile1.js +8 -0
- package/dist/cjs/icons/baseIcons/icons.d.ts +11 -4
- package/dist/cjs/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/icons.js +29 -15
- package/dist/cjs/icons/baseIcons/types.d.ts +1 -1
- package/dist/cjs/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/cjs/icons/consts.d.ts.map +1 -1
- package/dist/cjs/icons/consts.js +24 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/input/consts.d.ts +17 -3
- package/dist/cjs/input/consts.d.ts.map +1 -1
- package/dist/cjs/input/consts.js +27 -13
- package/dist/cjs/input/helpText.js +2 -2
- package/dist/cjs/input/input.d.ts.map +1 -1
- package/dist/cjs/input/input.js +8 -11
- package/dist/cjs/input/input.types.d.ts +6 -6
- package/dist/cjs/input/input.types.d.ts.map +1 -1
- package/dist/cjs/input/inputIcon.d.ts.map +1 -1
- package/dist/cjs/input/inputIcon.js +2 -1
- package/dist/cjs/input/theme.d.ts +33 -17
- package/dist/cjs/input/theme.d.ts.map +1 -1
- package/dist/cjs/input/theme.js +32 -22
- package/dist/cjs/pagination/paginationButton.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationButton.js +2 -5
- package/dist/cjs/pagination/paginationEllipsis.js +1 -1
- package/dist/cjs/pagination/paginationGoToPage.js +1 -1
- package/dist/cjs/pagination/paginationPrevNext.js +1 -1
- package/dist/cjs/pagination/paginationResults.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationResults.js +1 -1
- package/dist/cjs/pagination/theme.d.ts +27 -1
- package/dist/cjs/pagination/theme.d.ts.map +1 -1
- package/dist/cjs/pagination/theme.js +14 -1
- package/dist/cjs/skeleton/skeleton.types.d.ts +1 -1
- package/dist/cjs/skeleton/skeleton.types.d.ts.map +1 -1
- package/dist/cjs/skeleton/theme.d.ts +10 -14
- package/dist/cjs/skeleton/theme.d.ts.map +1 -1
- package/dist/cjs/skeleton/theme.js +10 -21
- package/dist/cjs/tag/tag.d.ts.map +1 -1
- package/dist/cjs/tag/tag.js +2 -3
- package/dist/cjs/tag/theme.d.ts +1 -0
- package/dist/cjs/tag/theme.d.ts.map +1 -1
- package/dist/cjs/tag/theme.js +10 -9
- package/dist/cjs/theme/components.d.ts +137 -20
- package/dist/cjs/theme/components.d.ts.map +1 -1
- package/dist/cjs/theme/components.js +3 -1
- package/dist/cjs/theme/defaultTheme.d.ts +137 -20
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- package/dist/cjs/tooltip/tooltip.js +1 -1
- package/dist/cjs/tooltip/tooltipContent.d.ts +1 -1
- package/dist/cjs/tooltip/tooltipContent.d.ts.map +1 -1
- package/dist/cjs/tooltip/tooltipContent.js +1 -4
- package/dist/cjs/tree/context.d.ts +5 -0
- package/dist/cjs/tree/context.d.ts.map +1 -0
- package/dist/cjs/tree/context.js +7 -0
- package/dist/cjs/tree/index.d.ts +8 -0
- package/dist/cjs/tree/index.d.ts.map +1 -0
- package/dist/cjs/tree/index.js +28 -0
- package/dist/cjs/tree/theme.d.ts +59 -0
- package/dist/cjs/tree/theme.d.ts.map +1 -0
- package/dist/cjs/tree/theme.js +69 -0
- package/dist/cjs/tree/tree.d.ts +14 -0
- package/dist/cjs/tree/tree.d.ts.map +1 -0
- package/dist/cjs/tree/tree.js +116 -0
- package/dist/cjs/tree/tree.types.d.ts +58 -0
- package/dist/cjs/tree/tree.types.d.ts.map +1 -0
- package/dist/cjs/tree/tree.types.js +2 -0
- package/dist/cjs/tree/treeIcon.d.ts +5 -0
- package/dist/cjs/tree/treeIcon.d.ts.map +1 -0
- package/dist/cjs/tree/treeIcon.js +29 -0
- package/dist/cjs/tree/treeItem.d.ts +8 -0
- package/dist/cjs/tree/treeItem.d.ts.map +1 -0
- package/dist/cjs/tree/treeItem.js +131 -0
- package/dist/cjs/tree/treeText.d.ts +5 -0
- package/dist/cjs/tree/treeText.d.ts.map +1 -0
- package/dist/cjs/tree/treeText.js +29 -0
- package/dist/cjs/tree/useTreeState.d.ts +9 -0
- package/dist/cjs/tree/useTreeState.d.ts.map +1 -0
- package/dist/cjs/tree/useTreeState.js +10 -0
- package/dist/esm/avatar/theme.d.ts +1 -0
- package/dist/esm/avatar/theme.d.ts.map +1 -1
- package/dist/esm/avatar/theme.js +2 -1
- package/dist/esm/badge/theme.d.ts +1 -0
- package/dist/esm/badge/theme.d.ts.map +1 -1
- package/dist/esm/badge/theme.js +5 -4
- package/dist/esm/button/theme.d.ts +1 -0
- package/dist/esm/button/theme.d.ts.map +1 -1
- package/dist/esm/button/theme.js +2 -1
- package/dist/esm/divider/divider.js +1 -1
- package/dist/esm/dragAndDrop/dragAndDrop.d.ts +1 -1
- package/dist/esm/dragAndDrop/dragAndDrop.d.ts.map +1 -1
- package/dist/esm/dragAndDrop/dragAndDrop.js +3 -3
- package/dist/esm/dragAndDrop/dragAndDrop.types.d.ts +1 -1
- package/dist/esm/dragAndDrop/dragAndDrop.types.d.ts.map +1 -1
- package/dist/esm/dragAndDrop/theme.d.ts +18 -3
- package/dist/esm/dragAndDrop/theme.d.ts.map +1 -1
- package/dist/esm/dragAndDrop/theme.js +23 -3
- package/dist/esm/icons/baseIcons/conc/conCreateDataset.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conCreateDataset.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conDataSearchAlt.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conDataSearchAlt.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conDataSearchAlt.js +5 -0
- package/dist/esm/icons/baseIcons/conc/conDataSearchPlus.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conDataSearchPlus.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conDataSearchPlus.js +5 -0
- package/dist/esm/icons/baseIcons/conc/conDatabase.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conDatabase.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conDatabasePlus.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conDatabasePlus.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conDataset.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conDataset.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conFolderPlus.js +1 -1
- package/dist/esm/icons/baseIcons/conc/conLNGBunkering.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conLNGBunkering.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conLNGBunkering.js +6 -0
- package/dist/esm/icons/baseIcons/conc/conReport.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conReport.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conReport1.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conReport1.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conReport1.js +6 -0
- package/dist/esm/icons/baseIcons/conc/conSensorAlt.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conSensorAlt.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conSensorAlt.js +6 -0
- package/dist/esm/icons/baseIcons/conc/conSensorPlus.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conSensorPlus.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conSensorPlus.js +6 -0
- package/dist/esm/icons/baseIcons/conc/conUploadFile.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/conc/conUploadFile.js +3 -2
- package/dist/esm/icons/baseIcons/conc/conUploadFile1.d.ts +4 -0
- package/dist/esm/icons/baseIcons/conc/conUploadFile1.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/conc/conUploadFile1.js +6 -0
- package/dist/esm/icons/baseIcons/icons.d.ts +11 -4
- package/dist/esm/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/icons.js +11 -4
- package/dist/esm/icons/baseIcons/types.d.ts +1 -1
- package/dist/esm/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/esm/icons/consts.d.ts.map +1 -1
- package/dist/esm/icons/consts.js +24 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/input/consts.d.ts +17 -3
- package/dist/esm/input/consts.d.ts.map +1 -1
- package/dist/esm/input/consts.js +26 -12
- package/dist/esm/input/helpText.js +3 -3
- package/dist/esm/input/input.d.ts.map +1 -1
- package/dist/esm/input/input.js +6 -9
- package/dist/esm/input/input.types.d.ts +6 -6
- package/dist/esm/input/input.types.d.ts.map +1 -1
- package/dist/esm/input/inputIcon.d.ts.map +1 -1
- package/dist/esm/input/inputIcon.js +2 -1
- package/dist/esm/input/theme.d.ts +33 -17
- package/dist/esm/input/theme.d.ts.map +1 -1
- package/dist/esm/input/theme.js +32 -22
- package/dist/esm/pagination/paginationButton.d.ts.map +1 -1
- package/dist/esm/pagination/paginationButton.js +2 -5
- package/dist/esm/pagination/paginationEllipsis.js +1 -1
- package/dist/esm/pagination/paginationGoToPage.js +1 -1
- package/dist/esm/pagination/paginationPrevNext.js +1 -1
- package/dist/esm/pagination/paginationResults.d.ts.map +1 -1
- package/dist/esm/pagination/paginationResults.js +1 -1
- package/dist/esm/pagination/theme.d.ts +27 -1
- package/dist/esm/pagination/theme.d.ts.map +1 -1
- package/dist/esm/pagination/theme.js +21 -1
- package/dist/esm/skeleton/skeleton.types.d.ts +1 -1
- package/dist/esm/skeleton/skeleton.types.d.ts.map +1 -1
- package/dist/esm/skeleton/theme.d.ts +10 -14
- package/dist/esm/skeleton/theme.d.ts.map +1 -1
- package/dist/esm/skeleton/theme.js +10 -21
- package/dist/esm/tag/tag.d.ts.map +1 -1
- package/dist/esm/tag/tag.js +2 -3
- package/dist/esm/tag/theme.d.ts +1 -0
- package/dist/esm/tag/theme.d.ts.map +1 -1
- package/dist/esm/tag/theme.js +10 -9
- package/dist/esm/theme/components.d.ts +137 -20
- package/dist/esm/theme/components.d.ts.map +1 -1
- package/dist/esm/theme/components.js +3 -1
- package/dist/esm/theme/defaultTheme.d.ts +137 -20
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- package/dist/esm/tooltip/tooltip.js +1 -1
- package/dist/esm/tooltip/tooltipContent.d.ts +1 -1
- package/dist/esm/tooltip/tooltipContent.d.ts.map +1 -1
- package/dist/esm/tooltip/tooltipContent.js +1 -4
- package/dist/esm/tree/context.d.ts +5 -0
- package/dist/esm/tree/context.d.ts.map +1 -0
- package/dist/esm/tree/context.js +3 -0
- package/dist/esm/tree/index.d.ts +8 -0
- package/dist/esm/tree/index.d.ts.map +1 -0
- package/dist/esm/tree/index.js +7 -0
- package/dist/esm/tree/theme.d.ts +59 -0
- package/dist/esm/tree/theme.d.ts.map +1 -0
- package/dist/esm/tree/theme.js +67 -0
- package/dist/esm/tree/tree.d.ts +14 -0
- package/dist/esm/tree/tree.d.ts.map +1 -0
- package/dist/esm/tree/tree.js +74 -0
- package/dist/esm/tree/tree.types.d.ts +58 -0
- package/dist/esm/tree/tree.types.d.ts.map +1 -0
- package/dist/esm/tree/tree.types.js +1 -0
- package/dist/esm/tree/treeIcon.d.ts +5 -0
- package/dist/esm/tree/treeIcon.d.ts.map +1 -0
- package/dist/esm/tree/treeIcon.js +12 -0
- package/dist/esm/tree/treeItem.d.ts +8 -0
- package/dist/esm/tree/treeItem.d.ts.map +1 -0
- package/dist/esm/tree/treeItem.js +91 -0
- package/dist/esm/tree/treeText.d.ts +5 -0
- package/dist/esm/tree/treeText.d.ts.map +1 -0
- package/dist/esm/tree/treeText.js +12 -0
- package/dist/esm/tree/useTreeState.d.ts +9 -0
- package/dist/esm/tree/useTreeState.d.ts.map +1 -0
- package/dist/esm/tree/useTreeState.js +6 -0
- package/package.json +1 -1
- package/src/avatar/theme.ts +2 -1
- package/src/badge/theme.ts +5 -4
- package/src/button/theme.ts +2 -1
- package/src/divider/divider.tsx +1 -1
- package/src/dragAndDrop/dragAndDrop.tsx +3 -3
- package/src/dragAndDrop/dragAndDrop.types.ts +1 -1
- package/src/dragAndDrop/theme.ts +24 -3
- package/src/icons/baseIcons/conc/conCreateDataset.ts +4 -3
- package/src/icons/baseIcons/conc/conDataSearchAlt.ts +8 -0
- package/src/icons/baseIcons/conc/conDataSearchPlus.ts +8 -0
- package/src/icons/baseIcons/conc/conDatabase.ts +4 -3
- package/src/icons/baseIcons/conc/conDatabasePlus.ts +4 -3
- package/src/icons/baseIcons/conc/conDataset.ts +4 -3
- package/src/icons/baseIcons/conc/conFolderPlus.ts +2 -2
- package/src/icons/baseIcons/conc/conLNGBunkering.ts +9 -0
- package/src/icons/baseIcons/conc/conReport.ts +4 -3
- package/src/icons/baseIcons/conc/conReport1.ts +9 -0
- package/src/icons/baseIcons/conc/conSensorAlt.ts +9 -0
- package/src/icons/baseIcons/conc/conSensorPlus.ts +9 -0
- package/src/icons/baseIcons/conc/conUploadFile.ts +4 -3
- package/src/icons/baseIcons/conc/conUploadFile1.ts +9 -0
- package/src/icons/baseIcons/icons.ts +11 -4
- package/src/icons/baseIcons/types.ts +15 -1
- package/src/icons/consts.ts +24 -0
- package/src/index.ts +1 -0
- package/src/input/consts.ts +27 -12
- package/src/input/helpText.tsx +3 -3
- package/src/input/input.tsx +5 -14
- package/src/input/input.types.ts +6 -6
- package/src/input/inputIcon.tsx +2 -1
- package/src/input/theme.ts +31 -27
- package/src/pagination/paginationButton.tsx +1 -5
- package/src/pagination/paginationEllipsis.tsx +1 -1
- package/src/pagination/paginationGoToPage.tsx +1 -1
- package/src/pagination/paginationPrevNext.tsx +1 -1
- package/src/pagination/paginationResults.tsx +1 -9
- package/src/pagination/theme.ts +22 -1
- package/src/skeleton/skeleton.types.ts +1 -1
- package/src/skeleton/theme.ts +9 -28
- package/src/tag/tag.tsx +2 -4
- package/src/tag/theme.ts +10 -9
- package/src/theme/components.ts +3 -1
- package/src/tooltip/tooltip.tsx +1 -1
- package/src/tooltip/tooltipContent.tsx +17 -21
- package/src/tree/context.ts +5 -0
- package/src/tree/index.ts +7 -0
- package/src/tree/theme.ts +76 -0
- package/src/tree/tree.tsx +121 -0
- package/src/tree/tree.types.ts +65 -0
- package/src/tree/treeIcon.tsx +16 -0
- package/src/tree/treeItem.tsx +177 -0
- package/src/tree/treeText.tsx +26 -0
- package/src/tree/useTreeState.ts +10 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Dict } from '../utils';
|
|
2
|
+
declare function variantDefault(props: Dict): {
|
|
3
|
+
item: Dict<any>;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: {
|
|
6
|
+
baseStyle: {};
|
|
7
|
+
defaultProps: {
|
|
8
|
+
size: string;
|
|
9
|
+
variant: string;
|
|
10
|
+
};
|
|
11
|
+
parts: string[];
|
|
12
|
+
sizes: {
|
|
13
|
+
sm: {
|
|
14
|
+
icon: {
|
|
15
|
+
size: string;
|
|
16
|
+
};
|
|
17
|
+
item: {
|
|
18
|
+
fontSize: string;
|
|
19
|
+
h: number;
|
|
20
|
+
py: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
md: {
|
|
24
|
+
icon: {
|
|
25
|
+
size: string;
|
|
26
|
+
};
|
|
27
|
+
item: {
|
|
28
|
+
fontSize: string;
|
|
29
|
+
h: number;
|
|
30
|
+
py: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
lg: {
|
|
34
|
+
item: {
|
|
35
|
+
fontSize: string;
|
|
36
|
+
h: number;
|
|
37
|
+
py: string;
|
|
38
|
+
};
|
|
39
|
+
icon: {
|
|
40
|
+
size: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
xl: {
|
|
44
|
+
item: {
|
|
45
|
+
fontSize: string;
|
|
46
|
+
h: number;
|
|
47
|
+
py: string;
|
|
48
|
+
};
|
|
49
|
+
icon: {
|
|
50
|
+
scale: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
variants: {
|
|
55
|
+
default: typeof variantDefault;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export default _default;
|
|
59
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/tree/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,iBAAS,cAAc,CAAC,KAAK,EAAE,IAAI;;EASlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DD,wBAMC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function variantDefault(props) {
|
|
2
|
+
const item = {
|
|
3
|
+
activeBg: 'skyBlue.30',
|
|
4
|
+
hoverBg: 'skyBlue.20',
|
|
5
|
+
selectedBg: 'skyBlue.10',
|
|
6
|
+
px: 2
|
|
7
|
+
};
|
|
8
|
+
return { item };
|
|
9
|
+
}
|
|
10
|
+
const baseStyle = {};
|
|
11
|
+
const defaultProps = {
|
|
12
|
+
size: 'md',
|
|
13
|
+
variant: 'default'
|
|
14
|
+
};
|
|
15
|
+
const parts = ['container', 'icon', 'item', 'text'];
|
|
16
|
+
const sizes = {
|
|
17
|
+
sm: {
|
|
18
|
+
icon: {
|
|
19
|
+
size: 'xs'
|
|
20
|
+
},
|
|
21
|
+
item: {
|
|
22
|
+
fontSize: 'md',
|
|
23
|
+
h: 32,
|
|
24
|
+
py: '3px'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
md: {
|
|
28
|
+
icon: {
|
|
29
|
+
size: 'sm'
|
|
30
|
+
},
|
|
31
|
+
item: {
|
|
32
|
+
fontSize: 'md',
|
|
33
|
+
h: 40,
|
|
34
|
+
py: '5px'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
lg: {
|
|
38
|
+
item: {
|
|
39
|
+
fontSize: 'md',
|
|
40
|
+
h: 48,
|
|
41
|
+
py: '7px'
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
size: 'md'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
xl: {
|
|
48
|
+
item: {
|
|
49
|
+
fontSize: 'lg',
|
|
50
|
+
h: 56,
|
|
51
|
+
py: '9px'
|
|
52
|
+
},
|
|
53
|
+
icon: {
|
|
54
|
+
scale: 2
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const variants = {
|
|
59
|
+
default: variantDefault
|
|
60
|
+
};
|
|
61
|
+
export default {
|
|
62
|
+
baseStyle,
|
|
63
|
+
defaultProps,
|
|
64
|
+
parts,
|
|
65
|
+
sizes,
|
|
66
|
+
variants
|
|
67
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VuiComponent } from '../core';
|
|
2
|
+
import { TreeProps } from './tree.types';
|
|
3
|
+
import TreeIcon from './treeIcon';
|
|
4
|
+
import TreeItem from './treeItem';
|
|
5
|
+
import TreeText from './treeText';
|
|
6
|
+
export declare const TreeBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
7
|
+
/** Displays a tree of tree link items and optional heading. Exposes some props to the children via context. */
|
|
8
|
+
export declare const Tree: VuiComponent<"div", TreeProps> & {
|
|
9
|
+
Icon: typeof TreeIcon;
|
|
10
|
+
Item: typeof TreeItem;
|
|
11
|
+
Text: typeof TreeText;
|
|
12
|
+
};
|
|
13
|
+
export default Tree;
|
|
14
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/tree/tree.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,YAAY,EAAE,MAAM,SAAS,CAAA;AAGnE,OAAO,EAA6B,SAAS,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,QAAQ,MAAM,YAAY,CAAA;AAGjC,eAAO,MAAM,QAAQ,+HAKpB,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,IAAI;UA4FT,eAAe;UACf,eAAe;UACf,eAAe;CACtB,CAAA;AAMD,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { Children, useEffect, useMemo } from 'react';
|
|
2
|
+
import { styled, useStyleConfig, vui } from '../core';
|
|
3
|
+
import { cs, filterUndefined } from '../utils';
|
|
4
|
+
import { TreeProvider } from './context';
|
|
5
|
+
import TreeIcon from './treeIcon';
|
|
6
|
+
import TreeItem from './treeItem';
|
|
7
|
+
import TreeText from './treeText';
|
|
8
|
+
import { useTreeState } from './useTreeState';
|
|
9
|
+
export const TreeBase = styled.divBox `
|
|
10
|
+
display: flex;
|
|
11
|
+
height: auto;
|
|
12
|
+
align-content: flex-start;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
`;
|
|
15
|
+
/** Displays a tree of tree link items and optional heading. Exposes some props to the children via context. */
|
|
16
|
+
export const Tree = vui((props, ref) => {
|
|
17
|
+
const { activeItemId, children, className, iconCollapse = 'falMinus', iconExpand = 'falPlus', items, onClickItem, size, variant, ...rest } = props;
|
|
18
|
+
const styles = useStyleConfig('Tree', props);
|
|
19
|
+
const { itemsInternal, setItemsInternal, activeItemIndex, setActiveItemIndex } = useTreeState(activeItemId);
|
|
20
|
+
const context = useMemo(() => filterUndefined({ size, variant }), [size, variant]);
|
|
21
|
+
const transformChildrenToItems = (children) => {
|
|
22
|
+
const t = [];
|
|
23
|
+
if (children) {
|
|
24
|
+
;
|
|
25
|
+
Children.toArray(children).forEach((child, index) => {
|
|
26
|
+
if (child?.props?.text) {
|
|
27
|
+
let items = [];
|
|
28
|
+
if (child.props.children) {
|
|
29
|
+
items = transformChildrenToItems(child.props.children);
|
|
30
|
+
}
|
|
31
|
+
t.push({
|
|
32
|
+
id: child.props.id,
|
|
33
|
+
text: child.props.text,
|
|
34
|
+
isActive: child.props.isActive,
|
|
35
|
+
items: child.props.items || items,
|
|
36
|
+
isCollapsed: child.props.isCollapsed,
|
|
37
|
+
disabled: child.props.disabled,
|
|
38
|
+
onClickTreeItem: onClickTreeItem
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (items) {
|
|
47
|
+
setItemsInternal(items);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const t = [];
|
|
51
|
+
if (children) {
|
|
52
|
+
const transformed = transformChildrenToItems(children);
|
|
53
|
+
t.push(...transformed);
|
|
54
|
+
}
|
|
55
|
+
setItemsInternal(t);
|
|
56
|
+
if (activeItemId !== undefined && t?.find((i) => i.id === activeItemId)) {
|
|
57
|
+
setActiveItemIndex(activeItemId);
|
|
58
|
+
}
|
|
59
|
+
}, [children, activeItemId]);
|
|
60
|
+
const onClickTreeItem = (id) => {
|
|
61
|
+
setActiveItemIndex(id);
|
|
62
|
+
if (onClickItem) {
|
|
63
|
+
onClickItem(id);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return (React.createElement(TreeProvider, { value: context },
|
|
67
|
+
React.createElement(TreeBase, { className: cs('vui-tree', className), ref: ref, ...styles.container, ...rest }, itemsInternal?.map(({ id, isActive, ...props }, index) => {
|
|
68
|
+
return (React.createElement(TreeItem, { activeItemIndex: activeItemIndex, iconCollapse: iconCollapse, iconExpand: iconExpand, id: id, isActive: activeItemIndex ? activeItemIndex === id : false, key: id ?? index, onClickTreeItem: onClickTreeItem, ...props }));
|
|
69
|
+
}))));
|
|
70
|
+
});
|
|
71
|
+
Tree.Icon = TreeIcon;
|
|
72
|
+
Tree.Item = TreeItem;
|
|
73
|
+
Tree.Text = TreeText;
|
|
74
|
+
export default Tree;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ReactNode, ReactText } from 'react';
|
|
2
|
+
import { IconProp } from '../icon';
|
|
3
|
+
import { LinkProps } from '../link';
|
|
4
|
+
import { SystemProps } from '../system';
|
|
5
|
+
import { ThemingProps } from '../theme';
|
|
6
|
+
import { PropsOf } from '../utils';
|
|
7
|
+
export declare type TreeProps = SystemProps & ThemingProps<'Tree'> & {
|
|
8
|
+
/** Currently selected item. */
|
|
9
|
+
activeItemId?: TreeItemId;
|
|
10
|
+
/** Socket defining the collapse icon on the left. */
|
|
11
|
+
iconCollapse?: IconProp;
|
|
12
|
+
/** Socket defining the expand icon on the left. */
|
|
13
|
+
iconExpand?: IconProp;
|
|
14
|
+
/** Socket displaying a tree of items. */
|
|
15
|
+
items?: PropsOf<'div', TreeItemProps>[] | JSX.Element;
|
|
16
|
+
/** Socket defining the size of the tree. */
|
|
17
|
+
onClickItem?: (id: TreeItemId) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare type TreeItemLinkProps = PropsOf<'a', LinkProps> | object;
|
|
20
|
+
export declare type TreeItemId = string | number;
|
|
21
|
+
export declare type TreeOnToggleEvent = {
|
|
22
|
+
id: TreeItemId;
|
|
23
|
+
collapsed: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare type TreeItemProps = SystemProps & ThemingProps<'Tree'> & {
|
|
26
|
+
activeItemId?: TreeItemId;
|
|
27
|
+
/** internal, not exposed */
|
|
28
|
+
activeItemIndex?: TreeItemId;
|
|
29
|
+
/** Unique ID */
|
|
30
|
+
id: TreeItemId;
|
|
31
|
+
/** Centers the content vertically and horizontally. @deprecated */
|
|
32
|
+
center?: boolean;
|
|
33
|
+
/** Centers the content horizontally. @deprecated */
|
|
34
|
+
centerH?: boolean;
|
|
35
|
+
/** Centers the content vertically. @deprecated */
|
|
36
|
+
centerV?: boolean;
|
|
37
|
+
/** Socket defining the collapse icon on the left. */
|
|
38
|
+
iconCollapse?: IconProp;
|
|
39
|
+
/** Socket defining the expand icon on the left. */
|
|
40
|
+
iconExpand?: IconProp;
|
|
41
|
+
/** The children of this tree item. */
|
|
42
|
+
items?: PropsOf<'div', TreeItemProps>[];
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
/** Collapsed state */
|
|
45
|
+
isCollapsed?: boolean;
|
|
46
|
+
/** Displays item and its content in disabled state with appropriate styling. */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Displays item in selected state with appropriate styling. */
|
|
49
|
+
isActive?: boolean;
|
|
50
|
+
/** If provided, content is wrapper with a link and the props are provided to the element. */
|
|
51
|
+
linkProps?: TreeItemLinkProps;
|
|
52
|
+
/** Socket displaying text within the item. */
|
|
53
|
+
text: ReactText | JSX.Element;
|
|
54
|
+
/** Collapse change state */
|
|
55
|
+
onToggle?: (event: TreeOnToggleEvent) => void;
|
|
56
|
+
onClickTreeItem?: (id: TreeItemId) => void;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=tree.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.types.d.ts","sourceRoot":"","sources":["../../../src/tree/tree.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,oBAAY,SAAS,GAAG,WAAW,GACjC,YAAY,CAAC,MAAM,CAAC,GAAG;IACrB,gCAAgC;IAChC,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB,qDAAqD;IACrD,YAAY,CAAC,EAAE,QAAQ,CAAA;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,CAAC,OAAO,CAAA;IACrD,4CAA4C;IAC5C,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,IAAI,CAAA;CACvC,CAAA;AAEH,oBAAY,iBAAiB,GAAG,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,MAAM,CAAA;AAEhE,oBAAY,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;AAExC,oBAAY,iBAAiB,GAAG;IAC9B,EAAE,EAAE,UAAU,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,oBAAY,aAAa,GAAG,WAAW,GACrC,YAAY,CAAC,MAAM,CAAC,GAAG;IACrB,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB,4BAA4B;IAC5B,eAAe,CAAC,EAAE,UAAU,CAAA;IAC5B,gBAAgB;IAChB,EAAE,EAAE,UAAU,CAAA;IACd,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qDAAqD;IACrD,YAAY,CAAC,EAAE,QAAQ,CAAA;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,sCAAsC;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,CAAA;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,sBAAsB;IACtB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,8CAA8C;IAC9C,IAAI,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC7C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,IAAI,CAAA;CAC3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeIcon.d.ts","sourceRoot":"","sources":["../../../src/tree/treeIcon.tsx"],"names":[],"mappings":"AAGA,OAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAIzC,oDAAoD;AACpD,eAAO,MAAM,QAAQ,kDAKnB,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useStyleConfig, vui } from '../core';
|
|
3
|
+
import Icon from '../icon';
|
|
4
|
+
import { cs } from '../utils';
|
|
5
|
+
import { useTreeContext } from './context';
|
|
6
|
+
/** Displays an icon on the side of the TreeItem. */
|
|
7
|
+
export const TreeIcon = vui((props, ref) => {
|
|
8
|
+
const { className, ...rest } = props;
|
|
9
|
+
const styles = useStyleConfig('Tree', useTreeContext());
|
|
10
|
+
return React.createElement(Icon, { className: cs('vui-treeIcon', className), ref: ref, size: "xs", ...styles.icon, ...rest });
|
|
11
|
+
});
|
|
12
|
+
export default TreeIcon;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TreeItemProps } from './tree.types';
|
|
2
|
+
export declare const TreeItemBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/**
|
|
4
|
+
* Displays a tree item with text and optional icons. Can be shown as selected.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TreeItem: import("../core").VuiComponent<"div", TreeItemProps>;
|
|
7
|
+
export default TreeItem;
|
|
8
|
+
//# sourceMappingURL=treeItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeItem.d.ts","sourceRoot":"","sources":["../../../src/tree/treeItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAI5C,eAAO,MAAM,YAAY,+HAcxB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,sDAiJnB,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Box } from '../box';
|
|
3
|
+
import { styled, useStyleConfig, vui } from '../core';
|
|
4
|
+
import { cs, isArray, isReactText } from '../utils';
|
|
5
|
+
import { useTreeContext } from './context';
|
|
6
|
+
import TreeIcon from './treeIcon';
|
|
7
|
+
import TreeText from './treeText';
|
|
8
|
+
export const TreeItemBase = styled.divBox `
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
line-height: normal;
|
|
12
|
+
outline: none;
|
|
13
|
+
align-content: flex-start;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
overflow: visible;
|
|
16
|
+
height: auto;
|
|
17
|
+
|
|
18
|
+
& [aria-disabled='true'] {
|
|
19
|
+
cursor: not-allowed;
|
|
20
|
+
user-select: none;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
/**
|
|
24
|
+
* Displays a tree item with text and optional icons. Can be shown as selected.
|
|
25
|
+
*/
|
|
26
|
+
export const TreeItem = vui((props, ref) => {
|
|
27
|
+
const mergedProps = { ...useTreeContext(), ...props };
|
|
28
|
+
const { activeItemId, activeItemIndex, children, center, centerH, centerV = true, className, iconCollapse = 'falMinus', isCollapsed, disabled, iconExpand = 'falPlus', id, items, isActive, isTruncated, key, onClickTreeItem, onToggle, text, ...rest } = mergedProps;
|
|
29
|
+
const styles = useStyleConfig('Tree', useTreeContext());
|
|
30
|
+
const { activeBg, h, hoverBg, p, px, py, selectedBg, ...itemStyles } = styles.item;
|
|
31
|
+
const [collapsedInternal, setIsCollapsedInternal] = useState(false);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
setIsCollapsedInternal(!!isCollapsed);
|
|
34
|
+
}, [isCollapsed]);
|
|
35
|
+
const toggle = (e) => {
|
|
36
|
+
if (!disabled) {
|
|
37
|
+
onToggle?.({ id, collapsed: !collapsedInternal });
|
|
38
|
+
setIsCollapsedInternal(!collapsedInternal);
|
|
39
|
+
}
|
|
40
|
+
const target = e.target;
|
|
41
|
+
const active = target?.closest('.vui-tree')?.getElementsByClassName('vui-treeItem-active')[0];
|
|
42
|
+
active ? (active.style.backgroundColor = 'transparent') : null;
|
|
43
|
+
onClickTreeItem?.(id);
|
|
44
|
+
// Avoids triggering parent's onClick
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
};
|
|
47
|
+
const interactiveProps = !disabled
|
|
48
|
+
? {
|
|
49
|
+
cursor: 'pointer',
|
|
50
|
+
focusVisibleRing: 2,
|
|
51
|
+
hoverBg: 'transparent',
|
|
52
|
+
activeBg: 'transparent',
|
|
53
|
+
userSelect: 'none'
|
|
54
|
+
}
|
|
55
|
+
: {};
|
|
56
|
+
const hoverTreeItem = (e, type) => {
|
|
57
|
+
const target = e.target;
|
|
58
|
+
if (target.classList.contains('vui-treeItem-permanent')) {
|
|
59
|
+
target.style.backgroundColor = type === 'over' ? '#e2f1ff' : 'transparent';
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
const permanent = target
|
|
65
|
+
.closest('.vui-treeItem')
|
|
66
|
+
?.getElementsByClassName('vui-treeItem-permanent')[0];
|
|
67
|
+
const collapsible = target
|
|
68
|
+
.closest('.vui-treeItem')
|
|
69
|
+
?.getElementsByClassName('vui-treeItem-collapsible')[0];
|
|
70
|
+
const active = target.closest('.vui-treeItem')?.getElementsByClassName('vui-treeItem-active')[0];
|
|
71
|
+
permanent ? (permanent.style.backgroundColor = type === 'over' ? '#e2f1ff' : 'transparent') : null;
|
|
72
|
+
collapsible ? (collapsible.style.backgroundColor = 'transparent') : null;
|
|
73
|
+
active ? (active.style.backgroundColor = 'hsl(139, 100%, 90%)') : null;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const isCollapsable = (isArray(children) && children.length > 0) || (isArray(items) && items.length > 0);
|
|
77
|
+
const isActiveInternal = (!activeItemIndex && isActive) || activeItemIndex === id;
|
|
78
|
+
return (React.createElement(TreeItemBase, { alignItems: "start", className: cs('vui-treeItem', className), h: collapsedInternal ? h : isCollapsable ? 'auto' : h, id: id, m: 0, onClick: !disabled ? (e) => toggle(e) : undefined, onMouseOut: !disabled ? (e) => hoverTreeItem(e, 'out') : undefined, onMouseOver: !disabled ? (e) => hoverTreeItem(e, 'over') : undefined, p: 0, ref: ref, w: 1, ...itemStyles, ...interactiveProps, ...rest, hoverBg: "transparent" },
|
|
79
|
+
React.createElement(Box, { flexDirection: "column", hoverBg: "transparent", m: 0, pl: 2, pr: 0, py: py, w: 1 },
|
|
80
|
+
React.createElement(Box, { alignItems: "center", bg: isActiveInternal ? 'hsl(139, 100%, 90%)' : 'transparent', className: isActiveInternal ? 'vui-treeItem-active' : 'vui-treeItem-permanent', flexDirection: "row", hoverBg: "transparent", m: 0, p: 0, w: 1 },
|
|
81
|
+
items && items?.length > 0 && (React.createElement(React.Fragment, null, collapsedInternal ? React.createElement(TreeIcon, { mr: 1, name: iconExpand }) : React.createElement(TreeIcon, { mr: 1, name: iconCollapse }))),
|
|
82
|
+
items?.length === 0 && React.createElement(TreeIcon, { mr: 1, name: "cusDotFullAlt" }),
|
|
83
|
+
isReactText(text) ? React.createElement(TreeText, { ...{ isTruncated, text } }) : text),
|
|
84
|
+
isCollapsable && !collapsedInternal && (React.createElement(Box, { className: "vui-treeItem-collapsible", flexDirection: "column", hoverBg: "transparent", m: 0, p: 0, w: 1 }, children ??
|
|
85
|
+
(isArray(items)
|
|
86
|
+
? items.map(({ key, ...props }, index) => {
|
|
87
|
+
return (React.createElement(TreeItem, { activeItemIndex: activeItemIndex, iconCollapse: iconCollapse, iconExpand: iconExpand, key: key ?? index, onClickTreeItem: onClickTreeItem, ...props }));
|
|
88
|
+
})
|
|
89
|
+
: items))))));
|
|
90
|
+
});
|
|
91
|
+
export default TreeItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeText.d.ts","sourceRoot":"","sources":["../../../src/tree/treeText.tsx"],"names":[],"mappings":"AAGA,OAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAIhC,yCAAyC;AACzC,eAAO,MAAM,QAAQ,gDAenB,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useStyleConfig, vui } from '../core';
|
|
3
|
+
import T from '../t';
|
|
4
|
+
import { cs, ellipsisOverflow } from '../utils';
|
|
5
|
+
import { useTreeContext } from './context';
|
|
6
|
+
/** Displays text within the TreeItem. */
|
|
7
|
+
export const TreeText = vui((props, ref) => {
|
|
8
|
+
const { className, ...rest } = props;
|
|
9
|
+
const styles = useStyleConfig('Tree', useTreeContext());
|
|
10
|
+
return (React.createElement(T, { className: cs('vui-treeText', className), fontSize: "inherit", py: styles.item.py, ref: ref, ...ellipsisOverflow, ...styles.text, ...rest }));
|
|
11
|
+
});
|
|
12
|
+
export default TreeText;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TreeItemId, TreeItemProps } from './tree.types';
|
|
3
|
+
export declare const useTreeState: (activeItemId?: TreeItemId) => {
|
|
4
|
+
itemsInternal: TreeItemProps[];
|
|
5
|
+
setItemsInternal: import("react").Dispatch<import("react").SetStateAction<TreeItemProps[]>>;
|
|
6
|
+
activeItemIndex: TreeItemId;
|
|
7
|
+
setActiveItemIndex: import("react").Dispatch<import("react").SetStateAction<TreeItemId>>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useTreeState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTreeState.d.ts","sourceRoot":"","sources":["../../../src/tree/useTreeState.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAExD,eAAO,MAAM,YAAY,kBAAmB,UAAU;;;;;CAKrD,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
export const useTreeState = (activeItemId) => {
|
|
3
|
+
const [itemsInternal, setItemsInternal] = useState([]);
|
|
4
|
+
const [activeItemIndex, setActiveItemIndex] = useState(activeItemId ?? '');
|
|
5
|
+
return { itemsInternal, setItemsInternal, activeItemIndex, setActiveItemIndex };
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/avatar/theme.ts
CHANGED
package/src/badge/theme.ts
CHANGED
|
@@ -2,7 +2,8 @@ const baseStyle = {}
|
|
|
2
2
|
|
|
3
3
|
const defaultProps = {
|
|
4
4
|
size: 'md',
|
|
5
|
-
variant: 'subtleSandstone'
|
|
5
|
+
variant: 'subtleSandstone',
|
|
6
|
+
fontWeight: 'medium'
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
const parts = ['container', 'icon', 'text']
|
|
@@ -54,7 +55,7 @@ const sizes = {
|
|
|
54
55
|
const variants = {
|
|
55
56
|
subtleSandstone: {
|
|
56
57
|
container: {
|
|
57
|
-
bg: 'sandstone.
|
|
58
|
+
bg: 'sandstone.90',
|
|
58
59
|
color: 'sandstone.20',
|
|
59
60
|
borderColor: 'transparent'
|
|
60
61
|
}
|
|
@@ -119,8 +120,8 @@ const variants = {
|
|
|
119
120
|
},
|
|
120
121
|
solidYellow: {
|
|
121
122
|
container: {
|
|
122
|
-
bg: 'sunflower.
|
|
123
|
-
color: 'sunflower.
|
|
123
|
+
bg: 'sunflower.50',
|
|
124
|
+
color: 'sunflower.15'
|
|
124
125
|
}
|
|
125
126
|
},
|
|
126
127
|
solidGreen: {
|
package/src/button/theme.ts
CHANGED
package/src/divider/divider.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { cs, filterUndefined } from '../utils'
|
|
|
5
5
|
import { DividerProps } from './divider.types'
|
|
6
6
|
|
|
7
7
|
export const DividerBase = styled.hrBox`
|
|
8
|
-
border-color:
|
|
8
|
+
border-color: sandstone.90;
|
|
9
9
|
`
|
|
10
10
|
|
|
11
11
|
/** Visually separates content with a horizontal or vertical line. */
|
|
@@ -17,7 +17,7 @@ const DragAndDropBase = styled.labelBox`
|
|
|
17
17
|
justify-content: center;
|
|
18
18
|
`
|
|
19
19
|
|
|
20
|
-
/**
|
|
20
|
+
/** Prepares uploading files by selecting or dragging. */
|
|
21
21
|
export const DragAndDrop = vui<'label', DragAndDropProps>((props, ref) => {
|
|
22
22
|
const {
|
|
23
23
|
accept,
|
|
@@ -51,12 +51,12 @@ export const DragAndDrop = vui<'label', DragAndDropProps>((props, ref) => {
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<DragAndDropBase
|
|
54
|
-
bg={disabled ? 'grey.20' : 'blue.20'}
|
|
55
54
|
className={cs('vui-drag-and-drop', className)}
|
|
56
55
|
cursor={disabled ? 'not-allowed' : 'pointer'}
|
|
57
56
|
onDragEnter={e => e.preventDefault()}
|
|
58
57
|
onDragOver={e => e.preventDefault()}
|
|
59
58
|
onDrop={e => handleDrop(e)}
|
|
59
|
+
opacity={disabled ? 0.5 : 1}
|
|
60
60
|
p={5}
|
|
61
61
|
pointerEvents={disabled ? 'none' : 'auto'}
|
|
62
62
|
ref={ref}
|
|
@@ -64,7 +64,7 @@ export const DragAndDrop = vui<'label', DragAndDropProps>((props, ref) => {
|
|
|
64
64
|
{...rest}
|
|
65
65
|
>
|
|
66
66
|
{children || (
|
|
67
|
-
<T
|
|
67
|
+
<T display="flex">
|
|
68
68
|
<Icon mr={1} name={icon} />
|
|
69
69
|
{text}
|
|
70
70
|
</T>
|
|
@@ -2,7 +2,7 @@ import { BoxProps } from '../box'
|
|
|
2
2
|
import { IconProp } from '../icon'
|
|
3
3
|
import { ThemingProps } from '../theme'
|
|
4
4
|
|
|
5
|
-
export type DragAndDropProps = BoxProps &
|
|
5
|
+
export type DragAndDropProps = Omit<BoxProps, 'variant'> &
|
|
6
6
|
ThemingProps<'DragAndDrop'> & {
|
|
7
7
|
/** A string that defines the file types the file input should accept. This string is a comma-separated list of [unique file type specifiers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers). */
|
|
8
8
|
accept?: string
|
package/src/dragAndDrop/theme.ts
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
const
|
|
1
|
+
const colors = {
|
|
2
|
+
bg: 'skyBlue.95',
|
|
3
|
+
main: 'seaBlue.28',
|
|
4
|
+
hover: 'skyBlue.90'
|
|
5
|
+
}
|
|
2
6
|
|
|
3
|
-
const
|
|
7
|
+
const baseStyle = {
|
|
8
|
+
borderWidth: 2,
|
|
9
|
+
borderStyle: 'solid',
|
|
10
|
+
borderColor: 'transparent',
|
|
11
|
+
bg: colors.bg,
|
|
12
|
+
color: colors.main,
|
|
13
|
+
hoverBg: colors.hover
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const defaultProps = {
|
|
17
|
+
variant: 'default'
|
|
18
|
+
}
|
|
4
19
|
|
|
5
20
|
const sizes = {}
|
|
6
21
|
|
|
7
|
-
const variants = {
|
|
22
|
+
const variants = {
|
|
23
|
+
default: {},
|
|
24
|
+
outlined: {
|
|
25
|
+
borderColor: colors.main,
|
|
26
|
+
borderStyle: 'dashed'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
8
29
|
|
|
9
30
|
export default {
|
|
10
31
|
baseStyle,
|