playbook_ui 17.1.0.pre.rc.4 → 17.1.0

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_container/_container.scss +3 -0
  4. data/app/pb_kits/playbook/pb_container/_container.tsx +47 -0
  5. data/app/pb_kits/playbook/pb_container/container.html.erb +3 -0
  6. data/app/pb_kits/playbook/pb_container/container.rb +15 -0
  7. data/app/pb_kits/playbook/pb_container/container.test.jsx +28 -0
  8. data/app/pb_kits/playbook/pb_container/docs/_container_default.html.erb +3 -0
  9. data/app/pb_kits/playbook/pb_container/docs/_container_default.jsx +12 -0
  10. data/app/pb_kits/playbook/pb_container/docs/_container_global_props.html.erb +10 -0
  11. data/app/pb_kits/playbook/pb_container/docs/_container_global_props.jsx +18 -0
  12. data/app/pb_kits/playbook/pb_container/docs/_container_global_props.md +1 -0
  13. data/app/pb_kits/playbook/pb_container/docs/_container_tag.html.erb +7 -0
  14. data/app/pb_kits/playbook/pb_container/docs/_container_tag.jsx +25 -0
  15. data/app/pb_kits/playbook/pb_container/docs/_container_tag.md +5 -0
  16. data/app/pb_kits/playbook/pb_container/docs/_description.md +1 -0
  17. data/app/pb_kits/playbook/pb_container/docs/_playground.json +57 -0
  18. data/app/pb_kits/playbook/pb_container/docs/_playground.overrides.json +54 -0
  19. data/app/pb_kits/playbook/pb_container/docs/example.yml +12 -0
  20. data/app/pb_kits/playbook/pb_container/docs/index.js +3 -0
  21. data/app/pb_kits/playbook/pb_container/kit.schema.json +52 -0
  22. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -2
  23. data/app/pb_kits/playbook/pb_dialog/docs/index.js +0 -1
  24. data/dist/chunks/_detail-CyTyC7gJ.js +5 -0
  25. data/dist/chunks/{_pb_line_graph-BGyCJjgG.js → _pb_line_graph-CUJ7NJIr.js} +1 -1
  26. data/dist/chunks/_table-DDKdCER5.js +1 -0
  27. data/dist/chunks/_typeahead-DdVBwRQT.js +1 -0
  28. data/dist/chunks/{globalProps-K1DCn3il.js → globalProps-DDcpyjvz.js} +1 -1
  29. data/dist/chunks/lib-D57mygNT.js +29 -0
  30. data/dist/chunks/{time_picker_helper-BZutIzB3.js → time_picker_helper-B_FN8E9Y.js} +1 -1
  31. data/dist/chunks/vendor.js +2 -2
  32. data/dist/menu.yml +7 -0
  33. data/dist/playbook-rails-react-bindings.js +1 -1
  34. data/dist/playbook-rails.js +1 -1
  35. data/lib/playbook/version.rb +1 -1
  36. metadata +28 -13
  37. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +0 -71
  38. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +0 -57
  39. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +0 -1
  40. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +0 -1
  41. data/dist/chunks/_detail-B4-co8rv.js +0 -5
  42. data/dist/chunks/_table-SGw4kUye.js +0 -1
  43. data/dist/chunks/_typeahead-DeIqOMbJ.js +0 -1
  44. data/dist/chunks/lib-7vm9BMqp.js +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2e1ded496c095c99e8ee8e474bb7609582dc8953949549e7e3fe5ef93e4de2b
4
- data.tar.gz: df2ce1c6ae5c85a67a961aebe95b1981f836ad605fa6886411d8043d8f64fdcf
3
+ metadata.gz: b282160685aeb7935309b54bddb2856ff20b4957a8ca3455a268ab52693bb8e7
4
+ data.tar.gz: 31b055f1c7c84e23d99b25cb980a5ad370f53088e265308ccd4e72a0b74500ba
5
5
  SHA512:
6
- metadata.gz: 4b367423e0711ecbca373b4d3e195ba2f36997bfb3fc00f3c7477eceb2fa0a4bb76ecbb6a169f09d3fe865a343f1eaedef1547f1a12539670d05c0474d531a99
7
- data.tar.gz: 547658843ad64464e8a86c74447bf63b4746181c668042e6ad8027b57eb9b184a392bc954184d29449ce2e21c137db066f88f2f6a46f2b0c41a616fcab744a56
6
+ metadata.gz: ce34582a3e72b462fa81e781a464f4f1352aaad7a37ffbace981816b5ec899397a6c29d8aa487af44d0fe20bda2f2d8280574bbf5a0a31548eed4c8e576976d8
7
+ data.tar.gz: 41690ad445b535cab92bb9a8c7a1e3c23e382b2e3661def036d7b85b16b7d2f6ec5c4419b22cdabdfc96f289231be50a4241d583e716a038a19efd82dfd63b3d
@@ -12,6 +12,7 @@
12
12
  @import 'pb_circle_icon_button/circle_icon_button';
13
13
  @import 'pb_collapsible/collapsible';
14
14
  @import 'pb_contact/contact';
15
+ @import 'pb_container/container';
15
16
  @import 'pb_copy_button/copy_button';
16
17
  @import 'pb_currency/currency';
17
18
  @import 'pb_dashboard_value/dashboard_value';
@@ -0,0 +1,3 @@
1
+ .pb_container_kit {
2
+
3
+ }
@@ -0,0 +1,47 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
+
6
+ type ContainerProps = {
7
+ aria?: { [key: string]: string },
8
+ children?: React.ReactNode,
9
+ className?: string,
10
+ data?: { [key: string]: string },
11
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) | ((event: any) => void) | any },
12
+ tag?: "div" | "span" | "a" | "button" | "option" | "table" | "tbody" | "thead" | "tfoot" | "tr" | "td" | "th" | "img" | "section" | "article" | "main" | "header" | "footer" | "nav" | "aside"
13
+ id?: string,
14
+ } & GlobalProps
15
+
16
+ const Container = (props: ContainerProps): React.ReactElement => {
17
+ const {
18
+ aria = {},
19
+ children,
20
+ className,
21
+ data = {},
22
+ htmlOptions = {},
23
+ tag = 'div',
24
+ id,
25
+ } = props
26
+
27
+ const ariaProps = buildAriaProps(aria)
28
+ const dataProps = buildDataProps(data)
29
+ const htmlProps = buildHtmlProps(htmlOptions)
30
+ const classes = classnames(buildCss('pb_container_kit'), globalProps(props), className)
31
+
32
+ const Tag = tag
33
+
34
+ return (
35
+ <Tag
36
+ {...ariaProps}
37
+ {...dataProps}
38
+ {...htmlProps}
39
+ className={classes}
40
+ id={id}
41
+ >
42
+ {children}
43
+ </Tag>
44
+ )
45
+ }
46
+
47
+ export default Container
@@ -0,0 +1,3 @@
1
+ <%= pb_content_tag(object.tag) do %>
2
+ <%= content.presence %>
3
+ <% end %>
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbContainer
5
+ class Container < ::Playbook::KitBase
6
+ prop :tag, type: Playbook::Props::Enum,
7
+ values: %w[div span a button option table tbody thead tfoot tr td th img section article main header footer nav aside],
8
+ default: "div"
9
+
10
+ def classname
11
+ generate_classname("pb_container_kit")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,28 @@
1
+ import React from 'react'
2
+ import { render, screen } from '../utilities/test-utils'
3
+
4
+ import { Container } from 'playbook-ui'
5
+
6
+ /* See these resources for more testing info:
7
+ - https://github.com/testing-library/jest-dom#usage for useage and examples
8
+ - https://jestjs.io/docs/en/using-matchers
9
+ */
10
+
11
+ test('Container renders with default props', () => {
12
+ const props = {
13
+ children: 'Container Content'
14
+ }
15
+
16
+ render(<Container {...props}>{props.children}</Container>)
17
+ expect(screen.getByText(props.children)).toBeInTheDocument()
18
+ })
19
+
20
+ test('Container renders with custom tag', () => {
21
+ const props = {
22
+ tag: 'span',
23
+ children: 'Container Content'
24
+ }
25
+
26
+ render(<Container {...props}>{props.children}</Container>)
27
+ expect(screen.getByText(props.children)).toBeInTheDocument()
28
+ })
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("container") do %>
2
+ Hello, I am a div container
3
+ <% end %>
@@ -0,0 +1,12 @@
1
+ import React from 'react'
2
+ import Container from '../../pb_container/_container'
3
+
4
+ const ContainerDefault = (props) => (
5
+ <Container
6
+ {...props}
7
+ >
8
+ Hello, I am a div container
9
+ </Container>
10
+ )
11
+
12
+ export default ContainerDefault
@@ -0,0 +1,10 @@
1
+ <%= pb_rails("container", props: {
2
+ border: "default",
3
+ border_radius: "lg",
4
+ hover: { shadow: "deepest" },
5
+ max_width: "sm",
6
+ padding: "md",
7
+ shadow: "deep"
8
+ }) do %>
9
+ Hello, I am a styled container
10
+ <% end %>
@@ -0,0 +1,18 @@
1
+ import React from 'react'
2
+ import Container from '../../pb_container/_container'
3
+
4
+ const ContainerGlobalProps = (props) => (
5
+ <Container
6
+ border="default"
7
+ borderRadius="lg"
8
+ hover={{ shadow: "deepest" }}
9
+ maxWidth="sm"
10
+ padding="md"
11
+ shadow="deep"
12
+ {...props}
13
+ >
14
+ Hello, I am a styled container
15
+ </Container>
16
+ )
17
+
18
+ export default ContainerGlobalProps
@@ -0,0 +1 @@
1
+ Use Container with global props instead of using a `div` and and having to write a SCSS file. This example shows usage of padding, border, borderRadius, hover, shadow, and maxWidth as props. See our [global props page](https://playbook.powerapp.cloud/global_props) for the full list of available options.
@@ -0,0 +1,7 @@
1
+ <%= pb_rails("container", props: { tag: "span" }) do %>
2
+ Hello, I am a span container
3
+ <% end %>
4
+ <br />
5
+ <%= pb_rails("container", props: { html_options: { href: "https://playbook.powerapp.cloud/", target: "_blank" }, tag: "a" }) do %>
6
+ Hello, I am an a container
7
+ <% end %>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import Container from '../../pb_container/_container'
3
+
4
+ const ContainerTag = (props) => {
5
+ return (
6
+ <>
7
+ <Container
8
+ tag="span"
9
+ {...props}
10
+ >
11
+ Hello, I am a span container
12
+ </Container>
13
+ <br />
14
+ <Container
15
+ htmlOptions={{ href: "https://playbook.powerapp.cloud/", target: "_blank" }}
16
+ tag="a"
17
+ {...props}
18
+ >
19
+ Hello, I am an a container
20
+ </Container>
21
+ </>
22
+ )
23
+ }
24
+
25
+ export default ContainerTag
@@ -0,0 +1,5 @@
1
+ Use the `tag` prop to change the HTML element rendered. Container uses `div` by default. Available tags are:
2
+
3
+ `div` `span` `a` `button` `option` `table` `tbody` `thead` `tfoot` `tr` `td` `th` `img` `section` `article` `main` `header` `footer` `nav` `aside`
4
+
5
+ Use `htmlOptions`/`html_options` to add any HTML attributes to the kit. For example, we add `href` here so the `a` tag is a working link.
@@ -0,0 +1 @@
1
+ Use Container in place of a custom `div` and SCSS file. Apply global props for spacing, border, radius, shadow, and more.
@@ -0,0 +1,57 @@
1
+ {
2
+ "template": "<Container{{props}}>\n {{children}}\n</Container>",
3
+ "propTargets": {},
4
+ "defaults": {
5
+ "tag": "div"
6
+ },
7
+ "groups": [
8
+ {
9
+ "name": "Layout",
10
+ "props": [
11
+ "tag"
12
+ ]
13
+ }
14
+ ],
15
+ "presets": [
16
+ {
17
+ "name": "Default",
18
+ "props": {},
19
+ "children": "Hello, I am a div container"
20
+ },
21
+ {
22
+ "name": "Span",
23
+ "props": {
24
+ "tag": "span"
25
+ },
26
+ "children": "Hello, I am a span container"
27
+ },
28
+ {
29
+ "name": "Global Props",
30
+ "props": {
31
+ "border": "default",
32
+ "borderRadius": "lg",
33
+ "hover": {
34
+ "shadow": "deepest"
35
+ },
36
+ "maxWidth": "sm",
37
+ "padding": "md",
38
+ "shadow": "deep"
39
+ },
40
+ "children": "Hello, I am a styled container"
41
+ }
42
+ ],
43
+ "conditionals": {},
44
+ "hints": {
45
+ "link_tag": {
46
+ "when": {
47
+ "tag": "a"
48
+ },
49
+ "message": "Use htmlOptions to add href and other HTML attributes when tag is a.",
50
+ "type": "info"
51
+ }
52
+ },
53
+ "children": {
54
+ "editable": true,
55
+ "default": "Hello, I am a div container"
56
+ }
57
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "template": "<Container{{props}}>\n {{children}}\n</Container>",
3
+ "children": {
4
+ "editable": true,
5
+ "default": "Hello, I am a div container"
6
+ },
7
+ "defaults": {
8
+ "tag": "div"
9
+ },
10
+ "groups": [
11
+ {
12
+ "name": "Layout",
13
+ "props": ["tag"]
14
+ }
15
+ ],
16
+ "presets": [
17
+ {
18
+ "name": "Default",
19
+ "props": {},
20
+ "children": "Hello, I am a div container"
21
+ },
22
+ {
23
+ "name": "Span",
24
+ "props": {
25
+ "tag": "span"
26
+ },
27
+ "children": "Hello, I am a span container"
28
+ },
29
+ {
30
+ "name": "Global Props",
31
+ "props": {
32
+ "border": "default",
33
+ "borderRadius": "lg",
34
+ "hover": {
35
+ "shadow": "deepest"
36
+ },
37
+ "maxWidth": "sm",
38
+ "padding": "md",
39
+ "shadow": "deep"
40
+ },
41
+ "children": "Hello, I am a styled container"
42
+ }
43
+ ],
44
+ "conditionals": {},
45
+ "hints": {
46
+ "link_tag": {
47
+ "when": {
48
+ "tag": "a"
49
+ },
50
+ "message": "Use htmlOptions to add href and other HTML attributes when tag is a.",
51
+ "type": "info"
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,12 @@
1
+ examples:
2
+
3
+ rails:
4
+ - container_default: Default
5
+ - container_tag: Tag
6
+ - container_global_props: Global Props
7
+
8
+
9
+ react:
10
+ - container_default: Default
11
+ - container_tag: Tag
12
+ - container_global_props: Global Props
@@ -0,0 +1,3 @@
1
+ export { default as ContainerDefault } from './_container_default.jsx'
2
+ export { default as ContainerTag } from './_container_tag.jsx'
3
+ export { default as ContainerGlobalProps } from './_container_global_props.jsx'
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://playbook.powerapp.cloud/schemas/kit-schema.json",
3
+ "name": "Container",
4
+ "description": "Container component",
5
+ "platforms": [
6
+ "react",
7
+ "rails"
8
+ ],
9
+ "props": {
10
+ "tag": {
11
+ "type": "enum",
12
+ "platforms": [
13
+ "react",
14
+ "rails"
15
+ ],
16
+ "values": [
17
+ "div",
18
+ "span",
19
+ "a",
20
+ "button",
21
+ "option",
22
+ "table",
23
+ "tbody",
24
+ "thead",
25
+ "tfoot",
26
+ "tr",
27
+ "td",
28
+ "th",
29
+ "img",
30
+ "section",
31
+ "article",
32
+ "main",
33
+ "header",
34
+ "footer",
35
+ "nav",
36
+ "aside"
37
+ ],
38
+ "default": "div"
39
+ }
40
+ },
41
+ "globalProps": true,
42
+ "usage": {
43
+ "react": {
44
+ "import": "import { Container } from 'playbook-ui'",
45
+ "example": "<Container tag=\"div\"></Container>"
46
+ },
47
+ "rails": {
48
+ "import": null,
49
+ "example": "<%= pb_rails(\"container\", props: { tag: \"div\" }) %>"
50
+ }
51
+ }
52
+ }
@@ -12,7 +12,6 @@ examples:
12
12
  - dialog_full_height_placement: Full Height Placement
13
13
  - dialog_loading: Loading
14
14
  - dialog_turbo_frames: Within Turbo Frames
15
- - dialog_overflow_visible: Overflow Visible
16
15
  - dialog_closeable: Close Button in Header
17
16
 
18
17
 
@@ -27,7 +26,6 @@ examples:
27
26
  - dialog_full_height: Full Height
28
27
  - dialog_full_height_placement: Full Height Placement
29
28
  - dialog_loading: Loading
30
- - dialog_overflow_visible: Overflow Visible
31
29
  - dialog_closeable: Close Button in Header
32
30
 
33
31
  swift:
@@ -9,5 +9,4 @@ 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
11
  export { default as DialogLoading } from './_dialog_loading.jsx'
12
- export { default as DialogOverflowVisible } from './_dialog_overflow_visible.jsx'
13
12
  export { default as DialogCloseable } from './_dialog_closeable.jsx'