@atlaskit/smart-card 33.4.0 → 34.0.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 (143) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/BlockCard/views/styled.js +1 -0
  4. package/dist/cjs/view/EmbedModal/components/link-info/styled.js +2 -0
  5. package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +1 -0
  6. package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +3 -0
  7. package/dist/cjs/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +1 -0
  8. package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  9. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -1
  10. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -0
  11. package/dist/cjs/view/FlexibleCard/components/common/motion-wrapper/index.js +1 -1
  12. package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +1 -1
  13. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +1 -0
  14. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/styled.js +2 -0
  15. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +3 -0
  16. package/dist/cjs/view/FlexibleCard/components/utils.js +3 -3
  17. package/dist/cjs/view/InlineCard/ErroredView/index.js +6 -2
  18. package/dist/cjs/view/InlineCard/ForbiddenView/index.js +40 -15
  19. package/dist/cjs/view/InlineCard/Frame/index.js +3 -1
  20. package/dist/cjs/view/InlineCard/Frame/styled-emotion.js +137 -0
  21. package/dist/cjs/view/InlineCard/Frame/styled.compiled.css +53 -0
  22. package/dist/cjs/view/InlineCard/Frame/styled.js +49 -124
  23. package/dist/cjs/view/InlineCard/Icon-emotion.js +58 -0
  24. package/dist/cjs/view/InlineCard/Icon.compiled.css +10 -0
  25. package/dist/cjs/view/InlineCard/Icon.js +39 -18
  26. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.compiled.css +6 -0
  27. package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +99 -25
  28. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled-emotion.js +95 -0
  29. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.compiled.css +36 -0
  30. package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +128 -45
  31. package/dist/cjs/view/InlineCard/ResolvingView/index.js +30 -12
  32. package/dist/cjs/view/InlineCard/ResolvingView/styled-emotion.js +16 -0
  33. package/dist/cjs/view/InlineCard/ResolvingView/styled.compiled.css +5 -0
  34. package/dist/cjs/view/InlineCard/ResolvingView/styled.js +26 -8
  35. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +42 -16
  36. package/dist/cjs/view/InlineCard/styled-emotion.js +55 -0
  37. package/dist/cjs/view/InlineCard/styled.compiled.css +21 -0
  38. package/dist/cjs/view/InlineCard/styled.js +25 -45
  39. package/dist/cjs/view/LinkUrl/index.js +1 -1
  40. package/dist/es2019/utils/analytics/analytics.js +1 -1
  41. package/dist/es2019/view/BlockCard/views/styled.js +1 -0
  42. package/dist/es2019/view/EmbedModal/components/link-info/styled.js +2 -0
  43. package/dist/es2019/view/FlexibleCard/components/actions/action/action-button/index.js +1 -0
  44. package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +3 -0
  45. package/dist/es2019/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +1 -0
  46. package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  47. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -1
  48. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
  49. package/dist/es2019/view/FlexibleCard/components/common/motion-wrapper/index.js +1 -1
  50. package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +1 -1
  51. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +1 -0
  52. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/styled.js +2 -0
  53. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +3 -0
  54. package/dist/es2019/view/FlexibleCard/components/utils.js +3 -3
  55. package/dist/es2019/view/InlineCard/ErroredView/index.js +6 -2
  56. package/dist/es2019/view/InlineCard/ForbiddenView/index.js +40 -15
  57. package/dist/es2019/view/InlineCard/Frame/index.js +3 -1
  58. package/dist/es2019/view/InlineCard/Frame/styled-emotion.js +143 -0
  59. package/dist/es2019/view/InlineCard/Frame/styled.compiled.css +53 -0
  60. package/dist/es2019/view/InlineCard/Frame/styled.js +44 -136
  61. package/dist/es2019/view/InlineCard/Icon-emotion.js +52 -0
  62. package/dist/es2019/view/InlineCard/Icon.compiled.css +10 -0
  63. package/dist/es2019/view/InlineCard/Icon.js +31 -15
  64. package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.compiled.css +6 -0
  65. package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +87 -18
  66. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled-emotion.js +114 -0
  67. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.compiled.css +36 -0
  68. package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +115 -43
  69. package/dist/es2019/view/InlineCard/ResolvingView/index.js +30 -12
  70. package/dist/es2019/view/InlineCard/ResolvingView/styled-emotion.js +9 -0
  71. package/dist/es2019/view/InlineCard/ResolvingView/styled.compiled.css +5 -0
  72. package/dist/es2019/view/InlineCard/ResolvingView/styled.js +20 -6
  73. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +42 -16
  74. package/dist/es2019/view/InlineCard/styled-emotion.js +47 -0
  75. package/dist/es2019/view/InlineCard/styled.compiled.css +21 -0
  76. package/dist/es2019/view/InlineCard/styled.js +19 -43
  77. package/dist/es2019/view/LinkUrl/index.js +1 -1
  78. package/dist/esm/utils/analytics/analytics.js +1 -1
  79. package/dist/esm/view/BlockCard/views/styled.js +1 -0
  80. package/dist/esm/view/EmbedModal/components/link-info/styled.js +2 -0
  81. package/dist/esm/view/FlexibleCard/components/actions/action/action-button/index.js +1 -0
  82. package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +3 -0
  83. package/dist/esm/view/FlexibleCard/components/blocks/action-block/action-footer/index.js +1 -0
  84. package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
  85. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +1 -1
  86. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -0
  87. package/dist/esm/view/FlexibleCard/components/common/motion-wrapper/index.js +1 -1
  88. package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +1 -1
  89. package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +1 -0
  90. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/styled.js +2 -0
  91. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/styled.js +3 -0
  92. package/dist/esm/view/FlexibleCard/components/utils.js +3 -3
  93. package/dist/esm/view/InlineCard/ErroredView/index.js +6 -2
  94. package/dist/esm/view/InlineCard/ForbiddenView/index.js +40 -15
  95. package/dist/esm/view/InlineCard/Frame/index.js +3 -1
  96. package/dist/esm/view/InlineCard/Frame/styled-emotion.js +131 -0
  97. package/dist/esm/view/InlineCard/Frame/styled.compiled.css +53 -0
  98. package/dist/esm/view/InlineCard/Frame/styled.js +46 -125
  99. package/dist/esm/view/InlineCard/Icon-emotion.js +51 -0
  100. package/dist/esm/view/InlineCard/Icon.compiled.css +10 -0
  101. package/dist/esm/view/InlineCard/Icon.js +36 -17
  102. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.compiled.css +6 -0
  103. package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +90 -18
  104. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled-emotion.js +87 -0
  105. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.compiled.css +36 -0
  106. package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +124 -43
  107. package/dist/esm/view/InlineCard/ResolvingView/index.js +30 -12
  108. package/dist/esm/view/InlineCard/ResolvingView/styled-emotion.js +9 -0
  109. package/dist/esm/view/InlineCard/ResolvingView/styled.compiled.css +5 -0
  110. package/dist/esm/view/InlineCard/ResolvingView/styled.js +22 -6
  111. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +42 -16
  112. package/dist/esm/view/InlineCard/styled-emotion.js +47 -0
  113. package/dist/esm/view/InlineCard/styled.compiled.css +21 -0
  114. package/dist/esm/view/InlineCard/styled.js +21 -43
  115. package/dist/esm/view/LinkUrl/index.js +1 -1
  116. package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
  117. package/dist/types/view/InlineCard/Frame/styled-emotion.d.ts +17 -0
  118. package/dist/types/view/InlineCard/Frame/styled.d.ts +8 -10
  119. package/dist/types/view/InlineCard/Icon-emotion.d.ts +12 -0
  120. package/dist/types/view/InlineCard/Icon.d.ts +2 -8
  121. package/dist/types/view/InlineCard/IconAndTitleLayout/styled-emotion.d.ts +36 -0
  122. package/dist/types/view/InlineCard/IconAndTitleLayout/styled.d.ts +8 -34
  123. package/dist/types/view/InlineCard/ResolvingView/styled-emotion.d.ts +9 -0
  124. package/dist/types/view/InlineCard/ResolvingView/styled.d.ts +1 -8
  125. package/dist/types/view/InlineCard/styled-emotion.d.ts +13 -0
  126. package/dist/types/view/InlineCard/styled.d.ts +1 -12
  127. package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
  128. package/dist/types-ts4.5/view/InlineCard/Frame/styled-emotion.d.ts +17 -0
  129. package/dist/types-ts4.5/view/InlineCard/Frame/styled.d.ts +8 -10
  130. package/dist/types-ts4.5/view/InlineCard/Icon-emotion.d.ts +12 -0
  131. package/dist/types-ts4.5/view/InlineCard/Icon.d.ts +2 -8
  132. package/dist/types-ts4.5/view/InlineCard/IconAndTitleLayout/styled-emotion.d.ts +36 -0
  133. package/dist/types-ts4.5/view/InlineCard/IconAndTitleLayout/styled.d.ts +8 -34
  134. package/dist/types-ts4.5/view/InlineCard/ResolvingView/styled-emotion.d.ts +9 -0
  135. package/dist/types-ts4.5/view/InlineCard/ResolvingView/styled.d.ts +1 -8
  136. package/dist/types-ts4.5/view/InlineCard/styled-emotion.d.ts +13 -0
  137. package/dist/types-ts4.5/view/InlineCard/styled.d.ts +1 -12
  138. package/hooks/package.json +3 -1
  139. package/hover-card/package.json +3 -1
  140. package/link-url/package.json +3 -1
  141. package/package.json +17 -7
  142. package/ssr/package.json +3 -1
  143. package/types/package.json +3 -1
@@ -1,141 +1,49 @@
1
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
- import styled from '@emotion/styled';
1
+ /* styled.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./styled.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React, { forwardRef } from 'react';
3
6
  import { B100, B200, B400, B50, N40 } from '@atlaskit/theme/colors';
4
7
  const lineHeight = 22;
5
- const selectedStyles = {
6
- cursor: 'pointer',
7
- boxShadow: `0 0 0 2px ${`var(--ds-border-selected, ${B100})`}`,
8
- outline: 'none',
9
- userSelect: 'none',
10
- '&, :hover, :focus, :active': {
11
- textDecoration: 'none'
12
- },
13
- '&:hover': {
14
- border: `1px solid ${`var(--ds-border, ${N40})`}`
15
- }
16
- };
17
- const isInteractive = ({
18
- isInteractive
19
- }) => {
20
- if (isInteractive) {
21
- return {
22
- ':active': {
23
- backgroundColor: `var(--ds-background-selected, ${B50})`
24
- },
25
- ':focus': selectedStyles
26
- };
27
- }
28
- return undefined;
29
- };
30
- const isSelected = ({
31
- isSelected
32
- }) => {
33
- if (isSelected) {
34
- return selectedStyles;
35
- } else {
36
- return {
37
- userSelect: 'text'
38
- };
39
- }
40
- };
41
- const hoveredStyles = {
42
- borderColor: `var(--ds-border-accent-blue, ${B200})`
43
- };
44
- const activeHoveredFocusedStyles = props => {
45
- if (props.withoutBackground) {
46
- return undefined;
47
- }
48
- return {
49
- textDecoration: 'none'
50
- };
51
- };
52
- const hoveredWihBorderStyles = props => ({
53
- ...hoveredStyles,
54
- ...activeHoveredFocusedStyles(props)
8
+ export const WrapperSpan = /*#__PURE__*/forwardRef(({
9
+ truncateInline,
10
+ withoutBackground,
11
+ isHovered,
12
+ isInteractive,
13
+ isSelected,
14
+ href,
15
+ ...props
16
+ }, ref) => {
17
+ return /*#__PURE__*/React.createElement("span", _extends({
18
+ ref: ref
19
+ }, props, {
20
+ className: ax(["_1yt4x7n9 _2rkoiti9 _v56415x0 _vwz4qslr _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _vwz4183y _1e0c1abx _1yyjkb7n _sudp1e54 _17bix7n9 _nr8z1o8l _102kqslr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19ith6cr _bfhkhp5a _1a3b18uv _4fprglyw _5goinqa1 _9oik18uv _1bnxglyw _jf4cnqa1 _1nrm18uv _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu18uv _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b18uv _4fprglyw _5goinqa1 _9oik18uv _1bnxglyw _jf4cnqa1 _bfw7h6cr _1nrm18uv _c2waglyw _1iohnqa1" : "_uizt1kdv"])
21
+ }), props.children);
55
22
  });
56
-
57
- /*
58
- Inline smart cards should have the following layout:
59
- ------------------------------------
60
- | icon | title | action OR lozenge |
61
- ------------------------------------
62
- The aim is to ensure (1) all children are
63
- in line with each other, (2) are vertically
64
- centered.
65
- */
66
- // NB: `padding` consistent with @mentions.
67
- // NB: `display: inline` required for `box-decoration-break` to work.
68
- // NB: `box-decoration-break` required for retaining properties (border-radius) on wrap.
69
- const baseWrapperStyles = props => ({
70
- lineHeight: `${lineHeight}px`,
71
- padding: `${"var(--ds-space-025, 2px)"} 0px`,
72
- ...(props.withoutBackground ? {
73
- paddingLeft: 0,
74
- marginLeft: "var(--ds-space-negative-025, -2px)"
75
- } : undefined),
76
- display: 'inline',
77
- boxDecorationBreak: 'clone',
78
- borderRadius: "var(--ds-border-radius-100, 4px)",
79
- color: `var(--ds-link, ${B400})`,
80
- ...(props.withoutBackground ? undefined : {
81
- backgroundColor: "var(--ds-surface-raised, white)"
82
- }),
83
- ...isSelected(props),
84
- ...(props.withoutBackground ? undefined : {
85
- border: `1px solid ${`var(--ds-border, ${N40})`}`
86
- }),
87
- '&:hover': hoveredStyles,
88
- '&, :hover, :focus, :active': activeHoveredFocusedStyles(props),
89
- transition: '0.1s all ease-in-out',
90
- MozUserSelect: 'none',
91
- // -moz-user-select
92
-
93
- ...(props.isHovered ? hoveredWihBorderStyles(props) : undefined)
23
+ export const WrapperAnchor = /*#__PURE__*/forwardRef(({
24
+ truncateInline,
25
+ withoutBackground,
26
+ isHovered,
27
+ isInteractive,
28
+ isSelected,
29
+ href,
30
+ ...props
31
+ }, ref) => {
32
+ return /*#__PURE__*/React.createElement("a", _extends({
33
+ href: href,
34
+ ref: ref
35
+ }, props, {
36
+ className: ax(["_1yt4x7n9 _2rkoiti9 _v56415x0 _vwz4qslr _1e0c1nu9 _16d9qvcn _syaz1y58 _1rkwglyw _4cvxmr28", truncateInline && "_1reo15vq _18m915vq _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bto1l2s _1nmz9jpi _vwz4183y _1e0c1abx _1yyjkb7n _sudp1e54 _17bix7n9 _nr8z1o8l _102kqslr", withoutBackground ? "_19bvidpf _18u01i6y" : "_19ith6cr _bfhkhp5a _1a3b18uv _4fprglyw _5goinqa1 _9oik18uv _1bnxglyw _jf4cnqa1 _1nrm18uv _c2waglyw _1iohnqa1", isHovered && "_1h6dmr28", isHovered && !withoutBackground && "_4bfu18uv _1hmsglyw _ajmmnqa1", isSelected ? "_12ji1r31 _1qu2glyw _12y31o36 _80omtlke _16qscw00 _uiztglyw _1a3b18uv _4fprglyw _5goinqa1 _9oik18uv _1bnxglyw _jf4cnqa1 _bfw7h6cr _1nrm18uv _c2waglyw _1iohnqa1" : "_uizt1kdv", isInteractive && "_nt751r31 _49pcglyw _1hvw1o36 _1372tlke _7ehicw00 _1j5pglyw _1di629zg"])
37
+ }), props.children);
94
38
  });
95
- const truncateStyles = {
96
- overflow: 'hidden',
97
- textOverflow: 'ellipsis',
98
- wordBreak: 'break-all',
99
- // The height of a truncated card is 1px higher than that of a non-truncated card, so we subtract 1px from the line height.
100
- lineHeight: `${lineHeight - 1}px`,
101
- display: '-webkit-inline-box',
102
- WebkitLineClamp: 1,
103
- WebkitBoxOrient: 'vertical',
104
- // We need to remove the padding because display: -webkit-inline-box will cause any padding to be
105
- // added to the total height, causing truncated cards to have greater height than non-truncated cards which use display: inline.
106
- padding: 0,
107
- '@supports not (-webkit-line-clamp: 1)': {
108
- display: 'inline-block',
109
- maxHeight: `${lineHeight}px`,
110
- // If the browser does not support webkit, we don't need to remove the padding
111
- padding: `${"var(--ds-space-025, 2px)"} 0px`
112
- }
113
- };
114
- const isTruncated = ({
115
- truncateInline
116
- }) => {
117
- if (truncateInline) {
118
- return truncateStyles;
119
- }
120
- return undefined;
121
- };
122
-
123
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
124
- export const WrapperAnchor = styled.a(props => ({
125
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
126
- ...baseWrapperStyles(props),
127
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
128
- ...isInteractive(props),
129
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
130
- ...isTruncated(props)
131
- }));
132
- WrapperAnchor.displayName = 'WrapperAnchor';
39
+ const baseWrapperStyles = null;
133
40
 
134
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
135
- export const WrapperSpan = styled.span(props => ({
136
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
137
- ...baseWrapperStyles(props),
138
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
139
- ...isTruncated(props)
140
- }));
141
- WrapperSpan.displayName = 'WrapperSpan';
41
+ // if the parent instruct the wrapper to be interactive, and the wrapper is in focus, apply selectedStyles
42
+ const interactiveStyles = null;
43
+ const hoveredStyles = null;
44
+ const hoveredWithBackgroundStyles = null;
45
+ const withoutBackgroundStyles = null;
46
+ const withBackgroundStyles = null;
47
+ const truncateStyles = null;
48
+ const notSelectedStyle = null;
49
+ const selectedStyles = null;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
+ import styled from '@emotion/styled';
5
+ import { SpanSkeleton } from '@atlaskit/linking-common';
6
+ // TODO: Figure out a more scalable/responsive solution
7
+ // for vertical alignment.
8
+ // Current rationale: vertically positioned at the top of
9
+ // the smart card container (when set to 0). Offset this
10
+ // to position it with appropriate whitespace from the top.
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
12
+ export const Icon = styled.img({
13
+ height: '16px',
14
+ width: '16px',
15
+ marginRight: "var(--ds-space-050, 4px)",
16
+ borderRadius: '2px',
17
+ userSelect: 'none',
18
+ position: 'absolute',
19
+ top: '50%',
20
+ left: '50%',
21
+ transform: 'translate(-50%, -50%)'
22
+ });
23
+
24
+ // Used for 'untrue' icons which claim to be 16x16 but
25
+ // are less than that in height/width.
26
+ // TODO: Replace this override with proper AtlasKit solution.
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
28
+ export const AKIconWrapper = styled.span({
29
+ marginRight: "var(--ds-space-negative-025, -2px)"
30
+ });
31
+ export const Shimmer = ({
32
+ testId
33
+ }) => {
34
+ const skeletonCustomStyles = {
35
+ position: 'absolute',
36
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
37
+ top: '50%',
38
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
39
+ left: '50%',
40
+ transform: 'translate(-50%, -50%)',
41
+ marginRight: "var(--ds-space-050, 4px)"
42
+ };
43
+ return /*#__PURE__*/React.createElement(SpanSkeleton, {
44
+ width: 16,
45
+ height: 16,
46
+ borderRadius: 2,
47
+ testId: testId
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
49
+ ,
50
+ style: skeletonCustomStyles
51
+ });
52
+ };
@@ -0,0 +1,10 @@
1
+
2
+ ._2rkoyh40{border-radius:2px}._154i1ssb{top:50%}
3
+ ._1bsb7vkz{width:1pc}
4
+ ._1ltv1ssb{left:50%}
5
+ ._2hwx1b66{margin-right:var(--ds-space-050,4px)}
6
+ ._2hwx1i6y{margin-right:var(--ds-space-negative-025,-2px)}
7
+ ._4t3i7vkz{height:1pc}
8
+ ._kqswstnw{position:absolute}
9
+ ._t9ec1ooe{transform:translate(-50%,-50%)}
10
+ ._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}
@@ -1,7 +1,9 @@
1
+ /* Icon.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./Icon.compiled.css";
4
+ import { forwardRef } from 'react';
5
+ import { ax, ix } from "@compiled/react/runtime";
1
6
  import React from 'react';
2
-
3
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
- import styled from '@emotion/styled';
5
7
  import { SpanSkeleton } from '@atlaskit/linking-common';
6
8
  // TODO: Figure out a more scalable/responsive solution
7
9
  // for vertical alignment.
@@ -9,25 +11,39 @@ import { SpanSkeleton } from '@atlaskit/linking-common';
9
11
  // the smart card container (when set to 0). Offset this
10
12
  // to position it with appropriate whitespace from the top.
11
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
12
- export const Icon = styled.img({
13
- height: '16px',
14
- width: '16px',
15
- marginRight: "var(--ds-space-050, 4px)",
16
- borderRadius: '2px',
17
- userSelect: 'none',
18
- position: 'absolute',
19
- top: '50%',
20
- left: '50%',
21
- transform: 'translate(-50%, -50%)'
14
+ export const Icon = forwardRef(({
15
+ as: C = "img",
16
+ style: __cmpls,
17
+ ...__cmplp
18
+ }, __cmplr) => {
19
+ return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
20
+ style: __cmpls,
21
+ ref: __cmplr,
22
+ className: ax(["_2rkoyh40 _4t3i7vkz _1bsb7vkz _2hwx1b66 _uiztglyw _kqswstnw _154i1ssb _1ltv1ssb _t9ec1ooe", __cmplp.className])
23
+ }));
22
24
  });
23
25
 
24
26
  // Used for 'untrue' icons which claim to be 16x16 but
25
27
  // are less than that in height/width.
26
28
  // TODO: Replace this override with proper AtlasKit solution.
27
29
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
28
- export const AKIconWrapper = styled.span({
29
- marginRight: "var(--ds-space-negative-025, -2px)"
30
+ if (process.env.NODE_ENV !== 'production') {
31
+ Icon.displayName = 'Icon';
32
+ }
33
+ export const AKIconWrapper = forwardRef(({
34
+ as: C = "span",
35
+ style: __cmpls,
36
+ ...__cmplp
37
+ }, __cmplr) => {
38
+ return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
39
+ style: __cmpls,
40
+ ref: __cmplr,
41
+ className: ax(["_2hwx1i6y", __cmplp.className])
42
+ }));
30
43
  });
44
+ if (process.env.NODE_ENV !== 'production') {
45
+ AKIconWrapper.displayName = 'AKIconWrapper';
46
+ }
31
47
  export const Shimmer = ({
32
48
  testId
33
49
  }) => {
@@ -0,0 +1,6 @@
1
+ ._18u01b66{margin-left:var(--ds-space-050,4px)}
2
+ ._syaz1wmz{color:var(--ds-text-subtlest,#6b778c)}
3
+ ._syaz1y58{color:var(--ds-link,#0052cc)}
4
+ ._1bnxglyw:hover{text-decoration-line:none}
5
+ ._9oik18uv:hover{text-decoration-color:initial}
6
+ ._jf4cnqa1:hover{text-decoration-style:solid}
@@ -1,10 +1,49 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
1
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _extends from "@babel/runtime/helpers/extends";
4
+ import "./index.compiled.css";
5
+ import { forwardRef } from 'react';
6
+ import { ax, ix } from "@compiled/react/runtime";
2
7
  import React from 'react';
3
8
  import ImageLoader from 'react-render-image';
4
9
  import LinkIcon from '@atlaskit/icon/core/migration/link';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { B400, N200 } from '@atlaskit/theme/colors';
5
12
  import { Icon, Shimmer } from '../Icon';
6
- import { LinkAppearance, NoLinkAppearance } from '../styled';
13
+ import { LinkAppearance as LinkAppearanceOld, NoLinkAppearance as NoLinkAppearanceOld } from '../styled-emotion';
7
14
  import { EmojiWrapper, IconEmptyWrapper, IconPositionWrapper, IconTitleWrapper, IconWrapper, TitleWrapper, TitleWrapperClassName } from './styled';
15
+ import { EmojiWrapper as EmojiWrapperOld, IconEmptyWrapper as IconEmptyWrapperOld, IconPositionWrapper as IconPositionWrapperOld, IconTitleWrapper as IconTitleWrapperOld, IconWrapper as IconWrapperOld, TitleWrapper as TitleWrapperOld } from './styled-emotion';
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- Ignored via go/DSP-18766
17
+ const NoLinkAppearance = forwardRef(({
18
+ as: C = "span",
19
+ style: __cmpls,
20
+ ...__cmplp
21
+ }, __cmplr) => {
22
+ return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
23
+ style: __cmpls,
24
+ ref: __cmplr,
25
+ className: ax(["_syaz1wmz _18u01b66", __cmplp.className])
26
+ }));
27
+ });
28
+
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- Ignored via go/DSP-18766
30
+ if (process.env.NODE_ENV !== 'production') {
31
+ NoLinkAppearance.displayName = 'NoLinkAppearance';
32
+ }
33
+ const LinkAppearance = forwardRef(({
34
+ as: C = "a",
35
+ style: __cmpls,
36
+ ...__cmplp
37
+ }, __cmplr) => {
38
+ return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
39
+ style: __cmpls,
40
+ ref: __cmplr,
41
+ className: ax(["_syaz1y58 _9oik18uv _1bnxglyw _jf4cnqa1", __cmplp.className])
42
+ }));
43
+ });
44
+ if (process.env.NODE_ENV !== 'production') {
45
+ LinkAppearance.displayName = 'LinkAppearance';
46
+ }
8
47
  export class IconAndTitleLayout extends React.Component {
9
48
  constructor(...args) {
10
49
  super(...args);
@@ -38,12 +77,12 @@ export class IconAndTitleLayout extends React.Component {
38
77
  emoji
39
78
  } = this.props;
40
79
  if (emoji) {
41
- return /*#__PURE__*/React.createElement(EmojiWrapper, null, emoji);
80
+ return fg('bandicoots-compiled-migration-smartcard') ? /*#__PURE__*/React.createElement(EmojiWrapper, null, emoji) : /*#__PURE__*/React.createElement(EmojiWrapperOld, null, emoji);
42
81
  }
43
82
  if (!icon || typeof icon === 'string') {
44
83
  return null;
45
84
  }
46
- return /*#__PURE__*/React.createElement(IconWrapper, null, icon);
85
+ return fg('bandicoots-compiled-migration-smartcard') ? /*#__PURE__*/React.createElement(IconWrapper, null, icon) : /*#__PURE__*/React.createElement(IconWrapperOld, null, icon);
47
86
  }
48
87
  renderImageIcon(errored, testId) {
49
88
  const {
@@ -104,12 +143,25 @@ export class IconAndTitleLayout extends React.Component {
104
143
  rightSide,
105
144
  testId = 'inline-card-icon-and-title'
106
145
  } = this.props;
107
- const titlePart = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, {
146
+ const titlePart = fg('bandicoots-compiled-migration-smartcard') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapper, {
108
147
  "data-testid": "icon-position-wrapper"
109
148
  }, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapper, {
110
149
  "data-testid": "icon-empty-wrapper"
111
150
  }), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapper
112
151
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
152
+ , {
153
+ style: {
154
+ color: titleTextColor
155
+ }
156
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
157
+ ,
158
+ className: TitleWrapperClassName
159
+ }, title)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconPositionWrapperOld, {
160
+ "data-testid": "icon-position-wrapper"
161
+ }, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconEmptyWrapperOld, {
162
+ "data-testid": "icon-empty-wrapper"
163
+ }), this.renderIcon(testId))), /*#__PURE__*/React.createElement(TitleWrapperOld
164
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
113
165
  , {
114
166
  style: {
115
167
  color: titleTextColor
@@ -118,20 +170,37 @@ export class IconAndTitleLayout extends React.Component {
118
170
  ,
119
171
  className: TitleWrapperClassName
120
172
  }, title));
121
- return (
122
- /*#__PURE__*/
123
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
124
- React.createElement(IconTitleWrapper, {
125
- style: {
126
- color: titleColor
127
- },
128
- "data-testid": testId
129
- }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
130
- href: link,
131
- onClick: this.handleClick,
132
- onKeyPress: this.handleKeyPress
133
- }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null)
134
- );
173
+ if (fg('bandicoots-compiled-migration-smartcard')) {
174
+ return (
175
+ /*#__PURE__*/
176
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
177
+ React.createElement(IconTitleWrapper, {
178
+ style: {
179
+ color: titleColor
180
+ },
181
+ "data-testid": testId
182
+ }, link ? /*#__PURE__*/React.createElement(LinkAppearance, {
183
+ href: link,
184
+ onClick: this.handleClick,
185
+ onKeyPress: this.handleKeyPress
186
+ }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearance, null, rightSide) : null)
187
+ );
188
+ } else {
189
+ return (
190
+ /*#__PURE__*/
191
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
192
+ React.createElement(IconTitleWrapperOld, {
193
+ style: {
194
+ color: titleColor
195
+ },
196
+ "data-testid": testId
197
+ }, link ? /*#__PURE__*/React.createElement(LinkAppearanceOld, {
198
+ href: link,
199
+ onClick: this.handleClick,
200
+ onKeyPress: this.handleKeyPress
201
+ }, titlePart) : titlePart, rightSide ? /*#__PURE__*/React.createElement(NoLinkAppearanceOld, null, rightSide) : null)
202
+ );
203
+ }
135
204
  }
136
205
  }
137
206
  _defineProperty(IconAndTitleLayout, "defaultProps", {
@@ -0,0 +1,114 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
+ import styled from '@emotion/styled';
3
+ // Wraps all icons represented in Inline Links. Icons have three sources/types:
4
+ // - JSON-LD: from the generator.icon property coming back from ORS.
5
+ // - @atlaskit/icon: for lock icons, unauthorized, etc.
6
+ // - @atlaskit/icon-object: for object icons, e.g. repository, branch, etc.
7
+ // NB: the first set of overrides style icons imported from @atlaskit/icon-object correctly.
8
+ // NB: the second set of overrides style icons imported from @atlaskit/icon correctly.
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
10
+
11
+ // TODO: remove this override behaviour for @atlaskit/icon-object
12
+ export const IconObjectOverrides = `
13
+ & > span {
14
+ height: 16px;
15
+ width: 16px;
16
+ position: absolute;
17
+ top: 3px;
18
+ left: 0;
19
+ & > svg {
20
+ position: absolute;
21
+ top: 50%;
22
+ left: 50%;
23
+ transform: translate(-50%, -50%);
24
+ }
25
+ }
26
+ `;
27
+
28
+ // TODO: remove this override behaviour for @atlaskit/icon
29
+ export const IconOverrides = `
30
+ & > * > span {
31
+ height: 16px;
32
+ width: 16px;
33
+ position: absolute;
34
+ left: 0;
35
+ & > svg {
36
+ position: absolute;
37
+ top: 50%;
38
+ left: 50%;
39
+ transform: translate(-50%, -50%);
40
+ }
41
+ }
42
+ `;
43
+
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
45
+ export const IconWrapper = styled.span({
46
+ userSelect: 'none'
47
+ },
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
49
+ IconOverrides,
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
51
+ IconObjectOverrides);
52
+
53
+ // Wraps all emoji in Inline Links similar to icon
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
55
+ export const EmojiWrapper = styled.span({
56
+ display: 'inline-block',
57
+ marginRight: "var(--ds-space-025, 2px)",
58
+ userSelect: 'none'
59
+ },
60
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
61
+ IconOverrides,
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
63
+ IconObjectOverrides);
64
+
65
+ // The main 'wrapping' element, title of the content.
66
+ // NB: `white-space` adds little whitespace before wrapping.
67
+ // NB: `word-break` line breaks as soon as an overflow takes place.
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
69
+ export const IconTitleWrapper = styled.span({
70
+ whiteSpace: 'pre-wrap',
71
+ wordBreak: 'break-all',
72
+ boxDecorationBreak: 'clone',
73
+ padding: `${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"}`
74
+ });
75
+
76
+ // TODO: Replace overrides with proper AtlasKit solution.
77
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
78
+ export const LozengeWrapper = styled.span({
79
+ display: 'inline-block',
80
+ verticalAlign: '1px',
81
+ margin: `0 ${"var(--ds-space-050, 4px)"} 0 ${"var(--ds-space-025, 2px)"}`
82
+ });
83
+
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
85
+ export const RightIconPositionWrapper = styled.span({
86
+ marginLeft: "var(--ds-space-025, 2px)",
87
+ position: 'relative',
88
+ display: 'inline-block'
89
+ });
90
+
91
+ // The following components are used to absolutely position icons in the vertical center.
92
+ // - IconPositionWrapper: the `relative` parent which has no height in itself.
93
+ // - IconEmptyWrapper: the child which forces `IconPositionWrapper` to have a height.
94
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
95
+ export const IconPositionWrapper = styled.span({
96
+ marginRight: "var(--ds-space-050, 4px)",
97
+ position: 'relative',
98
+ display: 'inline-block'
99
+ });
100
+
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
102
+ export const IconEmptyWrapper = styled.span({
103
+ width: '16px',
104
+ height: '100%',
105
+ display: 'inline-block',
106
+ opacity: 0
107
+ });
108
+
109
+ // With emotion it's not possible to use reference to `TitleWrapper` as part of a selector,
110
+ // To achieve same result we use classname instead.
111
+ export const TitleWrapperClassName = 'smart-link-title-wrapper';
112
+
113
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-empty-styled-expression -- Ignored via go/DSP-18766
114
+ export const TitleWrapper = styled.span({});
@@ -0,0 +1,36 @@
1
+ ._15x0stnw>*>span>svg{position:absolute}
2
+ ._16d9qvcn{-webkit-box-decoration-break:clone;box-decoration-break:clone}
3
+ ._17047vkz>*>span{height:1pc}
4
+ ._18lx1ooe>span>svg{transform:translate(-50%,-50%)}
5
+ ._18u0v77o{margin-left:var(--ds-space-025,2px)}
6
+ ._19bv1b66{padding-left:var(--ds-space-050,4px)}
7
+ ._19pkidpf{margin-top:0}
8
+ ._1bsb7vkz{width:1pc}
9
+ ._1e0c1o8l{display:inline-block}
10
+ ._1f027vkz>span{height:1pc}
11
+ ._1fqgstnw>span>svg{position:absolute}
12
+ ._1gx11ssb>span>svg{left:50%}
13
+ ._1nmz9jpi{word-break:break-all}
14
+ ._1tr81ssb>*>span>svg{left:50%}
15
+ ._1yg7idpf>*>span{left:0}
16
+ ._2hwx1b66{margin-right:var(--ds-space-050,4px)}
17
+ ._2hwxv77o{margin-right:var(--ds-space-025,2px)}
18
+ ._3g5ridpf>span{left:0}
19
+ ._4d7tstnw>span{position:absolute}
20
+ ._4t3i1osq{height:100%}
21
+ ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
22
+ ._d1gw1ssb>span>svg{top:50%}
23
+ ._iibf7vkz>*>span{width:1pc}
24
+ ._k9fw1ssb>*>span>svg{top:50%}
25
+ ._kqswh2mm{position:relative}
26
+ ._lacastnw>*>span{position:absolute}
27
+ ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
28
+ ._nbgx7vkz>span{width:1pc}
29
+ ._o5721jtm{white-space:pre-wrap}
30
+ ._o5fv1l7b>span{top:3px}
31
+ ._otyridpf{margin-bottom:0}
32
+ ._q3v31ooe>*>span>svg{transform:translate(-50%,-50%)}
33
+ ._s7n4t94y{vertical-align:1px}
34
+ ._tzy4idpf{opacity:0}
35
+ ._u5f31b66{padding-right:var(--ds-space-050,4px)}
36
+ ._uiztglyw{-webkit-user-select:none;-ms-user-select:none;user-select:none}