playbook_ui 13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 → 13.21.0.pre.alpha.PLAY12582474

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 862f27be95870b310dd89d38cd466bca0175ffa286df0b80b62c581e604e9db4
4
- data.tar.gz: 31c27ba009fba844f070688d282d59631f86091635854517ea3714c7fae6ad8c
3
+ metadata.gz: 1cac7b0753d888ee1b718932bbbb638ebad8f37d7e3b30dfb683dd0a575cbcad
4
+ data.tar.gz: d9e47ec1c043e9358f3618c0510484ebfce1d346743377228ca016336072dd3f
5
5
  SHA512:
6
- metadata.gz: 67145d68c85367df0bf1c7bf5d409955e27a5e9c0a170dfa0139a215471cbd4b93ccf53b94a7f2d4448f0da4adcee9a3fa02a7ea6636df8b540bef34a19a027d
7
- data.tar.gz: 819ba714430f9efd7109f822dbb20e01d7e00d004557522fe51a6290d024af97d23ba401365398192bce5f4f2f132db4526433093664e58091d9e27f749f7bf1
6
+ metadata.gz: f07bcb349a1e387b6497cbc75fdc31fb39ee33c259515670723642d7484d8da526f20f6484c5beda1086e7d8aa36ecc0b25f0e1b6aa3e021095571949a839e07
7
+ data.tar.gz: b6c92cff8163105411b1d21bb9b065b725f775af4fea9f760ba945a04437e0f00da16b80cf346a37f5e681da3884f97c30cfa373621ab7409c277704daf2016a
@@ -10,6 +10,7 @@
10
10
 
11
11
  [class^=pb_date_picker_kit] {
12
12
  .input_wrapper {
13
+ margin-bottom: $space_sm;
13
14
  position: relative;
14
15
 
15
16
  .flatpickr-wrapper {
@@ -75,4 +76,4 @@
75
76
  &:after {
76
77
  content: none;
77
78
  }
78
- }
79
+ }
@@ -135,9 +135,6 @@ useEffect(() => {
135
135
  }, scrollContainer)
136
136
  })
137
137
  const filteredProps = {...props}
138
- if (filteredProps.marginBottom === undefined) {
139
- filteredProps.marginBottom = "sm"
140
- }
141
138
  delete filteredProps?.position
142
139
 
143
140
  const classes = classnames(
@@ -17,7 +17,6 @@
17
17
  error: object.error,
18
18
  id: object.picker_id,
19
19
  label: object.hide_label ? nil : object.label,
20
- margin_bottom: "none",
21
20
  name: object.name,
22
21
  placeholder: object.placeholder,
23
22
  required: object.required,
@@ -82,4 +81,4 @@
82
81
  }
83
82
  })
84
83
  <% end %>
85
- <% end %>
84
+ <% end %>
@@ -75,8 +75,7 @@ module Playbook
75
75
  default: [1900, 2100]
76
76
 
77
77
  def classname
78
- default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
79
- generate_classname("pb_date_picker_kit") + default_margin_bottom
78
+ generate_classname("pb_date_picker_kit")
80
79
  end
81
80
 
82
81
  def date_picker_config
@@ -37,7 +37,7 @@ describe('DatePicker Kit', () => {
37
37
  )
38
38
 
39
39
  const kit = screen.getByTestId(testId)
40
- expect(kit).toHaveClass('pb_date_picker_kit mb_sm')
40
+ expect(kit).toHaveClass('pb_date_picker_kit')
41
41
  })
42
42
 
43
43
  test('shows DatePicker date format m/d/Y', async () => {
@@ -20,7 +20,6 @@ examples:
20
20
  - date_picker_hooks: Hooks
21
21
  - date_picker_year_range: Year Range
22
22
  - date_picker_anti_patterns: Anti-Patterns
23
- - date_picker_margin_bottom: Margin Bottom
24
23
  - date_picker_inline: Inline
25
24
  - date_picker_month_and_year: Month & Year Only
26
25
  - date_picker_week: Week
@@ -49,7 +48,6 @@ examples:
49
48
  - date_picker_flatpickr_methods: Flatpickr Methods
50
49
  - date_picker_hooks: Hooks
51
50
  - date_picker_year_range: Year Range
52
- - date_picker_margin_bottom: Margin Bottom
53
51
  - date_picker_inline: Inline
54
52
  - date_picker_month_and_year: Month & Year Only
55
53
  - date_picker_week: Week
@@ -19,7 +19,6 @@ export { default as DatePickerWeek } from './_date_picker_week.jsx'
19
19
  export { default as DatePickerPositions } from './_date_picker_positions.jsx'
20
20
  export { default as DatePickerPositionsElement } from './_date_picker_positions_element.jsx'
21
21
  export { default as DatePickerAllowInput } from './_date_picker_allow_input'
22
- export { default as DatePickerMarginBottom} from './_date_picker_margin_bottom'
23
22
  export { default as DatePickerQuickPickReact } from './_date_picker_quick_pick_react'
24
23
  export { default as DatePickerQuickPickRangeLimit } from './_date_picker_quick_pick_range_limit'
25
24
  export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
@@ -1,6 +1,7 @@
1
1
  @import "../../pb_textarea/textarea_mixin";
2
2
 
3
3
  [class^=pb_date_picker_kit] {
4
+ margin-bottom: $space_sm;
4
5
 
5
6
  .pb_date_picker_kit_label {
6
7
  margin-bottom: $space_xs;
@@ -64,4 +65,4 @@
64
65
  }
65
66
  }
66
67
  }
67
- }
68
+ }
@@ -3,6 +3,7 @@
3
3
  @import "../tokens/colors";
4
4
 
5
5
  [class^="pb_text_input_kit"] {
6
+ margin-bottom: $space_sm;
6
7
  .pb_text_input_kit_label {
7
8
  margin-bottom: $space_xs;
8
9
  display: block;
@@ -60,10 +60,6 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
60
60
  const ariaProps = buildAriaProps(aria)
61
61
  const dataProps = buildDataProps(data)
62
62
  const htmlProps = buildHtmlProps(htmlOptions)
63
- const filteredProps = {...props}
64
- if (filteredProps.marginBottom === undefined) {
65
- filteredProps.marginBottom = "sm"
66
- }
67
63
 
68
64
  const { alignment, border, icon } = addOn
69
65
  const addOnAlignment = alignment === 'left' ? 'left' : 'right'
@@ -78,7 +74,7 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
78
74
  'pb_text_input_kit',
79
75
  inline ? 'inline' : "",
80
76
  error ? 'error' : "",
81
- globalProps(filteredProps),
77
+ globalProps(props),
82
78
  className,
83
79
  ])
84
80
  const addOnIcon = (
@@ -26,8 +26,7 @@ module Playbook
26
26
  nested_kit: Playbook::PbTextInput::AddOn
27
27
 
28
28
  def classname
29
- default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
30
- generate_classname("pb_text_input_kit") + default_margin_bottom + error_class + inline_class
29
+ generate_classname("pb_text_input_kit") + error_class + inline_class
31
30
  end
32
31
 
33
32
  def input_tag
@@ -16,7 +16,7 @@ test('returns namespaced class name', () => {
16
16
  )
17
17
 
18
18
  const kit = screen.getByTestId(testId)
19
- expect(kit).toHaveClass(`${kitClass} mb_sm`)
19
+ expect(kit).toHaveClass(kitClass)
20
20
  })
21
21
 
22
22
  test('returns additional class name', () => {
@@ -88,31 +88,18 @@ $space_classes: (
88
88
 
89
89
  $positions: "top", "right", "bottom", "left";
90
90
 
91
-
92
- @mixin position-property($position, $space_name, $space, $is_inset: false) {
93
- @if $space_name == "0" {
94
- #{$position}: 0 !important;
95
- }
96
- @else if $space_name == "auto" or $space_name == "initial" or $space_name == "inherit" {
97
- #{$position}: #{$space} !important;
98
- }
99
- @else {
100
- @if $is_inset {
101
- #{$position}: #{$space} !important;
102
- } @else {
103
- #{$position}: #{-$space} !important;
104
- }
105
- }
106
- }
107
-
108
91
  @each $position in $positions {
109
92
  @each $space_name, $space in $space_classes {
110
- $space_name_str: "#{ $space_name }";
111
- .#{$position}_#{$space_name_str} {
112
- @include position-property($position, $space_name_str, $space)
113
- }
114
- .#{$position}_#{$space_name_str}_inset {
115
- @include position-property($position, $space_name_str, $space, true)
93
+ .#{$position}_#{$space_name} {
94
+ @if $space_name == "0" {
95
+ #{$position}: 0 !important;
96
+ }
97
+ @else if $space_name == "auto" or $space_name == "initial" or $space_name == "inherit" {
98
+ #{$position}: #{$space} !important;
99
+ }
100
+ @else {
101
+ #{$position}: #{-$space} !important;
102
+ }
116
103
  }
117
104
  }
118
105
  }
@@ -119,19 +119,19 @@ type Position = {
119
119
  }
120
120
 
121
121
  type Top = {
122
- top?: Sizes | {value: string, inset: boolean},
122
+ top?: Sizes,
123
123
  }
124
124
 
125
125
  type Right = {
126
- right?: Sizes | {value: string, inset: boolean},
126
+ right?: Sizes,
127
127
  }
128
128
 
129
129
  type Bottom = {
130
- bottom?: Sizes | {value: string, inset: boolean},
130
+ bottom?: Sizes,
131
131
  }
132
132
 
133
133
  type Left = {
134
- left?: Sizes | {value: string, inset: boolean},
134
+ left?: Sizes,
135
135
  }
136
136
 
137
137
  type Shadow = {
@@ -441,54 +441,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
441
441
  return css
442
442
  },
443
443
 
444
- topProps: ({ top }) => {
445
- let css = "";
446
- if (typeof top === 'string') {
447
- css += `top_${top}`;
448
- } else if (typeof top === 'object' && top.inset) {
449
- css += `top_${top.value}_inset`;
450
- } else if (typeof top === 'object' && !top.inset) {
451
- css += `top_${top.value}`;
452
- }
453
- return css;
454
- },
455
-
456
- rightProps: ({ right }) => {
457
- let css = "";
458
- if (typeof right === 'string') {
459
- css += `right_${right}`;
460
- } else if (typeof right === 'object' && right.inset) {
461
- css += `right_${right.value}_inset`;
462
- } else if (typeof right === 'object' && !right.inset) {
463
- css += `right_${right.value}`;
464
- }
465
- return css;
466
- },
467
-
468
- bottomProps: ({ bottom }) => {
469
- let css = "";
470
- if (typeof bottom === 'string') {
471
- css += `bottom_${bottom}`;
472
- } else if (typeof bottom === 'object' && bottom.inset) {
473
- css += `bottom_${bottom.value}_inset`;
474
- } else if (typeof bottom === 'object' && !bottom.inset) {
475
- css += `bottom_${bottom.value}`;
476
- }
477
- return css;
478
- },
479
-
480
- leftProps: ({ left }) => {
481
- let css = "";
482
- if (typeof left === 'string') {
483
- css += `left_${left}`;
484
- } else if (typeof left === 'object' && left.inset) {
485
- css += `left_${left.value}_inset`;
486
- }else if (typeof left === 'object' && !left.inset) {
487
- css += `left_${left.value}`;
488
- }
489
- return css;
490
- },
491
-
444
+ topProps: ({ top }: Top) => top ? `top_${top}` : '',
445
+ rightProps: ({ right }: Right) => right ? `right_${right}` : '',
446
+ bottomProps: ({ bottom }: Bottom) => bottom ? `bottom_${bottom}` : '',
447
+ leftProps: ({ left }: Left) => left ? `left_${left}` : '',
448
+
492
449
  textAlignProps: ({ textAlign }: TextAlign) => {
493
450
  if (typeof textAlign === 'object') {
494
451
  return getResponsivePropClasses(textAlign, 'text_align')