sbwb-ds 3.1.9 → 3.1.11

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbwb-ds",
3
- "version": "3.1.9",
3
+ "version": "3.1.11",
4
4
  "type": "module",
5
5
  "description": "Sistema de design para padronização dos processos visuais do portal SUBWEB",
6
6
  "main": "dist/sbwb-ds.js",
@@ -122,22 +122,24 @@ Default.args = {
122
122
  borderRadius: '4px',
123
123
  },
124
124
  },
125
- primaryButtonProps: {
125
+ secondaryButtonProps: {
126
126
  children: 'Button',
127
127
  onClick: () => {
128
- alert('example button clicked!');
128
+ alert('secondary example button clicked!');
129
129
  },
130
130
  width: '100%',
131
131
  height: '40px',
132
+ size: 'Small',
132
133
  },
133
- secondaryButtonProps: {
134
+ primaryButtonProps: {
134
135
  children: 'Button',
135
136
  onClick: () => {
136
- alert('secondary example button clicked!');
137
+ alert('example button clicked!');
137
138
  },
138
139
  width: '100%',
139
140
  height: '40px',
140
141
  variant: 'secondary',
142
+ size: 'Small',
141
143
  },
142
144
  description:
143
145
  'Lorem ipsum dolor sit amet consectetur. Tristique diam orci non nisl sociis interdum. Id ut in gravida amet risus felis. Bibendum nulla tincidunt a amet Egestas nisi. ',
@@ -186,75 +186,14 @@ const Popover = ({
186
186
  }
187
187
  };
188
188
 
189
- // const handleMouseEnterPopover = () => { # Removed because of design changes
190
- // if (popoverRef.current) {
191
- // popoverRef.current.style.opacity = '1';
192
- // popoverRef.current.style.visibility = 'visible';
193
- // }
194
- // };
195
-
196
- // const handleMouseLeavePopover = () => {
197
- // if (popoverRef.current && !isAlwaysVisible) {
198
- // popoverRef.current.style.opacity = '0';
199
- // popoverRef.current.style.visibility = 'hidden';
200
- // }
201
- // };
202
189
  useEffect(() => {
203
- const handleMouseEnter = () => {
204
- if (popoverRef.current) {
205
- // popoverRef.current.style.opacity = '1'; # Removed because of design changes
206
- // popoverRef.current.style.visibility = 'visible';
207
- updatePopoverPosition();
208
- }
209
- };
210
-
211
- const handleMouseLeave = () => {
212
- if (popoverRef.current && !isAlwaysVisible) {
213
- // popoverRef.current.style.opacity = '0'; # Removed because of design changes
214
- // popoverRef.current.style.visibility = 'hidden';
215
- }
216
- };
217
-
218
190
  if (isActive) {
219
191
  updatePopoverPosition();
220
192
  window.addEventListener('resize', updatePopoverPosition);
221
-
222
- if (targetRef.current) {
223
- // targetRef.current.addEventListener('mouseenter', handleMouseEnter); # Removed because of design changes
224
- // targetRef.current.addEventListener('mouseleave', handleMouseLeave);
225
- }
226
- }
227
-
228
- if (targetRef.current) {
229
- // targetRef.current.addEventListener('mouseenter', handleMouseEnter); # Removed because of design changes
230
- // targetRef.current.addEventListener('mouseleave', handleMouseLeave);
231
- }
232
-
233
- if (popoverRef.current) {
234
- // popoverRef.current.addEventListener( # Removed because of design changes
235
- // 'mouseenter',
236
- // // handleMouseEnterPopover
237
- // );
238
- // popoverRef.current.addEventListener(
239
- // 'mouseleave',
240
- // handleMouseLeavePopover
241
- // );
242
193
  }
243
194
 
244
195
  return () => {
245
196
  window.removeEventListener('resize', updatePopoverPosition);
246
- // if (targetRef.current) {
247
- // targetRef.current.removeEventListener('mouseenter', handleMouseEnter); # Removed because of design changes
248
- // targetRef.current.removeEventListener('mouseleave', handleMouseLeave);
249
- // popoverRef.current.removeEventListener(
250
- // 'mouseenter',
251
- // handleMouseEnterPopover
252
- // );
253
- // popoverRef.current.removeEventListener(
254
- // 'mouseleave',
255
- // handleMouseLeavePopover
256
- // );
257
- // }
258
197
  };
259
198
  }, [isActive, position, popoverMargin]);
260
199
 
@@ -294,30 +233,33 @@ const Popover = ({
294
233
  />
295
234
  </C.PopoverTitle>
296
235
  )}
297
- <div style={{ height: 16 }} />
236
+
237
+ {imageProps && (
238
+ <>
239
+ <div style={{ height: sg.spacings.spacingInset.spacingInsetSm }} />
240
+ <C.ImageWrapper>
241
+ <img {...imageProps} />
242
+ </C.ImageWrapper>
243
+ </>
244
+ )}
298
245
  {Boolean(actualStep) && (
299
246
  <>
247
+ <div style={{ height: sg.spacings.spacingInset.spacingInsetXs }} />
300
248
  <C.StepsContainer>
301
249
  <C.Steps>
302
250
  Step {actualStep} {totalSteps && `of ${totalSteps}`}
303
251
  </C.Steps>
304
252
  </C.StepsContainer>
305
- <div style={{ height: 8 }} />
253
+ <div style={{ height: sg.spacings.spacingInset.spacingInsetNano }} />
306
254
  </>
307
255
  )}
308
- {imageProps && (
309
- <C.ImageWrapper>
310
- <img {...imageProps} />
311
- </C.ImageWrapper>
312
- )}
313
- <div style={{ height: 12 }} />
314
256
  {description && <C.Description>{description}</C.Description>}
315
- <div style={{ height: 12 }} />
257
+ <div style={{ height: sg.spacings.spacingInset.spacingInsetXs }} />
316
258
  <C.ButtonsContainer>
317
259
  {primaryButtonProps && <Button {...primaryButtonProps} />}
318
260
  {secondaryButtonProps && <Button {...secondaryButtonProps} />}
319
261
  </C.ButtonsContainer>
320
- <div style={{ height: 12 }} />
262
+ <div style={{ height: sg.spacings.spacingInset.spacingInsetXs }} />
321
263
  {onDontShowAgain && (
322
264
  <C.DialogContainer>
323
265
  <CheckBox
@@ -336,8 +278,6 @@ const Popover = ({
336
278
  wrapperWidth={wrapperWidth}
337
279
  wrapperHeight={wrapperHeight}
338
280
  wrapperStyles={wrapperStyles}
339
- // onMouseEnter={handleMouseEnterPopover} # Removed because of design changes
340
- // onMouseLeave={handleMouseLeavePopover} # Removed because of design changes
341
281
  >
342
282
  {children}
343
283
  {ReactDOM.createPortal(popoverContent, document.body)}
@@ -55,7 +55,7 @@ export const PopoverContent = styled.div<PopoverContentProps>`
55
55
  box-shadow: ${sg.shadows.shadowLevelNear};
56
56
  border: 1px solid ${sg.colors.neutralColors.colorNeutralClean};
57
57
  background-color: ${sg.colors.neutralColors.colorNeutralSnow};
58
- border-radius: ${sg.borders.borderRadius.borderExtraSmall};
58
+ border-radius: ${sg.borders.borderRadius.borderRadiusSm};
59
59
  text-align: center;
60
60
  min-width: 32px;
61
61
  // visibility: ${({ isVisible }) => (isVisible ? 'visible' : 'hidden')};
@@ -137,8 +137,13 @@ export const PopoverTitle = styled.div`
137
137
  width: 100%;
138
138
  font-size: ${sg.fonts.fontSize.fontSizeBodyLg};
139
139
  font-weight: ${sg.fonts.fontWeight.fontWeightSemiBold};
140
+ color: ${sg.colors.neutralColors.colorNeutralDarkest};
141
+ `;
142
+ export const ImageWrapper = styled.div`
143
+ margin: 0;
144
+ padding: 0;
145
+ line-height: 0;
140
146
  `;
141
- export const ImageWrapper = styled.div``;
142
147
  export const Description = styled.div`
143
148
  display: flex;
144
149
  flex-direction: column;
@@ -147,6 +152,7 @@ export const Description = styled.div`
147
152
  width: 100%;
148
153
  font-size: ${sg.fonts.fontSize.fontSizeBodyMd};
149
154
  weight: ${sg.fonts.fontWeight.fontWeightRegular};
155
+ color: ${sg.colors.neutralColors.colorNeutralDark};
150
156
  `;
151
157
  export const ButtonsContainer = styled.div`
152
158
  display: flex;