playbook_ui 7.0.1.pre.alpha12 → 7.0.1.pre.alpha14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/data/menu.yml +1 -1
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/packs/examples.js +6 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +22 -6
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +5 -1
- data/app/pb_kits/playbook/pb_background/_background.html.erb +14 -0
- data/app/pb_kits/playbook/pb_background/_background.jsx +64 -0
- data/app/pb_kits/playbook/pb_background/_background.scss +15 -0
- data/app/pb_kits/playbook/pb_background/background.rb +36 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_default.html.erb +41 -0
- data/app/pb_kits/playbook/pb_background/docs/_background_default.jsx +75 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +4 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +5 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +5 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +3 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb +10 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +130 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +39 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +117 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +53 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +5 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_date/date.rb +2 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +8 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb +51 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.md +6 -0
- data/app/pb_kits/playbook/pb_date/docs/_description.md +2 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +7 -4
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +8 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/{_date_picker_read_only.html.erb → _date_picker_allow_input.html.erb} +1 -1
- 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_on_change.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +1 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +6 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +3 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_image/_image.jsx +5 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +5 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +4 -4
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +3 -2
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +3 -2
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +5 -1
- data/app/pb_kits/playbook/pb_message/_message.jsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +5 -2
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +5 -1
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +5 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +4 -4
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.html.erb +1 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_options.html.erb +9 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/radio.rb +2 -4
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +3 -3
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +6 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
- data/app/pb_kits/playbook/pb_time/_time.jsx +22 -13
- 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_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 +3 -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 +38 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
- data/app/pb_kits/playbook/pb_time/docs/example.yml +6 -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_time_range_inline/_time_range_inline.jsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +3 -3
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +3 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +41 -43
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_toggle/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +2 -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/pb_user_badge/_user_badge.jsx +5 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
- data/app/pb_kits/playbook/tokens/_typography.scss +3 -3
- data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +50 -8
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx +0 -13
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md +0 -1
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.html.erb +0 -11
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +0 -44
@@ -7,6 +7,8 @@ module Playbook
|
|
7
7
|
|
8
8
|
partial "pb_date_picker/date_picker"
|
9
9
|
|
10
|
+
prop :allow_input, type: Playbook::Props::Boolean,
|
11
|
+
default: false
|
10
12
|
prop :dark, type: Playbook::Props::Boolean,
|
11
13
|
default: false
|
12
14
|
prop :default_date, type: Playbook::Props::String,
|
@@ -40,8 +42,6 @@ module Playbook
|
|
40
42
|
prop :picker_id, type: Playbook::Props::String,
|
41
43
|
required: true
|
42
44
|
prop :placeholder, type: Playbook::Props::String
|
43
|
-
prop :read_only, type: Playbook::Props::Boolean,
|
44
|
-
default: false
|
45
45
|
prop :required, type: Playbook::Props::Boolean,
|
46
46
|
default: false
|
47
47
|
prop :type, type: Playbook::Props::String
|
@@ -54,6 +54,7 @@ module Playbook
|
|
54
54
|
|
55
55
|
def date_picker_config
|
56
56
|
{
|
57
|
+
allowInput: allow_input,
|
57
58
|
defaultDate: default_date,
|
58
59
|
disableDate: disable_date,
|
59
60
|
disableRange: disable_range,
|
@@ -64,7 +65,6 @@ module Playbook
|
|
64
65
|
minDate: min_date,
|
65
66
|
mode: mode,
|
66
67
|
pickerId: picker_id,
|
67
|
-
readOnly: read_only,
|
68
68
|
yearRange: year_range,
|
69
69
|
}.to_json.html_safe
|
70
70
|
end
|
@@ -2,17 +2,17 @@ import flatpickr from 'flatpickr'
|
|
2
2
|
|
3
3
|
const datePickerHelper = (config) => {
|
4
4
|
const {
|
5
|
+
allowInput,
|
5
6
|
defaultDate,
|
6
7
|
disableDate,
|
7
8
|
disableRange,
|
8
9
|
disableWeekdays,
|
9
10
|
format,
|
10
|
-
hideIcon,
|
11
11
|
maxDate,
|
12
12
|
minDate,
|
13
13
|
mode,
|
14
|
+
onChange,
|
14
15
|
pickerId,
|
15
|
-
readOnly,
|
16
16
|
yearRange,
|
17
17
|
} = config
|
18
18
|
|
@@ -65,7 +65,6 @@ const datePickerHelper = (config) => {
|
|
65
65
|
|
66
66
|
flatpickr(`#${pickerId}`, {
|
67
67
|
disableMobile: true,
|
68
|
-
allowInput: !readOnly,
|
69
68
|
dateFormat: format,
|
70
69
|
defaultDate: defaultDateGetter(),
|
71
70
|
disable: disableWeekdays && disableWeekdays.length > 0 ? [
|
@@ -101,6 +100,9 @@ const datePickerHelper = (config) => {
|
|
101
100
|
onClose: [() => {
|
102
101
|
window.removeEventListener('resize', calendarResizer)
|
103
102
|
}],
|
103
|
+
onChange: [(selectedDates, dateStr) => {
|
104
|
+
onChange(dateStr, selectedDates)
|
105
|
+
}],
|
104
106
|
onYearChange: [],
|
105
107
|
prevArrow: '<i class="far fa-angle-left"></i>',
|
106
108
|
static: true,
|
@@ -141,13 +143,6 @@ const datePickerHelper = (config) => {
|
|
141
143
|
}
|
142
144
|
picker.config.onYearChange.push(yearChangeHook)
|
143
145
|
|
144
|
-
// click handling for Calendar Icon
|
145
|
-
if (!hideIcon){
|
146
|
-
document.querySelector(`#cal-icon-${pickerId}`).addEventListener('click', () => {
|
147
|
-
picker.toggle()
|
148
|
-
})
|
149
|
-
}
|
150
|
-
|
151
146
|
// Adding dropdown icons to year and month selects
|
152
147
|
picker.monthElements[0].insertAdjacentHTML('afterend', '<i class="far fa-angle-down month-dropdown-icon"></i>')
|
153
148
|
dropdown.insertAdjacentHTML('afterend', '<i class="far fa-angle-down year-dropdown-icon" id="test-id"></i>')
|
@@ -166,6 +161,9 @@ const datePickerHelper = (config) => {
|
|
166
161
|
dropdown.value = picker.currentYear
|
167
162
|
}
|
168
163
|
})
|
164
|
+
if (allowInput){
|
165
|
+
picker.input.removeAttribute('readonly')
|
166
|
+
}
|
169
167
|
}
|
170
168
|
|
171
169
|
export default datePickerHelper
|
@@ -0,0 +1 @@
|
|
1
|
+
By default the date picker input can only be modified by picking a date on the calendar. This prop allows your users to manually type in the date.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { DatePicker, LabelValue } from '../..'
|
3
|
+
|
4
|
+
const DatePickerOnChange = () => {
|
5
|
+
const today = new Date()
|
6
|
+
const [dateString, setDateString] = useState(today.toLocaleDateString())
|
7
|
+
const [dateObj, setDateObj] = useState([today])
|
8
|
+
|
9
|
+
const changeHandler = (dateStr, selectedDates) => {
|
10
|
+
setDateString(dateStr)
|
11
|
+
setDateObj(selectedDates)
|
12
|
+
}
|
13
|
+
|
14
|
+
return (
|
15
|
+
<div>
|
16
|
+
<DatePicker
|
17
|
+
defaultDate={dateString}
|
18
|
+
marginBottom="lg"
|
19
|
+
onChange={changeHandler}
|
20
|
+
pickerId="date-picker-onchange"
|
21
|
+
/>
|
22
|
+
<LabelValue
|
23
|
+
label="Date Object"
|
24
|
+
marginBottom="lg"
|
25
|
+
value={dateObj[0] ? dateObj[0].toString() : ''}
|
26
|
+
/>
|
27
|
+
<LabelValue
|
28
|
+
label="Date String"
|
29
|
+
value={dateString}
|
30
|
+
/>
|
31
|
+
</div>
|
32
|
+
)
|
33
|
+
}
|
34
|
+
export default DatePickerOnChange
|
@@ -0,0 +1,3 @@
|
|
1
|
+
Your change handler function has access to two arguments: `dateStr` and `selectedDates`.
|
2
|
+
|
3
|
+
The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
|
@@ -12,7 +12,7 @@ examples:
|
|
12
12
|
- date_picker_min_max: Min Max
|
13
13
|
- date_picker_error: Error
|
14
14
|
- date_picker_hooks: Hooks
|
15
|
-
-
|
15
|
+
# - date_picker_allow_input: Allow Input
|
16
16
|
- date_picker_year_range: Year Range
|
17
17
|
- date_picker_dark: Dark
|
18
18
|
|
@@ -23,13 +23,14 @@ examples:
|
|
23
23
|
- date_picker_default_date: Default Date
|
24
24
|
- date_picker_input: Input Field
|
25
25
|
- date_picker_label: Label
|
26
|
+
- date_picker_on_change: onChange
|
26
27
|
- date_picker_range: Range
|
27
28
|
- date_picker_format: Format
|
28
29
|
- date_picker_disabled: Disabled Dates
|
29
30
|
- date_picker_min_max: Min Max
|
30
31
|
- date_picker_error: Error
|
31
32
|
- date_picker_hooks: Hooks
|
32
|
-
-
|
33
|
+
# - date_picker_allow_input: Allow Input
|
33
34
|
- date_picker_year_range: Year Range
|
34
35
|
- date_picker_dark: Dark
|
35
36
|
|
@@ -3,12 +3,13 @@ export { default as DatePickerHideIcon } from './_date_picker_hide_icon.jsx'
|
|
3
3
|
export { default as DatePickerInput } from './_date_picker_input.jsx'
|
4
4
|
export { default as DatePickerDefaultDate } from './_date_picker_default_date.jsx'
|
5
5
|
export { default as DatePickerLabel } from './_date_picker_label.jsx'
|
6
|
+
export { default as DatePickerOnChange } from './_date_picker_on_change.jsx'
|
6
7
|
export { default as DatePickerRange } from './_date_picker_range.jsx'
|
7
8
|
export { default as DatePickerFormat } from './_date_picker_format.jsx'
|
8
9
|
export { default as DatePickerDisabled } from './_date_picker_disabled.jsx'
|
9
10
|
export { default as DatePickerMinMax } from './_date_picker_min_max.jsx'
|
10
11
|
export { default as DatePickerError } from './_date_picker_error.jsx'
|
11
12
|
export { default as DatePickerHooks } from './_date_picker_hooks.jsx'
|
12
|
-
export { default as
|
13
|
+
// export { default as DatePickerAllowInput } from './_date_picker_allow_input.jsx'
|
13
14
|
export { default as DatePickerYearRange } from './_date_picker_year_range.jsx'
|
14
15
|
export { default as DatePickerDark } from './_date_picker_dark.jsx'
|
@@ -18,7 +18,11 @@ type DateRangeStackedProps = {
|
|
18
18
|
|
19
19
|
const DateRangeStacked = (props: DateRangeStackedProps) => {
|
20
20
|
const { className, dark = false, endDate, startDate } = props
|
21
|
-
const css = classnames(
|
21
|
+
const css = classnames(
|
22
|
+
buildCss('pb_date_range_stacked'),
|
23
|
+
globalProps(props),
|
24
|
+
className
|
25
|
+
)
|
22
26
|
|
23
27
|
return (
|
24
28
|
<div className={css}>
|
@@ -33,12 +33,12 @@ const DateStacked = (props: DateStackedProps) => {
|
|
33
33
|
size = 'sm',
|
34
34
|
} = props
|
35
35
|
const classes = classnames(
|
36
|
-
className,
|
37
36
|
buildCss('pb_date_stacked_kit', align, size, {
|
38
37
|
dark: dark,
|
39
38
|
reverse: reverse,
|
40
39
|
}),
|
41
|
-
globalProps(props)
|
40
|
+
globalProps(props),
|
41
|
+
className
|
42
42
|
)
|
43
43
|
|
44
44
|
const currentYear = new Date().getFullYear().toString()
|
@@ -20,7 +20,11 @@ type DateYearStackedProps = {
|
|
20
20
|
const DateYearStacked = (props: DateYearStackedProps) => {
|
21
21
|
const { align = 'left', className, dark = false, date } = props
|
22
22
|
const dateTimestamp = new DateTime({ value: date })
|
23
|
-
const css = classnames(
|
23
|
+
const css = classnames(
|
24
|
+
buildCss('pb_date_year_stacked', align),
|
25
|
+
globalProps(props),
|
26
|
+
className
|
27
|
+
)
|
24
28
|
|
25
29
|
return (
|
26
30
|
<div className={css}>
|
@@ -23,9 +23,9 @@ type FixedConfirmationToastProps = {
|
|
23
23
|
const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
|
24
24
|
const { className, status = 'neutral', text } = props
|
25
25
|
const css = classnames(
|
26
|
-
className,
|
27
26
|
`pb_fixed_confirmation_toast_kit_${status}`,
|
28
|
-
globalProps(props)
|
27
|
+
globalProps(props),
|
28
|
+
className
|
29
29
|
)
|
30
30
|
const icon = iconMap[status]
|
31
31
|
|
@@ -18,7 +18,7 @@ const FlexItem = (props: FlexItemPropTypes) => {
|
|
18
18
|
|
19
19
|
return (
|
20
20
|
<div
|
21
|
-
className={classnames(buildCss('pb_flex_item_kit', growClass),
|
21
|
+
className={classnames(buildCss('pb_flex_item_kit', growClass), globalProps(props), className)}
|
22
22
|
style={fixedStyle}
|
23
23
|
>
|
24
24
|
{children}
|
@@ -24,7 +24,12 @@
|
|
24
24
|
<%= form.text_area :example_text_area, props: { label: true } %>
|
25
25
|
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
|
26
26
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
27
|
-
<%= form.check_box :example_checkbox,
|
27
|
+
<%= form.check_box :example_checkbox,
|
28
|
+
data: { field1: "value1", field2: "value2" },
|
29
|
+
props: { text: "Example Checkbox", label: true },
|
30
|
+
id: "checkbox-id",
|
31
|
+
name: "checkbox-name",
|
32
|
+
class: "checkbox-class" %>
|
28
33
|
<%= form.date_picker :example_date_picker1, props: { default_date: "blank" } %>
|
29
34
|
|
30
35
|
<%= form.actions do |action| %>
|
@@ -18,8 +18,9 @@ type FormPillProps = {
|
|
18
18
|
const FormPill = (props: FormPillProps) => {
|
19
19
|
const { className, text, name, onClick = () => {}, avatarUrl } = props
|
20
20
|
const css = classnames(
|
21
|
-
|
22
|
-
globalProps(props)
|
21
|
+
`pb_form_pill_kit_${'primary'}`,
|
22
|
+
globalProps(props),
|
23
|
+
className
|
23
24
|
)
|
24
25
|
return (
|
25
26
|
<div className={css}>
|
@@ -27,7 +27,7 @@ const Highlight = (props: HighlightProps) => {
|
|
27
27
|
<Highlighter
|
28
28
|
autoEscape
|
29
29
|
data={data}
|
30
|
-
highlightClassName={classnames(
|
30
|
+
highlightClassName={classnames(globalProps(props), className)}
|
31
31
|
highlightTag="span"
|
32
32
|
id={id}
|
33
33
|
searchWords={highlightedText}
|
@@ -40,12 +40,12 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
|
|
40
40
|
|
41
41
|
const classes = (className, dark) =>
|
42
42
|
classnames(
|
43
|
-
className,
|
44
43
|
{
|
45
44
|
'pb_home_address_street': !dark,
|
46
45
|
'pb_home_address_street_dark': dark,
|
47
46
|
},
|
48
|
-
globalProps(props)
|
47
|
+
globalProps(props),
|
48
|
+
className
|
49
49
|
)
|
50
50
|
return (
|
51
51
|
<div className={classes(className, dark)}>
|
@@ -56,7 +56,6 @@ const Icon = (props: IconProps) => {
|
|
56
56
|
spin = false,
|
57
57
|
} = props
|
58
58
|
const classes = classnames(
|
59
|
-
className,
|
60
59
|
flipMap[flip],
|
61
60
|
'pb_icon_kit',
|
62
61
|
'far',
|
@@ -72,7 +71,8 @@ const Icon = (props: IconProps) => {
|
|
72
71
|
[`fa-pull-${pull}`]: pull,
|
73
72
|
[`fa-rotate-${rotation}`]: rotation,
|
74
73
|
},
|
75
|
-
globalProps(props)
|
74
|
+
globalProps(props),
|
75
|
+
className
|
76
76
|
)
|
77
77
|
|
78
78
|
return (
|
@@ -32,7 +32,11 @@ const IconValue = (props: IconValueProps) => {
|
|
32
32
|
} = props
|
33
33
|
const ariaProps = buildAriaProps(aria)
|
34
34
|
const dataProps = buildDataProps(data)
|
35
|
-
const classes = classnames(
|
35
|
+
const classes = classnames(
|
36
|
+
buildCss('pb_icon_value_kit', align),
|
37
|
+
globalProps(props),
|
38
|
+
className
|
39
|
+
)
|
36
40
|
|
37
41
|
return (
|
38
42
|
<div
|
@@ -25,7 +25,11 @@ const Image = (props: ImageProps) => {
|
|
25
25
|
} = props
|
26
26
|
|
27
27
|
const ariaProps = buildAriaProps(aria)
|
28
|
-
const classes = classnames(
|
28
|
+
const classes = classnames(
|
29
|
+
buildCss('pb_image lazyload blur_up'),
|
30
|
+
globalProps(props),
|
31
|
+
className
|
32
|
+
)
|
29
33
|
const dataProps = buildDataProps(data)
|
30
34
|
|
31
35
|
return (
|
@@ -30,7 +30,11 @@ const LabelPill = (props: LabelPillProps) => {
|
|
30
30
|
} = props
|
31
31
|
const ariaProps = buildAriaProps(aria)
|
32
32
|
const dataProps = buildDataProps(data)
|
33
|
-
const css = classnames(
|
33
|
+
const css = classnames(
|
34
|
+
'pb_label_pill_kit',
|
35
|
+
globalProps(props),
|
36
|
+
className
|
37
|
+
)
|
34
38
|
|
35
39
|
return (
|
36
40
|
<div
|
@@ -46,7 +46,7 @@ type LayoutFooterProps = {
|
|
46
46
|
const Side = (props: LayoutSideProps) => {
|
47
47
|
const { children, className } = props
|
48
48
|
return (
|
49
|
-
<div className={classnames('layout_sidebar',
|
49
|
+
<div className={classnames('layout_sidebar', globalProps(props), className)}>
|
50
50
|
{children}
|
51
51
|
</div>
|
52
52
|
)
|
@@ -56,7 +56,7 @@ const Side = (props: LayoutSideProps) => {
|
|
56
56
|
const Body = (props: LayoutBodyProps) => {
|
57
57
|
const { children, className } = props
|
58
58
|
return (
|
59
|
-
<div className={classnames('layout_body',
|
59
|
+
<div className={classnames('layout_body', globalProps(props), className)}>
|
60
60
|
{children}
|
61
61
|
</div>
|
62
62
|
)
|
@@ -66,7 +66,7 @@ const Body = (props: LayoutBodyProps) => {
|
|
66
66
|
const Header = (props: LayoutHeaderProps) => {
|
67
67
|
const { children, className } = props
|
68
68
|
return (
|
69
|
-
<div className={classnames('layout_header',
|
69
|
+
<div className={classnames('layout_header', globalProps(props), className)}>
|
70
70
|
{children}
|
71
71
|
</div>
|
72
72
|
)
|
@@ -76,7 +76,7 @@ const Header = (props: LayoutHeaderProps) => {
|
|
76
76
|
const Footer = (props: LayoutFooterProps) => {
|
77
77
|
const { children, className } = props
|
78
78
|
return (
|
79
|
-
<div className={classnames('layout_footer',
|
79
|
+
<div className={classnames('layout_footer', globalProps(props), className)}>
|
80
80
|
{children}
|
81
81
|
</div>
|
82
82
|
)
|