playbook_ui 15.4.0.pre.alpha.PLAY2582rails722112532 → 15.4.0.pre.alpha.PLAY2627requiredmultiselectdropdownbug12416
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/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +1 -2
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +8 -21
- data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +2 -6
- data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +0 -3
- data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +0 -24
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +2 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +2 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +0 -3
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +0 -1
- data/app/pb_kits/playbook/pb_date_time/date_time.rb +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_date_time/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +0 -3
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +0 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +0 -33
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/index.js +2 -18
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +1 -2
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +1 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +1 -4
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +1 -4
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +262 -384
- data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +5 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +1 -4
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +3 -14
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +7 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +0 -41
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +1 -3
- data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +1 -3
- data/app/pb_kits/playbook/pb_table/_table.tsx +26 -28
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +1 -2
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
- data/app/pb_kits/playbook/utilities/_truncate.scss +0 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +8 -26
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +0 -18
- data/dist/chunks/_line_graph-DDvq7zE7.js +1 -0
- data/dist/chunks/_typeahead-D2bVH5Fk.js +6 -0
- data/dist/chunks/_weekday_stacked-DB8t2C4f.js +37 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/lib-COXg9aPA.js +29 -0
- data/dist/chunks/pb_form_validation-DR765aoq.js +1 -0
- data/dist/chunks/vendor.js +1 -37
- data/dist/playbook-doc.js +19 -0
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +9 -23
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.html.erb +0 -9
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.jsx +0 -24
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_rails.md +0 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_react.md +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +0 -14
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +0 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +0 -22
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +0 -14
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +0 -29
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +0 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +0 -31
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +0 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +0 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +0 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +0 -1
- data/dist/chunks/_typeahead-Cd3O38ts.js +0 -6
- data/dist/chunks/lib-CgpqUb6l.js +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ccec73ff9da24371018279eed782db5b535c23fa452eed663389ef339ec64257
|
|
4
|
+
data.tar.gz: 16ed40f32b267d471031f73b72b48b5beaaa8f872d6e1923e2248c6c72bb234f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68d0361d59daead7dc1a5d010dc5a07ca80ea2b268d1bdb6220242b41973f7a80432e735ada36f12e3dbc6585bf6b41728c1a026a3f1403fc38a184720275877
|
|
7
|
+
data.tar.gz: f7084f65225e083853a288d1323d80f9781cb794f432064839a535e26087cad177fa4de396cd6de13082099c945df5e7111f7b361b4c3e87d0cd98f6b2cdc77d
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
|
-
import AdvancedTable from
|
|
3
|
-
import Flex from '../../pb_flex/_flex'
|
|
4
|
-
import Button from '../../pb_button/_button'
|
|
2
|
+
import { AdvancedTable, Button, Flex } from "playbook-ui"
|
|
5
3
|
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
6
4
|
import PAGINATION_MOCK_DATA from "./advanced_table_pagination_mock_data.json"
|
|
7
5
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import AdvancedTable from
|
|
3
|
-
import TextInput from '../../pb_text_input/_text_input'
|
|
4
|
-
import Body from '../../pb_body/_body'
|
|
2
|
+
import { AdvancedTable, TextInput, Body } from "playbook-ui";
|
|
5
3
|
import MOCK_DATA from "./advanced_table_mock_data.json";
|
|
6
4
|
|
|
7
5
|
const AdvancedTableInlineEditing = (props) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import AdvancedTable from '../_advanced_table'
|
|
3
3
|
import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
|
|
4
|
-
import colors from
|
|
5
|
-
|
|
4
|
+
import { colors } from "playbook-ui"
|
|
6
5
|
|
|
7
6
|
const AdvancedTableRowStyling = (props) => {
|
|
8
7
|
const columnDefinitions = [
|
|
@@ -5,7 +5,6 @@ import { globalProps } from '../utilities/globalProps'
|
|
|
5
5
|
|
|
6
6
|
import Button from '../pb_button/_button'
|
|
7
7
|
import Tooltip from '../pb_tooltip/_tooltip'
|
|
8
|
-
import CircleIconButton from '../pb_circle_icon_button/_circle_icon_button'
|
|
9
8
|
|
|
10
9
|
import usePBCopy from './usePBCopy'
|
|
11
10
|
|
|
@@ -19,7 +18,6 @@ type CopyButtonProps = {
|
|
|
19
18
|
tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left'
|
|
20
19
|
tooltipText?: string
|
|
21
20
|
value?: string
|
|
22
|
-
variant?: 'button' | 'icon'
|
|
23
21
|
timeout?: number
|
|
24
22
|
}
|
|
25
23
|
|
|
@@ -30,12 +28,11 @@ const CopyButton = (props: CopyButtonProps) => {
|
|
|
30
28
|
data = {},
|
|
31
29
|
from = '',
|
|
32
30
|
id,
|
|
33
|
-
text
|
|
31
|
+
text= 'Copy',
|
|
34
32
|
timeout = 1000,
|
|
35
|
-
tooltipPlacement
|
|
33
|
+
tooltipPlacement= 'bottom',
|
|
36
34
|
tooltipText = 'Copied!',
|
|
37
35
|
value = '',
|
|
38
|
-
variant = 'icon',
|
|
39
36
|
} = props
|
|
40
37
|
|
|
41
38
|
const [copied, copy] = usePBCopy({ value, from, timeout })
|
|
@@ -45,8 +42,7 @@ const CopyButton = (props: CopyButtonProps) => {
|
|
|
45
42
|
const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
|
|
46
43
|
|
|
47
44
|
return (
|
|
48
|
-
<div
|
|
49
|
-
{...ariaProps}
|
|
45
|
+
<div {...ariaProps}
|
|
50
46
|
{...dataProps}
|
|
51
47
|
className={classes}
|
|
52
48
|
id={id}
|
|
@@ -57,20 +53,11 @@ const CopyButton = (props: CopyButtonProps) => {
|
|
|
57
53
|
showTooltip={false}
|
|
58
54
|
text={tooltipText}
|
|
59
55
|
>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/>
|
|
66
|
-
) : (
|
|
67
|
-
<Button
|
|
68
|
-
icon="copy"
|
|
69
|
-
onClick={copy}
|
|
70
|
-
>
|
|
71
|
-
{text}
|
|
72
|
-
</Button>
|
|
73
|
-
)}
|
|
56
|
+
<Button icon="copy"
|
|
57
|
+
onClick={copy}
|
|
58
|
+
>
|
|
59
|
+
{text}
|
|
60
|
+
</Button>
|
|
74
61
|
</Tooltip>
|
|
75
62
|
</div>
|
|
76
63
|
)
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<%= pb_content_tag do %>
|
|
2
|
-
|
|
3
|
-
<%=
|
|
4
|
-
<% else %>
|
|
5
|
-
<%= pb_rails("button", props: { icon: "copy" }) do %>
|
|
6
|
-
<%= object.text %>
|
|
7
|
-
<% end %>
|
|
2
|
+
<%= pb_rails("button", props: { icon: "copy" }) do %>
|
|
3
|
+
<%= object.text %>
|
|
8
4
|
<% end %>
|
|
9
5
|
<% if object.id %>
|
|
10
6
|
<%= pb_rails("tooltip", props: {
|
|
@@ -37,29 +37,6 @@ it('copies the value to clipboard and pastes it into an input', async () => {
|
|
|
37
37
|
expect(navigator.clipboard.writeText).toHaveBeenCalledWith("copy");
|
|
38
38
|
})
|
|
39
39
|
|
|
40
|
-
test('passes text and tooltip props to icon variant', () => {
|
|
41
|
-
render(
|
|
42
|
-
<CopyButton
|
|
43
|
-
data={{ testid: 'text-test' }}
|
|
44
|
-
tooltipPlacement="right"
|
|
45
|
-
tooltipText="Text copied!"
|
|
46
|
-
value="copy"
|
|
47
|
-
/>
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const kit = screen.getByTestId('text-test')
|
|
51
|
-
const button = kit.querySelector('.pb_button_kit.pb_button_link.pb_button_inline.pb_button_enabled')
|
|
52
|
-
expect(button).toBeInTheDocument()
|
|
53
|
-
|
|
54
|
-
fireEvent.click(button)
|
|
55
|
-
const tooltipContent = screen.getByText("Text copied!")
|
|
56
|
-
expect(tooltipContent).toHaveTextContent("Text copied!")
|
|
57
|
-
|
|
58
|
-
const tooltip = kit.querySelector('.pb_tooltip_kit')
|
|
59
|
-
expect(tooltip).toBeInTheDocument()
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
63
40
|
test('passes text and tooltip props to button', () => {
|
|
64
41
|
render(
|
|
65
42
|
<CopyButton
|
|
@@ -68,7 +45,6 @@ test('passes text and tooltip props to button', () => {
|
|
|
68
45
|
tooltipPlacement="right"
|
|
69
46
|
tooltipText="Text copied!"
|
|
70
47
|
value="copy"
|
|
71
|
-
variant="button"
|
|
72
48
|
/>
|
|
73
49
|
)
|
|
74
50
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<%= pb_rails("copy_button", props: { id: "default-copy-button", value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease." } ) %>
|
|
2
|
-
<%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "
|
|
1
|
+
<%= pb_rails("copy_button", props: { id: "default-copy-button", text: "Copy Text", value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease." } ) %>
|
|
2
|
+
<%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
|
|
@@ -7,6 +7,7 @@ const CopyButtonDefault = (props) => (
|
|
|
7
7
|
<div>
|
|
8
8
|
<CopyButton
|
|
9
9
|
{...props}
|
|
10
|
+
text="Copy Text"
|
|
10
11
|
tooltipPlacement="right"
|
|
11
12
|
tooltipText="Text copied!"
|
|
12
13
|
value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
|
|
@@ -14,7 +15,7 @@ const CopyButtonDefault = (props) => (
|
|
|
14
15
|
|
|
15
16
|
<Textarea
|
|
16
17
|
{...props}
|
|
17
|
-
placeholder="
|
|
18
|
+
placeholder="Copy and paste here"
|
|
18
19
|
/>
|
|
19
20
|
</div>
|
|
20
21
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= pb_rails("body", props: { id: "body", text: "Copy this body text!"}) %>
|
|
2
|
-
<%= pb_rails("copy_button", props: { text: "Copy Body text", from: "body", id: "copy-body-button"
|
|
2
|
+
<%= pb_rails("copy_button", props: { text: "Copy Body text", from: "body", id: "copy-body-button" }) %>
|
|
3
3
|
<%= pb_rails("text_input", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
|
|
4
|
-
<%= pb_rails("copy_button", props: { text: "Copy Text Input", from: "copy-input", id: "copy-input-button"
|
|
4
|
+
<%= pb_rails("copy_button", props: { text: "Copy Text Input", from: "copy-input", id: "copy-input-button" }) %>
|
|
5
5
|
<%= pb_rails("text_input", props: { margin_top: "xs", id: "copy-input" , value: "Copy and paste here" }) %>
|
|
@@ -21,7 +21,6 @@ const CopyButtonFrom = (props) => {
|
|
|
21
21
|
text="Copy Body text"
|
|
22
22
|
tooltipPlacement="right"
|
|
23
23
|
tooltipText="Body text copied!"
|
|
24
|
-
variant="button"
|
|
25
24
|
/>
|
|
26
25
|
|
|
27
26
|
<TextInput
|
|
@@ -37,7 +36,6 @@ const CopyButtonFrom = (props) => {
|
|
|
37
36
|
text="Copy Text Input"
|
|
38
37
|
tooltipPlacement="right"
|
|
39
38
|
tooltipText="Text input copied!"
|
|
40
|
-
variant="button"
|
|
41
39
|
/>
|
|
42
40
|
|
|
43
41
|
<Textarea
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
examples:
|
|
2
2
|
rails:
|
|
3
3
|
- copy_button_default: Default
|
|
4
|
-
- copy_button_button_variant: Button Variant
|
|
5
4
|
- copy_button_from: Copy From
|
|
6
5
|
- copy_button_hook_rails: Copy Hook
|
|
7
6
|
|
|
8
7
|
react:
|
|
9
8
|
- copy_button_default: Default
|
|
10
|
-
- copy_button_button_variant: Button Variant
|
|
11
9
|
- copy_button_from: Copy From
|
|
12
10
|
- copy_button_hook: Copy Hook
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default as CopyButtonDefault } from './_copy_button_default.jsx'
|
|
2
2
|
export { default as CopyButtonFrom } from './_copy_button_from.jsx'
|
|
3
3
|
export { default as CopyButtonHook } from './_copy_button_hook.jsx'
|
|
4
|
-
export { default as CopyButtonButtonVariant } from './_copy_button_button_variant.jsx'
|
|
@@ -17,7 +17,6 @@ type DateTimeProps = {
|
|
|
17
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
18
18
|
id?: string,
|
|
19
19
|
size?: "sm" | "md",
|
|
20
|
-
showCurrentYear?: boolean,
|
|
21
20
|
showDayOfWeek: boolean,
|
|
22
21
|
showIcon?: boolean,
|
|
23
22
|
timeZone?: string
|
|
@@ -33,7 +32,6 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
33
32
|
showDayOfWeek = false,
|
|
34
33
|
datetime,
|
|
35
34
|
id,
|
|
36
|
-
showCurrentYear = false,
|
|
37
35
|
showIcon = false,
|
|
38
36
|
size = 'md',
|
|
39
37
|
timeZone = 'America/New_York',
|
|
@@ -61,7 +59,6 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
61
59
|
vertical="baseline"
|
|
62
60
|
>
|
|
63
61
|
<FormattedDate
|
|
64
|
-
showCurrentYear={showCurrentYear}
|
|
65
62
|
showDayOfWeek={showDayOfWeek}
|
|
66
63
|
size={size}
|
|
67
64
|
value={datetime}
|
|
@@ -16,7 +16,6 @@ module Playbook
|
|
|
16
16
|
prop :dark, type: Playbook::Props::Boolean, default: false
|
|
17
17
|
prop :show_icon, type: Playbook::Props::Boolean, default: false
|
|
18
18
|
prop :show_day_of_week, type: Playbook::Props::Boolean, default: false
|
|
19
|
-
prop :show_current_year, type: Playbook::Props::Boolean, default: false
|
|
20
19
|
|
|
21
20
|
def classname
|
|
22
21
|
generate_classname("pb_date_time_kit", align)
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
examples:
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_default: Default
|
|
5
5
|
- date_time_align: Alignment
|
|
6
6
|
- date_time_size: Size
|
|
7
|
-
- date_time_show_current_year: Show Current Year
|
|
8
7
|
|
|
9
8
|
react:
|
|
10
9
|
- date_time_default: Default
|
|
11
10
|
- date_time_align: Alignment
|
|
12
11
|
- date_time_size: Size
|
|
13
|
-
- date_time_show_current_year: Show Current Year
|
|
14
12
|
|
|
15
13
|
swift:
|
|
16
14
|
- date_time_default_swift: Default
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default as DateTimeDefault } from './_date_time_default.jsx'
|
|
2
2
|
export { default as DateTimeAlign } from './_date_time_align.jsx'
|
|
3
3
|
export { default as DateTimeSize } from './_date_time_size.jsx'
|
|
4
|
-
export { default as DateTimeShowCurrentYear } from './_date_time_show_current_year.jsx'
|
|
@@ -17,7 +17,6 @@ type DateTimeStackedProps = {
|
|
|
17
17
|
datetime: Date,
|
|
18
18
|
dark: boolean,
|
|
19
19
|
timeZone?: string,
|
|
20
|
-
showCurrentYear?: boolean,
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
@@ -29,7 +28,6 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
29
28
|
dark,
|
|
30
29
|
htmlOptions = {},
|
|
31
30
|
timeZone = 'America/New_York',
|
|
32
|
-
showCurrentYear = false,
|
|
33
31
|
} = props
|
|
34
32
|
|
|
35
33
|
const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
|
|
@@ -48,7 +46,6 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
48
46
|
bold
|
|
49
47
|
dark={dark}
|
|
50
48
|
date={date || datetime}
|
|
51
|
-
showCurrentYear={showCurrentYear}
|
|
52
49
|
/>
|
|
53
50
|
</FlexItem>
|
|
54
51
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
<%= pb_content_tag do %>
|
|
2
2
|
|
|
3
3
|
<%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
|
|
4
4
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
5
|
-
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark
|
|
5
|
+
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark }) %>
|
|
6
6
|
<% end %>
|
|
7
7
|
<%= pb_rails("section_separator", props: { orientation: "vertical", classname: "date-time-padding" }) %>
|
|
8
8
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
@@ -41,36 +41,3 @@ test('renders time in timezone', () => {
|
|
|
41
41
|
const kit = renderKit(DateTimeStacked, props)
|
|
42
42
|
expect(kit).toHaveTextContent(`${monthDayYear}11:00aMDT`)
|
|
43
43
|
})
|
|
44
|
-
|
|
45
|
-
test('renders current year when showCurrentYear is true', () => {
|
|
46
|
-
const currentYearDate = new Date()
|
|
47
|
-
const currentYear = currentYearDate.getFullYear()
|
|
48
|
-
|
|
49
|
-
const kit = renderKit(DateTimeStacked, {
|
|
50
|
-
data: { testid: 'datetimestacked-current-year' },
|
|
51
|
-
datetime: currentYearDate,
|
|
52
|
-
dark: false,
|
|
53
|
-
showCurrentYear: true,
|
|
54
|
-
})
|
|
55
|
-
expect(kit).toHaveTextContent(currentYear.toString())
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
test('hides current year by default', () => {
|
|
59
|
-
const currentYearDate = new Date()
|
|
60
|
-
const currentYear = currentYearDate.getFullYear()
|
|
61
|
-
|
|
62
|
-
const kit = renderKit(DateTimeStacked, {
|
|
63
|
-
data: { testid: 'datetimestacked-hide-year' },
|
|
64
|
-
datetime: currentYearDate,
|
|
65
|
-
dark: false,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const yearElement = kit.querySelector('.pb_caption_kit_xs')
|
|
69
|
-
|
|
70
|
-
if (yearElement) {
|
|
71
|
-
expect(yearElement.textContent).not.toBe(currentYear.toString())
|
|
72
|
-
} else {
|
|
73
|
-
|
|
74
|
-
expect(yearElement).toBeNull()
|
|
75
|
-
}
|
|
76
|
-
})
|
|
@@ -2,11 +2,9 @@ examples:
|
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_stacked_default: Default
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
7
6
|
react:
|
|
8
7
|
- date_time_stacked_default: Default
|
|
9
|
-
- date_time_stacked_show_current_year: Show Current Year
|
|
10
8
|
|
|
11
9
|
swift:
|
|
12
10
|
- date_time_stacked_default_swift: Default
|
|
@@ -33,8 +33,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
33
33
|
this.formPillProps = this.element.dataset.formPillProps
|
|
34
34
|
? JSON.parse(this.element.dataset.formPillProps)
|
|
35
35
|
: {};
|
|
36
|
-
const baseInput = this.element.querySelector(DROPDOWN_INPUT);
|
|
37
|
-
this.wasOriginallyRequired = baseInput && baseInput.hasAttribute("required");
|
|
38
36
|
this.setDefaultValue();
|
|
39
37
|
this.bindEventListeners();
|
|
40
38
|
this.bindSearchInput();
|
|
@@ -589,9 +587,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
589
587
|
// for multi_select, for each selectedOption, create a hidden input
|
|
590
588
|
const name = baseInput.getAttribute("name");
|
|
591
589
|
this.selectedOptions.forEach((raw) => {
|
|
592
|
-
const
|
|
593
|
-
// Use id if available, otherwise fall back to value
|
|
594
|
-
const id = optionData.id || optionData.value;
|
|
590
|
+
const id = JSON.parse(raw).id;
|
|
595
591
|
const inp = document.createElement("input");
|
|
596
592
|
inp.type = "hidden";
|
|
597
593
|
inp.name = name;
|
|
@@ -599,19 +595,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
599
595
|
inp.dataset.generated = "true";
|
|
600
596
|
baseInput.insertAdjacentElement("afterend", inp);
|
|
601
597
|
});
|
|
602
|
-
|
|
603
|
-
// For multi-select, remove required from base input when there are selections
|
|
604
|
-
// The generated inputs handle the form submission with actual values
|
|
605
|
-
// Restore required attribute when there are no selections (if it was originally required)
|
|
606
|
-
if (this.selectedOptions.size > 0) {
|
|
607
|
-
baseInput.value = "";
|
|
608
|
-
baseInput.removeAttribute("required");
|
|
609
|
-
} else {
|
|
610
|
-
baseInput.value = "";
|
|
611
|
-
if (this.wasOriginallyRequired) {
|
|
612
|
-
baseInput.setAttribute("required", "");
|
|
613
|
-
}
|
|
614
|
-
}
|
|
598
|
+
baseInput.value = "";
|
|
615
599
|
}
|
|
616
600
|
|
|
617
601
|
handleBackspaceClear() {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import Card from '
|
|
3
|
-
import Caption from '../../pb_caption/_caption'
|
|
4
|
-
import FormPill from '../_form_pill'
|
|
5
|
-
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
2
|
+
import { Card, Caption, FormPill, Typeahead } from 'playbook-ui'
|
|
6
3
|
|
|
7
4
|
const names = [
|
|
8
5
|
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|