@wandelbots/wandelbots-js-react-components 1.19.1 → 1.20.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 (42) hide show
  1. package/dist/components/LoadingButton.d.ts +1 -1
  2. package/dist/components/SelectableFab.d.ts +7 -0
  3. package/dist/components/SelectableFab.d.ts.map +1 -0
  4. package/dist/components/VelocitySlider.d.ts.map +1 -1
  5. package/dist/components/jogging/JoggingActivationRequired.d.ts.map +1 -1
  6. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +3 -2
  7. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts.map +1 -1
  8. package/dist/components/jogging/JoggingCartesianTab.d.ts +2 -3
  9. package/dist/components/jogging/JoggingCartesianTab.d.ts.map +1 -1
  10. package/dist/components/jogging/JoggingOptions.d.ts.map +1 -1
  11. package/dist/components/jogging/JoggingPanel.d.ts.map +1 -1
  12. package/dist/components/jogging/JoggingStore.d.ts +1 -1
  13. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  14. package/dist/index.cjs +29 -29
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.ts +9 -7
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +15006 -14834
  19. package/dist/index.js.map +1 -1
  20. package/dist/themes/createDarkTheme.d.ts +3 -0
  21. package/dist/themes/createDarkTheme.d.ts.map +1 -0
  22. package/dist/themes/createLightTheme.d.ts +2 -0
  23. package/dist/themes/createLightTheme.d.ts.map +1 -0
  24. package/dist/themes/themeTypes.d.ts +74 -0
  25. package/dist/themes/themeTypes.d.ts.map +1 -0
  26. package/dist/themes/theming.d.ts +0 -30
  27. package/dist/themes/theming.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/components/SelectableFab.tsx +47 -0
  30. package/src/components/VelocitySlider.tsx +1 -0
  31. package/src/components/jogging/JoggingActivationRequired.tsx +4 -3
  32. package/src/components/jogging/JoggingCartesianAxisControl.tsx +41 -28
  33. package/src/components/jogging/JoggingCartesianTab.tsx +16 -8
  34. package/src/components/jogging/JoggingOptions.tsx +10 -4
  35. package/src/components/jogging/JoggingPanel.tsx +15 -18
  36. package/src/components/jogging/JoggingStore.tsx +16 -7
  37. package/src/index.ts +9 -7
  38. package/src/themes/createDarkTheme.ts +223 -0
  39. package/src/themes/createLightTheme.ts +8 -0
  40. package/src/themes/themeTypes.ts +79 -0
  41. package/src/themes/theming.ts +3 -153
  42. package/src/themes/themeTypes.d.ts +0 -11
@@ -0,0 +1,223 @@
1
+ import { createTheme, type Theme } from "@mui/material"
2
+
3
+ export function createDarkTheme(): Theme {
4
+ const baseTheme = createTheme({
5
+ palette: {
6
+ mode: "dark",
7
+ text: {
8
+ primary: "rgba(255, 255, 255, 1)",
9
+ secondary: "rgba(255, 255, 255, 0.7)",
10
+ disabled: "rgba(255, 255, 255, 0.38)",
11
+ },
12
+ primary: {
13
+ main: "rgba(142, 86, 252, 1)",
14
+ dark: "rgba(136, 58, 255, 1)",
15
+ light: "rgba(157, 131, 246, 1)",
16
+ contrastText: "rgba(255, 255, 255, 0.87)",
17
+ },
18
+ secondary: {
19
+ main: "rgba(255, 255, 255, 1)",
20
+
21
+ dark: "rgba(255, 255, 255, 0.06)",
22
+ contrastText: "rgba(255, 255, 255, 0.87)",
23
+ },
24
+ tertiary: {
25
+ main: "rgba(100, 255, 218, 1)",
26
+ dark: "rgba(38, 166, 154, 1)",
27
+ light: "rgba(167, 255, 235, 1)",
28
+ contrastText: "rgba(0, 0, 0, 1)",
29
+ },
30
+ error: {
31
+ main: "rgba(239, 83, 80, 1)",
32
+ dark: "rgba(229, 57, 53, 1)",
33
+ light: "rgba(239, 154, 154, 1)",
34
+ contrastText: "rgba(255, 255, 255, 1)",
35
+ },
36
+ warning: {
37
+ main: "rgba(255, 255, 255, 1)",
38
+ dark: "rgba(255, 145, 0, 1)",
39
+ light: "rgba(255, 209, 128, 1)",
40
+ contrastText: "rgba(0, 0, 0, 0.87)",
41
+ },
42
+ success: {
43
+ main: "rgba(38, 166, 154, 1)",
44
+ dark: "rgba(0, 121, 107, 1)",
45
+ light: "rgba(128, 203, 196, 1)",
46
+ contrastText: "rgba(255, 255, 255, 0.87)",
47
+ },
48
+ background: {
49
+ default: "rgba(2, 6, 23, 1)",
50
+ paper: "rgba(17, 19, 31, 1)",
51
+ },
52
+ action: {
53
+ active: "rgba(255, 255, 255, 0.56)",
54
+ hover: "rgba(255, 255, 255, 0.08)",
55
+ selected: "rgba(255, 255, 255, 0.16)",
56
+ disabledBackground: "rgba(255, 255, 255, 0.12)",
57
+ focus: "rgba(255, 255, 255, 0.12)",
58
+ disabled: "rgba(255, 255, 255, 0.38)",
59
+ },
60
+ common: {
61
+ white: "rgba(255, 255, 255, 1)",
62
+ black: "rgba(0, 0, 0, 1)",
63
+ },
64
+ divider: "rgba(255, 255, 255, 0.12)",
65
+ backgroundPaperElevation: {
66
+ 0: "rgba(17,19,31,1.0)",
67
+ 1: "rgba(20,22,35,1.0)",
68
+ 2: "rgba(23,25,39,1.0)",
69
+ 3: "rgba(26,28,43,1.0)",
70
+ 4: "rgba(29,31,47,1.0)",
71
+ 5: "rgba(32,34,51,1.0)",
72
+ 6: "rgba(35,37,55,1.0)",
73
+ 7: "rgba(38,40,59,1.0)",
74
+ 8: "rgba(41,43,63,1.0)",
75
+ 9: "rgba(44,46,67,1.0)",
76
+ 10: "rgba(47,49,71,1.0)",
77
+ 11: "rgba(50,52,75,1.0)",
78
+ 12: "rgba(53,55,79,1.0)",
79
+ 13: "rgba(56,58,83,1.0)",
80
+ 14: "rgba(59,61,87,1.0)",
81
+ 15: "rgba(62,64,91,1.0)",
82
+ 16: "rgba(57,63,87,1.0)",
83
+ },
84
+ },
85
+ paletteExt: {
86
+ primary: {
87
+ hover: "rgba(142, 86, 252, 0.08)",
88
+ selected: "rgba(142, 86, 252, 0.16)",
89
+ focus: "rgba(142, 86, 252, 0.12)",
90
+ focusVisible: "rgba(142, 86, 252, 0.3)",
91
+ outlineBorder: "rgba(142, 86, 252, 0.5)",
92
+ },
93
+ secondary: {
94
+ tonal: "rgba(255,255,255,0.1)",
95
+ },
96
+ },
97
+ })
98
+
99
+ return {
100
+ ...baseTheme,
101
+ components: {
102
+ MuiButton: {
103
+ styleOverrides: {
104
+ root: {
105
+ textTransform: "none",
106
+ borderRadius: "10px",
107
+ },
108
+ },
109
+ variants: [
110
+ {
111
+ props: { color: "secondary", variant: "contained" },
112
+ style: {
113
+ border: `1px solid ${baseTheme.palette.divider}`,
114
+ background: baseTheme.paletteExt?.secondary?.tonal?.toString(),
115
+ },
116
+ },
117
+ ],
118
+ },
119
+ MuiDivider: {
120
+ styleOverrides: {
121
+ root: {
122
+ border: "1px solid",
123
+ },
124
+ },
125
+ },
126
+ MuiTab: {
127
+ styleOverrides: {
128
+ root: {
129
+ textTransform: "none",
130
+ color: baseTheme.palette.text.secondary,
131
+ "&.Mui-selected": {
132
+ color: baseTheme.palette.text.primary,
133
+ },
134
+ },
135
+ },
136
+ },
137
+ MuiTabs: {
138
+ styleOverrides: {
139
+ root: {
140
+ background: baseTheme.palette.backgroundPaperElevation?.[1],
141
+ },
142
+ },
143
+ },
144
+ MuiToggleButtonGroup: {
145
+ styleOverrides: {
146
+ root: {
147
+ ".MuiToggleButtonGroup-firstButton": {
148
+ borderRadius: "10px 0 0 10px",
149
+ },
150
+ ".MuiToggleButtonGroup-lastButton": {
151
+ borderRadius: "0 10px 10px 0",
152
+ },
153
+ },
154
+ },
155
+ },
156
+ MuiToggleButton: {
157
+ styleOverrides: {
158
+ root: {
159
+ textTransform: "none",
160
+ padding: "6px 16px",
161
+ },
162
+ },
163
+ },
164
+ MuiSelect: {
165
+ variants: [
166
+ {
167
+ props: { variant: "filled" },
168
+ style: {
169
+ borderRadius: "10px",
170
+ "::before, ::after": {
171
+ visibility: "collapse",
172
+ },
173
+ ".MuiInputBase-input": {
174
+ padding: "6px 16px",
175
+ borderRadius: "10px",
176
+ },
177
+ },
178
+ },
179
+ ],
180
+ },
181
+ MuiFab: {
182
+ styleOverrides: {
183
+ root: {
184
+ background: baseTheme.paletteExt?.secondary?.tonal,
185
+ },
186
+ },
187
+ variants: [
188
+ {
189
+ props: { color: "primary" },
190
+ style: {
191
+ background: baseTheme.palette.primary.main,
192
+ },
193
+ },
194
+ ],
195
+ },
196
+ },
197
+
198
+ componentsExt: {
199
+ JoggingCartesian: {
200
+ Axis: {
201
+ X: {
202
+ backgroundColor: "rgba(215, 66, 56, 1)",
203
+ borderColor: "rgba(215, 66, 56, 1)",
204
+ buttonBackgroundColor: "rgba(241, 77, 66, 1)",
205
+ color: "rgba(255, 255, 255, 1)",
206
+ },
207
+ Y: {
208
+ backgroundColor: "rgba(20, 151, 108, 1)",
209
+ borderColor: "rgba(20, 151, 108, 1)",
210
+ buttonBackgroundColor: "rgba(28, 188, 135, 1)",
211
+ color: "rgba(255, 255, 255, 1)",
212
+ },
213
+ Z: {
214
+ backgroundColor: "rgba(1, 87, 155, 1)",
215
+ borderColor: "rgba(1, 87, 155, 1)",
216
+ buttonBackgroundColor: "rgba(2, 136, 209, 1)",
217
+ color: "rgba(255, 255, 255, 1)",
218
+ },
219
+ },
220
+ },
221
+ },
222
+ }
223
+ }
@@ -0,0 +1,8 @@
1
+ import { createDarkTheme } from "./createDarkTheme"
2
+
3
+ export function createLightTheme() {
4
+ // Keep the dark theme until we support a light theme
5
+ const theme = createDarkTheme()
6
+ theme.palette.mode = "light"
7
+ return theme
8
+ }
@@ -0,0 +1,79 @@
1
+ type NovaColorPaletteExtension = {
2
+ paletteExt?: {
3
+ primary?: {
4
+ hover?: string
5
+ selected?: string
6
+ focus?: string
7
+ focusVisible?: string
8
+ outlineBorder?: string
9
+ }
10
+ secondary?: {
11
+ tonal?: string
12
+ }
13
+ }
14
+ }
15
+
16
+ export interface AxisControlComponentColors {
17
+ color?: string
18
+ borderColor?: string
19
+ backgroundColor?: string
20
+ buttonBackgroundColor?: string
21
+ }
22
+
23
+ interface NovaComponentsExtension {
24
+ componentsExt?: {
25
+ JoggingCartesian?: {
26
+ Axis?: {
27
+ X?: AxisControlComponentColors
28
+ Y?: AxisControlComponentColors
29
+ Z?: AxisControlComponentColors
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ interface BackgroundPaperElevation {
36
+ 0?: string
37
+ 1?: string
38
+ 2?: string
39
+ 3?: string
40
+ 4?: string
41
+ 5?: string
42
+ 6?: string
43
+ 7?: string
44
+ 8?: string
45
+ 9?: string
46
+ 10?: string
47
+ 11?: string
48
+ 12?: string
49
+ 13?: string
50
+ 14?: string
51
+ 15?: string
52
+ 16?: string
53
+ 17?: string
54
+ 18?: string
55
+ 19?: string
56
+ 20?: string
57
+ 21?: string
58
+ 22?: string
59
+ 23?: string
60
+ 24?: string
61
+ }
62
+
63
+ declare module "@mui/material/styles" {
64
+ interface Palette {
65
+ tertiary: Palette["primary"]
66
+ backgroundPaperElevation?: BackgroundPaperElevation
67
+ }
68
+
69
+ interface PaletteOptions {
70
+ tertiary?: PaletteOptions["primary"]
71
+ backgroundPaperElevation?: BackgroundPaperElevation
72
+ }
73
+
74
+ interface Theme extends NovaComponentsExtension, NovaColorPaletteExtension {}
75
+
76
+ interface ThemeOptions
77
+ extends NovaComponentsExtension,
78
+ NovaColorPaletteExtension {}
79
+ }
@@ -1,61 +1,8 @@
1
1
  "use client"
2
2
 
3
3
  import type { Theme, ThemeOptions } from "@mui/material/styles"
4
- import { createTheme } from "@mui/material/styles"
5
-
6
- /**
7
- * The palette of named colors we pick from for
8
- * configuring the default nova themes.
9
- */
10
- const colors = {
11
- white: "#FFFFFF",
12
- midnightblue: "#001337",
13
- lightbuttonblue: "#47D3FF",
14
- midnightgray: "#DDE0E4",
15
- midnightgray500: "#828B9B",
16
- skyblue500: "#06B8F1",
17
- skyblue600: "#0094CE",
18
- darkishblue: "#262F42",
19
- darkestblue: "#101629",
20
- grayishblue: "#505968",
21
- darkgrayishblue: "#363c4b",
22
- scaryred: "#FF0E65",
23
- tealGreen: "#1AC0B2",
24
- magenta: "#EA3785",
25
- }
26
-
27
- /**
28
- * Settings used to construct the Nova default theme.
29
- * The dark theme is the default and defines the structure of the
30
- * settings.
31
- */
32
- export const novaDarkSettings = {
33
- mode: "dark" as "dark" | "light",
34
- colors: {
35
- primary: colors.skyblue500,
36
- textDefault: colors.white,
37
- textSubtle: colors.midnightgray,
38
- background: {
39
- default: colors.darkishblue,
40
- panel: colors.darkestblue,
41
- },
42
- },
43
- }
44
-
45
- export type NovaThemeSettings = typeof novaDarkSettings
46
-
47
- export const novaLightSettings = {
48
- mode: "light",
49
- colors: {
50
- primary: colors.skyblue500,
51
- textDefault: colors.darkishblue,
52
- textSubtle: colors.midnightgray,
53
- background: {
54
- default: colors.skyblue500,
55
- panel: colors.white,
56
- },
57
- },
58
- } satisfies NovaThemeSettings
4
+ import { createDarkTheme } from "./createDarkTheme"
5
+ import { createLightTheme } from "./createLightTheme"
59
6
 
60
7
  /**
61
8
  * Create the default Wandelbots Nova Material UI theme, overriding
@@ -71,102 +18,5 @@ export function createNovaMuiTheme(opts: ThemeOptions): Theme {
71
18
  window.matchMedia?.("(prefers-color-scheme: light)")?.matches
72
19
  isDark = !browserPrefersLight
73
20
  }
74
-
75
- const nova = isDark ? novaDarkSettings : novaLightSettings
76
-
77
- const theme = createTheme({
78
- palette: {
79
- mode: nova.mode,
80
- primary: {
81
- main: nova.colors.primary,
82
- },
83
- background: {
84
- default: nova.colors.background.default,
85
- paper: nova.colors.background.panel,
86
- },
87
- },
88
- typography: {
89
- allVariants: {
90
- color: nova.colors.textDefault,
91
- },
92
- },
93
- components: {
94
- MuiSelect: {
95
- styleOverrides: {
96
- root: {
97
- backgroundColor: isDark ? "#505968" : undefined,
98
- borderRadius: "10px",
99
- color: "currentColor",
100
- "& > div": {
101
- padding: "4px 16px",
102
- },
103
- "& fieldset": {
104
- border: isDark ? "none" : undefined,
105
- },
106
- },
107
- },
108
- },
109
- MuiChip: {
110
- styleOverrides: {
111
- root: {
112
- backgroundColor: isDark ? "#505968" : undefined,
113
- borderRadius: "10px",
114
- color: "currentColor",
115
- },
116
- },
117
- },
118
- MuiToggleButtonGroup: {
119
- styleOverrides: {
120
- root: {
121
- "& > button": {
122
- borderRadius: "8px",
123
- textTransform: "none",
124
- paddingTop: "4px",
125
- paddingBottom: "4px",
126
- width: "100%",
127
- borderWidth: 0,
128
- backgroundColor: isDark ? "#3d4455" : undefined,
129
- color: isDark ? "rgba(255, 255, 255, 0.8)" : undefined,
130
-
131
- "&.Mui-selected": isDark
132
- ? {
133
- color: "white",
134
- backgroundColor: "#505968",
135
- }
136
- : undefined,
137
- },
138
- },
139
- },
140
- },
141
- MuiTabs: {
142
- styleOverrides: {
143
- root: {
144
- backgroundColor: isDark ? "#101629" : undefined,
145
- minHeight: "42px",
146
- },
147
- },
148
- },
149
- MuiTab: {
150
- styleOverrides: {
151
- root: {
152
- minHeight: "42px",
153
- textTransform: "none",
154
- "&.Mui-selected": isDark
155
- ? {
156
- color: "white",
157
- backgroundColor: "#404554",
158
- }
159
- : undefined,
160
- },
161
- },
162
- },
163
- },
164
- nova,
165
- })
166
-
167
- if (opts) {
168
- return createTheme(theme, opts)
169
- } else {
170
- return theme
171
- }
21
+ return isDark ? createDarkTheme() : createLightTheme()
172
22
  }
@@ -1,11 +0,0 @@
1
- import type { NovaThemeSettings } from "./novaTheme"
2
-
3
- declare module "@mui/material/styles" {
4
- interface Theme {
5
- nova: NovaThemeSettings
6
- }
7
-
8
- interface ThemeOptions {
9
- nova?: NovaThemeSettings
10
- }
11
- }