playbook_ui_docs 13.34.0.pre.alpha.PLAY14143373 → 13.34.1.pre.alpha.PLAY14043436

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: e5c1045ad09e5a4d9a20db34da703588b052139f26bcfe0c636572aa6fc79c76
4
- data.tar.gz: b015cef5e4adbdae94bbe01798bd0a90667f1fde5309e67fbd898c8fe5d1cabc
3
+ metadata.gz: 3812a664d81e2b4f059a5a654999a18ee1c2b527845449ddab01cbe13005c3e0
4
+ data.tar.gz: 4033ba38e0d909416df96bbee0aea167712c7ed68c8f4652966a2c034e6ab89e
5
5
  SHA512:
6
- metadata.gz: 37c70e9bc200b8077eb7a088212f97b855fd07817bc48985c9878745bf72b0caa0d6eac74db5eb9f6b8e5b9882cbc0445300e83d0f2943edf47e18c394444268
7
- data.tar.gz: f8fc30b946761d1de735090b48acc67ebdb8f43af26a85a7a1ceab17e5ae2e255f612646a2781c24d91526ea5d87f7700077f468ce14724fad83020829f9cc95
6
+ metadata.gz: 321a2a3eb423049704efba3cecdb4a7240b0abbbcd9e07eaf930456cbc0afe2c5d5fd5df824e9b4c8c0826fc2618b34e6be7db87fc6185f4b306b4fdefc0733d
7
+ data.tar.gz: c1ade40c7eff5c7d6720f1ac7f71b038c3f37df49f6574c921b4d58b70ea01863ee0cd98da452d146678afe15f3744230e95b5c7d0d344a9cd2777fd06da32ed
@@ -5,21 +5,17 @@ const DialogDefault = () => {
5
5
  const [isOpen, setIsOpen] = useState(false)
6
6
  const close = () => setIsOpen(false)
7
7
  const open = () => setIsOpen(true)
8
- const [isLoading, setIsLoading] = useState(false)
9
8
 
10
9
  return (
11
10
  <>
12
11
  <Button onClick={open}>{'Open Dialog'}</Button>
13
12
  <Dialog
14
13
  cancelButton="Cancel Button"
15
- className="wrapper"
16
14
  confirmButton="Okay"
17
- loading={isLoading}
18
15
  onCancel={close}
19
16
  onClose={close}
20
- onConfirm={() => setIsLoading(!isLoading)}
17
+ onConfirm={close}
21
18
  opened={isOpen}
22
- portalClassName="portal"
23
19
  size="sm"
24
20
  text="Hello Body Text, Nice to meet ya."
25
21
  title="Header Title is the Title Prop"
@@ -0,0 +1,46 @@
1
+ import React, { useState } from 'react'
2
+ import { Button, Dialog } from 'playbook-ui'
3
+
4
+ const DialogLoading = () => {
5
+ const [isOpen, setIsOpen] = useState(false)
6
+ const close = () => {
7
+ if (!isLoading) {
8
+ setIsOpen(false)
9
+ }
10
+ }
11
+ const open = () => setIsOpen(true)
12
+ const [isLoading, setIsLoading] = useState(false)
13
+ const submit = async () => {
14
+ setIsLoading(true)
15
+
16
+ try {
17
+ await new Promise((r) => setTimeout(r, 3000))
18
+ setIsOpen(false)
19
+ } catch (error) {
20
+ console.error("An error occurred.")
21
+ } finally {
22
+ setIsLoading(false)
23
+ }
24
+ }
25
+
26
+ return (
27
+ <>
28
+ <Button onClick={open}>{'Open Dialog'}</Button>
29
+ <Dialog
30
+ cancelButton="Cancel"
31
+ className="wrapper"
32
+ confirmButton="Okay"
33
+ loading={isLoading}
34
+ onCancel={close}
35
+ onClose={close}
36
+ onConfirm={submit}
37
+ opened={isOpen}
38
+ size="sm"
39
+ text="Make a 3 second request?"
40
+ title="Loading Example"
41
+ />
42
+ </>
43
+ )
44
+ }
45
+
46
+ export default DialogLoading
@@ -22,6 +22,7 @@ examples:
22
22
  - dialog_stacked_alert: Stacked Button Alert
23
23
  - dialog_full_height: Full Height
24
24
  - dialog_full_height_placement: Full Height Placement
25
+ - dialog_loading: Loading
25
26
 
26
27
  swift:
27
28
  - dialog_default_swift: Simple
@@ -8,3 +8,4 @@ export { default as DialogStatus } from './_dialog_status.jsx'
8
8
  export { default as DialogStackedAlert } from './_dialog_stacked_alert.jsx'
9
9
  export { default as DialogFullHeight } from './_dialog_full_height.jsx'
10
10
  export { default as DialogFullHeightPlacement } from './_dialog_full_height_placement.jsx'
11
+ export { default as DialogLoading } from './_dialog_loading.jsx'
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-control-statements/jsx-use-if-tag */
2
1
  import React, { useState } from 'react'
3
2
  import { Flex, Image } from 'playbook-ui'
4
3
  import Lightbox from '../_lightbox.tsx'
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-control-statements/jsx-use-if-tag */
2
1
  import React, { useState } from 'react'
3
2
  import { Flex, Image, Button, Body, FlexItem } from 'playbook-ui'
4
3
  import Lightbox from '../_lightbox.tsx'
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-control-statements/jsx-use-if-tag */
2
1
  import React, { useState } from "react";
3
2
  import { Flex, Image, Title, Pill } from "playbook-ui";
4
3
  import Lightbox from "../_lightbox.tsx";
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-control-statements/jsx-use-if-tag */
2
1
  import React, { useState } from 'react'
3
2
  import { Flex, Image } from 'playbook-ui'
4
3
  import Lightbox from '../_lightbox.tsx'
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsx-control-statements/jsx-use-if-tag */
2
1
  import React, { useState } from 'react'
3
2
  import { Flex, Image } from 'playbook-ui'
4
3
  import Lightbox from '../_lightbox.tsx'