@ultraviolet/plus 0.11.1 → 0.12.1

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.
@@ -3,24 +3,33 @@ import { CATEGORY_ICONS } from './Icons.js';
3
3
  import { jsx } from '@emotion/react/jsx-runtime';
4
4
 
5
5
  const StyledIcon = component => /*#__PURE__*/_styled(component, {
6
+ shouldForwardProp: prop => !['variant', 'disabled'].includes(prop),
6
7
  target: "e1wwql4e0"
7
8
  })(".fill{fill:", ({
8
- theme
9
- }) => theme.colors.other.icon.category.primary.fill, ";}.fillStrong{fill:", ({
10
- theme
11
- }) => theme.colors.other.icon.category.primary.fillStrong, ";}");
9
+ theme,
10
+ variant,
11
+ disabled
12
+ }) => theme.colors.other.icon.category[variant][disabled ? 'fillDisabled' : 'fill'], ";}.fillStrong{fill:", ({
13
+ theme,
14
+ variant,
15
+ disabled
16
+ }) => theme.colors.other.icon.category[variant][disabled ? 'fillStrongDisabled' : 'fillStrong'], ";}");
12
17
  /**
13
18
  * CategoryIcon component is used to render category icons, those icons are more complex than system icons
14
19
  * as they involve multiple colors that changes depending on theme.
15
20
  */
16
21
  const CategoryIcon = ({
17
- name
22
+ name,
23
+ variant = 'primary',
24
+ disabled
18
25
  }) => {
19
26
  const Icon = StyledIcon(CATEGORY_ICONS[name]);
20
27
  return jsx(Icon, {
21
28
  width: "20",
22
29
  height: "20",
23
- viewBox: "0 0 20 20"
30
+ viewBox: "0 0 20 20",
31
+ variant: variant,
32
+ disabled: disabled
24
33
  });
25
34
  };
26
35
 
package/dist/index.d.ts CHANGED
@@ -489,9 +489,10 @@ declare const Navigation: {
489
489
  children: ReactNode;
490
490
  label: string;
491
491
  }) => _emotion_react_jsx_runtime.JSX.Element | null;
492
- Item: ({ children, categoryIcon, label, subLabel, badgeText, badgeSentiment, href, onClick, toggle, active, noPinButton, type, hasParents, as, disabled, noExpand, toggleMenu, }: {
492
+ Item: ({ children, categoryIcon, categoryIconVariant, label, subLabel, badgeText, badgeSentiment, href, onClick, toggle, active, noPinButton, type, hasParents, as, disabled, noExpand, toggleMenu, }: {
493
493
  children?: ReactNode;
494
494
  categoryIcon?: "security" | "console" | "database" | "pin" | "billing" | "storage" | "baremetal" | "webHosting" | "vpc" | "useCase" | "toolsServices" | "serverless" | "observability" | "network" | "managedServices" | "iot" | "documentation" | "dedicatedServer" | "datacenter" | "containers" | "compute" | "ai" | "labs" | "devTools" | undefined;
495
+ categoryIconVariant?: "neutral" | "primary" | undefined;
495
496
  label: string;
496
497
  subLabel?: string | undefined;
497
498
  badgeText?: string | undefined;
@@ -82,9 +82,7 @@ const StyledContainer = /*#__PURE__*/_styled(Stack, {
82
82
  theme
83
83
  }) => `${theme.space['0.5']} ${theme.space['1']}`, ";}width:100%;&:hover[data-has-no-expand='false']:not([disabled]):not(\n [data-is-active='true']\n ),&:focus[data-has-no-expand='false']:not([disabled]):not(\n [data-is-active='true']\n ),&[data-has-active-children='true'][data-has-no-expand='false']:not(\n [disabled][data-is-active='true']\n ){background-color:", ({
84
84
  theme
85
- }) => theme.colors.neutral.backgroundHover, ";", ExpandedPinnedButton, ",", CollapsedPinnedButton, "{opacity:1;}&[data-is-pinnable='true']{", StyledBadge, "{opacity:0;}}", WrapText, "{color:", ({
86
- theme
87
- }) => theme.colors.neutral.textWeakHover, ";}}&:active[data-has-no-expand='false']:not([disabled]):not(\n [data-is-active='true']\n ){background-color:", ({
85
+ }) => theme.colors.neutral.backgroundHover, ";", ExpandedPinnedButton, ",", CollapsedPinnedButton, "{opacity:1;}&[data-is-pinnable='true']{", StyledBadge, "{opacity:0;}}}&:active[data-has-no-expand='false']:not([disabled]):not(\n [data-is-active='true']\n ){background-color:", ({
88
86
  theme
89
87
  }) => theme.colors.neutral.backgroundHover, ";}&[data-is-active='true'],&:hover[data-has-active='true']{background-color:", ({
90
88
  theme
@@ -113,6 +111,7 @@ const ContainerCategoryIcon = /*#__PURE__*/_styled(Stack, {
113
111
  const Item = ({
114
112
  children,
115
113
  categoryIcon,
114
+ categoryIconVariant,
116
115
  label,
117
116
  subLabel,
118
117
  badgeText,
@@ -239,14 +238,16 @@ const Item = ({
239
238
  alignItems: "center",
240
239
  justifyContent: "center",
241
240
  children: jsx(CategoryIcon, {
242
- name: categoryIcon
241
+ name: categoryIcon,
242
+ variant: categoryIconVariant,
243
+ disabled: disabled
243
244
  })
244
245
  }) : null, jsxs(Stack, {
245
246
  children: [jsx(WrapText, {
246
247
  as: "span",
247
248
  variant: "bodySmallStrong",
248
249
  sentiment: active ? 'primary' : 'neutral',
249
- prominence: categoryIcon || !hasParents ? undefined : 'weak',
250
+ prominence: (categoryIcon || !hasParents) && !active ? 'strong' : 'weak',
250
251
  animation: animation,
251
252
  disabled: disabled,
252
253
  children: label
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/plus",
3
- "version": "0.11.1",
3
+ "version": "0.12.1",
4
4
  "description": "Ultraviolet Plus",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {
@@ -43,20 +43,20 @@
43
43
  "@emotion/babel-plugin": "11.11.0",
44
44
  "@emotion/react": "11.11.4",
45
45
  "@emotion/styled": "11.11.5",
46
- "@types/react": "18.2.64",
47
- "@types/react-dom": "18.2.21",
46
+ "@types/react": "18.2.74",
47
+ "@types/react-dom": "18.2.23",
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
- "@ultraviolet/icons": "2.11.2",
51
- "@ultraviolet/illustrations": "1.7.0"
50
+ "@ultraviolet/illustrations": "1.7.0",
51
+ "@ultraviolet/icons": "2.12.0"
52
52
  },
53
53
  "dependencies": {
54
54
  "@uiw/codemirror-extensions-langs": "4.21.25",
55
55
  "@uiw/codemirror-theme-material": "4.21.25",
56
56
  "@uiw/react-codemirror": "4.21.25",
57
57
  "react-intersection-observer": "9.8.1",
58
- "@ultraviolet/themes": "1.9.0",
59
- "@ultraviolet/ui": "1.45.1"
58
+ "@ultraviolet/themes": "1.10.0",
59
+ "@ultraviolet/ui": "1.45.2"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "rollup -c ../../rollup.config.mjs",