playbook_ui 13.12.0.pre.alpha.PLAY1051removinghighchartsdependency1551 → 13.12.0.pre.alpha.PLAY1081exportingtypes1626
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_bar_graph/_bar_graph.tsx +32 -36
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +63 -67
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +46 -57
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +34 -39
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +28 -33
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +1 -1
- metadata +18 -2
@@ -6,3 +6,9 @@ examples:
|
|
6
6
|
|
7
7
|
react:
|
8
8
|
- multiple_users_stacked_default: Default
|
9
|
+
|
10
|
+
swift:
|
11
|
+
- multiple_users_stacked_default_swift: Default
|
12
|
+
- multiple_users_stacked_small_swift: Small
|
13
|
+
- multiple_users_stacked_xsmall_swift: xSmall
|
14
|
+
- multiple_users_stacked_props_swift: ""
|
@@ -0,0 +1,35 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
```swift
|
4
|
+
|
5
|
+
PBTextInput(
|
6
|
+
"ADD ON WITH DEFAULTS",
|
7
|
+
text: $textAddOn,
|
8
|
+
style: .rightIcon(.user, divider: true)
|
9
|
+
)
|
10
|
+
|
11
|
+
PBTextInput(
|
12
|
+
"RIGHT-ALIGNED ADD ON WITH BORDER",
|
13
|
+
text: $textAddOnRight,
|
14
|
+
style: .rightIcon(.user, divider: true)
|
15
|
+
)
|
16
|
+
|
17
|
+
PBTextInput(
|
18
|
+
"RIGHT-ALIGNED ADD ON WITH NO BORDER",
|
19
|
+
text: $textAddOnRightNoBorder,
|
20
|
+
style: .rightIcon(.user, divider: false)
|
21
|
+
)
|
22
|
+
|
23
|
+
PBTextInput(
|
24
|
+
"LEFT-ALIGNED ADD ON WITH NO BORDER",
|
25
|
+
text: $textAddOnLeft,
|
26
|
+
style: .leftIcon(.user, divider: false)
|
27
|
+
)
|
28
|
+
|
29
|
+
PBTextInput(
|
30
|
+
"LEFT-ALIGNED ADD ON WITH BORDER",
|
31
|
+
text: $textAddOnLeftNoBorder,
|
32
|
+
style: .leftIcon(.user, divider: true)
|
33
|
+
)
|
34
|
+
|
35
|
+
```
|
@@ -0,0 +1,29 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
|
4
|
+
```swift
|
5
|
+
|
6
|
+
@State private var textFirstName: String = ""
|
7
|
+
@State private var textLastName: String = ""
|
8
|
+
@State private var textPhone: String = ""
|
9
|
+
|
10
|
+
PBTextInput(
|
11
|
+
"First name",
|
12
|
+
text: $textFirstName,
|
13
|
+
placeholder: "Enter first name"
|
14
|
+
)
|
15
|
+
|
16
|
+
PBTextInput(
|
17
|
+
"Last name",
|
18
|
+
text: $textLastName,
|
19
|
+
placeholder: "Enter last name"
|
20
|
+
)
|
21
|
+
|
22
|
+
PBTextInput(
|
23
|
+
"Phone number",
|
24
|
+
text: $textPhone,
|
25
|
+
placeholder: "Enter phone number",
|
26
|
+
keyboardType: .phonePad
|
27
|
+
)
|
28
|
+
|
29
|
+
```
|
@@ -0,0 +1,24 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
|
4
|
+
```swift
|
5
|
+
|
6
|
+
@State private var textError: String = ""
|
7
|
+
@State private var textConfirmError: String = ""
|
8
|
+
|
9
|
+
PBTextInput(
|
10
|
+
"Email address",
|
11
|
+
text: $textError,
|
12
|
+
placeholder: "Enter email address",
|
13
|
+
error: (true, "Insert a valid email"),
|
14
|
+
style: .leftIcon(.user, divider: true)
|
15
|
+
)
|
16
|
+
|
17
|
+
PBTextInput(
|
18
|
+
"Confirm email address",
|
19
|
+
text: $textConfirmError,
|
20
|
+
placeholder: "Confirm email address",
|
21
|
+
style: .leftIcon(.user, divider: true)
|
22
|
+
)
|
23
|
+
|
24
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **title** | `String` | Adds a title | `nil` | |
|
5
|
+
| **placeholder** | `String` | Adds placeholder text | `""` | |
|
6
|
+
| **error** | `(Bool, String)` | Changes the style of the Text Input | `nil` | |
|
7
|
+
| **style** | `Style` | Changes the style of the Text Input | `.default` | `.default` `.rightIcon` `.leftIcon` `.inline` `.disabled` |
|
8
|
+
| **onChange** | `Bool` | Adds an event handler | `nil` | |
|
9
|
+
| **keyboardType** | `UIKeyboardType` | Speficies the keyboard type (ios only) | `.default` | |
|
10
|
+
| **text** | `String` | Sets the Text Input's text value | | |
|
11
|
+
| **selected** | `Bool` | Changes the style of the Text Input | | `true` `false` |
|
12
|
+
| **isHovering** | `Bool` | Changes the style of the Text Input | `false` | `true` `false` |
|
13
|
+
| **isIconHovering** | `Bool` | Changes the style of the Text Input | `false` | `true` `false` |
|
@@ -16,3 +16,10 @@ examples:
|
|
16
16
|
- text_input_add_on: Add On
|
17
17
|
- text_input_inline: Inline
|
18
18
|
- text_input_no_label: No Label
|
19
|
+
|
20
|
+
swift:
|
21
|
+
- text_input_default_swift: Default
|
22
|
+
- text_input_error_swift: With Error
|
23
|
+
- text_input_disabled_swift: Disabled
|
24
|
+
- text_input_add_on_swift: Add On
|
25
|
+
- text_input_props_swift: ""
|
@@ -0,0 +1,6 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **isHovering** | `Bool` | Changes the style of the Toggle | `false` | `true` `false` |
|
5
|
+
| **label** | `String` | Adds a label to the Toggle | `nil` | |
|
6
|
+
| **checked** | `Bool` | Changes the style of the Toggle | | `true` `false` |
|
@@ -5,6 +5,7 @@ import { globalProps } from "../utilities/globalProps";
|
|
5
5
|
import { buildAriaProps, buildDataProps } from "../utilities/props";
|
6
6
|
|
7
7
|
import HighchartsReact from "highcharts-react-official";
|
8
|
+
import Highcharts from "highcharts";
|
8
9
|
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
9
10
|
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
10
11
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
@@ -12,24 +13,24 @@ import treemap from 'highcharts/modules/treemap'
|
|
12
13
|
|
13
14
|
type TreemapChartProps = {
|
14
15
|
chartData: {
|
15
|
-
name: string
|
16
|
-
parent?: string | number
|
17
|
-
value: number
|
18
|
-
color?: string
|
19
|
-
id?: string | number
|
20
|
-
}[]
|
21
|
-
className?: string
|
22
|
-
colors: string[]
|
23
|
-
dark?: boolean
|
24
|
-
drillable: boolean
|
25
|
-
grouped: boolean
|
26
|
-
height?: string
|
27
|
-
id: number | string
|
28
|
-
title?: string
|
29
|
-
tooltipHtml: string
|
30
|
-
type?: string
|
31
|
-
aria?: { [key: string]: string }
|
32
|
-
data?: { [key: string]: string }
|
16
|
+
name: string;
|
17
|
+
parent?: string | number;
|
18
|
+
value: number;
|
19
|
+
color?: string;
|
20
|
+
id?: string | number;
|
21
|
+
}[];
|
22
|
+
className?: string;
|
23
|
+
colors: string[];
|
24
|
+
dark?: boolean;
|
25
|
+
drillable: boolean;
|
26
|
+
grouped: boolean;
|
27
|
+
height?: string;
|
28
|
+
id: number | string;
|
29
|
+
title?: string;
|
30
|
+
tooltipHtml: string;
|
31
|
+
type?: string;
|
32
|
+
aria?: { [key: string]: string };
|
33
|
+
data?: { [key: string]: string };
|
33
34
|
};
|
34
35
|
|
35
36
|
const TreemapChart = ({
|
@@ -49,6 +50,13 @@ const TreemapChart = ({
|
|
49
50
|
}: TreemapChartProps) => {
|
50
51
|
const ariaProps = buildAriaProps(aria);
|
51
52
|
const dataProps = buildDataProps(data);
|
53
|
+
const setupTheme = () => {
|
54
|
+
dark
|
55
|
+
? Highcharts.setOptions(highchartsDarkTheme)
|
56
|
+
: Highcharts.setOptions(highchartsTheme);
|
57
|
+
};
|
58
|
+
treemap(Highcharts)
|
59
|
+
setupTheme();
|
52
60
|
|
53
61
|
const staticOptions = {
|
54
62
|
title: {
|
@@ -80,26 +88,13 @@ const TreemapChart = ({
|
|
80
88
|
};
|
81
89
|
|
82
90
|
const [options, setOptions] = useState({});
|
83
|
-
const [isHighchartsLoaded, setIsHighchartsLoaded] = useState(false);
|
84
91
|
|
85
92
|
useEffect(() => {
|
93
|
+
|
86
94
|
setOptions({ ...staticOptions });
|
87
|
-
|
88
|
-
const interval = setInterval(() => {
|
89
|
-
if (window.Highcharts) {
|
90
|
-
clearInterval(interval)
|
91
|
-
dark
|
92
|
-
? window.Highcharts.setOptions(highchartsDarkTheme)
|
93
|
-
: window.Highcharts.setOptions(highchartsTheme)
|
94
|
-
|
95
|
-
treemap(window.Highcharts)
|
96
|
-
setIsHighchartsLoaded(true)
|
97
|
-
}
|
98
|
-
}, 0)
|
99
95
|
}, [chartData]);
|
100
96
|
|
101
97
|
return (
|
102
|
-
isHighchartsLoaded &&
|
103
98
|
<HighchartsReact
|
104
99
|
containerProps={{
|
105
100
|
className: classnames(globalProps(props), "pb_treemap_chart"),
|
@@ -107,7 +102,7 @@ const TreemapChart = ({
|
|
107
102
|
...ariaProps,
|
108
103
|
...dataProps,
|
109
104
|
}}
|
110
|
-
highcharts={
|
105
|
+
highcharts={Highcharts}
|
111
106
|
options={options}
|
112
107
|
/>
|
113
108
|
);
|