@zendeskgarden/react-colorpickers 9.0.0-next.9 → 9.1.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 (46) hide show
  1. package/dist/esm/elements/ColorPicker/ColorWell.js +10 -12
  2. package/dist/esm/elements/ColorPicker/index.js +12 -12
  3. package/dist/esm/elements/ColorPickerDialog/index.js +8 -6
  4. package/dist/esm/elements/ColorSwatch/index.js +5 -4
  5. package/dist/esm/elements/ColorSwatchDialog/index.js +8 -5
  6. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js +1 -1
  7. package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +1 -1
  8. package/dist/esm/styled/ColorPicker/StyledAlphaRange.js +4 -7
  9. package/dist/esm/styled/ColorPicker/StyledColorPicker.js +3 -6
  10. package/dist/esm/styled/ColorPicker/StyledColorWell.js +3 -6
  11. package/dist/esm/styled/ColorPicker/StyledColorWellThumb.js +23 -15
  12. package/dist/esm/styled/ColorPicker/StyledHexField.js +2 -5
  13. package/dist/esm/styled/ColorPicker/StyledHueRange.js +2 -6
  14. package/dist/esm/styled/ColorPicker/StyledInput.js +2 -5
  15. package/dist/esm/styled/ColorPicker/StyledInputGroup.js +2 -5
  16. package/dist/esm/styled/ColorPicker/StyledLabel.js +2 -5
  17. package/dist/esm/styled/ColorPicker/StyledPreview.js +6 -9
  18. package/dist/esm/styled/ColorPicker/StyledRGBAField.js +2 -5
  19. package/dist/esm/styled/ColorPicker/StyledSliderGroup.js +2 -5
  20. package/dist/esm/styled/ColorPicker/StyledSliders.js +26 -7
  21. package/dist/esm/styled/ColorPickerDialog/StyledButton.js +2 -8
  22. package/dist/esm/styled/ColorPickerDialog/StyledButtonPreview.js +12 -14
  23. package/dist/esm/styled/ColorPickerDialog/StyledTooltipBody.js +5 -8
  24. package/dist/esm/styled/ColorPickerDialog/StyledTooltipDialog.js +20 -0
  25. package/dist/esm/styled/ColorSwatch/StyledCell.js +2 -5
  26. package/dist/esm/styled/ColorSwatch/StyledColorSwatch.js +2 -5
  27. package/dist/esm/styled/ColorSwatch/StyledColorSwatchInput.js +2 -5
  28. package/dist/esm/styled/ColorSwatch/StyledColorSwatchLabel.js +19 -9
  29. package/dist/esm/styled/ColorSwatch/StyledIcon.js +2 -5
  30. package/dist/esm/styled/common/StyledRange.js +38 -32
  31. package/dist/index.cjs.js +220 -233
  32. package/dist/typings/styled/ColorPicker/StyledAlphaRange.d.ts +2 -2
  33. package/dist/typings/styled/ColorPicker/StyledColorPicker.d.ts +1 -1
  34. package/dist/typings/styled/ColorPicker/StyledColorWell.d.ts +1 -1
  35. package/dist/typings/styled/ColorPicker/StyledPreview.d.ts +3 -3
  36. package/dist/typings/styled/ColorPicker/StyledSliders.d.ts +3 -2
  37. package/dist/typings/styled/ColorPickerDialog/StyledButton.d.ts +0 -1
  38. package/dist/typings/styled/ColorPickerDialog/StyledButtonPreview.d.ts +1 -1
  39. package/dist/typings/styled/ColorPickerDialog/{StyledTooltipModal.d.ts → StyledTooltipDialog.d.ts} +2 -2
  40. package/dist/typings/styled/ColorSwatch/StyledColorSwatchLabel.d.ts +1 -1
  41. package/dist/typings/styled/common/StyledRange.d.ts +2 -2
  42. package/dist/typings/styled/index.d.ts +1 -1
  43. package/dist/typings/styled/types.d.ts +12 -0
  44. package/dist/typings/types/index.d.ts +9 -9
  45. package/package.json +11 -11
  46. package/dist/esm/styled/ColorPickerDialog/StyledTooltipModal.js +0 -23
@@ -5,19 +5,38 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
- import { getTrackMargin, getTrackHeight } from '../common/StyledRange.js';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
+ import { getTrackHeight, getTrackMargin } from '../common/StyledRange.js';
10
10
 
11
11
  const COMPONENT_ID = 'colorpickers.colorpicker_sliders';
12
+ const sizeStyles = props => {
13
+ if (props.$isOpaque) {
14
+ return undefined;
15
+ }
16
+ const trackHeight = getTrackHeight(props);
17
+ const trackMargin = getTrackMargin(props);
18
+ return `
19
+ & > * {
20
+ position: absolute;
21
+ width: 100%;
22
+ height: ${trackMargin * 2 + trackHeight}px;
23
+ }
24
+
25
+ & > :first-child {
26
+ top: -${trackMargin}px;
27
+ }
28
+
29
+ & > :last-child {
30
+ bottom: -${trackMargin}px;
31
+ }
32
+ `;
33
+ };
12
34
  const StyledSliders = styled.div.attrs({
13
35
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
36
+ 'data-garden-version': '9.1.0'
15
37
  }).withConfig({
16
38
  displayName: "StyledSliders",
17
39
  componentId: "sc-1lgr50m-0"
18
- })(["position:relative;margin-", ":", "px;width:100%;& > *{position:absolute;width:100%;height:", "px;}& > :first-child{top:-", "px;}& > :last-child{bottom:-", "px;}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 2, props => getTrackMargin(props) * 2 + getTrackHeight(props), getTrackMargin, getTrackMargin, props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledSliders.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
40
+ })(["position:relative;margin-", ":", "px;width:100%;", " ", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 2, sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
22
41
 
23
42
  export { StyledSliders };
@@ -5,20 +5,14 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
8
  import { Button } from '@zendeskgarden/react-buttons';
10
9
 
11
- const COMPONENT_ID = 'colorpickers.colordialog_button';
12
10
  const StyledButton = styled(Button).attrs({
13
11
  isNeutral: true,
14
- 'data-garden-id': COMPONENT_ID,
15
- 'data-garden-version': '9.0.0-next.9'
12
+ 'data-garden-version': '9.1.0'
16
13
  }).withConfig({
17
14
  displayName: "StyledButton",
18
15
  componentId: "sc-1dlijfv-0"
19
- })(["padding:0;width:", "px;max-width:", "px;&:last-of-type:not(:first-child){border-top-", "-radius:", " !important;border-bottom-", "-radius:", " !important;}", ";"], props => props.theme.space.base * 17, props => props.theme.space.base * 17, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => retrieveComponentStyles(COMPONENT_ID, props));
20
- StyledButton.defaultProps = {
21
- theme: DEFAULT_THEME
22
- };
16
+ })(["padding:0;width:", "px;max-width:", "px;&:last-of-type:not(:first-child){border-top-", "-radius:", " !important;border-bottom-", "-radius:", " !important;}"], props => props.theme.space.base * 17, props => props.theme.space.base * 17, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md, props => props.theme.rtl ? 'left' : 'right', props => props.theme.borderRadii.md);
23
17
 
24
18
  export { StyledButton };
@@ -6,25 +6,26 @@
6
6
  */
7
7
  import styled from 'styled-components';
8
8
  import { rgba } from 'polished';
9
- import { getCheckeredBackground, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { getCheckeredBackground, retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
11
  const COMPONENT_ID = 'colorpickers.colordialog_preview';
12
- const background = props => {
13
- const {
14
- backgroundColor
15
- } = props;
12
+ const background = _ref => {
13
+ let {
14
+ $backgroundColor,
15
+ theme
16
+ } = _ref;
16
17
  let retVal;
17
- if (typeof backgroundColor === 'string') {
18
- retVal = backgroundColor;
19
- } else if (backgroundColor === undefined) {
20
- retVal = props.theme.palette.white;
18
+ if (typeof $backgroundColor === 'string') {
19
+ retVal = $backgroundColor;
20
+ } else if ($backgroundColor === undefined) {
21
+ retVal = theme.palette.white;
21
22
  } else {
22
23
  const {
23
24
  red,
24
25
  green,
25
26
  blue,
26
27
  alpha = 1
27
- } = backgroundColor;
28
+ } = $backgroundColor;
28
29
  retVal = `rgba(${red}, ${green}, ${blue}, ${alpha ? alpha / 100 : 0})`;
29
30
  }
30
31
  return retVal;
@@ -38,14 +39,11 @@ const StyledButtonPreview = styled.span.attrs(props => ({
38
39
  })
39
40
  },
40
41
  'data-garden-id': COMPONENT_ID,
41
- 'data-garden-version': '9.0.0-next.9',
42
+ 'data-garden-version': '9.1.0',
42
43
  'data-test-id': 'dialog-preview'
43
44
  })).withConfig({
44
45
  displayName: "StyledButtonPreview",
45
46
  componentId: "sc-yxis8h-0"
46
47
  })(["display:inline-block;bottom:", "px;border-radius:", ";box-shadow:inset 0 0 0 ", " ", ";width:", "px;height:", "px;", ";"], props => props.theme.space.base, props => props.theme.borderRadii.sm, props => props.theme.borderWidths.sm, props => rgba(props.theme.palette.black, 0.19), props => props.theme.space.base * 5, props => props.theme.space.base * 5, props => retrieveComponentStyles(COMPONENT_ID, props));
47
- StyledButtonPreview.defaultProps = {
48
- theme: DEFAULT_THEME
49
- };
50
48
 
51
49
  export { StyledButtonPreview };
@@ -5,19 +5,16 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { TooltipModal } from '@zendeskgarden/react-modals';
9
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { TooltipDialog } from '@zendeskgarden/react-modals';
9
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
 
11
- const COMPONENT_ID = 'colorpickers.colordialog_tooltipmodal_body';
12
- const StyledTooltipBody = styled(TooltipModal.Body).attrs({
11
+ const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog_body';
12
+ const StyledTooltipBody = styled(TooltipDialog.Body).attrs({
13
13
  'data-garden-id': COMPONENT_ID,
14
- 'data-garden-version': '9.0.0-next.9'
14
+ 'data-garden-version': '9.1.0'
15
15
  }).withConfig({
16
16
  displayName: "StyledTooltipBody",
17
17
  componentId: "sc-1ueddpo-0"
18
18
  })(["padding:0;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
- StyledTooltipBody.defaultProps = {
20
- theme: DEFAULT_THEME
21
- };
22
19
 
23
20
  export { StyledTooltipBody };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import styled from 'styled-components';
8
+ import { TooltipDialog } from '@zendeskgarden/react-modals';
9
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
+
11
+ const COMPONENT_ID = 'colorpickers.colordialog_tooltipdialog';
12
+ const StyledTooltipDialog = styled(TooltipDialog).attrs({
13
+ 'data-garden-id': COMPONENT_ID,
14
+ 'data-garden-version': '9.1.0'
15
+ }).withConfig({
16
+ displayName: "StyledTooltipDialog",
17
+ componentId: "sc-1vbkccl-0"
18
+ })(["width:auto !important;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
19
+
20
+ export { StyledTooltipDialog };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'colorpickers.swatch_cell';
11
11
  const StyledCell = styled.td.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledCell",
16
16
  componentId: "sc-qr3oit-0"
17
17
  })(["padding:", "px;font-size:0;", ";"], props => props.theme.space.base, props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledCell.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledCell };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'colorpickers.color_swatch';
11
11
  const StyledColorSwatch = styled.table.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledColorSwatch",
16
16
  componentId: "sc-ajx440-0"
17
17
  })(["border-collapse:collapse;line-height:normal;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledColorSwatch.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledColorSwatch };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'colorpickers.color_swatch_input';
11
11
  const StyledColorSwatchInput = styled.input.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledColorSwatchInput",
16
16
  componentId: "sc-em45h0-0"
17
17
  })(["position:absolute;opacity:0;z-index:1;margin:0;cursor:pointer;width:100%;height:100%;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledColorSwatchInput.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledColorSwatchInput };
@@ -6,17 +6,30 @@
6
6
  */
7
7
  import styled from 'styled-components';
8
8
  import { parseToRgb, readableColor } from 'polished';
9
- import { focusStyles, retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
+ import { focusStyles, retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
10
10
  import { StyledButtonPreview } from '../ColorPickerDialog/StyledButtonPreview.js';
11
11
 
12
12
  const COMPONENT_ID = 'colorpickers.color_swatch_label';
13
- const colorStyles = props => {
13
+ const colorStyles = _ref => {
14
+ let {
15
+ $backgroundColor,
16
+ theme
17
+ } = _ref;
14
18
  const {
15
19
  alpha
16
- } = parseToRgb(props.backgroundColor);
17
- let foregroundColor = getColorV8('foreground', 600 , props.theme);
20
+ } = parseToRgb($backgroundColor);
21
+ const returnIfLightColor = getColor({
22
+ theme,
23
+ hue: 'neutralHue',
24
+ shade: 900
25
+ });
26
+ let foregroundColor = returnIfLightColor;
18
27
  if (alpha === undefined || alpha >= 0.4) {
19
- foregroundColor = readableColor(props.backgroundColor, foregroundColor, getColorV8('background', 600 , props.theme), false );
28
+ const returnIfDarkColor = getColor({
29
+ theme,
30
+ hue: 'white'
31
+ });
32
+ foregroundColor = readableColor($backgroundColor, returnIfLightColor, returnIfDarkColor, false );
20
33
  }
21
34
  return `
22
35
  color: ${foregroundColor};
@@ -25,7 +38,7 @@ const colorStyles = props => {
25
38
  const StyledColorSwatchLabel = styled(StyledButtonPreview).attrs({
26
39
  as: 'label',
27
40
  'data-garden-id': COMPONENT_ID,
28
- 'data-garden-version': '9.0.0-next.9'
41
+ 'data-garden-version': '9.1.0'
29
42
  }).withConfig({
30
43
  displayName: "StyledColorSwatchLabel",
31
44
  componentId: "sc-1aghocg-0"
@@ -33,8 +46,5 @@ const StyledColorSwatchLabel = styled(StyledButtonPreview).attrs({
33
46
  theme: props.theme,
34
47
  selector: '&:has(:focus-visible)'
35
48
  }), props => retrieveComponentStyles(COMPONENT_ID, props));
36
- StyledColorSwatchLabel.defaultProps = {
37
- theme: DEFAULT_THEME
38
- };
39
49
 
40
50
  export { StyledColorSwatchLabel };
@@ -6,19 +6,16 @@
6
6
  */
7
7
  import styled from 'styled-components';
8
8
  import SvgCheckSmFill from '../../node_modules/@zendeskgarden/svg-icons/src/12/check-sm-fill.svg.js';
9
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
9
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
10
10
  import { StyledColorSwatchInput } from './StyledColorSwatchInput.js';
11
11
 
12
12
  const COMPONENT_ID = 'colorpickers.colorswatch_check';
13
13
  const StyledIcon = styled(SvgCheckSmFill).attrs({
14
14
  'data-garden-id': COMPONENT_ID,
15
- 'data-garden-version': '9.0.0-next.9'
15
+ 'data-garden-version': '9.1.0'
16
16
  }).withConfig({
17
17
  displayName: "StyledIcon",
18
18
  componentId: "sc-8oigif-0"
19
19
  })(["position:absolute;top:0;left:0;transition:opacity 0.2s ease-in-out;opacity:0;width:100%;height:100%;", ":checked ~ &{opacity:1;}", ";"], StyledColorSwatchInput, props => retrieveComponentStyles(COMPONENT_ID, props));
20
- StyledIcon.defaultProps = {
21
- theme: DEFAULT_THEME
22
- };
23
20
 
24
21
  export { StyledIcon };
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { Range } from '@zendeskgarden/react-forms';
8
8
  import styled from 'styled-components';
9
- import { stripUnit, math } from 'polished';
10
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
+ import { stripUnit } from 'polished';
10
+ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
11
11
 
12
12
  const COMPONENT_ID = 'colorpickers.colorpicker_range';
13
13
  const thumbStyles = function (styles) {
@@ -54,17 +54,36 @@ const trackLowerStyles = function (styles) {
54
54
  }
55
55
  `;
56
56
  };
57
- const colorStyles = props => {
58
- const thumbBackgroundColor = getColorV8('neutralHue', 100, props.theme);
59
- const thumbBorderColor = thumbBackgroundColor;
60
- const thumbActiveBackgroundColor = getColorV8('neutralHue', 200, props.theme);
61
- const thumbActiveBorderColor = getColorV8('primaryHue', 600, props.theme);
62
- const thumbFocusBorderColor = getColorV8('primaryHue', 400, props.theme);
63
- const thumbHoverBackgroundColor = thumbActiveBackgroundColor;
64
- const thumbHoverBorderColor = thumbHoverBackgroundColor;
57
+ const colorStyles = _ref => {
58
+ let {
59
+ theme
60
+ } = _ref;
61
+ const thumbBackgroundColor = getColor({
62
+ theme,
63
+ variable: 'background.default'
64
+ });
65
+ const thumbBorderColor = getColor({
66
+ theme,
67
+ variable: 'border.default',
68
+ dark: {
69
+ offset: -100
70
+ },
71
+ light: {
72
+ offset: 100
73
+ }
74
+ });
75
+ const thumbActiveBackgroundColor = thumbBackgroundColor;
76
+ const thumbActiveBorderColor = getColor({
77
+ theme,
78
+ variable: 'border.primaryEmphasis'
79
+ });
80
+ const thumbFocusBorderColor = thumbActiveBorderColor;
81
+ const thumbHoverBackgroundColor = getColor({
82
+ theme,
83
+ variable: 'background.subtle'
84
+ });
85
+ const thumbHoverBorderColor = thumbActiveBorderColor;
65
86
  return `
66
- border-color: ${props.isOpaque && getColorV8('background', 600 , props.theme)};
67
-
68
87
  ${trackStyles(`
69
88
  background-color: transparent;
70
89
  `)}
@@ -94,32 +113,22 @@ const colorStyles = props => {
94
113
  `, ':active')}
95
114
  `;
96
115
  };
97
- const getThumbSize = props => props.theme.space.base * (props.isOpaque ? 6 : 4);
98
- const getTrackHeight = props => props.theme.space.base * (props.isOpaque ? 6 : 3);
116
+ const getThumbSize = props => props.theme.space.base * (props.$isOpaque ? 6 : 4);
117
+ const getTrackHeight = props => props.theme.space.base * (props.$isOpaque ? 6 : 3);
99
118
  const getTrackMargin = props => (getThumbSize(props) - getTrackHeight(props)) / 2 + stripUnit(props.theme.shadowWidths.md);
100
119
  const sizeStyles = props => {
101
120
  const thumbSize = getThumbSize(props);
102
121
  const trackHeight = getTrackHeight(props);
103
122
  const trackMargin = getTrackMargin(props);
104
123
  const thumbMargin = (trackHeight - thumbSize) / 2;
105
- const trackOffset = props.theme.space.base * (props.isOpaque ? -2 : -1);
106
- const height = props.isOpaque ? trackHeight : trackMargin * 2 + trackHeight;
107
- let marginHorizontal;
108
- let border;
109
- let borderRadius;
110
- if (props.isOpaque) {
111
- marginHorizontal = `-${trackMargin}px`;
112
- border = `${trackMargin}px ${props.theme.borderStyles.solid}`;
113
- borderRadius = `${trackMargin + stripUnit(props.theme.shadowWidths.md)}px`;
114
- }
124
+ const trackOffset = props.theme.space.base * (props.$isOpaque ? -2 : -1);
125
+ const height = props.$isOpaque ? trackHeight : trackMargin * 2 + trackHeight;
115
126
  return `
116
127
  /* stylelint-disable-next-line declaration-no-important */
117
128
  margin-top: 0 !important;
118
- margin-${props.theme.rtl ? 'right' : 'left'}: ${marginHorizontal};
119
129
  height: ${height}px; /* [1] */
120
130
  box-sizing: content-box; /* [2] */
121
- border: ${border};
122
- border-radius: ${borderRadius};
131
+ border-radius: ${props.$isOpaque && props.theme.borderRadii.md};
123
132
 
124
133
  ${trackStyles(`
125
134
  margin: ${trackMargin}px ${trackOffset}px;
@@ -128,7 +137,7 @@ const sizeStyles = props => {
128
137
 
129
138
  ${thumbStyles(`
130
139
  margin: ${thumbMargin}px 0;
131
- border-width: ${math(`${props.theme.borderWidths.sm} * 2`)};
140
+ border-width: ${props.theme.borderWidths.sm};
132
141
  height: ${thumbSize}px;
133
142
  width: ${thumbSize}px;
134
143
  `)};
@@ -136,7 +145,7 @@ const sizeStyles = props => {
136
145
  };
137
146
  const StyledRange = styled(Range).attrs({
138
147
  'data-garden-id': COMPONENT_ID,
139
- 'data-garden-version': '9.0.0-next.9',
148
+ 'data-garden-version': '9.1.0',
140
149
  hasLowerTrack: false
141
150
  }).withConfig({
142
151
  displayName: "StyledRange",
@@ -144,8 +153,5 @@ const StyledRange = styled(Range).attrs({
144
153
  })(["", ";", " ", ";", ";"], sizeStyles, trackStyles(`
145
154
  border-radius: 0;
146
155
  `), colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
147
- StyledRange.defaultProps = {
148
- theme: DEFAULT_THEME
149
- };
150
156
 
151
157
  export { StyledRange, getTrackHeight, getTrackMargin, trackStyles };