@instructure/ui-color-picker 11.7.8 → 11.7.9-snapshot-1

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 (47) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/es/ColorIndicator/v1/styles.js +2 -3
  3. package/es/ColorIndicator/v2/styles.js +2 -3
  4. package/es/ColorMixer/v1/index.js +10 -11
  5. package/es/ColorMixer/v2/index.js +10 -11
  6. package/es/ColorPicker/v1/index.js +3 -4
  7. package/es/ColorPicker/v2/index.js +3 -4
  8. package/es/ColorPreset/v1/index.js +6 -6
  9. package/es/ColorPreset/v2/index.js +6 -6
  10. package/lib/ColorContrast/v1/index.js +5 -6
  11. package/lib/ColorContrast/v2/index.js +5 -6
  12. package/lib/ColorIndicator/v1/index.js +2 -2
  13. package/lib/ColorIndicator/v1/styles.js +2 -4
  14. package/lib/ColorIndicator/v2/index.js +2 -2
  15. package/lib/ColorIndicator/v2/styles.js +2 -4
  16. package/lib/ColorMixer/v1/ColorPalette/index.js +7 -7
  17. package/lib/ColorMixer/v1/ColorPalette/styles.js +3 -3
  18. package/lib/ColorMixer/v1/RGBAInput/index.js +5 -5
  19. package/lib/ColorMixer/v1/Slider/index.js +3 -3
  20. package/lib/ColorMixer/v1/index.js +13 -14
  21. package/lib/ColorMixer/v2/ColorPalette/index.js +7 -7
  22. package/lib/ColorMixer/v2/ColorPalette/styles.js +3 -3
  23. package/lib/ColorMixer/v2/RGBAInput/index.js +5 -5
  24. package/lib/ColorMixer/v2/Slider/index.js +3 -3
  25. package/lib/ColorMixer/v2/index.js +13 -14
  26. package/lib/ColorPicker/v1/index.js +14 -19
  27. package/lib/ColorPicker/v2/index.js +10 -12
  28. package/lib/ColorPreset/v1/index.js +11 -12
  29. package/lib/ColorPreset/v2/index.js +8 -8
  30. package/package.json +24 -24
  31. package/src/ColorIndicator/v1/styles.ts +3 -4
  32. package/src/ColorIndicator/v2/styles.ts +3 -4
  33. package/src/ColorMixer/v1/index.tsx +15 -13
  34. package/src/ColorMixer/v2/index.tsx +15 -13
  35. package/src/ColorPicker/v1/index.tsx +7 -4
  36. package/src/ColorPicker/v2/index.tsx +7 -4
  37. package/src/ColorPreset/v1/index.tsx +6 -9
  38. package/src/ColorPreset/v2/index.tsx +6 -9
  39. package/tsconfig.build.tsbuildinfo +1 -1
  40. package/types/ColorIndicator/v1/styles.d.ts.map +1 -1
  41. package/types/ColorIndicator/v2/styles.d.ts.map +1 -1
  42. package/types/ColorMixer/v1/index.d.ts.map +1 -1
  43. package/types/ColorMixer/v2/index.d.ts.map +1 -1
  44. package/types/ColorPicker/v1/index.d.ts.map +1 -1
  45. package/types/ColorPicker/v2/index.d.ts.map +1 -1
  46. package/types/ColorPreset/v1/index.d.ts.map +1 -1
  47. package/types/ColorPreset/v2/index.d.ts.map +1 -1
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.ColorPreset = void 0;
8
8
  var _react = require("react");
9
9
  var _emotion = require("@instructure/emotion");
10
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
- var _uiColorUtils = _interopRequireDefault(require("@instructure/ui-color-utils"));
10
+ var _uiReactUtils = require("@instructure/ui-react-utils");
11
+ var _uiColorUtils = require("@instructure/ui-color-utils");
12
12
  var _latest = require("@instructure/ui-buttons/latest");
13
13
  var _latest2 = require("@instructure/ui-view/latest");
14
14
  var _latest3 = require("@instructure/ui-tooltip/latest");
@@ -94,7 +94,7 @@ let ColorPreset = exports.ColorPreset = (_dec = (0, _emotion.withStyleNew)(_styl
94
94
  const {
95
95
  selected
96
96
  } = this.props;
97
- return !!selected && _uiColorUtils.default.colorToHex8(selected) === _uiColorUtils.default.colorToHex8(color);
97
+ return !!selected && (0, _uiColorUtils.colorToHex8)(selected) === (0, _uiColorUtils.colorToHex8)(color);
98
98
  }
99
99
  onMenuItemSelected = color => (_e, args) => {
100
100
  if (args.value === 'select') {
@@ -135,9 +135,9 @@ let ColorPreset = exports.ColorPreset = (_dec = (0, _emotion.withStyleNew)(_styl
135
135
  children: [(0, _jsxRuntime.jsxs)("div", {
136
136
  css: this.props.styles?.popoverContent,
137
137
  children: [(0, _jsxRuntime.jsx)(_index2.ColorMixer, {
138
- value: _uiColorUtils.default.colorToHex8(this.state.newColor),
138
+ value: (0, _uiColorUtils.colorToHex8)(this.state.newColor),
139
139
  onChange: newColor => this.setState({
140
- newColor: _uiColorUtils.default.colorToRGB(newColor)
140
+ newColor: (0, _uiColorUtils.colorToRGB)(newColor)
141
141
  }),
142
142
  withAlpha: this.props?.colorMixerSettings?.colorMixer?.withAlpha,
143
143
  rgbRedInputScreenReaderLabel: this.props.colorMixerSettings.colorMixer.rgbRedInputScreenReaderLabel,
@@ -151,7 +151,7 @@ let ColorPreset = exports.ColorPreset = (_dec = (0, _emotion.withStyleNew)(_styl
151
151
  css: this.props.styles?.popoverContrastBlock,
152
152
  children: (0, _jsxRuntime.jsx)(_index3.ColorContrast, {
153
153
  firstColor: this.props.colorMixerSettings.colorContrast.firstColor,
154
- secondColor: _uiColorUtils.default.colorToHex8(this.state.newColor),
154
+ secondColor: (0, _uiColorUtils.colorToHex8)(this.state.newColor),
155
155
  label: this.props.colorMixerSettings.colorContrast.label,
156
156
  successLabel: this.props.colorMixerSettings.colorContrast.successLabel,
157
157
  failureLabel: this.props.colorMixerSettings.colorContrast.failureLabel,
@@ -166,7 +166,7 @@ let ColorPreset = exports.ColorPreset = (_dec = (0, _emotion.withStyleNew)(_styl
166
166
  css: this.props.styles?.popoverFooter,
167
167
  children: [(0, _jsxRuntime.jsx)(_latest.Button, {
168
168
  onClick: () => {
169
- this.props?.colorMixerSettings?.onPresetChange([_uiColorUtils.default.colorToHex8(this.state.newColor), ...this.props.colors]);
169
+ this.props?.colorMixerSettings?.onPresetChange([(0, _uiColorUtils.colorToHex8)(this.state.newColor), ...this.props.colors]);
170
170
  this.setState({
171
171
  openAddNew: false
172
172
  });
@@ -273,7 +273,7 @@ let ColorPreset = exports.ColorPreset = (_dec = (0, _emotion.withStyleNew)(_styl
273
273
  return null;
274
274
  }
275
275
  return (0, _jsxRuntime.jsxs)("div", {
276
- ...(0, _omitProps.omitProps)(this.props, ColorPreset.allowedProps),
276
+ ...(0, _uiReactUtils.omitProps)(this.props, ColorPreset.allowedProps),
277
277
  ref: this.handleRef,
278
278
  css: styles?.colorPreset,
279
279
  "data-cid": "ColorPreset",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-color-picker",
3
- "version": "11.7.8",
3
+ "version": "11.7.9-snapshot-1",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -15,32 +15,32 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.29.7",
18
- "@instructure/console": "11.7.8",
19
- "@instructure/emotion": "11.7.8",
20
- "@instructure/ui-a11y-content": "11.7.8",
21
- "@instructure/ui-buttons": "11.7.8",
22
- "@instructure/shared-types": "11.7.8",
23
- "@instructure/ui-color-utils": "11.7.8",
24
- "@instructure/ui-drilldown": "11.7.8",
25
- "@instructure/ui-dom-utils": "11.7.8",
26
- "@instructure/ui-form-field": "11.7.8",
27
- "@instructure/ui-pill": "11.7.8",
28
- "@instructure/ui-icons": "11.7.8",
29
- "@instructure/ui-popover": "11.7.8",
30
- "@instructure/ui-react-utils": "11.7.8",
31
- "@instructure/ui-heading": "11.7.8",
32
- "@instructure/ui-text": "11.7.8",
33
- "@instructure/ui-text-input": "11.7.8",
34
- "@instructure/ui-tooltip": "11.7.8",
35
- "@instructure/ui-themes": "11.7.8",
36
- "@instructure/ui-view": "11.7.8",
37
- "@instructure/ui-utils": "11.7.8"
18
+ "@instructure/emotion": "11.7.9-snapshot-1",
19
+ "@instructure/console": "11.7.9-snapshot-1",
20
+ "@instructure/shared-types": "11.7.9-snapshot-1",
21
+ "@instructure/ui-a11y-content": "11.7.9-snapshot-1",
22
+ "@instructure/ui-buttons": "11.7.9-snapshot-1",
23
+ "@instructure/ui-color-utils": "11.7.9-snapshot-1",
24
+ "@instructure/ui-dom-utils": "11.7.9-snapshot-1",
25
+ "@instructure/ui-drilldown": "11.7.9-snapshot-1",
26
+ "@instructure/ui-heading": "11.7.9-snapshot-1",
27
+ "@instructure/ui-form-field": "11.7.9-snapshot-1",
28
+ "@instructure/ui-icons": "11.7.9-snapshot-1",
29
+ "@instructure/ui-react-utils": "11.7.9-snapshot-1",
30
+ "@instructure/ui-pill": "11.7.9-snapshot-1",
31
+ "@instructure/ui-text-input": "11.7.9-snapshot-1",
32
+ "@instructure/ui-popover": "11.7.9-snapshot-1",
33
+ "@instructure/ui-text": "11.7.9-snapshot-1",
34
+ "@instructure/ui-tooltip": "11.7.9-snapshot-1",
35
+ "@instructure/ui-themes": "11.7.9-snapshot-1",
36
+ "@instructure/ui-utils": "11.7.9-snapshot-1",
37
+ "@instructure/ui-view": "11.7.9-snapshot-1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "vitest": "^5.0.0",
41
- "@instructure/ui-axe-check": "11.7.8",
42
- "@instructure/ui-scripts": "11.7.8",
43
- "@instructure/ui-babel-preset": "11.7.8"
41
+ "@instructure/ui-axe-check": "11.7.9-snapshot-1",
42
+ "@instructure/ui-babel-preset": "11.7.9-snapshot-1",
43
+ "@instructure/ui-scripts": "11.7.9-snapshot-1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=18 <=19"
@@ -25,8 +25,7 @@
25
25
  import type { ColorIndicatorProps, ColorIndicatorStyle } from './props'
26
26
  import type { ColorIndicatorTheme } from '@instructure/shared-types'
27
27
  import type { RGBAType } from '@instructure/ui-color-utils'
28
- import conversions from '@instructure/ui-color-utils'
29
- import { isValid } from '@instructure/ui-color-utils'
28
+ import { colorToRGB, isValid } from '@instructure/ui-color-utils'
30
29
 
31
30
  const calcBlendedColor = (c1: RGBAType, c2: RGBAType) => {
32
31
  // 0.4 as decided by design
@@ -79,8 +78,8 @@ const generateStyle = (
79
78
  backgroundSize: componentTheme.backgroundSize,
80
79
  backgroundPosition: componentTheme.backgroundPosition,
81
80
  borderColor: calcBlendedColor(
82
- conversions.colorToRGB(componentTheme.colorIndicatorBorderColor),
83
- conversions.colorToRGB(isValid(color!) ? color! : '#fff')
81
+ colorToRGB(componentTheme.colorIndicatorBorderColor),
82
+ colorToRGB(isValid(color!) ? color! : '#fff')
84
83
  )
85
84
  }
86
85
  }
@@ -25,8 +25,7 @@
25
25
  import type { ColorIndicatorProps, ColorIndicatorStyle } from './props'
26
26
  import type { NewComponentTypes } from '@instructure/ui-themes'
27
27
  import type { RGBAType } from '@instructure/ui-color-utils'
28
- import conversions from '@instructure/ui-color-utils'
29
- import { isValid } from '@instructure/ui-color-utils'
28
+ import { colorToRGB, isValid } from '@instructure/ui-color-utils'
30
29
 
31
30
  const calcBlendedColor = (c1: RGBAType, c2: RGBAType) => {
32
31
  // 0.4 as decided by design
@@ -79,8 +78,8 @@ const generateStyle = (
79
78
  backgroundSize: componentTheme.backgroundSize,
80
79
  backgroundPosition: componentTheme.backgroundPosition,
81
80
  borderColor: calcBlendedColor(
82
- conversions.colorToRGB(componentTheme.colorIndicatorBorderColor),
83
- conversions.colorToRGB(isValid(color!) ? color! : '#fff')
81
+ colorToRGB(componentTheme.colorIndicatorBorderColor),
82
+ colorToRGB(isValid(color!) ? color! : '#fff')
84
83
  )
85
84
  }
86
85
  }
@@ -26,8 +26,12 @@ import { Component } from 'react'
26
26
 
27
27
  import { withStyle } from '@instructure/emotion'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
- import { isValid } from '@instructure/ui-color-utils'
30
- import conversions from '@instructure/ui-color-utils'
29
+ import {
30
+ isValid,
31
+ colorToHsva,
32
+ colorToHex8,
33
+ colorToRGB
34
+ } from '@instructure/ui-color-utils'
31
35
  import { logWarn as warn } from '@instructure/console'
32
36
  import type { HSVType } from '@instructure/ui-color-utils'
33
37
  import ColorPalette from './ColorPalette/index.js'
@@ -90,7 +94,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
90
94
  `[ColorMixer] The passed color value is not valid.`
91
95
  )
92
96
  this.setState({
93
- ...conversions.colorToHsva(this.props.value!)
97
+ ...colorToHsva(this.props.value!)
94
98
  })
95
99
  }
96
100
 
@@ -103,14 +107,14 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
103
107
  prevState.v !== v ||
104
108
  prevState.a !== a
105
109
  ) {
106
- this.props.onChange(conversions.colorToHex8({ h, s, v, a }))
110
+ this.props.onChange(colorToHex8({ h, s, v, a }))
107
111
  }
108
112
  if (
109
113
  prevProps.value !== this.props.value &&
110
- conversions.colorToHex8({ h, s, v, a }) !== this.props.value
114
+ colorToHex8({ h, s, v, a }) !== this.props.value
111
115
  ) {
112
116
  this.setState({
113
- ...conversions.colorToHsva(this.props.value!)
117
+ ...colorToHsva(this.props.value!)
114
118
  })
115
119
  }
116
120
  }
@@ -141,7 +145,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
141
145
  >
142
146
  <span
143
147
  css={styles?.sliderAndPaletteContainer}
144
- aria-label={`${conversions.colorToHex8({ h, s, v, a })}`}
148
+ aria-label={`${colorToHex8({ h, s, v, a })}`}
145
149
  aria-live="polite"
146
150
  >
147
151
  <ColorPalette
@@ -171,7 +175,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
171
175
  value={h}
172
176
  minValue={0}
173
177
  maxValue={359}
174
- color={conversions.colorToHex8({ h, s, v, a })}
178
+ color={colorToHex8({ h, s, v, a })}
175
179
  onChange={(hue: number) => {
176
180
  this.setState({ h: hue })
177
181
  }}
@@ -185,7 +189,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
185
189
  width={this._width}
186
190
  height={this._sliderHeight}
187
191
  indicatorRadius={this._sliderIndicatorRadius}
188
- color={conversions.colorToHex8({ h, s, v })}
192
+ color={colorToHex8({ h, s, v })}
189
193
  value={a}
190
194
  minValue={0}
191
195
  maxValue={1}
@@ -200,10 +204,8 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
200
204
  disabled={disabled}
201
205
  label={withAlpha ? 'RGBA' : 'RGB'}
202
206
  width={this._width}
203
- value={conversions.colorToRGB({ h, s, v, a })}
204
- onChange={(color) =>
205
- this.setState({ ...conversions.colorToHsva(color) })
206
- }
207
+ value={colorToRGB({ h, s, v, a })}
208
+ onChange={(color) => this.setState({ ...colorToHsva(color) })}
207
209
  withAlpha={withAlpha}
208
210
  rgbRedInputScreenReaderLabel={rgbRedInputScreenReaderLabel}
209
211
  rgbGreenInputScreenReaderLabel={rgbGreenInputScreenReaderLabel}
@@ -26,8 +26,12 @@ import { Component } from 'react'
26
26
 
27
27
  import { withStyleNew } from '@instructure/emotion'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
- import { isValid } from '@instructure/ui-color-utils'
30
- import conversions from '@instructure/ui-color-utils'
29
+ import {
30
+ isValid,
31
+ colorToHsva,
32
+ colorToHex8,
33
+ colorToRGB
34
+ } from '@instructure/ui-color-utils'
31
35
  import { logWarn as warn } from '@instructure/console'
32
36
  import type { HSVType } from '@instructure/ui-color-utils'
33
37
  import ColorPalette from './ColorPalette/index.js'
@@ -90,7 +94,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
90
94
  `[ColorMixer] The passed color value is not valid.`
91
95
  )
92
96
  this.setState({
93
- ...conversions.colorToHsva(this.props.value!)
97
+ ...colorToHsva(this.props.value!)
94
98
  })
95
99
  }
96
100
 
@@ -103,14 +107,14 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
103
107
  prevState.v !== v ||
104
108
  prevState.a !== a
105
109
  ) {
106
- this.props.onChange(conversions.colorToHex8({ h, s, v, a }))
110
+ this.props.onChange(colorToHex8({ h, s, v, a }))
107
111
  }
108
112
  if (
109
113
  prevProps.value !== this.props.value &&
110
- conversions.colorToHex8({ h, s, v, a }) !== this.props.value
114
+ colorToHex8({ h, s, v, a }) !== this.props.value
111
115
  ) {
112
116
  this.setState({
113
- ...conversions.colorToHsva(this.props.value!)
117
+ ...colorToHsva(this.props.value!)
114
118
  })
115
119
  }
116
120
  }
@@ -141,7 +145,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
141
145
  >
142
146
  <span
143
147
  css={styles?.sliderAndPaletteContainer}
144
- aria-label={`${conversions.colorToHex8({ h, s, v, a })}`}
148
+ aria-label={`${colorToHex8({ h, s, v, a })}`}
145
149
  aria-live="polite"
146
150
  >
147
151
  <ColorPalette
@@ -171,7 +175,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
171
175
  value={h}
172
176
  minValue={0}
173
177
  maxValue={359}
174
- color={conversions.colorToHex8({ h, s, v, a })}
178
+ color={colorToHex8({ h, s, v, a })}
175
179
  onChange={(hue: number) => {
176
180
  this.setState({ h: hue })
177
181
  }}
@@ -185,7 +189,7 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
185
189
  width={this._width}
186
190
  height={this._sliderHeight}
187
191
  indicatorRadius={this._sliderIndicatorRadius}
188
- color={conversions.colorToHex8({ h, s, v })}
192
+ color={colorToHex8({ h, s, v })}
189
193
  value={a}
190
194
  minValue={0}
191
195
  maxValue={1}
@@ -200,10 +204,8 @@ class ColorMixer extends Component<ColorMixerProps, ColorMixerState> {
200
204
  disabled={disabled}
201
205
  label={withAlpha ? 'RGBA' : 'RGB'}
202
206
  width={this._width}
203
- value={conversions.colorToRGB({ h, s, v, a })}
204
- onChange={(color) =>
205
- this.setState({ ...conversions.colorToHsva(color) })
206
- }
207
+ value={colorToRGB({ h, s, v, a })}
208
+ onChange={(color) => this.setState({ ...colorToHsva(color) })}
207
209
  withAlpha={withAlpha}
208
210
  rgbRedInputScreenReaderLabel={rgbRedInputScreenReaderLabel}
209
211
  rgbGreenInputScreenReaderLabel={rgbGreenInputScreenReaderLabel}
@@ -27,8 +27,11 @@ import { Component } from 'react'
27
27
  import { withStyle, InstUISettingsProvider } from '@instructure/emotion'
28
28
  import { warn, error } from '@instructure/console'
29
29
  import { omitProps } from '@instructure/ui-react-utils'
30
- import { isValid, contrast as getContrast } from '@instructure/ui-color-utils'
31
- import conversions from '@instructure/ui-color-utils'
30
+ import {
31
+ isValid,
32
+ contrast as getContrast,
33
+ colorToHex8
34
+ } from '@instructure/ui-color-utils'
32
35
  import { TextInput } from '@instructure/ui-text-input/v11_6'
33
36
  import { Tooltip } from '@instructure/ui-tooltip/v11_6'
34
37
  import { Button, IconButton } from '@instructure/ui-buttons/v11_6'
@@ -542,7 +545,7 @@ class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
542
545
  `#${this.mixedColorWithStrippedAlpha}`,
543
546
  (newColor: string) => {
544
547
  this.setState({
545
- mixedColor: conversions.colorToHex8(newColor).slice(1)
548
+ mixedColor: colorToHex8(newColor).slice(1)
546
549
  })
547
550
  },
548
551
  () => {
@@ -572,7 +575,7 @@ class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
572
575
  value={`#${this.state.mixedColor}`}
573
576
  onChange={(newColor: string) =>
574
577
  this.setState({
575
- mixedColor: conversions.colorToHex8(newColor).slice(1)
578
+ mixedColor: colorToHex8(newColor).slice(1)
576
579
  })
577
580
  }
578
581
  withAlpha={this.props.colorMixerSettings.colorMixer.withAlpha}
@@ -27,8 +27,11 @@ import { Component } from 'react'
27
27
  import { withStyleNew, InstUISettingsProvider } from '@instructure/emotion'
28
28
  import { warn, error } from '@instructure/console'
29
29
  import { omitProps } from '@instructure/ui-react-utils'
30
- import { isValid, contrast as getContrast } from '@instructure/ui-color-utils'
31
- import conversions from '@instructure/ui-color-utils'
30
+ import {
31
+ isValid,
32
+ contrast as getContrast,
33
+ colorToHex8
34
+ } from '@instructure/ui-color-utils'
32
35
  import { TextInput } from '@instructure/ui-text-input/latest'
33
36
  import { Tooltip } from '@instructure/ui-tooltip/latest'
34
37
  import { Button, IconButton } from '@instructure/ui-buttons/latest'
@@ -546,7 +549,7 @@ class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
546
549
  `#${this.mixedColorWithStrippedAlpha}`,
547
550
  (newColor: string) => {
548
551
  this.setState({
549
- mixedColor: conversions.colorToHex8(newColor).slice(1)
552
+ mixedColor: colorToHex8(newColor).slice(1)
550
553
  })
551
554
  },
552
555
  () => {
@@ -576,7 +579,7 @@ class ColorPicker extends Component<ColorPickerProps, ColorPickerState> {
576
579
  value={`#${this.state.mixedColor}`}
577
580
  onChange={(newColor: string) =>
578
581
  this.setState({
579
- mixedColor: conversions.colorToHex8(newColor).slice(1)
582
+ mixedColor: colorToHex8(newColor).slice(1)
580
583
  })
581
584
  }
582
585
  withAlpha={this.props.colorMixerSettings.colorMixer.withAlpha}
@@ -26,7 +26,7 @@ import { Component } from 'react'
26
26
 
27
27
  import { withStyle } from '@instructure/emotion'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
- import conversions from '@instructure/ui-color-utils'
29
+ import { colorToHex8, colorToRGB } from '@instructure/ui-color-utils'
30
30
 
31
31
  import { IconButton, Button } from '@instructure/ui-buttons/v11_6'
32
32
  import { View } from '@instructure/ui-view/v11_6'
@@ -98,10 +98,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
98
98
 
99
99
  isSelectedColor(color: string) {
100
100
  const { selected } = this.props
101
- return (
102
- !!selected &&
103
- conversions.colorToHex8(selected) === conversions.colorToHex8(color)
104
- )
101
+ return !!selected && colorToHex8(selected) === colorToHex8(color)
105
102
  }
106
103
 
107
104
  onMenuItemSelected =
@@ -149,9 +146,9 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
149
146
  >
150
147
  <div css={this.props.styles?.popoverContent}>
151
148
  <ColorMixer
152
- value={conversions.colorToHex8(this.state.newColor)}
149
+ value={colorToHex8(this.state.newColor)}
153
150
  onChange={(newColor: string) =>
154
- this.setState({ newColor: conversions.colorToRGB(newColor) })
151
+ this.setState({ newColor: colorToRGB(newColor) })
155
152
  }
156
153
  withAlpha={this.props?.colorMixerSettings?.colorMixer?.withAlpha}
157
154
  rgbRedInputScreenReaderLabel={
@@ -189,7 +186,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
189
186
  firstColor={
190
187
  this.props.colorMixerSettings.colorContrast.firstColor
191
188
  }
192
- secondColor={conversions.colorToHex8(this.state.newColor)}
189
+ secondColor={colorToHex8(this.state.newColor)}
193
190
  label={this.props.colorMixerSettings.colorContrast.label}
194
191
  successLabel={
195
192
  this.props.colorMixerSettings.colorContrast.successLabel
@@ -220,7 +217,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
220
217
  <Button
221
218
  onClick={() => {
222
219
  this.props?.colorMixerSettings?.onPresetChange([
223
- conversions.colorToHex8(this.state.newColor),
220
+ colorToHex8(this.state.newColor),
224
221
  ...this.props.colors
225
222
  ])
226
223
  this.setState({ openAddNew: false })
@@ -26,7 +26,7 @@ import { Component } from 'react'
26
26
 
27
27
  import { withStyleNew } from '@instructure/emotion'
28
28
  import { omitProps } from '@instructure/ui-react-utils'
29
- import conversions from '@instructure/ui-color-utils'
29
+ import { colorToHex8, colorToRGB } from '@instructure/ui-color-utils'
30
30
 
31
31
  import { IconButton, Button } from '@instructure/ui-buttons/latest'
32
32
  import { View } from '@instructure/ui-view/latest'
@@ -97,10 +97,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
97
97
 
98
98
  isSelectedColor(color: string) {
99
99
  const { selected } = this.props
100
- return (
101
- !!selected &&
102
- conversions.colorToHex8(selected) === conversions.colorToHex8(color)
103
- )
100
+ return !!selected && colorToHex8(selected) === colorToHex8(color)
104
101
  }
105
102
 
106
103
  onMenuItemSelected =
@@ -148,9 +145,9 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
148
145
  >
149
146
  <div css={this.props.styles?.popoverContent}>
150
147
  <ColorMixer
151
- value={conversions.colorToHex8(this.state.newColor)}
148
+ value={colorToHex8(this.state.newColor)}
152
149
  onChange={(newColor: string) =>
153
- this.setState({ newColor: conversions.colorToRGB(newColor) })
150
+ this.setState({ newColor: colorToRGB(newColor) })
154
151
  }
155
152
  withAlpha={this.props?.colorMixerSettings?.colorMixer?.withAlpha}
156
153
  rgbRedInputScreenReaderLabel={
@@ -188,7 +185,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
188
185
  firstColor={
189
186
  this.props.colorMixerSettings.colorContrast.firstColor
190
187
  }
191
- secondColor={conversions.colorToHex8(this.state.newColor)}
188
+ secondColor={colorToHex8(this.state.newColor)}
192
189
  label={this.props.colorMixerSettings.colorContrast.label}
193
190
  successLabel={
194
191
  this.props.colorMixerSettings.colorContrast.successLabel
@@ -219,7 +216,7 @@ class ColorPreset extends Component<ColorPresetProps, ColorPresetState> {
219
216
  <Button
220
217
  onClick={() => {
221
218
  this.props?.colorMixerSettings?.onPresetChange([
222
- conversions.colorToHex8(this.state.newColor),
219
+ colorToHex8(this.state.newColor),
223
220
  ...this.props.colors
224
221
  ])
225
222
  this.setState({ openAddNew: false })