@atlaskit/button 16.1.2

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 (113) hide show
  1. package/CHANGELOG.md +1485 -0
  2. package/LICENSE +13 -0
  3. package/README.md +13 -0
  4. package/__perf__/button.tsx +19 -0
  5. package/__perf__/custom.tsx +19 -0
  6. package/__perf__/customised.tsx +11 -0
  7. package/__perf__/default.tsx +5 -0
  8. package/__perf__/loading.tsx +5 -0
  9. package/__perf__/utils/example-runner.tsx +48 -0
  10. package/__perf__/utils/interaction-tasks.tsx +98 -0
  11. package/button-group/package.json +7 -0
  12. package/codemods/15.0.0-lite-mode.ts +49 -0
  13. package/codemods/15.1.1-data-testid.ts +173 -0
  14. package/codemods/__tests__/15.0.0-lite-mode/optimistic.ts +646 -0
  15. package/codemods/__tests__/15.0.0-lite-mode/safe.ts +223 -0
  16. package/codemods/__tests__/15.0.0-lite-mode/shared.ts +257 -0
  17. package/codemods/__tests__/15.1.1-data-testid/rename-data-testid.ts +186 -0
  18. package/codemods/__tests__/_framework.ts +47 -0
  19. package/codemods/helpers/15.0.0-runner.ts +169 -0
  20. package/codemods/helpers/helpers-generic.ts +662 -0
  21. package/codemods/optimistic-15.0.0-lite-mode.ts +279 -0
  22. package/codemods/readme.md +1 -0
  23. package/custom-theme-button/package.json +7 -0
  24. package/dist/cjs/button-group.js +50 -0
  25. package/dist/cjs/button.js +104 -0
  26. package/dist/cjs/custom-theme-button/custom-theme-button-types.js +5 -0
  27. package/dist/cjs/custom-theme-button/custom-theme-button.js +229 -0
  28. package/dist/cjs/custom-theme-button/index.js +23 -0
  29. package/dist/cjs/custom-theme-button/theme.js +108 -0
  30. package/dist/cjs/entry-points/button-group.js +15 -0
  31. package/dist/cjs/entry-points/custom-theme-button.js +25 -0
  32. package/dist/cjs/entry-points/loading-button.js +15 -0
  33. package/dist/cjs/entry-points/standard-button.js +15 -0
  34. package/dist/cjs/entry-points/types.js +5 -0
  35. package/dist/cjs/index.js +51 -0
  36. package/dist/cjs/loading-button.js +34 -0
  37. package/dist/cjs/shared/block-events.js +44 -0
  38. package/dist/cjs/shared/button-base.js +158 -0
  39. package/dist/cjs/shared/colors.js +409 -0
  40. package/dist/cjs/shared/css.js +265 -0
  41. package/dist/cjs/shared/get-is-only-single-icon.js +26 -0
  42. package/dist/cjs/shared/loading-spinner.js +45 -0
  43. package/dist/cjs/types.js +5 -0
  44. package/dist/cjs/version.json +5 -0
  45. package/dist/es2019/button-group.js +36 -0
  46. package/dist/es2019/button.js +69 -0
  47. package/dist/es2019/custom-theme-button/custom-theme-button-types.js +1 -0
  48. package/dist/es2019/custom-theme-button/custom-theme-button.js +164 -0
  49. package/dist/es2019/custom-theme-button/index.js +2 -0
  50. package/dist/es2019/custom-theme-button/theme.js +81 -0
  51. package/dist/es2019/entry-points/button-group.js +1 -0
  52. package/dist/es2019/entry-points/custom-theme-button.js +1 -0
  53. package/dist/es2019/entry-points/loading-button.js +1 -0
  54. package/dist/es2019/entry-points/standard-button.js +1 -0
  55. package/dist/es2019/entry-points/types.js +1 -0
  56. package/dist/es2019/index.js +6 -0
  57. package/dist/es2019/loading-button.js +17 -0
  58. package/dist/es2019/shared/block-events.js +37 -0
  59. package/dist/es2019/shared/button-base.js +127 -0
  60. package/dist/es2019/shared/colors.js +393 -0
  61. package/dist/es2019/shared/css.js +249 -0
  62. package/dist/es2019/shared/get-is-only-single-icon.js +19 -0
  63. package/dist/es2019/shared/loading-spinner.js +33 -0
  64. package/dist/es2019/types.js +1 -0
  65. package/dist/es2019/version.json +5 -0
  66. package/dist/esm/button-group.js +35 -0
  67. package/dist/esm/button.js +79 -0
  68. package/dist/esm/custom-theme-button/custom-theme-button-types.js +1 -0
  69. package/dist/esm/custom-theme-button/custom-theme-button.js +203 -0
  70. package/dist/esm/custom-theme-button/index.js +2 -0
  71. package/dist/esm/custom-theme-button/theme.js +90 -0
  72. package/dist/esm/entry-points/button-group.js +1 -0
  73. package/dist/esm/entry-points/custom-theme-button.js +1 -0
  74. package/dist/esm/entry-points/loading-button.js +1 -0
  75. package/dist/esm/entry-points/standard-button.js +1 -0
  76. package/dist/esm/entry-points/types.js +1 -0
  77. package/dist/esm/index.js +6 -0
  78. package/dist/esm/loading-button.js +19 -0
  79. package/dist/esm/shared/block-events.js +36 -0
  80. package/dist/esm/shared/button-base.js +135 -0
  81. package/dist/esm/shared/colors.js +393 -0
  82. package/dist/esm/shared/css.js +245 -0
  83. package/dist/esm/shared/get-is-only-single-icon.js +19 -0
  84. package/dist/esm/shared/loading-spinner.js +35 -0
  85. package/dist/esm/types.js +1 -0
  86. package/dist/esm/version.json +5 -0
  87. package/dist/types/button-group.d.ts +18 -0
  88. package/dist/types/button.d.ts +8 -0
  89. package/dist/types/custom-theme-button/custom-theme-button-types.d.ts +21 -0
  90. package/dist/types/custom-theme-button/custom-theme-button.d.ts +6 -0
  91. package/dist/types/custom-theme-button/index.d.ts +2 -0
  92. package/dist/types/custom-theme-button/theme.d.ts +21 -0
  93. package/dist/types/entry-points/button-group.d.ts +1 -0
  94. package/dist/types/entry-points/custom-theme-button.d.ts +2 -0
  95. package/dist/types/entry-points/loading-button.d.ts +2 -0
  96. package/dist/types/entry-points/standard-button.d.ts +2 -0
  97. package/dist/types/entry-points/types.d.ts +4 -0
  98. package/dist/types/index.d.ts +8 -0
  99. package/dist/types/loading-button.d.ts +11 -0
  100. package/dist/types/shared/block-events.d.ts +3 -0
  101. package/dist/types/shared/button-base.d.ts +10 -0
  102. package/dist/types/shared/colors.d.ts +31 -0
  103. package/dist/types/shared/css.d.ts +22 -0
  104. package/dist/types/shared/get-is-only-single-icon.d.ts +2 -0
  105. package/dist/types/shared/loading-spinner.d.ts +4 -0
  106. package/dist/types/types.d.ts +51 -0
  107. package/extract-react-types/custom-theme-button-props.tsx +7 -0
  108. package/extract-react-types/loading-button-props.tsx +5 -0
  109. package/extract-react-types/shared-props.tsx +5 -0
  110. package/loading-button/package.json +7 -0
  111. package/package.json +83 -0
  112. package/standard-button/package.json +7 -0
  113. package/types/package.json +7 -0
@@ -0,0 +1 @@
1
+ export { default } from '../button-group';
@@ -0,0 +1 @@
1
+ export { default, Theme } from '../custom-theme-button';
@@ -0,0 +1 @@
1
+ export { default } from '../loading-button';
@@ -0,0 +1 @@
1
+ export { default } from '../button';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ // Ideally this file is not used directly. But rather, you go through the entry points
2
+ export { // default export is Button
3
+ default } from './entry-points/standard-button';
4
+ export { default as LoadingButton } from './entry-points/loading-button';
5
+ export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
6
+ export { default as ButtonGroup } from './entry-points/button-group';
@@ -0,0 +1,19 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import React from 'react';
4
+ import Button from './button';
5
+ import LoadingSpinner from './shared/loading-spinner';
6
+ var LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(_ref, ref) {
7
+ var _ref$isLoading = _ref.isLoading,
8
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
9
+ rest = _objectWithoutProperties(_ref, ["isLoading"]);
10
+
11
+ // Button already has React.memo, so just leaning on that
12
+ return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
13
+ ref: ref,
14
+ overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, rest) : null
15
+ }));
16
+ }); // Tools including enzyme rely on components having a display name
17
+
18
+ LoadingButton.displayName = 'LoadingButton';
19
+ export default LoadingButton;
@@ -0,0 +1,36 @@
1
+ function abort(event) {
2
+ event.preventDefault();
3
+ event.stopPropagation();
4
+ }
5
+
6
+ var tabKeyCode = 9;
7
+
8
+ function onKey(event) {
9
+ // Allowing tab so that a user can move focus away
10
+ if (event.keyCode === tabKeyCode) {
11
+ return;
12
+ }
13
+
14
+ abort(event);
15
+ }
16
+
17
+ var block = {
18
+ onMouseDownCapture: abort,
19
+ onMouseUpCapture: abort,
20
+ // because we have tabIndex = -1 when disabled,
21
+ // keyboard events can only occur when there is an overlay
22
+ onKeyDownCapture: onKey,
23
+ onKeyUpCapture: onKey,
24
+ onTouchStartCapture: abort,
25
+ onTouchEndCapture: abort,
26
+ onPointerDownCapture: abort,
27
+ onPointerUpCapture: abort,
28
+ onClickCapture: abort,
29
+ // Just smashing the existing onClick for good measure
30
+ onClick: abort
31
+ };
32
+ var doNotBlock = {};
33
+ export default function blockEvents(_ref) {
34
+ var isInteractive = _ref.isInteractive;
35
+ return isInteractive ? doNotBlock : block;
36
+ }
@@ -0,0 +1,135 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+
4
+ /** @jsx jsx */
5
+ import React, { useCallback, useEffect, useRef } from 'react';
6
+ import { jsx } from '@emotion/core';
7
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
8
+ import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
9
+ import blockEvents from './block-events';
10
+ import { getContentStyle, getFadingCss, getIconStyle, overlayCss } from './css';
11
+
12
+ function noop() {} // Disabled buttons will still publish events for nested elements in webkit.
13
+ // We are disabling pointer events on child elements so that
14
+ // the button will always be the target of events
15
+ // Note: firefox does not have this behaviour for child elements
16
+
17
+
18
+ var noPointerEventsOnChildrenCss = {
19
+ '> *': {
20
+ pointerEvents: 'none'
21
+ }
22
+ };
23
+ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
24
+ var _props$appearance = props.appearance,
25
+ appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
26
+ buttonCss = props.buttonCss,
27
+ _props$spacing = props.spacing,
28
+ spacing = _props$spacing === void 0 ? 'default' : _props$spacing,
29
+ _props$autoFocus = props.autoFocus,
30
+ autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus,
31
+ _props$isDisabled = props.isDisabled,
32
+ isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled,
33
+ _props$shouldFitConta = props.shouldFitContainer,
34
+ shouldFitContainer = _props$shouldFitConta === void 0 ? false : _props$shouldFitConta,
35
+ _props$isSelected = props.isSelected,
36
+ isSelected = _props$isSelected === void 0 ? false : _props$isSelected,
37
+ iconBefore = props.iconBefore,
38
+ iconAfter = props.iconAfter,
39
+ children = props.children,
40
+ className = props.className,
41
+ href = props.href,
42
+ overlay = props.overlay,
43
+ _props$tabIndex = props.tabIndex,
44
+ tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
45
+ _props$type = props.type,
46
+ type = _props$type === void 0 ? !href ? 'button' : undefined : _props$type,
47
+ _props$onMouseDown = props.onMouseDown,
48
+ providedOnMouseDown = _props$onMouseDown === void 0 ? noop : _props$onMouseDown,
49
+ _props$onClick = props.onClick,
50
+ providedOnClick = _props$onClick === void 0 ? noop : _props$onClick,
51
+ _props$component = props.component,
52
+ Component = _props$component === void 0 ? href ? 'a' : 'button' : _props$component,
53
+ testId = props.testId,
54
+ analyticsContext = props.analyticsContext,
55
+ rest = _objectWithoutProperties(props, ["appearance", "buttonCss", "spacing", "autoFocus", "isDisabled", "shouldFitContainer", "isSelected", "iconBefore", "iconAfter", "children", "className", "href", "overlay", "tabIndex", "type", "onMouseDown", "onClick", "component", "testId", "analyticsContext"]);
56
+
57
+ var ourRef = useRef();
58
+ var setRef = useCallback(function (node) {
59
+ ourRef.current = node;
60
+
61
+ if (ref == null) {
62
+ return;
63
+ }
64
+
65
+ if (typeof ref === 'function') {
66
+ ref(node);
67
+ return;
68
+ } // @ts-ignore
69
+
70
+
71
+ ref.current = node;
72
+ }, [ourRef, ref]); // Cross browser auto focusing is pretty broken, so we are doing it ourselves
73
+
74
+ useAutoFocus(ourRef, autoFocus);
75
+ var onClick = usePlatformLeafEventHandler({
76
+ fn: providedOnClick,
77
+ action: 'clicked',
78
+ componentName: 'button',
79
+ packageName: "@atlaskit/button",
80
+ packageVersion: "16.1.2",
81
+ analyticsData: analyticsContext
82
+ }); // Button currently calls preventDefault, which is not standard button behaviour
83
+
84
+ var onMouseDown = useCallback(function (event) {
85
+ event.preventDefault();
86
+ providedOnMouseDown(event);
87
+ }, [providedOnMouseDown]); // Lose focus when becoming disabled (standard button behaviour)
88
+
89
+ useEffect(function () {
90
+ var el = ourRef.current;
91
+
92
+ if (isDisabled && el && el === document.activeElement) {
93
+ el.blur();
94
+ }
95
+ }, [isDisabled]); // we are 'disabling' input with a button when there is an overlay
96
+
97
+ var hasOverlay = Boolean(overlay);
98
+ var fadeCss = getFadingCss({
99
+ hasOverlay: hasOverlay
100
+ });
101
+ var isInteractive = !isDisabled && !hasOverlay;
102
+ return jsx(Component, _extends({}, rest, {
103
+ css: [buttonCss, isInteractive ? null : noPointerEventsOnChildrenCss],
104
+ className: className,
105
+ ref: setRef,
106
+ onClick: onClick,
107
+ onMouseDown: onMouseDown,
108
+ disabled: isDisabled,
109
+ href: isInteractive ? href : undefined // using undefined so that the property doesn't exist when false
110
+ ,
111
+ "data-has-overlay": hasOverlay ? true : undefined,
112
+ "data-testid": testId,
113
+ type: type // Adding a tab index so element is always focusable, even when not a <button> or <a>
114
+ // Disabling focus via keyboard navigation when disabled
115
+ // as this is standard button behaviour
116
+ ,
117
+ tabIndex: isDisabled ? -1 : tabIndex
118
+ }, blockEvents({
119
+ isInteractive: isInteractive
120
+ })), iconBefore ? jsx("span", {
121
+ css: [fadeCss, getIconStyle({
122
+ spacing: spacing
123
+ })]
124
+ }, iconBefore) : null, children ? jsx("span", {
125
+ css: [fadeCss, getContentStyle({
126
+ spacing: spacing
127
+ })]
128
+ }, children) : null, iconAfter ? jsx("span", {
129
+ css: [fadeCss, getIconStyle({
130
+ spacing: spacing
131
+ })]
132
+ }, iconAfter) : null, overlay ? jsx("span", {
133
+ css: overlayCss
134
+ }, overlay) : null);
135
+ });
@@ -0,0 +1,393 @@
1
+ import * as colors from '@atlaskit/theme/colors';
2
+ import { token } from '@atlaskit/tokens';
3
+ // Hard coding the active rgba color value rather than using a helper to convert it
4
+ // With helper it would be: hex2rgba(colors.B75, 0.6)
5
+ var fadedB75 = 'rgba(179, 212, 255, 0.6)';
6
+ var values = {
7
+ // Default appearance
8
+ background: {
9
+ default: {
10
+ default: {
11
+ light: token('color.background.subtleNeutral.resting', colors.N20A),
12
+ dark: token('color.background.subtleNeutral.resting', colors.DN70)
13
+ },
14
+ hover: {
15
+ light: token('color.background.subtleNeutral.hover', colors.N30A),
16
+ dark: token('color.background.subtleNeutral.hover', colors.DN60)
17
+ },
18
+ active: {
19
+ light: token('color.background.subtleNeutral.pressed', fadedB75),
20
+ dark: token('color.background.subtleNeutral.pressed', colors.B75)
21
+ },
22
+ disabled: {
23
+ light: token('color.background.disabled', colors.N20A),
24
+ dark: token('color.background.disabled', colors.DN70)
25
+ },
26
+ selected: {
27
+ light: token('color.background.selected.resting', colors.N700),
28
+ dark: token('color.background.selected.resting', colors.DN0)
29
+ },
30
+ focusSelected: {
31
+ light: token('color.background.selected.resting', colors.N700),
32
+ dark: token('color.background.selected.resting', colors.DN0)
33
+ }
34
+ },
35
+ primary: {
36
+ default: {
37
+ light: token('color.background.boldBrand.resting', colors.B400),
38
+ dark: token('color.background.boldBrand.resting', colors.B100)
39
+ },
40
+ hover: {
41
+ light: token('color.background.boldBrand.hover', colors.B300),
42
+ dark: token('color.background.boldBrand.hover', colors.B75)
43
+ },
44
+ active: {
45
+ light: token('color.background.boldBrand.pressed', colors.B500),
46
+ dark: token('color.background.boldBrand.pressed', colors.B200)
47
+ },
48
+ disabled: {
49
+ light: token('color.background.disabled', colors.N20A),
50
+ dark: token('color.background.disabled', colors.DN70)
51
+ },
52
+ selected: {
53
+ light: token('color.background.selected.resting', colors.N700),
54
+ dark: token('color.background.selected.resting', colors.DN0)
55
+ },
56
+ focusSelected: {
57
+ light: token('color.background.selected.resting', colors.N700),
58
+ dark: token('color.background.selected.resting', colors.DN0)
59
+ }
60
+ },
61
+ warning: {
62
+ default: {
63
+ light: token('color.background.boldWarning.resting', colors.Y300),
64
+ dark: token('color.background.boldWarning.resting', colors.Y300)
65
+ },
66
+ hover: {
67
+ light: token('color.background.boldWarning.hover', colors.Y200),
68
+ dark: token('color.background.boldWarning.hover', colors.Y200)
69
+ },
70
+ active: {
71
+ light: token('color.background.boldWarning.pressed', colors.Y400),
72
+ dark: token('color.background.boldWarning.pressed', colors.Y400)
73
+ },
74
+ disabled: {
75
+ light: token('color.background.disabled', colors.N20A),
76
+ dark: token('color.background.disabled', colors.DN70)
77
+ },
78
+ selected: {
79
+ light: token('color.background.selected.resting', colors.Y400),
80
+ dark: token('color.background.selected.resting', colors.Y400)
81
+ },
82
+ focusSelected: {
83
+ light: token('color.background.selected.resting', colors.Y400),
84
+ dark: token('color.background.selected.resting', colors.Y400)
85
+ }
86
+ },
87
+ danger: {
88
+ default: {
89
+ light: token('color.background.boldDanger.resting', colors.R400),
90
+ dark: token('color.background.boldDanger.resting', colors.R400)
91
+ },
92
+ hover: {
93
+ light: token('color.background.boldDanger.hover', colors.R300),
94
+ dark: token('color.background.boldDanger.hover', colors.R300)
95
+ },
96
+ active: {
97
+ light: token('color.background.boldDanger.pressed', colors.R500),
98
+ dark: token('color.background.boldDanger.pressed', colors.R500)
99
+ },
100
+ disabled: {
101
+ light: token('color.background.disabled', colors.N20A),
102
+ dark: token('color.background.disabled', colors.DN70)
103
+ },
104
+ selected: {
105
+ light: token('color.background.selected.resting', colors.R500),
106
+ dark: token('color.background.selected.resting', colors.R500)
107
+ },
108
+ focusSelected: {
109
+ light: token('color.background.selected.resting', colors.R500),
110
+ dark: token('color.background.selected.resting', colors.R500)
111
+ }
112
+ },
113
+ link: {
114
+ default: {
115
+ light: 'none',
116
+ dark: 'none'
117
+ },
118
+ selected: {
119
+ light: token('color.background.selected.resting', colors.N700),
120
+ dark: token('color.background.selected.resting', colors.N20)
121
+ },
122
+ focusSelected: {
123
+ light: token('color.background.selected.resting', colors.N700),
124
+ dark: token('color.background.selected.resting', colors.N20)
125
+ }
126
+ },
127
+ subtle: {
128
+ default: {
129
+ light: 'none',
130
+ dark: 'none'
131
+ },
132
+ hover: {
133
+ light: token('color.background.transparentNeutral.hover', colors.N30A),
134
+ dark: token('color.background.transparentNeutral.hover', colors.DN60)
135
+ },
136
+ active: {
137
+ light: token('color.background.transparentNeutral.pressed', fadedB75),
138
+ dark: token('color.background.transparentNeutral.pressed', colors.B75)
139
+ },
140
+ disabled: {
141
+ light: 'none',
142
+ dark: 'none'
143
+ },
144
+ selected: {
145
+ light: token('color.background.selected.resting', colors.N700),
146
+ dark: token('color.background.selected.resting', colors.DN0)
147
+ },
148
+ focusSelected: {
149
+ light: token('color.background.selected.resting', colors.N700),
150
+ dark: token('color.background.selected.resting', colors.DN0)
151
+ }
152
+ },
153
+ 'subtle-link': {
154
+ default: {
155
+ light: 'none',
156
+ dark: 'none'
157
+ },
158
+ selected: {
159
+ light: token('color.background.selected.resting', colors.N700),
160
+ dark: token('color.background.selected.resting', colors.N20)
161
+ },
162
+ focusSelected: {
163
+ light: token('color.background.selected.resting', colors.N700),
164
+ dark: token('color.background.selected.resting', colors.N20)
165
+ }
166
+ }
167
+ },
168
+ boxShadowColor: {
169
+ default: {
170
+ focus: {
171
+ light: token('color.border.focus', colors.B100),
172
+ dark: token('color.border.focus', colors.B75)
173
+ },
174
+ focusSelected: {
175
+ light: token('color.border.focus', colors.B100),
176
+ dark: token('color.border.focus', colors.B75)
177
+ }
178
+ },
179
+ primary: {
180
+ focus: {
181
+ light: token('color.border.focus', colors.B100),
182
+ dark: token('color.border.focus', colors.B75)
183
+ },
184
+ focusSelected: {
185
+ light: token('color.border.focus', colors.B100),
186
+ dark: token('color.border.focus', colors.B75)
187
+ }
188
+ },
189
+ warning: {
190
+ focus: {
191
+ light: token('color.border.focus', colors.Y500),
192
+ dark: token('color.border.focus', colors.Y500)
193
+ },
194
+ focusSelected: {
195
+ light: token('color.border.focus', colors.Y500),
196
+ dark: token('color.border.focus', colors.Y500)
197
+ }
198
+ },
199
+ danger: {
200
+ focus: {
201
+ light: token('color.border.focus', colors.R100),
202
+ dark: token('color.border.focus', colors.R100)
203
+ },
204
+ focusSelected: {
205
+ light: token('color.border.focus', colors.R100),
206
+ dark: token('color.border.focus', colors.R100)
207
+ }
208
+ },
209
+ link: {
210
+ focus: {
211
+ light: token('color.border.focus', colors.B100),
212
+ dark: token('color.border.focus', colors.B75)
213
+ },
214
+ focusSelected: {
215
+ light: token('color.border.focus', colors.B100),
216
+ dark: token('color.border.focus', colors.B75)
217
+ }
218
+ },
219
+ subtle: {
220
+ focus: {
221
+ light: token('color.border.focus', colors.B100),
222
+ dark: token('color.border.focus', colors.B75)
223
+ },
224
+ focusSelected: {
225
+ light: token('color.border.focus', colors.B100),
226
+ dark: token('color.border.focus', colors.B75)
227
+ }
228
+ },
229
+ 'subtle-link': {
230
+ focus: {
231
+ light: token('color.border.focus', colors.B100),
232
+ dark: token('color.border.focus', colors.B75)
233
+ },
234
+ focusSelected: {
235
+ light: token('color.border.focus', colors.B100),
236
+ dark: token('color.border.focus', colors.B75)
237
+ }
238
+ }
239
+ },
240
+ color: {
241
+ default: {
242
+ default: {
243
+ light: token('color.text.highEmphasis', colors.N500),
244
+ dark: token('color.text.highEmphasis', colors.DN400)
245
+ },
246
+ active: {
247
+ light: token('color.text.highEmphasis', colors.B400),
248
+ dark: token('color.text.highEmphasis', colors.B400)
249
+ },
250
+ disabled: {
251
+ light: token('color.text.disabled', colors.N70),
252
+ dark: token('color.text.disabled', colors.DN30)
253
+ },
254
+ selected: {
255
+ light: token('color.text.selected', colors.N20),
256
+ dark: token('color.text.selected', colors.DN400)
257
+ },
258
+ focusSelected: {
259
+ light: token('color.text.selected', colors.N20),
260
+ dark: token('color.text.selected', colors.DN400)
261
+ }
262
+ },
263
+ primary: {
264
+ default: {
265
+ light: token('color.text.onBold', colors.N0),
266
+ dark: token('color.text.onBold', colors.DN30)
267
+ },
268
+ disabled: {
269
+ light: token('color.text.disabled', colors.N70),
270
+ dark: token('color.text.disabled', colors.DN30)
271
+ },
272
+ selected: {
273
+ light: token('color.text.selected', colors.N20),
274
+ dark: token('color.text.selected', colors.DN400)
275
+ },
276
+ focusSelected: {
277
+ light: token('color.text.selected', colors.N20),
278
+ dark: token('color.text.selected', colors.DN400)
279
+ }
280
+ },
281
+ warning: {
282
+ default: {
283
+ light: token('color.text.onBoldWarning', colors.N800),
284
+ dark: token('color.text.onBoldWarning', colors.N800)
285
+ },
286
+ disabled: {
287
+ light: token('color.text.disabled', colors.N70),
288
+ dark: token('color.text.disabled', colors.DN30)
289
+ },
290
+ selected: {
291
+ light: token('color.text.selected', colors.N800),
292
+ dark: token('color.text.selected', colors.N800)
293
+ },
294
+ focusSelected: {
295
+ light: token('color.text.selected', colors.N800),
296
+ dark: token('color.text.selected', colors.N800)
297
+ }
298
+ },
299
+ danger: {
300
+ default: {
301
+ light: token('color.text.onBold', colors.N0),
302
+ dark: token('color.text.onBold', colors.N0)
303
+ },
304
+ disabled: {
305
+ light: token('color.text.disabled', colors.N70),
306
+ dark: token('color.text.disabled', colors.DN30)
307
+ },
308
+ selected: {
309
+ light: token('color.text.selected', colors.N0),
310
+ dark: token('color.text.selected', colors.N0)
311
+ },
312
+ focusSelected: {
313
+ light: token('color.text.selected', colors.N0),
314
+ dark: token('color.text.selected', colors.N0)
315
+ }
316
+ },
317
+ link: {
318
+ default: {
319
+ light: token('color.text.link.resting', colors.B400),
320
+ dark: token('color.text.link.resting', colors.B100)
321
+ },
322
+ hover: {
323
+ light: token('color.text.link.resting', colors.B300),
324
+ dark: token('color.text.link.resting', colors.B75)
325
+ },
326
+ active: {
327
+ light: token('color.text.link.pressed', colors.B500),
328
+ dark: token('color.text.link.pressed', colors.B200)
329
+ },
330
+ disabled: {
331
+ light: token('color.text.disabled', colors.N70),
332
+ dark: token('color.text.disabled', colors.DN100)
333
+ },
334
+ selected: {
335
+ light: token('color.text.selected', colors.N20),
336
+ dark: token('color.text.selected', colors.N700)
337
+ },
338
+ focusSelected: {
339
+ light: token('color.text.selected', colors.N20),
340
+ dark: token('color.text.selected', colors.N700)
341
+ }
342
+ },
343
+ subtle: {
344
+ default: {
345
+ light: token('color.text.highEmphasis', colors.N500),
346
+ dark: token('color.text.highEmphasis', colors.DN400)
347
+ },
348
+ active: {
349
+ light: token('color.text.highEmphasis', colors.B400),
350
+ dark: token('color.text.highEmphasis', colors.B400)
351
+ },
352
+ disabled: {
353
+ light: token('color.text.disabled', colors.N70),
354
+ dark: token('color.text.disabled', colors.DN100)
355
+ },
356
+ selected: {
357
+ light: token('color.text.selected', colors.N20),
358
+ dark: token('color.text.selected', colors.DN400)
359
+ },
360
+ focusSelected: {
361
+ light: token('color.text.selected', colors.N20),
362
+ dark: token('color.text.selected', colors.DN400)
363
+ }
364
+ },
365
+ 'subtle-link': {
366
+ default: {
367
+ light: token('color.text.mediumEmphasis', colors.N200),
368
+ dark: token('color.text.mediumEmphasis', colors.DN400)
369
+ },
370
+ hover: {
371
+ light: token('color.text.mediumEmphasis', colors.N90),
372
+ dark: token('color.text.mediumEmphasis', colors.B50)
373
+ },
374
+ active: {
375
+ light: token('color.text.highEmphasis', colors.N400),
376
+ dark: token('color.text.highEmphasis', colors.DN300)
377
+ },
378
+ disabled: {
379
+ light: token('color.text.disabled', colors.N70),
380
+ dark: token('color.text.disabled', colors.DN100)
381
+ },
382
+ selected: {
383
+ light: token('color.text.selected', colors.N20),
384
+ dark: token('color.text.selected', colors.DN400)
385
+ },
386
+ focusSelected: {
387
+ light: token('color.text.selected', colors.N20),
388
+ dark: token('color.text.selected', colors.DN400)
389
+ }
390
+ }
391
+ }
392
+ };
393
+ export default values;