playbook_ui 10.23.0.pre.alpha2 → 10.23.0.pre.cachetest
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 +0 -1
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/pb_avatar/{_avatar.tsx → _avatar.jsx} +14 -13
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -2
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +1 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +1 -1
- data/app/pb_kits/playbook/pb_background/_background.jsx +3 -8
- data/app/pb_kits/playbook/pb_background/_background.scss +8 -24
- data/app/pb_kits/playbook/pb_background/background.rb +6 -6
- data/app/pb_kits/playbook/pb_background/docs/_background_image.html.erb +2 -50
- data/app/pb_kits/playbook/pb_background/docs/_background_image.jsx +28 -71
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -5
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +4 -8
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -18
- data/app/pb_kits/playbook/pb_button/button.rb +3 -13
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +1 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.jsx +1 -1
- data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +0 -88
- data/app/pb_kits/playbook/pb_card/card_body.rb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +0 -3
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.jsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.jsx +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +3 -24
- data/app/pb_kits/playbook/pb_currency/currency.rb +3 -12
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.jsx +1 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +10 -17
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/docs/_flex_align.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/flex_item.rb +24 -2
- data/app/pb_kits/playbook/pb_form_group/_form_group.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +0 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -3
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/{_image.tsx → _image.jsx} +15 -11
- data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
- data/app/pb_kits/playbook/pb_image/docs/{_default_image.tsx → _default_image.jsx} +1 -1
- data/app/pb_kits/playbook/pb_image/docs/index.js +4 -4
- data/app/pb_kits/playbook/pb_image/image.rb +1 -1
- data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -5
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +1 -1
- data/app/pb_kits/playbook/pb_online_status/{_online_status.tsx → _online_status.jsx} +6 -4
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +1 -2
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -3
- data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
- data/app/pb_kits/playbook/pb_popover/index.js +9 -4
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +93 -83
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +8 -15
- data/app/pb_kits/playbook/pb_table/_table.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -14
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -1
- data/app/pb_kits/playbook/pb_time/_time.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.jsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.jsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +1 -1
- data/app/pb_kits/playbook/plugins/pb_chart.js +4 -8
- data/app/pb_kits/playbook/types.js +4 -0
- data/app/pb_kits/playbook/utilities/globalProps.js +97 -0
- data/app/pb_kits/playbook/utilities/{props.ts → props.js} +7 -9
- data/lib/playbook/classnames.rb +0 -11
- data/lib/playbook/kit_base.rb +0 -22
- data/lib/playbook/version.rb +2 -2
- metadata +9 -42
- data/app/pb_kits/playbook/pb_background/docs/_background_image.md +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_form.html.erb +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_form.jsx +0 -14
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +0 -26
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -35
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.html.erb +0 -27
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.jsx +0 -44
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -215
- data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +0 -40
- data/app/pb_kits/playbook/utilities/_align_content.scss +0 -29
- data/app/pb_kits/playbook/utilities/_align_items.scss +0 -35
- data/app/pb_kits/playbook/utilities/_align_self.scss +0 -29
- data/app/pb_kits/playbook/utilities/_flex.scss +0 -15
- data/app/pb_kits/playbook/utilities/_flex_direction.scss +0 -19
- data/app/pb_kits/playbook/utilities/_flex_grow.scss +0 -9
- data/app/pb_kits/playbook/utilities/_flex_shrink.scss +0 -9
- data/app/pb_kits/playbook/utilities/_flex_wrap.scss +0 -14
- data/app/pb_kits/playbook/utilities/_flexbox.scss +0 -11
- data/app/pb_kits/playbook/utilities/_justify_content.scss +0 -23
- data/app/pb_kits/playbook/utilities/_justify_self.scss +0 -19
- data/app/pb_kits/playbook/utilities/_order.scss +0 -55
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -274
- data/lib/playbook/align_content.rb +0 -29
- data/lib/playbook/align_items.rb +0 -29
- data/lib/playbook/align_self.rb +0 -29
- data/lib/playbook/flex.rb +0 -29
- data/lib/playbook/flex_direction.rb +0 -29
- data/lib/playbook/flex_grow.rb +0 -29
- data/lib/playbook/flex_shrink.rb +0 -29
- data/lib/playbook/flex_wrap.rb +0 -29
- data/lib/playbook/justify_content.rb +0 -29
- data/lib/playbook/justify_self.rb +0 -29
- data/lib/playbook/order.rb +0 -29
@@ -7,8 +7,6 @@ examples:
|
|
7
7
|
- button_block_content: Button Block Content
|
8
8
|
- button_accessibility: Button Accessibility Options
|
9
9
|
- button_options: Button Additional Options
|
10
|
-
- button_size: Button Size
|
11
|
-
- button_form: Button Form Attribute
|
12
10
|
react:
|
13
11
|
- button_default: Button Variants
|
14
12
|
- button_full_width: Button Full Width
|
@@ -17,5 +15,3 @@ examples:
|
|
17
15
|
- button_block_content: Button Block Content
|
18
16
|
- button_accessibility: Button Accessibility Options
|
19
17
|
- button_options: Button Additional Options (onClick)
|
20
|
-
- button_size: Button Size
|
21
|
-
- button_form: Button Form Attribute
|
@@ -5,5 +5,3 @@ export { default as ButtonLoading } from './_button_loading.jsx'
|
|
5
5
|
export { default as ButtonBlockContent } from './_button_block_content.jsx'
|
6
6
|
export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
7
7
|
export { default as ButtonOptions } from './_button_options.jsx'
|
8
|
-
export { default as ButtonSize } from './_button_size.jsx'
|
9
|
-
export { default as ButtonForm } from './_button_form.jsx'
|
@@ -5,7 +5,7 @@ import classnames from 'classnames'
|
|
5
5
|
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
7
|
|
8
|
-
import { globalProps } from '../utilities/globalProps'
|
8
|
+
import { globalProps } from '../utilities/globalProps.js'
|
9
9
|
|
10
10
|
type ButtonToolbarProps = {
|
11
11
|
aria?: object,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { deprecatedProps, globalProps } from '../utilities/globalProps'
|
6
|
+
import { deprecatedProps, globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type CaptionProps = {
|
9
9
|
aria?: object,
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import { get } from 'lodash'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
|
-
import { globalProps } from '../utilities/globalProps'
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type CardPropTypes = {
|
10
10
|
aria?: object,
|
@@ -4,7 +4,7 @@
|
|
4
4
|
class: object.classname,
|
5
5
|
aria: object.aria,
|
6
6
|
dark: object.dark) do %>
|
7
|
-
<%= pb_rails("card/card_body", props: { padding: object.body_padding
|
7
|
+
<%= pb_rails("card/card_body", props: { padding: object.body_padding }) do %>
|
8
8
|
<%= content %>
|
9
9
|
<% end if content.present? %>
|
10
10
|
<% end %>
|
@@ -36,94 +36,6 @@ module Playbook
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
def body_flex_direction
|
40
|
-
if flex_direction.present?
|
41
|
-
"flex_direction_#{flex_direction}"
|
42
|
-
else
|
43
|
-
""
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def body_flex_wrap
|
48
|
-
if flex_wrap.present?
|
49
|
-
"flex_wrap_#{flex_wrap}"
|
50
|
-
else
|
51
|
-
""
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def body_justify_content
|
56
|
-
if justify_content.present?
|
57
|
-
"justify_content_#{justify_content}"
|
58
|
-
else
|
59
|
-
""
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def body_justify_self
|
64
|
-
if justify_self.present?
|
65
|
-
"justify_self_#{justify_self}"
|
66
|
-
else
|
67
|
-
""
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def body_align_items
|
72
|
-
if align_items.present?
|
73
|
-
"align_items_#{align_items}"
|
74
|
-
else
|
75
|
-
""
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def body_align_content
|
80
|
-
if align_content.present?
|
81
|
-
"align_content_#{align_content}"
|
82
|
-
else
|
83
|
-
""
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def body_align_self
|
88
|
-
if align_self.present?
|
89
|
-
"align_self_#{align_self}"
|
90
|
-
else
|
91
|
-
""
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def body_flex
|
96
|
-
if flex.present?
|
97
|
-
"flex_#{flex}"
|
98
|
-
else
|
99
|
-
""
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
def body_flex_grow
|
104
|
-
if flex_grow.present?
|
105
|
-
"flex_grow_#{flex_grow}"
|
106
|
-
else
|
107
|
-
""
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
def body_flex_shrink
|
112
|
-
if flex_shrink.present?
|
113
|
-
"flex_shrink_#{flex_shrink}"
|
114
|
-
else
|
115
|
-
""
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
def body_order
|
120
|
-
if order.present?
|
121
|
-
"order_#{order}"
|
122
|
-
else
|
123
|
-
""
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
39
|
private
|
128
40
|
|
129
41
|
def selected_class
|
@@ -4,7 +4,7 @@ module Playbook
|
|
4
4
|
module PbCard
|
5
5
|
class CardBody < Playbook::KitBase
|
6
6
|
def classname
|
7
|
-
generate_classname("pb_card_body_kit", padding,
|
7
|
+
generate_classname("pb_card_body_kit", padding, separator: " ")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -5,7 +5,7 @@ import Body from '../pb_body/_body.jsx'
|
|
5
5
|
import Icon from '../pb_icon/_icon.jsx'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
7
|
import classnames from 'classnames'
|
8
|
-
import { globalProps } from '../utilities/globalProps'
|
8
|
+
import { globalProps } from '../utilities/globalProps.js'
|
9
9
|
|
10
10
|
type CheckboxProps = {
|
11
11
|
aria?: object,
|
@@ -14,7 +14,6 @@ type CircleChartProps = {
|
|
14
14
|
children: Node,
|
15
15
|
className?: string,
|
16
16
|
colors: array,
|
17
|
-
dark?: Boolean,
|
18
17
|
data?: Object,
|
19
18
|
dataLabelHtml: string,
|
20
19
|
dataLabels: boolean,
|
@@ -41,7 +40,6 @@ const CircleChart = (props: CircleChartProps) => {
|
|
41
40
|
children,
|
42
41
|
className,
|
43
42
|
colors = [],
|
44
|
-
dark = false,
|
45
43
|
data = {},
|
46
44
|
dataLabelHtml = '<div>{point.name}</div>',
|
47
45
|
dataLabels = false,
|
@@ -83,7 +81,6 @@ const CircleChart = (props: CircleChartProps) => {
|
|
83
81
|
borderColor: roundedBorderColor,
|
84
82
|
borderWidth: roundedBorderWidth,
|
85
83
|
chartData: formattedChartData,
|
86
|
-
dark,
|
87
84
|
title,
|
88
85
|
type: style,
|
89
86
|
showInLegend: legend,
|
@@ -7,7 +7,7 @@ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
|
7
7
|
import type { Callback } from '../types'
|
8
8
|
|
9
9
|
import { noop } from '../utilities/props'
|
10
|
-
import { globalProps } from '../utilities/globalProps'
|
10
|
+
import { globalProps } from '../utilities/globalProps.js'
|
11
11
|
|
12
12
|
import Button from '../pb_button/_button'
|
13
13
|
import Icon from '../pb_icon/_icon'
|
@@ -4,7 +4,7 @@ import React, { useState } from 'react'
|
|
4
4
|
|
5
5
|
import classnames from 'classnames'
|
6
6
|
|
7
|
-
import { globalProps } from '../utilities/globalProps'
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
9
9
|
|
10
10
|
import CollapsibleContent from './child_kits/CollapsibleContent'
|
@@ -4,7 +4,7 @@ import classnames from 'classnames'
|
|
4
4
|
import React, { useContext } from 'react'
|
5
5
|
import AnimateHeight from 'react-animate-height'
|
6
6
|
import { buildCss } from '../../utilities/props'
|
7
|
-
import { globalProps } from '../../utilities/globalProps'
|
7
|
+
import { globalProps } from '../../utilities/globalProps.js'
|
8
8
|
|
9
9
|
import CollapsibleContext from '../context'
|
10
10
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
8
|
|
9
9
|
import Body from '../pb_body/_body'
|
@@ -11,7 +11,6 @@ import Caption from '../pb_caption/_caption'
|
|
11
11
|
import Title from '../pb_title/_title'
|
12
12
|
|
13
13
|
type CurrencyProps = {
|
14
|
-
abbreviate?: boolean,
|
15
14
|
align?: 'center' | 'left' | 'right',
|
16
15
|
amount: string,
|
17
16
|
aria?: object,
|
@@ -35,7 +34,6 @@ const sizes = {
|
|
35
34
|
|
36
35
|
const Currency = (props: CurrencyProps) => {
|
37
36
|
const {
|
38
|
-
abbreviate = false,
|
39
37
|
align = 'left',
|
40
38
|
aria = {},
|
41
39
|
amount,
|
@@ -71,24 +69,6 @@ const Currency = (props: CurrencyProps) => {
|
|
71
69
|
className
|
72
70
|
)
|
73
71
|
|
74
|
-
const getFormattedNumber = (input) => new Intl.NumberFormat('en-US', {
|
75
|
-
notation: 'compact',
|
76
|
-
maximumFractionDigits: 1,
|
77
|
-
}).format(input)
|
78
|
-
|
79
|
-
type AbbrType = 'amount' | 'unit'
|
80
|
-
|
81
|
-
const getAbbreviatedValue = (abbrType: AbbrType) => {
|
82
|
-
const num = `${getFormattedNumber(whole.split(',').join(''))}`,
|
83
|
-
isAmount = abbrType === 'amount',
|
84
|
-
isUnit = abbrType === 'unit'
|
85
|
-
return isAmount ? num.slice(0, -1) : isUnit ? num.slice(-1) : ''
|
86
|
-
}
|
87
|
-
|
88
|
-
const getAmount = abbreviate ? getAbbreviatedValue('amount') : whole,
|
89
|
-
getAbbreviation = abbreviate ? getAbbreviatedValue('unit') : null,
|
90
|
-
getDecimalValue = abbreviate ? '' : `.${decimal}`
|
91
|
-
|
92
72
|
return (
|
93
73
|
<div
|
94
74
|
{...ariaProps}
|
@@ -112,7 +92,7 @@ const Currency = (props: CurrencyProps) => {
|
|
112
92
|
dark={dark}
|
113
93
|
size={sizes[size]}
|
114
94
|
>
|
115
|
-
{
|
95
|
+
{`${whole}`}
|
116
96
|
</Title>
|
117
97
|
|
118
98
|
<Body
|
@@ -120,11 +100,10 @@ const Currency = (props: CurrencyProps) => {
|
|
120
100
|
color="light"
|
121
101
|
dark={dark}
|
122
102
|
>
|
123
|
-
{getAbbreviation}
|
124
103
|
<If condition={unit}>
|
125
104
|
{unit}
|
126
105
|
<Else />
|
127
|
-
{
|
106
|
+
{`.${decimal}`}
|
128
107
|
</If>
|
129
108
|
</Body>
|
130
109
|
</div>
|
@@ -33,9 +33,6 @@ module Playbook
|
|
33
33
|
prop :dark, type: Playbook::Props::Boolean,
|
34
34
|
default: false
|
35
35
|
|
36
|
-
prop :abbreviate, type: Playbook::Props::Boolean,
|
37
|
-
default: false
|
38
|
-
|
39
36
|
def classname
|
40
37
|
generate_classname("pb_currency_kit", align, size, dark_class)
|
41
38
|
end
|
@@ -51,7 +48,7 @@ module Playbook
|
|
51
48
|
def title_props
|
52
49
|
{
|
53
50
|
size: size_value,
|
54
|
-
text:
|
51
|
+
text: whole_value,
|
55
52
|
classname: "pb_currency_value",
|
56
53
|
dark: dark,
|
57
54
|
}
|
@@ -87,18 +84,12 @@ module Playbook
|
|
87
84
|
amount.split(".").first.to_s
|
88
85
|
end
|
89
86
|
|
90
|
-
def abbreviated_value(index = 0..-2)
|
91
|
-
value = amount.split(".").first.split(",").join("")
|
92
|
-
abbreviated_num = number_to_human(value, units: { thousand: "K", million: "M", billion: "B", trillion: "T" }).gsub(/\s+/, "").to_s
|
93
|
-
abbreviated_num[index]
|
94
|
-
end
|
95
|
-
|
96
87
|
def units_element
|
97
88
|
_, decimal_part = amount.split(".")
|
98
|
-
if unit.nil?
|
89
|
+
if unit.nil?
|
99
90
|
decimal_part.nil? ? ".00" : ".#{decimal_part}"
|
100
91
|
else
|
101
|
-
|
92
|
+
unit
|
102
93
|
end
|
103
94
|
end
|
104
95
|
|
@@ -5,11 +5,9 @@ examples:
|
|
5
5
|
- currency_size: Size
|
6
6
|
- currency_alignment: Alignment
|
7
7
|
- currency_no_symbol: No Symbol
|
8
|
-
- currency_abbreviated: Abbreviate Larger Amounts
|
9
8
|
|
10
9
|
react:
|
11
10
|
- currency_variants: Variants
|
12
11
|
- currency_size: Size
|
13
12
|
- currency_alignment: Alignment
|
14
13
|
- currency_no_symbol: No Symbol
|
15
|
-
- currency_abbreviated: Abbreviate Larger Amounts
|
@@ -2,4 +2,3 @@ export { default as CurrencyVariants } from './_currency_variants.jsx'
|
|
2
2
|
export { default as CurrencySize } from './_currency_size.jsx'
|
3
3
|
export { default as CurrencyAlignment } from './_currency_alignment.jsx'
|
4
4
|
export { default as CurrencyNoSymbol } from './_currency_no_symbol.jsx'
|
5
|
-
export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
import Body from '../pb_body/_body'
|
9
9
|
import StatChange from '../pb_stat_change/_stat_change'
|
@@ -5,7 +5,7 @@ import classnames from 'classnames'
|
|
5
5
|
import Modal from 'react-modal'
|
6
6
|
|
7
7
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
|
-
import { globalProps } from '../utilities/globalProps'
|
8
|
+
import { globalProps } from '../utilities/globalProps.js'
|
9
9
|
|
10
10
|
import Button from '../pb_button/_button'
|
11
11
|
import DialogHeader from './child_kits/_dialog_header'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildCss } from '../../utilities/props'
|
6
|
-
import { globalProps } from '../../utilities/globalProps'
|
6
|
+
import { globalProps } from '../../utilities/globalProps.js'
|
7
7
|
|
8
8
|
// Body component
|
9
9
|
const DialogBody = (props: DialogBodyProps) => {
|
@@ -4,7 +4,7 @@ import React from 'react'
|
|
4
4
|
import classnames from 'classnames'
|
5
5
|
|
6
6
|
import { buildCss } from '../../utilities/props'
|
7
|
-
import { globalProps } from '../../utilities/globalProps'
|
7
|
+
import { globalProps } from '../../utilities/globalProps.js'
|
8
8
|
|
9
9
|
import Flex from '../../pb_flex/_flex'
|
10
10
|
import SectionSeparator from '../../pb_section_separator/_section_separator'
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React, { useContext } from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../../utilities/props'
|
6
|
-
import { globalProps } from '../../utilities/globalProps'
|
6
|
+
import { globalProps } from '../../utilities/globalProps.js'
|
7
7
|
|
8
8
|
import { CloseIcon } from '../_close_icon'
|
9
9
|
import { DialogContext } from '../_dialog_context'
|
@@ -4,7 +4,7 @@ import React, { useCallback } from 'react'
|
|
4
4
|
import { useDropzone } from 'react-dropzone'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
|
7
|
-
import { buildCss,
|
7
|
+
import { buildCss, noop } from '../utilities/props'
|
8
8
|
import { globalProps } from '../utilities/globalProps'
|
9
9
|
import type { Callback } from '../types'
|
10
10
|
|
@@ -14,17 +14,15 @@ import Card from '../pb_card/_card'
|
|
14
14
|
type FileUploadProps = {
|
15
15
|
accept?: array<string>,
|
16
16
|
className?: string,
|
17
|
-
data?: object,
|
18
17
|
acceptedFilesDescription?: string,
|
19
18
|
onFilesAccepted: Callback,
|
20
19
|
}
|
21
20
|
|
22
21
|
const FileUpload = (props: FileUploadProps) => {
|
23
22
|
const {
|
24
|
-
accept =
|
23
|
+
accept = ['*'],
|
25
24
|
acceptedFilesDescription = '',
|
26
25
|
className,
|
27
|
-
data = {},
|
28
26
|
onFilesAccepted = noop,
|
29
27
|
} = props
|
30
28
|
const onDrop = useCallback((files) => {
|
@@ -36,22 +34,17 @@ const FileUpload = (props: FileUploadProps) => {
|
|
36
34
|
onDrop,
|
37
35
|
})
|
38
36
|
|
39
|
-
const acceptedFileTypes = () => {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const dataProps = buildDataProps(data)
|
37
|
+
const acceptedFileTypes = accept.map((fileType) => {
|
38
|
+
if (fileType.startsWith('image/')) {
|
39
|
+
return fileType.replace('image/', ' ')
|
40
|
+
} else {
|
41
|
+
return fileType
|
42
|
+
}
|
43
|
+
})
|
50
44
|
|
51
45
|
return (
|
52
46
|
<div
|
53
47
|
className={classnames(buildCss('pb_file_upload_kit'), globalProps(props), className)}
|
54
|
-
{...dataProps}
|
55
48
|
{...getRootProps()}
|
56
49
|
>
|
57
50
|
<Card>
|
@@ -60,7 +53,7 @@ const FileUpload = (props: FileUploadProps) => {
|
|
60
53
|
<If condition={isDragActive}>
|
61
54
|
<p>{'Drop the files here ...'}</p>
|
62
55
|
<Else />
|
63
|
-
<p>{
|
56
|
+
<p>{`Choose a file or drag it here. The accepted file types are: ${acceptedFilesDescription || acceptedFileTypes}`}</p>
|
64
57
|
</If>
|
65
58
|
</Body>
|
66
59
|
</Card>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
type FlexProps = {
|
8
8
|
children: array<React.ReactNode> | React.ReactNode,
|
9
9
|
className?: string,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { buildCss } from '../utilities/props'
|
5
|
-
import { globalProps } from '../utilities/globalProps'
|
5
|
+
import { globalProps } from '../utilities/globalProps.js'
|
6
6
|
type FlexItemPropTypes = {
|
7
7
|
children: array<React.ReactNode> | React.ReactNode,
|
8
8
|
fixedSize: string,
|
@@ -8,11 +8,17 @@ module Playbook
|
|
8
8
|
default: false
|
9
9
|
prop :shrink, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
|
-
|
11
|
+
prop :flex, type: Playbook::Props::Enum,
|
12
|
+
values: %w[0 1 2 3 4 5 6 7 8 9 10 11 12 none],
|
13
|
+
default: "none"
|
12
14
|
prop :overflow, type: Playbook::Props::Enum,
|
13
15
|
values: %w[auto hidden inherit initial scroll visible] + [nil],
|
14
16
|
default: nil
|
15
17
|
|
18
|
+
prop :order, type: Playbook::Props::Enum,
|
19
|
+
values: %w[1 2 3 4 5 6 7 8 9 10 11 12 first none],
|
20
|
+
default: "none"
|
21
|
+
|
16
22
|
prop :align_self, type: Playbook::Props::Enum,
|
17
23
|
values: %w[start center end stretch] + [nil],
|
18
24
|
default: nil
|
@@ -21,7 +27,7 @@ module Playbook
|
|
21
27
|
default: false
|
22
28
|
|
23
29
|
def classname
|
24
|
-
generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, display_flex_class) + overflow_class + align_self_class
|
30
|
+
generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, flex_class, display_flex_class) + overflow_class + order_class + align_self_class
|
25
31
|
end
|
26
32
|
|
27
33
|
def style_value
|
@@ -53,6 +59,22 @@ module Playbook
|
|
53
59
|
def shrink_class
|
54
60
|
shrink ? "shrink" : nil
|
55
61
|
end
|
62
|
+
|
63
|
+
def flex_class
|
64
|
+
if flex == "none"
|
65
|
+
nil
|
66
|
+
else
|
67
|
+
"flex_#{flex}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def order_class
|
72
|
+
if order == "none"
|
73
|
+
""
|
74
|
+
else
|
75
|
+
"order_#{order}"
|
76
|
+
end
|
77
|
+
end
|
56
78
|
end
|
57
79
|
end
|
58
80
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type FormGroupProps = {
|
9
9
|
aria?: object,
|
@@ -41,7 +41,6 @@
|
|
41
41
|
border-bottom-right-radius: 0;
|
42
42
|
border-top-right-radius: 0;
|
43
43
|
min-height: 45px;
|
44
|
-
margin-bottom: 16px;
|
45
44
|
}
|
46
45
|
|
47
46
|
& > [class^=pb_button_kit]:not(:first-child) {
|
@@ -49,7 +48,6 @@
|
|
49
48
|
border-top-left-radius: 0;
|
50
49
|
border-left-width: 0;
|
51
50
|
min-height: 45px;
|
52
|
-
margin-bottom: 16px;
|
53
51
|
}
|
54
52
|
|
55
53
|
& > [class^=pb_date_picker_kit]:not(:last-child) {
|
@@ -3,8 +3,8 @@ import React from 'react'
|
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import Title from '../pb_title/_title.jsx'
|
5
5
|
import Icon from '../pb_icon/_icon.jsx'
|
6
|
-
import Avatar from '../pb_avatar/_avatar'
|
7
|
-
import { globalProps } from '../utilities/globalProps'
|
6
|
+
import Avatar from '../pb_avatar/_avatar.jsx'
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type FormPillProps = {
|
10
10
|
className?: string,
|