playbook_ui_docs 16.11.0.pre.rc.1 → 16.11.0.pre.rc.2

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: 3f609213cca04d26639951a31e33caaa37196ee606be1a7b4d6f236d528f7f57
4
- data.tar.gz: 5a4f99a56d0675389b50bb56e957b7e3f14457e962d5ab419a7f357245584f4f
3
+ metadata.gz: 9aeba2a5a2194029a406138e8d79cdfc9e0537d1cb8b0dbe633e539e7664c963
4
+ data.tar.gz: 2f977b71ba7e2d799e9912caed0e3d728170d2c9728435695d60f884fc1feaec
5
5
  SHA512:
6
- metadata.gz: f6120c03f348ee94b493478738c396af098c13cb67ca11414d5316953e8e6009c4abc50cc521823f1ee62e55dd4362dad9bf5e50acc93ff680dca440c760a64a
7
- data.tar.gz: 2d8ae9ec419707fe1d6502aed0b5b9f0bf97977a6f0f3d99a6969789b724661e28b29f82b0cf43e031fbe2211182ec473ab2d151b18442554014cbc8b01db4cb
6
+ metadata.gz: e490dac24f0130b452f93c6483700b91a731dc3b4d37337bb86f6e6b2c3963698cbe57591901483ab0ddbca638e06304eaf3f4f307648a1d87cbb8cb032e2bb5
7
+ data.tar.gz: e282ad05fc6b15f02339eb91772f1b16da21617ceeba44d2c30eb7f3cc505f0923895a7a209d6e35e038831ebc32dd037fb310cb0ec6937463ce1a230a6b21ef
@@ -0,0 +1,57 @@
1
+ import React, { useState } from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTableRowPinningBoth = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const [pinnedRows, setPinnedRows] = useState({top: ["8"], bottom: ["1"]})
39
+
40
+ return (
41
+ <div>
42
+ <AdvancedTable
43
+ columnDefinitions={columnDefinitions}
44
+ maxHeight="xs"
45
+ pinnedRows={{value: pinnedRows, onChange: setPinnedRows}}
46
+ tableData={MOCK_DATA_WITH_ID}
47
+ tableProps={{sticky: true}}
48
+ {...props}
49
+ >
50
+ <AdvancedTable.Header enableSorting />
51
+ <AdvancedTable.Body />
52
+ </AdvancedTable>
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default AdvancedTableRowPinningBoth
@@ -0,0 +1 @@
1
+ This code snippet demonstrates `pinnedRows` taking an array of row ids to both the `top` and `bottom` properties.
@@ -0,0 +1,57 @@
1
+ import React, { useState } from "react"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
4
+
5
+ const AdvancedTableRowPinningBottom = (props) => {
6
+ const columnDefinitions = [
7
+ {
8
+ accessor: "year",
9
+ label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
11
+ },
12
+ {
13
+ accessor: "newEnrollments",
14
+ label: "New Enrollments",
15
+ },
16
+ {
17
+ accessor: "scheduledMeetings",
18
+ label: "Scheduled Meetings",
19
+ },
20
+ {
21
+ accessor: "attendanceRate",
22
+ label: "Attendance Rate",
23
+ },
24
+ {
25
+ accessor: "completedClasses",
26
+ label: "Completed Classes",
27
+ },
28
+ {
29
+ accessor: "classCompletionRate",
30
+ label: "Class Completion Rate",
31
+ },
32
+ {
33
+ accessor: "graduatedStudents",
34
+ label: "Graduated Students",
35
+ },
36
+ ]
37
+
38
+ const [pinnedRows, setPinnedRows] = useState({bottom: ["8"]})
39
+
40
+ return (
41
+ <div>
42
+ <AdvancedTable
43
+ columnDefinitions={columnDefinitions}
44
+ maxHeight="xs"
45
+ pinnedRows={{value: pinnedRows, onChange: setPinnedRows}}
46
+ tableData={MOCK_DATA_WITH_ID}
47
+ tableProps={{sticky: true}}
48
+ {...props}
49
+ >
50
+ <AdvancedTable.Header enableSorting />
51
+ <AdvancedTable.Body />
52
+ </AdvancedTable>
53
+ </div>
54
+ )
55
+ }
56
+
57
+ export default AdvancedTableRowPinningBottom
@@ -0,0 +1 @@
1
+ This code snippet demonstrates `pinnedRows` taking an array of row ids to the `bottom` property.
@@ -1,7 +1,7 @@
1
- Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and will not change position if sorting is used.
1
+ Use the `pinnedRows` prop to pin specific rows to the top or bottom of an Advanced Table. Pinned rows will remain at the top or bottom when scrolling through table data and will not change position if sorting is used.
2
2
 
3
3
  **NOTE:**
4
4
  - Sticky header required: Pinned rows must be used with `sticky: true` via `tableProps` (works with both responsive and non-responsive tables)
5
5
  - Row ids required: Each object within the `tableData` Array must contain a unique id in order to attach an id to all Rows for this to function.
6
- - `pinnedRows` takes an array of row ids to the `top` property as shown in the code snippet below.
6
+ - `pinnedRows` takes an array of row ids to the `top` or `bottom` property, or both. `top` is shown in the code snippet below.
7
7
  - For expandable rows, use the parent id in `pinnedRows`, all its children will automatically be pinned with it. If id for a child is passed in without parent being pinned, nothing will be pinned.
@@ -67,7 +67,9 @@ examples:
67
67
  - advanced_table_column_headers_custom_cell: Multi-Header Columns with Custom Cells
68
68
  - advanced_table_column_headers_vertical_border: Multi-Header Columns with Vertical Borders
69
69
  - advanced_table_no_subrows: Table with No Subrows or Expansion
70
- - advanced_table_pinned_rows: Pinned Rows
70
+ - advanced_table_pinned_rows: Pinned Rows (Top)
71
+ - advanced_table_pinned_rows_bottom: Pinned Rows (Bottom)
72
+ - advanced_table_pinned_rows_both: Pinned Rows (Both)
71
73
  - advanced_table_selectable_rows: Selectable Rows
72
74
  - advanced_table_selectable_rows_no_subrows_react: Selectable Rows (No Subrows)
73
75
  - advanced_table_selectable_rows_actions: Selectable Rows (With Actions)
@@ -89,5 +91,4 @@ examples:
89
91
  - advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
90
92
  - advanced_table_padding_control: Padding Control using Column Styling
91
93
  - advanced_table_column_border_color: Column Group Border Color
92
- - advanced_table_fullscreen: Fullscreen
93
94
  - advanced_table_infinite_scroll: Infinite Scroll
@@ -52,4 +52,6 @@ export { default as AdvancedTableColumnStylingBackground } from './_advanced_tab
52
52
  export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
53
53
  export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
54
54
  export { default as AdvancedTableCascadeCollapse } from './_advanced_table_cascade_collapse.jsx'
55
- export { default as AdvancedTableSortParentOnly } from './_advanced_table_sort_parent_only.jsx'
55
+ export { default as AdvancedTableSortParentOnly } from './_advanced_table_sort_parent_only.jsx'
56
+ export { default as AdvancedTablePinnedRowsBottom } from './_advanced_table_pinned_rows_bottom.jsx'
57
+ export { default as AdvancedTablePinnedRowsBoth } from './_advanced_table_pinned_rows_both.jsx'
@@ -0,0 +1,66 @@
1
+ <div id="file-upload-remove-replace">
2
+ <%= pb_rails("list", props: { id: "selected-files-list", margin_bottom: "sm" }) %>
3
+
4
+ <%= pb_rails("file_upload", props: {
5
+ id: "remove_replace",
6
+ input_options: { multiple: true },
7
+ }) %>
8
+ </div>
9
+
10
+ <template id="file-list-item-template">
11
+ <%= pb_rails("list/item") do %>
12
+ <%= pb_rails("flex", props: { align: "center", justify: "between", width: "100%" }) do %>
13
+ <%= pb_rails("body", props: { data: { file_name: true } }) %>
14
+ <%= pb_rails("circle_icon_button", props: {
15
+ icon: "times",
16
+ variant: "secondary",
17
+ input_options: { classname: "remove-file-button" },
18
+ }) %>
19
+ <% end %>
20
+ <% end %>
21
+ </template>
22
+
23
+ <%= javascript_tag defer: "defer" do %>
24
+ document.addEventListener("DOMContentLoaded", function () {
25
+ const fileInput = document.getElementById("upload-remove_replace")
26
+ const list = document.getElementById("selected-files-list")
27
+ const template = document.getElementById("file-list-item-template")
28
+ let files = []
29
+
30
+ if (!fileInput || !list || !template) return
31
+
32
+ function syncInput() {
33
+ const dataTransfer = new DataTransfer()
34
+ files.forEach((file) => dataTransfer.items.add(file))
35
+ fileInput.files = dataTransfer.files
36
+ }
37
+
38
+ function render() {
39
+ list.innerHTML = ""
40
+
41
+ files.forEach((file, index) => {
42
+ const clone = template.content.cloneNode(true)
43
+ const nameElement = clone.querySelector("[data-file-name]")
44
+ const removeButton = clone.querySelector(".remove-file-button")
45
+
46
+ nameElement.textContent = file.name
47
+ removeButton.addEventListener("click", function (event) {
48
+ event.preventDefault()
49
+ event.stopPropagation()
50
+ files = files.filter((_, fileIndex) => fileIndex !== index)
51
+ syncInput()
52
+ render()
53
+ })
54
+
55
+ list.appendChild(clone)
56
+ })
57
+ }
58
+
59
+ fileInput.addEventListener("change", function () {
60
+ const newFiles = Array.from(fileInput.files)
61
+ files = [...files, ...newFiles]
62
+ syncInput()
63
+ render()
64
+ })
65
+ })
66
+ <% end %>
@@ -0,0 +1,53 @@
1
+
2
+ import React, { useState } from 'react'
3
+
4
+ import Body from '../../pb_body/_body'
5
+ import CircleIconButton from '../../pb_circle_icon_button/_circle_icon_button'
6
+ import FileUpload from '../../pb_file_upload/_file_upload'
7
+ import Flex from '../../pb_flex/_flex'
8
+ import List from '../../pb_list/_list'
9
+ import ListItem from '../../pb_list/_list_item'
10
+
11
+ const FileUploadRemoveReplace = (props) => {
12
+ const [filesToUpload, setFilesToUpload] = useState([])
13
+
14
+ const handleOnFilesAccepted = (files) => {
15
+ setFilesToUpload([...filesToUpload, ...files])
16
+ }
17
+
18
+ const handleRemoveFile = (index) => {
19
+ setFilesToUpload(filesToUpload.filter((_, fileIndex) => fileIndex !== index))
20
+ }
21
+
22
+ return (
23
+ <div>
24
+ {filesToUpload.length > 0 && (
25
+ <List marginBottom="sm">
26
+ {filesToUpload.map((file, index) => (
27
+ <ListItem key={`${file.name}-${index}`}>
28
+ <Flex
29
+ align="center"
30
+ justify="between"
31
+ width="100%"
32
+ >
33
+ <Body text={file.name} />
34
+ <CircleIconButton
35
+ aria={{ label: `Remove ${file.name}` }}
36
+ icon="times"
37
+ onClick={() => handleRemoveFile(index)}
38
+ variant="secondary"
39
+ />
40
+ </Flex>
41
+ </ListItem>
42
+ ))}
43
+ </List>
44
+ )}
45
+ <FileUpload
46
+ onFilesAccepted={handleOnFilesAccepted}
47
+ {...props}
48
+ />
49
+ </div>
50
+ )
51
+ }
52
+
53
+ export default FileUploadRemoveReplace
@@ -0,0 +1,5 @@
1
+ The File Upload kit does not include built-in remove or replace behavior. Manage selected files in application state and compose the kit with other Playbook components.
2
+
3
+ **Remove** — Track accepted files in state and filter out the file to remove. In React, pair `List` with `CircleIconButton`. In Rails, listen for `change` on the file input, keep files in a JavaScript array, and use `DataTransfer` to sync the input when a file is removed.
4
+
5
+ **Replace** — Selecting a new file on the native Rails input replaces the current selection. For single-file React workflows, set state to the newly accepted files instead of appending: `setFilesToUpload(files)`.
@@ -4,6 +4,7 @@ examples:
4
4
  - file_upload_default: File Upload
5
5
  - file_upload_custom: Custom
6
6
  - file_upload_error: Error
7
+ - file_upload_remove_replace: Remove and Replace
7
8
 
8
9
  react:
9
10
  - file_upload_default: Default List of files to upload
@@ -11,4 +12,5 @@ examples:
11
12
  - file_upload_custom_message: Add a custom message
12
13
  - file_upload_custom_description: Add your one accepted files description
13
14
  - file_upload_max_size: Set a file size limit
14
- - file_upload_error: Error
15
+ - file_upload_error: Error
16
+ - file_upload_remove_replace: Remove and Replace
@@ -4,3 +4,4 @@ export { default as FileUploadCustomMessage } from './_file_upload_custom_messag
4
4
  export { default as FileUploadCustomDescription } from './_file_upload_custom_description.jsx'
5
5
  export { default as FileUploadMaxSize } from './_file_upload_max_size.jsx'
6
6
  export { default as FileUploadError } from './_file_upload_error.jsx'
7
+ export { default as FileUploadRemoveReplace } from './_file_upload_remove_replace.jsx'
@@ -90,7 +90,7 @@ const FullScreenTableAndFilter = (props) => {
90
90
  double
91
91
  maxHeight="50vh"
92
92
  minWidth="xs"
93
- popoverProps={{ width: "350px", appendTo: ".fullscreen-overlay" }}
93
+ popoverProps={{ width: "350px" }}
94
94
  results={50}
95
95
  sortOptions={{
96
96
  territory_id: "Territory ID",
@@ -1 +1 @@
1
- Full Screen can host composed workflows such as a filter paired with a data table. For popovers inside the overlay, set the popover append target to `.fullscreen-overlay` so menus render within the fullscreen layer.
1
+ Full Screen can host composed workflows such as a filter paired with a data table. Filter and sort popovers automatically append to the fullscreen overlay; dropdown menus inside them portal above the overlay via the shared floating UI stack.
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("textarea", props: {
2
- error: raw(pb_rails("icon", props: { icon: "warning" }) + " This field has an error!"),
2
+ error: raw("#{pb_rails('icon', props: { icon: 'warning' })} This field has an error!"),
3
3
  label: "Label",
4
4
  rows: 4
5
5
  }) %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.11.0.pre.rc.1
4
+ version: 16.11.0.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-07-01 00:00:00.000000000 Z
12
+ date: 2026-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -129,6 +129,10 @@ files:
129
129
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx
130
130
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md
131
131
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx
132
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both.jsx
133
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_both_react.md
134
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom.jsx
135
+ - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_bottom_react.md
132
136
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.html.erb
133
137
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_rails.md
134
138
  - app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md
@@ -1092,6 +1096,9 @@ files:
1092
1096
  - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_error.html.erb
1093
1097
  - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_error.jsx
1094
1098
  - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx
1099
+ - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.html.erb
1100
+ - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.jsx
1101
+ - app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.md
1095
1102
  - app/pb_kits/playbook/pb_file_upload/docs/_playground.json
1096
1103
  - app/pb_kits/playbook/pb_file_upload/docs/_playground.overrides.json
1097
1104
  - app/pb_kits/playbook/pb_file_upload/docs/example.yml