@atlaskit/button 17.8.0 → 17.10.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/CHANGELOG.md +18 -0
  2. package/dist/cjs/entry-points/standard-button.js +0 -1
  3. package/dist/cjs/new-button/variants/default/use-default-button.js +1 -0
  4. package/dist/cjs/new-button/variants/icon/use-icon-button.js +1 -0
  5. package/dist/cjs/new-button/variants/shared/colors.js +44 -36
  6. package/dist/cjs/new-button/variants/shared/loading-overlay.js +1 -4
  7. package/dist/cjs/new-button/variants/shared/use-button-base.js +4 -1
  8. package/dist/cjs/new-button/variants/shared/xcss.js +16 -8
  9. package/dist/cjs/old-button/shared/button-base.js +1 -1
  10. package/dist/es2019/entry-points/standard-button.js +0 -5
  11. package/dist/es2019/new-button/variants/default/use-default-button.js +1 -0
  12. package/dist/es2019/new-button/variants/icon/use-icon-button.js +1 -0
  13. package/dist/es2019/new-button/variants/shared/colors.js +44 -36
  14. package/dist/es2019/new-button/variants/shared/loading-overlay.js +1 -4
  15. package/dist/es2019/new-button/variants/shared/use-button-base.js +3 -1
  16. package/dist/es2019/new-button/variants/shared/xcss.js +15 -7
  17. package/dist/es2019/old-button/shared/button-base.js +1 -1
  18. package/dist/esm/entry-points/standard-button.js +0 -5
  19. package/dist/esm/new-button/variants/default/use-default-button.js +1 -0
  20. package/dist/esm/new-button/variants/icon/use-icon-button.js +1 -0
  21. package/dist/esm/new-button/variants/shared/colors.js +44 -36
  22. package/dist/esm/new-button/variants/shared/loading-overlay.js +1 -4
  23. package/dist/esm/new-button/variants/shared/use-button-base.js +4 -1
  24. package/dist/esm/new-button/variants/shared/xcss.js +16 -8
  25. package/dist/esm/old-button/shared/button-base.js +1 -1
  26. package/dist/types/containers/button-group.d.ts +4 -4
  27. package/dist/types/entry-points/standard-button.d.ts +0 -5
  28. package/dist/types/new-button/variants/default/types.d.ts +0 -4
  29. package/dist/types/new-button/variants/icon/types.d.ts +0 -4
  30. package/dist/types/new-button/variants/shared/colors.d.ts +5 -3
  31. package/dist/types/new-button/variants/shared/use-button-base.d.ts +2 -1
  32. package/dist/types/new-button/variants/shared/xcss.d.ts +2 -1
  33. package/dist/types/new-button/variants/types.d.ts +4 -0
  34. package/dist/types/old-button/types.d.ts +20 -20
  35. package/dist/types-ts4.5/containers/button-group.d.ts +4 -4
  36. package/dist/types-ts4.5/entry-points/standard-button.d.ts +0 -5
  37. package/dist/types-ts4.5/new-button/variants/default/types.d.ts +0 -4
  38. package/dist/types-ts4.5/new-button/variants/icon/types.d.ts +0 -4
  39. package/dist/types-ts4.5/new-button/variants/shared/colors.d.ts +5 -3
  40. package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +2 -1
  41. package/dist/types-ts4.5/new-button/variants/shared/xcss.d.ts +2 -1
  42. package/dist/types-ts4.5/new-button/variants/types.d.ts +4 -0
  43. package/dist/types-ts4.5/old-button/types.d.ts +20 -20
  44. package/extract-react-types/new-button/variants/default/{common-props.tsx → common-default-button-props.tsx} +1 -1
  45. package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +5 -0
  46. package/package.json +4 -4
@@ -5,85 +5,85 @@ export type Spacing = 'compact' | 'default' | 'none';
5
5
  type Combine<First, Second> = Omit<First, keyof Second> & Second;
6
6
  export type BaseOwnProps = {
7
7
  /**
8
- * The base styling to apply to the button
8
+ * The base styling to apply to the button.
9
9
  */
10
10
  appearance?: Appearance;
11
11
  /**
12
- * Set the button to autofocus on mount
12
+ * Set the button to autofocus on mount.
13
13
  */
14
14
  autoFocus?: boolean;
15
15
  /**
16
- * Add a classname to the button
16
+ * Add a classname to the button.
17
17
  */
18
18
  className?: string;
19
19
  /**
20
- * Used to 'overlay' something over a button. This is commonly used to display a loading spinner
20
+ * Used to 'overlay' something over a button. This is commonly used to display a loading spinner.
21
21
  */
22
22
  overlay?: React.ReactNode;
23
23
  /**
24
- * Provides a url for buttons being used as a link
24
+ * Provides a URL that's used when the button is a link styled as a button.
25
25
  */
26
26
  href?: string;
27
27
  /**
28
- * Places an icon within the button, after the button's text
28
+ * Places an icon within the button, after the button's text.
29
29
  */
30
30
  iconAfter?: React.ReactChild;
31
31
  /**
32
- * Places an icon within the button, before the button's text
32
+ * Places an icon within the button, before the button's text.
33
33
  */
34
34
  iconBefore?: React.ReactChild;
35
35
  /**
36
- * Set if the button is disabled
36
+ * Set if the button is disabled.
37
37
  */
38
38
  isDisabled?: boolean;
39
39
  /**
40
- * Change the style to indicate the button is selected
40
+ * Change the style to indicate the button is selected.
41
41
  */
42
42
  isSelected?: boolean;
43
43
  /**
44
- * Handler to be called on blur
44
+ * Handler to be called on blur.
45
45
  */
46
46
  onBlur?: React.FocusEventHandler<HTMLElement>;
47
47
  /**
48
- * Handler to be called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details
48
+ * Handler to be called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details.
49
49
  */
50
50
  onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
51
51
  /**
52
- * Handler to be called on focus
52
+ * Handler to be called on focus.
53
53
  */
54
54
  onFocus?: React.FocusEventHandler<HTMLElement>;
55
55
  /**
56
- * Set the amount of padding in the button
56
+ * Set the amount of padding in the button.
57
57
  */
58
58
  spacing?: Spacing;
59
59
  /**
60
- * Pass target down to a link within the button component, if a href is provided
60
+ * Pass target down to the button. If a href is provided, this will be a semantic link styled as a button.
61
61
  */
62
62
  target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
63
63
  /**
64
- * Pass type down to a button
64
+ * Pass type down to the button.
65
65
  */
66
66
  type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
67
67
  /**
68
- * Option to fit button width to its parent width
68
+ * Option to fit button width to its parent width.
69
69
  */
70
70
  shouldFitContainer?: boolean;
71
71
  /**
72
- * Text content to be rendered in the button
72
+ * Text content to be rendered in the button.
73
73
  */
74
74
  children?: React.ReactNode;
75
75
  /**
76
- * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
76
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests.
77
77
  */
78
78
  testId?: string;
79
79
  component?: React.ComponentType<React.AllHTMLAttributes<HTMLElement>> | React.ElementType;
80
80
  /**
81
81
  * An optional name used to identify this component to press listeners. For example, interaction tracing. For more information,
82
- * see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration)
82
+ * see [UFO integration into Design System components](https://go.atlassian.com/react-ufo-dst-integration).
83
83
  */
84
84
  interactionName?: string;
85
85
  /**
86
- * Additional information to be included in the `context` of analytics events that come from button
86
+ * Additional information to be included in the `context` of analytics events that come from button.
87
87
  */
88
88
  analyticsContext?: Record<string, any>;
89
89
  };
@@ -4,7 +4,7 @@ import {
4
4
  type SupportedElements,
5
5
  } from '../../../../src/new-button/variants/types';
6
6
 
7
- export default function CommonProps(
7
+ export default function CommonDefaultButtonProps(
8
8
  props: CommonButtonProps<SupportedElements> & CommonDefaultButtonProps,
9
9
  ) {
10
10
  return null;
@@ -0,0 +1,5 @@
1
+ import { AdditionalButtonVariantProps } from '../../../../src/new-button/variants/types';
2
+
3
+ export default function IconButtonProps(props: AdditionalButtonVariantProps) {
4
+ return null;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "17.8.0",
3
+ "version": "17.10.0",
4
4
  "description": "A button triggers an event or action. They let users know what will happen next.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -87,10 +87,10 @@
87
87
  "@atlaskit/focus-ring": "^1.3.0",
88
88
  "@atlaskit/icon": "^22.1.0",
89
89
  "@atlaskit/interaction-context": "^2.1.0",
90
- "@atlaskit/primitives": "^5.1.0",
90
+ "@atlaskit/primitives": "^5.5.0",
91
91
  "@atlaskit/spinner": "^16.0.0",
92
92
  "@atlaskit/theme": "^12.7.0",
93
- "@atlaskit/tokens": "^1.42.0",
93
+ "@atlaskit/tokens": "^1.43.0",
94
94
  "@atlaskit/visually-hidden": "^1.2.4",
95
95
  "@babel/runtime": "^7.0.0",
96
96
  "@emotion/react": "^11.7.1"
@@ -102,7 +102,7 @@
102
102
  "@af/accessibility-testing": "*",
103
103
  "@af/integration-testing": "*",
104
104
  "@af/visual-regression": "*",
105
- "@atlaskit/app-provider": "^1.0.0",
105
+ "@atlaskit/app-provider": "^1.2.0",
106
106
  "@atlaskit/ssr": "*",
107
107
  "@atlaskit/visual-regression": "*",
108
108
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",