@wandelbots/wandelbots-js-react-components 1.8.0 → 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 (91) 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/wandelscript-editor/WandelscriptEditor.d.ts +2 -2
  34. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +1 -1
  35. package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts +2 -2
  36. package/dist/components/wandelscript-editor/WandelscriptEditor.stories.d.ts.map +1 -1
  37. package/dist/externalizeComponent.d.ts +7 -0
  38. package/dist/externalizeComponent.d.ts.map +1 -0
  39. package/dist/index.cjs +29 -48
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.ts +49 -9
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +11681 -12331
  44. package/dist/index.js.map +1 -1
  45. package/dist/themes/color.d.ts +1 -1
  46. package/dist/themes/color.d.ts.map +1 -1
  47. package/dist/themes/novaTheme.stories.d.ts +5 -0
  48. package/dist/themes/novaTheme.stories.d.ts.map +1 -0
  49. package/dist/themes/theming.d.ts +49 -0
  50. package/dist/themes/theming.d.ts.map +1 -0
  51. package/package.json +20 -13
  52. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +2 -2
  53. package/src/components/CopyableText.tsx +30 -0
  54. package/src/components/LoadingButton.stories.tsx +19 -26
  55. package/src/components/ThemeSelect.tsx +3 -4
  56. package/src/components/VelocitySlider.stories.tsx +10 -15
  57. package/src/components/VelocitySlider.tsx +7 -2
  58. package/src/components/jogging/JoggingCartesianAxisControl.stories.tsx +21 -21
  59. package/src/components/jogging/JoggingCartesianAxisControl.tsx +1 -1
  60. package/src/components/jogging/JoggingCartesianTab.tsx +37 -44
  61. package/src/components/jogging/JoggingCartesianValues.tsx +37 -33
  62. package/src/components/jogging/JoggingJointLimitDetector.tsx +10 -7
  63. package/src/components/jogging/JoggingJointRotationControl.stories.tsx +31 -19
  64. package/src/components/jogging/JoggingJointRotationControl.tsx +44 -30
  65. package/src/components/jogging/JoggingJointValues.tsx +35 -33
  66. package/src/components/jogging/JoggingOptions.tsx +130 -80
  67. package/src/components/jogging/JoggingPanel.stories.tsx +20 -17
  68. package/src/components/jogging/JoggingPanel.tsx +29 -31
  69. package/src/components/jogging/JoggingStore.tsx +69 -18
  70. package/src/components/jogging/JoggingVelocitySlider.tsx +24 -22
  71. package/src/components/wandelscript-editor/WandelscriptEditor.stories.tsx +7 -7
  72. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +48 -23
  73. package/src/externalizeComponent.tsx +37 -0
  74. package/src/i18n/locales/de/translations.json +2 -1
  75. package/src/i18n/locales/en/translations.json +2 -1
  76. package/src/icons/orientation-coord-system.svg +3 -0
  77. package/src/icons/orientation-tool.svg +3 -0
  78. package/src/index.ts +39 -9
  79. package/src/themes/color.tsx +29 -19
  80. package/src/themes/novaTheme.stories.tsx +77 -0
  81. package/src/themes/themeTypes.d.ts +11 -0
  82. package/src/themes/theming.ts +174 -0
  83. package/dist/themes/theme.d.ts +0 -144
  84. package/dist/themes/theme.d.ts.map +0 -1
  85. package/dist/themes/wbTheme.d.ts +0 -73
  86. package/dist/themes/wbTheme.d.ts.map +0 -1
  87. package/dist/themes/wbTheme.stories.d.ts +0 -7
  88. package/dist/themes/wbTheme.stories.d.ts.map +0 -1
  89. package/src/themes/theme.ts +0 -150
  90. package/src/themes/wbTheme.stories.tsx +0 -64
  91. package/src/themes/wbTheme.ts +0 -186
@@ -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