@instructure/ui-range-input 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-range-input
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-range-input
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['min', 'max', 'defaultValue', 'value', 'onChange', 'messages', 'size', 'layout', 'id', 'label', 'displayValue', 'step', 'formatValue', 'inline', 'disabled', 'readOnly', 'thumbVariant', 'inputRef'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-range-input",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "A styled HTML range input",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,25 +15,25 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/console": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/shared-types": "11.6.0",
21
- "@instructure/ui-dom-utils": "11.6.0",
22
- "@instructure/ui-color-utils": "11.6.0",
23
- "@instructure/ui-form-field": "11.6.0",
24
- "@instructure/ui-i18n": "11.6.0",
25
- "@instructure/ui-react-utils": "11.6.0",
26
- "@instructure/ui-utils": "11.6.0",
27
- "@instructure/uid": "11.6.0",
28
- "@instructure/ui-view": "11.6.0"
18
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/emotion": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/ui-dom-utils": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/ui-color-utils": "11.6.1-pr-snapshot-1779894247159",
22
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
23
+ "@instructure/ui-form-field": "11.6.1-pr-snapshot-1779894247159",
24
+ "@instructure/ui-i18n": "11.6.1-pr-snapshot-1779894247159",
25
+ "@instructure/ui-utils": "11.6.1-pr-snapshot-1779894247159",
26
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
27
+ "@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159",
28
+ "@instructure/uid": "11.6.1-pr-snapshot-1779894247159"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@testing-library/jest-dom": "^6.6.3",
32
32
  "@testing-library/react": "15.0.7",
33
33
  "vitest": "^3.2.2",
34
- "@instructure/ui-axe-check": "11.6.0",
35
- "@instructure/ui-babel-preset": "11.6.0",
36
- "@instructure/ui-themes": "11.6.0"
34
+ "@instructure/ui-axe-check": "11.6.1-pr-snapshot-1779894247159",
35
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
36
+ "@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18 <=19"
@@ -46,10 +46,8 @@
46
46
  ".": {
47
47
  "types": "./types/index.d.ts",
48
48
  "import": "./es/index.js",
49
- "require": "./lib/index.js",
50
49
  "default": "./es/index.js"
51
50
  },
52
- "./lib/*": "./lib/*",
53
51
  "./es/*": "./es/*",
54
52
  "./types/*": "./types/*",
55
53
  "./package.json": "./package.json",
@@ -59,7 +57,7 @@
59
57
  "lint": "ui-scripts lint",
60
58
  "lint:fix": "ui-scripts lint --fix",
61
59
  "clean": "ui-scripts clean",
62
- "build": "ui-scripts build --modules es,cjs",
60
+ "build": "ui-scripts build",
63
61
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
64
62
  "build:types": "tsc -p tsconfig.build.json",
65
63
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,191 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.RangeInput = void 0;
8
- var _react = require("react");
9
- var _console = require("@instructure/console");
10
- var _ContextView = require("@instructure/ui-view/lib/ContextView");
11
- var _FormField = require("@instructure/ui-form-field/lib/FormField");
12
- var _addEventListener = require("@instructure/ui-dom-utils/lib/addEventListener.js");
13
- var _emotion = require("@instructure/emotion");
14
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
15
- var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
16
- var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
17
- var _styles = _interopRequireDefault(require("./styles"));
18
- var _theme = _interopRequireDefault(require("./theme"));
19
- var _props = require("./props");
20
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
21
- var _dec, _dec2, _class, _RangeInput;
22
- /*
23
- * The MIT License (MIT)
24
- *
25
- * Copyright (c) 2015 - present Instructure, Inc.
26
- *
27
- * Permission is hereby granted, free of charge, to any person obtaining a copy
28
- * of this software and associated documentation files (the "Software"), to deal
29
- * in the Software without restriction, including without limitation the rights
30
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
31
- * copies of the Software, and to permit persons to whom the Software is
32
- * furnished to do so, subject to the following conditions:
33
- *
34
- * The above copyright notice and this permission notice shall be included in all
35
- * copies or substantial portions of the Software.
36
- *
37
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
- * SOFTWARE.
44
- */
45
- /**
46
- ---
47
- category: components
48
- ---
49
- **/
50
- let RangeInput = exports.RangeInput = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_RangeInput = class RangeInput extends _react.Component {
51
- constructor(props) {
52
- super(props);
53
- this.ref = null;
54
- this._input = null;
55
- this._inputListener = null;
56
- this._changeListener = null;
57
- this.defaultId = void 0;
58
- this.handleRef = el => {
59
- this.ref = el;
60
- };
61
- this.handleInputRef = el => {
62
- this._input = el;
63
- if (typeof this.props.inputRef === 'function') {
64
- this.props.inputRef(el);
65
- }
66
- };
67
- this.handleChange = event => {
68
- const _this$props = this.props,
69
- onChange = _this$props.onChange,
70
- value = _this$props.value;
71
- if (typeof value === 'undefined') {
72
- this.setState({
73
- value: event.target.value
74
- });
75
- }
76
- if (typeof onChange === 'function') {
77
- onChange(event.target.value);
78
- }
79
- };
80
- // controlled input must have an onChange, but we're handling it with native events
81
- this.noopChange = () => {};
82
- if (typeof props.value === 'undefined') {
83
- this.state = {
84
- value: props.defaultValue
85
- };
86
- }
87
- this.defaultId = props.deterministicId();
88
- }
89
-
90
- /* workaround for https://github.com/facebook/react/issues/554 */
91
- componentDidMount() {
92
- var _this$props$makeStyle, _this$props2;
93
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
94
- if (this._input !== null) {
95
- // https://connect.microsoft.com/IE/Feedback/Details/856998
96
- this._inputListener = (0, _addEventListener.addEventListener)(this._input, 'input', this.handleChange);
97
- this._changeListener = (0, _addEventListener.addEventListener)(this._input, 'change', this.handleChange);
98
- }
99
- }
100
- componentWillUnmount() {
101
- var _this$_inputListener, _this$_changeListener;
102
- if (!this._input) {
103
- return;
104
- }
105
- (_this$_inputListener = this._inputListener) === null || _this$_inputListener === void 0 ? void 0 : _this$_inputListener.remove();
106
- (_this$_changeListener = this._changeListener) === null || _this$_changeListener === void 0 ? void 0 : _this$_changeListener.remove();
107
- }
108
- /* end workaround */
109
-
110
- componentDidUpdate() {
111
- var _this$props$makeStyle2, _this$props3;
112
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
113
- }
114
- get value() {
115
- const value = typeof this.props.value === 'undefined' ? this.state.value : this.props.value;
116
- return typeof value === 'string' ? parseInt(value) : value;
117
- }
118
- get id() {
119
- return this.props.id || this.defaultId;
120
- }
121
- renderValue() {
122
- if (this.props.displayValue) {
123
- var _this$props$styles;
124
- if (!this.value) {
125
- (0, _console.warn)(false, 'RangeInput should have a `value` or `defaultValue` set for the value to be displayed. If no value has to be displayed, set `displayValue={false}`.');
126
- return null;
127
- }
128
- const props = {
129
- [RangeInput.outputLocatorAttribute]: this.id
130
- };
131
- return (0, _jsxRuntime.jsx)(_ContextView.ContextView, {
132
- background: "inverse",
133
- placement: "end center",
134
- children: (0, _jsxRuntime.jsx)("div", {
135
- ...props,
136
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.rangeInputInputValue,
137
- children: this.props.formatValue(this.value, this.props.max)
138
- })
139
- });
140
- }
141
- return null;
142
- }
143
- render() {
144
- var _this$props$styles2, _this$props$styles3;
145
- const _this$props4 = this.props,
146
- formatValue = _this$props4.formatValue,
147
- disabled = _this$props4.disabled,
148
- readOnly = _this$props4.readOnly;
149
- const props = (0, _omitProps.omitProps)(this.props, RangeInput.allowedProps);
150
- return (0, _jsxRuntime.jsx)(_FormField.FormField, {
151
- ...(0, _pickProps.pickProps)(this.props, _FormField.FormField.allowedProps),
152
- label: this.props.label,
153
- id: this.id,
154
- elementRef: this.handleRef,
155
- "data-cid": "RangeInput",
156
- children: (0, _jsxRuntime.jsxs)("div", {
157
- css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.rangeInput,
158
- children: [(0, _jsxRuntime.jsx)("input", {
159
- css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.rangeInputInput,
160
- ref: this.handleInputRef,
161
- type: "range",
162
- id: this.id,
163
- min: this.props.min,
164
- max: this.props.max,
165
- step: this.props.step,
166
- value: this.value,
167
- onChange: this.noopChange,
168
- "aria-valuetext": formatValue(this.value, this.props.max),
169
- ...props,
170
- disabled: disabled || readOnly,
171
- "aria-disabled": disabled || readOnly ? 'true' : void 0
172
- }), this.renderValue()]
173
- })
174
- });
175
- }
176
- }, _RangeInput.displayName = "RangeInput", _RangeInput.componentId = 'RangeInput', _RangeInput.outputLocatorAttribute = 'data-range-output', _RangeInput.allowedProps = _props.allowedProps, _RangeInput.defaultProps = {
177
- step: 1,
178
- formatValue: val => val,
179
- // If min and max has default value, they don't give a warning if not set, even if they are required props.
180
- // TODO: figure out if they don't need to be required or remove defaults in V9.
181
- max: 0,
182
- min: 0,
183
- inline: false,
184
- size: 'medium',
185
- layout: 'stacked',
186
- displayValue: true,
187
- disabled: false,
188
- readOnly: false,
189
- thumbVariant: 'deprecated'
190
- }, _RangeInput)) || _class) || _class);
191
- var _default = exports.default = RangeInput;
@@ -1,167 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props) => {
42
- const size = props.size,
43
- thumbVariant = props.thumbVariant;
44
- const valueSizeVariants = {
45
- small: {
46
- fontSize: componentTheme.valueSmallFontSize,
47
- padding: componentTheme.valueSmallPadding,
48
- lineHeight: componentTheme.valueSmallLineHeight
49
- },
50
- medium: {
51
- fontSize: componentTheme.valueMediumFontSize,
52
- padding: componentTheme.valueMediumPadding,
53
- lineHeight: componentTheme.valueMediumLineHeight
54
- },
55
- large: {
56
- fontSize: componentTheme.valueLargeFontSize,
57
- padding: componentTheme.valueLargePadding,
58
- lineHeight: componentTheme.valueLargeLineHeight
59
- }
60
- };
61
- const trackStyle = {
62
- borderRadius: '0.312em',
63
- borderColor: 'transparent',
64
- color: 'transparent',
65
- cursor: 'pointer',
66
- background: componentTheme.trackBackground,
67
- height: `calc(${componentTheme.handleSize} / 2)`
68
- };
69
- const borderedHandleSize = `calc(${componentTheme.handleSize} + (${componentTheme.handleBorderSize} * 2))`;
70
- const thumbVariantStyle = {
71
- deprecated: {
72
- width: componentTheme.handleSize,
73
- height: componentTheme.handleSize,
74
- boxShadow: `0 0.0625rem 0 ${componentTheme.handleShadowColor}`
75
- },
76
- accessible: {
77
- width: borderedHandleSize,
78
- height: borderedHandleSize,
79
- borderWidth: componentTheme.handleBorderSize,
80
- borderColor: componentTheme.handleBorderColor,
81
- borderStyle: 'solid',
82
- boxSizing: 'border-box',
83
- boxShadow: componentTheme.handleShadow
84
- }
85
- };
86
- const thumbStyle = {
87
- appearance: 'none',
88
- borderRadius: '50%',
89
- cursor: 'pointer',
90
- transition: 'all 0.15s ease-in-out',
91
- background: componentTheme.handleBackground,
92
- ...thumbVariantStyle[thumbVariant],
93
- '&:hover': {
94
- background: componentTheme.handleHoverBackground
95
- }
96
- };
97
- const thumbPosition = {
98
- deprecated: {
99
- marginTop: `calc(-1 * ${componentTheme.handleSize} / 4)`
100
- },
101
- accessible: {
102
- marginTop: `calc(-1 * ${borderedHandleSize} / 4)`
103
- }
104
- };
105
- const thumbFocusActiveStyle = {
106
- deprecated: {
107
- background: componentTheme.handleFocusBackground,
108
- boxShadow: `0 0.0625rem 0 ${componentTheme.handleShadowColor}, 0 0 0 ${componentTheme.handleFocusOutlineWidth} ${componentTheme.handleFocusOutlineColor}`
109
- },
110
- accessible: {
111
- background: componentTheme.handleFocusBackground,
112
- boxShadow: componentTheme.handleShadow + ', ' + `inset 0 0 0 ${componentTheme.handleFocusInset} ${componentTheme.handleFocusBackground}, ` + `inset 0 0 0 calc(${componentTheme.handleFocusInset} + ${componentTheme.handleFocusRingSize}) ${componentTheme.handleFocusRingColor}`
113
- }
114
- };
115
- return {
116
- rangeInput: {
117
- label: 'rangeInput',
118
- display: 'flex',
119
- justifyContent: 'center',
120
- alignItems: 'center',
121
- minWidth: componentTheme.minWidth
122
- },
123
- rangeInputInput: {
124
- label: 'rangeInput__input',
125
- all: 'initial',
126
- flex: 'auto',
127
- boxSizing: 'border-box',
128
- appearance: 'none',
129
- width: '100%',
130
- // for Firefox
131
- outline: 'none',
132
- margin: 0,
133
- '&::-webkit-slider-thumb': {
134
- ...thumbStyle,
135
- ...thumbPosition[thumbVariant]
136
- },
137
- '&::-moz-range-thumb': thumbStyle,
138
- '&:focus, &:active': {
139
- outline: 'none',
140
- '&::-webkit-slider-thumb': thumbFocusActiveStyle[thumbVariant],
141
- '&::-moz-range-thumb': thumbFocusActiveStyle[thumbVariant]
142
- },
143
- // remove outline in FF
144
- '&::-moz-focus-inner, &::-moz-focus-outer': {
145
- border: 0,
146
- outline: 'none'
147
- },
148
- '&::-webkit-slider-runnable-track': trackStyle,
149
- '&::-moz-range-track': trackStyle,
150
- '[dir="rtl"] &': {
151
- direction: 'rtl'
152
- }
153
- },
154
- rangeInputInputValue: {
155
- label: 'rangeInput__value',
156
- all: 'initial',
157
- boxSizing: 'border-box',
158
- display: 'block',
159
- color: 'inherit',
160
- fontFamily: componentTheme.valueFontFamily,
161
- fontWeight: componentTheme.valueFontWeight,
162
- textAlign: 'center',
163
- ...valueSizeVariants[size]
164
- }
165
- };
166
- };
167
- var _default = exports.default = generateStyle;
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _alpha = require("@instructure/ui-color-utils/lib/alpha.js");
8
- var _darken = require("@instructure/ui-color-utils/lib/darken.js");
9
- /*
10
- * The MIT License (MIT)
11
- *
12
- * Copyright (c) 2015 - present Instructure, Inc.
13
- *
14
- * Permission is hereby granted, free of charge, to any person obtaining a copy
15
- * of this software and associated documentation files (the "Software"), to deal
16
- * in the Software without restriction, including without limitation the rights
17
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
- * copies of the Software, and to permit persons to whom the Software is
19
- * furnished to do so, subject to the following conditions:
20
- *
21
- * The above copyright notice and this permission notice shall be included in all
22
- * copies or substantial portions of the Software.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
31
- */
32
-
33
- /**
34
- * Generates the theme object for the component from the theme and provided additional information
35
- * @param {Object} theme The actual theme object.
36
- * @return {Object} The final theme object with the overrides and component variables
37
- */
38
- const generateComponentTheme = theme => {
39
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6, _colors$contrasts7, _colors$contrasts8, _colors$contrasts9;
40
- const colors = theme.colors,
41
- borders = theme.borders,
42
- typography = theme.typography,
43
- spacing = theme.spacing,
44
- forms = theme.forms,
45
- themeName = theme.key;
46
- const themeSpecificStyle = {
47
- canvas: {
48
- handleBackground: theme['ic-brand-primary'],
49
- handleHoverBackground: theme['ic-brand-primary'],
50
- handleFocusBackground: theme['ic-brand-primary'],
51
- // Deprecated, remove with "deprecated" thumbVariant
52
- handleShadowColor: (0, _darken.darken)(theme['ic-brand-primary'], 15),
53
- handleFocusOutlineColor: (0, _alpha.alpha)(theme['ic-brand-primary'], 40)
54
- }
55
- };
56
- const componentVariables = {
57
- minWidth: '12.5rem',
58
- handleSize: '1.5rem',
59
- handleBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.blue4570,
60
- handleBorderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
61
- handleBorderSize: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
62
- handleShadow: '0 0.0625rem 0.125rem rgba(0, 0, 0, .2), 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1)',
63
- handleFocusInset: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
64
- handleFocusRingSize: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
65
- handleFocusRingColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.white1010,
66
- handleFocusBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
67
- handleHoverBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.blue4570,
68
- // Deprecated, remove with "deprecated" thumbVariant
69
- handleShadowColor: (0, _darken.darken)(colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.blue5782, 10),
70
- handleFocusOutlineColor: (0, _alpha.alpha)(colors === null || colors === void 0 ? void 0 : (_colors$contrasts7 = colors.contrasts) === null || _colors$contrasts7 === void 0 ? void 0 : _colors$contrasts7.blue4570, 40),
71
- handleFocusOutlineWidth: '0.75em',
72
- trackBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts8 = colors.contrasts) === null || _colors$contrasts8 === void 0 ? void 0 : _colors$contrasts8.grey4570,
73
- valueColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts9 = colors.contrasts) === null || _colors$contrasts9 === void 0 ? void 0 : _colors$contrasts9.white1010,
74
- valueFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
75
- valueFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
76
- valueSmallFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
77
- valueSmallPadding: `0 ${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall}`,
78
- valueSmallLineHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightSmall,
79
- valueMediumFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
80
- valueMediumPadding: `0 ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
81
- valueMediumLineHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightMedium,
82
- valueLargeFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
83
- valueLargePadding: `0 ${spacing === null || spacing === void 0 ? void 0 : spacing.medium}`,
84
- valueLargeLineHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightLarge
85
- };
86
- return {
87
- ...componentVariables,
88
- ...themeSpecificStyle[themeName]
89
- };
90
- };
91
- var _default = exports.default = generateComponentTheme;
package/lib/index.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "RangeInput", {
7
- enumerable: true,
8
- get: function () {
9
- return _RangeInput.RangeInput;
10
- }
11
- });
12
- var _RangeInput = require("./RangeInput");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}