playbook_ui 7.8.1 → 7.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/playbook/pb_doc_helper.rb +55 -6
- data/app/helpers/playbook/pb_sample_helper.rb +6 -0
- data/app/pb_kits/playbook/config/_kit_example.html.erb +18 -4
- data/app/pb_kits/playbook/config/_kit_ui.html.erb +21 -21
- data/app/pb_kits/playbook/pb_currency/_currency.html.erb +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +16 -1
- data/app/pb_kits/playbook/pb_currency/_currency.scss +23 -1
- data/app/pb_kits/playbook/pb_currency/currency.rb +22 -0
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_small.html.erb → _currency_alignment.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_small.jsx → _currency_alignment.jsx} +5 -5
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.html.erb +7 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.jsx +17 -0
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_large.html.erb → _currency_size.html.erb} +8 -7
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_large.jsx → _currency_size.jsx} +9 -8
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +24 -0
- data/app/pb_kits/playbook/pb_currency/docs/{_currency_medium.jsx → _currency_variants.jsx} +13 -10
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +8 -6
- data/app/pb_kits/playbook/pb_currency/docs/index.js +4 -3
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +22 -0
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +47 -0
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +2 -46
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_horizontal_nav.html.erb +6 -0
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_horizontal_nav.jsx +33 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss +375 -0
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.html.erb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +8 -4
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit.html.erb +17 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit.jsx +28 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.html.erb +20 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.jsx +31 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.md +1 -0
- data/app/pb_kits/playbook/pb_stat_change/docs/example.yml +6 -4
- data/app/pb_kits/playbook/pb_stat_change/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +12 -7
- data/app/pb_kits/playbook/pb_table/_table.scss +1 -57
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_alignment.scss +32 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +4 -3
- data/app/pb_kits/playbook/pb_table/styles/_side_highlight.scss +24 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +5 -1
- data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +2 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.html.erb +19 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +4 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.md +10 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +5 -0
- data/app/pb_kits/playbook/react_rails_kits.js +1 -0
- data/lib/playbook.rb +1 -0
- data/{app/pb_kits → lib}/playbook/props.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/array.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/base.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/boolean.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/date.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/enum.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/hash.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/hash_array.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/number.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/number_array.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/numeric.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/percentage.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/proc.rb +0 -0
- data/{app/pb_kits → lib}/playbook/props/string.rb +0 -0
- data/lib/playbook/version.rb +1 -1
- metadata +38 -26
- data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.html.erb +0 -21
- data/app/pb_kits/playbook/pb_table/styles/_mixins.scss +0 -0
@@ -20,8 +20,8 @@ import {
|
|
20
20
|
const filterResults = (results) =>
|
21
21
|
results.items.map((result) => {
|
22
22
|
return {
|
23
|
-
|
24
|
-
|
23
|
+
name: result.login,
|
24
|
+
id: result.id,
|
25
25
|
}
|
26
26
|
})
|
27
27
|
|
@@ -71,6 +71,8 @@ const TypeaheadWithPillsAsync = () => {
|
|
71
71
|
</If>
|
72
72
|
<Typeahead
|
73
73
|
async
|
74
|
+
getOptionLabel={(option) => option.name}
|
75
|
+
getOptionValue={(option) => option.id}
|
74
76
|
isMulti
|
75
77
|
label="Github Users"
|
76
78
|
loadOptions={promiseOptions}
|
@@ -4,8 +4,16 @@
|
|
4
4
|
|
5
5
|
The prop `load_options`, when used in conjunction with `async: true` and `pills: true`, points to a JavaScript function located within the global window namespace. This function should return a `Promise` which resolves with the list of formatted options as described in prior examples above. This function is identical to the function provided to the React version of this kit. See the code example for more details.
|
6
6
|
|
7
|
-
#### React
|
7
|
+
#### React
|
8
|
+
|
9
|
+
##### `loadOptions`
|
8
10
|
|
9
11
|
**Additional required props: ** `async: true`
|
10
12
|
|
11
|
-
[As outlined in the react-select Async docs](https://react-select.com/async), `loadOptions` expects to return a Promise that resolves resolves with the list of formatted options as described in prior examples above. See the code example for more details.
|
13
|
+
[As outlined in the react-select Async docs](https://react-select.com/async), `loadOptions` expects to return a Promise that resolves resolves with the list of formatted options as described in prior examples above. See the code example for more details.
|
14
|
+
|
15
|
+
##### `getOptionLabel` + `getOptionValue`
|
16
|
+
|
17
|
+
If your server returns data that requires differing field names other than `label` and `value`
|
18
|
+
|
19
|
+
See `react-select` docs for more information: https://react-select.com/advanced#replacing-builtins
|
@@ -8,6 +8,8 @@ module Playbook
|
|
8
8
|
prop :async, type: Playbook::Props::Boolean,
|
9
9
|
default: false
|
10
10
|
prop :default_options, type: Playbook::Props::HashArray, default: []
|
11
|
+
prop :get_option_label
|
12
|
+
prop :get_option_value
|
11
13
|
prop :id
|
12
14
|
prop :label
|
13
15
|
prop :load_options
|
@@ -45,6 +47,9 @@ module Playbook
|
|
45
47
|
placeholder: placeholder
|
46
48
|
}
|
47
49
|
|
50
|
+
base_options.merge!({getOptionLabel: get_option_label}) if get_option_label.present?
|
51
|
+
base_options.merge!({getOptionValue: get_option_value}) if get_option_value.present?
|
52
|
+
|
48
53
|
base_options.merge!({
|
49
54
|
async: true,
|
50
55
|
loadOptions: load_options,
|
@@ -5,3 +5,4 @@ export { default as Legend } from './pb_legend/_legend.jsx'
|
|
5
5
|
export { default as LineGraph } from './pb_line_graph/_line_graph.jsx'
|
6
6
|
export { default as Typeahead } from './pb_typeahead/_typeahead.jsx'
|
7
7
|
export { default as RichTextEditor } from './pb_rich_text_editor/_rich_text_editor.jsx'
|
8
|
+
export { KitSearch, SnippetToggle, DarkModeToggle } from './docs_components'
|
data/lib/playbook.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
8
8
|
- Power Devs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-11
|
12
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -664,12 +664,14 @@ files:
|
|
664
664
|
- app/pb_kits/playbook/pb_currency/_currency.jsx
|
665
665
|
- app/pb_kits/playbook/pb_currency/_currency.scss
|
666
666
|
- app/pb_kits/playbook/pb_currency/currency.rb
|
667
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
668
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
669
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
670
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
671
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
672
|
-
- app/pb_kits/playbook/pb_currency/docs/
|
667
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_alignment.html.erb
|
668
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_alignment.jsx
|
669
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.html.erb
|
670
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.jsx
|
671
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_size.html.erb
|
672
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_size.jsx
|
673
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb
|
674
|
+
- app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx
|
673
675
|
- app/pb_kits/playbook/pb_currency/docs/_description.md
|
674
676
|
- app/pb_kits/playbook/pb_currency/docs/example.yml
|
675
677
|
- app/pb_kits/playbook/pb_currency/docs/index.js
|
@@ -1287,6 +1289,7 @@ files:
|
|
1287
1289
|
- app/pb_kits/playbook/pb_nav/_nav.html.erb
|
1288
1290
|
- app/pb_kits/playbook/pb_nav/_nav.jsx
|
1289
1291
|
- app/pb_kits/playbook/pb_nav/_nav.scss
|
1292
|
+
- app/pb_kits/playbook/pb_nav/_subtle_mixin.scss
|
1290
1293
|
- app/pb_kits/playbook/pb_nav/_vertical_nav.scss
|
1291
1294
|
- app/pb_kits/playbook/pb_nav/docs/_block_nav.html.erb
|
1292
1295
|
- app/pb_kits/playbook/pb_nav/docs/_block_nav.jsx
|
@@ -1301,6 +1304,8 @@ files:
|
|
1301
1304
|
- app/pb_kits/playbook/pb_nav/docs/_horizontal_nav.jsx
|
1302
1305
|
- app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.html.erb
|
1303
1306
|
- app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.jsx
|
1307
|
+
- app/pb_kits/playbook/pb_nav/docs/_subtle_horizontal_nav.html.erb
|
1308
|
+
- app/pb_kits/playbook/pb_nav/docs/_subtle_horizontal_nav.jsx
|
1304
1309
|
- app/pb_kits/playbook/pb_nav/docs/_subtle_nav.html.erb
|
1305
1310
|
- app/pb_kits/playbook/pb_nav/docs/_subtle_nav.jsx
|
1306
1311
|
- app/pb_kits/playbook/pb_nav/docs/_subtle_no_highlight_nav.html.erb
|
@@ -1460,6 +1465,7 @@ files:
|
|
1460
1465
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.html.erb
|
1461
1466
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx
|
1462
1467
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss
|
1468
|
+
- app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss
|
1463
1469
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb
|
1464
1470
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx
|
1465
1471
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb
|
@@ -1605,6 +1611,11 @@ files:
|
|
1605
1611
|
- app/pb_kits/playbook/pb_stat_change/docs/_description.md
|
1606
1612
|
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.html.erb
|
1607
1613
|
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_default.jsx
|
1614
|
+
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit.html.erb
|
1615
|
+
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit.jsx
|
1616
|
+
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.html.erb
|
1617
|
+
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.jsx
|
1618
|
+
- app/pb_kits/playbook/pb_stat_change/docs/_stat_change_unit_two.md
|
1608
1619
|
- app/pb_kits/playbook/pb_stat_change/docs/example.yml
|
1609
1620
|
- app/pb_kits/playbook/pb_stat_change/docs/index.js
|
1610
1621
|
- app/pb_kits/playbook/pb_stat_change/stat_change.rb
|
@@ -1680,14 +1691,15 @@ files:
|
|
1680
1691
|
- app/pb_kits/playbook/pb_table/docs/example.yml
|
1681
1692
|
- app/pb_kits/playbook/pb_table/docs/index.js
|
1682
1693
|
- app/pb_kits/playbook/pb_table/index.js
|
1694
|
+
- app/pb_kits/playbook/pb_table/styles/_alignment.scss
|
1683
1695
|
- app/pb_kits/playbook/pb_table/styles/_all.scss
|
1684
1696
|
- app/pb_kits/playbook/pb_table/styles/_as-cards.scss
|
1685
1697
|
- app/pb_kits/playbook/pb_table/styles/_content.scss
|
1686
1698
|
- app/pb_kits/playbook/pb_table/styles/_headers.scss
|
1687
1699
|
- app/pb_kits/playbook/pb_table/styles/_hover.scss
|
1688
|
-
- app/pb_kits/playbook/pb_table/styles/_mixins.scss
|
1689
1700
|
- app/pb_kits/playbook/pb_table/styles/_mobile.scss
|
1690
1701
|
- app/pb_kits/playbook/pb_table/styles/_reset.scss
|
1702
|
+
- app/pb_kits/playbook/pb_table/styles/_side_highlight.scss
|
1691
1703
|
- app/pb_kits/playbook/pb_table/styles/_single-line.scss
|
1692
1704
|
- app/pb_kits/playbook/pb_table/styles/_structure.scss
|
1693
1705
|
- app/pb_kits/playbook/pb_table/styles/_table-card.scss
|
@@ -1946,20 +1958,6 @@ files:
|
|
1946
1958
|
- app/pb_kits/playbook/pb_weekday_stacked/docs/index.js
|
1947
1959
|
- app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb
|
1948
1960
|
- app/pb_kits/playbook/plugins/pb_chart.js
|
1949
|
-
- app/pb_kits/playbook/props.rb
|
1950
|
-
- app/pb_kits/playbook/props/array.rb
|
1951
|
-
- app/pb_kits/playbook/props/base.rb
|
1952
|
-
- app/pb_kits/playbook/props/boolean.rb
|
1953
|
-
- app/pb_kits/playbook/props/date.rb
|
1954
|
-
- app/pb_kits/playbook/props/enum.rb
|
1955
|
-
- app/pb_kits/playbook/props/hash.rb
|
1956
|
-
- app/pb_kits/playbook/props/hash_array.rb
|
1957
|
-
- app/pb_kits/playbook/props/number.rb
|
1958
|
-
- app/pb_kits/playbook/props/number_array.rb
|
1959
|
-
- app/pb_kits/playbook/props/numeric.rb
|
1960
|
-
- app/pb_kits/playbook/props/percentage.rb
|
1961
|
-
- app/pb_kits/playbook/props/proc.rb
|
1962
|
-
- app/pb_kits/playbook/props/string.rb
|
1963
1961
|
- app/pb_kits/playbook/react_rails_kits.js
|
1964
1962
|
- app/pb_kits/playbook/tokens/_animation-curves.scss
|
1965
1963
|
- app/pb_kits/playbook/tokens/_border_radius.scss
|
@@ -1987,13 +1985,27 @@ files:
|
|
1987
1985
|
- fonts/regular-min.js
|
1988
1986
|
- lib/playbook.rb
|
1989
1987
|
- lib/playbook/engine.rb
|
1988
|
+
- lib/playbook/props.rb
|
1989
|
+
- lib/playbook/props/array.rb
|
1990
|
+
- lib/playbook/props/base.rb
|
1991
|
+
- lib/playbook/props/boolean.rb
|
1992
|
+
- lib/playbook/props/date.rb
|
1993
|
+
- lib/playbook/props/enum.rb
|
1994
|
+
- lib/playbook/props/hash.rb
|
1995
|
+
- lib/playbook/props/hash_array.rb
|
1996
|
+
- lib/playbook/props/number.rb
|
1997
|
+
- lib/playbook/props/number_array.rb
|
1998
|
+
- lib/playbook/props/numeric.rb
|
1999
|
+
- lib/playbook/props/percentage.rb
|
2000
|
+
- lib/playbook/props/proc.rb
|
2001
|
+
- lib/playbook/props/string.rb
|
1990
2002
|
- lib/playbook/version.rb
|
1991
2003
|
- lib/playbook_ui.rb
|
1992
2004
|
homepage: http://playbook.powerapp.cloud
|
1993
2005
|
licenses:
|
1994
2006
|
- MIT
|
1995
2007
|
metadata: {}
|
1996
|
-
post_install_message:
|
2008
|
+
post_install_message:
|
1997
2009
|
rdoc_options: []
|
1998
2010
|
require_paths:
|
1999
2011
|
- lib
|
@@ -2009,7 +2021,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2009
2021
|
version: '0'
|
2010
2022
|
requirements: []
|
2011
2023
|
rubygems_version: 3.1.4
|
2012
|
-
signing_key:
|
2024
|
+
signing_key:
|
2013
2025
|
specification_version: 4
|
2014
2026
|
summary: Playbook Design System
|
2015
2027
|
test_files: []
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<%= pb_rails("currency", props: {
|
2
|
-
label: "Caption",
|
3
|
-
amount: "2,000.50",
|
4
|
-
size: "md",
|
5
|
-
}) %>
|
6
|
-
|
7
|
-
<%= pb_rails("currency", props: {
|
8
|
-
align: "center",
|
9
|
-
amount: "342",
|
10
|
-
label: "Caption",
|
11
|
-
size: "md",
|
12
|
-
symbol: "€",
|
13
|
-
}) %>
|
14
|
-
|
15
|
-
<%= pb_rails("currency", props: {
|
16
|
-
align: "right",
|
17
|
-
amount: "45",
|
18
|
-
label: "Caption",
|
19
|
-
unit: "/mo",
|
20
|
-
size: "md",
|
21
|
-
}) %>
|
File without changes
|