playbook_ui 13.29.0.pre.alpha.testingcollapsibleissue3052 → 13.30.0.pre.alpha.PBNTR353draggablev53136
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +58 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +68 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +5 -0
- data/app/pb_kits/playbook/pb_card/_card.tsx +57 -9
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -5
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +2 -3
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +2 -4
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +70 -50
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +26 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +3 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +13 -8
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +23 -35
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx +7 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +7 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx +11 -9
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +7 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +143 -18
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +6 -5
- data/app/pb_kits/playbook/pb_list/_list.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +7 -3
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +72 -0
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +78 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb +24 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +27 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +110 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +66 -0
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_percentage.tsx +57 -0
- data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +48 -0
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +43 -25
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +7 -3
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.html.erb +32 -33
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +0 -2
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +11 -10
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +8 -6
- data/app/pb_kits/playbook/playbook-doc.js +2 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -0
- data/dist/menu.yml +5 -1
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/kit_base.rb +19 -0
- data/lib/playbook/version.rb +2 -2
- metadata +23 -2
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= pb_rails("overlay") do %>
|
2
|
+
<%= pb_rails("table", props: { size: "sm" }) do %>
|
3
|
+
<thead>
|
4
|
+
<tr>
|
5
|
+
<th>Column 1</th>
|
6
|
+
<th>Column 2</th>
|
7
|
+
<th>Column 3</th>
|
8
|
+
<th>Column 4</th>
|
9
|
+
<th>Column 5</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% 7.times do %>
|
14
|
+
<tr>
|
15
|
+
<td>Value 1</td>
|
16
|
+
<td>Value 2</td>
|
17
|
+
<td>Value 3</td>
|
18
|
+
<td>Value 4</td>
|
19
|
+
<td>Value 5</td>
|
20
|
+
</tr>
|
21
|
+
<% end %>
|
22
|
+
</tbody>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import {
|
3
|
+
Overlay,
|
4
|
+
Table,
|
5
|
+
} from '../..'
|
6
|
+
|
7
|
+
const TableExample = () => {
|
8
|
+
return (
|
9
|
+
<Table size="sm">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>{'Column 1'}</th>
|
13
|
+
<th>{'Column 2'}</th>
|
14
|
+
<th>{'Column 3'}</th>
|
15
|
+
<th>{'Column 4'}</th>
|
16
|
+
<th>{'Column 5'}</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
{Array.from({ length: 7 }, (_, index) => (
|
21
|
+
<tr key={index}>
|
22
|
+
{Array.from({ length: 5 }, (_, columnIndex) => (
|
23
|
+
<td key={columnIndex}>{`Value ${columnIndex + 1}`}</td>
|
24
|
+
))}
|
25
|
+
</tr>
|
26
|
+
))}
|
27
|
+
</tbody>
|
28
|
+
</Table>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
const OverlayDefault = () => (
|
33
|
+
<>
|
34
|
+
<Overlay>
|
35
|
+
<TableExample />
|
36
|
+
</Overlay>
|
37
|
+
</>
|
38
|
+
)
|
39
|
+
|
40
|
+
export default OverlayDefault
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Overlays optionally accept a `color`, which sets the "start" (opaque) color of a gradient mask. Because this overlay is intended to reveal underlying content, the "end" color is fixed to transparent.
|
2
|
+
|
3
|
+
The optional `layout` prop accepts the `position` and `size` of the overlay as a key:value pair.
|
4
|
+
|
5
|
+
The `position` key accepts `bottom` (default), `top`, `y` (for both top and bottom) `right`, `left`, or `x` (for both left and right), which sets the side(s) where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
|
6
|
+
|
7
|
+
The `size` value is `full` (100%) by default, but accepts our [spacing tokens](https://playbook.powerapp.cloud/visual_guidelines/spacing) or a percentage value as a string, and literally translates to how much of the container is covered by the overlay(s).
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light" }) do %>
|
2
|
+
<%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
|
3
|
+
<% 15.times do %>
|
4
|
+
<%= pb_rails("flex/flex_item") do %>
|
5
|
+
<%= pb_rails("card") do %>
|
6
|
+
Card content
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import {
|
3
|
+
Overlay,
|
4
|
+
Card,
|
5
|
+
Flex,
|
6
|
+
FlexItem,
|
7
|
+
} from '../..'
|
8
|
+
|
9
|
+
const InlineCardsExample = () => {
|
10
|
+
return (
|
11
|
+
<Flex
|
12
|
+
columnGap="lg"
|
13
|
+
orientation="row"
|
14
|
+
overflowX="auto"
|
15
|
+
>
|
16
|
+
{Array.from({ length: 15 }, (_, index) => (
|
17
|
+
<FlexItem key={index}>
|
18
|
+
<Card>{"Card Content"}</Card>
|
19
|
+
</FlexItem>
|
20
|
+
))}
|
21
|
+
</Flex>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
const OverlayMultiDirectional = () => (
|
26
|
+
<>
|
27
|
+
<Overlay
|
28
|
+
color="card_light"
|
29
|
+
layout={{"x": "xl"}}
|
30
|
+
>
|
31
|
+
<InlineCardsExample />
|
32
|
+
</Overlay>
|
33
|
+
</>
|
34
|
+
)
|
35
|
+
|
36
|
+
export default OverlayMultiDirectional
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Optionally, you can pass multi-directional options (`x` or `y`) to the `position` key, which creates multiple overlays.
|
2
|
+
|
3
|
+
Your `color` is still applied as the starting edge to both overlays, and each mask will fade to transparent moving toward its opposite edge, ending at the `size` value you set.
|
4
|
+
|
5
|
+
NOTE: Multi-directional overlays share the available container space, so passing `full` or a percentage string greater than 50% to a multi-directional overlay will cause your masks to overlap at the midline of your container. As a best practice, we do not recommend exceeding a percentage size of 25% when using multi-directional overlays.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= pb_content_tag(:div,
|
2
|
+
aria: object.aria,
|
3
|
+
class: object.classname,
|
4
|
+
data: object.data,
|
5
|
+
id: object.id,
|
6
|
+
**combined_html_options) do %>
|
7
|
+
<% if is_size_percentage %>
|
8
|
+
<div class="overlay_linear_gradient"
|
9
|
+
style="background: <%= previous_overlay %>"></div>
|
10
|
+
|
11
|
+
<%= content.presence %>
|
12
|
+
|
13
|
+
<% if has_subsequent_overlay %>
|
14
|
+
<div class="overlay_linear_gradient"
|
15
|
+
style="background: <%= subsequent_overlay %>"></div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% else %>
|
19
|
+
<div class="<%= previous_overlay_class_name %>"></div>
|
20
|
+
|
21
|
+
<%= content.presence %>
|
22
|
+
|
23
|
+
<% if has_subsequent_overlay %>
|
24
|
+
<div class="<%= subsequent_overlay_class_name %>"></div>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbOverlay
|
5
|
+
class Overlay < Playbook::KitBase
|
6
|
+
prop :color, type: Playbook::Props::Enum,
|
7
|
+
values: %w[card_light bg_light card_dark bg_dark],
|
8
|
+
default: "card_light"
|
9
|
+
prop :layout, type: Playbook::Props::HashProp,
|
10
|
+
default: { "bottom": "full" }
|
11
|
+
|
12
|
+
def classname
|
13
|
+
generate_classname("pb_overlay")
|
14
|
+
end
|
15
|
+
|
16
|
+
def position
|
17
|
+
layout.keys[0]
|
18
|
+
end
|
19
|
+
|
20
|
+
def size
|
21
|
+
layout.values[0]
|
22
|
+
end
|
23
|
+
|
24
|
+
def is_size_percentage
|
25
|
+
size.include?("%")
|
26
|
+
end
|
27
|
+
|
28
|
+
def previous_overlay
|
29
|
+
"linear-gradient(#{previous_overlay_direction}, #{color_map[color.to_sym]} 0%, transparent #{size})"
|
30
|
+
end
|
31
|
+
|
32
|
+
def subsequent_overlay
|
33
|
+
"linear-gradient(#{subsequent_overlay_direction}, #{color_map[color.to_sym]} 0%, transparent #{size})"
|
34
|
+
end
|
35
|
+
|
36
|
+
def previous_overlay_class_name
|
37
|
+
"overlay_#{color}_#{previous_overlay_direction_token}_#{size}"
|
38
|
+
end
|
39
|
+
|
40
|
+
def subsequent_overlay_class_name
|
41
|
+
"overlay_#{color}_#{subsequent_overlay_direction_token}_#{size}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def previous_overlay_direction
|
45
|
+
previous_overlay_direction_map[position.to_sym]
|
46
|
+
end
|
47
|
+
|
48
|
+
def subsequent_overlay_direction
|
49
|
+
subsequent_overlay_direction_map[position.to_sym]
|
50
|
+
end
|
51
|
+
|
52
|
+
def previous_overlay_direction_token
|
53
|
+
has_subsequent_overlay ? previous_overlay_direction_map_token[position.to_sym] : position
|
54
|
+
end
|
55
|
+
|
56
|
+
def subsequent_overlay_direction_token
|
57
|
+
has_subsequent_overlay ? subsequent_overlay_direction_map_token[position.to_sym] : position
|
58
|
+
end
|
59
|
+
|
60
|
+
def previous_overlay_direction_map
|
61
|
+
{
|
62
|
+
"bottom": "to top",
|
63
|
+
"top": "to bottom",
|
64
|
+
"left": "to right",
|
65
|
+
"right": "to left",
|
66
|
+
"x": "to right",
|
67
|
+
"y": "to top",
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
def subsequent_overlay_direction_map
|
72
|
+
{
|
73
|
+
"bottom": "to top",
|
74
|
+
"top": "to bottom",
|
75
|
+
"left": "to right",
|
76
|
+
"right": "to left",
|
77
|
+
"x": "to left",
|
78
|
+
"y": "to bottom",
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
def previous_overlay_direction_map_token
|
83
|
+
{
|
84
|
+
"x": "left",
|
85
|
+
"y": "top",
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
def subsequent_overlay_direction_map_token
|
90
|
+
{
|
91
|
+
"x": "right",
|
92
|
+
"y": "bottom",
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
def has_subsequent_overlay
|
97
|
+
position == "x".to_sym || position == "y".to_sym
|
98
|
+
end
|
99
|
+
|
100
|
+
def color_map
|
101
|
+
{
|
102
|
+
"card_light": "#fff",
|
103
|
+
"bg_light": "#F3F7FB",
|
104
|
+
"card_dark": "#231E3D",
|
105
|
+
"bg_dark": "#0a0527",
|
106
|
+
}
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import { render, screen } from '../utilities/test-utils'
|
4
|
+
import { Overlay } from '..'
|
5
|
+
|
6
|
+
const testId = "overlay"
|
7
|
+
const children = "This is the Overlay children"
|
8
|
+
|
9
|
+
test('should pass data prop', () => {
|
10
|
+
const props = {
|
11
|
+
children,
|
12
|
+
data: { testid: testId }
|
13
|
+
}
|
14
|
+
|
15
|
+
render(<Overlay {...props} />)
|
16
|
+
const kit = screen.getByTestId(testId)
|
17
|
+
expect(kit).toBeInTheDocument()
|
18
|
+
})
|
19
|
+
|
20
|
+
test("should pass className prop", () => {
|
21
|
+
const className = "custom-class-name"
|
22
|
+
const props = {
|
23
|
+
className,
|
24
|
+
children,
|
25
|
+
data: { testid: testId },
|
26
|
+
}
|
27
|
+
|
28
|
+
render(<Overlay {...props} />)
|
29
|
+
const kit = screen.getByTestId(testId)
|
30
|
+
expect(kit).toHaveClass(className)
|
31
|
+
})
|
32
|
+
|
33
|
+
test('should pass aria prop', () => {
|
34
|
+
const props = {
|
35
|
+
aria: { label: testId },
|
36
|
+
children,
|
37
|
+
data: { testid: testId },
|
38
|
+
}
|
39
|
+
|
40
|
+
render(<Overlay {...props} />)
|
41
|
+
const kit = screen.getByTestId(testId)
|
42
|
+
expect(kit).toHaveAttribute('aria-label', testId)
|
43
|
+
})
|
44
|
+
|
45
|
+
test('should pass id prop', () => {
|
46
|
+
const props = {
|
47
|
+
children,
|
48
|
+
data: { testid: testId },
|
49
|
+
id: testId
|
50
|
+
}
|
51
|
+
|
52
|
+
render(<Overlay {...props} />)
|
53
|
+
const kit = screen.getByTestId(testId)
|
54
|
+
expect(kit).toHaveAttribute('id', testId)
|
55
|
+
})
|
56
|
+
|
57
|
+
test('should render children', () => {
|
58
|
+
const props = {
|
59
|
+
children,
|
60
|
+
data: { testid: testId }
|
61
|
+
}
|
62
|
+
|
63
|
+
render(<Overlay {...props} />)
|
64
|
+
const kit = screen.getByTestId(testId)
|
65
|
+
expect(kit).toHaveTextContent(props.children)
|
66
|
+
})
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import defaultColors from "../../tokens/exports/_colors.scss";
|
3
|
+
import { OverlayChildrenProps } from '../_overlay';
|
4
|
+
|
5
|
+
|
6
|
+
const previousOverlayDirectionMap: { [key: string]: string } = {
|
7
|
+
"bottom": "to top",
|
8
|
+
"top": "to bottom",
|
9
|
+
"left": "to right",
|
10
|
+
"right": "to left",
|
11
|
+
"x": "to right",
|
12
|
+
"y": "to top",
|
13
|
+
}
|
14
|
+
|
15
|
+
const subsequentOverlayDirectionMap: { [key: string]: string } = {
|
16
|
+
...previousOverlayDirectionMap,
|
17
|
+
"x": "to left",
|
18
|
+
"y": "to bottom",
|
19
|
+
}
|
20
|
+
|
21
|
+
const OverlayPercentage = (props: OverlayChildrenProps) => {
|
22
|
+
const {
|
23
|
+
children,
|
24
|
+
color,
|
25
|
+
position,
|
26
|
+
size,
|
27
|
+
} = props
|
28
|
+
|
29
|
+
const getPreviousOverlayDirection = () => {
|
30
|
+
return previousOverlayDirectionMap[position]
|
31
|
+
}
|
32
|
+
|
33
|
+
const getSubsequentOverlayDirection = () => {
|
34
|
+
return subsequentOverlayDirectionMap[position]
|
35
|
+
}
|
36
|
+
|
37
|
+
const hasSubsequentOverlay = position === "x" || position === "y"
|
38
|
+
|
39
|
+
const previousOverlay = `linear-gradient(${getPreviousOverlayDirection()}, ${defaultColors[color]} 0%, transparent ${size})`
|
40
|
+
const subsequentOverlay = `linear-gradient(${getSubsequentOverlayDirection()}, ${defaultColors[color]} 0%, transparent ${size})`
|
41
|
+
|
42
|
+
return (
|
43
|
+
<>
|
44
|
+
<div className="overlay_linear_gradient"
|
45
|
+
style={{ background: previousOverlay }} />
|
46
|
+
|
47
|
+
{children}
|
48
|
+
|
49
|
+
{ hasSubsequentOverlay &&
|
50
|
+
<div className="overlay_linear_gradient"
|
51
|
+
style={{ background: subsequentOverlay }} />
|
52
|
+
}
|
53
|
+
</>
|
54
|
+
)
|
55
|
+
}
|
56
|
+
|
57
|
+
export default OverlayPercentage
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { OverlayChildrenProps } from '../_overlay'
|
3
|
+
|
4
|
+
const previousOverlayDirectionMap: { [key: string]: string } = {
|
5
|
+
"x": "left",
|
6
|
+
"y": "top",
|
7
|
+
}
|
8
|
+
|
9
|
+
const subsequentOverlayDirectionMap: { [key: string]: string } = {
|
10
|
+
"x": "right",
|
11
|
+
"y": "bottom",
|
12
|
+
}
|
13
|
+
|
14
|
+
const OverlayToken = (props: OverlayChildrenProps) => {
|
15
|
+
const {
|
16
|
+
children,
|
17
|
+
color,
|
18
|
+
position,
|
19
|
+
size,
|
20
|
+
} = props
|
21
|
+
|
22
|
+
const hasSubsequentOverlay = position === "x" || position === "y"
|
23
|
+
|
24
|
+
const getPreviousOverlayDirection = () => {
|
25
|
+
return hasSubsequentOverlay ? previousOverlayDirectionMap[position] : position
|
26
|
+
}
|
27
|
+
|
28
|
+
const getSubsequentOverlayDirection = () => {
|
29
|
+
return hasSubsequentOverlay ? subsequentOverlayDirectionMap[position] : position
|
30
|
+
}
|
31
|
+
|
32
|
+
const previousOverlayClassName = `overlay_${color}_${getPreviousOverlayDirection()}_${size}`
|
33
|
+
const subsequentOverlayClassName = `overlay_${color}_${getSubsequentOverlayDirection()}_${size}`
|
34
|
+
|
35
|
+
return (
|
36
|
+
<>
|
37
|
+
<div className={previousOverlayClassName} />
|
38
|
+
|
39
|
+
{children}
|
40
|
+
|
41
|
+
{ hasSubsequentOverlay &&
|
42
|
+
<div className={subsequentOverlayClassName} />
|
43
|
+
}
|
44
|
+
</>
|
45
|
+
)
|
46
|
+
}
|
47
|
+
|
48
|
+
export default OverlayToken
|
@@ -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://
|
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
|
-
.
|
105
|
-
|
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-
|
108
|
-
transform: rotate(
|
109
|
-
height:
|
110
|
-
width:
|
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
|
-
.
|
117
|
-
|
118
|
-
border
|
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://
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
71
|
+
<List enableDrag={enableDrag}
|
72
72
|
variant={props.variant}
|
73
73
|
>
|
74
74
|
{selectableListItems}
|