playbook_ui 4.9.0.pre.alpha1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/playbook/pages_controller.rb +0 -8
- data/app/helpers/playbook/pb_doc_helper.rb +2 -8
- data/app/pb_kits/playbook/_playbook.scss +0 -1
- data/app/pb_kits/playbook/data/menu.yml +0 -2
- data/app/pb_kits/playbook/index.js +0 -1
- data/app/pb_kits/playbook/packs/examples.js +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_filter/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_label_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +14 -31
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +0 -8
- data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.jsx +1 -24
- data/app/pb_kits/playbook/pb_label_value/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_label_value/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.rb +1 -8
- data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_online_status/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_online_status/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_source/docs/_source_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_source/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_source/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_time/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx +9 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/index.js +1 -0
- data/lib/playbook/version.rb +1 -1
- metadata +12 -12
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +0 -60
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -6
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx +0 -34
- data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_file_upload/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_file_upload/file_upload.rb +0 -11
- data/app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.html.erb +0 -24
- data/app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.jsx +0 -35
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2efde50eecbf0220c77d407beee2d9a06df001f526934bdc8acf7bf0078b4aa8
|
|
4
|
+
data.tar.gz: 01c79e37dcd31369d0a55a4a8588b103fa51c4115f8401ab1b53078bbe3ec9cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d12d4271e8402ffa8717d1fee0dd276f565a0b254cea4e6567ee80c000fe3a271da72eb3e1a474b9cd7857d4d600e1b8b064af1aaed9c6e715935f87d477d11b
|
|
7
|
+
data.tar.gz: 86ca4495e6464009c0456cba66a2f4dc04e0f44a0ee1009abfd9b9816350e2267d46ea4fc14895f654523f9877977ead9d2a0a9ce14555b09b02bea73a1857d7
|
|
@@ -6,7 +6,6 @@ require "yaml"
|
|
|
6
6
|
module Playbook
|
|
7
7
|
class PagesController < ApplicationController
|
|
8
8
|
before_action :set_kit, only: %i[kit_show_rails kit_show_react]
|
|
9
|
-
before_action :ensure_rails_kit_exists, only: %i[kit_show_rails]
|
|
10
9
|
before_action :set_category, only: %i[kit_category_show_rails kit_category_show_react]
|
|
11
10
|
|
|
12
11
|
def home; end
|
|
@@ -65,12 +64,5 @@ module Playbook
|
|
|
65
64
|
redirect_to root_path, flash: { error: "That kit does not exist" }
|
|
66
65
|
end
|
|
67
66
|
end
|
|
68
|
-
|
|
69
|
-
def ensure_rails_kit_exists
|
|
70
|
-
# TODO: unsure why we cannot simply use the helpers that are included in ApplicationController - fix this
|
|
71
|
-
erbfiles = File.join("**", "*.erb")
|
|
72
|
-
kit_files = Dir.glob(erbfiles, base: "#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit}/docs").present?
|
|
73
|
-
redirect_to action: "kit_show_react" unless kit_files.present?
|
|
74
|
-
end
|
|
75
67
|
end
|
|
76
68
|
end
|
|
@@ -9,11 +9,9 @@ module Playbook
|
|
|
9
9
|
def has_kit_type?(kit, type)
|
|
10
10
|
type ||= "rails"
|
|
11
11
|
if type == "rails"
|
|
12
|
-
|
|
13
|
-
Dir.glob(erbfiles, base: "#{kit_path(kit)}/docs").present?
|
|
12
|
+
Dir["playbook/pb_#{kit}/*.html.erb"].empty?
|
|
14
13
|
elsif type == "react"
|
|
15
|
-
|
|
16
|
-
Dir.glob(jsxfiles, base: "#{kit_path(kit)}/docs").present?
|
|
14
|
+
Dir["playbook/pb_#{kit}/*.jsx"].empty?
|
|
17
15
|
end
|
|
18
16
|
end
|
|
19
17
|
|
|
@@ -25,10 +23,6 @@ module Playbook
|
|
|
25
23
|
end
|
|
26
24
|
end
|
|
27
25
|
|
|
28
|
-
def kit_path(kit)
|
|
29
|
-
"#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{kit}"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
26
|
def get_kit_description(kit)
|
|
33
27
|
filename = "#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit}/docs/_description.md"
|
|
34
28
|
read_file(filename)
|
|
@@ -17,7 +17,6 @@ export DateRangeStacked from './pb_date_range_stacked/_date_range_stacked.jsx'
|
|
|
17
17
|
export DateStacked from './pb_date_stacked/_date_stacked.jsx'
|
|
18
18
|
export DateYearStacked from './pb_date_year_stacked/_date_year_stacked.jsx'
|
|
19
19
|
export DistributionBar from './pb_distribution_bar/_distribution_bar.jsx'
|
|
20
|
-
export FileUpload from './pb_file_upload/_file_upload.jsx'
|
|
21
20
|
export Filter from './pb_filter/_filter.jsx'
|
|
22
21
|
export FixedConfirmationToast from './pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx'
|
|
23
22
|
export Flex from './pb_flex/_flex.jsx'
|
|
@@ -31,7 +31,6 @@ import * as DateRangeStacked from 'pb_date_range_stacked/docs'
|
|
|
31
31
|
import * as DateStacked from 'pb_date_stacked/docs'
|
|
32
32
|
import * as DateYearStacked from 'pb_date_year_stacked/docs'
|
|
33
33
|
import * as DistributionBar from 'pb_distribution_bar/docs'
|
|
34
|
-
import * as FileUpload from 'pb_file_upload/docs'
|
|
35
34
|
import * as Filter from 'pb_filter/docs'
|
|
36
35
|
import * as FixedConfirmationToast from 'pb_fixed_confirmation_toast/docs'
|
|
37
36
|
import * as Flex from 'pb_flex/docs'
|
|
@@ -100,7 +99,6 @@ WebpackerReact.setup({
|
|
|
100
99
|
...DateStacked,
|
|
101
100
|
...DateYearStacked,
|
|
102
101
|
...DistributionBar,
|
|
103
|
-
...FileUpload,
|
|
104
102
|
...Filter,
|
|
105
103
|
...FixedConfirmationToast,
|
|
106
104
|
...Flex,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FilterDefault } from './_filter_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LabelPillDefault } from './_label_pill_default.jsx'
|
|
@@ -1,38 +1,21 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
1
|
import React from 'react'
|
|
4
|
-
import
|
|
5
|
-
import { Body, Caption } from '../'
|
|
2
|
+
import PropTypes from 'prop-types'
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
className
|
|
9
|
-
|
|
10
|
-
value: String,
|
|
11
|
-
dark?: Boolean
|
|
4
|
+
const propTypes = {
|
|
5
|
+
className: PropTypes.string,
|
|
6
|
+
id: PropTypes.string,
|
|
12
7
|
}
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'pb_label_value_kit' + themeStyle,
|
|
23
|
-
className,
|
|
24
|
-
])
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div className={css}>
|
|
28
|
-
<Caption
|
|
29
|
-
text={label}
|
|
30
|
-
/>
|
|
31
|
-
<Body
|
|
32
|
-
text={value}
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
)
|
|
9
|
+
class LabelValue extends React.Component {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="pb_label_value">
|
|
13
|
+
<span>{'LABEL VALUE CONTENT'}</span>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
36
17
|
}
|
|
37
18
|
|
|
19
|
+
LabelValue.propTypes = propTypes
|
|
20
|
+
|
|
38
21
|
export default LabelValue
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { LabelValue } from '../../'
|
|
3
2
|
|
|
4
3
|
const LabelValueDefault = () => {
|
|
5
4
|
return (
|
|
6
|
-
<
|
|
7
|
-
<LabelValue
|
|
8
|
-
label="Role"
|
|
9
|
-
value="Administrator, Moderator"
|
|
10
|
-
/>
|
|
11
|
-
|
|
12
|
-
<br />
|
|
13
|
-
|
|
14
|
-
<LabelValue
|
|
15
|
-
label="Email"
|
|
16
|
-
value="anna.black@powerhrg.com"
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
<br />
|
|
20
|
-
|
|
21
|
-
<LabelValue
|
|
22
|
-
label="Bio"
|
|
23
|
-
value="Proin pulvinar feugiat massa in luctus. Donec urna nulla,
|
|
24
|
-
elementum sit amet tincidunt nec, mattis nec urna. Cras viverra
|
|
25
|
-
lorem odio, id pretium dui interdum ut. Nullam dignissim nisl vitae
|
|
26
|
-
orci vehicula condimentum"
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
5
|
+
<h1>{'Coming Soon...'}</h1>
|
|
29
6
|
)
|
|
30
7
|
}
|
|
31
8
|
|
|
@@ -9,16 +9,9 @@ module Playbook
|
|
|
9
9
|
|
|
10
10
|
prop :label, required: true
|
|
11
11
|
prop :value, required: true
|
|
12
|
-
prop :dark, type: Playbook::Props::Boolean, default: false
|
|
13
12
|
|
|
14
13
|
def classname
|
|
15
|
-
generate_classname("pb_label_value_kit"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
def dark_class
|
|
21
|
-
dark ? "dark" : nil
|
|
14
|
+
generate_classname("pb_label_value_kit")
|
|
22
15
|
end
|
|
23
16
|
end
|
|
24
17
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OnlineStatusDefault } from './_online_status_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SourceDefault } from './_source_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StarRatingDefault } from './_star_rating_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TimeDefault } from './_time_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TimestampDefault } from './_timestamp_default.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TitleDetailDefault } from './_title_detail_default.jsx'
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playbook_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.9.0
|
|
4
|
+
version: 4.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-
|
|
12
|
+
date: 2020-03-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: actionpack
|
|
@@ -757,16 +757,11 @@ files:
|
|
|
757
757
|
- app/pb_kits/playbook/pb_distribution_bar/docs/index.js
|
|
758
758
|
- app/pb_kits/playbook/pb_enhanced_element/element_observer.js
|
|
759
759
|
- app/pb_kits/playbook/pb_enhanced_element/index.js
|
|
760
|
-
- app/pb_kits/playbook/pb_file_upload/_file_upload.jsx
|
|
761
|
-
- app/pb_kits/playbook/pb_file_upload/_file_upload.scss
|
|
762
|
-
- app/pb_kits/playbook/pb_file_upload/docs/_file_upload_default.jsx
|
|
763
|
-
- app/pb_kits/playbook/pb_file_upload/docs/example.yml
|
|
764
|
-
- app/pb_kits/playbook/pb_file_upload/docs/index.js
|
|
765
|
-
- app/pb_kits/playbook/pb_file_upload/file_upload.rb
|
|
766
760
|
- app/pb_kits/playbook/pb_filter/_filter.html.erb
|
|
767
761
|
- app/pb_kits/playbook/pb_filter/_filter.jsx
|
|
768
762
|
- app/pb_kits/playbook/pb_filter/_filter.scss
|
|
769
763
|
- app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb
|
|
764
|
+
- app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx
|
|
770
765
|
- app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb
|
|
771
766
|
- app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb
|
|
772
767
|
- app/pb_kits/playbook/pb_filter/docs/example.yml
|
|
@@ -957,6 +952,7 @@ files:
|
|
|
957
952
|
- app/pb_kits/playbook/pb_label_pill/docs/_description.md
|
|
958
953
|
- app/pb_kits/playbook/pb_label_pill/docs/_footer.md
|
|
959
954
|
- app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.html.erb
|
|
955
|
+
- app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx
|
|
960
956
|
- app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.md
|
|
961
957
|
- app/pb_kits/playbook/pb_label_pill/docs/example.yml
|
|
962
958
|
- app/pb_kits/playbook/pb_label_pill/docs/index.js
|
|
@@ -966,8 +962,6 @@ files:
|
|
|
966
962
|
- app/pb_kits/playbook/pb_label_value/_label_value.scss
|
|
967
963
|
- app/pb_kits/playbook/pb_label_value/docs/_description.md
|
|
968
964
|
- app/pb_kits/playbook/pb_label_value/docs/_footer.md
|
|
969
|
-
- app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.html.erb
|
|
970
|
-
- app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.jsx
|
|
971
965
|
- app/pb_kits/playbook/pb_label_value/docs/_label_value_default.html.erb
|
|
972
966
|
- app/pb_kits/playbook/pb_label_value/docs/_label_value_default.jsx
|
|
973
967
|
- app/pb_kits/playbook/pb_label_value/docs/_label_value_default.md
|
|
@@ -1122,6 +1116,7 @@ files:
|
|
|
1122
1116
|
- app/pb_kits/playbook/pb_online_status/_online_status_mixins.scss
|
|
1123
1117
|
- app/pb_kits/playbook/pb_online_status/docs/_description.md
|
|
1124
1118
|
- app/pb_kits/playbook/pb_online_status/docs/_online_status_default.html.erb
|
|
1119
|
+
- app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx
|
|
1125
1120
|
- app/pb_kits/playbook/pb_online_status/docs/example.yml
|
|
1126
1121
|
- app/pb_kits/playbook/pb_online_status/docs/index.js
|
|
1127
1122
|
- app/pb_kits/playbook/pb_online_status/online_status.rb
|
|
@@ -1299,6 +1294,7 @@ files:
|
|
|
1299
1294
|
- app/pb_kits/playbook/pb_source/_source.scss
|
|
1300
1295
|
- app/pb_kits/playbook/pb_source/docs/_description.md
|
|
1301
1296
|
- app/pb_kits/playbook/pb_source/docs/_source_default.html.erb
|
|
1297
|
+
- app/pb_kits/playbook/pb_source/docs/_source_default.jsx
|
|
1302
1298
|
- app/pb_kits/playbook/pb_source/docs/_source_noicon.html.erb
|
|
1303
1299
|
- app/pb_kits/playbook/pb_source/docs/_source_types.html.erb
|
|
1304
1300
|
- app/pb_kits/playbook/pb_source/docs/example.yml
|
|
@@ -1309,6 +1305,7 @@ files:
|
|
|
1309
1305
|
- app/pb_kits/playbook/pb_star_rating/_star_rating.scss
|
|
1310
1306
|
- app/pb_kits/playbook/pb_star_rating/docs/_description.md
|
|
1311
1307
|
- app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb
|
|
1308
|
+
- app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx
|
|
1312
1309
|
- app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb
|
|
1313
1310
|
- app/pb_kits/playbook/pb_star_rating/docs/example.yml
|
|
1314
1311
|
- app/pb_kits/playbook/pb_star_rating/docs/index.js
|
|
@@ -1428,6 +1425,7 @@ files:
|
|
|
1428
1425
|
- app/pb_kits/playbook/pb_time/docs/_description.md
|
|
1429
1426
|
- app/pb_kits/playbook/pb_time/docs/_footer.md
|
|
1430
1427
|
- app/pb_kits/playbook/pb_time/docs/_time_default.html.erb
|
|
1428
|
+
- app/pb_kits/playbook/pb_time/docs/_time_default.jsx
|
|
1431
1429
|
- app/pb_kits/playbook/pb_time/docs/_time_default.md
|
|
1432
1430
|
- app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb
|
|
1433
1431
|
- app/pb_kits/playbook/pb_time/docs/example.yml
|
|
@@ -1441,6 +1439,7 @@ files:
|
|
|
1441
1439
|
- app/pb_kits/playbook/pb_timestamp/docs/_footer.md
|
|
1442
1440
|
- app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md
|
|
1443
1441
|
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb
|
|
1442
|
+
- app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx
|
|
1444
1443
|
- app/pb_kits/playbook/pb_timestamp/docs/example.yml
|
|
1445
1444
|
- app/pb_kits/playbook/pb_timestamp/docs/index.js
|
|
1446
1445
|
- app/pb_kits/playbook/pb_timestamp/timestamp.rb
|
|
@@ -1474,6 +1473,7 @@ files:
|
|
|
1474
1473
|
- app/pb_kits/playbook/pb_title_detail/docs/_description.md
|
|
1475
1474
|
- app/pb_kits/playbook/pb_title_detail/docs/_footer.md
|
|
1476
1475
|
- app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.html.erb
|
|
1476
|
+
- app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx
|
|
1477
1477
|
- app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.md
|
|
1478
1478
|
- app/pb_kits/playbook/pb_title_detail/docs/example.yml
|
|
1479
1479
|
- app/pb_kits/playbook/pb_title_detail/docs/index.js
|
|
@@ -1640,9 +1640,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1640
1640
|
version: '0'
|
|
1641
1641
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1642
1642
|
requirements:
|
|
1643
|
-
- - "
|
|
1643
|
+
- - ">="
|
|
1644
1644
|
- !ruby/object:Gem::Version
|
|
1645
|
-
version:
|
|
1645
|
+
version: '0'
|
|
1646
1646
|
requirements: []
|
|
1647
1647
|
rubyforge_project:
|
|
1648
1648
|
rubygems_version: 2.7.3
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import React, { useCallback } from 'react'
|
|
4
|
-
import { useDropzone } from 'react-dropzone'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
buildCss,
|
|
8
|
-
noop,
|
|
9
|
-
} from '../utilities/props'
|
|
10
|
-
|
|
11
|
-
import type { Callback } from '../types.js'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
Body,
|
|
15
|
-
Card,
|
|
16
|
-
} from '..'
|
|
17
|
-
|
|
18
|
-
type FileUploadProps = {
|
|
19
|
-
acceptedFiles?: FileList,
|
|
20
|
-
className?: String,
|
|
21
|
-
onFilesAccepted: Callback,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const FileUpload = ({
|
|
25
|
-
acceptedFiles = [],
|
|
26
|
-
className,
|
|
27
|
-
onFilesAccepted = noop,
|
|
28
|
-
}: FileUploadProps) => {
|
|
29
|
-
const onDrop = useCallback((files) => {
|
|
30
|
-
onFilesAccepted(files)
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
getRootProps,
|
|
35
|
-
getInputProps,
|
|
36
|
-
isDragActive,
|
|
37
|
-
} = useDropzone({ onDrop })
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div
|
|
41
|
-
className={buildCss('pb_file_upload_kit', className)}
|
|
42
|
-
{...getRootProps()}
|
|
43
|
-
>
|
|
44
|
-
<Card>
|
|
45
|
-
<input {...getInputProps()} />
|
|
46
|
-
<Body
|
|
47
|
-
color="light"
|
|
48
|
-
>
|
|
49
|
-
<If condition={isDragActive}>
|
|
50
|
-
<p>{'Drop the files here ...'}</p>
|
|
51
|
-
<Else />
|
|
52
|
-
<p>{'Drag & drop some files here, or click to select files'}</p>
|
|
53
|
-
</If>
|
|
54
|
-
</Body>
|
|
55
|
-
</Card>
|
|
56
|
-
</div>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default FileUpload
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
FileUpload,
|
|
4
|
-
List,
|
|
5
|
-
ListItem,
|
|
6
|
-
} from '../..'
|
|
7
|
-
|
|
8
|
-
const AcceptedFilesList = ({files}: FileList) => (
|
|
9
|
-
<List>
|
|
10
|
-
{files.map(file => (
|
|
11
|
-
<ListItem key={file.name}>{file.name}</ListItem>
|
|
12
|
-
))}
|
|
13
|
-
</List>
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
const FileUploadDefault = () => {
|
|
17
|
-
const [filesToUpload, setFilesToUpload] = useState([])
|
|
18
|
-
|
|
19
|
-
const handleOnFilesAccepted = files => {
|
|
20
|
-
setFilesToUpload([...filesToUpload, ...files])
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div>
|
|
25
|
-
<AcceptedFilesList files={filesToUpload} />
|
|
26
|
-
<FileUpload
|
|
27
|
-
acceptedFiles={filesToUpload}
|
|
28
|
-
onFilesAccepted={handleOnFilesAccepted}
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default FileUploadDefault
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as FileUploadDefault } from './_file_upload_default.jsx'
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("label_value", props: {
|
|
2
|
-
label: "Role",
|
|
3
|
-
value: "Administrator, Moderator",
|
|
4
|
-
dark: true
|
|
5
|
-
}) %>
|
|
6
|
-
|
|
7
|
-
<br>
|
|
8
|
-
|
|
9
|
-
<%= pb_rails("label_value", props: {
|
|
10
|
-
label: "Email",
|
|
11
|
-
value: "anna.black@powerhrg.com",
|
|
12
|
-
dark: true
|
|
13
|
-
}) %>
|
|
14
|
-
|
|
15
|
-
<br>
|
|
16
|
-
|
|
17
|
-
<%= pb_rails("label_value", props: {
|
|
18
|
-
label: "Bio",
|
|
19
|
-
value: "Proin pulvinar feugiat massa in luctus. Donec urna nulla,
|
|
20
|
-
elementum sit amet tincidunt nec, mattis nec urna. Cras viverra
|
|
21
|
-
lorem odio, id pretium dui interdum ut. Nullam dignissim nisl vitae
|
|
22
|
-
orci vehicula condimentum.",
|
|
23
|
-
dark: true
|
|
24
|
-
}) %>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { LabelValue } from '../../'
|
|
3
|
-
|
|
4
|
-
const LabelValueDark = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div>
|
|
7
|
-
<LabelValue
|
|
8
|
-
dark
|
|
9
|
-
label="Role"
|
|
10
|
-
value="Administrator, Moderator"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
<br />
|
|
14
|
-
|
|
15
|
-
<LabelValue
|
|
16
|
-
dark
|
|
17
|
-
label="Email"
|
|
18
|
-
value="anna.black@powerhrg.com"
|
|
19
|
-
/>
|
|
20
|
-
|
|
21
|
-
<br />
|
|
22
|
-
|
|
23
|
-
<LabelValue
|
|
24
|
-
dark
|
|
25
|
-
label="Bio"
|
|
26
|
-
value="Proin pulvinar feugiat massa in luctus. Donec urna nulla,
|
|
27
|
-
elementum sit amet tincidunt nec, mattis nec urna. Cras viverra
|
|
28
|
-
lorem odio, id pretium dui interdum ut. Nullam dignissim nisl vitae
|
|
29
|
-
orci vehicula condimentum"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default LabelValueDark
|