playbook_ui 7.0.0.pre.alpha9 → 7.0.0.pre.alpha10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/data/menu.yml +1 -0
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +1 -0
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +3 -7
- data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.jsx +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +2 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +2 -1
- data/app/pb_kits/playbook/pb_date/_date.html.erb +8 -32
- data/app/pb_kits/playbook/pb_date/_date.jsx +67 -76
- data/app/pb_kits/playbook/pb_date/_date.scss +0 -25
- data/app/pb_kits/playbook/pb_date/date.rb +10 -18
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +17 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +2 -5
- data/app/pb_kits/playbook/pb_date/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +39 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +149 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +33 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +85 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +165 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb +24 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx +30 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.html.erb +43 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.jsx +48 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.html.erb +19 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.jsx +25 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hide_icon.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hide_icon.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.html.erb +37 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.jsx +37 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_hooks.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.html.erb +26 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.jsx +32 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.html.erb +9 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.jsx +17 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.html.erb +14 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.jsx +22 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.html.erb +7 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.jsx +16 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_description.md +7 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +35 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +14 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +33 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss +53 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +785 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +108 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +44 -0
- data/app/pb_kits/playbook/pb_filter/_filter.scss +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +2 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +2 -0
- data/app/pb_kits/playbook/pb_form/form_builder.rb +1 -0
- data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +20 -0
- data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +2 -2
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +0 -1
- data/app/pb_kits/playbook/pb_table/table.rb +3 -3
- data/app/pb_kits/playbook/pb_text_input/_text_input.html.erb +1 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +21 -17
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -0
- data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
- data/app/pb_kits/playbook/pb_time/_time.jsx +20 -11
- data/app/pb_kits/playbook/pb_time/_time.scss +16 -8
- data/app/pb_kits/playbook/pb_time/docs/_time_align.html.erb +18 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +3 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_dark.html.erb +70 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_dark.jsx +1 -6
- data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +47 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +33 -4
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb +11 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +19 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +2 -1
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +0 -7
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +42 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
- data/app/pb_kits/playbook/pb_time/docs/example.yml +7 -2
- data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time/time.rb +14 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +60 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +20 -3
- data/app/pb_kits/playbook/pb_typeahead/components/Control.jsx +30 -0
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx +12 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +51 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +34 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +22 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +29 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +84 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +45 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +101 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +8 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +4 -0
- data/app/pb_kits/playbook/tokens/_typography.scss +4 -4
- data/app/pb_kits/playbook/vendor.js +6 -0
- data/lib/playbook/version.rb +1 -1
- metadata +71 -8
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.html.erb +0 -24
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +0 -32
- data/app/pb_kits/playbook/pb_date/docs/_date_default_react.jsx +0 -20
- data/app/pb_kits/playbook/pb_date/docs/_date_default_react.md +0 -3
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.html.erb +0 -27
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 194c10ec06ce124dbe76ef242188655e8858047a6390fbf32471f54aabdd9c10
|
4
|
+
data.tar.gz: f17c05ef7b24bf389b1d646559faaa89862d684b0ff3bb6c81fd6f7e81e1c43f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5eb92a1873b2e77da0083aa018dada538cd2642ec23135a4b299ed75d21a0fee7d76f41954862a214c9b201c62cce3da9c9f4dac567b8d3671e55a47e16a64e
|
7
|
+
data.tar.gz: fcd1e7d53968d610fff6919e56341621d3286b331181861bc286e6483e1580d0732ece53915ce0ecd1f2a5818f813aacd59f8a5d370de8e66d4802ee153708d5
|
data/README.md
CHANGED
@@ -35,10 +35,9 @@ To run the tests, do `bin/test`. To launch a shell in the container run `make sh
|
|
35
35
|
|
36
36
|
See [docs/upgrade-guide](./docs/upgrade-guide)
|
37
37
|
|
38
|
-
###
|
38
|
+
### Releases
|
39
39
|
|
40
|
-
* [
|
41
|
-
* [Creating Releases](https://github.com/powerhome/playbook/wiki/Releasing-a-New-Version)
|
40
|
+
* [Playbook Releases](https://github.com/powerhome/playbook/wiki/Playbook-Releases)
|
42
41
|
|
43
42
|
### Development Environment
|
44
43
|
|
@@ -63,4 +62,4 @@ See [docs/upgrade-guide](./docs/upgrade-guide)
|
|
63
62
|
5. When finished, inside of the directory you want to test with playbook, run `yarn unlink playbook-ui`.
|
64
63
|
6. Inside of your Playbook repository, run `yarn unlink`.
|
65
64
|
|
66
|
-
Keep in mind: Styles are brought in from playbook through the rails gem, so you will not be able to test scss updates with yarn linking.
|
65
|
+
Keep in mind: Styles are brought in from playbook through the rails gem, so you will not be able to test scss updates with yarn linking.
|
@@ -16,6 +16,7 @@
|
|
16
16
|
@import 'pb_currency/currency';
|
17
17
|
@import 'pb_dashboard_value/dashboard_value';
|
18
18
|
@import 'pb_date/date';
|
19
|
+
@import 'pb_date_picker/date_picker';
|
19
20
|
@import 'pb_date_range_inline/date_range_inline';
|
20
21
|
@import 'pb_date_range_stacked/date_range_stacked';
|
21
22
|
@import 'pb_date_stacked/date_stacked';
|
@@ -18,6 +18,7 @@ export Contact from './pb_contact/_contact.jsx'
|
|
18
18
|
export Currency from './pb_currency/_currency.jsx'
|
19
19
|
export DashboardValue from './pb_dashboard_value/_dashboard_value.jsx'
|
20
20
|
export Date from './pb_date/_date.jsx'
|
21
|
+
export DatePicker from './pb_date_picker/_date_picker.jsx'
|
21
22
|
export DateRangeInline from './pb_date_range_inline/_date_range_inline.jsx'
|
22
23
|
export DateRangeStacked from './pb_date_range_stacked/_date_range_stacked.jsx'
|
23
24
|
export DateStacked from './pb_date_stacked/_date_stacked.jsx'
|
@@ -83,6 +84,7 @@ export Title from './pb_title/_title.jsx'
|
|
83
84
|
export TitleCount from './pb_title_count/_title_count.jsx'
|
84
85
|
export TitleDetail from './pb_title_detail/_title_detail.jsx'
|
85
86
|
export Toggle from './pb_toggle/_toggle.jsx'
|
87
|
+
export Typeahead from './pb_typeahead/_typeahead.jsx'
|
86
88
|
export User from './pb_user/_user.jsx'
|
87
89
|
export UserBadge from './pb_user_badge/_user_badge.jsx'
|
88
90
|
export WeekdayStacked from './pb_weekday_stacked/_weekday_stacked.jsx'
|
@@ -95,6 +97,7 @@ export dashboardValueSettings from './pb_dashboard_value/dashboardValueSettings'
|
|
95
97
|
|
96
98
|
// Other JS/Plugins
|
97
99
|
export pbChart from './plugins/pb_chart.js'
|
100
|
+
export datePickerHelper from './pb_date_picker/date_picker_helper.js'
|
98
101
|
export PbTypeahead from './pb_typeahead'
|
99
102
|
export PbPopover from './pb_popover'
|
100
103
|
export PbTable from './pb_table'
|
@@ -4,26 +4,22 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonDefault = () => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
-
dark
|
8
|
-
marginRight="xl"
|
9
7
|
onClick={() => alert('button clicked!')}
|
10
8
|
text="Button Primary"
|
11
9
|
/>
|
10
|
+
{' '}
|
12
11
|
<Button
|
13
12
|
onClick={() => alert('button clicked!')}
|
14
13
|
text="Button Secondary"
|
15
14
|
variant="secondary"
|
16
15
|
/>
|
16
|
+
{' '}
|
17
17
|
<Button
|
18
18
|
onClick={() => alert('button clicked!')}
|
19
19
|
text="Button Link"
|
20
20
|
variant="link"
|
21
21
|
/>
|
22
|
-
|
23
|
-
disabled
|
24
|
-
onClick={() => alert('button clicked!')}
|
25
|
-
text="Button Disabled"
|
26
|
-
/>
|
22
|
+
{' '}
|
27
23
|
<Button
|
28
24
|
disabled
|
29
25
|
onClick={() => alert('button clicked!')}
|
@@ -7,16 +7,19 @@ const ButtonDefaultDark = () => (
|
|
7
7
|
dark
|
8
8
|
text="Button Primary"
|
9
9
|
/>
|
10
|
+
{' '}
|
10
11
|
<Button
|
11
12
|
dark
|
12
13
|
text="Button Secondary"
|
13
14
|
variant="secondary"
|
14
15
|
/>
|
16
|
+
{' '}
|
15
17
|
<Button
|
16
18
|
dark
|
17
19
|
text="Button Link"
|
18
20
|
variant="link"
|
19
21
|
/>
|
22
|
+
{' '}
|
20
23
|
<Button
|
21
24
|
dark
|
22
25
|
disabled
|
@@ -1,38 +1,14 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
|
-
class: object.classname
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}) do %>
|
13
|
-
<%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true }) %>
|
14
|
-
<% end %>
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<!-- day_of_week -->
|
18
|
-
<% if object.show_day_of_week %>
|
19
|
-
<%= pb_rails("title", props: { tag: "div", text: object.date_day_of_week, size: 4 }) %>
|
20
|
-
<%= pb_rails("body", props: {
|
21
|
-
text: "•",
|
22
|
-
color: "light",
|
23
|
-
tag: "div",
|
24
|
-
}) %>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<!-- month day, year -->
|
28
|
-
|
29
|
-
<%# if not current year %>
|
30
|
-
<% if object.year.to_s == DateTime.now.year.to_s %>
|
31
|
-
<%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}", size: 4 }) %>
|
32
|
-
<%# if is current year %>
|
33
|
-
<% else %>
|
34
|
-
<%= pb_rails("title", props: { tag: "div", text: "#{object.month} #{object.day}, #{object.year}", size: 4 }) %>
|
4
|
+
class: object.classname) do %>
|
5
|
+
<% if object.size == "lg" %>
|
6
|
+
<%= pb_rails("title", props: { text: object.lg_date, size: 3 }) %>
|
7
|
+
<% elsif object.size == "sm" %>
|
8
|
+
<%= pb_rails("icon", props: { icon: "calendar", fixed_width: true }) %>
|
9
|
+
<%= pb_rails("title", props: { tag: "span", text: object.sm_date, size: 4 }) %>
|
10
|
+
<% else %>
|
11
|
+
<%= pb_rails("title", props: { text: object.xs_date, size: 4 }) %>
|
35
12
|
<% end %>
|
36
|
-
|
37
13
|
<% end %>
|
38
14
|
|
@@ -2,91 +2,82 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import DateTime from '../pb_kit/dateTime.js'
|
5
|
-
import {
|
5
|
+
import { Icon } from '../'
|
6
6
|
import classnames from 'classnames'
|
7
7
|
import { globalProps } from '../utilities/globalProps.js'
|
8
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
showIcon?: boolean,
|
17
|
-
showDayOfWeek?: boolean,
|
18
|
-
alignment?: "left" | "center" | "right"
|
9
|
+
const defaultDateString = (value: DateTime) => {
|
10
|
+
const weekday = value.toWeekday().toUpperCase()
|
11
|
+
const month = value.toMonth().toUpperCase()
|
12
|
+
const day = value.toDay()
|
13
|
+
|
14
|
+
return `${weekday} · ${month} ${day}`
|
19
15
|
}
|
20
16
|
|
21
|
-
const
|
22
|
-
const
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
data = {},
|
28
|
-
id,
|
29
|
-
showDayOfWeek = false,
|
30
|
-
showIcon = false,
|
31
|
-
} = props
|
17
|
+
const largeDateString = (value: DateTime) => {
|
18
|
+
const month = value.toMonth().toUpperCase()
|
19
|
+
const day = value.toDay()
|
20
|
+
|
21
|
+
return `${month} ${day}`
|
22
|
+
}
|
32
23
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
const day = dateTimestamp.toDay()
|
37
|
-
const year = dateTimestamp.toYear()
|
38
|
-
const currentYear = new Date().getFullYear().toString()
|
24
|
+
type DateSubcomponent = {
|
25
|
+
value: DateTime,
|
26
|
+
}
|
39
27
|
|
40
|
-
|
41
|
-
|
28
|
+
const ExtraSmallDate = ({ value, ...props }: DateSubcomponent) => (
|
29
|
+
<h3 className={classnames('pb_title_kit_4', globalProps(props))}>
|
30
|
+
{defaultDateString(value)}
|
31
|
+
</h3>
|
32
|
+
)
|
42
33
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
34
|
+
const SmallDate = ({ value, ...props }: DateSubcomponent) => (
|
35
|
+
<h3 className={classnames('pb_title_kit_4', globalProps(props))}>
|
36
|
+
<Icon
|
37
|
+
fixedWidth
|
38
|
+
icon="calendar"
|
39
|
+
/>
|
40
|
+
{defaultDateString(value)}
|
41
|
+
</h3>
|
42
|
+
)
|
43
|
+
|
44
|
+
const LargeDate = ({ value, ...props }: DateSubcomponent) => (
|
45
|
+
<h3 className={classnames('pb_title_kit_3', globalProps(props))}>
|
46
|
+
{largeDateString(value)}
|
47
|
+
</h3>
|
48
|
+
)
|
49
|
+
|
50
|
+
type PbDateProps = {
|
51
|
+
size?: "xs" | "sm" | "lg",
|
52
|
+
value?: string,
|
53
|
+
className?: string
|
54
|
+
}
|
55
|
+
|
56
|
+
const PbDate = ({ size, value, className, ...props }: PbDateProps) => {
|
57
|
+
const date = new DateTime({ value: value })
|
58
|
+
|
59
|
+
if (size == 'xs')
|
60
|
+
return (
|
61
|
+
<ExtraSmallDate
|
62
|
+
{...props}
|
63
|
+
className={className}
|
64
|
+
value={date}
|
65
|
+
/>
|
66
|
+
)
|
67
|
+
if (size == 'lg')
|
68
|
+
return (
|
69
|
+
<LargeDate
|
70
|
+
{...props}
|
71
|
+
className={className}
|
72
|
+
value={date}
|
73
|
+
/>
|
74
|
+
)
|
48
75
|
return (
|
49
|
-
<
|
50
|
-
{...
|
51
|
-
{
|
52
|
-
|
53
|
-
|
54
|
-
>
|
55
|
-
<Title
|
56
|
-
size={4}
|
57
|
-
tag="h4"
|
58
|
-
>
|
59
|
-
<If condition={showIcon}>
|
60
|
-
<Body
|
61
|
-
color="light"
|
62
|
-
tag="span"
|
63
|
-
>
|
64
|
-
<Icon
|
65
|
-
fixedWidth
|
66
|
-
icon="calendar-alt"
|
67
|
-
/>
|
68
|
-
</Body>
|
69
|
-
</If>
|
70
|
-
<If condition={showDayOfWeek}>
|
71
|
-
{weekday}
|
72
|
-
<Body
|
73
|
-
color="light"
|
74
|
-
tag="span"
|
75
|
-
text=" • "
|
76
|
-
/>
|
77
|
-
</If>
|
78
|
-
<span>
|
79
|
-
{month}
|
80
|
-
{' '}
|
81
|
-
{day}
|
82
|
-
</span>
|
83
|
-
<If condition={currentYear != year}>
|
84
|
-
<span>
|
85
|
-
{` , ${year}`}
|
86
|
-
</span>
|
87
|
-
</If>
|
88
|
-
</Title>
|
89
|
-
</div>
|
76
|
+
<SmallDate
|
77
|
+
{...props}
|
78
|
+
className={className}
|
79
|
+
value={date}
|
80
|
+
/>
|
90
81
|
)
|
91
82
|
}
|
92
83
|
|
@@ -1,27 +1,2 @@
|
|
1
1
|
@import "../pb_icon/icon";
|
2
2
|
@import "../pb_title/title";
|
3
|
-
|
4
|
-
[class^=pb_date_kit] {
|
5
|
-
display: flex;
|
6
|
-
flex-direction: row;
|
7
|
-
align-items: center;
|
8
|
-
> div {
|
9
|
-
margin-right: 4px !important;
|
10
|
-
}
|
11
|
-
|
12
|
-
&[class*=_center] {
|
13
|
-
display: flex;
|
14
|
-
flex-direction: row;
|
15
|
-
align-items: center;
|
16
|
-
justify-content: center;
|
17
|
-
margin-right: 4px !important;
|
18
|
-
}
|
19
|
-
|
20
|
-
&[class*=_right] {
|
21
|
-
display: flex;
|
22
|
-
flex-direction: row;
|
23
|
-
align-items: center;
|
24
|
-
justify-content: flex-end;
|
25
|
-
margin-left: 4px !important;
|
26
|
-
}
|
27
|
-
}
|
@@ -10,33 +10,25 @@ module Playbook
|
|
10
10
|
partial "pb_date/date"
|
11
11
|
|
12
12
|
prop :date, required: true
|
13
|
+
prop :size, type: Playbook::Props::Enum,
|
14
|
+
values: %w[lg sm xs],
|
15
|
+
default: "sm"
|
13
16
|
prop :timezone, default: "America/New_York"
|
14
|
-
prop :alignment, type: Playbook::Props::Enum,
|
15
|
-
values: %w[left center right],
|
16
|
-
default: "left"
|
17
|
-
prop :show_icon, type: Playbook::Props::Boolean,
|
18
|
-
default: false
|
19
|
-
prop :show_day_of_week, type: Playbook::Props::Boolean,
|
20
|
-
default: false
|
21
17
|
|
22
18
|
def classname
|
23
|
-
generate_classname("pb_date_kit"
|
19
|
+
generate_classname("pb_date_kit")
|
24
20
|
end
|
25
21
|
|
26
|
-
def
|
27
|
-
pb_date_time.to_day_of_week
|
22
|
+
def xs_date
|
23
|
+
"#{pb_date_time.to_day_of_week.upcase} · #{pb_date_time.to_month.upcase} #{pb_date_time.to_day}".html_safe
|
28
24
|
end
|
29
25
|
|
30
|
-
def
|
31
|
-
pb_date_time.to_day
|
26
|
+
def lg_date
|
27
|
+
"#{pb_date_time.to_month.upcase} #{pb_date_time.to_day}"
|
32
28
|
end
|
33
29
|
|
34
|
-
def
|
35
|
-
pb_date_time.to_month.
|
36
|
-
end
|
37
|
-
|
38
|
-
def year
|
39
|
-
pb_date_time.to_year
|
30
|
+
def sm_date
|
31
|
+
"#{pb_date_time.to_day_of_week.upcase} · #{pb_date_time.to_month.upcase} #{pb_date_time.to_day}".html_safe
|
40
32
|
end
|
41
33
|
|
42
34
|
private
|