playbook_ui 10.19.0.pre.lightbox → 10.21.0.pre.alpha.jd1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/data/menu.yml +0 -1
  4. data/app/pb_kits/playbook/index.js +1 -2
  5. data/app/pb_kits/playbook/pb_body/_body.jsx +3 -1
  6. data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -1
  7. data/app/pb_kits/playbook/pb_caption/_caption.scss +7 -0
  8. data/app/pb_kits/playbook/pb_caption/caption.rb +5 -2
  9. data/app/pb_kits/playbook/pb_date/_date.jsx +1 -1
  10. data/app/pb_kits/playbook/pb_date/date.html.erb +1 -1
  11. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +3 -0
  12. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +1 -0
  13. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
  14. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +10 -1
  15. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.html.erb +5 -0
  16. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.jsx +18 -0
  17. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.md +1 -0
  18. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  19. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  20. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_month_and_year_styles.scss +127 -0
  21. data/app/pb_kits/playbook/pb_image/_image.jsx +13 -15
  22. data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
  23. data/app/pb_kits/playbook/pb_image/docs/_custom_error_image.html.erb +1 -0
  24. data/app/pb_kits/playbook/pb_image/docs/_default_image.jsx +48 -35
  25. data/app/pb_kits/playbook/pb_image/docs/_rounded_image.jsx +46 -35
  26. data/app/pb_kits/playbook/pb_image/image.rb +1 -1
  27. data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
  28. data/app/pb_kits/playbook/pb_legend/_legend.jsx +1 -7
  29. data/app/pb_kits/playbook/pb_legend/_legend.scss +6 -2
  30. data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.html.erb +4 -0
  31. data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.jsx +29 -0
  32. data/app/pb_kits/playbook/pb_legend/docs/_legend_colors.md +2 -0
  33. data/app/pb_kits/playbook/pb_legend/docs/_legend_default.html.erb +2 -2
  34. data/app/pb_kits/playbook/pb_legend/docs/_legend_default.jsx +1 -1
  35. data/app/pb_kits/playbook/pb_legend/docs/example.yml +4 -4
  36. data/app/pb_kits/playbook/pb_legend/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_legend/legend.rb +1 -2
  38. data/app/pb_kits/playbook/pb_legend/legend.test.js +29 -0
  39. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +4 -0
  40. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +6 -2
  41. data/app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss +0 -2
  42. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
  43. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +14 -0
  44. data/app/pb_kits/playbook/pb_title/_title.jsx +2 -1
  45. data/app/pb_kits/playbook/pb_title/title.rb +5 -2
  46. data/app/pb_kits/playbook/playbook-doc.js +0 -2
  47. data/dist/reset.css +60 -1
  48. data/lib/playbook/version.rb +2 -2
  49. metadata +10 -21
  50. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.jsx +0 -53
  51. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.jsx +0 -54
  52. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx +0 -39
  53. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx +0 -82
  54. data/app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx +0 -54
  55. data/app/pb_kits/playbook/pb_lightbox/Carousel/styles.scss +0 -110
  56. data/app/pb_kits/playbook/pb_lightbox/Carousel/useSlides.js +0 -66
  57. data/app/pb_kits/playbook/pb_lightbox/Carousel/useUnscrollableBody.js +0 -11
  58. data/app/pb_kits/playbook/pb_lightbox/_lightbox.jsx +0 -81
  59. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +0 -65
  60. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +0 -1
  61. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +0 -65
  62. data/app/pb_kits/playbook/pb_lightbox/docs/example.yml +0 -6
  63. data/app/pb_kits/playbook/pb_lightbox/docs/index.js +0 -2
  64. data/app/pb_kits/playbook/pb_lightbox/hooks/useToggler.js +0 -10
  65. data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +0 -21
  66. data/app/pb_kits/playbook/pb_lightbox/hooks/useWindowSize.js +0 -25
  67. data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +0 -92
  68. data/app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: baa1f6f416384a560ac9d4e03d4aed20b4d01a980f4384c24a29a6a48ee19a60
4
- data.tar.gz: 79ba5f8ef47057ac2e187c46676d559c59149afda9ecfb934debaab366104728
3
+ metadata.gz: 1c31d281357f8dc7925b97fa9b6afaf1a5b058119086ad716ee72f9d86c7a221
4
+ data.tar.gz: 154d9accb2a7412eb67a71fc73504da468eb3ca786b8f887667733b9a019e397
5
5
  SHA512:
6
- metadata.gz: edaa286cf749d9fdaa8b3ae854f59bc62681f0baffb90718b335a6774eec4133357f4eb7190b9f4545ec55b6cf41856052a0bc58ccedbd1d7c707b580654095a
7
- data.tar.gz: a37e1263c2648e1bb032d49dc971871e7d5df0bd64091d4e61cdaf8e97f5df5915b2c6eb96f9b22508e3b3dc7c609206be70a979ccafd86616fa83b3cb005d38
6
+ metadata.gz: 5c804f0c7103265e31c1aa49d87996cddab6cc611b60c41c5d8c5dd99a4fe784bdb9e16a59720857593bfbd17cd90f7ccc8549aea096803d62eb757488851a28
7
+ data.tar.gz: 5e8d5c37aa6ae27821507353fb3943339a9b4cf2a04fd683b6ae3d0cece1060949160e2b8adf1e862c28577d83944d4f993fa86536fc4aad79d3b09f1ae78818
@@ -47,7 +47,6 @@
47
47
  @import 'pb_label_value/label_value';
48
48
  @import 'pb_layout/layout';
49
49
  @import 'pb_legend/legend';
50
- @import 'pb_lightbox/lightbox';
51
50
  @import 'pb_line_graph/line_graph';
52
51
  @import 'pb_list/list';
53
52
  @import 'pb_loading_inline/loading_inline';
@@ -102,4 +102,3 @@ kits:
102
102
  - title_detail
103
103
  - user_badge
104
104
  - walkthrough
105
- - lightbox
@@ -4,6 +4,7 @@ import 'lazysizes/plugins/attrchange/ls.attrchange'
4
4
  import 'lazysizes'
5
5
 
6
6
  // vvv React Component JSX Imports from the React Kits vvv
7
+ export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
7
8
  export { default as Avatar } from './pb_avatar/_avatar'
8
9
  export { default as AvatarActionButton } from './pb_avatar_action_button/_avatar_action_button'
9
10
  export { default as Background } from './pb_background/_background'
@@ -54,7 +55,6 @@ export { default as Layout } from './pb_layout/_layout'
54
55
  export { default as Legend } from './pb_legend/_legend'
55
56
  export { default as LineGraph } from './pb_line_graph/_line_graph'
56
57
  export { default as List } from './pb_list/_list'
57
- export { default as Lightbox } from './pb_lightbox/_lightbox'
58
58
  export { default as ListItem } from './pb_list/_list_item'
59
59
  export { default as LoadingInline } from './pb_loading_inline/_loading_inline'
60
60
  export { default as Message } from './pb_message/_message'
@@ -101,7 +101,6 @@ export { default as Toggle } from './pb_toggle/_toggle'
101
101
  export { default as Typeahead } from './pb_typeahead/_typeahead'
102
102
  export { default as User } from './pb_user/_user'
103
103
  export { default as UserBadge } from './pb_user_badge/_user_badge'
104
- export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
105
104
  export { default as WeekdayStacked } from './pb_weekday_stacked/_weekday_stacked'
106
105
  // ^^^ React Component JSX Imports from the React Kits ^^^
107
106
 
@@ -21,6 +21,7 @@ type BodyProps = {
21
21
  status?: 'negative' | 'neutral' | 'positive',
22
22
  tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
23
23
  text?: string,
24
+ variant: null | 'link',
24
25
  }
25
26
 
26
27
  const Body = (props: BodyProps) => {
@@ -36,12 +37,13 @@ const Body = (props: BodyProps) => {
36
37
  status,
37
38
  tag = 'div',
38
39
  text,
40
+ variant = null,
39
41
  } = props
40
42
 
41
43
  const ariaProps = buildAriaProps(aria)
42
44
  const dataProps = buildDataProps(data)
43
45
  const classes = classnames(
44
- buildCss('pb_body_kit', color, status),
46
+ buildCss('pb_body_kit', color, variant, status),
45
47
  globalProps(props),
46
48
  className
47
49
  )
@@ -30,6 +30,7 @@ const Caption = (props: CaptionProps) => {
30
30
  size = 'md',
31
31
  tag = 'div',
32
32
  text,
33
+ variant = null,
33
34
  } = props
34
35
  const tagOptions = [
35
36
  'h1',
@@ -48,7 +49,7 @@ const Caption = (props: CaptionProps) => {
48
49
  const ariaProps = buildAriaProps(aria)
49
50
  const dataProps = buildDataProps(data)
50
51
  const css = classnames(
51
- buildCss('pb_caption_kit', size, color),
52
+ buildCss('pb_caption_kit', size, variant, color),
52
53
  globalProps(props),
53
54
  className,
54
55
  )
@@ -3,6 +3,9 @@
3
3
 
4
4
  [class^="pb_caption_kit"] {
5
5
  @include caption;
6
+ &[class*="_link"] {
7
+ color: $primary;
8
+ }
6
9
 
7
10
  &[class^="pb_caption_kit_lg"] {
8
11
  @include caption_lg;
@@ -11,6 +14,10 @@
11
14
  &[class^="pb_caption_kit_xs"] {
12
15
  @include caption_xs;
13
16
  }
17
+
18
+ &[class*="link"] {
19
+ color: $primary;
20
+ }
14
21
 
15
22
  @include pb_caption_kit_colors;
16
23
 
@@ -10,14 +10,17 @@ module Playbook
10
10
  values: %w[h1 h2 h3 h4 h5 h6 p span div caption],
11
11
  default: "div"
12
12
  prop :text
13
- prop :variant, deprecated: true
13
+ prop :variant, type: Playbook::Props::Enum,
14
+ values: [nil, "link"],
15
+ default: nil,
16
+ deprecated: true
14
17
 
15
18
  prop :color, type: Playbook::Props::Enum,
16
19
  values: [nil, "default", "light", "lighter", "success", "error", "link"],
17
20
  default: nil
18
21
 
19
22
  def classname
20
- generate_classname("pb_caption_kit", size, color)
23
+ generate_classname("pb_caption_kit", size, variant, color)
21
24
  end
22
25
  end
23
26
  end
@@ -107,7 +107,7 @@ const PbDate = (props: PbDateProps) => {
107
107
  <Icon
108
108
  fixedWidth
109
109
  icon="calendar-alt"
110
- size="xs"
110
+ size="sm"
111
111
  />
112
112
  </Caption>
113
113
  </If>
@@ -42,7 +42,7 @@
42
42
  <%= pb_rails("caption", props: {
43
43
  tag: "div",
44
44
  }) do %>
45
- <%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true, size: 'xs' }) %>
45
+ <%= pb_rails("icon", props: { icon: "calendar-alt", fixed_width: true, size: "sm" }) %>
46
46
  <% end %>
47
47
  <% end %>
48
48
 
@@ -40,6 +40,7 @@ type DatePickerProps = {
40
40
  onChange: (String) => void,
41
41
  pickerId?: String,
42
42
  placeholder?: String,
43
+ plugins?: Boolean,
43
44
  type?: String,
44
45
  yearRange?: Array,
45
46
  }
@@ -73,6 +74,7 @@ const DatePicker = (props: DatePickerProps) => {
73
74
  onChange = () => {},
74
75
  pickerId,
75
76
  placeholder = 'Select Date',
77
+ plugins = false,
76
78
  yearRange = [ 1900, 2100 ],
77
79
  } = props
78
80
 
@@ -100,6 +102,7 @@ const DatePicker = (props: DatePickerProps) => {
100
102
  mode: mode,
101
103
  onChange: onChange,
102
104
  pickerId: pickerId,
105
+ plugins: plugins,
103
106
  yearRange: yearRange,
104
107
  })
105
108
  }, [])
@@ -3,6 +3,7 @@
3
3
  @import "../tokens/colors";
4
4
  @import "./sass_partials/flatpickr_styles";
5
5
  @import "./sass_partials/inline_styles";
6
+ @import "./sass_partials/month_and_year_styles";
6
7
 
7
8
  [class^=pb_date_picker_kit] {
8
9
  .input_wrapper {
@@ -41,6 +41,8 @@ module Playbook
41
41
  required: true
42
42
  prop :placeholder, type: Playbook::Props::String,
43
43
  default: "Select Date"
44
+ prop :plugins, type: Playbook::Props::Boolean,
45
+ default: false
44
46
  prop :required, type: Playbook::Props::Boolean,
45
47
  default: false
46
48
  prop :year_range, type: Playbook::Props::Array,
@@ -64,6 +66,7 @@ module Playbook
64
66
  minDate: min_date,
65
67
  mode: mode,
66
68
  pickerId: picker_id,
69
+ plugins: plugins,
67
70
  required: required,
68
71
  yearRange: year_range,
69
72
  }.to_json.html_safe
@@ -1,4 +1,5 @@
1
1
  import flatpickr from 'flatpickr'
2
+ import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect'
2
3
 
3
4
  const datePickerHelper = (config) => {
4
5
  const {
@@ -13,6 +14,7 @@ const datePickerHelper = (config) => {
13
14
  mode,
14
15
  onChange = () => {},
15
16
  pickerId,
17
+ plugins,
16
18
  required,
17
19
  yearRange,
18
20
  } = config
@@ -50,6 +52,10 @@ const datePickerHelper = (config) => {
50
52
  }
51
53
  }
52
54
 
55
+ const setMonthAndYearPlugin = () => (
56
+ plugins ? [ monthSelectPlugin({ shorthand: true, dateFormat: 'F Y', altFormat: 'F Y' }) ] : []
57
+ )
58
+
53
59
  // ===========================================================
54
60
  // | Flatpickr initializer w/ config |
55
61
  // ===========================================================
@@ -97,6 +103,7 @@ const datePickerHelper = (config) => {
97
103
  onYearChange: [() => {
98
104
  yearChangeHook()
99
105
  }],
106
+ plugins: setMonthAndYearPlugin(),
100
107
  prevArrow: '<i class="far fa-angle-left"></i>',
101
108
  static: true,
102
109
  })
@@ -153,8 +160,10 @@ const datePickerHelper = (config) => {
153
160
  }
154
161
 
155
162
  // Adding dropdown icons to year and month selects
156
- picker.monthElements[0].insertAdjacentHTML('afterend', '<i class="far fa-angle-down month-dropdown-icon"></i>')
157
163
  dropdown.insertAdjacentHTML('afterend', '<i class="far fa-angle-down year-dropdown-icon" id="test-id"></i>')
164
+ if (picker.monthElements[0].parentElement) {
165
+ return picker.monthElements[0].insertAdjacentHTML('afterend', '<i class="far fa-angle-down month-dropdown-icon"></i>')
166
+ }
158
167
 
159
168
  // Remove readonly attribute for validation and or text input
160
169
  if (allowInput){
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("date_picker", props: {
2
+ label: "Date Picker",
3
+ plugins: true,
4
+ picker_id: "disabled_date"
5
+ }) %>
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+
3
+ import DatePicker from '../_date_picker'
4
+
5
+ const DatePickerMonthAndYear = (props) => {
6
+ return (
7
+ <div>
8
+ <DatePicker
9
+ label="Date Picker"
10
+ pickerId="disabled-date"
11
+ plugins
12
+ {...props}
13
+ />
14
+ </div>
15
+ )
16
+ }
17
+
18
+ export default DatePickerMonthAndYear
@@ -0,0 +1 @@
1
+ By default month&year plugin is disabled. To activate it set `plugins` prop to `true`. If you're using React just pass a `plugins` prop to the kit.
@@ -16,6 +16,7 @@ examples:
16
16
  - date_picker_year_range: Year Range
17
17
  - date_picker_anti_patterns: Anti-Patterns
18
18
  - date_picker_inline: Inline
19
+ - date_picker_month_and_year: Month & Year Only
19
20
 
20
21
 
21
22
  react:
@@ -34,3 +35,4 @@ examples:
34
35
  - date_picker_hooks: Hooks
35
36
  - date_picker_year_range: Year Range
36
37
  - date_picker_inline: Inline
38
+ - date_picker_month_and_year: Month & Year Only
@@ -13,3 +13,4 @@ export { default as DatePickerHooks } from './_date_picker_hooks.jsx'
13
13
  export { default as DatePickerFlatpickrMethods } from './_date_picker_flatpickr_methods.jsx'
14
14
  export { default as DatePickerYearRange } from './_date_picker_year_range.jsx'
15
15
  export { default as DatePickerInline } from './_date_picker_inline.jsx'
16
+ export { default as DatePickerMonthAndYear } from './_date_picker_month_and_year.jsx'
@@ -0,0 +1,127 @@
1
+ @import "../../tokens/colors";
2
+
3
+
4
+ .numInput {
5
+ border-left: none !important;
6
+ }
7
+
8
+ // Manual Import
9
+ .flatpickr-monthSelect-months {
10
+ margin: 10px 1px 3px 1px;
11
+ flex-wrap: wrap;
12
+ }
13
+
14
+ .flatpickr-monthSelect-month {
15
+ background: none;
16
+ border: 1px solid transparent;
17
+ border-radius: 4px;
18
+ -webkit-box-sizing: border-box;
19
+ box-sizing: border-box;
20
+ color: $text_lt_default;
21
+ cursor: pointer;
22
+ display: inline-block;
23
+ font-weight: 400;
24
+ margin: 0.5px;
25
+ justify-content: center;
26
+ padding: 10px;
27
+ position: relative;
28
+ -webkit-box-pack: center;
29
+ -webkit-justify-content: center;
30
+ -ms-flex-pack: center;
31
+ text-align: center;
32
+ width: 33%;
33
+ }
34
+
35
+ .flatpickr-monthSelect-month.flatpickr-disabled {
36
+ color: #eee;
37
+ }
38
+
39
+ .flatpickr-monthSelect-month.flatpickr-disabled:hover,
40
+ .flatpickr-monthSelect-month.flatpickr-disabled:focus {
41
+ cursor: not-allowed;
42
+ background: none !important;
43
+ }
44
+
45
+ .flatpickr-monthSelect-theme-dark {
46
+ background: #3f4458;
47
+ }
48
+
49
+ .flatpickr-monthSelect-theme-dark .flatpickr-current-month input.cur-year {
50
+ color: #fff;
51
+ }
52
+
53
+ .flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-prev-month,
54
+ .flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-next-month {
55
+ color: #fff;
56
+ fill: #fff;
57
+ }
58
+
59
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month {
60
+ color: rgba(255, 255, 255, 0.95);
61
+ }
62
+
63
+ .flatpickr-monthSelect-month.today {
64
+ border-color: #959ea9;
65
+ }
66
+
67
+ .flatpickr-monthSelect-month.inRange,
68
+ .flatpickr-monthSelect-month.inRange.today,
69
+ .flatpickr-monthSelect-month:hover,
70
+ .flatpickr-monthSelect-month:focus {
71
+ background: $active_light;
72
+ font-weight: $bold;
73
+ color: $text_lt_default;
74
+ cursor: pointer;
75
+ outline: 0;
76
+ }
77
+
78
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.inRange,
79
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:hover,
80
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:focus {
81
+ background: #646c8c;
82
+ border-color: #646c8c;
83
+ }
84
+
85
+ .flatpickr-monthSelect-month.today:hover,
86
+ .flatpickr-monthSelect-month.today:focus {
87
+ background: #959ea9;
88
+ border-color: #959ea9;
89
+ color: #fff;
90
+ }
91
+
92
+ .flatpickr-monthSelect-month.selected,
93
+ .flatpickr-monthSelect-month.startRange,
94
+ .flatpickr-monthSelect-month.endRange {
95
+ background-color: $primary;
96
+ font-weight: $bold;
97
+ box-shadow: none;
98
+ color: #fff;
99
+ border-color: $primary;
100
+ }
101
+
102
+ .flatpickr-monthSelect-month.startRange {
103
+ border-radius: 50px 0 0 50px;
104
+ }
105
+
106
+ .flatpickr-monthSelect-month.endRange {
107
+ border-radius: 0 50px 50px 0;
108
+ }
109
+
110
+ .flatpickr-monthSelect-month.startRange.endRange {
111
+ border-radius: 50px;
112
+ }
113
+
114
+ .flatpickr-monthSelect-month.inRange {
115
+ border-radius: 0;
116
+ box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
117
+ }
118
+
119
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.selected,
120
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.startRange,
121
+ .flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.endRange {
122
+ background: #80cbc4;
123
+ -webkit-box-shadow: none;
124
+ box-shadow: none;
125
+ color: #fff;
126
+ border-color: #80cbc4;
127
+ }
@@ -34,7 +34,7 @@ const Image = (props: ImageProps) => {
34
34
 
35
35
  const ariaProps = buildAriaProps(aria)
36
36
  const classes = classnames(
37
- buildCss('pb_image_kit', size),
37
+ buildCss('pb_image_kit', size ? `size_${size}` : null),
38
38
  'lazyload',
39
39
  transition,
40
40
  { rounded },
@@ -44,20 +44,18 @@ const Image = (props: ImageProps) => {
44
44
  const dataProps = buildDataProps(data)
45
45
 
46
46
  return (
47
- <div>
48
- <img
49
- {...ariaProps}
50
- {...dataProps}
51
- alt={alt}
52
- className={classes}
53
- data-src={url}
54
- id={id}
55
- onError={onError}
56
- rounded={+rounded}
57
- src={url}
58
- transition={transition}
59
- />
60
- </div>
47
+ <img
48
+ {...ariaProps}
49
+ {...dataProps}
50
+ alt={alt}
51
+ className={classes}
52
+ data-src={url}
53
+ id={id}
54
+ onError={onError}
55
+ rounded={+rounded}
56
+ src={url}
57
+ transition={transition}
58
+ />
61
59
  )
62
60
  }
63
61
 
@@ -14,7 +14,7 @@ $image-sizes: (
14
14
  object-fit: cover;
15
15
 
16
16
  @each $name, $size in $image-sizes {
17
- &[class*=_#{$name}] {
17
+ &[class*=size_#{$name}] {
18
18
  width: $size;
19
19
  height: $size;
20
20
  object-fit: cover;
@@ -35,7 +35,7 @@ $image-sizes: (
35
35
  transition: opacity 300ms ease-in;
36
36
  }
37
37
  }
38
-
38
+
39
39
  &.blur {
40
40
  filter: blur(5px);
41
41
  &.lazyloaded {
@@ -44,7 +44,7 @@ $image-sizes: (
44
44
  transition: filter 300ms ease-in;
45
45
  }
46
46
  }
47
-
47
+
48
48
  &.scale {
49
49
  opacity: 0;
50
50
  transform: scale(0.9);
@@ -49,6 +49,7 @@
49
49
  props: {
50
50
  alt: "This is the alt text!",
51
51
  on_error: "this.classList.add('image-error')",
52
+ padding_x: "none",
52
53
  rounded: true,
53
54
  size: "xs",
54
55
  url: "not_a_picture"
@@ -5,41 +5,54 @@ import Image from '../_image'
5
5
  const DefaultImage = (props) => {
6
6
  return (
7
7
  <>
8
- <Image
9
- alt="picture of a misty forest"
10
- size="xs"
11
- url="https://unsplash.it/500/400/?image=634"
12
- {...props}
13
- />
14
- <Image
15
- alt="picture of a misty forest"
16
- size="sm"
17
- url="https://unsplash.it/500/400/?image=634"
18
- {...props}
19
- />
20
- <Image
21
- alt="picture of a misty forest"
22
- size="md"
23
- url="https://unsplash.it/500/400/?image=634"
24
- {...props}
25
- />
26
- <Image
27
- alt="picture of a misty forest"
28
- size="lg"
29
- url="https://unsplash.it/500/400/?image=634"
30
- {...props}
31
- />
32
- <Image
33
- alt="picture of a misty forest"
34
- size="xl"
35
- url="https://unsplash.it/500/400/?image=634"
36
- {...props}
37
- />
38
- <Image
39
- alt="picture of a misty forest"
40
- url="https://unsplash.it/500/400/?image=634"
41
- {...props}
42
- />
8
+ <br />
9
+ <div>
10
+ <Image
11
+ alt="picture of a misty forest"
12
+ size="xs"
13
+ url="https://unsplash.it/500/400/?image=634"
14
+ {...props}
15
+ />
16
+ </div>
17
+ <div>
18
+ <Image
19
+ alt="picture of a misty forest"
20
+ size="sm"
21
+ url="https://unsplash.it/500/400/?image=634"
22
+ {...props}
23
+ />
24
+ </div>
25
+ <div>
26
+ <Image
27
+ alt="picture of a misty forest"
28
+ size="md"
29
+ url="https://unsplash.it/500/400/?image=634"
30
+ {...props}
31
+ />
32
+ </div>
33
+ <div>
34
+ <Image
35
+ alt="picture of a misty forest"
36
+ size="lg"
37
+ url="https://unsplash.it/500/400/?image=634"
38
+ {...props}
39
+ />
40
+ </div>
41
+ <div>
42
+ <Image
43
+ alt="picture of a misty forest"
44
+ size="xl"
45
+ url="https://unsplash.it/500/400/?image=634"
46
+ {...props}
47
+ />
48
+ </div>
49
+ <div>
50
+ <Image
51
+ alt="picture of a misty forest"
52
+ url="https://unsplash.it/500/400/?image=634"
53
+ {...props}
54
+ />
55
+ </div>
43
56
  </>
44
57
  )
45
58
  }