@wandelbots/wandelbots-js-react-components 1.7.1 → 1.9.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.
Files changed (96) hide show
  1. package/README.md +30 -16
  2. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -1
  3. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  4. package/dist/components/CopyableText.d.ts +5 -0
  5. package/dist/components/CopyableText.d.ts.map +1 -0
  6. package/dist/components/LoadingButton.d.ts +1 -1
  7. package/dist/components/LoadingButton.stories.d.ts +1 -1
  8. package/dist/components/LoadingButton.stories.d.ts.map +1 -1
  9. package/dist/components/ThemeSelect.d.ts.map +1 -1
  10. package/dist/components/VelocitySlider.d.ts.map +1 -1
  11. package/dist/components/VelocitySlider.stories.d.ts +2 -2
  12. package/dist/components/VelocitySlider.stories.d.ts.map +1 -1
  13. package/dist/components/jogging/JoggingCartesianAxisControl.stories.d.ts +1 -1
  14. package/dist/components/jogging/JoggingCartesianAxisControl.stories.d.ts.map +1 -1
  15. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  16. package/dist/components/jogging/JoggingCartesianValues.d.ts +1 -1
  17. package/dist/components/jogging/JoggingCartesianValues.d.ts.map +1 -1
  18. package/dist/components/jogging/JoggingJointLimitDetector.d.ts +2 -2
  19. package/dist/components/jogging/JoggingJointLimitDetector.d.ts.map +1 -1
  20. package/dist/components/jogging/JoggingJointRotationControl.d.ts.map +1 -1
  21. package/dist/components/jogging/JoggingJointRotationControl.stories.d.ts +2 -2
  22. package/dist/components/jogging/JoggingJointRotationControl.stories.d.ts.map +1 -1
  23. package/dist/components/jogging/JoggingJointValues.d.ts +1 -1
  24. package/dist/components/jogging/JoggingJointValues.d.ts.map +1 -1
  25. package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
  26. package/dist/components/jogging/JoggingPanel.d.ts +8 -1
  27. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  28. package/dist/components/jogging/JoggingPanel.stories.d.ts +2 -2
  29. package/dist/components/jogging/JoggingPanel.stories.d.ts.map +1 -1
  30. package/dist/components/jogging/JoggingStore.d.ts +14 -1
  31. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  32. package/dist/components/jogging/JoggingVelocitySlider.d.ts.map +1 -1
  33. package/dist/components/robots/FANUC_CRX20iAL.d.ts +3 -0
  34. package/dist/components/robots/FANUC_CRX20iAL.d.ts.map +1 -0
  35. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  36. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts +2 -2
  37. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +1 -1
  38. package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts +2 -2
  39. package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts.map +1 -1
  40. package/dist/externalizeComponent.d.ts +7 -0
  41. package/dist/externalizeComponent.d.ts.map +1 -0
  42. package/dist/index.cjs +29 -48
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.ts +49 -9
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +11672 -12089
  47. package/dist/index.js.map +1 -1
  48. package/dist/themes/color.d.ts +1 -1
  49. package/dist/themes/color.d.ts.map +1 -1
  50. package/dist/themes/novaTheme.stories.d.ts +5 -0
  51. package/dist/themes/novaTheme.stories.d.ts.map +1 -0
  52. package/dist/themes/theming.d.ts +49 -0
  53. package/dist/themes/theming.d.ts.map +1 -0
  54. package/package.json +20 -13
  55. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +2 -2
  56. package/src/components/CopyableText.tsx +30 -0
  57. package/src/components/LoadingButton.stories.tsx +19 -26
  58. package/src/components/ThemeSelect.tsx +3 -4
  59. package/src/components/VelocitySlider.stories.tsx +10 -15
  60. package/src/components/VelocitySlider.tsx +7 -2
  61. package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +21 -21
  62. package/src/components/jogging/JoggingCartesianAxisControl.tsx +1 -1
  63. package/src/components/jogging/JoggingCartesianTab.tsx +37 -44
  64. package/src/components/jogging/JoggingCartesianValues.tsx +37 -33
  65. package/src/components/jogging/JoggingJointLimitDetector.tsx +10 -7
  66. package/src/components/jogging/JoggingJointRotationControl.stories.tsx +31 -19
  67. package/src/components/jogging/JoggingJointRotationControl.tsx +44 -30
  68. package/src/components/jogging/JoggingJointValues.tsx +35 -33
  69. package/src/components/jogging/JoggingOptions.tsx +130 -80
  70. package/src/components/jogging/JoggingPanel.stories.tsx +20 -17
  71. package/src/components/jogging/JoggingPanel.tsx +29 -31
  72. package/src/components/jogging/JoggingStore.tsx +69 -18
  73. package/src/components/jogging/JoggingVelocitySlider.tsx +24 -22
  74. package/src/components/robots/FANUC_CRX20iAL.tsx +176 -0
  75. package/src/components/robots/SupportedRobot.tsx +4 -0
  76. package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +7 -7
  77. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +48 -23
  78. package/src/externalizeComponent.tsx +37 -0
  79. package/src/i18n/locales/de/translations.json +2 -1
  80. package/src/i18n/locales/en/translations.json +2 -1
  81. package/src/icons/orientation-coord-system.svg +3 -0
  82. package/src/icons/orientation-tool.svg +3 -0
  83. package/src/index.ts +39 -9
  84. package/src/themes/color.tsx +29 -19
  85. package/src/themes/novaTheme.stories.tsx +77 -0
  86. package/src/themes/themeTypes.d.ts +11 -0
  87. package/src/themes/theming.ts +174 -0
  88. package/dist/themes/theme.d.ts +0 -144
  89. package/dist/themes/theme.d.ts.map +0 -1
  90. package/dist/themes/wbTheme.d.ts +0 -73
  91. package/dist/themes/wbTheme.d.ts.map +0 -1
  92. package/dist/themes/wbTheme.stories.d.ts +0 -7
  93. package/dist/themes/wbTheme.stories.d.ts.map +0 -1
  94. package/src/themes/theme.ts +0 -150
  95. package/src/themes/wbTheme.stories.tsx +0 -64
  96. package/src/themes/wbTheme.ts +0 -186
@@ -1,144 +0,0 @@
1
- import { ThemeOptions } from '@mui/material/styles';
2
- type ThemeName = 'wandelbots';
3
- export declare const allThemes: {
4
- wb: import("@mui/material").Theme;
5
- };
6
- export interface NamedThemeOptions extends ThemeOptions {
7
- name: ThemeName;
8
- }
9
- declare module '@mui/material/styles' {
10
- interface Theme {
11
- backgrounds: {
12
- light1: string;
13
- light2: string;
14
- medium: string;
15
- dark1: string;
16
- dark2: string;
17
- };
18
- buttonPrimary: {
19
- background: string;
20
- text: string;
21
- };
22
- buttonSecondary: {
23
- background: string;
24
- text: string;
25
- };
26
- buttonBack: {
27
- background: string;
28
- text: string;
29
- };
30
- inputField: {
31
- background: string;
32
- text: string;
33
- unitBackground: string;
34
- unitText: string;
35
- };
36
- sidebar: {
37
- background: string;
38
- backgroundSelected: string;
39
- selected: string;
40
- };
41
- actionPanel: {
42
- background: string;
43
- backgroundSelected: string;
44
- text: string;
45
- };
46
- controlPanel: {
47
- background: string;
48
- text: string;
49
- };
50
- listItem: {
51
- background: string;
52
- backgroundSelected: string;
53
- textTitle: string;
54
- textTitleSelected: string;
55
- textDesc: string;
56
- textDescSelected: string;
57
- };
58
- breadcrumb: {
59
- background: string;
60
- text: string;
61
- textSelected: string;
62
- };
63
- axes: {
64
- x: string;
65
- y: string;
66
- z: string;
67
- };
68
- viewport: {
69
- background: string;
70
- controlBackground: string;
71
- };
72
- tabIcon: {
73
- color: string;
74
- };
75
- }
76
- interface ThemeOptions {
77
- backgrounds?: {
78
- light1?: string;
79
- light2?: string;
80
- medium?: string;
81
- dark1?: string;
82
- dark2?: string;
83
- };
84
- buttonPrimary?: {
85
- background?: string;
86
- text?: string;
87
- };
88
- buttonSecondary?: {
89
- background?: string;
90
- text?: string;
91
- };
92
- buttonBack?: {
93
- background?: string;
94
- text?: string;
95
- };
96
- inputField?: {
97
- background?: string;
98
- text?: string;
99
- unitBackground?: string;
100
- unitText?: string;
101
- };
102
- sidebar?: {
103
- background?: string;
104
- backgroundSelected?: string;
105
- selected?: string;
106
- };
107
- actionPanel?: {
108
- background?: string;
109
- backgroundSelected?: string;
110
- text?: string;
111
- };
112
- controlPanel?: {
113
- background?: string;
114
- text?: string;
115
- };
116
- listItem?: {
117
- background?: string;
118
- backgroundSelected?: string;
119
- textTitle?: string;
120
- textTitleSelected?: string;
121
- textDesc?: string;
122
- textDescSelected?: string;
123
- };
124
- breadcrumb?: {
125
- background?: string;
126
- text?: string;
127
- textSelected?: string;
128
- };
129
- axes?: {
130
- x?: string;
131
- y?: string;
132
- z?: string;
133
- };
134
- viewport?: {
135
- background?: string;
136
- controlBackground?: string;
137
- };
138
- tabIcon?: {
139
- color?: string;
140
- };
141
- }
142
- }
143
- export {};
144
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/themes/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,KAAK,SAAS,GAAG,YAAY,CAAA;AAE7B,eAAO,MAAM,SAAS;;CAErB,CAAA;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,KAAK;QACb,WAAW,EAAE;YACX,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;YACf,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,CAAA;QACD,aAAa,EAAE;YACb,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;SACd,CAAA;QACD,eAAe,EAAE;YACf,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;SACd,CAAA;QACD,UAAU,EAAE;YACV,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,MAAM,CAAC;SACd,CAAA;QACD,UAAU,EAAE;YACV,UAAU,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AAE;YACX,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,IAAI,CAAC,EAAE,MAAM,CAAA;YACb,YAAY,CAAC,EAAE,MAAM,CAAC;SACvB,CAAA;QACD,IAAI,CAAC,EAAE;YACL,CAAC,CAAC,EAAE,MAAM,CAAC;YACX,CAAC,CAAC,EAAE,MAAM,CAAC;YACX,CAAC,CAAC,EAAE,MAAM,CAAC;SACZ,CAAC;QACF,QAAQ,CAAC,EAAE;YACT,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;SAC5B,CAAC;QACF,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;SAChB,CAAA;KACF;CACF"}
@@ -1,73 +0,0 @@
1
- /** Colors for the dark theme */
2
- export declare const darkColors: {
3
- primary: string;
4
- textDefault: string;
5
- textInverse: string;
6
- textError: string;
7
- textSubtle: string;
8
- backgroundDefault: string;
9
- inputBackgroundDefault: string;
10
- borderColorDefault: string;
11
- selectBackground: string;
12
- appBarBackground: string;
13
- virtualRobot: string;
14
- physicalRobot: string;
15
- robotViewportBackground: string;
16
- viewportButtonInactiveBackground: string;
17
- viewportButtonHover: string;
18
- viewportButtonActiveBackground: string;
19
- tabsBarBackground: string;
20
- activeTabBackground: string;
21
- omniverseConfigurationSuccess: string;
22
- omniverseConfigurationFailure: string;
23
- };
24
- /** Colors for the light theme */
25
- export declare const lightColors: {
26
- primary: string;
27
- textDefault: string;
28
- textInverse: string;
29
- textError: string;
30
- textSubtle: string;
31
- backgroundDefault: string;
32
- inputBackgroundDefault: string;
33
- borderColorDefault: string;
34
- selectBackground: string;
35
- appBarBackground: string;
36
- virtualRobot: string;
37
- physicalRobot: string;
38
- robotViewportBackground: string;
39
- viewportButtonInactiveBackground: string;
40
- viewportButtonHover: string;
41
- viewportButtonActiveBackground: string;
42
- tabsBarBackground: string;
43
- activeTabBackground: string;
44
- omniverseConfigurationSuccess: string;
45
- omniverseConfigurationFailure: string;
46
- };
47
- /** Gets the colors for the current theme (light or dark) */
48
- export declare function useThemeColors(): {
49
- primary: string;
50
- textDefault: string;
51
- textInverse: string;
52
- textError: string;
53
- textSubtle: string;
54
- backgroundDefault: string;
55
- inputBackgroundDefault: string;
56
- borderColorDefault: string;
57
- selectBackground: string;
58
- appBarBackground: string;
59
- virtualRobot: string;
60
- physicalRobot: string;
61
- robotViewportBackground: string;
62
- viewportButtonInactiveBackground: string;
63
- viewportButtonHover: string;
64
- viewportButtonActiveBackground: string;
65
- tabsBarBackground: string;
66
- activeTabBackground: string;
67
- omniverseConfigurationSuccess: string;
68
- omniverseConfigurationFailure: string;
69
- };
70
- export declare const darkTheme: import("@mui/material").Theme;
71
- export declare const lightTheme: import("@mui/material").Theme;
72
- export declare const wbTheme: import("@mui/material").Theme;
73
- //# sourceMappingURL=wbTheme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wbTheme.d.ts","sourceRoot":"","sources":["../../src/themes/wbTheme.ts"],"names":[],"mappings":"AAsBA,gCAAgC;AAChC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAsBtB,CAAA;AAED,iCAAiC;AACjC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;CAsBvB,CAAA;AAED,4DAA4D;AAC5D,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;EAE7B;AA4GD,eAAO,MAAM,SAAS,+BAA8B,CAAA;AACpD,eAAO,MAAM,UAAU,+BAA+B,CAAA;AACtD,eAAO,MAAM,OAAO,+BAAY,CAAA"}
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- declare const ColorPalette: () => import("react/jsx-runtime").JSX.Element;
3
- declare const meta: Meta<typeof ColorPalette>;
4
- export default meta;
5
- type Story = StoryObj<typeof ColorPalette>;
6
- export declare const colorPalette: Story;
7
- //# sourceMappingURL=wbTheme.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wbTheme.stories.d.ts","sourceRoot":"","sources":["../../src/themes/wbTheme.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGlD,QAAA,MAAM,YAAY,+CAiDjB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAEnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,YAAY,EAAE,KAAU,CAAC"}
@@ -1,150 +0,0 @@
1
- import { ThemeOptions } from '@mui/material/styles';
2
- import { wbTheme } from './wbTheme';
3
-
4
- // TODO: Is all of this theme name foo actually necessary?
5
-
6
- type ThemeName = 'wandelbots'
7
-
8
- export const allThemes = {
9
- wb: wbTheme,
10
- }
11
-
12
- export interface NamedThemeOptions extends ThemeOptions {
13
- name: ThemeName
14
- }
15
-
16
- declare module '@mui/material/styles' {
17
- interface Theme {
18
- backgrounds: {
19
- light1: string,
20
- light2: string,
21
- medium: string,
22
- dark1: string,
23
- dark2: string,
24
- }
25
- buttonPrimary: {
26
- background: string;
27
- text: string;
28
- }
29
- buttonSecondary: {
30
- background: string;
31
- text: string;
32
- }
33
- buttonBack: {
34
- background: string;
35
- text: string;
36
- }
37
- inputField: {
38
- background: string;
39
- text: string;
40
- unitBackground: string;
41
- unitText: string;
42
- }
43
- sidebar: {
44
- background: string;
45
- backgroundSelected: string;
46
- selected: string;
47
- }
48
- actionPanel: {
49
- background: string;
50
- backgroundSelected: string;
51
- text: string;
52
- }
53
- controlPanel: {
54
- background: string;
55
- text: string;
56
- }
57
- listItem: {
58
- background: string;
59
- backgroundSelected: string;
60
- textTitle: string;
61
- textTitleSelected: string;
62
- textDesc: string;
63
- textDescSelected: string;
64
- }
65
- breadcrumb: {
66
- background: string;
67
- text: string
68
- textSelected: string;
69
- }
70
- axes: {
71
- x: string;
72
- y: string;
73
- z: string;
74
- };
75
- viewport: {
76
- background: string;
77
- controlBackground: string;
78
- };
79
- tabIcon: {
80
- color: string;
81
- }
82
- }
83
-
84
- interface ThemeOptions {
85
- backgrounds?: {
86
- light1?: string,
87
- light2?: string,
88
- medium?: string,
89
- dark1?: string,
90
- dark2?: string,
91
- }
92
- buttonPrimary?: {
93
- background?: string;
94
- text?: string;
95
- }
96
- buttonSecondary?: {
97
- background?: string;
98
- text?: string;
99
- }
100
- buttonBack?: {
101
- background?: string;
102
- text?: string;
103
- }
104
- inputField?: {
105
- background?: string;
106
- text?: string;
107
- unitBackground?: string;
108
- unitText?: string;
109
- }
110
- sidebar?: {
111
- background?: string;
112
- backgroundSelected?: string;
113
- selected?: string;
114
- }
115
- actionPanel?: {
116
- background?: string;
117
- backgroundSelected?: string;
118
- text?: string;
119
- }
120
- controlPanel?: {
121
- background?: string;
122
- text?: string;
123
- }
124
- listItem?: {
125
- background?: string;
126
- backgroundSelected?: string;
127
- textTitle?: string;
128
- textTitleSelected?: string;
129
- textDesc?: string;
130
- textDescSelected?: string;
131
- }
132
- breadcrumb?: {
133
- background?: string;
134
- text?: string
135
- textSelected?: string;
136
- }
137
- axes?: {
138
- x?: string;
139
- y?: string;
140
- z?: string;
141
- };
142
- viewport?: {
143
- background?: string;
144
- controlBackground?: string;
145
- };
146
- tabIcon?: {
147
- color?: string;
148
- }
149
- }
150
- }
@@ -1,64 +0,0 @@
1
- import { wbTheme } from "./wbTheme";
2
- import { Meta, StoryObj } from "@storybook/react";
3
- import { Color, ColorSection } from "./color";
4
-
5
- const ColorPalette = () => {
6
- return (
7
- <div
8
- style={{
9
- fontFamily: "sans-serif",
10
- }}
11
- >
12
- <ColorSection name="Palette">
13
- <Color name="Primary" color={wbTheme.palette.primary.main} />
14
- <Color name="Secondary" color={wbTheme.palette.secondary.main} />
15
- <Color name="Background" color={wbTheme.palette.background.default} />
16
- </ColorSection>
17
- <ColorSection name="Text">
18
- <Color name="Primary" color={wbTheme.palette.text.primary} />
19
- <Color name="Secondary" color={wbTheme.palette.text.secondary} />
20
- </ColorSection>
21
- <ColorSection name="Button">
22
- <Color
23
- name="Primary Background"
24
- color={wbTheme.buttonPrimary.background}
25
- />
26
- <Color name="Primary Text" color={wbTheme.buttonPrimary.text} />
27
- <Color
28
- name="Secondary Background"
29
- color={wbTheme.buttonSecondary.background}
30
- />
31
- <Color name="Secondary Text" color={wbTheme.buttonSecondary.text} />
32
- <Color name="Back Background" color={wbTheme.buttonBack.background} />
33
- <Color name="Back Text" color={wbTheme.buttonBack.text} />
34
- </ColorSection>
35
- <ColorSection name="Input Field">
36
- <Color name="Background" color={wbTheme.inputField.background} />
37
- <Color name="Text" color={wbTheme.inputField.text} />
38
- <Color
39
- name="Unit Background"
40
- color={wbTheme.inputField.unitBackground}
41
- />
42
- <Color name="Unit Text" color={wbTheme.inputField.unitText} />
43
- </ColorSection>
44
- <ColorSection name="Sidebar">
45
- <Color name="Background" color={wbTheme.sidebar.background} />
46
- <Color
47
- name="Background Selected"
48
- color={wbTheme.sidebar.backgroundSelected}
49
- />
50
- <Color name="Selected" color={wbTheme.sidebar.selected} />
51
- </ColorSection>
52
- </div>
53
- );
54
- };
55
-
56
- const meta: Meta<typeof ColorPalette> = {
57
- component: ColorPalette,
58
- };
59
-
60
- export default meta;
61
-
62
- type Story = StoryObj<typeof ColorPalette>;
63
-
64
- export const colorPalette: Story = {};
@@ -1,186 +0,0 @@
1
- "use client"
2
-
3
- import { createTheme, useTheme, type ThemeOptions } from "@mui/material/styles"
4
- import { defaultsDeep } from "lodash-es"
5
-
6
- const baseColors = {
7
- white: "#FFFFFF",
8
- midnightblue: "#001337",
9
- lightbuttonblue: "#47D3FF",
10
- midnightgray: "#DDE0E4",
11
- midnightgray500: "#828B9B",
12
- skyblue500: "#06B8F1",
13
- skyblue600: "#0094CE",
14
- darkishblue: "#262F42",
15
- darkestblue: "#101629",
16
- grayishblue: "#505968",
17
- darkgrayishblue: "#363c4b",
18
- scaryred: "#FF0E65",
19
- tealGreen: "#1AC0B2",
20
- magenta: "#EA3785",
21
- }
22
-
23
- /** Colors for the dark theme */
24
- export const darkColors = {
25
- primary: baseColors.skyblue500,
26
- textDefault: baseColors.white,
27
- textInverse: baseColors.darkestblue,
28
- textError: baseColors.scaryred,
29
- textSubtle: baseColors.midnightgray500,
30
- backgroundDefault: baseColors.darkishblue,
31
- inputBackgroundDefault: baseColors.darkgrayishblue,
32
- borderColorDefault: "#3A4150",
33
-
34
- selectBackground: baseColors.grayishblue,
35
- appBarBackground: baseColors.darkestblue,
36
- virtualRobot: "#1AC0B2",
37
- physicalRobot: "#956FFA",
38
- robotViewportBackground: "#1F283A",
39
- viewportButtonInactiveBackground: baseColors.darkestblue,
40
- viewportButtonHover: baseColors.midnightgray500,
41
- viewportButtonActiveBackground: baseColors.skyblue500,
42
- tabsBarBackground: baseColors.darkestblue,
43
- activeTabBackground: baseColors.darkishblue,
44
- omniverseConfigurationSuccess: baseColors.tealGreen,
45
- omniverseConfigurationFailure: baseColors.magenta,
46
- }
47
-
48
- /** Colors for the light theme */
49
- export const lightColors = {
50
- primary: baseColors.lightbuttonblue,
51
- textDefault: "#18181B",
52
- textInverse: baseColors.white,
53
- textError: baseColors.scaryred,
54
- textSubtle: baseColors.midnightgray500,
55
- backgroundDefault: baseColors.white,
56
- inputBackgroundDefault: baseColors.white,
57
- borderColorDefault: baseColors.midnightgray500,
58
-
59
- selectBackground: "#E4E4E7",
60
- appBarBackground: baseColors.white,
61
- virtualRobot: "green",
62
- physicalRobot: "blue",
63
- robotViewportBackground: "#E4E4E7",
64
- viewportButtonInactiveBackground: baseColors.midnightgray,
65
- viewportButtonHover: baseColors.midnightgray500,
66
- viewportButtonActiveBackground: baseColors.lightbuttonblue,
67
- tabsBarBackground: baseColors.white,
68
- activeTabBackground: baseColors.white,
69
- omniverseConfigurationSuccess: baseColors.tealGreen,
70
- omniverseConfigurationFailure: baseColors.magenta,
71
- }
72
-
73
- /** Gets the colors for the current theme (light or dark) */
74
- export function useThemeColors() {
75
- return useTheme().palette.mode === "dark" ? darkColors : lightColors
76
- }
77
-
78
- function createRobotPadTheme(
79
- mode: "light" | "dark",
80
- options: ThemeOptions = {},
81
- ) {
82
- const colors = mode === "light" ? lightColors : darkColors
83
- return createTheme(
84
- defaultsDeep(options, {
85
- palette: {
86
- mode,
87
- primary: {
88
- main: colors.primary,
89
- },
90
- background: {
91
- default: colors.backgroundDefault,
92
- },
93
- },
94
- typography: {
95
- allVariants: {
96
- color: colors.textDefault,
97
- },
98
- },
99
- components: {
100
- MuiPaper: {
101
- styleOverrides: {
102
- root: {
103
- backgroundColor: colors.backgroundDefault,
104
- },
105
- },
106
- },
107
- MuiTabs: {
108
- styleOverrides: {
109
- root: {
110
- backgroundColor: colors.tabsBarBackground,
111
- minHeight: "42px",
112
- },
113
- },
114
- },
115
- MuiTab: {
116
- styleOverrides: {
117
- root: {
118
- minHeight: "42px",
119
- textTransform: "none",
120
- "&.Mui-selected": {
121
- color: "inherit",
122
- backgroundColor: colors.activeTabBackground,
123
- },
124
- },
125
- },
126
- },
127
- MuiButton: {
128
- defaultProps: {
129
- disableElevation: true,
130
- },
131
- styleOverrides: {
132
- root: {
133
- textTransform: "none",
134
- borderRadius: "10px",
135
- fontSize: "14px",
136
- fontWeight: 500,
137
- },
138
- },
139
- variants: [
140
- {
141
- props: { variant: "outlined" },
142
- style: {
143
- border: "2px solid rgba(255, 255, 255, 0.6)",
144
- color: "rgba(255, 255, 255, 0.6)",
145
- backgroundColor: "rgba(255, 255, 255, 0.2)",
146
- "&:hover": {
147
- backgroundColor: "rgba(255, 255, 255, 0.4)",
148
- border: "2px solid rgba(255, 255, 255, 0.8)",
149
- },
150
- },
151
- },
152
- ],
153
- },
154
- MuiFab: {
155
- styleOverrides: {
156
- root: {
157
- width: "48px",
158
- height: "48px",
159
- backgroundColor: colors.viewportButtonInactiveBackground,
160
- color: colors.textDefault,
161
- "&:hover": {
162
- backgroundColor: colors.viewportButtonHover,
163
- },
164
- },
165
- },
166
- variants: [
167
- {
168
- props: { variant: "active" },
169
- style: {
170
- backgroundColor: colors.viewportButtonActiveBackground,
171
- color: colors.textInverse,
172
- "&:hover": {
173
- backgroundColor: colors.viewportButtonActiveBackground,
174
- },
175
- },
176
- },
177
- ],
178
- },
179
- },
180
- }),
181
- )
182
- }
183
-
184
- export const darkTheme = createRobotPadTheme("dark")
185
- export const lightTheme = createRobotPadTheme("light")
186
- export const wbTheme = darkTheme