@hitachivantara/uikit-react-core 6.0.0-next.1 → 6.0.0-next.10

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.
Files changed (46) hide show
  1. package/dist/ActionBar/ActionBar.styles.js +1 -1
  2. package/dist/BaseDropdown/BaseDropdownPanel.js +1 -2
  3. package/dist/Button/Button.js +2 -2
  4. package/dist/CheckBox/CheckBox.js +2 -1
  5. package/dist/CheckBox/CheckBox.styles.js +10 -11
  6. package/dist/ColorPicker/ColorPicker.js +15 -21
  7. package/dist/ColorPicker/ColorPicker.styles.js +5 -10
  8. package/dist/ColorPicker/{Fields → Picker}/Fields.js +54 -44
  9. package/dist/ColorPicker/Picker/Picker.js +32 -41
  10. package/dist/ColorPicker/Picker/Picker.styles.js +21 -37
  11. package/dist/ColorPicker/PresetColors/PresetColors.js +5 -20
  12. package/dist/ColorPicker/PresetColors/PresetColors.styles.js +1 -10
  13. package/dist/ColorPicker/SavedColors/SavedColors.js +14 -37
  14. package/dist/ColorPicker/SavedColors/SavedColors.styles.js +9 -24
  15. package/dist/ColorPicker/Swatch.js +39 -0
  16. package/dist/FormElement/Suggestions/Suggestions.js +1 -2
  17. package/dist/Header/Actions/Actions.styles.js +2 -5
  18. package/dist/Header/Header.js +0 -1
  19. package/dist/Header/Header.styles.js +1 -2
  20. package/dist/Input/Input.js +1 -1
  21. package/dist/OverflowTooltip/OverflowTooltip.js +2 -2
  22. package/dist/Pagination/Pagination.js +17 -39
  23. package/dist/Pagination/Pagination.styles.js +32 -54
  24. package/dist/Radio/Radio.js +2 -2
  25. package/dist/Radio/Radio.styles.js +9 -11
  26. package/dist/SearchInput/SearchInput.styles.js +1 -2
  27. package/dist/Select/Option.js +1 -1
  28. package/dist/Select/OptionGroup.js +1 -1
  29. package/dist/Select/Select.js +4 -4
  30. package/dist/StatusIcon/StatusIcon.js +4 -4
  31. package/dist/StatusIcon/StatusIcon.styles.js +9 -14
  32. package/dist/Tag/Tag.js +1 -1
  33. package/dist/TextArea/TextArea.js +1 -1
  34. package/dist/TreeView/TreeView.js +1 -1
  35. package/dist/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +1 -2
  36. package/dist/icons.js +2 -2
  37. package/dist/index.d.ts +98 -115
  38. package/dist/index.js +3 -4
  39. package/dist/providers/Provider.js +3 -3
  40. package/dist/providers/ThemeProvider.js +24 -6
  41. package/dist/themes/index.js +3 -3
  42. package/dist/themes/{ds5.js → next.js} +4 -16
  43. package/dist/themes/pentaho.js +34 -1
  44. package/dist/utils/theme.js +0 -20
  45. package/package.json +11 -10
  46. package/dist/ColorPicker/Fields/Fields.styles.js +0 -36
@@ -12,9 +12,10 @@ const HvThemeProvider = ({
12
12
  colorMode: colorModeProp,
13
13
  themeRootId: rootId
14
14
  }) => {
15
- const [colorMode, setColorMode] = useState(colorModeProp);
15
+ const [colorModeValue, setColorModeValue] = useState(colorModeProp);
16
+ const colorMode = colorModeValue === "dark" ? "dark" : "light";
16
17
  useEffect(() => {
17
- setColorMode(colorModeProp);
18
+ setColorModeValue(colorModeProp);
18
19
  }, [colorModeProp]);
19
20
  useEffect(() => {
20
21
  const element = getContainerElement(rootId);
@@ -24,17 +25,34 @@ const HvThemeProvider = ({
24
25
  const value = useMemo(
25
26
  () => ({
26
27
  colorModes: ["light", "dark"],
27
- activeTheme: theme,
28
+ // activeTheme: theme as HvTheme,
28
29
  selectedMode: colorMode,
29
30
  changeMode(newMode = colorMode) {
30
- setColorMode(newMode);
31
+ setColorModeValue(newMode);
31
32
  },
32
- rootId
33
+ rootId,
34
+ // TODO: remove once backwards-compatibility is not needed anymore
35
+ activeTheme: {
36
+ ...theme,
37
+ colors: {
38
+ ...theme.colors,
39
+ modes: {
40
+ ...theme.colors,
41
+ light: { ...theme.colors.light, type: "light" },
42
+ dark: { ...theme.colors.dark, type: "dark" }
43
+ }
44
+ }
45
+ },
46
+ themes: [theme],
47
+ selectedTheme: theme.name,
48
+ changeTheme(theme2, mode) {
49
+ setColorModeValue(mode);
50
+ }
33
51
  }),
34
52
  [theme, colorMode, rootId]
35
53
  );
36
54
  const muiTheme = useMemo(() => {
37
- const colors = theme.colors[colorMode];
55
+ const colors = theme.colors[colorMode] || theme.colors.light;
38
56
  return createTheme({
39
57
  colorSchemes: { light: true, dark: true },
40
58
  spacing: theme.space.base,
@@ -1,8 +1,8 @@
1
- import { ds5 } from "./ds5.js";
1
+ import { next } from "./next.js";
2
2
  import { pentaho } from "./pentaho.js";
3
- const themes = { ds5, pentaho };
3
+ const themes = { next, pentaho };
4
4
  export {
5
- ds5,
5
+ next,
6
6
  pentaho,
7
7
  themes
8
8
  };
@@ -1,5 +1,5 @@
1
- import { mergeTheme, ds5 as ds5$1, theme } from "@hitachivantara/uikit-styles";
2
- const ds5 = mergeTheme(ds5$1, {
1
+ import { mergeTheme, next as next$1, theme } from "@hitachivantara/uikit-styles";
2
+ const next = mergeTheme(next$1, {
3
3
  components: {
4
4
  HvAvatar: {
5
5
  classes: {
@@ -122,20 +122,8 @@ const ds5 = mergeTheme(ds5$1, {
122
122
  HvColorPicker: {
123
123
  classes: {
124
124
  colorPicker: {
125
- " .HvColorPickerPresetColors-swatchWrap > span > div": {
125
+ ".HvColorPickerSwatch-root": {
126
126
  borderRadius: theme.radii.round
127
- },
128
- " .HvColorPickerSavedColors-swatchWrap > span > div": {
129
- borderRadius: theme.radii.round
130
- },
131
- " .HvColorPickerPicker-saturation > div": {
132
- borderRadius: theme.radii.round,
133
- " .saturation-white": {
134
- borderRadius: theme.radii.round,
135
- " .saturation-black": {
136
- borderRadius: theme.radii.round
137
- }
138
- }
139
127
  }
140
128
  }
141
129
  }
@@ -280,5 +268,5 @@ const ds5 = mergeTheme(ds5$1, {
280
268
  }
281
269
  });
282
270
  export {
283
- ds5
271
+ next
284
272
  };
@@ -13,12 +13,25 @@ const inputColors = {
13
13
  bg: ld("#FFFFFF", "#020617")
14
14
  };
15
15
  const popperStyles = {
16
+ margin: theme.spacing("xxs", 0),
16
17
  backgroundColor: theme.colors.bgContainer,
17
18
  border: `1px solid ${theme.colors.borderSubtle}`,
18
19
  borderRadius: theme.radii.large,
19
20
  boxShadow: `0px 0px 6px 0px rgba(65, 65, 65, 0.08)`
20
21
  };
21
22
  const pentaho = mergeTheme(pentaho$1, {
23
+ icons: {
24
+ viewBox: "0 0 256 256",
25
+ // Semantic icons
26
+ Success: "M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z",
27
+ Caution: "M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z",
28
+ Fail: "M128,72a8,8,0,0,1,8,8v56a8,8,0,0,1-16,0V80A8,8,0,0,1,128,72ZM116,172a12,12,0,1,0,12-12A12,12,0,0,0,116,172Zm124-44a15.85,15.85,0,0,1-4.67,11.28l-96.05,96.06a16,16,0,0,1-22.56,0h0l-96-96.06a16,16,0,0,1,0-22.56l96.05-96.06a16,16,0,0,1,22.56,0l96.05,96.06A15.85,15.85,0,0,1,240,128Zm-16,0L128,32,32,128,128,224h0Z",
29
+ Info: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z",
30
+ Start: "M205.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L131.31,128ZM51.31,128l74.35-74.34a8,8,0,0,0-11.32-11.32l-80,80a8,8,0,0,0,0,11.32l80,80a8,8,0,0,0,11.32-11.32Z",
31
+ Backwards: "M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z",
32
+ Forwards: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z",
33
+ End: "M141.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L124.69,128,50.34,53.66A8,8,0,0,1,61.66,42.34l80,80A8,8,0,0,1,141.66,133.66Zm80-11.32-80-80a8,8,0,0,0-11.32,11.32L204.69,128l-74.35,74.34a8,8,0,0,0,11.32,11.32l80-80A8,8,0,0,0,221.66,122.34Z"
34
+ },
22
35
  components: {
23
36
  HvLoading: {
24
37
  classes: {
@@ -216,7 +229,7 @@ const pentaho = mergeTheme(pentaho$1, {
216
229
  classes: {
217
230
  root: {
218
231
  borderRadius: theme.radii.round,
219
- "& .HvButton-subtle[data-color=secondary]": {
232
+ "& .HvButton-subtle[data-color=text]": {
220
233
  borderColor: theme.colors.textDimmed,
221
234
  backgroundColor: inputColors.bg
222
235
  }
@@ -537,6 +550,16 @@ const pentaho = mergeTheme(pentaho$1, {
537
550
  }
538
551
  }
539
552
  },
553
+ HvPagination: {
554
+ classes: {
555
+ root: {
556
+ ...theme.typography.caption1
557
+ },
558
+ icon: {
559
+ fontSize: 16
560
+ }
561
+ }
562
+ },
540
563
  HvHeader: {
541
564
  classes: {
542
565
  root: {
@@ -682,6 +705,9 @@ const pentaho = mergeTheme(pentaho$1, {
682
705
  display: "none"
683
706
  }
684
707
  },
708
+ "& .MuiCardContent-root:last-child": {
709
+ paddingBottom: 0
710
+ },
685
711
  "& > :last-child:not(.HvCardMedia-root)": {
686
712
  paddingBottom: theme.space.sm
687
713
  },
@@ -838,6 +864,13 @@ const pentaho = mergeTheme(pentaho$1, {
838
864
  borderRadius: theme.radii.none
839
865
  }
840
866
  }
867
+ },
868
+ HvTooltip: {
869
+ classes: {
870
+ tooltip: {
871
+ padding: theme.spacing("xs", "sm")
872
+ }
873
+ }
841
874
  }
842
875
  }
843
876
  });
@@ -1,29 +1,9 @@
1
- import { themes } from "../themes/index.js";
2
1
  const setElementAttrs = (element, themeName, modeName) => {
3
2
  element.dataset.theme = themeName;
4
3
  element.dataset.colorMode = modeName;
5
4
  element.classList.add("uikit-root-element");
6
5
  element.style.colorScheme = modeName;
7
6
  };
8
- const processThemes = (themesList) => {
9
- if (themesList && Array.isArray(themesList) && themesList.length > 0) {
10
- const list = [];
11
- themesList.forEach((thm) => {
12
- const i = list.findIndex(
13
- (t) => t.name.trim() === thm.name.trim()
14
- );
15
- if (i !== -1) {
16
- list.splice(i, 1);
17
- list.push(thm);
18
- } else {
19
- list.push(thm);
20
- }
21
- });
22
- return list;
23
- }
24
- return [themes.ds5];
25
- };
26
7
  export {
27
- processThemes,
28
8
  setElementAttrs
29
9
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "6.0.0-next.1",
3
+ "version": "6.0.0-next.10",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "author": "Hitachi Vantara UI Kit Team",
7
7
  "description": "UI Kit Core React components.",
8
- "homepage": "https://github.com/lumada-design/hv-uikit-react",
8
+ "homepage": "https://github.com/pentaho/hv-uikit-react",
9
9
  "sideEffects": false,
10
10
  "keywords": [
11
11
  "hitachi-vantara",
@@ -16,12 +16,12 @@
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/lumada-design/hv-uikit-react.git",
19
+ "url": "git+https://github.com/pentaho/hv-uikit-react.git",
20
20
  "directory": "packages/core"
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "bugs": {
24
- "url": "https://github.com/lumada-design/hv-uikit-react/issues"
24
+ "url": "https://github.com/pentaho/hv-uikit-react/issues"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@emotion/react": "^11.11.1",
@@ -33,21 +33,22 @@
33
33
  "dependencies": {
34
34
  "@emotion/cache": "^11.11.0",
35
35
  "@emotion/serialize": "^1.1.2",
36
- "@hitachivantara/uikit-react-shared": "^6.0.0-next.1",
37
- "@hitachivantara/uikit-react-utils": "^6.0.0-next.1",
38
- "@hitachivantara/uikit-styles": "^6.0.0-next.1",
36
+ "@hitachivantara/uikit-react-shared": "^6.0.0-next.6",
37
+ "@hitachivantara/uikit-react-utils": "^6.0.0-next.6",
38
+ "@hitachivantara/uikit-styles": "^6.0.0-next.5",
39
39
  "@internationalized/date": "^3.2.0",
40
40
  "@mui/base": "5.0.0-beta.68",
41
41
  "@popperjs/core": "^2.11.8",
42
42
  "@react-aria/datepicker": "^3.9.0",
43
43
  "@react-stately/datepicker": "^3.9.0",
44
44
  "@types/react-table": "^7.7.18",
45
+ "@uiw/react-color-hue": "^2.9.2",
46
+ "@uiw/react-color-saturation": "^2.9.2",
45
47
  "clsx": "^2.0.0",
46
48
  "embla-carousel-react": "^8.1.3",
47
49
  "notistack": "^3.0.2",
48
50
  "rc-slider": "^10.5.0",
49
51
  "rc-tooltip": "~6.3.0",
50
- "react-color": "^2.19.3",
51
52
  "react-popper": "^2.3.0",
52
53
  "react-resize-detector": "^8.1.0",
53
54
  "react-table": "^7.8.0",
@@ -60,11 +61,11 @@
60
61
  "access": "public",
61
62
  "directory": "package"
62
63
  },
63
- "gitHead": "f8dfa00a9f29ffdfcabe9cd00553ddf8b7458bd0",
64
+ "gitHead": "f7ad5a89be6f6fe234809656fec7403e0b114b4b",
64
65
  "exports": {
65
66
  ".": {
66
67
  "types": "./dist/index.d.ts",
67
- "import": "./dist/index.js"
68
+ "default": "./dist/index.js"
68
69
  }
69
70
  },
70
71
  "types": "dist/index.d.ts",
@@ -1,36 +0,0 @@
1
- import { createClasses } from "@hitachivantara/uikit-react-utils";
2
- import { theme } from "@hitachivantara/uikit-styles";
3
- const { useClasses } = createClasses("HvColorPickerFields", {
4
- fields: {
5
- width: "100%",
6
- display: "flex",
7
- paddingTop: "18px",
8
- marginRight: "0px"
9
- },
10
- single: {
11
- maxWidth: "50px",
12
- paddingLeft: theme.space.xxs,
13
- "& input": {
14
- marginLeft: 5,
15
- marginRight: 5
16
- },
17
- "& label": {
18
- paddingLeft: 5
19
- }
20
- },
21
- double: {
22
- maxWidth: "82px",
23
- paddingRight: theme.space.xxs,
24
- "& input": {
25
- textTransform: "uppercase",
26
- marginLeft: 5,
27
- marginRight: 5
28
- },
29
- "& label": {
30
- paddingLeft: 5
31
- }
32
- }
33
- });
34
- export {
35
- useClasses
36
- };