playbook_ui 15.5.0.pre.alpha.play250612607 → 15.5.0.pre.alpha.play260612706

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: 2b5ffde9745ceb25129d5ef341dd3dda350a7cc52f0db4be00ffd873e90912a4
4
- data.tar.gz: 4ba6f0e94b76a8b45bc12853f81c160dc54f31e4d671292e7c447df040bdc17c
3
+ metadata.gz: 68e50dc389b41862430cc0615991fb9e83f733981412aeb7ce348cc851f19325
4
+ data.tar.gz: a59b600809d8eac2c4d1718c904196de1879fd1c4307433734fd90e77a27d48c
5
5
  SHA512:
6
- metadata.gz: 32d276f58d1ac23aa1a37911eac0142b1e0f1d4b959a51edbf14e3a6c8aad19ec3875e28cc5828372f07853c4d3ae6e27c320e5ea7a957e79032b19026b97a60
7
- data.tar.gz: 47f2381f3a46b5c8b0c5bc80080ca2ed7268c706a8cd27f592fa1ebe61587d67b3d72d06a3afabf89449b43a12e0ebc7db8de08ca8108fa5f37535d2f3589711
6
+ metadata.gz: 512a1c1bc6effa4642eaa6c75f95e0403ecd1f6c33bb87bb8cb2270f9758b6f1d2f103b96180dc4303d74991a176820ba351521fa677c288e0df7d838517b380
7
+ data.tar.gz: 6a9959a608a5aae7a45bb4f98afb1e54feca7a1b6fe5a8a70a2fa4edb60f31e01c27bba37dbfc0feabd41dc7370b23be6152ab43f1e2579e1d0863fc3bf2dc08
@@ -102,16 +102,16 @@ const Background = (props: BackgroundProps): React.ReactElement => {
102
102
  useEffect(() => {
103
103
  const updateResponsiveProps = () => {
104
104
  setResponsiveProps({
105
- backgroundSize: getResponsiveValue(props.backgroundSize),
106
- backgroundPosition: getResponsiveValue(props.backgroundPosition),
107
- backgroundRepeat: getResponsiveValue(props.backgroundRepeat),
108
- backgroundColor: getResponsiveValue(props.backgroundColor),
109
- imageUrl: getResponsiveValue(props.imageUrl),
105
+ backgroundSize: getResponsiveValue(backgroundSize),
106
+ backgroundPosition: getResponsiveValue(backgroundPosition),
107
+ backgroundRepeat: getResponsiveValue(backgroundRepeat),
108
+ backgroundColor: getResponsiveValue(backgroundColor),
109
+ imageUrl: getResponsiveValue(imageUrl),
110
110
  });
111
111
  };
112
112
  window.addEventListener('resize', updateResponsiveProps);
113
113
  return () => window.removeEventListener('resize', updateResponsiveProps);
114
- }, [props]);
114
+ }, [backgroundSize, backgroundPosition, backgroundRepeat, backgroundColor, imageUrl]);
115
115
 
116
116
 
117
117
  // Extract currently applicable responsive values.
@@ -4,7 +4,6 @@ import Background from './_background'
4
4
 
5
5
  const props = {
6
6
  data: { testid: 'background' },
7
- backgroundColor: null,
8
7
  }
9
8
 
10
9
  it('Should be accessible', async () => {
@@ -42,3 +41,8 @@ test('applies correct overlay class when imageOverlay prop is provided', () => {
42
41
  const kit = renderKit(Background, props, { imageOverlay: 'opacity_6' });
43
42
  expect(kit).toHaveClass('imageoverlay_opacity_6');
44
43
  });
44
+
45
+ test('Sets backgroundColor to light as default when no backgroundColor prop is provided', () => {
46
+ const kit = renderKit(Background, props);
47
+ expect(kit).toHaveClass('pb_background_color_light');
48
+ });
@@ -1,3 +1,3 @@
1
- <%= pb_rails("background", props: { background_color: "light", padding: "xl" }) do %>
1
+ <%= pb_rails("background", props: { padding: "xl" }) do %>
2
2
 
3
3
  <% end %>
@@ -3,7 +3,6 @@ import Background from '../../pb_background/_background'
3
3
 
4
4
  const BackgroundLight = (props) => (
5
5
  <Background
6
- backgroundColor="light"
7
6
  padding="xl"
8
7
  {...props}
9
8
  />
@@ -0,0 +1 @@
1
+ By default, the Background kit sets background color to 'light' as seen here.
@@ -1,7 +1,7 @@
1
1
  examples:
2
2
 
3
3
  rails:
4
- - background_light: Light
4
+ - background_light: Default
5
5
  - background_white: White
6
6
  - background_gradient: Gradient
7
7
  - background_image: Image
@@ -11,7 +11,7 @@ examples:
11
11
  - background_size: Size
12
12
 
13
13
  react:
14
- - background_light: Light
14
+ - background_light: Default
15
15
  - background_white: White
16
16
  - background_gradient: Gradient
17
17
  - background_image: Image
@@ -1,3 +1,24 @@
1
+ <%
2
+ options = [
3
+ {
4
+ label: "United States",
5
+ value: "unitedStates",
6
+ id: "us"
7
+ },
8
+ {
9
+ label: "United Kingdom",
10
+ value: "unitedKingdom",
11
+ id: "gb"
12
+ },
13
+ {
14
+ label: "Pakistan",
15
+ value: "pakistan",
16
+ id: "pk"
17
+ }
18
+ ]
19
+ %>
20
+
21
+
1
22
  <%= pb_rails("button", props: { text: "Open Complex Dialog", data:{"open-dialog": "dialog-complex"} }) %>
2
23
 
3
24
  <%= pb_rails("dialog", props: { id:"dialog-complex", size: "lg", full_height: true }) do %>
@@ -10,6 +31,16 @@
10
31
  <%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
11
32
  <%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
12
33
  <%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
34
+ <%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
35
+ <%= pb_rails("typeahead", props: {
36
+ id: "typeahead-default",
37
+ placeholder: "Select one...",
38
+ options: options,
39
+ name: :foo,
40
+ margin_top: "sm",
41
+ is_multi: false
42
+ })
43
+ %>
13
44
 
14
45
  <% end %>
15
46
  <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Back", confirm_button: "Send my Issue", confirm_button_id:"confirm-complex", id: "dialog-complex"}) %>
@@ -143,25 +143,30 @@ export default class PbDialog extends PbEnhancedElement {
143
143
 
144
144
  // Close dialog box on outside click
145
145
  dialogs.forEach((dialogElement) => {
146
- const originalMousedownHandler = dialogElement._outsideClickHandler
147
- if (originalMousedownHandler) dialogElement.removeEventListener("mousedown", originalMousedownHandler)
146
+ const originalClickHandler = dialogElement._outsideClickHandler
147
+ if (originalClickHandler) dialogElement.removeEventListener("click", originalClickHandler)
148
+
148
149
  dialogElement._outsideClickHandler = (event) => {
149
150
  const dialogParentDataset = dialogElement.parentElement.dataset
150
151
  if (dialogParentDataset.overlayClick === "overlay_close") return
151
152
 
152
- const dialogModal = event.target.getBoundingClientRect()
153
- const clickedOutsideDialogModal = event.clientX < dialogModal.left ||
154
- event.clientX > dialogModal.right ||
155
- event.clientY < dialogModal.top ||
156
- event.clientY > dialogModal.bottom
157
-
158
- if (clickedOutsideDialogModal) {
153
+ // Get the dialog's bounding box (the actual content area)
154
+ const rect = dialogElement.getBoundingClientRect()
155
+ const clickedInDialog = (
156
+ event.clientX >= rect.left &&
157
+ event.clientX <= rect.right &&
158
+ event.clientY >= rect.top &&
159
+ event.clientY <= rect.bottom
160
+ )
161
+
162
+ // Only close if clicked outside the dialog content (on the backdrop)
163
+ if (!clickedInDialog) {
159
164
  dialogElement.close()
160
165
  event.stopPropagation()
161
166
  }
162
167
  }
163
168
 
164
- dialogElement.addEventListener("mousedown", dialogElement._outsideClickHandler);
169
+ dialogElement.addEventListener("click", dialogElement._outsideClickHandler);
165
170
  })
166
171
  }
167
172
  }
@@ -7,18 +7,29 @@ type ClearContainerProps = {
7
7
  id: string,
8
8
  },
9
9
  clearValue: () => void,
10
+ innerProps?: any,
10
11
  }
11
12
 
12
- const ClearContainer = (props: ClearContainerProps): React.ReactElement => {
13
- const { selectProps, clearValue } = props
13
+ const ClearContainer = (props: ClearContainerProps | any): React.ReactElement => {
14
+ const { selectProps, clearValue, innerProps } = props
14
15
  useEffect(() => {
15
16
  document.addEventListener(`pb-typeahead-kit-${selectProps.id}:clear`, clearValue)
16
17
  }, [clearValue, selectProps.id])
17
18
 
19
+ // To stop this from bubbling up when inside a dialog or other modal
20
+ const handleMouseDown = (event: React.MouseEvent) => {
21
+ event.stopPropagation()
22
+ innerProps?.onMouseDown?.(event)
23
+ }
24
+
18
25
  return (
19
26
  <components.ClearIndicator
20
27
  className="clear_indicator"
21
28
  {...props}
29
+ innerProps={{
30
+ ...innerProps,
31
+ onMouseDown: handleMouseDown,
32
+ }}
22
33
  />
23
34
  )
24
35
  }