playbook_ui 13.29.0 → 13.30.0.pre.alpha.PBNTR353draggablev53136

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/index.js +1 -0
  4. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +58 -0
  5. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +68 -0
  6. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +2 -0
  7. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  8. data/app/pb_kits/playbook/pb_card/_card.scss +5 -0
  9. data/app/pb_kits/playbook/pb_card/_card.tsx +57 -9
  10. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -5
  11. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +2 -6
  12. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +2 -3
  13. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +2 -4
  14. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +70 -50
  15. data/app/pb_kits/playbook/pb_draggable/context/types.ts +26 -0
  16. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +3 -2
  17. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md +2 -2
  18. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +13 -8
  19. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.md +1 -0
  20. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +23 -35
  21. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +5 -0
  22. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx +7 -7
  23. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +7 -1
  24. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx +11 -9
  25. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +7 -0
  26. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +143 -18
  27. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +6 -5
  28. data/app/pb_kits/playbook/pb_list/_list.tsx +4 -4
  29. data/app/pb_kits/playbook/pb_list/_list_item.tsx +7 -3
  30. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +72 -0
  31. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +78 -0
  32. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb +24 -0
  33. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
  34. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
  35. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb +11 -0
  36. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
  37. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
  38. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +8 -0
  39. data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
  40. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +27 -0
  41. data/app/pb_kits/playbook/pb_overlay/overlay.rb +110 -0
  42. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +66 -0
  43. data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_percentage.tsx +57 -0
  44. data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +48 -0
  45. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +43 -25
  46. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +7 -3
  47. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -3
  48. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.html.erb +32 -33
  49. data/app/pb_kits/playbook/pb_table/table_header.html.erb +0 -2
  50. data/app/pb_kits/playbook/pb_timeline/_item.tsx +11 -10
  51. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +8 -6
  52. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  53. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -0
  54. data/dist/menu.yml +5 -1
  55. data/dist/playbook-rails.js +6 -6
  56. data/lib/playbook/kit_base.rb +19 -0
  57. data/lib/playbook/version.rb +2 -2
  58. metadata +26 -5
@@ -24,8 +24,13 @@ $flag-min-resolution: 192dpi;
24
24
  transition: $transition_default;
25
25
  }
26
26
 
27
+ .iti__divider {
28
+ border-bottom: 1px solid $border_light !important;
29
+ }
30
+
27
31
  .iti__selected-flag {
28
32
  padding: 0 $space_xxs 0 $space_sm;
33
+ border-radius: $space_xxs;
29
34
 
30
35
  &[aria-expanded="true"] {
31
36
  color: $primary_action;
@@ -33,7 +38,6 @@ $flag-min-resolution: 192dpi;
33
38
 
34
39
  &:focus-visible {
35
40
  outline-style: solid;
36
- border-radius: $space_xxs 0px 0px $space_xxs;
37
41
  outline-color: $primary;
38
42
  }
39
43
  }
@@ -55,7 +59,7 @@ $flag-min-resolution: 192dpi;
55
59
  }
56
60
 
57
61
  .iti__flag {
58
- background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/img/flags.png");
62
+ background-image: url("https://intl-tel-input.com/intl-tel-input/img/flags.png");
59
63
  border-radius: 1px;
60
64
  }
61
65
 
@@ -101,28 +105,36 @@ $flag-min-resolution: 192dpi;
101
105
  color: $primary_action;
102
106
  }
103
107
 
104
- .iti__active::after {
105
- float: right;
108
+ .iti__country-list .iti__country {
109
+ display: flex;
110
+ align-items: center;
111
+ }
112
+
113
+ .iti__flag-box,
114
+ .iti__country-name,
115
+ .iti__dial-code {
116
+ flex-grow: 0;
117
+ }
118
+
119
+ .iti__dial-code {
120
+ margin-right: $space_sm;
121
+ }
122
+
123
+
124
+ .iti__country-list .iti__country.iti__active::after {
106
125
  content: "";
107
- margin-top: $space_xxs + 1px;
108
- transform: rotate($transform-rotate-deg/3);
109
- height: $space_xs + 4px;
110
- width: $space_xxs + 2px;
126
+ margin-left: auto;
127
+ transform: rotate(45deg);
128
+ height: 12px;
129
+ width: 6px;
111
130
  border-bottom: 2px solid;
112
131
  border-right: 2px solid;
113
132
  border-radius: 1px;
114
133
  }
115
134
 
116
- .iti__country-list {
117
- min-width: $dropdown-min-width;
118
- border-radius: $border_radius_md;
119
- border: 1px solid $border_light;
120
- box-shadow: $shadow_deep;
121
- margin-top: 1px;
122
- }
123
-
124
- .iti__divider {
125
- border-bottom: 1px solid $border_light;
135
+ .iti__dropdown-content {
136
+ border-radius: $space_xs;
137
+ border: 1px solid $border_light !important;
126
138
  }
127
139
 
128
140
  &.dark {
@@ -147,6 +159,15 @@ $flag-min-resolution: 192dpi;
147
159
  color: $white;
148
160
  }
149
161
 
162
+ .iti__dropdown-content {
163
+ border-radius: $space_xs;
164
+ border: 1px solid $border_dark !important;
165
+ }
166
+
167
+ .iti__divider {
168
+ border-bottom: 1px solid $border_dark !important;
169
+ }
170
+
150
171
  .iti__country-list {
151
172
  background-color: $bg_dark;
152
173
  border: 1px solid $border_dark;
@@ -157,17 +178,14 @@ $flag-min-resolution: 192dpi;
157
178
  .iti__country-name {
158
179
  color: $text_dk_default;
159
180
  }
160
-
181
+
161
182
  .iti__dial-code {
162
183
  color: $text_lt_lighter;
184
+ margin-right: $space_sm;
163
185
  }
164
186
  }
165
187
  }
166
188
 
167
- .iti__divider {
168
- border-bottom: 1px solid $border_dark;
169
- }
170
-
171
189
  .iti__arrow.iti__arrow--up::before {
172
190
  color: $slate;
173
191
  }
@@ -178,10 +196,10 @@ $flag-min-resolution: 192dpi;
178
196
  }
179
197
  }
180
198
  }
181
-
199
+
182
200
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
183
201
  .iti__flag {
184
- background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/img/flags@2x.png");
202
+ background-image: url("https://intl-tel-input.com/intl-tel-input/img/flags.png");
185
203
  }
186
204
  }
187
205
  }
@@ -2,7 +2,7 @@ import React, { useState } from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
5
- import { globalProps } from "../utilities/globalProps";
5
+ import { globalProps, domSafeProps } from "../utilities/globalProps";
6
6
 
7
7
  import Checkbox from "../pb_checkbox/_checkbox";
8
8
  import ListItem from "../pb_list/_list_item";
@@ -16,6 +16,7 @@ export type SelectableListItemProps = {
16
16
  className?: string;
17
17
  data?: GenericObject;
18
18
  defaultChecked?: boolean;
19
+ dragId?: string;
19
20
  dragHandle?: boolean;
20
21
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
21
22
  id?: string;
@@ -33,6 +34,7 @@ const SelectableListItem = ({
33
34
  children,
34
35
  className,
35
36
  data = {},
37
+ dragId,
36
38
  dragHandle = true,
37
39
  defaultChecked,
38
40
  htmlOptions = {},
@@ -67,7 +69,7 @@ const SelectableListItem = ({
67
69
  {...props}
68
70
  className={classnames(checkedState ? "checked_item" : "", className)}
69
71
  dragHandle={dragHandle}
70
- id={id}
72
+ dragId={dragId}
71
73
  >
72
74
  <div
73
75
  {...ariaProps}
@@ -106,7 +108,9 @@ const SelectableListItem = ({
106
108
  text={label}
107
109
  type="radio"
108
110
  value={value}
109
- {...props}
111
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
112
+ //@ts-ignore
113
+ {...domSafeProps(props)}
110
114
  />
111
115
  {children}
112
116
  </>
@@ -14,7 +14,7 @@ type SelectableListProps = {
14
14
  children?: React.ReactElement[],
15
15
  className?: string,
16
16
  data?: GenericObject,
17
- draggable?: boolean,
17
+ enableDrag?: boolean,
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string,
20
20
  variant?: 'checkbox' | 'radio',
@@ -26,7 +26,7 @@ const SelectableList = (props: SelectableListProps) => {
26
26
  children,
27
27
  className,
28
28
  data = {},
29
- draggable = false,
29
+ enableDrag = false,
30
30
  htmlOptions = {},
31
31
  id,
32
32
  } = props
@@ -68,7 +68,7 @@ const SelectableList = (props: SelectableListProps) => {
68
68
  className={classes}
69
69
  id={id}
70
70
  >
71
- <List draggable={draggable}
71
+ <List enableDrag={enableDrag}
72
72
  variant={props.variant}
73
73
  >
74
74
  {selectableListItems}
@@ -1,34 +1,33 @@
1
- <%= pb_rails("table") do %>
2
- <thead>
3
- <tr>
4
- <th>Column 1</th>
5
- <th>Column 2</th>
6
- <th>Column 3</th>
7
- <th align="center">Rating</th>
8
- <th align="right">Money</th>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <tr>
13
- <td>Value 1</td>
14
- <td>Value 2</td>
15
- <td>Value 3</td>
16
- <td align="center">3</td>
17
- <td align="right">$57.32</td>
18
- </tr>
19
- <tr>
20
- <td>Value 1</td>
21
- <td>Value 2</td>
22
- <td>Value 3</td>
23
- <td align="center">2</td>
24
- <td align="right">$5,657.08</td>
25
- </tr>
26
- <tr>
27
- <td>Value 1</td>
28
- <td>Value 2</td>
29
- <td>Value 3</td>
30
- <td align="center">4</td>
31
- <td align="right">$358.77</td>
32
- </tr>
33
- </tbody>
1
+ <%= pb_rails("table") do %> <%= pb_rails("table/table_head") do %>
2
+ <%= pb_rails("table/table_row") do %>
3
+ <%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
4
+ <%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
5
+ <%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
6
+ <%= pb_rails("table/table_header", props: { text: "Rating", text_align: "center" }) %>
7
+ <%= pb_rails("table/table_header", props: { text: "Money", text_align: "right" }) %>
8
+ <% end %>
9
+ <% end %>
10
+ <%= pb_rails("table/table_body") do %>
11
+ <%= pb_rails("table/table_row") do %>
12
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
13
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
14
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
15
+ <%= pb_rails("table/table_cell", props: { text: "3", text_align: "center" }) %>
16
+ <%= pb_rails("table/table_cell", props: { text: "$57.32", text_align: "right" }) %>
17
+ <% end %>
18
+ <%= pb_rails("table/table_row") do %>
19
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
20
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
21
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
22
+ <%= pb_rails("table/table_cell", props: { text: "2", text_align: "center" }) %>
23
+ <%= pb_rails("table/table_cell", props: { text: "$5,657.08", text_align: "right" }) %>
24
+ <% end %>
25
+ <%= pb_rails("table/table_row") do %>
26
+ <%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
27
+ <%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
28
+ <%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
29
+ <%= pb_rails("table/table_cell", props: { text: "4", text_align: "center" }) %>
30
+ <%= pb_rails("table/table_cell", props: { text: "$358.77", text_align: "right" }) %>
31
+ <% end %>
32
+ <% end %>
34
33
  <% end %>
@@ -7,9 +7,7 @@
7
7
  id: "pb-th#{object.id}",
8
8
  **combined_html_options) do %>
9
9
  <% unless sorting_style? %>
10
- <%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_nolink" }) do %>
11
10
  <%= content.presence || object.text %>
12
- <% end %>
13
11
  <% else %>
14
12
  <%= link_to next_link, style: link_style do %>
15
13
  <%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_link" }) do %>
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildCss, buildHtmlProps } from '../utilities/props'
5
+ import { globalProps, GlobalProps } from "../utilities/globalProps";
5
6
 
6
7
  import DateStacked from '../pb_date_stacked/_date_stacked'
7
8
  import IconCircle from '../pb_icon_circle/_icon_circle'
@@ -14,7 +15,7 @@ type ItemProps = {
14
15
  icon?: string,
15
16
  iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
16
17
  lineStyle?: 'solid' | 'dotted',
17
- }
18
+ } & GlobalProps
18
19
 
19
20
  const TimelineItem = ({
20
21
  className,
@@ -24,7 +25,7 @@ const TimelineItem = ({
24
25
  icon = 'user',
25
26
  iconColor = 'default',
26
27
  lineStyle = 'solid',
27
-
28
+ ...props
28
29
  }: ItemProps) => {
29
30
  const timelineItemCss = buildCss('pb_timeline_item_kit', lineStyle)
30
31
 
@@ -32,23 +33,23 @@ const TimelineItem = ({
32
33
 
33
34
  return (
34
35
  <div
35
- {...htmlProps}
36
- className={classnames(timelineItemCss, className)}
36
+ {...htmlProps}
37
+ className={classnames(timelineItemCss, globalProps(props), className)}
37
38
  >
38
39
  <div className="pb_timeline_item_left_block">
39
40
  {date &&
40
41
  <DateStacked
41
- align="center"
42
- date={date}
43
- size="sm"
42
+ align="center"
43
+ date={date}
44
+ size="sm"
44
45
  />
45
46
  }
46
47
  </div>
47
48
  <div className="pb_timeline_item_step">
48
49
  <IconCircle
49
- icon={icon}
50
- size="xs"
51
- variant={iconColor}
50
+ icon={icon}
51
+ size="xs"
52
+ variant={iconColor}
52
53
  />
53
54
  <div className="pb_timeline_item_connector" />
54
55
  </div>
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
5
6
 
6
7
  import TimelineItem from './_item'
7
8
 
@@ -14,7 +15,7 @@ type TimelineProps = {
14
15
  id?: string,
15
16
  orientation?: string,
16
17
  showDate?: boolean,
17
- }
18
+ } & GlobalProps
18
19
 
19
20
  const Timeline = ({
20
21
  aria = {},
@@ -25,6 +26,7 @@ const Timeline = ({
25
26
  id,
26
27
  orientation = 'horizontal',
27
28
  showDate = false,
29
+ ...props
28
30
  }: TimelineProps) => {
29
31
  const ariaProps = buildAriaProps(aria)
30
32
  const dataProps = buildDataProps(data)
@@ -33,11 +35,11 @@ const Timeline = ({
33
35
  const timelineCss = buildCss('pb_timeline_kit', `_${orientation}`, dateStyle)
34
36
  return (
35
37
  <div
36
- {...ariaProps}
37
- {...dataProps}
38
- {...htmlProps}
39
- className={classnames(timelineCss, className)}
40
- id={id}
38
+ {...ariaProps}
39
+ {...dataProps}
40
+ {...htmlProps}
41
+ className={classnames(timelineCss, globalProps(props), className)}
42
+ id={id}
41
43
  >
42
44
  {children}
43
45
  </div>
@@ -66,6 +66,7 @@ import * as MultipleUsers from 'pb_multiple_users/docs'
66
66
  import * as MultipleUsersStacked from 'pb_multiple_users_stacked/docs'
67
67
  import * as Nav from 'pb_nav/docs'
68
68
  import * as OnlineStatus from 'pb_online_status/docs'
69
+ import * as Overlay from 'pb_overlay/docs'
69
70
  import * as Passphrase from 'pb_passphrase/docs'
70
71
  import * as PbReactPopover from 'pb_popover/docs'
71
72
  import * as Person from 'pb_person/docs'
@@ -170,6 +171,7 @@ WebpackerReact.registerComponents({
170
171
  ...MultipleUsersStacked,
171
172
  ...Nav,
172
173
  ...OnlineStatus,
174
+ ...Overlay,
173
175
  ...Passphrase,
174
176
  ...PbReactPopover,
175
177
  ...Person,
@@ -520,6 +520,7 @@ export const domSafeProps = (props: {[key: string]: string}): {[key: string]: st
520
520
  'paddingY',
521
521
  'padding',
522
522
  'dark',
523
+ 'enableDrag',
523
524
  ]
524
525
  return omit(props, notSafeProps)
525
526
  }
data/dist/menu.yml CHANGED
@@ -352,6 +352,9 @@ kits:
352
352
  platforms: *web
353
353
  description:
354
354
  status: "stable"
355
+ - name: "overlay"
356
+ platforms: *web
357
+ status: "stable"
355
358
  - name: "draggable"
356
359
  platforms: *react_only
357
360
  description:
@@ -467,4 +470,5 @@ kits:
467
470
  status: "stable"
468
471
  - name: "user"
469
472
  platforms: *web
470
- description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
473
+ description: This kit was created for having a systematic way of displaying users with avatar, titles, name and territory. This is a versatile kit with features than can be added to display more info.
474
+ status: "stable"