playbook_ui 12.13.0.pre.alpha.PLAY693tooltipwrongbg440 → 12.13.0.pre.alpha.PLAY705phonenumberkit438

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18b2b312491b972cf09d3520048e4bcee3b3a54fc77823a96f99e4b8124d691e
4
- data.tar.gz: 15984bc190a04b1a771106b3c0d487164c94a5565f9403946cba9f042f244c6e
3
+ metadata.gz: 8ffc2f1f3d1df264f744d65f5b89a07812fe6e560e9c9137e3f91e2b1eb17816
4
+ data.tar.gz: a85d780b532e6930b7588a22d566023d965398cb73ea2267e8f12ab5e46f3114
5
5
  SHA512:
6
- metadata.gz: 93575b229a5e34b07acfa9efcdfa1a7c4abdc4d312a1ada00215312802a5a51c42b5d0a23c8ba12876bc102400e7f768202c8656145ff00bf724006a25eb28bd
7
- data.tar.gz: fce5886dc11ec423b86399cfbb5879c3bdc8d9c5833d5a4cc4f6dcea84928396f00a80fa6832f44e91f9a63f7767a6a6975e1dbce541e6a6822ed3dcca05f345
6
+ metadata.gz: b346f34311944e98fb46a98c01fce27798f102ab81cc93db231ddfa570648b613a43a0bb40c8c628b3bc434366d8216f44977c657a5f9dd6fff67c655ce7edec
7
+ data.tar.gz: 0a807e7b97cd9f9524572abc04563d13e25fd0dff7b032e9479a0a41847502b515ee64508432ac7b0e63d48202c9a282022d678923aef7cf408ac6d1cec34b6f
@@ -78,7 +78,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
78
78
  mode = 'single',
79
79
  name,
80
80
  onChange = () => { void 0 },
81
- onClose,
82
81
  pickerId,
83
82
  placeholder = 'Select Date',
84
83
  plugins = false,
@@ -96,13 +95,9 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
96
95
  const inputAriaProps = buildAriaProps(inputAria)
97
96
  const inputDataProps = buildDataProps(inputData)
98
97
 
99
- const filteredProps = {...props}
100
- delete filteredProps?.position
101
-
102
98
  const classes = classnames(
103
99
  buildCss('pb_date_picker_kit'),
104
- //@ts-ignore
105
- globalProps(filteredProps),
100
+ globalProps(props),
106
101
  error ? 'error' : null,
107
102
  className
108
103
  )
@@ -122,10 +117,8 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
122
117
  minDate,
123
118
  mode,
124
119
  onChange,
125
- onClose,
126
120
  pickerId,
127
121
  plugins,
128
- // @ts-ignore
129
122
  position,
130
123
  positionElement,
131
124
  selectionType,
@@ -19,7 +19,6 @@ type DatePickerConfig = {
19
19
  hideIcon?: boolean;
20
20
  inLine?: boolean,
21
21
  onChange: (dateStr: string, selectedDates: Date[]) => void,
22
- onClose: (dateStr: Date[] | string, selectedDates: Date[] | string) => void,
23
22
  selectionType?: "month" | "week" | "",
24
23
  showTimezone?: boolean,
25
24
  staticPosition: boolean,
@@ -42,7 +41,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
42
41
  minDate,
43
42
  mode,
44
43
  onChange = () => {},
45
- onClose = () => {},
46
44
  pickerId,
47
45
  plugins,
48
46
  position = "auto",
@@ -153,10 +151,9 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
153
151
  window.addEventListener('resize', calendarResizer)
154
152
  if (!staticPosition && scrollContainer) attachToScroll(scrollContainer)
155
153
  }],
156
- onClose: [(selectedDates, dateStr) => {
154
+ onClose: [() => {
157
155
  window.removeEventListener('resize', calendarResizer)
158
156
  if (!staticPosition && scrollContainer) detachFromScroll(scrollContainer as HTMLElement)
159
- onClose(selectedDates, dateStr)
160
157
  }],
161
158
  onChange: [(selectedDates, dateStr) => {
162
159
  onChange(dateStr, selectedDates)
@@ -31,7 +31,6 @@ examples:
31
31
  - date_picker_input: Input Field
32
32
  - date_picker_label: Label
33
33
  - date_picker_on_change: onChange
34
- - date_picker_on_close: onClose
35
34
  - date_picker_range: Range
36
35
  - date_picker_format: Format
37
36
  - date_picker_disabled: Disabled Dates
@@ -19,4 +19,3 @@ 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 DatePickerOnClose } from './_date_picker_on_close.jsx'
@@ -151,10 +151,6 @@ const Layout = (props: LayoutPropTypes) => {
151
151
  const nonSideChildren = layoutChildren.filter(
152
152
  (child: React.ReactElement & {type: {displayName: string}}) => child.type?.displayName !== 'Side'
153
153
  )
154
-
155
- const filteredProps = {...props}
156
- delete filteredProps?.position
157
-
158
154
  return (
159
155
  <div
160
156
  {...ariaProps}
@@ -163,8 +159,7 @@ const Layout = (props: LayoutPropTypes) => {
163
159
  layoutCss,
164
160
  layoutCollapseCss,
165
161
  className,
166
- //@ts-ignore
167
- globalProps(filteredProps)
162
+ globalProps(props)
168
163
  )}
169
164
  >
170
165
  {subComponentTags('Side')}
@@ -88,18 +88,13 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
88
88
  &.show {
89
89
  opacity: 1;
90
90
  margin-bottom: $space_sm;
91
- color: $white;
92
- background-color: rgba($black, $opacity_9);
91
+ background-color: $white;
93
92
  &.fade_out {
94
93
  animation-name: fadeOut;
95
94
  animation-duration: 150ms;
96
95
  animation-timing-function: linear;
97
96
  animation-fill-mode: forwards;
98
97
  }
99
- .arrow {
100
- border-color: $black transparent transparent transparent;
101
- opacity: $opacity_9;
102
- }
103
98
  }
104
99
  }
105
100
 
@@ -114,12 +109,12 @@ $tooltip_shadow: rgba(60, 106, 172, 0.18);
114
109
  }
115
110
  //rails
116
111
  &.show {
117
- color: $charcoal;
118
- background-color: $white;
112
+ color: $white;
113
+ background-color: rgba($black, $opacity_9);
119
114
  }
120
- .arrow {
121
- border-color: $white transparent transparent transparent;
122
- opacity: $opacity_10;
115
+ .arrow {
116
+ border-color: $black transparent transparent transparent;
117
+ opacity: $opacity_9;
123
118
  }
124
119
  // react arrow
125
120
  .arrow_bg {
@@ -1,16 +1,3 @@
1
- $relative: relative !default;
2
- $absolute: absolute !default;
3
- $fixed: fixed !default;
4
- $sticky: sticky !default;
5
- $static: static !default;
6
- $position: (
7
- relative: $relative,
8
- absolute: $absolute,
9
- fixed: $fixed,
10
- sticky: $sticky,
11
- static: $static
12
- );
13
-
14
1
  // z_index variables
15
2
  $z_1: 100 !default;
16
3
  $z_2: 200 !default;
@@ -1,23 +1,3 @@
1
- .position_relative {
2
- position: relative;
3
- }
4
-
5
- .position_absolute {
6
- position: absolute;
7
- }
8
-
9
- .position_fixed {
10
- position: fixed;
11
- }
12
-
13
- .position_sticky {
14
- position: sticky;
15
- }
16
-
17
- .position_static {
18
- position: static;
19
- }
20
-
21
1
  .z_index_1 {
22
2
  z-index: 100;
23
3
  }
@@ -100,10 +100,6 @@ type Padding = {
100
100
  padding?: AllSizes,
101
101
  }
102
102
 
103
- type Position = {
104
- position?: "relative" | "absolute" | "fixed" | "sticky" | "static",
105
- }
106
-
107
103
  type Shadow = {
108
104
  shadow?: "none" | "deep" | "deeper" | "deepest",
109
105
  }
@@ -119,7 +115,7 @@ export type GlobalProps = AlignContent & AlignItems & AlignSelf &
119
115
  BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
120
116
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
121
117
  LineHeight & Margin & MaxWidth & NumberSpacing & Order & Padding &
122
- Position & Shadow & ZIndex
118
+ Shadow & ZIndex
123
119
 
124
120
  const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
125
121
  const keys: string[] = Object.keys(prop)
@@ -287,12 +283,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
287
283
  } else {
288
284
  return order ? `flex_order_${order}` : ''
289
285
  }
290
- },
291
- positionProps: ({ position }: Position) => {
292
- let css = ''
293
- css += position && position !== 'static' ? `position_${position}` : ''
294
- return css
295
- },
286
+ }
296
287
  }
297
288
 
298
289
  type DefaultProps = {[key: string]: string} | Record<string, unknown>
@@ -31,7 +31,6 @@ module Playbook
31
31
  flex_grow_props,
32
32
  flex_shrink_props,
33
33
  order_props,
34
- position_props,
35
34
  ].compact.join(" ")
36
35
  end
37
36
 
@@ -19,7 +19,6 @@ require "playbook/flex"
19
19
  require "playbook/flex_grow"
20
20
  require "playbook/flex_shrink"
21
21
  require "playbook/order"
22
- require "playbook/position"
23
22
 
24
23
  module Playbook
25
24
  class KitBase < ViewComponent::Base
@@ -44,7 +43,6 @@ module Playbook
44
43
  include Playbook::FlexGrow
45
44
  include Playbook::FlexShrink
46
45
  include Playbook::Order
47
- include Playbook::Position
48
46
 
49
47
  prop :id
50
48
  prop :data, type: Playbook::Props::Hash, default: {}
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.13.0"
5
- VERSION = "12.13.0.pre.alpha.PLAY693tooltipwrongbg440"
5
+ VERSION = "12.13.0.pre.alpha.PLAY705phonenumberkit438"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.13.0.pre.alpha.PLAY693tooltipwrongbg440
4
+ version: 12.13.0.pre.alpha.PLAY705phonenumberkit438
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -738,8 +738,6 @@ files:
738
738
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.md
739
739
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.jsx
740
740
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md
741
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_close.jsx
742
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_close.md
743
741
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions.html.erb
744
742
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions.jsx
745
743
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions.md
@@ -2440,7 +2438,6 @@ files:
2440
2438
  - lib/playbook/pb_doc_helper.rb
2441
2439
  - lib/playbook/pb_forms_helper.rb
2442
2440
  - lib/playbook/pb_kit_helper.rb
2443
- - lib/playbook/position.rb
2444
2441
  - lib/playbook/props.rb
2445
2442
  - lib/playbook/props/array.rb
2446
2443
  - lib/playbook/props/base.rb
@@ -1,43 +0,0 @@
1
- /* eslint-disable react/no-multi-comp */
2
- import React, { useState } from 'react'
3
- import { DatePicker,LabelValue } from '../..'
4
-
5
-
6
- const DatePickerOnClose = (props) => {
7
- const today = new Date()
8
- const [dateString, setDateString] = useState(today.toLocaleDateString())
9
- const [dateObj, setDateObj] = useState([today])
10
-
11
- const handleOnClose = (selectedDates, dateStr) => {
12
- setDateString(dateStr)
13
- setDateObj(selectedDates)
14
- }
15
-
16
-
17
- return (
18
- <div>
19
- <DatePicker
20
- defaultDate={dateString}
21
- enableTime
22
- marginBottom="lg"
23
- onClose={handleOnClose}
24
- pickerId="date-picker-on-close"
25
- showTimezone
26
- {...props}
27
- />
28
- <LabelValue
29
- label="Date Object"
30
- marginBottom="lg"
31
- value={dateObj[0] ? dateObj[0].toString() : ''}
32
- {...props}
33
- />
34
- <LabelValue
35
- label="Date String"
36
- value={dateString}
37
- {...props}
38
- />
39
- </div>
40
- )
41
- }
42
-
43
- export default DatePickerOnClose
@@ -1,3 +0,0 @@
1
- The `onClose` handler function has access to two arguments: `dateStr` and `selectedDates`.
2
-
3
- The first, `dateStr`, is a string of the chosen date. The second, `selectedDates`, is an array of selected date objects. In many use cases `selectedDates` will have only one value but you'll still need to access it from index 0.
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Playbook
4
- module Position
5
- def self.included(base)
6
- base.prop :position
7
- end
8
-
9
- private
10
-
11
- def position_props
12
- selected_props = position_options.keys.select { |sk| try(sk) }
13
- return nil unless selected_props.present?
14
-
15
- selected_props.map do |k|
16
- value = send(k)
17
- return nil unless position_values.include? value
18
-
19
- "position_#{value}"
20
- end.compact.join(" ")
21
- end
22
-
23
- def position_options
24
- {
25
- position: "position",
26
- }
27
- end
28
-
29
- def position_values
30
- %w[relative absolute fixed sticky]
31
- end
32
- end
33
- end