playbook_ui 13.5.0 → 13.6.0.pre.alpha.play845allkitsbytypes1219
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_body/_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate.html.erb +12 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate.jsx +50 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate.md +4 -0
- data/app/pb_kits/playbook/pb_body/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_body/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +26 -22
- data/app/pb_kits/playbook/pb_collapsible/index.js +4 -0
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_file_upload/file_upload.rb +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.scss +0 -8
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -4
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +1 -9
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +6 -6
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +1 -1
- data/app/pb_kits/playbook/pb_radio/radio.rb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +3 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +2 -0
- data/app/pb_kits/playbook/pb_select/select.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +1 -1
- data/app/pb_kits/playbook/pb_source/source.rb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_header.html.erb +31 -27
- data/app/pb_kits/playbook/pb_table/docs/_table_header.md +8 -1
- data/app/pb_kits/playbook/pb_table/styles/_table_header.scss +20 -1
- data/app/pb_kits/playbook/pb_table/table_header.html.erb +23 -49
- data/app/pb_kits/playbook/pb_table/table_header.rb +34 -6
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -2
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +15 -14
- data/app/pb_kits/playbook/pb_title/_title.tsx +4 -4
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +6 -6
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate.html.erb +12 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate.jsx +53 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate.md +4 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title/title.rb +1 -1
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -1
- data/app/pb_kits/playbook/tokens/_overflow.scss +10 -0
- data/app/pb_kits/playbook/utilities/_overflow.scss +22 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +23 -8
- data/dist/menu.yml +235 -110
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +4 -2
- data/lib/playbook/overflow.rb +33 -0
- data/lib/playbook/props/base.rb +1 -1
- data/lib/playbook/props/hash.rb +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +16 -7
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
$text_align_values: (
|
3
2
|
start: start,
|
4
3
|
end: end,
|
@@ -22,6 +21,15 @@ $text_align_values: (
|
|
22
21
|
}
|
23
22
|
}
|
24
23
|
|
24
|
+
.pb_th_link:hover {
|
25
|
+
background-color: rgba($primary, 0.03);
|
26
|
+
color: $primary !important;
|
27
|
+
}
|
28
|
+
|
29
|
+
.pb_th_link, .pb_th_nolink{
|
30
|
+
padding: $space_xxs;
|
31
|
+
}
|
32
|
+
|
25
33
|
[class^=pb_table] {
|
26
34
|
thead {
|
27
35
|
[class^=pb_th_active] {
|
@@ -29,3 +37,14 @@ $text_align_values: (
|
|
29
37
|
}
|
30
38
|
}
|
31
39
|
}
|
40
|
+
|
41
|
+
[class*="pb_table_header_dropdown"][class*="_vertical"] {
|
42
|
+
&[class*="_normal"] {
|
43
|
+
[class*="pb_nav_list_kit_item"][class*="pb_nav_list_item"] {
|
44
|
+
&[class*="_link"] {
|
45
|
+
border-left-width: 0px;
|
46
|
+
background-color: #fff !important;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -4,61 +4,35 @@
|
|
4
4
|
class: object.classname,
|
5
5
|
data: object.data,
|
6
6
|
id: "pb-th#{object.id}") do %>
|
7
|
-
<%
|
8
|
-
|
9
|
-
<%= pb_rails("flex", props:{ align: object.align_content }) do %>
|
10
|
-
<%= content.presence || content_tag(:span, item[:item], class: "pb_th_active") %>
|
11
|
-
<span class="pb_th_active">
|
12
|
-
<%= pb_rails("icon", props: { icon: object.sort_icon(item[:direction]),
|
13
|
-
fixed_width: true,
|
14
|
-
classname: "pb_th_active",
|
15
|
-
padding_left: "xs" }) %>
|
16
|
-
</span>
|
17
|
-
<% end %>
|
18
|
-
<% end %>
|
19
|
-
<% end %>
|
20
|
-
<% if object.sort_menu.all? { |item| item[:active] == false } %>
|
21
|
-
<%= pb_rails("flex", props:{ align: object.align_content }) do %>
|
7
|
+
<% unless sorting_style? %>
|
8
|
+
<%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_nolink" }) do %>
|
22
9
|
<%= content.presence || object.text %>
|
23
|
-
<%= pb_rails("icon", props: { icon: "arrow-up-arrow-down",
|
24
|
-
fixed_width: true,
|
25
|
-
padding_left: "xs" }) %>
|
26
10
|
<% end %>
|
27
11
|
<% else %>
|
28
|
-
<%=
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
12
|
+
<%= link_to next_link, style: link_style do %>
|
13
|
+
<%= pb_rails("flex", props:{ align: object.align_content, justify: object.justify_sort_icon, classname: "pb_th_link" }) do %>
|
14
|
+
<%= content.presence || object.text %>
|
15
|
+
<% if sorting_style? %>
|
16
|
+
<%= pb_rails("icon", props: { icon: object.sort_icon(active_item[:direction], active_item[:active]),
|
17
|
+
fixed_width: true,
|
18
|
+
classname: active_item.any? ? "pb_th_active" : "",
|
19
|
+
padding_left: "xs" }) %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% if use_dropdown_select %>
|
24
|
+
<%= pb_rails("popover", props: { classname: "pb_filter_sort_menu",
|
25
|
+
close_on_click: "outside",
|
26
|
+
trigger_element_id: "pb-th#{object.id}",
|
27
|
+
tooltip_id: "sort-filter-btn-tooltip#{object.id}",
|
28
|
+
position: object.placement ,
|
29
|
+
padding: 'none'}) do %>
|
30
|
+
<%= pb_rails("nav", props: {classname: "pb_table_header_dropdown"}) do %>
|
31
|
+
<% object.sort_menu.each do |item| %>
|
32
|
+
<%= pb_rails("nav/item", props: { text: item[:item], link: item[:link], icon_right: sort_icon(item[:direction], item[:active]), active: item[:active] }) %>
|
46
33
|
<% end %>
|
47
34
|
<% end %>
|
48
35
|
<% end %>
|
49
36
|
<% end %>
|
50
37
|
<% end %>
|
51
38
|
<% end %>
|
52
|
-
<% if object.sort_menu != [{}] && object.colspan == 1 %>
|
53
|
-
<script>
|
54
|
-
document.addEventListener("DOMContentLoaded", function() {
|
55
|
-
var thId = `<%= "#pb-th#{object.id}" %>`
|
56
|
-
var firstLink = `<%= next_link %>`
|
57
|
-
var thElement = document.querySelector(thId);
|
58
|
-
|
59
|
-
thElement.addEventListener("click", function() {
|
60
|
-
window.location.href = firstLink;
|
61
|
-
});
|
62
|
-
});
|
63
|
-
</script>
|
64
|
-
<% end %>
|
@@ -9,15 +9,20 @@ module Playbook
|
|
9
9
|
prop :align_content, type: Playbook::Props::Enum,
|
10
10
|
values: %w[start center end stretch baseline none],
|
11
11
|
default: "center"
|
12
|
+
prop :justify_sort_icon, type: Playbook::Props::Enum,
|
13
|
+
values: %w[start center end stretch around between evenly none],
|
14
|
+
default: "between"
|
12
15
|
prop :colspan, type: Playbook::Props::Number,
|
13
16
|
default: 1
|
14
17
|
prop :placement, type: Playbook::Props::Enum,
|
15
18
|
values: %w[top bottom left right top-start top-end bottom-start bottom-end right-start right-end left-start left-end],
|
16
|
-
default: "bottom-
|
19
|
+
default: "bottom-end"
|
17
20
|
prop :sort_menu, type: Playbook::Props::HashArray,
|
18
21
|
default: [{}]
|
19
22
|
prop :text, type: Playbook::Props::String,
|
20
23
|
default: ""
|
24
|
+
prop :sort_dropdown, type: Playbook::Props::Boolean,
|
25
|
+
default: false
|
21
26
|
|
22
27
|
def classname
|
23
28
|
generate_classname("pb_table_header_kit", align_class)
|
@@ -30,23 +35,46 @@ module Playbook
|
|
30
35
|
def next_link
|
31
36
|
return sort_menu[0][:link] if sort_menu.all? { |item| item[:active] == false }
|
32
37
|
|
38
|
+
link = ""
|
39
|
+
|
33
40
|
sort_menu.each_with_index do |item, index|
|
34
41
|
if item[:active] == true
|
35
42
|
next_index = (index + 1) % sort_menu.length
|
36
|
-
sort_menu[next_index][:link]
|
43
|
+
link = sort_menu[next_index][:link]
|
37
44
|
end
|
38
45
|
end
|
46
|
+
link
|
47
|
+
end
|
48
|
+
|
49
|
+
def sorting_style?
|
50
|
+
sort_menu != [{}]
|
51
|
+
end
|
52
|
+
|
53
|
+
def use_dropdown_select
|
54
|
+
sort_menu != [{}] && (object.colspan > 1 || sort_dropdown)
|
39
55
|
end
|
40
56
|
|
41
|
-
def sort_icon(direction)
|
57
|
+
def sort_icon(direction, active)
|
42
58
|
case direction
|
43
59
|
when "asc"
|
44
|
-
"sort-amount-up"
|
60
|
+
active ? "sort-amount-up" : ""
|
45
61
|
when "desc"
|
46
|
-
"sort-amount-down"
|
62
|
+
active ? "sort-amount-down" : ""
|
47
63
|
else
|
48
|
-
""
|
64
|
+
"arrow-up-arrow-down"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def link_style
|
69
|
+
active_item.any? ? "" : "color: #687887;"
|
70
|
+
end
|
71
|
+
|
72
|
+
def active_item
|
73
|
+
active_item = {}
|
74
|
+
sort_menu.each do |item|
|
75
|
+
active_item = item if item[:active] == true
|
49
76
|
end
|
77
|
+
active_item
|
50
78
|
end
|
51
79
|
end
|
52
80
|
end
|
@@ -11,7 +11,7 @@ module Playbook
|
|
11
11
|
prop :error
|
12
12
|
prop :inline, type: Playbook::Props::Boolean,
|
13
13
|
default: false
|
14
|
-
prop :input_options, type: Playbook::Props::
|
14
|
+
prop :input_options, type: Playbook::Props::HashProp,
|
15
15
|
default: {}
|
16
16
|
prop :label
|
17
17
|
prop :name
|
@@ -19,7 +19,7 @@ module Playbook
|
|
19
19
|
prop :required, type: Playbook::Props::Boolean,
|
20
20
|
default: false
|
21
21
|
prop :type, default: "text"
|
22
|
-
prop :validation, type: Playbook::Props::
|
22
|
+
prop :validation, type: Playbook::Props::HashProp,
|
23
23
|
default: {}
|
24
24
|
prop :value
|
25
25
|
prop :add_on, type: Playbook::Props::NestedProps,
|
@@ -20,7 +20,7 @@ type TimeStackedProps = {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
const TimeStackedDefault = (props: TimeStackedProps): React.ReactElement => {
|
23
|
-
if (props.date) deprecatedProps(
|
23
|
+
if (props.date) deprecatedProps() //date prop is deprecated, use time instead
|
24
24
|
|
25
25
|
const {
|
26
26
|
align = 'left',
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@import "../tokens/screen_sizes";
|
4
4
|
@import './title_mixin';
|
5
5
|
|
6
|
-
[class^=pb_title_kit]{
|
6
|
+
[class^=pb_title_kit] {
|
7
7
|
&[class*=_1] {
|
8
8
|
@include pb_title_1;
|
9
9
|
@include title_colors;
|
@@ -36,22 +36,23 @@
|
|
36
36
|
}
|
37
37
|
|
38
38
|
@each $size, $size_value in $breakpoints_grid {
|
39
|
-
@
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
39
|
+
@for $title_size_value from 1 through 4 {
|
40
|
+
$min_size: map-get($size_value, "min");
|
41
|
+
$max_size: map-get($size_value, "max");
|
42
|
+
&[class*=_#{$size}_#{$title_size_value}] {
|
43
|
+
@include break_on($min_size, $max_size) {
|
44
|
+
@if $title_size_value == 1 { @include pb_title_1; }
|
45
|
+
@else if $title_size_value == 2 { @include pb_title_2; }
|
46
|
+
@else if $title_size_value == 3 { @include pb_title_3; }
|
47
|
+
@else if $title_size_value == 4 { @include pb_title_4; }
|
48
|
+
@include title_colors;
|
49
|
+
@include title_truncate;
|
50
|
+
@if $title_size_value != 4 { @include pb_title_bold; }
|
52
51
|
}
|
52
|
+
}
|
53
53
|
}
|
54
54
|
}
|
55
|
+
|
55
56
|
&.dark {
|
56
57
|
@include pb_title_dark;
|
57
58
|
}
|
@@ -17,12 +17,12 @@ type TitleProps = {
|
|
17
17
|
size?: SizeType | SizeResponsiveType,
|
18
18
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span",
|
19
19
|
text?: string,
|
20
|
-
truncate?: null |
|
20
|
+
truncate?: null | "1" | "2" | "3" | "4" | "5",
|
21
21
|
variant?: null | "link",
|
22
22
|
} & GlobalProps
|
23
23
|
|
24
24
|
const Title = (props: TitleProps): React.ReactElement => {
|
25
|
-
if (props.variant) deprecatedProps(
|
25
|
+
if (props.variant) deprecatedProps() //variant prop is deprecated, use color instead
|
26
26
|
const {
|
27
27
|
aria = {},
|
28
28
|
children,
|
@@ -41,12 +41,12 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
41
41
|
const ariaProps: {[key: string]: string | number} = buildAriaProps(aria)
|
42
42
|
const dataProps: {[key: string]: string | number} = buildDataProps(data)
|
43
43
|
const getBold = bold ? '' : 'thin'
|
44
|
-
const isTruncated = truncate ? `
|
44
|
+
const isTruncated = truncate ? `truncate-${truncate}` : null
|
45
45
|
const isSizeNumberOrString = typeof size === "number" || typeof size === "string"
|
46
46
|
|
47
47
|
const buildResponsiveSizeCss = () => {
|
48
48
|
let css = ''
|
49
|
-
|
49
|
+
|
50
50
|
if (!isSizeNumberOrString) {
|
51
51
|
Object.entries(size).forEach((sizeObj) => {
|
52
52
|
css += `pb_title_kit_${sizeObj[0]}_${sizeObj[1]} `
|
@@ -18,11 +18,11 @@ $pb_title_colors: (
|
|
18
18
|
}
|
19
19
|
|
20
20
|
$pb_title_truncate: (
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
truncate-1: 1,
|
22
|
+
truncate-2: 2,
|
23
|
+
truncate-3: 3,
|
24
|
+
truncate-4: 4,
|
25
|
+
truncate-5: 5
|
26
26
|
);
|
27
27
|
|
28
28
|
@mixin title_truncate {
|
@@ -31,7 +31,7 @@ $pb_title_truncate: (
|
|
31
31
|
overflow: hidden;
|
32
32
|
display: -webkit-box;
|
33
33
|
-webkit-line-clamp: $number;
|
34
|
-
-webkit-box-orient: vertical;
|
34
|
+
-webkit-box-orient: vertical;
|
35
35
|
}
|
36
36
|
}
|
37
37
|
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% lorem = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, minus. Nisi beatae voluptatum labore sequi. Nemo accusantium corrupti, reiciendis magnam tenetur perferendis esse pariatur voluptas eaque hic vel rem nihil quidem dolorum ex dolor, libero ullam placeat, sapiente eos. Cumque obcaecati dignissimos molestiae, minima quibusdam sint maxime libero accusantium animi quis quia maiores enim ipsum, esse, modi laudantium illum error!" %>
|
2
|
+
|
3
|
+
<%= pb_rails("flex", props: { orientation: "column", max_width: "md" }) do %>
|
4
|
+
<%= pb_rails("caption", props: { text: "After first row" }) %>
|
5
|
+
<%= pb_rails("title", props: { text: lorem, truncate: "1", size: 4, margin_bottom: "md" }) %>
|
6
|
+
|
7
|
+
<%= pb_rails("caption", props: { text: "After second row" }) %>
|
8
|
+
<%= pb_rails("title", props: { text: lorem, truncate: "2", size: 4, margin_bottom: "md" }) %>
|
9
|
+
|
10
|
+
<%= pb_rails("caption", props: { text: "After third row" }) %>
|
11
|
+
<%= pb_rails("title", props: { text: lorem, truncate: "3", size: 4 }) %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
import Title from '../_title';
|
4
|
+
import Caption from '../../pb_caption/_caption'
|
5
|
+
import Flex from '../../pb_flex/_flex'
|
6
|
+
|
7
|
+
const TitleTruncate = (props) => {
|
8
|
+
const lorem = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, minus. Nisi beatae voluptatum labore sequi. Nemo accusantium corrupti, reiciendis magnam tenetur perferendis esse pariatur voluptas eaque hic vel rem nihil quidem dolorum ex dolor, libero ullam placeat, sapiente eos. Cumque obcaecati dignissimos molestiae, minima quibusdam sint maxime libero accusantium animi quis quia maiores enim ipsum, esse, modi laudantium illum error!"
|
9
|
+
|
10
|
+
return (
|
11
|
+
<Flex
|
12
|
+
maxWidth="md"
|
13
|
+
orientation="column"
|
14
|
+
>
|
15
|
+
<Caption
|
16
|
+
text="After first row"
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
<Title
|
20
|
+
marginBottom="md"
|
21
|
+
size={4}
|
22
|
+
text={lorem}
|
23
|
+
truncate="1"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
|
27
|
+
<Caption
|
28
|
+
text="After second row"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
<Title
|
32
|
+
marginBottom="md"
|
33
|
+
size={4}
|
34
|
+
text={lorem}
|
35
|
+
truncate="2"
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
|
39
|
+
<Caption
|
40
|
+
text="After third row"
|
41
|
+
{...props}
|
42
|
+
/>
|
43
|
+
<Title
|
44
|
+
size={4}
|
45
|
+
text={lorem}
|
46
|
+
truncate="3"
|
47
|
+
{...props}
|
48
|
+
/>
|
49
|
+
</Flex>
|
50
|
+
)
|
51
|
+
}
|
52
|
+
|
53
|
+
export default TitleTruncate
|
@@ -4,9 +4,11 @@ examples:
|
|
4
4
|
- title_light_weight: Light Weight UI
|
5
5
|
- title_colors: Colors
|
6
6
|
- title_responsive: Responsive
|
7
|
+
- title_truncate: Truncate
|
7
8
|
|
8
9
|
react:
|
9
10
|
- title_default: Default UI
|
10
11
|
- title_light_weight: Light Weight UI
|
11
12
|
- title_colors: Colors
|
12
13
|
- title_responsive: Responsive
|
14
|
+
- title_truncate: Truncate
|
@@ -2,3 +2,4 @@ export { default as TitleDefault } from './_title_default.jsx'
|
|
2
2
|
export { default as TitleLightWeight } from './_title_light_weight.jsx'
|
3
3
|
export { default as TitleColors } from './_title_colors.jsx'
|
4
4
|
export { default as TitleResponsive } from './_title_responsive.jsx'
|
5
|
+
export { default as TitleTruncate } from './_title_truncate.jsx'
|
@@ -5,7 +5,7 @@ require "action_view"
|
|
5
5
|
module Playbook
|
6
6
|
module PbToggle
|
7
7
|
class Toggle < Playbook::KitBase
|
8
|
-
prop :input_options, type: Playbook::Props::
|
8
|
+
prop :input_options, type: Playbook::Props::HashProp,
|
9
9
|
default: {}
|
10
10
|
|
11
11
|
prop :checked, type: Playbook::Props::Boolean,
|
@@ -19,7 +19,7 @@ module Playbook
|
|
19
19
|
prop :name
|
20
20
|
prop :options, type: Playbook::Props::HashArray,
|
21
21
|
default: []
|
22
|
-
prop :input_options, type: Playbook::Props::
|
22
|
+
prop :input_options, type: Playbook::Props::HashProp,
|
23
23
|
default: {}
|
24
24
|
|
25
25
|
prop :is_multi, type: Playbook::Props::Boolean,
|
@@ -0,0 +1,22 @@
|
|
1
|
+
@import "../tokens/overflow";
|
2
|
+
|
3
|
+
$overflow_classes: (
|
4
|
+
visible: $visible,
|
5
|
+
hidden: $hidden,
|
6
|
+
scroll: $scroll,
|
7
|
+
auto: $auto,
|
8
|
+
);
|
9
|
+
|
10
|
+
$variants: (
|
11
|
+
overflow_x: "overflow-x",
|
12
|
+
overflow_y: "overflow-y",
|
13
|
+
overflow: "overflow",
|
14
|
+
);
|
15
|
+
|
16
|
+
@each $variant_name, $variant_property in $variants {
|
17
|
+
@each $class_name, $overflow_value in $overflow_classes {
|
18
|
+
.#{$variant_name}_#{$class_name} {
|
19
|
+
#{$variant_property}: #{$overflow_value} !important;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
@@ -128,6 +128,13 @@ type TextAlign = {
|
|
128
128
|
textAlign?: "start" | "end" | "left" | "right" | "center" | "justify" | "justifyAll" | "matchParent",
|
129
129
|
}
|
130
130
|
|
131
|
+
type OverflowTypes = "scroll" | "visible" | "hidden" | "auto"
|
132
|
+
type Overflow = {
|
133
|
+
overflowX?: OverflowTypes,
|
134
|
+
overflowY?: OverflowTypes,
|
135
|
+
overflow?: OverflowTypes
|
136
|
+
}
|
137
|
+
|
131
138
|
type ZIndexType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10
|
132
139
|
type ZIndexResponsiveType = {[key: string]: ZIndexType}
|
133
140
|
type ZIndex = {
|
@@ -138,7 +145,7 @@ type ZIndex = {
|
|
138
145
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
139
146
|
BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
140
147
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
141
|
-
LineHeight & Margin & MaxWidth & NumberSpacing & Order & Padding &
|
148
|
+
LineHeight & Margin & MaxWidth & NumberSpacing & Order & Overflow & Padding &
|
142
149
|
Position & Shadow & TextAlign & ZIndex & { hover?: string };
|
143
150
|
|
144
151
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
@@ -255,6 +262,14 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
255
262
|
css += borderRadius ? `border_radius_${borderRadius} ` : ''
|
256
263
|
return css
|
257
264
|
},
|
265
|
+
overflowProps: ({ overflow, overflowX, overflowY }: Overflow) => {
|
266
|
+
let css = ''
|
267
|
+
css += overflow ? `overflow_${overflow}` : ''
|
268
|
+
css += overflowX ? `overflow_x_${overflowX}` : ''
|
269
|
+
css += overflowY ? `overflow_y_${overflowY}` : ''
|
270
|
+
return css
|
271
|
+
},
|
272
|
+
|
258
273
|
darkProps: ({ dark }: Dark) => dark ? 'dark' : '',
|
259
274
|
numberSpacingProps: ({ numberSpacing }: NumberSpacing) => {
|
260
275
|
let css = ''
|
@@ -417,13 +432,13 @@ export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {})
|
|
417
432
|
}
|
418
433
|
|
419
434
|
|
420
|
-
export const deprecatedProps = (
|
421
|
-
if (process.env.NODE_ENV === 'development') {
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
}
|
435
|
+
export const deprecatedProps = (): void => {
|
436
|
+
// if (process.env.NODE_ENV === 'development') {
|
437
|
+
// /* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
438
|
+
// props.forEach((prop) => {
|
439
|
+
// console.warn(`${kit} Kit: The prop '${prop}' is deprecated and will be removed in a future release!`)
|
440
|
+
// })
|
441
|
+
// }
|
427
442
|
}
|
428
443
|
|
429
444
|
export const domSafeProps = (props: {[key: string]: string}): {[key: string]: string} => {
|