Skip to content

Commit 2e7595a

Browse files
AtlassianAFP Repo Bot
Atlassian
authored and
AFP Repo Bot
committed
Synchronise latest changes
1 parent 66f2cba commit 2e7595a

File tree

7 files changed

+41
-15
lines changed

7 files changed

+41
-15
lines changed

packages/documentation/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
3535
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
3636
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^2.0.0",
37-
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
37+
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.1.0",
3838
"@atlaskit/primitives": "^14.4.0",
3939
"@atlaskit/theme": "^18.0.0",
4040
"@atlaskit/tokens": "^4.7.0",

packages/react-drop-indicator/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @atlaskit/pragmatic-drag-and-drop-react-indicator
22

3+
## 3.1.0
4+
5+
### Minor Changes
6+
7+
- [#140214](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140214)
8+
[`6903fb239a6ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6903fb239a6ac) -
9+
Exposing a `<Border>` drop indicator component. Currently `Border` is not documented while we
10+
validate with internal usage.
11+
312
## 3.0.2
413

514
### Patch Changes

packages/react-drop-indicator/examples/outline.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Heading from '@atlaskit/heading';
1212
import { Box, Inline, Stack } from '@atlaskit/primitives/compiled';
1313
import { token } from '@atlaskit/tokens';
1414

15-
import Outline from '../src/internal/outline';
15+
import Border from '../src/internal/border';
1616
import { presetStrokeColors } from '../src/presets';
1717

1818
const targetStyles = css({
@@ -47,7 +47,7 @@ function Target(options: Partial<Options>) {
4747
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
4848
<div css={targetStyles} style={{ '--border-radius': borderRadius } as CSSProperties}>
4949
Target
50-
<Outline strokeColor={strokeColor} borderRadius={borderRadius} indent={indent} />
50+
<Border strokeColor={strokeColor} borderRadius={borderRadius} indent={indent} />
5151
</div>
5252
);
5353
}

packages/react-drop-indicator/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"description": "An optional Pragmatic drag and drop package containing react components that provide a visual indication about what the user will achieve when the drop (eg lines)",
55
"publishConfig": {
66
"registry": "https://registry.npmjs.org/"
@@ -34,6 +34,7 @@
3434
},
3535
"exports": {
3636
".": "./src/index.ts",
37+
"./border": "./src/border.tsx",
3738
"./box": "./src/box.tsx",
3839
"./types": "./src/types.ts",
3940
"./tree-item": "./src/tree-item.tsx"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
3+
import type { Appearance, CSSSize } from './internal-types';
4+
import { Border } from './internal/border';
5+
import { presetStrokeColors } from './presets';
6+
7+
export function DropIndicator({
8+
appearance = 'default',
9+
indent,
10+
}: {
11+
appearance?: Appearance;
12+
indent?: CSSSize;
13+
}) {
14+
return <Border strokeColor={presetStrokeColors[appearance]} indent={indent} />;
15+
}
16+
17+
// For React.lazy
18+
export default DropIndicator;

packages/react-drop-indicator/src/internal/outline.tsx renamed to packages/react-drop-indicator/src/internal/border.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ const styles = css({
2626
borderRadius: 'var(--border-radius)',
2727
});
2828

29-
// TODO: use `outline` or `border`?
30-
export function Outline({
29+
export function Border({
3130
strokeColor = presetStrokeColors.default,
3231
strokeWidth = presetStrokeWidth,
3332
borderRadius = '3px', // TODO: update to border.radius (4px) token
@@ -55,4 +54,4 @@ export function Outline({
5554
}
5655

5756
// For React.lazy
58-
export default Outline;
57+
export default Border;

packages/react-drop-indicator/src/tree-item.tsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import React, { type ReactElement } from 'react';
22

33
import type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
44

5-
import { Line } from './internal/line';
6-
import { Outline } from './internal/outline';
7-
import { presetStrokeColors } from './presets';
5+
import { DropIndicator as Border } from './border';
6+
import { DropIndicator as Line } from './box';
87

98
export type DropIndicatorProps = {
109
instruction: Instruction;
@@ -18,22 +17,22 @@ function getElement({
1817
isBlocked: boolean;
1918
}): ReactElement | null {
2019
const indent = `${instruction.currentLevel * instruction.indentPerLevel}px`;
21-
const strokeColor = presetStrokeColors[!isBlocked ? 'default' : 'warning'];
20+
const appearance = isBlocked ? 'warning' : 'default';
2221

2322
if (instruction.type === 'reorder-above') {
24-
return <Line edge="top" strokeColor={strokeColor} indent={indent} />;
23+
return <Line edge="top" appearance={appearance} indent={indent} />;
2524
}
2625
if (instruction.type === 'reorder-below') {
27-
return <Line edge="bottom" strokeColor={strokeColor} indent={indent} />;
26+
return <Line edge="bottom" appearance={appearance} indent={indent} />;
2827
}
2928

3029
if (instruction.type === 'make-child') {
31-
return <Outline strokeColor={strokeColor} indent={indent} />;
30+
return <Border appearance={appearance} indent={indent} />;
3231
}
3332

3433
if (instruction.type === 'reparent') {
3534
const reparentIndent = `${instruction.desiredLevel * instruction.indentPerLevel}px`;
36-
return <Line edge="bottom" strokeColor={strokeColor} indent={reparentIndent} />;
35+
return <Line edge="bottom" appearance={appearance} indent={reparentIndent} />;
3736
}
3837

3938
return null;

0 commit comments

Comments
 (0)