playbook_ui 14.17.0.pre.alpha.PBNTR935draggablelinedesign7118 → 14.17.0.pre.alpha.play1499backgroundkitoverlay7105

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_background/_background.scss +26 -0
  3. data/app/pb_kits/playbook/pb_background/_background.tsx +8 -4
  4. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +36 -0
  5. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
  6. data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
  7. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  8. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +20 -43
  9. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +105 -102
  10. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
  11. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +48 -50
  12. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
  13. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.jsx → _draggable_with_table_react.jsx} +1 -1
  14. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +1 -3
  15. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -9
  16. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -4
  17. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -68
  18. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +3 -4
  19. data/dist/chunks/{_typeahead-HqfDnjRe.js → _typeahead-ySWHB-7p.js} +1 -1
  20. data/dist/chunks/{_weekday_stacked-DVQITtQ9.js → _weekday_stacked-36N8xzXL.js} +1 -1
  21. data/dist/chunks/vendor.js +1 -1
  22. data/dist/playbook-doc.js +1 -1
  23. data/dist/playbook-rails-react-bindings.js +1 -1
  24. data/dist/playbook-rails.js +1 -1
  25. data/dist/playbook.css +1 -1
  26. data/lib/playbook/version.rb +1 -1
  27. metadata +18 -18
  28. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +0 -115
  29. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +0 -5
  30. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_react.md → _draggable_default.md} +0 -0
  31. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.html.erb → _draggable_default_rails.html.erb} +0 -0
  32. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_react.md → _draggable_multiple_containers.md} +0 -0
  33. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.html.erb → _draggable_multiple_containers_rails.html.erb} +0 -0
  34. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_react.md → _draggable_with_cards.md} +0 -0
  35. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.html.erb → _draggable_with_cards_rails.html.erb} +0 -0
  36. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_react.md → _draggable_with_list.md} +0 -0
  37. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.html.erb → _draggable_with_list_rails.html.erb} +0 -0
  38. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_react.md → _draggable_with_selectable_list.md} +0 -0
  39. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.html.erb → _draggable_with_selectable_list_rails.html.erb} +0 -0
  40. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_rails.md → _draggable_with_table.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee5a8f7236c5915641d49888d1b31358596a366e9e22a281b560dcaa31bb8936
4
- data.tar.gz: ad235c43f83f72d5d31a9a99e02d662cb7db5b5b5c270d9c1bbe3c9392e9d9ae
3
+ metadata.gz: b38daf6aad351a9d3b57169619dbba3749175bb2e2aae4f92aeb1368d8cd6cd5
4
+ data.tar.gz: 6718570cbc87905c88c57df0f1878cabd011e6ddac73d4c522c9ed88f08e537a
5
5
  SHA512:
6
- metadata.gz: 198ec85648866bcbcb816b91bc9a54e8ea126596c036bc5af0d8fb9ddad100b1cfca65a032a24cc65211f0679495cbbc5ab0f0708cf2751c9e75d1f19fac35bd
7
- data.tar.gz: 9ca8b30bda370751ff399531e4e22879a39beae908d79dedac31dfe5f30159aa501b1a3ed620d80f44e74d1c619ac1517e31c304d8583c9d86862a74a157ba99
6
+ metadata.gz: 8f1df4e4bcd4f2f0dac7285d99a80bd63c0b139db5256d2c8fe7754f78a573a811fa17fd3d8203eff2de08c576070c862add9cf92a3869a63bc178e87abd3a98
7
+ data.tar.gz: 2a0df11f026f0afe56e42a873105cd71756ea23d7e6bedec727954db2ff20fe7781142226f2415fe1f5d21d38a4c4e1c8fe286bf4a888e2d1f8089a7ba9ac2c7
@@ -55,4 +55,30 @@ $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
+ }
58
84
  }
@@ -25,6 +25,7 @@ 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',
28
29
  children?: React.ReactChild[] | React.ReactNode,
29
30
  className?: string,
30
31
  customColor?: string,
@@ -86,8 +87,9 @@ const Background = (props: BackgroundProps): React.ReactElement => {
86
87
  imageUrl = '',
87
88
  tag = 'div',
88
89
  transition = '',
90
+ imageOverlay,
89
91
  } = props
90
-
92
+
91
93
  const [responsiveProps, setResponsiveProps] = useState({
92
94
  backgroundSize: getResponsiveValue(backgroundSize),
93
95
  backgroundPosition: getResponsiveValue(backgroundPosition),
@@ -132,7 +134,8 @@ const Background = (props: BackgroundProps): React.ReactElement => {
132
134
  [`pb_background_color_${resBackgroundColor}`]: resBackgroundColor && !customColor,
133
135
  [`pb_background_custom_color`]: !!customColor,
134
136
  },
135
- className
137
+ className,
138
+ imageOverlay ? "imageoverlay" : ""
136
139
  );
137
140
 
138
141
  const backgroundStyle = {
@@ -155,7 +158,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
155
158
  const ariaProps = buildAriaProps(aria);
156
159
  const dataProps = buildDataProps(data);
157
160
  const htmlProps = buildHtmlProps(htmlOptions);
158
-
161
+
159
162
  return (
160
163
  <Tag
161
164
  {...ariaProps}
@@ -164,11 +167,12 @@ const Background = (props: BackgroundProps): React.ReactElement => {
164
167
  alt={alt}
165
168
  className={classes}
166
169
  id={id}
170
+ imageOverlay={imageOverlay}
167
171
  style={combinedStyles}
168
172
  >
169
173
  {children}
170
174
  </Tag>
171
-
175
+
172
176
  )
173
177
  }
174
178
 
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+ import Background from "../../pb_background/_background"
3
+ import Flex from "../../pb_flex/_flex"
4
+ import FlexItem from "../../pb_flex/_flex_item"
5
+ import Title from "../../pb_title/_title"
6
+
7
+ const BackgroundOverlay = (props) => {
8
+ return (
9
+ <Background
10
+ alt="colorful background"
11
+ className="background lazyload"
12
+ imageOverlay="opacity_6"
13
+ imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80"
14
+ {...props}
15
+ backgroundColor="light"
16
+ >
17
+ <Flex
18
+ orientation="column"
19
+ vertical="center"
20
+ {...props}
21
+ >
22
+ <FlexItem>
23
+ <Title
24
+ dark
25
+ padding="lg"
26
+ size={1}
27
+ text="Background Kit Image"
28
+ {...props}
29
+ />
30
+ </FlexItem>
31
+ </Flex>
32
+ </Background>
33
+ )
34
+ }
35
+
36
+ export default BackgroundOverlay
@@ -0,0 +1 @@
1
+ An overlay can be added to the background image by setting the `imageOverlay` prop and adding a `backgroundColor`. The `imageOverlay` prop can be set to any opacity ranging from `opacity_1` to `opacity_10`.
@@ -11,6 +11,7 @@ examples:
11
11
  - background_size: Size
12
12
 
13
13
  react:
14
+ - background_overlay: Overlay
14
15
  - background_light: Light
15
16
  - background_white: White
16
17
  - background_gradient: Gradient
@@ -6,3 +6,4 @@ 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,6 +1,5 @@
1
1
  @import "../tokens/colors";
2
2
  @import "../tokens/opacity";
3
- @import "../tokens/border_radius";
4
3
 
5
4
  .pb_draggable_container {
6
5
  .pb_draggable_item {
@@ -35,7 +34,7 @@
35
34
  width: 100%;
36
35
  height: 100%;
37
36
  border: 2px dashed $neutral;
38
- border-radius: $border_radius_sm;
37
+ border-radius: $border-radius-sm;
39
38
  box-sizing: border-box;
40
39
  z-index: 10;
41
40
  pointer-events: none;
@@ -65,7 +64,7 @@
65
64
  width: 100%;
66
65
  height: 100%;
67
66
  background-color: rgba($neutral, $opacity_5);
68
- border-radius: $border_radius_sm;
67
+ border-radius: $border-radius-sm;
69
68
  z-index: 10;
70
69
  pointer-events: none;
71
70
  }
@@ -74,70 +73,48 @@
74
73
  &.drop_zone_color_primary::before { background-color: rgba($primary, $opacity_5); }
75
74
  &.drop_zone_color_purple::before { background-color: rgba($purple, $opacity_5); }
76
75
  }
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;
76
+
77
+ // Line variant
83
78
  &.drop_zone_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;
79
+ // Hide the original content to show the line
87
80
  & > * {
88
81
  opacity: 0;
89
82
  }
90
- height: 4px;
83
+
91
84
  // Style for horizontal line (default)
92
85
  &::before {
93
86
  content: '';
94
87
  position: absolute;
95
88
  left: 0;
96
89
  top: 0;
97
- width: 100%;
98
- height: 4px;
90
+ width: 4px;
91
+ height: 100%;
99
92
  background-color: $neutral;
100
- border-radius: $border_radius_rounded;
93
+ border-radius: 1000px;
101
94
  z-index: 10;
102
95
  pointer-events: none;
103
- transform: translateY(-50%);
104
96
  }
105
- // Apply color variants to the ::before element
97
+
98
+ // Apply color variants
106
99
  &.drop_zone_color_primary::before { background-color: $primary; }
107
100
  &.drop_zone_color_purple::before { background-color: $purple; }
108
101
  }
109
102
  }
110
103
  }
111
- // Line variant - Horizontal orientation (vertical line for draggable items in horizontal layout)
112
- &.line_horizontal {
113
- .pb_draggable_item {
114
- position: relative;
104
+ }
105
+
106
+ // Support for vertical layouts (horizontal line)
107
+ .pb_draggable_container.vertical {
108
+ .pb_draggable_item {
109
+ &.is_dragging {
110
+ // Line variant for vertical layouts (horizontal line)
115
111
  &.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
124
112
  &::before {
125
- content: '';
126
- position: absolute;
113
+ width: 100%;
114
+ height: 4px;
127
115
  left: 0;
128
116
  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%);
136
117
  }
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; }
141
118
  }
142
119
  }
143
120
  }
@@ -60,120 +60,123 @@ const DraggableDropZones = (props) => {
60
60
 
61
61
  return (
62
62
  <>
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
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
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}
73
86
  marginBottom="xs"
74
- text="Shadow"
75
- textAlign="center"
76
- />
77
- <Draggable.Container
78
- htmlOptions={{style:{ width: "200px"}}}
87
+ padding="xs"
79
88
  {...props}
80
89
  >
81
- {initialShadowState.map(({ id, text }) => (
82
- <Card dragId={id}
83
- draggableItem
84
- key={id}
85
- marginBottom="xs"
86
- padding="xs"
87
- {...props}
90
+ <Flex alignItems="stretch"
91
+ flexDirection="column"
88
92
  >
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
93
+ <Body
94
+ text={text}
95
+ {...props}
96
+ />
97
+ </Flex>
98
+ </Card>
99
+ ))}
100
+ </Draggable.Container>
101
+ </DraggableProvider>
102
+ </FlexItem>
103
+ <FlexItem marginRight="xl">
104
+ <DraggableProvider
105
+ dropZone={{type: "outline"}}
106
+ initialItems={dataOutline}
107
+ onReorder={(items) => setInitialOutlineState(items)}
108
+ >
109
+ <Caption
110
+ marginBottom="xs"
111
+ textAlign="center"
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}
109
124
  marginBottom="xs"
110
- text="Outline"
111
- textAlign="center"
112
- />
113
- <Draggable.Container
114
- htmlOptions={{style:{ width: "200px"}}}
125
+ padding="xs"
115
126
  {...props}
116
127
  >
117
- {initialOutlineState.map(({ id, text }) => (
118
- <Card
119
- dragId={id}
120
- draggableItem
121
- key={id}
122
- marginBottom="xs"
123
- padding="xs"
124
- {...props}
128
+ <Flex
129
+ alignItems="stretch"
130
+ flexDirection="column"
125
131
  >
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
132
+ <Body
133
+ text={text}
134
+ {...props}
135
+ />
136
+ </Flex>
137
+ </Card>
138
+ ))}
139
+ </Draggable.Container>
140
+ </DraggableProvider>
141
+ </FlexItem>
142
+ <FlexItem>
143
+ <DraggableProvider
144
+ dropZone={{type: "line"}}
145
+ initialItems={dataLine}
146
+ onReorder={(items) => setInitialLineState(items)}
147
+ >
148
+ <Caption
149
+ marginBottom="xs"
150
+ textAlign="center"
151
+ >
152
+ {"Line"}
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}
147
162
  marginBottom="xs"
148
- text="Line"
149
- textAlign="center"
150
- />
151
- <Draggable.Container
152
- htmlOptions={{style:{ width: "200px"}}}
163
+ padding="xs"
153
164
  {...props}
154
165
  >
155
- {initialLineState.map(({ id, text }) => (
156
- <Card dragId={id}
157
- draggableItem
158
- key={id}
159
- marginBottom="xs"
160
- padding="xs"
161
- {...props}
166
+ <Flex alignItems="stretch"
167
+ flexDirection="column"
162
168
  >
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>
169
+ <Body
170
+ text={text}
171
+ {...props}
172
+ />
173
+ </Flex>
174
+ </Card>
175
+ ))}
176
+ </Draggable.Container>
177
+ </DraggableProvider>
178
+ </FlexItem>
179
+ </Flex>
177
180
  </>
178
181
  );
179
182
  };
@@ -1,5 +1,5 @@
1
- The Draggable kit lets you customize the style of drop zones that appear when dragging an item.
1
+ The Draggable kit allows you to choose the style of drop zones that appear when dragging an item.
2
2
 
3
- By default, drop zones are in the "ghost" style, but you can also choose from "shadow," "outline," and "line."
3
+ By default, the Draggable kit utilizes the "ghost" style for drop zones, but you can also choose between "shadow", "outline", and "line".
4
4
 
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).
5
+ Additionally, when using the "line" style, be sure to set the proper `direction` attribute within the `dropZone` prop depending on the orentation of your draggable view. By default, this attribute is set to "vertical", but can also be used with a "horizontal" direction. The `direction` attribute only applies to the "line" style and will not affect other drop zone styles.
@@ -6,8 +6,6 @@ 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
-
11
9
  // Initial items to be dragged
12
10
  const dataPrimary = [
13
11
  {
@@ -44,54 +42,54 @@ const DraggableDropZonesColors = (props) => {
44
42
 
45
43
  return (
46
44
  <>
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>
45
+ <Caption marginBottom="xs">
46
+ Primary
47
+ </Caption>
48
+ <DraggableProvider
49
+ dropZone={{type: "shadow", color: "primary"}}
50
+ initialItems={dataPrimary}
51
+ onReorder={(items) => setInitialPrimaryState(items)}
52
+ >
53
+ <Draggable.Container {...props}>
54
+ <Flex>
55
+ {initialPrimaryState.map(({ id, url }) => (
56
+ <Draggable.Item dragId={id}
57
+ key={id}
58
+ marginRight="sm"
59
+ >
60
+ <Image alt={id}
61
+ size="md"
62
+ url={url}
63
+ />
64
+ </Draggable.Item>
65
+ ))}
66
+ </Flex>
67
+ </Draggable.Container>
68
+ </DraggableProvider>
69
+ <Caption marginBottom="xs">
70
+ Purple
71
+ </Caption>
72
+ <DraggableProvider
73
+ dropZone={{type: "outline", color: "purple"}}
74
+ initialItems={dataPurple}
75
+ onReorder={(items) => setInitialPurpleState(items)}
76
+ >
77
+ <Draggable.Container {...props}>
78
+ <Flex>
79
+ {initialPurpleState.map(({ id, url }) => (
80
+ <Draggable.Item dragId={id}
81
+ key={id}
82
+ marginRight="sm"
83
+ >
84
+ <Image alt={id}
85
+ size="md"
86
+ url={url}
87
+ />
88
+ </Draggable.Item>
89
+ ))}
90
+ </Flex>
91
+ </Draggable.Container>
92
+ </DraggableProvider>
95
93
  </>
96
94
  );
97
95
  };
@@ -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.
1
+ By default, the Draggable kit sets the default color of drop zones to "neutral" (or "primary" if using the "line" style.)
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
 
3
3
  import Flex from '../../pb_flex/_flex'
4
- import { DraggableProvider } from '../context'
4
+ import { DraggableProvider } from '../../pb_draggable/context'
5
5
  import Avatar from '../../pb_avatar/_avatar'
6
6
  import Body from '../../pb_body/_body'
7
7
  import Table from '../../pb_table/_table'
@@ -2,6 +2,4 @@ The draggable kit can also be used in conjunction with the table kit to create d
2
2
 
3
3
  - Wrap the Table with the `DraggableProvider` and manage state as shown.
4
4
  - use the `draggableContainer` prop on the Table.Body to designate it as the Draggable Container
5
- - use the `draggableItem` prop on the Table.Row to designate it as the Draggable Item. Make sure to also pass id to the `dragId` prop here.
6
-
7
- We recommending using the default `dropZone type` with the Table kit.
5
+ - use the `draggableItem` prop on the Table.Row to designate it as the Draggable Item. Make sure to also pass id to the `dragId` prop here.