playbook_ui 13.24.0 → 13.25.0.pre.alpha.PLAY761globalpaddingpropsbuttons2713

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/index.js +1 -0
  4. data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -6
  5. data/app/pb_kits/playbook/pb_background/_background.tsx +7 -5
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +41 -6
  7. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +4 -0
  8. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +23 -0
  9. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +35 -0
  10. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +26 -0
  11. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +36 -0
  12. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +3 -0
  13. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +22 -0
  14. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +34 -0
  15. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +1 -0
  16. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +6 -0
  17. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +3 -0
  18. data/app/pb_kits/playbook/pb_body/_body.scss +3 -3
  19. data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
  20. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -1
  21. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +98 -0
  22. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +186 -0
  23. data/app/pb_kits/playbook/pb_dropdown/context/index.tsx +5 -0
  24. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.jsx +50 -0
  25. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +102 -0
  26. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +66 -0
  27. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +77 -0
  28. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +9 -0
  29. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +4 -0
  30. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +17 -0
  31. data/app/pb_kits/playbook/pb_dropdown/hooks/useDropdown.tsx +17 -0
  32. data/app/pb_kits/playbook/pb_dropdown/hooks/useHandleOnKeydown.tsx +56 -0
  33. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +95 -0
  34. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +91 -0
  35. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +128 -0
  36. data/app/pb_kits/playbook/pb_dropdown/utilities/subComponentHelper.tsx +59 -0
  37. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -1
  38. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
  39. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +1 -1
  40. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +3 -3
  41. data/app/pb_kits/playbook/pb_list/_list_item.tsx +2 -2
  42. data/app/pb_kits/playbook/pb_source/source.test.js +2 -2
  43. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +27 -19
  44. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +4 -2
  45. data/app/pb_kits/playbook/pb_typeahead/components/index.tsx +19 -0
  46. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +51 -0
  47. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +1 -1
  48. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +1 -0
  49. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  50. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  51. data/app/pb_kits/playbook/tokens/_colors.scss +1 -1
  52. data/dist/menu.yml +5 -1
  53. data/dist/playbook-rails.js +6 -6
  54. data/lib/playbook/kit_base.rb +21 -1
  55. data/lib/playbook/version.rb +2 -2
  56. metadata +32 -6
  57. /data/app/pb_kits/playbook/pb_dialog/docs/{_dialog_props_table.md → _dialog_props_swift.md} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1111185a0ba8189b593aac01cc00c8e0e25665e52023c6dae98205d0a8292c97
4
- data.tar.gz: '08738c3ea661ac56922035b3e069885ea4b6233d7f7e6704d441e728a1c64aed'
3
+ metadata.gz: 87b317350275195afe02aadc0653bec704af39dc00c4b5f356ef0d9f29de6aef
4
+ data.tar.gz: d70e018947e00e2af967b4b38fca98571c17fe6aabe62901b7a77c65674fc7b8
5
5
  SHA512:
6
- metadata.gz: 339c41e64df36a935e6bdd362dae6b6260faae9c524ea9f0aad8bd73ea26d9fd3c63fd69ce1234f97839794cd60c020120e583f814ea80b96654aa6771c3384c
7
- data.tar.gz: b86306732da6f9f96493f2c0b9bdef887aff78f0de2b2aeb7ba9d0a64aff1cd198021c55acf36fcd9bee75f68e3fbf457a95f43dfd1be203eb9943de53ae5065
6
+ metadata.gz: 26142daab52ad1f9659e2f910eaae809a8fa3e799f48a4edfa940b22e2ce808a9cff5485d1fd77951909add3832eef781391d74361c25dedbf1fcbe216f416b2
7
+ data.tar.gz: 4cb2757e860f0cd8c4a2d802d1493c155f0edea90c3b18ff2f98c9366cc0f7c76e1524e71a285871a7c470151ac711735b22a82994ac7eea39837ac1548616cb
@@ -1,5 +1,6 @@
1
1
 
2
2
 
3
+
3
4
  @import 'pb_advanced_table/advanced_table';
4
5
  @import 'pb_avatar/avatar';
5
6
  @import 'pb_avatar_action_button/avatar_action_button';
@@ -30,6 +31,7 @@
30
31
  @import 'pb_detail/detail';
31
32
  @import 'pb_dialog/dialog';
32
33
  @import 'pb_distribution_bar/distribution_bar';
34
+ @import 'pb_dropdown/dropdown';
33
35
  @import 'pb_file_upload/file_upload';
34
36
  @import 'pb_filter/filter';
35
37
  @import 'pb_fixed_confirmation_toast/fixed_confirmation_toast';
@@ -35,6 +35,7 @@ export { default as DateYearStacked } from './pb_date_year_stacked/_date_year_st
35
35
  export { default as Detail} from './pb_detail/_detail'
36
36
  export { default as Dialog } from './pb_dialog/_dialog'
37
37
  export { default as DistributionBar } from './pb_distribution_bar/_distribution_bar'
38
+ export { default as Dropdown} from './pb_dropdown/_dropdown'
38
39
  export { default as FileUpload } from './pb_file_upload/_file_upload'
39
40
  export { default as Filter } from './pb_filter/_filter'
40
41
  export { default as FixedConfirmationToast } from './pb_fixed_confirmation_toast/_fixed_confirmation_toast'
@@ -1,9 +1,4 @@
1
- <%= content_tag(:div,
2
- id: object.id,
3
- data: object.data.merge(initials: object.initials),
4
- class: object.classname,
5
- aria: object.aria,
6
- **combined_html_options) do %>
1
+ <%= object.pb_content_tag(:div, data: object.data.merge(initials: object.initials)) do %>
7
2
  <%= content_tag(:div, data: { initials: object.initials }, class: "avatar_wrapper") do %>
8
3
  <%= pb_rails("image", props: { alt: object.alt_text, url: object.image_url, on_error: object.handle_img_error }) if object.image_url.present? %>
9
4
  <% end %>
@@ -65,7 +65,7 @@ const getResponsiveValue = <T extends string | undefined>(prop: ResponsiveProp<T
65
65
 
66
66
  const Background = (props: BackgroundProps): React.ReactElement => {
67
67
  const {
68
- alt = '',
68
+ alt = undefined,
69
69
  aria = {},
70
70
  backgroundColor = 'light',
71
71
  backgroundPosition = '',
@@ -130,11 +130,13 @@ const Background = (props: BackgroundProps): React.ReactElement => {
130
130
  );
131
131
 
132
132
  const backgroundStyle = {
133
- backgroundImage: resImageUrl ? `url(${resImageUrl})` : undefined,
134
- backgroundRepeat: resBackgroundRepeat || undefined,
135
- backgroundSize: resBackgroundSize || undefined,
136
- backgroundPosition: resBackgroundPosition || undefined,
137
133
  backgroundColor: customColor || undefined,
134
+ ...(resImageUrl !== '' ? {
135
+ backgroundImage: resImageUrl ? `url(${resImageUrl})` : undefined,
136
+ backgroundRepeat: resBackgroundRepeat || undefined,
137
+ backgroundPosition: resBackgroundPosition || undefined,
138
+ backgroundSize: resBackgroundSize || undefined,
139
+ } : {})
138
140
  };
139
141
 
140
142
  const Tag: React.ReactElement | any = `${tag}`;
@@ -13,12 +13,12 @@ import classnames from "classnames";
13
13
 
14
14
  type BarGraphProps = {
15
15
  align?: "left" | "right" | "center";
16
- axisTitle: string;
16
+ axisTitle: { name: string; }[] | string;
17
17
  dark?: boolean;
18
18
  xAxisCategories: [];
19
19
  yAxisMin: number;
20
20
  yAxisMax: number;
21
- chartData: { name: string; data: number[] }[];
21
+ chartData: { name: string; data: number[], yAxis: number }[];
22
22
  className?: string;
23
23
  customOptions?: Partial<Highcharts.Options>;
24
24
  id: string;
@@ -37,6 +37,8 @@ type BarGraphProps = {
37
37
  y?: number;
38
38
  aria?: { [key: string]: string };
39
39
  data?: { [key: string]: string };
40
+ stacking?: "normal" | "percent"
41
+ axisFormat?: { format: string; }[] | string;
40
42
  };
41
43
 
42
44
 
@@ -51,8 +53,10 @@ const BarGraph = ({
51
53
  colors,
52
54
  htmlOptions = {},
53
55
  customOptions = {},
56
+ axisFormat,
54
57
  id,
55
58
  pointStart,
59
+ stacking,
56
60
  subTitle,
57
61
  type = "column",
58
62
  title = "Title",
@@ -67,7 +71,7 @@ const BarGraph = ({
67
71
  x = 0,
68
72
  y = 0,
69
73
  ...props
70
- }: BarGraphProps): React.ReactElement => {
74
+ }: BarGraphProps): React.ReactElement => {
71
75
  const ariaProps = buildAriaProps(aria);
72
76
  const dataProps = buildDataProps(data)
73
77
  const htmlProps = buildHtmlProps(htmlOptions);
@@ -89,13 +93,23 @@ const BarGraph = ({
89
93
  subtitle: {
90
94
  text: subTitle,
91
95
  },
92
- yAxis: {
96
+ yAxis: [{
97
+ labels: {
98
+ format: typeof axisFormat === 'string' ? axisFormat : (axisFormat && axisFormat[0] ? axisFormat[0].format : "")
99
+
100
+ },
93
101
  min: yAxisMin,
94
102
  max: yAxisMax,
103
+ opposite: false,
95
104
  title: {
96
- text: axisTitle,
105
+ text: typeof axisTitle === 'string' ? axisTitle : axisTitle[0].name,
97
106
  },
98
- },
107
+ plotLines: typeof yAxisMin !== 'undefined' && yAxisMin !== null ? [] : [{
108
+ value: 0,
109
+ zIndex: 10,
110
+ color: "#E4E8F0"
111
+ }],
112
+ }],
99
113
  xAxis: {
100
114
  categories: xAxisCategories,
101
115
  },
@@ -113,7 +127,9 @@ const BarGraph = ({
113
127
  : highchartsTheme.colors,
114
128
  plotOptions: {
115
129
  series: {
130
+ stacking: stacking,
116
131
  pointStart: pointStart,
132
+ borderWidth: stacking ? 0 : "",
117
133
  events: {},
118
134
  dataLabels: {
119
135
  enabled: false,
@@ -124,6 +140,25 @@ const BarGraph = ({
124
140
  credits: false,
125
141
  };
126
142
 
143
+ if (Array.isArray(axisTitle) && axisTitle.length > 1 && axisTitle[1].name) {
144
+ staticOptions.yAxis.push({
145
+ labels: {
146
+ format: typeof axisFormat === 'string' ? axisFormat : axisFormat[1].format,
147
+ },
148
+ min: yAxisMin,
149
+ max: yAxisMax,
150
+ opposite: true,
151
+ title: {
152
+ text: axisTitle[1].name,
153
+ },
154
+ plotLines: typeof yAxisMin !== 'undefined' && yAxisMin !== null ? [] : [{
155
+ value: 0,
156
+ zIndex: 10,
157
+ color: "#E4E8F0"
158
+ }],
159
+ });
160
+ }
161
+
127
162
  if (!toggleLegendClick) {
128
163
  staticOptions.plotOptions.series.events = { legendItemClick: () => false };
129
164
  }
@@ -7,6 +7,7 @@ module Playbook
7
7
  values: %w[left right center],
8
8
  default: "center"
9
9
  prop :axis_title
10
+ prop :axis_format
10
11
  prop :chart_data, type: Playbook::Props::Array,
11
12
  default: []
12
13
  prop :custom_options, default: {}
@@ -14,6 +15,7 @@ module Playbook
14
15
  values: %w[vertical horizontal],
15
16
  default: "vertical"
16
17
  prop :point_start, type: Playbook::Props::Numeric
18
+ prop :stacking
17
19
  prop :subtitle
18
20
  prop :title
19
21
  prop :x_axis_categories, type: Playbook::Props::Array,
@@ -49,8 +51,10 @@ module Playbook
49
51
  dark: dark ? "dark" : "",
50
52
  type: chart_type,
51
53
  title: title,
54
+ stacking: stacking,
52
55
  subTitle: subtitle,
53
56
  axisTitle: axis_title,
57
+ axisFormat: axis_format,
54
58
  pointStart: point_start,
55
59
  xAxisCategories: x_axis_categories,
56
60
  yAxisMin: y_axis_min,
@@ -0,0 +1,23 @@
1
+ <% data = [{
2
+ name: 'Installation',
3
+ data: [-475, 400, -1000, 354, -856],
4
+ threshold: 0
5
+ }, {
6
+ name: 'Manufacturing',
7
+ data: [1475, 200, 1000, 654, -656],
8
+ threshold: 0
9
+ },
10
+ {
11
+ name: 'Sales & Distribution',
12
+ data: [1270, 100, -1200, 554, 756],
13
+ threshold: 0
14
+ }] %>
15
+
16
+ <%= pb_rails("bar_graph", props: {
17
+ axis_title: 'Number of Employees',
18
+ chart_data: data,
19
+ id: "bar-default",
20
+ x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
21
+ title: 'Bar Graph with Negative Numbers',
22
+ legend: true,
23
+ }) %>
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+
3
+ import BarGraph from '../_bar_graph'
4
+
5
+ const chartData = [{
6
+ name: 'Installation',
7
+ data: [-475, 400, -1000, 354, -856],
8
+ threshold: 0
9
+ }, {
10
+ name: 'Manufacturing',
11
+ data: [1475, 200, 1000, 654, -656],
12
+ threshold: 0
13
+ },
14
+ {
15
+ name: 'Sales & Distribution',
16
+ data: [1270, 100, -1200, 554, 756],
17
+ threshold: 0
18
+ }]
19
+
20
+
21
+ const BarGraphStacked = (props) => (
22
+ <div>
23
+ <BarGraph
24
+ axisTitle="Number of Employees"
25
+ chartData={chartData}
26
+ id="bar-default"
27
+ legend
28
+ title="Bar Graph with Negative Numbers"
29
+ xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
30
+ {...props}
31
+ />
32
+ </div>
33
+ )
34
+
35
+ export default BarGraphStacked
@@ -0,0 +1,26 @@
1
+ <% data = [{
2
+ name: 'Number of Installations',
3
+ data: [1475,200,3000,654,656]
4
+ }, {
5
+ type: 'spline',
6
+ name: 'Percentage',
7
+ data: [48, 70, 25, 55, 72],
8
+ color: '#F9BB00',
9
+ yAxis: 1
10
+ }] %>
11
+
12
+ <% axis_titles = [{name: "Number of Installations"}, {name: "Percentage"}] %>
13
+
14
+ <% axis_formats = [{format: ""}, {format: "{value}%"}] %>
15
+
16
+ <%= pb_rails("bar_graph", props: {
17
+ axis_format: axis_formats,
18
+ axis_title: axis_titles,
19
+ chart_data: data,
20
+ id: "bar-spline",
21
+ y_axis_min: 0,
22
+ x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
23
+ subtitle: 'Source: thesolarfoundation.com',
24
+ title: 'Bar Graph with Secondary Y-axis',
25
+ legend: true,
26
+ }) %>
@@ -0,0 +1,36 @@
1
+ import React from 'react'
2
+
3
+ import BarGraph from '../_bar_graph'
4
+
5
+ const chartData = [{
6
+ name: 'Number of Installations',
7
+ data: [1475, 200, 3000, 654, 656],
8
+ }, {
9
+ type: 'spline',
10
+ name: 'Percentage',
11
+ data: [48, 70, 25, 55, 72],
12
+ color: '#F9BB00',
13
+ yAxis: 1
14
+ }]
15
+
16
+ const axisTitles = [ {name: "Number of Installations"}, {name: "Percentage"}]
17
+
18
+ const axisFormats = [{format: ""}, {format: "{value}%"}]
19
+
20
+ const BarGraphSecondaryYAxis= (props) => (
21
+ <div>
22
+ <BarGraph
23
+ axisFormat={axisFormats}
24
+ axisTitle={axisTitles}
25
+ chartData={chartData}
26
+ id="bar-spline"
27
+ legend
28
+ title="Bar Graph with Secondary Y-axis"
29
+ xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
30
+ yAxisMin={0}
31
+ {...props}
32
+ />
33
+ </div>
34
+ )
35
+
36
+ export default BarGraphSecondaryYAxis
@@ -0,0 +1,3 @@
1
+ Optionally add a second yAxis to support secondary datasets (e.x., a spline) by passing` yAxis: 1` to the second node of your `chartData` array.
2
+
3
+ To customize the format and/or title of your secondary yAxis, pass your desired values as arrays through the `axisFormat` and `axisTitle` props, respectively.
@@ -0,0 +1,22 @@
1
+ <% data = [{
2
+ name: 'Installation',
3
+ data: [1475, 200, 3000, 654, 656],
4
+ },
5
+ {
6
+ name: 'Manufacturing',
7
+ data: [1270, 800, 200, 454, 956],
8
+ }, {
9
+ name: 'Sales & Distribution',
10
+ data: [975, 1600, 1500, 924, 500],
11
+ }] %>
12
+
13
+ <%= pb_rails("bar_graph", props: {
14
+ axis_title: 'Number of Employees',
15
+ chart_data: data,
16
+ id: "bar-default",
17
+ y_axis_min: 0,
18
+ x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
19
+ stacking: "normal",
20
+ title: 'Bar Graph with Stacked Columns',
21
+ legend: true,
22
+ }) %>
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+
3
+ import BarGraph from '../_bar_graph'
4
+
5
+ const chartData = [{
6
+ name: 'Installation',
7
+ data: [1475, 200, 3000, 654, 656],
8
+ },
9
+ {
10
+ name: 'Manufacturing',
11
+ data: [1270, 800, 200, 454, 956],
12
+ }, {
13
+ name: 'Sales & Distribution',
14
+ data: [975, 1600, 1500, 924, 500],
15
+ }]
16
+
17
+
18
+ const BarGraphStacked = (props) => (
19
+ <div>
20
+ <BarGraph
21
+ axisTitle="Number Of Employees"
22
+ chartData={chartData}
23
+ id="bar-default"
24
+ legend
25
+ stacking="normal"
26
+ title="Bar Graph with Stacked Columns"
27
+ xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May']}
28
+ yAxisMin={0}
29
+ {...props}
30
+ />
31
+ </div>
32
+ )
33
+
34
+ export default BarGraphStacked
@@ -0,0 +1 @@
1
+ The `stacking` prop can be used for a stacked bar graph. The prop allows for `normal` or `percent` as options.
@@ -9,6 +9,9 @@ examples:
9
9
  - bar_graph_spline: Spline
10
10
  - bar_graph_colors: Color Overrides
11
11
  - bar_graph_custom: Custom Overrides
12
+ - bar_graph_stacked: Stacked
13
+ - bar_graph_negative_numbers: Negative Numbers
14
+ - bar_graph_secondary_y_axis: Secondary Y-Axis
12
15
 
13
16
 
14
17
  react:
@@ -20,3 +23,6 @@ examples:
20
23
  - bar_graph_spline: Spline
21
24
  - bar_graph_colors: Color Overrides
22
25
  - bar_graph_custom: Custom Overrides
26
+ - bar_graph_stacked: Stacked
27
+ - bar_graph_negative_numbers: Negative Numbers
28
+ - bar_graph_secondary_y_axis: Secondary Y-Axis
@@ -6,3 +6,6 @@ export { default as BarGraphHeight } from './_bar_graph_height.jsx'
6
6
  export { default as BarGraphSpline } from './_bar_graph_spline.jsx'
7
7
  export { default as BarGraphColors } from './_bar_graph_colors.jsx'
8
8
  export { default as BarGraphCustom } from './_bar_graph_custom.jsx'
9
+ export { default as BarGraphStacked } from './_bar_graph_stacked.jsx'
10
+ export { default as BarGraphNegativeNumbers } from './_bar_graph_negative_numbers.jsx'
11
+ export { default as BarGraphSecondaryYAxis } from './_bar_graph_secondary_y_axis.jsx'
@@ -19,7 +19,7 @@
19
19
  }
20
20
  }
21
21
  b, strong {
22
- @include pb_title_4
22
+ font-weight: $bold;
23
23
  }
24
24
 
25
25
  a {
@@ -29,8 +29,8 @@
29
29
  }
30
30
  }
31
31
 
32
- em {
33
- font-weight: $bold;
32
+ em, i {
33
+ font-style: italic;
34
34
  }
35
35
 
36
36
  small {
@@ -17,7 +17,7 @@ $pb_button_sizes: (
17
17
  @each $name, $size in $pb_button_sizes {
18
18
  &[class*=size_#{$name}] {
19
19
  font-size: $size;
20
- padding: calc(#{$size} / 2) calc(#{$size} * 2.42) !important;
20
+ padding: calc(#{$size} / 2) calc(#{$size} * 2.42);
21
21
  @if $name == "sm" {
22
22
  min-height: 0;
23
23
  }
@@ -27,5 +27,5 @@ examples:
27
27
  - dialog_default_swift: Simple
28
28
  - dialog_sizes_swift: Sizes
29
29
  - dialog_status_swift: Status
30
- - dialog_props_table: ""
30
+ - dialog_props_swift: ""
31
31
 
@@ -0,0 +1,98 @@
1
+ @import "../tokens/colors";
2
+ @import "../tokens/spacing";
3
+ @import "../tokens/typography";
4
+ @import "../tokens/border_radius";
5
+ @import "../tokens/shadows";
6
+ @import "../tokens/positioning";
7
+ @import "../pb_body/body_mixins";
8
+
9
+ .pb_dropdown {
10
+ .dropdown_wrapper {
11
+ position: relative;
12
+ .dropdown_trigger_wrapper {
13
+ @include pb_body;
14
+ border: 1px solid $border_light;
15
+ background-color: $white;
16
+ box-shadow: inset 0 -11px 20px rgba($primary, 0.05);
17
+ @media (hover: hover) {
18
+ &:hover,
19
+ &:active,
20
+ &:focus {
21
+ background-color: $focus_input_light;
22
+ }
23
+ input {
24
+ background-color: $focus_input_light;
25
+ }
26
+ }
27
+
28
+ .dropdown_input {
29
+ @include pb_body;
30
+ border: unset;
31
+ border-radius: $border_rad_heavier;
32
+ padding: 0;
33
+
34
+ &:focus-visible {
35
+ outline: none;
36
+ }
37
+ }
38
+ &:focus {
39
+ box-shadow: 0px 0px 0 1px $primary;
40
+ outline: unset;
41
+ transition: box-shadow 0.15s ease-in-out;
42
+ }
43
+ }
44
+
45
+ .dropdown_trigger_wrapper_focus {
46
+ box-shadow: 0px 0px 0 1px $primary;
47
+ transition: box-shadow .10s ease-in-out;
48
+ }
49
+
50
+ .pb_dropdown_container {
51
+ background-color: $white;
52
+ overflow: hidden;
53
+ box-shadow: $shadow_deep;
54
+ border-radius: $border_rad_heavier;
55
+ border: 1px solid $border_light;
56
+ margin-top: $space_xs;
57
+ position: absolute;
58
+ z-index: $z_1;
59
+ width: 100%;
60
+ transition: opacity 0.25s ease-in-out;
61
+
62
+ .pb_dropdown_option {
63
+ :hover {
64
+ background-color: $border_light;
65
+ }
66
+ }
67
+
68
+ .dropdown_option_focused {
69
+ background-color: $border_light;
70
+ }
71
+
72
+ .dropdown_option {
73
+ width: 100%;
74
+ }
75
+
76
+ .dropdown_option_list {
77
+ border-bottom: 1px solid $border_light;
78
+ }
79
+ .dropdown_option_selected {
80
+ background-color: $primary;
81
+ [class^="pb_body"],
82
+ [class^="pb_title_kit"] {
83
+ color: $white !important;
84
+ }
85
+ :hover {
86
+ background-color: unset;
87
+ }
88
+ }
89
+ }
90
+ .close {
91
+ display: none;
92
+ }
93
+
94
+ .open {
95
+ display: block;
96
+ }
97
+ }
98
+ }