playbook_ui 14.17.0.pre.alpha.play1499backgroundkitoverlay7105 → 14.17.0.pre.alpha.play1906overlaykitaddopacityandgradient7201
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_background/_background.scss +0 -26
- data/app/pb_kits/playbook/pb_background/_background.tsx +4 -8
- data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +43 -20
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +102 -105
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +50 -48
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +110 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -6
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +68 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -3
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +49 -22
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +15 -4
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +4 -2
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +39 -1
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +19 -7
- data/dist/chunks/{_typeahead-ySWHB-7p.js → _typeahead-HqfDnjRe.js} +1 -1
- data/dist/chunks/{_weekday_stacked-36N8xzXL.js → _weekday_stacked--YupDiur.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +18 -18
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +0 -36
- data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +0 -1
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcbb7de57b1795b09a1e17be0796d035b2d81369c91fb4f41f8305356ae9ecb9
|
4
|
+
data.tar.gz: 2ad249de4b7102825375229b1785b79bfaf59c28c433fed5f8085b7c9d1ff4f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a308beba3d438ade5305948c24395ebc76ecee41870c11966e9e4dadcdccb96898909334a34e51a3e07e1f71cb75158e9c228cc13dc5c80e774d1c9f1b817ff
|
7
|
+
data.tar.gz: b706011d94f16779786e69b56136ea18806acd9d74198e5ebbcae38506ebbce822b70ee35c406ce282b7c845d9157c3b38ded9c68883e0cf827b2304bf471916
|
@@ -55,30 +55,4 @@ $background_colors: map-merge($additional_colors, $merge_kits7);
|
|
55
55
|
transition: 700ms ease-in;
|
56
56
|
}
|
57
57
|
}
|
58
|
-
|
59
|
-
&.imageoverlay {
|
60
|
-
position: relative;
|
61
|
-
|
62
|
-
&:before {
|
63
|
-
content: "";
|
64
|
-
position: absolute;
|
65
|
-
top: 0;
|
66
|
-
left: 0;
|
67
|
-
right: 0;
|
68
|
-
bottom: 0;
|
69
|
-
z-index: 1;
|
70
|
-
background-color: inherit;
|
71
|
-
}
|
72
|
-
|
73
|
-
* {
|
74
|
-
position: relative;
|
75
|
-
z-index: 2;
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
@each $key, $value in $opacity {
|
80
|
-
&.imageoverlay[imageoverlay="#{$key}"]::before {
|
81
|
-
opacity: $value;
|
82
|
-
}
|
83
|
-
}
|
84
58
|
}
|
@@ -25,7 +25,6 @@ type BackgroundProps = {
|
|
25
25
|
backgroundPosition?: ResponsiveProp<string> | string,
|
26
26
|
backgroundRepeat?: ResponsiveProp<BackgroundRepeat> | BackgroundRepeat,
|
27
27
|
imageUrl?: ResponsiveProp<string> | string,
|
28
|
-
imageOverlay?: 'opacity_1' | 'opacity_2' | 'opacity_3' | 'opacity_4' | 'opacity_5' | 'opacity_6' | 'opacity_7' | 'opacity_8' | 'opacity_9' | 'opacity_10',
|
29
28
|
children?: React.ReactChild[] | React.ReactNode,
|
30
29
|
className?: string,
|
31
30
|
customColor?: string,
|
@@ -87,9 +86,8 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
87
86
|
imageUrl = '',
|
88
87
|
tag = 'div',
|
89
88
|
transition = '',
|
90
|
-
imageOverlay,
|
91
89
|
} = props
|
92
|
-
|
90
|
+
|
93
91
|
const [responsiveProps, setResponsiveProps] = useState({
|
94
92
|
backgroundSize: getResponsiveValue(backgroundSize),
|
95
93
|
backgroundPosition: getResponsiveValue(backgroundPosition),
|
@@ -134,8 +132,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
134
132
|
[`pb_background_color_${resBackgroundColor}`]: resBackgroundColor && !customColor,
|
135
133
|
[`pb_background_custom_color`]: !!customColor,
|
136
134
|
},
|
137
|
-
className
|
138
|
-
imageOverlay ? "imageoverlay" : ""
|
135
|
+
className
|
139
136
|
);
|
140
137
|
|
141
138
|
const backgroundStyle = {
|
@@ -158,7 +155,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
158
155
|
const ariaProps = buildAriaProps(aria);
|
159
156
|
const dataProps = buildDataProps(data);
|
160
157
|
const htmlProps = buildHtmlProps(htmlOptions);
|
161
|
-
|
158
|
+
|
162
159
|
return (
|
163
160
|
<Tag
|
164
161
|
{...ariaProps}
|
@@ -167,12 +164,11 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
167
164
|
alt={alt}
|
168
165
|
className={classes}
|
169
166
|
id={id}
|
170
|
-
imageOverlay={imageOverlay}
|
171
167
|
style={combinedStyles}
|
172
168
|
>
|
173
169
|
{children}
|
174
170
|
</Tag>
|
175
|
-
|
171
|
+
|
176
172
|
)
|
177
173
|
}
|
178
174
|
|
@@ -6,4 +6,3 @@ export { default as BackgroundStatus } from './_background_status.jsx'
|
|
6
6
|
export { default as BackgroundStatusSubtle } from './_background_status_subtle.jsx'
|
7
7
|
export { default as BackgroundCategory } from './_background_category.jsx'
|
8
8
|
export { default as BackgroundSize } from './_background_size.jsx'
|
9
|
-
export { default as BackgroundOverlay } from './_background_overlay.jsx'
|
@@ -1,5 +1,6 @@
|
|
1
1
|
@import "../tokens/colors";
|
2
2
|
@import "../tokens/opacity";
|
3
|
+
@import "../tokens/border_radius";
|
3
4
|
|
4
5
|
.pb_draggable_container {
|
5
6
|
.pb_draggable_item {
|
@@ -34,7 +35,7 @@
|
|
34
35
|
width: 100%;
|
35
36
|
height: 100%;
|
36
37
|
border: 2px dashed $neutral;
|
37
|
-
border-radius: $
|
38
|
+
border-radius: $border_radius_sm;
|
38
39
|
box-sizing: border-box;
|
39
40
|
z-index: 10;
|
40
41
|
pointer-events: none;
|
@@ -64,7 +65,7 @@
|
|
64
65
|
width: 100%;
|
65
66
|
height: 100%;
|
66
67
|
background-color: rgba($neutral, $opacity_5);
|
67
|
-
border-radius: $
|
68
|
+
border-radius: $border_radius_sm;
|
68
69
|
z-index: 10;
|
69
70
|
pointer-events: none;
|
70
71
|
}
|
@@ -73,48 +74,70 @@
|
|
73
74
|
&.drop_zone_color_primary::before { background-color: rgba($primary, $opacity_5); }
|
74
75
|
&.drop_zone_color_purple::before { background-color: rgba($purple, $opacity_5); }
|
75
76
|
}
|
76
|
-
|
77
|
-
|
77
|
+
}
|
78
|
+
}
|
79
|
+
// Line default - Vertical orientation (horizontal line for draggable items in vertical layout)
|
80
|
+
&.line_vertical {
|
81
|
+
.pb_draggable_item {
|
82
|
+
position: relative;
|
78
83
|
&.drop_zone_line {
|
79
|
-
// Hide the original content to show the line
|
84
|
+
// Hide the original content to show the line only (held draggable item should not take up space in drop zone)
|
85
|
+
position: relative;
|
86
|
+
z-index: 2;
|
80
87
|
& > * {
|
81
88
|
opacity: 0;
|
82
89
|
}
|
83
|
-
|
90
|
+
height: 4px;
|
84
91
|
// Style for horizontal line (default)
|
85
92
|
&::before {
|
86
93
|
content: '';
|
87
94
|
position: absolute;
|
88
95
|
left: 0;
|
89
96
|
top: 0;
|
90
|
-
width:
|
91
|
-
height:
|
97
|
+
width: 100%;
|
98
|
+
height: 4px;
|
92
99
|
background-color: $neutral;
|
93
|
-
border-radius:
|
100
|
+
border-radius: $border_radius_rounded;
|
94
101
|
z-index: 10;
|
95
102
|
pointer-events: none;
|
103
|
+
transform: translateY(-50%);
|
96
104
|
}
|
97
|
-
|
98
|
-
// Apply color variants
|
105
|
+
// Apply color variants to the ::before element
|
99
106
|
&.drop_zone_color_primary::before { background-color: $primary; }
|
100
107
|
&.drop_zone_color_purple::before { background-color: $purple; }
|
101
108
|
}
|
102
109
|
}
|
103
110
|
}
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
.pb_draggable_item {
|
109
|
-
&.is_dragging {
|
110
|
-
// Line variant for vertical layouts (horizontal line)
|
111
|
+
// Line variant - Horizontal orientation (vertical line for draggable items in horizontal layout)
|
112
|
+
&.line_horizontal {
|
113
|
+
.pb_draggable_item {
|
114
|
+
position: relative;
|
111
115
|
&.drop_zone_line {
|
116
|
+
position: relative;
|
117
|
+
z-index: 2;
|
118
|
+
& > * {
|
119
|
+
opacity: 0;
|
120
|
+
}
|
121
|
+
width: 4px;
|
122
|
+
height: auto;
|
123
|
+
// Style for vertical line
|
112
124
|
&::before {
|
113
|
-
|
114
|
-
|
125
|
+
content: '';
|
126
|
+
position: absolute;
|
115
127
|
left: 0;
|
116
128
|
top: 0;
|
129
|
+
width: 4px;
|
130
|
+
height: 100%;
|
131
|
+
background-color: $neutral;
|
132
|
+
border-radius: $border_radius_rounded;
|
133
|
+
z-index: 10;
|
134
|
+
pointer-events: none;
|
135
|
+
transform: translateX(-50%);
|
117
136
|
}
|
137
|
+
|
138
|
+
// Apply color variants to the ::before element
|
139
|
+
&.drop_zone_color_primary::before { background-color: $primary; }
|
140
|
+
&.drop_zone_color_purple::before { background-color: $purple; }
|
118
141
|
}
|
119
142
|
}
|
120
143
|
}
|
@@ -60,123 +60,120 @@ const DraggableDropZones = (props) => {
|
|
60
60
|
|
61
61
|
return (
|
62
62
|
<>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
marginBottom="xs"
|
74
|
-
textAlign="center"
|
75
|
-
>
|
76
|
-
{"Shadow"}
|
77
|
-
</Caption>
|
78
|
-
<Draggable.Container
|
79
|
-
htmlOptions={{style:{ width: "200px"}}}
|
80
|
-
{...props}
|
81
|
-
>
|
82
|
-
{initialShadowState.map(({ id, text }) => (
|
83
|
-
<Card dragId={id}
|
84
|
-
draggableItem
|
85
|
-
key={id}
|
63
|
+
<Flex justify="between"
|
64
|
+
{...props}
|
65
|
+
>
|
66
|
+
<FlexItem marginRight="xl">
|
67
|
+
<DraggableProvider
|
68
|
+
dropZone={{type: "shadow"}}
|
69
|
+
initialItems={dataShadow}
|
70
|
+
onReorder={(items) => setInitialShadowState(items)}
|
71
|
+
>
|
72
|
+
<Caption
|
86
73
|
marginBottom="xs"
|
87
|
-
|
74
|
+
text="Shadow"
|
75
|
+
textAlign="center"
|
76
|
+
/>
|
77
|
+
<Draggable.Container
|
78
|
+
htmlOptions={{style:{ width: "200px"}}}
|
88
79
|
{...props}
|
89
80
|
>
|
90
|
-
|
91
|
-
|
81
|
+
{initialShadowState.map(({ id, text }) => (
|
82
|
+
<Card dragId={id}
|
83
|
+
draggableItem
|
84
|
+
key={id}
|
85
|
+
marginBottom="xs"
|
86
|
+
padding="xs"
|
87
|
+
{...props}
|
92
88
|
>
|
93
|
-
<
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
{"Outline"}
|
114
|
-
</Caption>
|
115
|
-
<Draggable.Container
|
116
|
-
htmlOptions={{style:{ width: "200px"}}}
|
117
|
-
{...props}
|
118
|
-
>
|
119
|
-
{initialOutlineState.map(({ id, text }) => (
|
120
|
-
<Card
|
121
|
-
dragId={id}
|
122
|
-
draggableItem
|
123
|
-
key={id}
|
89
|
+
<Flex alignItems="stretch"
|
90
|
+
flexDirection="column"
|
91
|
+
>
|
92
|
+
<Body
|
93
|
+
text={text}
|
94
|
+
{...props}
|
95
|
+
/>
|
96
|
+
</Flex>
|
97
|
+
</Card>
|
98
|
+
))}
|
99
|
+
</Draggable.Container>
|
100
|
+
</DraggableProvider>
|
101
|
+
</FlexItem>
|
102
|
+
<FlexItem marginRight="xl">
|
103
|
+
<DraggableProvider
|
104
|
+
dropZone={{type: "outline"}}
|
105
|
+
initialItems={dataOutline}
|
106
|
+
onReorder={(items) => setInitialOutlineState(items)}
|
107
|
+
>
|
108
|
+
<Caption
|
124
109
|
marginBottom="xs"
|
125
|
-
|
110
|
+
text="Outline"
|
111
|
+
textAlign="center"
|
112
|
+
/>
|
113
|
+
<Draggable.Container
|
114
|
+
htmlOptions={{style:{ width: "200px"}}}
|
126
115
|
{...props}
|
127
116
|
>
|
128
|
-
|
129
|
-
|
130
|
-
|
117
|
+
{initialOutlineState.map(({ id, text }) => (
|
118
|
+
<Card
|
119
|
+
dragId={id}
|
120
|
+
draggableItem
|
121
|
+
key={id}
|
122
|
+
marginBottom="xs"
|
123
|
+
padding="xs"
|
124
|
+
{...props}
|
131
125
|
>
|
132
|
-
<
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
</Caption>
|
154
|
-
<Draggable.Container
|
155
|
-
htmlOptions={{style:{ width: "200px"}}}
|
156
|
-
{...props}
|
157
|
-
>
|
158
|
-
{initialLineState.map(({ id, text }) => (
|
159
|
-
<Card dragId={id}
|
160
|
-
draggableItem
|
161
|
-
key={id}
|
126
|
+
<Flex
|
127
|
+
alignItems="stretch"
|
128
|
+
flexDirection="column"
|
129
|
+
>
|
130
|
+
<Body
|
131
|
+
text={text}
|
132
|
+
{...props}
|
133
|
+
/>
|
134
|
+
</Flex>
|
135
|
+
</Card>
|
136
|
+
))}
|
137
|
+
</Draggable.Container>
|
138
|
+
</DraggableProvider>
|
139
|
+
</FlexItem>
|
140
|
+
<FlexItem>
|
141
|
+
<DraggableProvider
|
142
|
+
dropZone={{type: "line"}}
|
143
|
+
initialItems={dataLine}
|
144
|
+
onReorder={(items) => setInitialLineState(items)}
|
145
|
+
>
|
146
|
+
<Caption
|
162
147
|
marginBottom="xs"
|
163
|
-
|
148
|
+
text="Line"
|
149
|
+
textAlign="center"
|
150
|
+
/>
|
151
|
+
<Draggable.Container
|
152
|
+
htmlOptions={{style:{ width: "200px"}}}
|
164
153
|
{...props}
|
165
154
|
>
|
166
|
-
|
167
|
-
|
155
|
+
{initialLineState.map(({ id, text }) => (
|
156
|
+
<Card dragId={id}
|
157
|
+
draggableItem
|
158
|
+
key={id}
|
159
|
+
marginBottom="xs"
|
160
|
+
padding="xs"
|
161
|
+
{...props}
|
168
162
|
>
|
169
|
-
<
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
163
|
+
<Flex alignItems="stretch"
|
164
|
+
flexDirection="column"
|
165
|
+
>
|
166
|
+
<Body
|
167
|
+
text={text}
|
168
|
+
{...props}
|
169
|
+
/>
|
170
|
+
</Flex>
|
171
|
+
</Card>
|
172
|
+
))}
|
173
|
+
</Draggable.Container>
|
174
|
+
</DraggableProvider>
|
175
|
+
</FlexItem>
|
176
|
+
</Flex>
|
180
177
|
</>
|
181
178
|
);
|
182
179
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
The Draggable kit
|
1
|
+
The Draggable kit lets you customize the style of drop zones that appear when dragging an item.
|
2
2
|
|
3
|
-
By default,
|
3
|
+
By default, drop zones are in the "ghost" style, but you can also choose from "shadow," "outline," and "line."
|
4
4
|
|
5
|
-
|
5
|
+
When using the "line" type, make sure to set the appropriate `direction` attribute within the `dropZone` prop based on the orientation of your draggable view. By default, this is set to "vertical," but it can also be adjusted to "horizontal." Note that the direction attribute only applies to the "line" type and does not affect other drop zone styles. For more on the "line" style in particular, check out the [Draggable Drop Zones Line doc example](https://playbook.powerapp.cloud/kits/draggable/react#draggable-drop-zones-line).
|
@@ -6,6 +6,8 @@ import Caption from '../../pb_caption/_caption'
|
|
6
6
|
import Draggable from '../../pb_draggable/_draggable'
|
7
7
|
import { DraggableProvider } from '../../pb_draggable/context'
|
8
8
|
|
9
|
+
|
10
|
+
|
9
11
|
// Initial items to be dragged
|
10
12
|
const dataPrimary = [
|
11
13
|
{
|
@@ -42,54 +44,54 @@ const DraggableDropZonesColors = (props) => {
|
|
42
44
|
|
43
45
|
return (
|
44
46
|
<>
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
47
|
+
<Caption marginBottom="xs"
|
48
|
+
text="Primary"
|
49
|
+
/>
|
50
|
+
<DraggableProvider
|
51
|
+
dropZone={{type: "shadow", color: "primary"}}
|
52
|
+
initialItems={dataPrimary}
|
53
|
+
onReorder={(items) => setInitialPrimaryState(items)}
|
54
|
+
>
|
55
|
+
<Draggable.Container {...props}>
|
56
|
+
<Flex>
|
57
|
+
{initialPrimaryState.map(({ id, url }) => (
|
58
|
+
<Draggable.Item dragId={id}
|
59
|
+
key={id}
|
60
|
+
marginRight="sm"
|
61
|
+
>
|
62
|
+
<Image alt={id}
|
63
|
+
size="md"
|
64
|
+
url={url}
|
65
|
+
/>
|
66
|
+
</Draggable.Item>
|
67
|
+
))}
|
68
|
+
</Flex>
|
69
|
+
</Draggable.Container>
|
70
|
+
</DraggableProvider>
|
71
|
+
<Caption marginBottom="xs"
|
72
|
+
text="Purple"
|
73
|
+
/>
|
74
|
+
<DraggableProvider
|
75
|
+
dropZone={{type: "outline", color: "purple"}}
|
76
|
+
initialItems={dataPurple}
|
77
|
+
onReorder={(items) => setInitialPurpleState(items)}
|
78
|
+
>
|
79
|
+
<Draggable.Container {...props}>
|
80
|
+
<Flex>
|
81
|
+
{initialPurpleState.map(({ id, url }) => (
|
82
|
+
<Draggable.Item dragId={id}
|
83
|
+
key={id}
|
84
|
+
marginRight="sm"
|
85
|
+
>
|
86
|
+
<Image alt={id}
|
87
|
+
size="md"
|
88
|
+
url={url}
|
89
|
+
/>
|
90
|
+
</Draggable.Item>
|
91
|
+
))}
|
92
|
+
</Flex>
|
93
|
+
</Draggable.Container>
|
94
|
+
</DraggableProvider>
|
93
95
|
</>
|
94
96
|
);
|
95
97
|
};
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
The default `color` for Draggable kit drop zones is "neutral", with "primary" or "purple" as additional options. When `type` is set to "line", the default color is "primary" and "purple" is the only other option.
|