playbook_ui 13.30.0.pre.alpha.20240515remotebuildkitconversion3150 → 13.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +4 -4
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -4
- data/app/pb_kits/playbook/pb_collapsible/index.js +1 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +1 -6
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +4 -2
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +50 -70
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +1 -5
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +4 -11
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.md +2 -4
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.jsx +2 -2
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list.md +1 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.jsx +4 -6
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +15 -142
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +5 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -18
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +218 -228
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -14
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -7
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +2 -17
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +3 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +11 -16
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +6 -37
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +1 -6
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +5 -21
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -21
- data/app/pb_kits/playbook/pb_list/_list.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +3 -7
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +1 -3
- data/app/pb_kits/playbook/pb_nav/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/item.rb +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +4 -4
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +3 -7
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -3
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +2 -16
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +10 -11
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +6 -8
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +5 -22
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +0 -59
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.md +0 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_default_swift.md +0 -33
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_props_swift.md +0 -18
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +0 -26
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list.md +0 -7
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.html.erb +0 -9
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +0 -34
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.html.erb +0 -32
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_custom_icon.jsx +0 -48
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +0 -72
- data/app/pb_kits/playbook/pb_icon/icon_aliases.json +0 -39
- data/app/pb_kits/playbook/pb_icon/types.d.ts +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.html.erb +0 -24
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.html.erb +0 -11
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +0 -27
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +0 -110
@@ -23,7 +23,6 @@ type FixedConfirmationToastProps = {
|
|
23
23
|
data?: string;
|
24
24
|
horizontal?: "right" | "left" | "center";
|
25
25
|
htmlOptions?: { [key: string]: string | number | boolean | (VoidCallback) };
|
26
|
-
icon?: string,
|
27
26
|
id?: string;
|
28
27
|
multiLine?: boolean;
|
29
28
|
onClose?: VoidCallback;
|
@@ -42,7 +41,6 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
42
41
|
closeable = false,
|
43
42
|
horizontal,
|
44
43
|
htmlOptions = {},
|
45
|
-
icon,
|
46
44
|
multiLine = false,
|
47
45
|
onClose = () => undefined,
|
48
46
|
open = true,
|
@@ -50,18 +48,14 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
50
48
|
text,
|
51
49
|
vertical,
|
52
50
|
} = props;
|
53
|
-
|
54
|
-
const returnedIcon = icon || iconMap[status]
|
55
|
-
const iconClass = icon ? "custom_icon" : ""
|
56
|
-
|
57
51
|
const css = classnames(
|
58
52
|
`pb_fixed_confirmation_toast_kit_${status}`,
|
59
53
|
{ _multi_line: multiLine },
|
60
54
|
{ [`positioned_toast ${vertical} ${horizontal}`]: vertical && horizontal },
|
61
|
-
`${iconClass}`,
|
62
55
|
globalProps(props),
|
63
56
|
className
|
64
57
|
);
|
58
|
+
const icon = iconMap[status];
|
65
59
|
|
66
60
|
const htmlProps = buildHtmlProps(htmlOptions);
|
67
61
|
|
@@ -92,11 +86,11 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.React
|
|
92
86
|
onClick={handleClick}
|
93
87
|
{...htmlProps}
|
94
88
|
>
|
95
|
-
{
|
89
|
+
{icon && (
|
96
90
|
<Icon
|
97
91
|
className="pb_icon"
|
98
92
|
fixedWidth
|
99
|
-
icon={
|
93
|
+
icon={icon}
|
100
94
|
/>
|
101
95
|
)}
|
102
96
|
|
@@ -6,7 +6,6 @@ examples:
|
|
6
6
|
- fixed_confirmation_toast_close: Click to Close
|
7
7
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
8
8
|
- fixed_confirmation_toast_children: Children
|
9
|
-
- fixed_confirmation_toast_custom_icon: Custom Icon
|
10
9
|
|
11
10
|
react:
|
12
11
|
- fixed_confirmation_toast_default: Default
|
@@ -15,7 +14,6 @@ examples:
|
|
15
14
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
16
15
|
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
17
16
|
- fixed_confirmation_toast_children: Children
|
18
|
-
- fixed_confirmation_toast_custom_icon: Custom Icon
|
19
17
|
|
20
18
|
swift:
|
21
19
|
- fixed_confirmation_toast_default_swift: Default
|
@@ -4,4 +4,3 @@ export { default as FixedConfirmationToastClose } from './_fixed_confirmation_to
|
|
4
4
|
export { default as FixedConfirmationToastPositions } from './_fixed_confirmation_toast_positions.jsx'
|
5
5
|
export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
|
6
6
|
export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
|
7
|
-
export { default as FixedConfirmationToastCustomIcon } from './_fixed_confirmation_toast_custom_icon.jsx'
|
@@ -20,7 +20,6 @@ module Playbook
|
|
20
20
|
values: [nil, "top", "bottom"],
|
21
21
|
default: nil
|
22
22
|
prop :auto_close, type: Playbook::Props::Number
|
23
|
-
prop :icon, type: Playbook::Props::String
|
24
23
|
|
25
24
|
def show_text?
|
26
25
|
text.present?
|
@@ -43,24 +42,20 @@ module Playbook
|
|
43
42
|
end
|
44
43
|
|
45
44
|
def icon_value
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
def icon_class
|
59
|
-
icon.present? ? " custom_icon" : ""
|
45
|
+
case status
|
46
|
+
when "success"
|
47
|
+
"check"
|
48
|
+
when "error"
|
49
|
+
"exclamation-triangle"
|
50
|
+
when "neutral"
|
51
|
+
"info-circle"
|
52
|
+
when "tip"
|
53
|
+
"info-circle"
|
54
|
+
end
|
60
55
|
end
|
61
56
|
|
62
57
|
def classname
|
63
|
-
generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + auto_close_class
|
58
|
+
generate_classname("pb_fixed_confirmation_toast_kit", status, multi_line_class) + close_class + position_class + auto_close_class
|
64
59
|
end
|
65
60
|
end
|
66
61
|
end
|
@@ -3,7 +3,6 @@ import classnames from 'classnames'
|
|
3
3
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
5
5
|
import { isValidEmoji } from '../utilities/validEmojiChecker'
|
6
|
-
import aliasesJson from './icon_aliases.json'
|
7
6
|
|
8
7
|
export type IconSizes = "lg"
|
9
8
|
| "xs"
|
@@ -41,19 +40,6 @@ type IconProps = {
|
|
41
40
|
spin?: boolean,
|
42
41
|
} & GlobalProps
|
43
42
|
|
44
|
-
type AliasType = string | string[];
|
45
|
-
|
46
|
-
interface Aliases {
|
47
|
-
[key: string]: AliasType;
|
48
|
-
}
|
49
|
-
|
50
|
-
interface AliasesJson {
|
51
|
-
aliases: Aliases;
|
52
|
-
}
|
53
|
-
|
54
|
-
const aliases: AliasesJson = aliasesJson;
|
55
|
-
|
56
|
-
|
57
43
|
const flipMap = {
|
58
44
|
horizontal: 'fa-flip-horizontal',
|
59
45
|
vertical: 'fa-flip-vertical',
|
@@ -66,22 +52,6 @@ declare global {
|
|
66
52
|
var PB_ICONS: {[key: string]: React.FunctionComponent<any>}
|
67
53
|
}
|
68
54
|
|
69
|
-
// Resolve alias function
|
70
|
-
const resolveAlias = (icon: string): string => {
|
71
|
-
const alias = aliases.aliases[icon];
|
72
|
-
|
73
|
-
if (alias) {
|
74
|
-
if (Array.isArray(alias)) {
|
75
|
-
return alias[0];
|
76
|
-
} else {
|
77
|
-
return alias;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
return icon;
|
82
|
-
};
|
83
|
-
|
84
|
-
|
85
55
|
const Icon = (props: IconProps) => {
|
86
56
|
const {
|
87
57
|
aria = {},
|
@@ -104,8 +74,7 @@ const Icon = (props: IconProps) => {
|
|
104
74
|
spin = false,
|
105
75
|
} = props
|
106
76
|
|
107
|
-
|
108
|
-
let iconElement: ReactSVGElement | null = typeof(resolvedIcon) === "object" ? resolvedIcon : null
|
77
|
+
let iconElement: ReactSVGElement | null = typeof(icon) === "object" ? icon : null
|
109
78
|
|
110
79
|
const faClasses = {
|
111
80
|
'fa-border': border,
|
@@ -121,12 +90,12 @@ const Icon = (props: IconProps) => {
|
|
121
90
|
|
122
91
|
if (!customIcon && !iconElement) {
|
123
92
|
const PowerIcon: React.FunctionComponent<any> | undefined =
|
124
|
-
window.PB_ICONS ? window.PB_ICONS[
|
93
|
+
window.PB_ICONS ? window.PB_ICONS[icon as string] : null
|
125
94
|
|
126
95
|
if (PowerIcon) {
|
127
96
|
iconElement = <PowerIcon /> as ReactSVGElement
|
128
97
|
} else {
|
129
|
-
faClasses[`fa-${
|
98
|
+
faClasses[`fa-${icon}`] = icon as string
|
130
99
|
}
|
131
100
|
}
|
132
101
|
|
@@ -146,7 +115,7 @@ const Icon = (props: IconProps) => {
|
|
146
115
|
className
|
147
116
|
)
|
148
117
|
|
149
|
-
aria.label ? null : aria.label = `${
|
118
|
+
aria.label ? null : aria.label = `${icon} icon`
|
150
119
|
const ariaProps: {[key: string]: any} = buildAriaProps(aria)
|
151
120
|
const dataProps: {[key: string]: any} = buildDataProps(data)
|
152
121
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -168,7 +137,7 @@ const Icon = (props: IconProps) => {
|
|
168
137
|
}
|
169
138
|
</>
|
170
139
|
)
|
171
|
-
else if (isValidEmoji(
|
140
|
+
else if (isValidEmoji(icon as string))
|
172
141
|
return (
|
173
142
|
<>
|
174
143
|
<span
|
@@ -177,7 +146,7 @@ const Icon = (props: IconProps) => {
|
|
177
146
|
className={classesEmoji}
|
178
147
|
id={id}
|
179
148
|
>
|
180
|
-
{
|
149
|
+
{icon}
|
181
150
|
</span>
|
182
151
|
</>
|
183
152
|
)
|
@@ -1,6 +1 @@
|
|
1
|
-
<%= pb_rails("icon", props: { icon: "
|
2
|
-
<%= pb_rails("icon", props: { icon: "circle-arrow-right", fixed_width: true }) %>
|
3
|
-
<%= pb_rails("icon", props: { icon: "arrow-circle-right", fixed_width: true }) %>
|
4
|
-
|
5
|
-
<%= pb_rails("caption", props: { text: "Font Awesome (no alias & not in our Playbook-icons lib)", margin_y: "md" }) %>
|
6
|
-
<%= pb_rails("icon", props: { icon: "elephant", fixed_width: true }) %>
|
1
|
+
<%= pb_rails("icon", props: { icon: "user", fixed_width: true }) %>
|
@@ -1,29 +1,13 @@
|
|
1
|
-
import React from
|
1
|
+
import React from 'react'
|
2
2
|
|
3
|
-
import Icon from
|
4
|
-
import {Caption} from "../.."
|
3
|
+
import Icon from '../_icon'
|
5
4
|
|
6
5
|
const IconDefault = (props) => {
|
7
6
|
return (
|
8
7
|
<div>
|
9
|
-
<Icon
|
10
|
-
|
11
|
-
|
12
|
-
/>
|
13
|
-
<Icon fixedWidth
|
14
|
-
icon='circle-arrow-right'
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
<Icon fixedWidth
|
18
|
-
icon='arrow-circle-right'
|
19
|
-
{...props}
|
20
|
-
/>
|
21
|
-
<Caption
|
22
|
-
marginY='md'
|
23
|
-
text='Font Awesome (no alias & not in our Playbook-icons lib)'
|
24
|
-
/>
|
25
|
-
<Icon fixedWidth
|
26
|
-
icon='elephant'
|
8
|
+
<Icon
|
9
|
+
fixedWidth
|
10
|
+
icon="user"
|
27
11
|
{...props}
|
28
12
|
/>
|
29
13
|
</div>
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# rubocop:disable Style/HashLikeCase
|
4
4
|
|
5
5
|
require "open-uri"
|
6
|
-
require "json"
|
7
6
|
|
8
7
|
module Playbook
|
9
8
|
module PbIcon
|
@@ -39,8 +38,6 @@ module Playbook
|
|
39
38
|
prop :spin, type: Playbook::Props::Boolean,
|
40
39
|
default: false
|
41
40
|
|
42
|
-
ALIASES = JSON.parse(File.read(Playbook::Engine.root.join("app/pb_kits/playbook/pb_icon/icon_aliases.json")))["aliases"].freeze
|
43
|
-
|
44
41
|
def valid_emoji?
|
45
42
|
emoji_regex = /\p{Emoji}/
|
46
43
|
emoji_regex.match?(icon)
|
@@ -86,8 +83,7 @@ module Playbook
|
|
86
83
|
return unless Rails.application.config.respond_to?(:icon_path)
|
87
84
|
|
88
85
|
base_path = Rails.application.config.icon_path
|
89
|
-
|
90
|
-
icon_path = Dir.glob(Rails.root.join(base_path, "**", "#{resolved_icon}.svg")).first
|
86
|
+
icon_path = Dir.glob(Rails.root.join(base_path, "**", "#{icon}.svg")).first
|
91
87
|
icon_path if icon_path && File.exist?(icon_path)
|
92
88
|
end
|
93
89
|
|
@@ -110,22 +106,6 @@ module Playbook
|
|
110
106
|
|
111
107
|
private
|
112
108
|
|
113
|
-
def resolve_alias(icon)
|
114
|
-
aliases = ALIASES[icon]
|
115
|
-
return icon unless aliases
|
116
|
-
|
117
|
-
if aliases.is_a?(Array)
|
118
|
-
aliases.find { |alias_name| file_exists?(alias_name) } || icon
|
119
|
-
else
|
120
|
-
aliases
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
def file_exists?(alias_name)
|
125
|
-
base_path = Rails.application.config.icon_path
|
126
|
-
File.exist?(Dir.glob(Rails.root.join(base_path, "**", "#{alias_name}.svg")).first)
|
127
|
-
end
|
128
|
-
|
129
109
|
def svg_size
|
130
110
|
size.nil? ? "1x" : size
|
131
111
|
end
|
@@ -10,7 +10,7 @@ type ListProps = {
|
|
10
10
|
className?: string;
|
11
11
|
children: React.ReactNode[] | React.ReactNode;
|
12
12
|
dark?: boolean;
|
13
|
-
|
13
|
+
draggable?: boolean;
|
14
14
|
data?: Record<string, unknown>;
|
15
15
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
id?: string;
|
@@ -32,7 +32,7 @@ const List = (props: ListProps) => {
|
|
32
32
|
className,
|
33
33
|
dark = false,
|
34
34
|
data = {},
|
35
|
-
|
35
|
+
draggable = false,
|
36
36
|
htmlOptions = {},
|
37
37
|
id,
|
38
38
|
layout = "",
|
@@ -54,7 +54,7 @@ const List = (props: ListProps) => {
|
|
54
54
|
const childrenWithProps = React.Children.map(
|
55
55
|
children,
|
56
56
|
(child: React.ReactElement) => {
|
57
|
-
return React.cloneElement(child, { text, variant,
|
57
|
+
return React.cloneElement(child, { text, variant, draggable });
|
58
58
|
}
|
59
59
|
);
|
60
60
|
const ariaProps = buildAriaProps(aria);
|
@@ -74,7 +74,7 @@ const List = (props: ListProps) => {
|
|
74
74
|
return (
|
75
75
|
<>
|
76
76
|
{
|
77
|
-
|
77
|
+
draggable ? (
|
78
78
|
<Draggable.Container>
|
79
79
|
<div className={classes}>
|
80
80
|
{ordered ? (
|
@@ -11,7 +11,6 @@ type ListItemProps = {
|
|
11
11
|
children: React.ReactNode[] | React.ReactNode,
|
12
12
|
className?: string,
|
13
13
|
data?: Record<string, unknown>,
|
14
|
-
dragId?: string,
|
15
14
|
dragHandle?: boolean,
|
16
15
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
16
|
id?: string,
|
@@ -24,8 +23,7 @@ const ListItem = (props: ListItemProps) => {
|
|
24
23
|
children,
|
25
24
|
className,
|
26
25
|
data = {},
|
27
|
-
|
28
|
-
dragId,
|
26
|
+
draggable = false,
|
29
27
|
dragHandle = true,
|
30
28
|
htmlOptions = {},
|
31
29
|
id,
|
@@ -44,10 +42,8 @@ const ListItem = (props: ListItemProps) => {
|
|
44
42
|
return (
|
45
43
|
<>
|
46
44
|
{
|
47
|
-
|
48
|
-
<Draggable.Item
|
49
|
-
dragId={dragId}
|
50
|
-
>
|
45
|
+
draggable ? (
|
46
|
+
<Draggable.Item id={id}>
|
51
47
|
<li
|
52
48
|
{...ariaProps}
|
53
49
|
{...dataProps}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
2
|
-
<%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city"
|
2
|
+
<%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city" }) do %>
|
3
3
|
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
4
4
|
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
5
5
|
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
@@ -1,3 +1 @@
|
|
1
|
-
The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to any NavItem and pass that navItem any number of NavItems as children to create a collapsible nav.
|
2
|
-
|
3
|
-
The optional `collapsed` prop can also be used to set the default state for the collapsed nav on first render of the page. `collapsed` takes a boolean value that is set to true (meaning nav is collapsed) by default. Set it to false as shown here to have the nav open on first render.
|
1
|
+
The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to any NavItem and pass that navItem any number of NavItems as children to create a collapsible nav.
|
@@ -12,7 +12,6 @@ module Playbook
|
|
12
12
|
default: "regular"
|
13
13
|
prop :highlighted_border, type: Playbook::Props::Boolean, default: true
|
14
14
|
prop :collapsible, type: Playbook::Props::Boolean, default: false
|
15
|
-
prop :collapsed, type: Playbook::Props::Boolean, default: true
|
16
15
|
prop :link
|
17
16
|
prop :text
|
18
17
|
prop :collapsible_trail, type: Playbook::Props::Boolean, default: false
|
@@ -1,7 +1,7 @@
|
|
1
|
-
Overlays
|
1
|
+
Overlays require 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
2
|
|
3
|
-
The optional `layout` prop accepts
|
3
|
+
The optional `layout` prop accepts a `position` and a `size` as a key:value pair object.
|
4
4
|
|
5
|
-
The `position` key accepts `
|
5
|
+
The `position` key accepts `top`, `bottom`, `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
6
|
|
7
|
-
The `size` value
|
7
|
+
The `size` value 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. By default, `size` is set to `full` (100%) so that your overlay covers the entire container with a smooth fade from `color` at its starting edge, fading to transparent and ending at the containers opposite edge.
|
@@ -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
|
5
|
+
import { globalProps } from "../utilities/globalProps";
|
6
6
|
|
7
7
|
import Checkbox from "../pb_checkbox/_checkbox";
|
8
8
|
import ListItem from "../pb_list/_list_item";
|
@@ -16,7 +16,6 @@ export type SelectableListItemProps = {
|
|
16
16
|
className?: string;
|
17
17
|
data?: GenericObject;
|
18
18
|
defaultChecked?: boolean;
|
19
|
-
dragId?: string;
|
20
19
|
dragHandle?: boolean;
|
21
20
|
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
22
21
|
id?: string;
|
@@ -34,7 +33,6 @@ const SelectableListItem = ({
|
|
34
33
|
children,
|
35
34
|
className,
|
36
35
|
data = {},
|
37
|
-
dragId,
|
38
36
|
dragHandle = true,
|
39
37
|
defaultChecked,
|
40
38
|
htmlOptions = {},
|
@@ -69,7 +67,7 @@ const SelectableListItem = ({
|
|
69
67
|
{...props}
|
70
68
|
className={classnames(checkedState ? "checked_item" : "", className)}
|
71
69
|
dragHandle={dragHandle}
|
72
|
-
|
70
|
+
id={id}
|
73
71
|
>
|
74
72
|
<div
|
75
73
|
{...ariaProps}
|
@@ -108,9 +106,7 @@ const SelectableListItem = ({
|
|
108
106
|
text={label}
|
109
107
|
type="radio"
|
110
108
|
value={value}
|
111
|
-
|
112
|
-
//@ts-ignore
|
113
|
-
{...domSafeProps(props)}
|
109
|
+
{...props}
|
114
110
|
/>
|
115
111
|
{children}
|
116
112
|
</>
|
@@ -14,7 +14,7 @@ type SelectableListProps = {
|
|
14
14
|
children?: React.ReactElement[],
|
15
15
|
className?: string,
|
16
16
|
data?: GenericObject,
|
17
|
-
|
17
|
+
draggable?: 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
|
+
draggable = 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 draggable={draggable}
|
72
72
|
variant={props.variant}
|
73
73
|
>
|
74
74
|
{selectableListItems}
|
@@ -52,20 +52,6 @@
|
|
52
52
|
data: object.data,
|
53
53
|
id: object.id,
|
54
54
|
**combined_html_options) do %>
|
55
|
-
|
56
|
-
<%= content.presence || object.text %>
|
57
|
-
<% else %>
|
58
|
-
<%= link_to next_link, style: link_style do %>
|
59
|
-
<%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_link" }) do %>
|
60
|
-
<%= content.presence || object.text %>
|
61
|
-
<% if sorting_style? %>
|
62
|
-
<%= pb_rails("icon", props: { icon: object.sort_icon(active_item[:direction], active_item[:active]),
|
63
|
-
fixed_width: true,
|
64
|
-
classname: active_item.any? ? "pb_th_active" : "",
|
65
|
-
padding_left: "xs" }) %>
|
66
|
-
<% end %>
|
67
|
-
<% end %>
|
68
|
-
<% end %>
|
69
|
-
<% end %>
|
70
|
-
<% end %>
|
55
|
+
<%= content.presence || object.text %>
|
71
56
|
<% end %>
|
57
|
+
<% end %>
|
@@ -2,7 +2,6 @@ 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";
|
6
5
|
|
7
6
|
import DateStacked from '../pb_date_stacked/_date_stacked'
|
8
7
|
import IconCircle from '../pb_icon_circle/_icon_circle'
|
@@ -15,7 +14,7 @@ type ItemProps = {
|
|
15
14
|
icon?: string,
|
16
15
|
iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
|
17
16
|
lineStyle?: 'solid' | 'dotted',
|
18
|
-
}
|
17
|
+
}
|
19
18
|
|
20
19
|
const TimelineItem = ({
|
21
20
|
className,
|
@@ -25,7 +24,7 @@ const TimelineItem = ({
|
|
25
24
|
icon = 'user',
|
26
25
|
iconColor = 'default',
|
27
26
|
lineStyle = 'solid',
|
28
|
-
|
27
|
+
|
29
28
|
}: ItemProps) => {
|
30
29
|
const timelineItemCss = buildCss('pb_timeline_item_kit', lineStyle)
|
31
30
|
|
@@ -33,23 +32,23 @@ const TimelineItem = ({
|
|
33
32
|
|
34
33
|
return (
|
35
34
|
<div
|
36
|
-
|
37
|
-
|
35
|
+
{...htmlProps}
|
36
|
+
className={classnames(timelineItemCss, className)}
|
38
37
|
>
|
39
38
|
<div className="pb_timeline_item_left_block">
|
40
39
|
{date &&
|
41
40
|
<DateStacked
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
align="center"
|
42
|
+
date={date}
|
43
|
+
size="sm"
|
45
44
|
/>
|
46
45
|
}
|
47
46
|
</div>
|
48
47
|
<div className="pb_timeline_item_step">
|
49
48
|
<IconCircle
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
icon={icon}
|
50
|
+
size="xs"
|
51
|
+
variant={iconColor}
|
53
52
|
/>
|
54
53
|
<div className="pb_timeline_item_connector" />
|
55
54
|
</div>
|
@@ -2,7 +2,6 @@ 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'
|
6
5
|
|
7
6
|
import TimelineItem from './_item'
|
8
7
|
|
@@ -15,7 +14,7 @@ type TimelineProps = {
|
|
15
14
|
id?: string,
|
16
15
|
orientation?: string,
|
17
16
|
showDate?: boolean,
|
18
|
-
}
|
17
|
+
}
|
19
18
|
|
20
19
|
const Timeline = ({
|
21
20
|
aria = {},
|
@@ -26,7 +25,6 @@ const Timeline = ({
|
|
26
25
|
id,
|
27
26
|
orientation = 'horizontal',
|
28
27
|
showDate = false,
|
29
|
-
...props
|
30
28
|
}: TimelineProps) => {
|
31
29
|
const ariaProps = buildAriaProps(aria)
|
32
30
|
const dataProps = buildDataProps(data)
|
@@ -35,11 +33,11 @@ const Timeline = ({
|
|
35
33
|
const timelineCss = buildCss('pb_timeline_kit', `_${orientation}`, dateStyle)
|
36
34
|
return (
|
37
35
|
<div
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
{...ariaProps}
|
37
|
+
{...dataProps}
|
38
|
+
{...htmlProps}
|
39
|
+
className={classnames(timelineCss, className)}
|
40
|
+
id={id}
|
43
41
|
>
|
44
42
|
{children}
|
45
43
|
</div>
|