playbook_ui 10.21.0.pre.alpha.rg1 → 10.22.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/_playbook.scss +1 -11
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -2
- data/app/pb_kits/playbook/pb_avatar/{_avatar.jsx → _avatar.tsx} +13 -14
- 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 +8 -3
- data/app/pb_kits/playbook/pb_background/_background.scss +24 -8
- data/app/pb_kits/playbook/pb_background/background.rb +6 -6
- data/app/pb_kits/playbook/pb_background/docs/_background_image.html.erb +50 -2
- data/app/pb_kits/playbook/pb_background/docs/_background_image.jsx +71 -28
- data/app/pb_kits/playbook/pb_background/docs/_background_image.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +5 -1
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -0
- 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 +8 -4
- data/app/pb_kits/playbook/pb_button/_button.scss +18 -1
- data/app/pb_kits/playbook/pb_button/button.rb +13 -3
- data/app/pb_kits/playbook/pb_button/button.test.js +13 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_form.html.erb +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_form.jsx +14 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +26 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +1 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +2 -0
- 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_checkbox/_checkbox.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +1 -0
- 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 +24 -3
- data/app/pb_kits/playbook/pb_currency/currency.rb +12 -3
- data/app/pb_kits/playbook/pb_currency/currency.test.js +35 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.html.erb +27 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.jsx +44 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +215 -0
- 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 +17 -10
- data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +40 -0
- 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_form_group/_form_group.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +3 -0
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +1 -0
- 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_stat_value/_icon_stat_value.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
- data/app/pb_kits/playbook/pb_image/{_image.jsx → _image.tsx} +11 -15
- 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 +5 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +1 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -0
- 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.jsx → _online_status.tsx} +4 -6
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +2 -1
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +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 +5 -0
- 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 +4 -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 +14 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -0
- 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 +8 -4
- data/app/pb_kits/playbook/utilities/_align_content.scss +6 -6
- data/app/pb_kits/playbook/utilities/_align_items.scss +16 -5
- data/app/pb_kits/playbook/utilities/_align_self.scss +6 -6
- data/app/pb_kits/playbook/utilities/_flex.scss +4 -4
- data/app/pb_kits/playbook/utilities/_flex_direction.scss +4 -4
- data/app/pb_kits/playbook/utilities/_flex_grow.scss +2 -2
- data/app/pb_kits/playbook/utilities/_flex_shrink.scss +2 -2
- data/app/pb_kits/playbook/utilities/_flex_wrap.scss +3 -3
- data/app/pb_kits/playbook/utilities/_flexbox.scss +11 -0
- data/app/pb_kits/playbook/utilities/_justify_content.scss +6 -6
- data/app/pb_kits/playbook/utilities/_justify_self.scss +5 -5
- data/app/pb_kits/playbook/utilities/_order.scss +14 -14
- data/app/pb_kits/playbook/utilities/globalProps.ts +156 -0
- data/app/pb_kits/playbook/utilities/{props.js → props.ts} +9 -7
- data/lib/playbook/align_items.rb +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +21 -9
- data/app/pb_kits/playbook/types.js +0 -4
@@ -5,7 +5,7 @@ import classnames from 'classnames'
|
|
5
5
|
|
6
6
|
import DateTime from '../pb_kit/dateTime.js'
|
7
7
|
import { buildCss } from '../utilities/props'
|
8
|
-
import { globalProps } from '../utilities/globalProps
|
8
|
+
import { globalProps } from '../utilities/globalProps'
|
9
9
|
|
10
10
|
import Body from '../pb_body/_body'
|
11
11
|
import Caption from '../pb_caption/_caption'
|
@@ -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'
|
7
7
|
|
8
8
|
type TitleProps = {
|
9
9
|
aria?: object,
|
@@ -6,7 +6,7 @@ import AsyncSelect from 'react-select/async'
|
|
6
6
|
import CreateableSelect from 'react-select/creatable'
|
7
7
|
import AsyncCreateableSelect from 'react-select/async-creatable'
|
8
8
|
import { get, isString, uniqueId } from 'lodash'
|
9
|
-
import { globalProps } from '../utilities/globalProps
|
9
|
+
import { globalProps } from '../utilities/globalProps'
|
10
10
|
import classnames from 'classnames'
|
11
11
|
|
12
12
|
import Control from './components/Control'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import React from 'react'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
5
|
-
import { globalProps } from '../utilities/globalProps
|
5
|
+
import { globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
7
|
type UserBadgeProps = {
|
8
8
|
aria?: object,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
import React from 'react'
|
7
7
|
import classnames from 'classnames'
|
8
8
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
9
|
-
import { globalProps } from '../utilities/globalProps
|
9
|
+
import { globalProps } from '../utilities/globalProps'
|
10
10
|
import Joyride from 'react-joyride'
|
11
11
|
import Button from '../pb_button/_button'
|
12
12
|
import Flex from '../pb_flex/_flex'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import { globalProps } from '../utilities/globalProps
|
5
|
+
import { globalProps } from '../utilities/globalProps'
|
6
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
7
|
|
8
8
|
import Caption from '../pb_caption/_caption'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import Highcharts from 'highcharts'
|
2
2
|
|
3
3
|
import { highchartsTheme } from '../pb_dashboard/pbChartsLightTheme'
|
4
|
+
import { highchartsDarkTheme } from '../pb_dashboard/pbChartsDarkTheme'
|
4
5
|
import colors from '../tokens/exports/_colors.scss'
|
5
6
|
|
6
7
|
import pie from 'highcharts/modules/variable-pie'
|
@@ -67,10 +68,14 @@ class pbChart {
|
|
67
68
|
}
|
68
69
|
}
|
69
70
|
|
71
|
+
setupTheme() {
|
72
|
+
this.options.dark ? Highcharts.setOptions(highchartsDarkTheme) : Highcharts.setOptions(highchartsTheme)
|
73
|
+
}
|
74
|
+
|
70
75
|
setupGauge(options) {
|
71
76
|
highchartsMore(Highcharts)
|
72
77
|
solidGauge(Highcharts)
|
73
|
-
|
78
|
+
this.setupTheme()
|
74
79
|
|
75
80
|
Highcharts.chart(this.defaults.id, {
|
76
81
|
chart: {
|
@@ -140,7 +145,7 @@ class pbChart {
|
|
140
145
|
}
|
141
146
|
|
142
147
|
setupPieChart(options) {
|
143
|
-
|
148
|
+
this.setupTheme()
|
144
149
|
Highcharts.chart(this.defaults.id, {
|
145
150
|
title: {
|
146
151
|
text: this.defaults.title,
|
@@ -187,8 +192,7 @@ class pbChart {
|
|
187
192
|
}
|
188
193
|
|
189
194
|
setupChart(options) {
|
190
|
-
|
191
|
-
|
195
|
+
this.setupTheme()
|
192
196
|
const configOptions = {
|
193
197
|
title: {
|
194
198
|
text: this.defaults.title,
|
@@ -1,29 +1,29 @@
|
|
1
1
|
.align_content_start {
|
2
2
|
display: flex;
|
3
|
-
align-content: start;
|
3
|
+
align-content: start !important;
|
4
4
|
}
|
5
5
|
|
6
6
|
.align_content_end {
|
7
7
|
display: flex;
|
8
|
-
align-content: end;
|
8
|
+
align-content: end !important;
|
9
9
|
}
|
10
10
|
|
11
11
|
.align_content_center {
|
12
12
|
display: flex;
|
13
|
-
align-content: center;
|
13
|
+
align-content: center !important;
|
14
14
|
}
|
15
15
|
|
16
16
|
.align_content_space_between {
|
17
17
|
display: flex;
|
18
|
-
align-content: space-between;
|
18
|
+
align-content: space-between !important;
|
19
19
|
}
|
20
20
|
|
21
21
|
.align_content_space_around {
|
22
22
|
display: flex;
|
23
|
-
align-content: space-around;
|
23
|
+
align-content: space-around !important;
|
24
24
|
}
|
25
25
|
|
26
26
|
.align_content_space_evenly {
|
27
27
|
display: flex;
|
28
|
-
align-content: space-evenly;
|
28
|
+
align-content: space-evenly !important;
|
29
29
|
}
|
@@ -1,24 +1,35 @@
|
|
1
|
+
.align_items_flex_start {
|
2
|
+
display: flex;
|
3
|
+
align-items: flex-start !important;
|
4
|
+
}
|
5
|
+
|
6
|
+
.align_items_flex_end {
|
7
|
+
display: flex;
|
8
|
+
align-items: flex-end !important;
|
9
|
+
}
|
10
|
+
|
1
11
|
.align_items_start {
|
2
12
|
display: flex;
|
3
|
-
align-items:
|
13
|
+
align-items: start !important;
|
4
14
|
}
|
5
15
|
|
6
16
|
.align_items_end {
|
7
17
|
display: flex;
|
8
|
-
align-items:
|
18
|
+
align-items: end !important;
|
9
19
|
}
|
10
20
|
|
21
|
+
|
11
22
|
.align_items_center {
|
12
23
|
display: flex;
|
13
|
-
align-items: center;
|
24
|
+
align-items: center !important;
|
14
25
|
}
|
15
26
|
|
16
27
|
.align_items_baseline {
|
17
28
|
display: flex;
|
18
|
-
align-items: baseline;
|
29
|
+
align-items: baseline !important;
|
19
30
|
}
|
20
31
|
|
21
32
|
.align_items_stretch {
|
22
33
|
display: flex;
|
23
|
-
align-items: stretch;
|
34
|
+
align-items: stretch !important;
|
24
35
|
}
|
@@ -1,29 +1,29 @@
|
|
1
1
|
.align_self_start {
|
2
2
|
display: flex;
|
3
|
-
align-self: start;
|
3
|
+
align-self: start !important;
|
4
4
|
}
|
5
5
|
|
6
6
|
.align_self_end {
|
7
7
|
display: flex;
|
8
|
-
align-self: end;
|
8
|
+
align-self: end !important;
|
9
9
|
}
|
10
10
|
|
11
11
|
.align_self_auto {
|
12
12
|
display: flex;
|
13
|
-
align-self: auto;
|
13
|
+
align-self: auto !important;
|
14
14
|
}
|
15
15
|
|
16
16
|
.align_self_center {
|
17
17
|
display: flex;
|
18
|
-
align-self: center;
|
18
|
+
align-self: center !important;
|
19
19
|
}
|
20
20
|
|
21
21
|
.align_self_stretch {
|
22
22
|
display: flex;
|
23
|
-
align-self: stretch;
|
23
|
+
align-self: stretch !important;
|
24
24
|
}
|
25
25
|
|
26
26
|
.align_self_baseline {
|
27
27
|
display: flex;
|
28
|
-
align-self: baseline;
|
28
|
+
align-self: baseline !important;
|
29
29
|
}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
.flex_auto {
|
2
|
-
flex: auto;
|
2
|
+
flex: auto !important;
|
3
3
|
}
|
4
4
|
|
5
5
|
.flex_initial {
|
6
|
-
flex: initial;
|
6
|
+
flex: initial !important;
|
7
7
|
}
|
8
8
|
|
9
9
|
.flex_none {
|
10
|
-
flex: none;
|
10
|
+
flex: none !important;
|
11
11
|
}
|
12
12
|
|
13
13
|
.flex_1 {
|
14
|
-
flex: 1;
|
14
|
+
flex: 1 !important;
|
15
15
|
}
|
@@ -1,19 +1,19 @@
|
|
1
1
|
.flex_direction_row {
|
2
2
|
display: flex;
|
3
|
-
flex-direction: row;
|
3
|
+
flex-direction: row !important;
|
4
4
|
}
|
5
5
|
|
6
6
|
.flex_direction_column {
|
7
7
|
display: flex;
|
8
|
-
flex-direction: column;
|
8
|
+
flex-direction: column !important;
|
9
9
|
}
|
10
10
|
|
11
11
|
.flex_direction_row_reverse {
|
12
12
|
display: flex;
|
13
|
-
flex-direction: row-reverse;
|
13
|
+
flex-direction: row-reverse !important;
|
14
14
|
}
|
15
15
|
|
16
16
|
.flex_direction_column_reverse {
|
17
17
|
display: flex;
|
18
|
-
flex-direction: column-reverse;
|
18
|
+
flex-direction: column-reverse !important;
|
19
19
|
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
.flex_wrap_wrap {
|
2
2
|
display: flex;
|
3
|
-
flex-wrap: wrap;
|
3
|
+
flex-wrap: wrap !important;
|
4
4
|
}
|
5
5
|
|
6
6
|
.flex_wrap_nowrap {
|
7
7
|
display: flex;
|
8
|
-
flex-wrap: nowrap;
|
8
|
+
flex-wrap: nowrap !important;
|
9
9
|
}
|
10
10
|
|
11
11
|
.flex_wrap_wrap_reverse {
|
12
12
|
display: flex;
|
13
|
-
flex-wrap: wrap-reverse;
|
13
|
+
flex-wrap: wrap-reverse !important;
|
14
14
|
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
@import './utilities/flex_direction';
|
2
|
+
@import './utilities/justify_content';
|
3
|
+
@import './utilities/flex_wrap';
|
4
|
+
@import './utilities/justify_self';
|
5
|
+
@import './utilities/align_items';
|
6
|
+
@import './utilities/align_content';
|
7
|
+
@import './utilities/align_self';
|
8
|
+
@import './utilities/flex';
|
9
|
+
@import './utilities/flex_grow';
|
10
|
+
@import './utilities/flex_shrink';
|
11
|
+
@import './utilities/order';
|
@@ -1,23 +1,23 @@
|
|
1
1
|
.justify_content_start {
|
2
|
-
justify-content: start;
|
2
|
+
justify-content: start !important;
|
3
3
|
}
|
4
4
|
|
5
5
|
.justify_content_end {
|
6
|
-
justify-content: end;
|
6
|
+
justify-content: end !important;
|
7
7
|
}
|
8
8
|
|
9
9
|
.justify_content_center {
|
10
|
-
justify-content: center;
|
10
|
+
justify-content: center !important;
|
11
11
|
}
|
12
12
|
|
13
13
|
.justify_content_space_between {
|
14
|
-
justify-content: space-between;
|
14
|
+
justify-content: space-between !important;
|
15
15
|
}
|
16
16
|
|
17
17
|
.justify_content_space_around {
|
18
|
-
justify-content: space-around;
|
18
|
+
justify-content: space-around !important;
|
19
19
|
}
|
20
20
|
|
21
21
|
.justify_content_space_evenly {
|
22
|
-
justify-content: space-evenly;
|
22
|
+
justify-content: space-evenly !important;
|
23
23
|
}
|
@@ -1,19 +1,19 @@
|
|
1
1
|
.justify_self_auto {
|
2
|
-
justify-self: auto;
|
2
|
+
justify-self: auto !important;
|
3
3
|
}
|
4
4
|
|
5
5
|
.justify_self_start {
|
6
|
-
justify-self: start;
|
6
|
+
justify-self: start !important;
|
7
7
|
}
|
8
8
|
|
9
9
|
.justify_self_end {
|
10
|
-
justify-self: end;
|
10
|
+
justify-self: end !important;
|
11
11
|
}
|
12
12
|
|
13
13
|
.justify_self_center {
|
14
|
-
justify-self: center;
|
14
|
+
justify-self: center !important;
|
15
15
|
}
|
16
16
|
|
17
17
|
.justify_self_stretch {
|
18
|
-
justify-self: stretch;
|
18
|
+
justify-self: stretch !important;
|
19
19
|
}
|
@@ -1,55 +1,55 @@
|
|
1
1
|
.order_1 {
|
2
|
-
order: 1;
|
2
|
+
order: 1 !important;
|
3
3
|
}
|
4
4
|
|
5
5
|
.order_2 {
|
6
|
-
order: 2;
|
6
|
+
order: 2 !important;
|
7
7
|
}
|
8
8
|
|
9
9
|
.order_3 {
|
10
|
-
order: 3;
|
10
|
+
order: 3 !important;
|
11
11
|
}
|
12
12
|
|
13
13
|
.order_4 {
|
14
|
-
order: 4;
|
14
|
+
order: 4 !important;
|
15
15
|
}
|
16
16
|
|
17
17
|
.order_5 {
|
18
|
-
order: 5;
|
18
|
+
order: 5 !important;
|
19
19
|
}
|
20
20
|
|
21
21
|
.order_6 {
|
22
|
-
order: 6;
|
22
|
+
order: 6 !important;
|
23
23
|
}
|
24
24
|
|
25
25
|
.order_7 {
|
26
|
-
order: 7;
|
26
|
+
order: 7 !important;
|
27
27
|
}
|
28
28
|
|
29
29
|
.order_8 {
|
30
|
-
order: 8;
|
30
|
+
order: 8 !important;
|
31
31
|
}
|
32
32
|
|
33
33
|
.order_9 {
|
34
|
-
order: 9;
|
34
|
+
order: 9 !important;
|
35
35
|
}
|
36
36
|
|
37
37
|
.order_10 {
|
38
|
-
order: 10;
|
38
|
+
order: 10 !important;
|
39
39
|
}
|
40
40
|
|
41
41
|
.order_11 {
|
42
|
-
order: 11;
|
42
|
+
order: 11 !important;
|
43
43
|
}
|
44
44
|
|
45
45
|
.order_12 {
|
46
|
-
order: 12;
|
46
|
+
order: 12 !important;
|
47
47
|
}
|
48
48
|
|
49
49
|
.order_none {
|
50
|
-
order: none;
|
50
|
+
order: none !important;
|
51
51
|
}
|
52
52
|
|
53
53
|
.order_first {
|
54
|
-
order: -1;
|
54
|
+
order: -1 !important;
|
55
55
|
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
type Sizes = "xs" | "sm" | "md" | "lg" | "xl"
|
2
|
+
type None = "none"
|
3
|
+
|
4
|
+
type AllSizes = None & Sizes
|
5
|
+
|
6
|
+
type Margin = {
|
7
|
+
marginRight?: AllSizes,
|
8
|
+
marginLeft?: AllSizes,
|
9
|
+
marginTop?: AllSizes,
|
10
|
+
marginBottom?: AllSizes,
|
11
|
+
marginX?: AllSizes,
|
12
|
+
marginY?: AllSizes,
|
13
|
+
margin?: AllSizes,
|
14
|
+
}
|
15
|
+
|
16
|
+
type Padding = {
|
17
|
+
paddingRight?: AllSizes,
|
18
|
+
paddingLeft?: AllSizes,
|
19
|
+
paddingTop?: AllSizes,
|
20
|
+
paddingBottom?: AllSizes,
|
21
|
+
paddingX?: AllSizes,
|
22
|
+
paddingY?: AllSizes,
|
23
|
+
padding?: AllSizes,
|
24
|
+
}
|
25
|
+
|
26
|
+
type Dark = {
|
27
|
+
dark?: boolean,
|
28
|
+
}
|
29
|
+
|
30
|
+
type NumberSpacing = {
|
31
|
+
numberSpacing?: "tabular",
|
32
|
+
}
|
33
|
+
|
34
|
+
type MaxWidth = {
|
35
|
+
maxWidth?: Sizes,
|
36
|
+
}
|
37
|
+
|
38
|
+
type ZIndex = {
|
39
|
+
zIndex?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10,
|
40
|
+
}
|
41
|
+
|
42
|
+
type Shadow = {
|
43
|
+
shadow?: "none" | "deep" | "deeper" | "deepest",
|
44
|
+
}
|
45
|
+
|
46
|
+
type LineHeight = {
|
47
|
+
lineHeight?: "loosest" | "looser" | "loose" | "normal" | "tight" | "tighter" | "tightest",
|
48
|
+
}
|
49
|
+
|
50
|
+
type Display = {
|
51
|
+
display?: "block" | "flex" | "hidden" | "inline_block" | "inline" | "inline_flex",
|
52
|
+
}
|
53
|
+
|
54
|
+
type Cursor = {
|
55
|
+
cursor?: "pointer",
|
56
|
+
}
|
57
|
+
|
58
|
+
type BorderRadius = {
|
59
|
+
borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "rounded",
|
60
|
+
}
|
61
|
+
|
62
|
+
export type GlobalProps = BorderRadius & Cursor & Dark & Display & LineHeight & Margin & MaxWidth & NumberSpacing & Padding & Shadow & ZIndex
|
63
|
+
|
64
|
+
// Prop categories
|
65
|
+
const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} = {
|
66
|
+
spacingProps: ({
|
67
|
+
marginRight,
|
68
|
+
marginLeft,
|
69
|
+
marginTop,
|
70
|
+
marginBottom,
|
71
|
+
marginX,
|
72
|
+
marginY,
|
73
|
+
margin,
|
74
|
+
paddingRight,
|
75
|
+
paddingLeft,
|
76
|
+
paddingTop,
|
77
|
+
paddingBottom,
|
78
|
+
paddingX,
|
79
|
+
paddingY,
|
80
|
+
padding,
|
81
|
+
}: Margin & Padding) => {
|
82
|
+
let css = ''
|
83
|
+
css += marginRight ? `mr_${marginRight} ` : ''
|
84
|
+
css += marginLeft ? `ml_${marginLeft} ` : ''
|
85
|
+
css += marginTop ? `mt_${marginTop} ` : ''
|
86
|
+
css += marginBottom ? `mb_${marginBottom} ` : ''
|
87
|
+
css += marginX ? `mx_${marginX} ` : ''
|
88
|
+
css += marginY ? `my_${marginY} ` : ''
|
89
|
+
css += margin ? `m_${margin} ` : ''
|
90
|
+
css += paddingRight ? `pr_${paddingRight} ` : ''
|
91
|
+
css += paddingLeft ? `pl_${paddingLeft} ` : ''
|
92
|
+
css += paddingTop ? `pt_${paddingTop} ` : ''
|
93
|
+
css += paddingBottom ? `pb_${paddingBottom} ` : ''
|
94
|
+
css += paddingX ? `px_${paddingX} ` : ''
|
95
|
+
css += paddingY ? `py_${paddingY} ` : ''
|
96
|
+
css += padding ? `p_${padding} ` : ''
|
97
|
+
return css
|
98
|
+
},
|
99
|
+
darkProps: ({ dark }: Dark) => {
|
100
|
+
let css = ''
|
101
|
+
css += dark ? 'dark' : ''
|
102
|
+
return css
|
103
|
+
},
|
104
|
+
numberSpacingProps: ({ numberSpacing }: NumberSpacing) => {
|
105
|
+
let css = ''
|
106
|
+
css += numberSpacing ? `ns_${numberSpacing} ` : ''
|
107
|
+
return css
|
108
|
+
},
|
109
|
+
maxWidthProps: ({ maxWidth }: MaxWidth) => {
|
110
|
+
let css = ''
|
111
|
+
css += maxWidth ? `max_width_${maxWidth } ` : ''
|
112
|
+
return css
|
113
|
+
},
|
114
|
+
zIndexProps: ({ zIndex }: ZIndex) => {
|
115
|
+
let css = ''
|
116
|
+
css += zIndex ? `z_index_${zIndex } ` : ''
|
117
|
+
return css
|
118
|
+
},
|
119
|
+
shadowProps: ({ shadow }: Shadow) => {
|
120
|
+
let css = ''
|
121
|
+
css += shadow ? `shadow_${shadow} ` : ''
|
122
|
+
return css
|
123
|
+
},
|
124
|
+
lineHeightProps: ({ lineHeight }: LineHeight) => {
|
125
|
+
let css = ''
|
126
|
+
css += lineHeight ? `line_height_${lineHeight} ` : ''
|
127
|
+
return css
|
128
|
+
},
|
129
|
+
displayProps: ({ display }: Display) => {
|
130
|
+
let css = ''
|
131
|
+
css += display ? `display_${display} ` : ''
|
132
|
+
return css
|
133
|
+
},
|
134
|
+
cursorProps: ({ cursor }: Cursor) => {
|
135
|
+
let css = ''
|
136
|
+
css += cursor ? `cursor_${cursor} ` : ''
|
137
|
+
return css
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
// All Exported as a single function
|
142
|
+
export const globalProps = (props: GlobalProps, defaultProps: {[key: string]: string} | {} = {}): string => {
|
143
|
+
const allProps = { ...props, ...defaultProps }
|
144
|
+
return Object.keys(PROP_CATEGORIES).map((key) => {
|
145
|
+
return PROP_CATEGORIES[key](allProps)
|
146
|
+
}).join("")
|
147
|
+
}
|
148
|
+
|
149
|
+
export const deprecatedProps = (kit: string, props: string[] = []): void => {
|
150
|
+
if (process.env.NODE_ENV === 'development') {
|
151
|
+
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
|
152
|
+
props.forEach((prop) => {
|
153
|
+
console.warn(`${kit} Kit: The prop '${prop}' is deprecated and will be removed in a future release!`)
|
154
|
+
})
|
155
|
+
}
|
156
|
+
}
|
@@ -10,10 +10,11 @@ import classnames from 'classnames'
|
|
10
10
|
* @param {Object} data the object containing the data to derive the props from.
|
11
11
|
* @returns {Object} an object whose keys have the prefix added to them.
|
12
12
|
*/
|
13
|
-
const buildPrefixedProps = (prefix, data
|
14
|
-
props[
|
15
|
-
|
16
|
-
|
13
|
+
const buildPrefixedProps = (prefix: string, data: {[key: string]: any}) =>
|
14
|
+
Object.keys(data).reduce((props: {[key: string]: any}, key: string) => {
|
15
|
+
props[`${prefix}-${key}`] = data[key]
|
16
|
+
return props
|
17
|
+
}, {})
|
17
18
|
|
18
19
|
/**
|
19
20
|
* Represent a "No-Operation" function that can be used as a sensible
|
@@ -29,7 +30,8 @@ export const noop = () => {}
|
|
29
30
|
* @param {Object} aria the object containing the aria prop values.
|
30
31
|
* @returns {Object} an object holding the HTML valid aria props and their values.
|
31
32
|
*/
|
32
|
-
export const buildAriaProps = (aria) =>
|
33
|
+
export const buildAriaProps = (aria: {[key: string]: string}): {[key: string]: string} =>
|
34
|
+
buildPrefixedProps('aria', aria)
|
33
35
|
|
34
36
|
/**
|
35
37
|
* Maps a given data object into HTML valid data attribtues and their values.
|
@@ -37,7 +39,7 @@ export const buildAriaProps = (aria) => buildPrefixedProps('aria', aria)
|
|
37
39
|
* @param {Object} data the object containing the data prop values.
|
38
40
|
* @returns {Object} an object holding the HTML valid data props and their values.
|
39
41
|
*/
|
40
|
-
export const buildDataProps = (data) => buildPrefixedProps('data', data)
|
42
|
+
export const buildDataProps = (data: {[key: string]: any}) => buildPrefixedProps('data', data)
|
41
43
|
|
42
44
|
/**
|
43
45
|
* Builds a Playbook valid root className off of the incoming css rules.
|
@@ -45,5 +47,5 @@ export const buildDataProps = (data) => buildPrefixedProps('data', data)
|
|
45
47
|
* @param {Object} rules a 'classnames' compliant rules object, used to derive the root className.
|
46
48
|
* @returns {String} the derived root className value.
|
47
49
|
*/
|
48
|
-
export const buildCss = (...rules) => classnames(rules).replace(/\s/g, '_')
|
50
|
+
export const buildCss = (...rules: string[]) => classnames(rules).replace(/\s/g, '_')
|
49
51
|
|
data/lib/playbook/align_items.rb
CHANGED
data/lib/playbook/version.rb
CHANGED