@flanksource/clicky-ui 0.3.34 → 0.3.35
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.
- package/README.md +4 -0
- package/dist/ai.cjs +3 -0
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.js +3 -0
- package/dist/ai.js.map +1 -1
- package/dist/comments/CommentCard.d.ts +1 -1
- package/dist/comments/CommentProvider.d.ts +1 -1
- package/dist/comments/CommentThread.d.ts +1 -1
- package/dist/comments/CommentThreadList.d.ts +1 -1
- package/dist/comments/MentionTextarea.d.ts +1 -1
- package/dist/comments/comment-context.d.ts +4 -4
- package/dist/comments/comment-fixtures.d.ts +1 -1
- package/dist/comments/comment-types.d.ts +1 -1
- package/dist/components/AccordionList.d.ts +1 -1
- package/dist/components/ComboboxControl.d.ts +1 -1
- package/dist/components/ComboboxMenu.d.ts +2 -2
- package/dist/components/ComboboxTags.cjs +41 -11
- package/dist/components/ComboboxTags.cjs.map +1 -1
- package/dist/components/ComboboxTags.d.ts +6 -0
- package/dist/components/ComboboxTags.d.ts.map +1 -1
- package/dist/components/ComboboxTags.js +41 -11
- package/dist/components/ComboboxTags.js.map +1 -1
- package/dist/components/DateField.d.ts +3 -3
- package/dist/components/DatePicker.d.ts +3 -3
- package/dist/components/DateTimePicker.d.ts +3 -3
- package/dist/components/ErrorWrapper.d.ts +2 -2
- package/dist/components/Field.d.ts +1 -1
- package/dist/components/FilterBar.d.ts +1 -1
- package/dist/components/FormLookupProvider.d.ts +1 -1
- package/dist/components/FormatOptionsDropdown.d.ts +1 -1
- package/dist/components/IconButton.d.ts +3 -3
- package/dist/components/InputField.d.ts +2 -2
- package/dist/components/ItemActions.d.ts +1 -1
- package/dist/components/JsonSchemaForm.cjs +17 -36
- package/dist/components/JsonSchemaForm.cjs.map +1 -1
- package/dist/components/JsonSchemaForm.d.ts +1 -1
- package/dist/components/JsonSchemaForm.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm.js +17 -36
- package/dist/components/JsonSchemaForm.js.map +1 -1
- package/dist/components/ListMenu.d.ts +1 -1
- package/dist/components/MultiSelect.d.ts +1 -1
- package/dist/components/SearchInput.d.ts +1 -1
- package/dist/components/SegmentedControl.d.ts +1 -1
- package/dist/components/SplitButton.d.ts +1 -1
- package/dist/components/Switch.d.ts +1 -1
- package/dist/components/TreePickerField.cjs +11 -2
- package/dist/components/TreePickerField.cjs.map +1 -1
- package/dist/components/TreePickerField.d.ts +13 -4
- package/dist/components/TreePickerField.d.ts.map +1 -1
- package/dist/components/TreePickerField.js +11 -2
- package/dist/components/TreePickerField.js.map +1 -1
- package/dist/components/UnitStepControls.d.ts +1 -1
- package/dist/components/button.d.ts +3 -3
- package/dist/components/combobox-types.d.ts +1 -1
- package/dist/components/density-switcher.d.ts +1 -1
- package/dist/components/filter-bar-context.d.ts +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +2 -2
- package/dist/components/form-lookup-context.d.ts +1 -1
- package/dist/components/icon-menu-picker.d.ts +1 -1
- package/dist/components/json-schema-form-accordion-array.cjs +44 -21
- package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
- package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-accordion-array.js +47 -24
- package/dist/components/json-schema-form-accordion-array.js.map +1 -1
- package/dist/components/json-schema-form-array.cjs +53 -30
- package/dist/components/json-schema-form-array.cjs.map +1 -1
- package/dist/components/json-schema-form-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-array.js +54 -31
- package/dist/components/json-schema-form-array.js.map +1 -1
- package/dist/components/json-schema-form-cards-array.cjs +32 -22
- package/dist/components/json-schema-form-cards-array.cjs.map +1 -1
- package/dist/components/json-schema-form-cards-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-cards-array.js +33 -23
- package/dist/components/json-schema-form-cards-array.js.map +1 -1
- package/dist/components/json-schema-form-collection-layouts.fixtures.d.ts +44 -0
- package/dist/components/json-schema-form-collection-layouts.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-discriminator.d.ts +1 -1
- package/dist/components/json-schema-form-errors.cjs +5 -1
- package/dist/components/json-schema-form-errors.cjs.map +1 -1
- package/dist/components/json-schema-form-errors.d.ts +2 -1
- package/dist/components/json-schema-form-errors.d.ts.map +1 -1
- package/dist/components/json-schema-form-errors.js +6 -2
- package/dist/components/json-schema-form-errors.js.map +1 -1
- package/dist/components/json-schema-form-extensions.d.ts +1 -1
- package/dist/components/json-schema-form-filter-input.cjs +50 -0
- package/dist/components/json-schema-form-filter-input.cjs.map +1 -0
- package/dist/components/json-schema-form-filter-input.d.ts +5 -0
- package/dist/components/json-schema-form-filter-input.d.ts.map +1 -0
- package/dist/components/json-schema-form-filter-input.js +50 -0
- package/dist/components/json-schema-form-filter-input.js.map +1 -0
- package/dist/components/json-schema-form-filter.cjs +49 -0
- package/dist/components/json-schema-form-filter.cjs.map +1 -0
- package/dist/components/json-schema-form-filter.d.ts +8 -0
- package/dist/components/json-schema-form-filter.d.ts.map +1 -0
- package/dist/components/json-schema-form-filter.js +49 -0
- package/dist/components/json-schema-form-filter.js.map +1 -0
- package/dist/components/json-schema-form-layout.cjs +84 -17
- package/dist/components/json-schema-form-layout.cjs.map +1 -1
- package/dist/components/json-schema-form-layout.d.ts +1 -1
- package/dist/components/json-schema-form-layout.d.ts.map +1 -1
- package/dist/components/json-schema-form-layout.js +84 -17
- package/dist/components/json-schema-form-layout.js.map +1 -1
- package/dist/components/json-schema-form-list-array.cjs +16 -5
- package/dist/components/json-schema-form-list-array.cjs.map +1 -1
- package/dist/components/json-schema-form-list-array.d.ts +2 -1
- package/dist/components/json-schema-form-list-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-list-array.js +16 -5
- package/dist/components/json-schema-form-list-array.js.map +1 -1
- package/dist/components/json-schema-form-object.cjs +239 -85
- package/dist/components/json-schema-form-object.cjs.map +1 -1
- package/dist/components/json-schema-form-object.d.ts +2 -2
- package/dist/components/json-schema-form-object.d.ts.map +1 -1
- package/dist/components/json-schema-form-object.js +241 -87
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-preferences.cjs +1 -1
- package/dist/components/json-schema-form-preferences.cjs.map +1 -1
- package/dist/components/json-schema-form-preferences.d.ts +1 -1
- package/dist/components/json-schema-form-preferences.d.ts.map +1 -1
- package/dist/components/json-schema-form-preferences.js +1 -1
- package/dist/components/json-schema-form-preferences.js.map +1 -1
- package/dist/components/json-schema-form-properties-errors.fixtures.d.ts +14 -0
- package/dist/components/json-schema-form-properties-errors.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties-size.cjs +19 -0
- package/dist/components/json-schema-form-properties-size.cjs.map +1 -0
- package/dist/components/json-schema-form-properties-size.d.ts +4 -0
- package/dist/components/json-schema-form-properties-size.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties-size.js +19 -0
- package/dist/components/json-schema-form-properties-size.js.map +1 -0
- package/dist/components/json-schema-form-properties.cjs +305 -0
- package/dist/components/json-schema-form-properties.cjs.map +1 -0
- package/dist/components/json-schema-form-properties.d.ts +20 -0
- package/dist/components/json-schema-form-properties.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties.fixtures.d.ts +157 -0
- package/dist/components/json-schema-form-properties.fixtures.d.ts.map +1 -0
- package/dist/components/json-schema-form-properties.js +305 -0
- package/dist/components/json-schema-form-properties.js.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.cjs +6 -0
- package/dist/components/json-schema-form-property-actions-context.cjs.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.d.ts +2 -0
- package/dist/components/json-schema-form-property-actions-context.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-actions-context.js +6 -0
- package/dist/components/json-schema-form-property-actions-context.js.map +1 -0
- package/dist/components/json-schema-form-property-collection.cjs +31 -0
- package/dist/components/json-schema-form-property-collection.cjs.map +1 -0
- package/dist/components/json-schema-form-property-collection.d.ts +6 -0
- package/dist/components/json-schema-form-property-collection.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-collection.js +31 -0
- package/dist/components/json-schema-form-property-collection.js.map +1 -0
- package/dist/components/json-schema-form-property-draft.cjs +45 -0
- package/dist/components/json-schema-form-property-draft.cjs.map +1 -0
- package/dist/components/json-schema-form-property-draft.d.ts +8 -0
- package/dist/components/json-schema-form-property-draft.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-draft.js +45 -0
- package/dist/components/json-schema-form-property-draft.js.map +1 -0
- package/dist/components/json-schema-form-property-preview.cjs +68 -0
- package/dist/components/json-schema-form-property-preview.cjs.map +1 -0
- package/dist/components/json-schema-form-property-preview.d.ts +7 -0
- package/dist/components/json-schema-form-property-preview.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-preview.js +68 -0
- package/dist/components/json-schema-form-property-preview.js.map +1 -0
- package/dist/components/json-schema-form-property-selection.cjs +89 -0
- package/dist/components/json-schema-form-property-selection.cjs.map +1 -0
- package/dist/components/json-schema-form-property-selection.d.ts +6 -0
- package/dist/components/json-schema-form-property-selection.d.ts.map +1 -0
- package/dist/components/json-schema-form-property-selection.js +89 -0
- package/dist/components/json-schema-form-property-selection.js.map +1 -0
- package/dist/components/json-schema-form-render.cjs +41 -4
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts +1 -1
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +42 -5
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +2 -0
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +2 -0
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +222 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -0
- package/dist/components/json-schema-form-table-array.cjs +82 -51
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +84 -53
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-template-menu.d.ts +1 -1
- package/dist/components/json-schema-form-template.d.ts +1 -1
- package/dist/components/json-schema-form-types.d.ts +7 -179
- package/dist/components/json-schema-form-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.cjs +10 -9
- package/dist/components/json-schema-form-utils.cjs.map +1 -1
- package/dist/components/json-schema-form-utils.d.ts +11 -1
- package/dist/components/json-schema-form-utils.d.ts.map +1 -1
- package/dist/components/json-schema-form-utils.js +10 -9
- package/dist/components/json-schema-form-utils.js.map +1 -1
- package/dist/components/loading.d.ts +4 -4
- package/dist/components/mdx-editor-callout.d.ts +1 -1
- package/dist/components/mdx-editor-options.d.ts +1 -1
- package/dist/components/select.d.ts +3 -3
- package/dist/components/theme-switcher.d.ts +1 -1
- package/dist/components/use-list-menu-selection.d.ts +1 -1
- package/dist/components/useComboboxLayout.d.ts +1 -1
- package/dist/components/workload-picker-utils.d.ts +1 -1
- package/dist/data/Avatar.d.ts +1 -1
- package/dist/data/AvatarBadge.d.ts +1 -1
- package/dist/data/Badge.d.ts +1 -1
- package/dist/data/Callout.d.ts +1 -1
- package/dist/data/DataTable.cjs +575 -435
- package/dist/data/DataTable.cjs.map +1 -1
- package/dist/data/DataTable.d.ts +21 -13
- package/dist/data/DataTable.d.ts.map +1 -1
- package/dist/data/DataTable.grouping.d.ts +1 -1
- package/dist/data/DataTable.js +575 -435
- package/dist/data/DataTable.js.map +1 -1
- package/dist/data/ExecutionTree.d.ts +1 -1
- package/dist/data/FilterPill.d.ts +1 -1
- package/dist/data/FixtureEditor/RawFenceEditor.d.ts +1 -1
- package/dist/data/FixtureEditor/types.d.ts +1 -1
- package/dist/data/Gauge.d.ts +1 -1
- package/dist/data/GaugeHoverCard.d.ts +1 -1
- package/dist/data/Icon.d.ts +1 -1
- package/dist/data/KeyValueList.d.ts +1 -1
- package/dist/data/MarkdownEditor.d.ts +1 -1
- package/dist/data/MatrixTable.d.ts +1 -1
- package/dist/data/ObjectGraph.d.ts +1 -1
- package/dist/data/ProgressBars.d.ts +1 -1
- package/dist/data/Properties.cjs +86 -35
- package/dist/data/Properties.cjs.map +1 -1
- package/dist/data/Properties.d.ts +2 -2
- package/dist/data/Properties.d.ts.map +1 -1
- package/dist/data/Properties.js +87 -36
- package/dist/data/Properties.js.map +1 -1
- package/dist/data/RadialGauge.d.ts +1 -1
- package/dist/data/SchemaViewer.d.ts +1 -1
- package/dist/data/SortableHeader.d.ts +1 -1
- package/dist/data/StatStrip.d.ts +1 -1
- package/dist/data/StatusBreakdown.d.ts +1 -1
- package/dist/data/TabButton.d.ts +1 -1
- package/dist/data/TaskManager.cjs +9 -17
- package/dist/data/TaskManager.cjs.map +1 -1
- package/dist/data/TaskManager.d.ts.map +1 -1
- package/dist/data/TaskManager.js +9 -17
- package/dist/data/TaskManager.js.map +1 -1
- package/dist/data/TaskManagerButton.cjs +17 -34
- package/dist/data/TaskManagerButton.cjs.map +1 -1
- package/dist/data/TaskManagerButton.d.ts.map +1 -1
- package/dist/data/TaskManagerButton.js +18 -35
- package/dist/data/TaskManagerButton.js.map +1 -1
- package/dist/data/TaskProcessDetails.cjs +5 -26
- package/dist/data/TaskProcessDetails.cjs.map +1 -1
- package/dist/data/TaskProcessDetails.d.ts +2 -1
- package/dist/data/TaskProcessDetails.d.ts.map +1 -1
- package/dist/data/TaskProcessDetails.js +5 -26
- package/dist/data/TaskProcessDetails.js.map +1 -1
- package/dist/data/TaskProgress.cjs +24 -15
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.d.ts +2 -1
- package/dist/data/TaskProgress.d.ts.map +1 -1
- package/dist/data/TaskProgress.js +24 -15
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/TaskResourceReadings.cjs +42 -0
- package/dist/data/TaskResourceReadings.cjs.map +1 -0
- package/dist/data/TaskResourceReadings.d.ts +6 -0
- package/dist/data/TaskResourceReadings.d.ts.map +1 -0
- package/dist/data/TaskResourceReadings.js +42 -0
- package/dist/data/TaskResourceReadings.js.map +1 -0
- package/dist/data/TaskSnapshot.cjs.map +1 -1
- package/dist/data/TaskSnapshot.d.ts +14 -1
- package/dist/data/TaskSnapshot.d.ts.map +1 -1
- package/dist/data/TaskSnapshot.js.map +1 -1
- package/dist/data/Timeline.d.ts +1 -1
- package/dist/data/Tree.d.ts +1 -1
- package/dist/data/TreeGroupHeader.d.ts +1 -1
- package/dist/data/TreeNode.d.ts +1 -1
- package/dist/data/Version.d.ts +3 -3
- package/dist/data/ai/ChatWindow.cjs +22 -12
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +22 -12
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindow.test-utils.d.ts +4 -2
- package/dist/data/ai/ChatWindow.test-utils.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.types.d.ts +1 -1
- package/dist/data/ai/ChatWindowManager.cjs +2 -0
- package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
- package/dist/data/ai/ChatWindowManager.d.ts +1 -1
- package/dist/data/ai/ChatWindowManager.d.ts.map +1 -1
- package/dist/data/ai/ChatWindowManager.js +2 -0
- package/dist/data/ai/ChatWindowManager.js.map +1 -1
- package/dist/data/ai/PolicyTree.d.ts +1 -1
- package/dist/data/ai/PromptCatalog/PromptPageHeader.d.ts +1 -1
- package/dist/data/ai/PromptCatalog/types.d.ts +1 -1
- package/dist/data/ai/PromptRunEditor/index.cjs +4 -0
- package/dist/data/ai/PromptRunEditor/index.cjs.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.d.ts +5 -2
- package/dist/data/ai/PromptRunEditor/index.d.ts.map +1 -1
- package/dist/data/ai/PromptRunEditor/index.js +4 -0
- package/dist/data/ai/PromptRunEditor/index.js.map +1 -1
- package/dist/data/ai/SessionChatComposer.d.ts +1 -1
- package/dist/data/ai/SessionInspector.approvals.cjs +147 -0
- package/dist/data/ai/SessionInspector.approvals.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.approvals.d.ts +21 -0
- package/dist/data/ai/SessionInspector.approvals.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.approvals.js +147 -0
- package/dist/data/ai/SessionInspector.approvals.js.map +1 -0
- package/dist/data/ai/SessionInspector.cjs +21 -8
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts +6 -2
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.hierarchy.d.ts +1 -1
- package/dist/data/ai/SessionInspector.js +21 -8
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.panel-parts.cjs +47 -0
- package/dist/data/ai/SessionInspector.panel-parts.cjs.map +1 -0
- package/dist/data/ai/SessionInspector.panel-parts.d.ts +20 -0
- package/dist/data/ai/SessionInspector.panel-parts.d.ts.map +1 -0
- package/dist/data/ai/SessionInspector.panel-parts.js +47 -0
- package/dist/data/ai/SessionInspector.panel-parts.js.map +1 -0
- package/dist/data/ai/SessionInspector.panels.cjs +40 -99
- package/dist/data/ai/SessionInspector.panels.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.panels.d.ts +3 -1
- package/dist/data/ai/SessionInspector.panels.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.panels.js +12 -71
- package/dist/data/ai/SessionInspector.panels.js.map +1 -1
- package/dist/data/ai/SessionViewer.d.ts +1 -1
- package/dist/data/ai/SessionViewer.rows.d.ts +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts +1 -1
- package/dist/data/ai/SessionViewer.unified.d.ts +23 -0
- package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/Footer.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/Rail.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/SectionCard.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.cjs +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.js +3 -1
- package/dist/data/ai/SpecRuntimeEditor/VerifySection.js.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/fields.d.ts +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs +3 -1
- package/dist/data/ai/SpecRuntimeEditor/index.cjs.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts +5 -2
- package/dist/data/ai/SpecRuntimeEditor/index.d.ts.map +1 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js +3 -1
- package/dist/data/ai/SpecRuntimeEditor/index.js.map +1 -1
- package/dist/data/ai/chat-window-context.cjs +1 -0
- package/dist/data/ai/chat-window-context.cjs.map +1 -1
- package/dist/data/ai/chat-window-context.d.ts +13 -5
- package/dist/data/ai/chat-window-context.d.ts.map +1 -1
- package/dist/data/ai/chat-window-context.js +1 -0
- package/dist/data/ai/chat-window-context.js.map +1 -1
- package/dist/data/ai/index.d.ts +2 -1
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/ai/use-session-scroll.d.ts +1 -1
- package/dist/data/cache-browser/adapter.d.ts +1 -1
- package/dist/data/cells/CellFilterActions.d.ts +1 -1
- package/dist/data/cells/EntityCell.d.ts +1 -1
- package/dist/data/cells/tag-utils.d.ts +1 -1
- package/dist/data/chat/Chat.cjs +42 -46
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts +16 -5
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.js +43 -47
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ModelSelector.d.ts +1 -1
- package/dist/data/chat/PromptInput.cjs +13 -0
- package/dist/data/chat/PromptInput.cjs.map +1 -1
- package/dist/data/chat/PromptInput.d.ts +8 -2
- package/dist/data/chat/PromptInput.d.ts.map +1 -1
- package/dist/data/chat/PromptInput.js +14 -1
- package/dist/data/chat/PromptInput.js.map +1 -1
- package/dist/data/chat/tool-render/ToolArgs.d.ts +1 -1
- package/dist/data/chat/tool-render/ToolParams.d.ts +1 -1
- package/dist/data/chat/tool-render/ToolValue.d.ts +1 -1
- package/dist/data/chat/tool-render/adapter.d.ts +1 -1
- package/dist/data/chat/tool-render/context.d.ts +1 -1
- package/dist/data/chat/tool-render/defaults.d.ts +1 -1
- package/dist/data/chat/tool-render/known-tool-views.d.ts +1 -1
- package/dist/data/chat/tool-render/summary.d.ts +1 -1
- package/dist/data/chat/types.d.ts +1 -1
- package/dist/data/clicky-export/useClickyExport.d.ts +1 -1
- package/dist/data/data-table-server-filters.d.ts +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts +1 -1
- package/dist/data/diagnostics/StackFrameRow.d.ts +1 -1
- package/dist/data/git/GitChangeList.d.ts +1 -1
- package/dist/data/icon-fallback.d.ts +1 -1
- package/dist/data/properties-context.cjs +6 -0
- package/dist/data/properties-context.cjs.map +1 -0
- package/dist/data/properties-context.d.ts +7 -0
- package/dist/data/properties-context.d.ts.map +1 -0
- package/dist/data/properties-context.js +6 -0
- package/dist/data/properties-context.js.map +1 -0
- package/dist/data/query-browser/QueryBrowser.types.d.ts +1 -1
- package/dist/data/runtime/RuntimeBar.cjs +7 -3
- package/dist/data/runtime/RuntimeBar.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBar.js +7 -3
- package/dist/data/runtime/RuntimeBar.js.map +1 -1
- package/dist/data/task-copy.cjs +1 -1
- package/dist/data/task-copy.cjs.map +1 -1
- package/dist/data/task-copy.js +1 -1
- package/dist/data/task-copy.js.map +1 -1
- package/dist/data/task-resource-summary.cjs +30 -0
- package/dist/data/task-resource-summary.cjs.map +1 -0
- package/dist/data/task-resource-summary.d.ts +15 -0
- package/dist/data/task-resource-summary.d.ts.map +1 -0
- package/dist/data/task-resource-summary.js +30 -0
- package/dist/data/task-resource-summary.js.map +1 -0
- package/dist/data/task-status.cjs +8 -2
- package/dist/data/task-status.cjs.map +1 -1
- package/dist/data/task-status.d.ts +3 -0
- package/dist/data/task-status.d.ts.map +1 -1
- package/dist/data/task-status.js +8 -2
- package/dist/data/task-status.js.map +1 -1
- package/dist/data/task-work-progress.cjs +24 -0
- package/dist/data/task-work-progress.cjs.map +1 -0
- package/dist/data/task-work-progress.d.ts +21 -0
- package/dist/data/task-work-progress.d.ts.map +1 -0
- package/dist/data/task-work-progress.js +24 -0
- package/dist/data/task-work-progress.js.map +1 -0
- package/dist/data/test-runner/TestRunner.d.ts +1 -1
- package/dist/data/test-runner/adapter.d.ts +1 -1
- package/dist/data/test-runner/context.d.ts +1 -1
- package/dist/data/use-data-table-virtual.cjs +73 -0
- package/dist/data/use-data-table-virtual.cjs.map +1 -0
- package/dist/data/use-data-table-virtual.d.ts +40 -0
- package/dist/data/use-data-table-virtual.d.ts.map +1 -0
- package/dist/data/use-data-table-virtual.js +73 -0
- package/dist/data/use-data-table-virtual.js.map +1 -0
- package/dist/data/verification/VerificationResults.d.ts +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/expressions/lang/attributes.cjs +56 -0
- package/dist/expressions/lang/attributes.cjs.map +1 -0
- package/dist/expressions/lang/attributes.d.ts +22 -0
- package/dist/expressions/lang/attributes.d.ts.map +1 -0
- package/dist/expressions/lang/attributes.js +56 -0
- package/dist/expressions/lang/attributes.js.map +1 -0
- package/dist/expressions/lang/completion.cjs +164 -0
- package/dist/expressions/lang/completion.cjs.map +1 -0
- package/dist/expressions/lang/completion.d.ts +29 -0
- package/dist/expressions/lang/completion.d.ts.map +1 -0
- package/dist/expressions/lang/completion.js +164 -0
- package/dist/expressions/lang/completion.js.map +1 -0
- package/dist/expressions/lang/environment.cjs +115 -0
- package/dist/expressions/lang/environment.cjs.map +1 -0
- package/dist/expressions/lang/environment.d.ts +54 -0
- package/dist/expressions/lang/environment.d.ts.map +1 -0
- package/dist/expressions/lang/environment.js +115 -0
- package/dist/expressions/lang/environment.js.map +1 -0
- package/dist/expressions/lang/generated/conformance.json.d.ts +4962 -0
- package/dist/expressions/lang/generated/index.cjs +18 -0
- package/dist/expressions/lang/generated/index.cjs.map +1 -0
- package/dist/expressions/lang/generated/index.d.ts +9 -0
- package/dist/expressions/lang/generated/index.d.ts.map +1 -0
- package/dist/expressions/lang/generated/index.js +18 -0
- package/dist/expressions/lang/generated/index.js.map +1 -0
- package/dist/expressions/lang/generated/languages.json.cjs +18 -0
- package/dist/expressions/lang/generated/languages.json.cjs.map +1 -0
- package/dist/expressions/lang/generated/languages.json.d.ts +2305 -0
- package/dist/expressions/lang/generated/languages.json.js +18 -0
- package/dist/expressions/lang/generated/languages.json.js.map +1 -0
- package/dist/expressions/lang/generated/spec.json.cjs +12 -0
- package/dist/expressions/lang/generated/spec.json.cjs.map +1 -0
- package/dist/expressions/lang/generated/spec.json.d.ts +6260 -0
- package/dist/expressions/lang/generated/spec.json.js +12 -0
- package/dist/expressions/lang/generated/spec.json.js.map +1 -0
- package/dist/expressions/lang/hover.cjs +106 -0
- package/dist/expressions/lang/hover.cjs.map +1 -0
- package/dist/expressions/lang/hover.d.ts +54 -0
- package/dist/expressions/lang/hover.d.ts.map +1 -0
- package/dist/expressions/lang/hover.js +106 -0
- package/dist/expressions/lang/hover.js.map +1 -0
- package/dist/expressions/lang/index.cjs +87 -0
- package/dist/expressions/lang/index.cjs.map +1 -0
- package/dist/expressions/lang/index.d.ts +65 -0
- package/dist/expressions/lang/index.d.ts.map +1 -0
- package/dist/expressions/lang/index.js +90 -0
- package/dist/expressions/lang/index.js.map +1 -0
- package/dist/expressions/lang/merge.cjs +52 -0
- package/dist/expressions/lang/merge.cjs.map +1 -0
- package/dist/expressions/lang/merge.d.ts +12 -0
- package/dist/expressions/lang/merge.d.ts.map +1 -0
- package/dist/expressions/lang/merge.js +52 -0
- package/dist/expressions/lang/merge.js.map +1 -0
- package/dist/expressions/lang/prefix.cjs +91 -0
- package/dist/expressions/lang/prefix.cjs.map +1 -0
- package/dist/expressions/lang/prefix.d.ts +36 -0
- package/dist/expressions/lang/prefix.d.ts.map +1 -0
- package/dist/expressions/lang/prefix.js +91 -0
- package/dist/expressions/lang/prefix.js.map +1 -0
- package/dist/expressions/lang/spec.d.ts +13 -0
- package/dist/expressions/lang/spec.d.ts.map +1 -0
- package/dist/expressions/lang/theme.cjs +97 -0
- package/dist/expressions/lang/theme.cjs.map +1 -0
- package/dist/expressions/lang/theme.d.ts +6 -0
- package/dist/expressions/lang/theme.d.ts.map +1 -0
- package/dist/expressions/lang/theme.js +97 -0
- package/dist/expressions/lang/theme.js.map +1 -0
- package/dist/expressions/lang/types.d.ts +81 -0
- package/dist/expressions/lang/types.d.ts.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.cjs +308 -0
- package/dist/expressions/playground/ExpressionPlayground.cjs.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.d.ts +42 -0
- package/dist/expressions/playground/ExpressionPlayground.d.ts.map +1 -0
- package/dist/expressions/playground/ExpressionPlayground.js +291 -0
- package/dist/expressions/playground/ExpressionPlayground.js.map +1 -0
- package/dist/expressions/playground/RunControls.cjs +51 -0
- package/dist/expressions/playground/RunControls.cjs.map +1 -0
- package/dist/expressions/playground/RunControls.d.ts +7 -0
- package/dist/expressions/playground/RunControls.d.ts.map +1 -0
- package/dist/expressions/playground/RunControls.js +51 -0
- package/dist/expressions/playground/RunControls.js.map +1 -0
- package/dist/expressions/playground/VerticalSplit.cjs +109 -0
- package/dist/expressions/playground/VerticalSplit.cjs.map +1 -0
- package/dist/expressions/playground/VerticalSplit.d.ts +23 -0
- package/dist/expressions/playground/VerticalSplit.d.ts.map +1 -0
- package/dist/expressions/playground/VerticalSplit.js +109 -0
- package/dist/expressions/playground/VerticalSplit.js.map +1 -0
- package/dist/expressions/playground/api.cjs +49 -0
- package/dist/expressions/playground/api.cjs.map +1 -0
- package/dist/expressions/playground/api.d.ts +53 -0
- package/dist/expressions/playground/api.d.ts.map +1 -0
- package/dist/expressions/playground/api.js +49 -0
- package/dist/expressions/playground/api.js.map +1 -0
- package/dist/expressions/playground/languages.cjs +88 -0
- package/dist/expressions/playground/languages.cjs.map +1 -0
- package/dist/expressions/playground/languages.d.ts +43 -0
- package/dist/expressions/playground/languages.d.ts.map +1 -0
- package/dist/expressions/playground/languages.js +88 -0
- package/dist/expressions/playground/languages.js.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.cjs +72 -0
- package/dist/expressions/playground/panels/GraphPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.d.ts +19 -0
- package/dist/expressions/playground/panels/GraphPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/GraphPanel.js +72 -0
- package/dist/expressions/playground/panels/GraphPanel.js.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.cjs +82 -0
- package/dist/expressions/playground/panels/ResultPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.d.ts +11 -0
- package/dist/expressions/playground/panels/ResultPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/ResultPanel.js +82 -0
- package/dist/expressions/playground/panels/ResultPanel.js.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.cjs +76 -0
- package/dist/expressions/playground/panels/SpecPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.d.ts +18 -0
- package/dist/expressions/playground/panels/SpecPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/SpecPanel.js +76 -0
- package/dist/expressions/playground/panels/SpecPanel.js.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.cjs +89 -0
- package/dist/expressions/playground/panels/TokensPanel.cjs.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.d.ts +15 -0
- package/dist/expressions/playground/panels/TokensPanel.d.ts.map +1 -0
- package/dist/expressions/playground/panels/TokensPanel.js +72 -0
- package/dist/expressions/playground/panels/TokensPanel.js.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.cjs +35 -0
- package/dist/expressions/playground/panels/graphNodes.cjs.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.d.ts +19 -0
- package/dist/expressions/playground/panels/graphNodes.d.ts.map +1 -0
- package/dist/expressions/playground/panels/graphNodes.js +35 -0
- package/dist/expressions/playground/panels/graphNodes.js.map +1 -0
- package/dist/expressions/playground/runAction.cjs +12 -0
- package/dist/expressions/playground/runAction.cjs.map +1 -0
- package/dist/expressions/playground/runAction.d.ts +15 -0
- package/dist/expressions/playground/runAction.d.ts.map +1 -0
- package/dist/expressions/playground/runAction.js +12 -0
- package/dist/expressions/playground/runAction.js.map +1 -0
- package/dist/expressions/playground/runShortcut.cjs +9 -0
- package/dist/expressions/playground/runShortcut.cjs.map +1 -0
- package/dist/expressions/playground/runShortcut.d.ts +2 -0
- package/dist/expressions/playground/runShortcut.d.ts.map +1 -0
- package/dist/expressions/playground/runShortcut.js +9 -0
- package/dist/expressions/playground/runShortcut.js.map +1 -0
- package/dist/expressions/playground/useEditorTheme.cjs +40 -0
- package/dist/expressions/playground/useEditorTheme.cjs.map +1 -0
- package/dist/expressions/playground/useEditorTheme.d.ts +16 -0
- package/dist/expressions/playground/useEditorTheme.d.ts.map +1 -0
- package/dist/expressions/playground/useEditorTheme.js +23 -0
- package/dist/expressions/playground/useEditorTheme.js.map +1 -0
- package/dist/expressions/playground/useEvaluator.cjs +72 -0
- package/dist/expressions/playground/useEvaluator.cjs.map +1 -0
- package/dist/expressions/playground/useEvaluator.d.ts +25 -0
- package/dist/expressions/playground/useEvaluator.d.ts.map +1 -0
- package/dist/expressions/playground/useEvaluator.js +72 -0
- package/dist/expressions/playground/useEvaluator.js.map +1 -0
- package/dist/expressions/playground/useParsedInput.cjs +22 -0
- package/dist/expressions/playground/useParsedInput.cjs.map +1 -0
- package/dist/expressions/playground/useParsedInput.d.ts +20 -0
- package/dist/expressions/playground/useParsedInput.d.ts.map +1 -0
- package/dist/expressions/playground/useParsedInput.js +22 -0
- package/dist/expressions/playground/useParsedInput.js.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.cjs +11 -0
- package/dist/expressions/playground/verticalSplitModel.cjs.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.d.ts +3 -0
- package/dist/expressions/playground/verticalSplitModel.d.ts.map +1 -0
- package/dist/expressions/playground/verticalSplitModel.js +11 -0
- package/dist/expressions/playground/verticalSplitModel.js.map +1 -0
- package/dist/expressions/playground.cjs +18 -0
- package/dist/expressions/playground.cjs.map +1 -0
- package/dist/expressions/playground.d.ts +18 -0
- package/dist/expressions/playground.d.ts.map +1 -0
- package/dist/expressions/playground.js +18 -0
- package/dist/expressions/playground.js.map +1 -0
- package/dist/expressions.cjs +28 -0
- package/dist/expressions.cjs.map +1 -0
- package/dist/expressions.d.ts +10 -0
- package/dist/expressions.d.ts.map +1 -0
- package/dist/expressions.js +28 -0
- package/dist/expressions.js.map +1 -0
- package/dist/hooks/density-provider.d.ts +1 -1
- package/dist/hooks/theme-provider.d.ts +1 -1
- package/dist/hooks/use-density.d.ts +1 -1
- package/dist/hooks/use-resource-clock.cjs +14 -0
- package/dist/hooks/use-resource-clock.cjs.map +1 -0
- package/dist/hooks/use-resource-clock.d.ts +2 -0
- package/dist/hooks/use-resource-clock.d.ts.map +1 -0
- package/dist/hooks/use-resource-clock.js +14 -0
- package/dist/hooks/use-resource-clock.js.map +1 -0
- package/dist/hooks/use-task-run.cjs +12 -3
- package/dist/hooks/use-task-run.cjs.map +1 -1
- package/dist/hooks/use-task-run.d.ts.map +1 -1
- package/dist/hooks/use-task-run.js +12 -3
- package/dist/hooks/use-task-run.js.map +1 -1
- package/dist/hooks/use-theme.d.ts +1 -1
- package/dist/icons/registry.d.ts +1 -1
- package/dist/icons/types.d.ts +1 -1
- package/dist/layout/AppShell.d.ts +1 -1
- package/dist/layout/AppShell.nav.drag.d.ts +1 -1
- package/dist/layout/AppSidebar.d.ts +1 -1
- package/dist/layout/Panel.d.ts +1 -1
- package/dist/layout/PanelFrame.d.ts +1 -1
- package/dist/layout/Section.d.ts +1 -1
- package/dist/layout/SplitPane.d.ts +1 -1
- package/dist/layout/Tabs.d.ts +1 -1
- package/dist/layout/Workspace.d.ts +1 -1
- package/dist/layout/Workspace.model.d.ts +1 -1
- package/dist/lib/combobox-values.d.ts +1 -1
- package/dist/monaco/MonacoEditor.cjs +3 -3
- package/dist/monaco/MonacoEditor.cjs.map +1 -1
- package/dist/monaco/MonacoEditor.js +2 -2
- package/dist/monaco/MonacoEditor.js.map +1 -1
- package/dist/monaco/types.d.ts +1 -1
- package/dist/monaco/use-monaco-worker.d.ts +1 -1
- package/dist/overlay/CellActions.d.ts +1 -1
- package/dist/overlay/CommandPalette.d.ts +2 -2
- package/dist/overlay/CommandPalette.model.d.ts +1 -1
- package/dist/overlay/CommandPaletteList.d.ts +1 -1
- package/dist/overlay/DropdownMenu.d.ts +1 -1
- package/dist/overlay/HoverCard.d.ts +1 -1
- package/dist/overlay/Modal.d.ts +2 -2
- package/dist/overlay/Toast.d.ts +1 -1
- package/dist/overlay/TourCard.d.ts +1 -1
- package/dist/overlay/TourProvider.d.ts +1 -1
- package/dist/overlay/dropdownMenuContext.d.ts +1 -1
- package/dist/overlay/toast-context.d.ts +2 -2
- package/dist/overlay/tour-context.d.ts +1 -1
- package/dist/overlay/tour-types.d.ts +1 -1
- package/dist/profiles/connections/connectionBrowserModel.d.ts +1 -1
- package/dist/profiles/connections/connectionQueryWorkspace.d.ts +1 -1
- package/dist/profiles/editor/profileBuilder.d.ts +1 -1
- package/dist/profiles/elasticsearch/esParamOperandExtension.d.ts +1 -1
- package/dist/profiles/fields/profileFieldControls.d.ts +1 -1
- package/dist/profiles/fields/profileFieldIcons.d.ts +1 -1
- package/dist/profiles/fields/profileFieldState.d.ts +1 -1
- package/dist/profiles/query/jsonPathSample.d.ts +1 -1
- package/dist/profiles/query/jsonPathSampleRow.d.ts +1 -1
- package/dist/profiles/query/prometheusResults.d.ts +2 -2
- package/dist/rpc/EndpointList.d.ts +1 -1
- package/dist/rpc/EntityExplorerApp.d.ts +1 -1
- package/dist/rpc/OperationCatalog.d.ts +1 -1
- package/dist/rpc/OperationEntityContextPicker.d.ts +1 -1
- package/dist/rpc/OperationEntityPage.d.ts +1 -1
- package/dist/rpc/OperationResultView.d.ts +1 -1
- package/dist/rpc/RouterProvider.d.ts +1 -1
- package/dist/rpc/SchemaActionForm.d.ts +1 -1
- package/dist/rpc/formMetadata.d.ts +1 -1
- package/dist/rpc/router.d.ts +1 -1
- package/dist/rpc/rpc-story.fixtures.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +21 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { FormSize } from '../../components/json-schema-form-size';
|
|
3
3
|
import { JsonSchemaObject } from '../../components/json-schema-form-types';
|
|
4
4
|
import { SpecRuntimeEditorProps } from '../ai/SpecRuntimeEditor';
|
package/dist/data/Gauge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { StaticIconComponent } from './Icon';
|
|
3
3
|
export type GaugeTone = "neutral" | "success" | "warning" | "danger" | "info";
|
|
4
4
|
export type GaugeVariant = "default" | "cell";
|
package/dist/data/Icon.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementType, ReactElement, ReactNode } from '
|
|
1
|
+
import { ElementType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { SizeToken } from '../lib/size';
|
|
3
3
|
export type LabelIconSpec = string | ReactNode;
|
|
4
4
|
export type IconStyle = "plain" | "badge";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { ClickyProps } from './Clicky';
|
|
3
3
|
import { MarkdownEditorPreviewFormat, MarkdownEditorPreviewHeaders, MarkdownEditorPreviewRequest, MarkdownEditorPreviewResult } from './MarkdownEditor.model';
|
|
4
4
|
export type MarkdownEditorProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { StaticIconComponent } from './Icon';
|
|
3
3
|
export type ProgressBarsVariant = "default" | "cell";
|
|
4
4
|
export type ProgressBarsOrientation = "horizontal" | "vertical";
|
package/dist/data/Properties.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const utils = require("../lib/utils.cjs");
|
|
|
7
7
|
const DropdownMenu = require("../overlay/DropdownMenu.cjs");
|
|
8
8
|
const Icon = require("./Icon.cjs");
|
|
9
9
|
const propertiesUtils = require("./properties-utils.cjs");
|
|
10
|
+
const propertiesContext = require("./properties-context.cjs");
|
|
10
11
|
const UiRows = require("../icons/components/UiRows.cjs");
|
|
11
12
|
const UiListFlat = require("../icons/components/UiListFlat.cjs");
|
|
12
13
|
const UiListDashes = require("../icons/components/UiListDashes.cjs");
|
|
@@ -55,14 +56,17 @@ function Properties({
|
|
|
55
56
|
showDensityMenu = true,
|
|
56
57
|
emptyMessage = "No properties"
|
|
57
58
|
}) {
|
|
59
|
+
const parent = react.useContext(propertiesContext.PropertiesContext);
|
|
58
60
|
const [densityOverride, setDensityOverride] = react.useState();
|
|
59
61
|
react.useEffect(() => setDensityOverride(readStoredDensity(keyRef)), [keyRef]);
|
|
60
62
|
const visible = items.filter((item) => !item.hidden);
|
|
61
63
|
if (visible.length === 0) {
|
|
62
64
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: emptyMessage });
|
|
63
65
|
}
|
|
64
|
-
const activeDensity = densityOverride ?? density;
|
|
66
|
+
const activeDensity = (parent == null ? void 0 : parent.density) ?? densityOverride ?? density;
|
|
65
67
|
const styles = DENSITY_CLASSES[activeDensity];
|
|
68
|
+
const columns = (parent == null ? void 0 : parent.columns) ?? gridTemplateColumns ?? styles.gridTemplateColumns;
|
|
69
|
+
const depth = (parent == null ? void 0 : parent.depth) ?? 0;
|
|
66
70
|
const updateDensity = (next) => {
|
|
67
71
|
setDensityOverride(next);
|
|
68
72
|
writeStoredDensity(keyRef, next);
|
|
@@ -71,50 +75,97 @@ function Properties({
|
|
|
71
75
|
"dl",
|
|
72
76
|
{
|
|
73
77
|
className: utils.cn(
|
|
74
|
-
"divide-y divide-border rounded-md border border-border bg-muted/20",
|
|
78
|
+
"grid gap-x-density-3 divide-y divide-border rounded-md border border-border bg-muted/20",
|
|
79
|
+
parent && "col-span-full rounded-none border-0 bg-transparent",
|
|
75
80
|
className
|
|
76
81
|
),
|
|
82
|
+
style: { gridTemplateColumns: parent ? "subgrid" : columns },
|
|
77
83
|
children: [
|
|
78
|
-
showDensityMenu ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end px-density-2 py-density-1", children: [
|
|
84
|
+
showDensityMenu && !parent ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-full flex items-center justify-end px-density-2 py-density-1", children: [
|
|
79
85
|
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "sr-only", children: "Properties display options" }),
|
|
80
|
-
/* @__PURE__ */ jsxRuntime.jsx("dd", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
PropertiesDensityMenu,
|
|
88
|
+
{
|
|
89
|
+
density: activeDensity,
|
|
90
|
+
onChange: updateDensity
|
|
91
|
+
}
|
|
92
|
+
) })
|
|
81
93
|
] }) : null,
|
|
82
94
|
visible.map((item) => {
|
|
83
95
|
const iconName = typeof labelIcon === "function" ? labelIcon(item.key, item.value, item) : labelIcon;
|
|
84
96
|
const renderedLabel = renderLabel ? renderLabel(item.key, item.value, item) : propertiesUtils.formatPropertyLabel(item.key);
|
|
85
97
|
const ariaLabel = typeof renderedLabel === "string" ? renderedLabel : item.key;
|
|
86
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
"aria-label": ariaLabel,
|
|
96
|
-
className: utils.cn("min-w-0 truncate", styles.label, labelClassName),
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-density-1", children: [
|
|
99
|
-
iconName ? /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { name: iconName, className: "text-xs shrink-0" }) : null,
|
|
100
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: renderedLabel })
|
|
101
|
-
] }),
|
|
102
|
-
item.subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-[10px] font-normal text-muted-foreground/80", children: item.subtitle }) : null
|
|
103
|
-
]
|
|
104
|
-
}
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: utils.cn(
|
|
103
|
+
"col-span-full grid min-w-0 grid-cols-subgrid gap-density-3",
|
|
104
|
+
styles.row,
|
|
105
|
+
rowClassName
|
|
105
106
|
),
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
109
|
+
"dt",
|
|
110
|
+
{
|
|
111
|
+
"aria-label": ariaLabel,
|
|
112
|
+
className: utils.cn("min-w-0 truncate", styles.label, labelClassName),
|
|
113
|
+
style: { paddingInlineStart: depth * 16 },
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-density-1", children: [
|
|
116
|
+
iconName ? /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { name: iconName, className: "text-xs shrink-0" }) : null,
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: renderedLabel })
|
|
118
|
+
] }),
|
|
119
|
+
item.subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-[10px] font-normal text-muted-foreground/80", children: item.subtitle }) : null
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: utils.cn("min-w-0 space-y-density-1", valueClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-start gap-density-1", children: [
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
+
ActionList,
|
|
126
|
+
{
|
|
127
|
+
actions: prefixActions,
|
|
128
|
+
item,
|
|
129
|
+
className: "shrink-0 pt-0.5"
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
className: utils.cn("min-w-0 max-w-full flex-1", styles.value),
|
|
136
|
+
children: renderValue ? renderValue(item.key, item.value, item) : defaultRenderValue(item.value)
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
+
ActionList,
|
|
141
|
+
{
|
|
142
|
+
actions: suffixActions,
|
|
143
|
+
item,
|
|
144
|
+
className: "shrink-0 pt-0.5"
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
] }) })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
item.expandable && item.expanded && item.renderChildren ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-full grid grid-cols-subgrid", children: [
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "sr-only", children: [
|
|
153
|
+
ariaLabel,
|
|
154
|
+
" properties"
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "col-span-full grid min-w-0 grid-cols-subgrid", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
+
propertiesContext.PropertiesContext.Provider,
|
|
158
|
+
{
|
|
159
|
+
value: {
|
|
160
|
+
depth: depth + 1,
|
|
161
|
+
columns,
|
|
162
|
+
density: activeDensity
|
|
163
|
+
},
|
|
164
|
+
children: item.renderChildren()
|
|
165
|
+
}
|
|
166
|
+
) })
|
|
167
|
+
] }) : null
|
|
168
|
+
] }, item.key);
|
|
118
169
|
})
|
|
119
170
|
]
|
|
120
171
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Properties.cjs","sources":["../../src/data/Properties.tsx"],"sourcesContent":["import { useEffect, useState, type ReactNode } from \"react\";\nimport { IconButton } from \"../components/IconButton\";\nimport {\n UiCheck,\n UiDotsVertical,\n UiListDashes,\n UiListFlat,\n UiRows,\n} from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport { DropdownMenu } from \"../overlay/DropdownMenu\";\nimport { Icon, type StaticIconComponent } from \"./Icon\";\nimport { formatPropertyLabel } from \"./properties-utils\";\n\nexport type PropertiesAction<V = unknown> = {\n /** Stable action id. */\n id: string;\n /** Iconify name or imported icon component. */\n icon: string | StaticIconComponent;\n /** Accessible label and tooltip for this row action. */\n label: (key: string, value: V, item: PropertiesItem<V>) => string;\n /** Return false to hide the action for a specific row. */\n visible?: (key: string, value: V, item: PropertiesItem<V>) => boolean;\n /** Return true to disable the action for a specific row. */\n disabled?: (key: string, value: V, item: PropertiesItem<V>) => boolean;\n /** Called when the row action is clicked. */\n onClick: (key: string, value: V, item: PropertiesItem<V>) => void;\n};\n\nexport type PropertiesItem<V = unknown> = {\n /** Stable property key. Also used as the default label. */\n key: string;\n /** Property value passed to renderers and actions. */\n value: V;\n /** Secondary text shown below the label. */\n subtitle?: ReactNode;\n /** Hide this row without removing it from the item array. */\n hidden?: boolean;\n /** Enables an expandable child area below the row value. */\n expandable?: boolean;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Called when an expandable row is toggled. */\n onToggle?: (next: boolean) => void;\n /** Child content rendered when the row is expanded. */\n renderChildren?: () => ReactNode;\n};\n\nexport type PropertiesDensity = \"comfortable\" | \"compact\" | \"spacious\";\n\nexport type PropertiesProps<V = unknown> = {\n /** Property rows to render. Hidden items are filtered out. */\n items: PropertiesItem<V>[];\n /** Custom label renderer. */\n renderLabel?: (key: string, value: V, item: PropertiesItem<V>) => ReactNode;\n /** Custom value renderer. */\n renderValue?: (key: string, value: V, item: PropertiesItem<V>) => ReactNode;\n /** Static icon name or function that returns an icon name per row. */\n labelIcon?: string | ((key: string, value: V, item: PropertiesItem<V>) => string | undefined);\n /** Actions rendered before the value. */\n prefixActions?: PropertiesAction<V>[];\n /** Actions rendered after the value. */\n suffixActions?: PropertiesAction<V>[];\n /** Classes applied to the list root. */\n className?: string;\n /** Classes applied to each row. */\n rowClassName?: string;\n /** CSS grid columns applied to each row. Defaults to the selected density preset. */\n gridTemplateColumns?: string;\n /** Classes applied to each label cell. */\n labelClassName?: string;\n /** Classes applied to each value cell. */\n valueClassName?: string;\n /** Row density preset. */\n density?: PropertiesDensity;\n /** Stable reference used to persist this instance's density preference. */\n keyRef?: string;\n /** Show the display-options menu. */\n showDensityMenu?: boolean;\n /** Empty-state content when no rows are visible. */\n emptyMessage?: ReactNode;\n};\n\nconst PROPERTIES_DENSITY_STORAGE_PREFIX = \"clicky-ui-properties\";\n\nconst PROPERTIES_DENSITY_OPTIONS: Array<{\n value: PropertiesDensity;\n label: string;\n icon: StaticIconComponent;\n}> = [\n { value: \"compact\", label: \"Compact\", icon: UiRows },\n { value: \"comfortable\", label: \"Comfortable\", icon: UiListFlat },\n { value: \"spacious\", label: \"Spacious\", icon: UiListDashes },\n];\n\nconst DENSITY_CLASSES: Record<\n PropertiesDensity,\n { row: string; label: string; value: string; gridTemplateColumns: string }\n> = {\n spacious: {\n row: \"px-density-4 py-density-3\",\n label: \"text-sm font-medium text-muted-foreground\",\n value: \"text-base text-foreground\",\n gridTemplateColumns: \"minmax(12rem, 20rem) minmax(0, 1fr)\",\n },\n comfortable: {\n row: \"px-density-3 py-density-2\",\n label: \"text-xs font-medium text-muted-foreground\",\n value: \"text-sm text-foreground\",\n gridTemplateColumns: \"minmax(7rem, 12rem) minmax(0, 1fr)\",\n },\n compact: {\n row: \"px-density-2 py-density-1.5\",\n label: \"font-mono text-[11px] text-muted-foreground\",\n value: \"text-xs text-foreground\",\n gridTemplateColumns: \"minmax(8rem, 14rem) minmax(0, 1fr)\",\n },\n};\n\nexport function Properties<V = unknown>({\n items,\n renderLabel,\n renderValue,\n labelIcon,\n prefixActions,\n suffixActions,\n className,\n rowClassName,\n gridTemplateColumns,\n labelClassName,\n valueClassName,\n density = \"comfortable\",\n keyRef,\n showDensityMenu = true,\n emptyMessage = \"No properties\",\n}: PropertiesProps<V>) {\n const [densityOverride, setDensityOverride] = useState<PropertiesDensity>();\n useEffect(() => setDensityOverride(readStoredDensity(keyRef)), [keyRef]);\n\n const visible = items.filter((item) => !item.hidden);\n\n if (visible.length === 0) {\n return <div className=\"text-sm text-muted-foreground\">{emptyMessage}</div>;\n }\n\n const activeDensity = densityOverride ?? density;\n const styles = DENSITY_CLASSES[activeDensity];\n\n const updateDensity = (next: PropertiesDensity) => {\n setDensityOverride(next);\n writeStoredDensity(keyRef, next);\n };\n\n return (\n <dl\n className={cn(\n \"divide-y divide-border rounded-md border border-border bg-muted/20\",\n className,\n )}\n >\n {showDensityMenu ? (\n <div className=\"flex items-center justify-end px-density-2 py-density-1\">\n <dt className=\"sr-only\">Properties display options</dt>\n <dd>\n <PropertiesDensityMenu density={activeDensity} onChange={updateDensity} />\n </dd>\n </div>\n ) : null}\n {visible.map((item) => {\n const iconName =\n typeof labelIcon === \"function\" ? labelIcon(item.key, item.value, item) : labelIcon;\n const renderedLabel = renderLabel\n ? renderLabel(item.key, item.value, item)\n : formatPropertyLabel(item.key);\n const ariaLabel = typeof renderedLabel === \"string\" ? renderedLabel : item.key;\n\n return (\n <div\n key={item.key}\n className={cn(\"grid min-w-0 gap-density-3\", styles.row, rowClassName)}\n style={{ gridTemplateColumns: gridTemplateColumns ?? styles.gridTemplateColumns }}\n >\n <dt\n aria-label={ariaLabel}\n className={cn(\"min-w-0 truncate\", styles.label, labelClassName)}\n >\n <div className=\"flex min-w-0 items-center gap-density-1\">\n {iconName ? <Icon name={iconName} className=\"text-xs shrink-0\" /> : null}\n <span className=\"min-w-0 truncate\">{renderedLabel}</span>\n </div>\n {item.subtitle ? (\n <div className=\"mt-0.5 text-[10px] font-normal text-muted-foreground/80\">\n {item.subtitle}\n </div>\n ) : null}\n </dt>\n <dd className={cn(\"min-w-0 space-y-density-1\", valueClassName)}>\n <div className=\"flex min-w-0 items-start gap-density-1\">\n <ActionList actions={prefixActions} item={item} className=\"shrink-0 pt-0.5\" />\n <div className={cn(\"min-w-0 max-w-full flex-1\", styles.value)}>\n {renderValue\n ? renderValue(item.key, item.value, item)\n : defaultRenderValue(item.value)}\n </div>\n <ActionList actions={suffixActions} item={item} className=\"shrink-0 pt-0.5\" />\n </div>\n {item.expandable && item.expanded && item.renderChildren\n ? item.renderChildren()\n : null}\n </dd>\n </div>\n );\n })}\n </dl>\n );\n}\n\nfunction PropertiesDensityMenu({\n density,\n onChange,\n}: {\n density: PropertiesDensity;\n onChange: (density: PropertiesDensity) => void;\n}) {\n return (\n <DropdownMenu\n align=\"right\"\n menuLabel=\"Properties options\"\n trigger={\n <IconButton\n icon={UiDotsVertical}\n label=\"Properties options\"\n className=\"h-6 w-6\"\n />\n }\n >\n {(closeMenu) => (\n <div className=\"min-w-44 py-1 text-popover-foreground\">\n <div className=\"px-2 py-1 text-xs font-medium text-muted-foreground\">\n Density\n </div>\n {PROPERTIES_DENSITY_OPTIONS.map((option) => {\n const active = density === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={active}\n className={densityMenuItemClassName(active)}\n onClick={() => {\n onChange(option.value);\n closeMenu();\n }}\n >\n <Icon\n icon={option.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n {active ? (\n <Icon icon={UiCheck} className=\"text-sm text-foreground\" />\n ) : (\n <span className=\"inline-block h-4 w-4\" aria-hidden />\n )}\n </button>\n );\n })}\n </div>\n )}\n </DropdownMenu>\n );\n}\n\nfunction densityMenuItemClassName(active: boolean): string {\n return cn(\n \"flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm\",\n \"hover:bg-accent focus:bg-accent focus:outline-none\",\n active && \"bg-accent/60\",\n );\n}\n\nfunction readStoredDensity(\n keyRef: string | undefined,\n): PropertiesDensity | undefined {\n const storageKey = propertiesDensityStorageKey(keyRef);\n if (!storageKey || typeof window === \"undefined\") return undefined;\n\n try {\n const value = window.localStorage.getItem(storageKey);\n return isPropertiesDensity(value) ? value : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredDensity(\n keyRef: string | undefined,\n density: PropertiesDensity,\n): void {\n const storageKey = propertiesDensityStorageKey(keyRef);\n if (!storageKey || typeof window === \"undefined\") return;\n\n try {\n window.localStorage.setItem(storageKey, density);\n } catch {\n // Display preferences are best-effort when browser storage is unavailable.\n }\n}\n\nfunction propertiesDensityStorageKey(\n keyRef: string | undefined,\n): string | undefined {\n const normalized = keyRef?.trim();\n return normalized\n ? `${PROPERTIES_DENSITY_STORAGE_PREFIX}:${normalized}:density`\n : undefined;\n}\n\nfunction isPropertiesDensity(value: unknown): value is PropertiesDensity {\n return value === \"compact\" || value === \"comfortable\" || value === \"spacious\";\n}\n\nfunction ActionList<V>({\n actions,\n item,\n className,\n}: {\n actions: PropertiesAction<V>[] | undefined;\n item: PropertiesItem<V>;\n className?: string;\n}) {\n if (!actions || actions.length === 0) return null;\n const rendered = actions.filter(\n (action) => !action.visible || action.visible(item.key, item.value, item),\n );\n if (rendered.length === 0) return null;\n return (\n <span className={cn(\"inline-flex items-center\", className)}>\n {rendered.map((action) => (\n <PropertiesActionButton key={action.id} action={action} item={item} />\n ))}\n </span>\n );\n}\n\nfunction PropertiesActionButton<V>({\n action,\n item,\n}: {\n action: PropertiesAction<V>;\n item: PropertiesItem<V>;\n}) {\n const label = action.label(item.key, item.value, item);\n const disabled = action.disabled?.(item.key, item.value, item) ?? false;\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n disabled={disabled}\n className={cn(\n \"inline-flex h-5 w-5 items-center justify-center rounded text-muted-foreground\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:opacity-35 disabled:hover:bg-transparent disabled:hover:text-muted-foreground\",\n )}\n onClick={(event) => {\n event.stopPropagation();\n action.onClick(item.key, item.value, item);\n }}\n >\n <Icon\n {...(typeof action.icon === \"string\" ? { name: action.icon } : { icon: action.icon })}\n className=\"text-xs\"\n />\n </button>\n );\n}\n\nfunction defaultRenderValue(value: unknown): ReactNode {\n if (value === null || value === undefined) {\n return <span className=\"font-mono italic text-muted-foreground\">null</span>;\n }\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return <span className=\"font-mono\">{String(value)}</span>;\n }\n try {\n return (\n <pre className=\"max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed\">\n {JSON.stringify(value, null, 2)}\n </pre>\n );\n } catch {\n return String(value);\n }\n}\n"],"names":["UiRows","UiListFlat","UiListDashes","useState","useEffect","jsx","jsxs","cn","formatPropertyLabel","Icon","DropdownMenu","IconButton","UiDotsVertical","UiCheck"],"mappings":";;;;;;;;;;;;;;AAmFA,MAAM,oCAAoC;AAE1C,MAAM,6BAID;AAAA,EACH,EAAE,OAAO,WAAW,OAAO,WAAW,MAAMA,OAAAA,OAAA;AAAA,EAC5C,EAAE,OAAO,eAAe,OAAO,eAAe,MAAMC,WAAAA,WAAA;AAAA,EACpD,EAAE,OAAO,YAAY,OAAO,YAAY,MAAMC,aAAAA,aAAA;AAChD;AAEA,MAAM,kBAGF;AAAA,EACF,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,EAAA;AAAA,EAEvB,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,EAAA;AAAA,EAEvB,SAAS;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,EAAA;AAEzB;AAEO,SAAS,WAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,kBAAkB;AAAA,EAClB,eAAe;AACjB,GAAuB;AACrB,QAAM,CAAC,iBAAiB,kBAAkB,IAAIC,eAAA;AAC9CC,QAAAA,UAAU,MAAM,mBAAmB,kBAAkB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;AAEvE,QAAM,UAAU,MAAM,OAAO,CAAC,SAAS,CAAC,KAAK,MAAM;AAEnD,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAOC,2BAAAA,IAAC,OAAA,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BAAA;AACN,eAAO,QAAQ,KAAK,KAAK,KAAK,OAAO,IAAI;AAAA,MAC3C;AAAA,MAEA,UAAAF,2BAAAA;AAAAA,QAACI,KAAAA;AAAAA,QAAA;AAAA,UACE,GAAI,OAAO,OAAO,SAAS,WAAW,EAAE,MAAM,OAAO,SAAS,EAAE,MAAM,OAAO,KAAA;AAAA,UAC9E,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA;AAGN;AAEA,SAAS,mBAAmB,OAA2B;AACrD,MAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,WAAOJ,2BAAAA,IAAC,QAAA,EAAK,WAAU,0CAAyC,UAAA,QAAI;AAAA,EACtE;AACA,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;AAC3D,0CAAQ,QAAA,EAAK,WAAU,aAAa,UAAA,OAAO,KAAK,GAAE;AAAA,EACpD;AACA,MAAI;AACF,WACEA,+BAAC,SAAI,WAAU,gGACZ,eAAK,UAAU,OAAO,MAAM,CAAC,EAAA,CAChC;AAAA,EAEJ,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;;"}
|
|
1
|
+
{"version":3,"file":"Properties.cjs","sources":["../../src/data/Properties.tsx"],"sourcesContent":["import {\n Fragment,\n useContext,\n useEffect,\n useState,\n type ReactNode,\n} from \"react\";\nimport { IconButton } from \"../components/IconButton\";\nimport {\n UiCheck,\n UiDotsVertical,\n UiListDashes,\n UiListFlat,\n UiRows,\n} from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport { DropdownMenu } from \"../overlay/DropdownMenu\";\nimport { Icon, type StaticIconComponent } from \"./Icon\";\nimport { formatPropertyLabel } from \"./properties-utils\";\nimport { PropertiesContext } from \"./properties-context\";\n\nexport type PropertiesAction<V = unknown> = {\n /** Stable action id. */\n id: string;\n /** Iconify name or imported icon component. */\n icon: string | StaticIconComponent;\n /** Accessible label and tooltip for this row action. */\n label: (key: string, value: V, item: PropertiesItem<V>) => string;\n /** Return false to hide the action for a specific row. */\n visible?: (key: string, value: V, item: PropertiesItem<V>) => boolean;\n /** Return true to disable the action for a specific row. */\n disabled?: (key: string, value: V, item: PropertiesItem<V>) => boolean;\n /** Called when the row action is clicked. */\n onClick: (key: string, value: V, item: PropertiesItem<V>) => void;\n};\n\nexport type PropertiesItem<V = unknown> = {\n /** Stable property key. Also used as the default label. */\n key: string;\n /** Property value passed to renderers and actions. */\n value: V;\n /** Secondary text shown below the label. */\n subtitle?: ReactNode;\n /** Hide this row without removing it from the item array. */\n hidden?: boolean;\n /** Enables a child area spanning both columns, with nested labels indented. */\n expandable?: boolean;\n /** Controlled expanded state. */\n expanded?: boolean;\n /** Called when an expandable row is toggled. */\n onToggle?: (next: boolean) => void;\n /** Child content rendered when the row is expanded. */\n renderChildren?: () => ReactNode;\n};\n\nexport type PropertiesDensity = \"comfortable\" | \"compact\" | \"spacious\";\n\nexport type PropertiesProps<V = unknown> = {\n /** Property rows to render. Hidden items are filtered out. */\n items: PropertiesItem<V>[];\n /** Custom label renderer. */\n renderLabel?: (key: string, value: V, item: PropertiesItem<V>) => ReactNode;\n /** Custom value renderer. */\n renderValue?: (key: string, value: V, item: PropertiesItem<V>) => ReactNode;\n /** Static icon name or function that returns an icon name per row. */\n labelIcon?:\n | string\n | ((key: string, value: V, item: PropertiesItem<V>) => string | undefined);\n /** Actions rendered before the value. */\n prefixActions?: PropertiesAction<V>[];\n /** Actions rendered after the value. */\n suffixActions?: PropertiesAction<V>[];\n /** Classes applied to the list root. */\n className?: string;\n /** Classes applied to each row. */\n rowClassName?: string;\n /** CSS grid columns applied to each row. Defaults to the selected density preset. */\n gridTemplateColumns?: string;\n /** Classes applied to each label cell. */\n labelClassName?: string;\n /** Classes applied to each value cell. */\n valueClassName?: string;\n /** Row density preset. */\n density?: PropertiesDensity;\n /** Stable reference used to persist this instance's density preference. */\n keyRef?: string;\n /** Show the display-options menu. */\n showDensityMenu?: boolean;\n /** Empty-state content when no rows are visible. */\n emptyMessage?: ReactNode;\n};\n\nconst PROPERTIES_DENSITY_STORAGE_PREFIX = \"clicky-ui-properties\";\n\nconst PROPERTIES_DENSITY_OPTIONS: Array<{\n value: PropertiesDensity;\n label: string;\n icon: StaticIconComponent;\n}> = [\n { value: \"compact\", label: \"Compact\", icon: UiRows },\n { value: \"comfortable\", label: \"Comfortable\", icon: UiListFlat },\n { value: \"spacious\", label: \"Spacious\", icon: UiListDashes },\n];\n\nconst DENSITY_CLASSES: Record<\n PropertiesDensity,\n { row: string; label: string; value: string; gridTemplateColumns: string }\n> = {\n spacious: {\n row: \"px-density-4 py-density-3\",\n label: \"text-sm font-medium text-muted-foreground\",\n value: \"text-base text-foreground\",\n gridTemplateColumns: \"minmax(12rem, 20rem) minmax(0, 1fr)\",\n },\n comfortable: {\n row: \"px-density-3 py-density-2\",\n label: \"text-xs font-medium text-muted-foreground\",\n value: \"text-sm text-foreground\",\n gridTemplateColumns: \"minmax(7rem, 12rem) minmax(0, 1fr)\",\n },\n compact: {\n row: \"px-density-2 py-density-1.5\",\n label: \"font-mono text-[11px] text-muted-foreground\",\n value: \"text-xs text-foreground\",\n gridTemplateColumns: \"minmax(8rem, 14rem) minmax(0, 1fr)\",\n },\n};\n\nexport function Properties<V = unknown>({\n items,\n renderLabel,\n renderValue,\n labelIcon,\n prefixActions,\n suffixActions,\n className,\n rowClassName,\n gridTemplateColumns,\n labelClassName,\n valueClassName,\n density = \"comfortable\",\n keyRef,\n showDensityMenu = true,\n emptyMessage = \"No properties\",\n}: PropertiesProps<V>) {\n const parent = useContext(PropertiesContext);\n const [densityOverride, setDensityOverride] = useState<PropertiesDensity>();\n useEffect(() => setDensityOverride(readStoredDensity(keyRef)), [keyRef]);\n\n const visible = items.filter((item) => !item.hidden);\n\n if (visible.length === 0) {\n return <div className=\"text-sm text-muted-foreground\">{emptyMessage}</div>;\n }\n\n const activeDensity = parent?.density ?? densityOverride ?? density;\n const styles = DENSITY_CLASSES[activeDensity];\n const columns =\n parent?.columns ?? gridTemplateColumns ?? styles.gridTemplateColumns;\n const depth = parent?.depth ?? 0;\n\n const updateDensity = (next: PropertiesDensity) => {\n setDensityOverride(next);\n writeStoredDensity(keyRef, next);\n };\n\n return (\n <dl\n className={cn(\n \"grid gap-x-density-3 divide-y divide-border rounded-md border border-border bg-muted/20\",\n parent && \"col-span-full rounded-none border-0 bg-transparent\",\n className,\n )}\n style={{ gridTemplateColumns: parent ? \"subgrid\" : columns }}\n >\n {showDensityMenu && !parent ? (\n <div className=\"col-span-full flex items-center justify-end px-density-2 py-density-1\">\n <dt className=\"sr-only\">Properties display options</dt>\n <dd>\n <PropertiesDensityMenu\n density={activeDensity}\n onChange={updateDensity}\n />\n </dd>\n </div>\n ) : null}\n {visible.map((item) => {\n const iconName =\n typeof labelIcon === \"function\"\n ? labelIcon(item.key, item.value, item)\n : labelIcon;\n const renderedLabel = renderLabel\n ? renderLabel(item.key, item.value, item)\n : formatPropertyLabel(item.key);\n const ariaLabel =\n typeof renderedLabel === \"string\" ? renderedLabel : item.key;\n\n return (\n <Fragment key={item.key}>\n <div\n className={cn(\n \"col-span-full grid min-w-0 grid-cols-subgrid gap-density-3\",\n styles.row,\n rowClassName,\n )}\n >\n <dt\n aria-label={ariaLabel}\n className={cn(\"min-w-0 truncate\", styles.label, labelClassName)}\n style={{ paddingInlineStart: depth * 16 }}\n >\n <div className=\"flex min-w-0 items-center gap-density-1\">\n {iconName ? (\n <Icon name={iconName} className=\"text-xs shrink-0\" />\n ) : null}\n <span className=\"min-w-0 truncate\">{renderedLabel}</span>\n </div>\n {item.subtitle ? (\n <div className=\"mt-0.5 text-[10px] font-normal text-muted-foreground/80\">\n {item.subtitle}\n </div>\n ) : null}\n </dt>\n <dd className={cn(\"min-w-0 space-y-density-1\", valueClassName)}>\n <div className=\"flex min-w-0 items-start gap-density-1\">\n <ActionList\n actions={prefixActions}\n item={item}\n className=\"shrink-0 pt-0.5\"\n />\n <div\n className={cn(\"min-w-0 max-w-full flex-1\", styles.value)}\n >\n {renderValue\n ? renderValue(item.key, item.value, item)\n : defaultRenderValue(item.value)}\n </div>\n <ActionList\n actions={suffixActions}\n item={item}\n className=\"shrink-0 pt-0.5\"\n />\n </div>\n </dd>\n </div>\n {item.expandable && item.expanded && item.renderChildren ? (\n <div className=\"col-span-full grid grid-cols-subgrid\">\n <dt className=\"sr-only\">{ariaLabel} properties</dt>\n <dd className=\"col-span-full grid min-w-0 grid-cols-subgrid\">\n <PropertiesContext.Provider\n value={{\n depth: depth + 1,\n columns,\n density: activeDensity,\n }}\n >\n {item.renderChildren()}\n </PropertiesContext.Provider>\n </dd>\n </div>\n ) : null}\n </Fragment>\n );\n })}\n </dl>\n );\n}\n\nfunction PropertiesDensityMenu({\n density,\n onChange,\n}: {\n density: PropertiesDensity;\n onChange: (density: PropertiesDensity) => void;\n}) {\n return (\n <DropdownMenu\n align=\"right\"\n menuLabel=\"Properties options\"\n trigger={\n <IconButton\n icon={UiDotsVertical}\n label=\"Properties options\"\n className=\"h-6 w-6\"\n />\n }\n >\n {(closeMenu) => (\n <div className=\"min-w-44 py-1 text-popover-foreground\">\n <div className=\"px-2 py-1 text-xs font-medium text-muted-foreground\">\n Density\n </div>\n {PROPERTIES_DENSITY_OPTIONS.map((option) => {\n const active = density === option.value;\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={active}\n className={densityMenuItemClassName(active)}\n onClick={() => {\n onChange(option.value);\n closeMenu();\n }}\n >\n <Icon\n icon={option.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n {active ? (\n <Icon icon={UiCheck} className=\"text-sm text-foreground\" />\n ) : (\n <span className=\"inline-block h-4 w-4\" aria-hidden />\n )}\n </button>\n );\n })}\n </div>\n )}\n </DropdownMenu>\n );\n}\n\nfunction densityMenuItemClassName(active: boolean): string {\n return cn(\n \"flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm\",\n \"hover:bg-accent focus:bg-accent focus:outline-none\",\n active && \"bg-accent/60\",\n );\n}\n\nfunction readStoredDensity(\n keyRef: string | undefined,\n): PropertiesDensity | undefined {\n const storageKey = propertiesDensityStorageKey(keyRef);\n if (!storageKey || typeof window === \"undefined\") return undefined;\n\n try {\n const value = window.localStorage.getItem(storageKey);\n return isPropertiesDensity(value) ? value : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredDensity(\n keyRef: string | undefined,\n density: PropertiesDensity,\n): void {\n const storageKey = propertiesDensityStorageKey(keyRef);\n if (!storageKey || typeof window === \"undefined\") return;\n\n try {\n window.localStorage.setItem(storageKey, density);\n } catch {\n // Display preferences are best-effort when browser storage is unavailable.\n }\n}\n\nfunction propertiesDensityStorageKey(\n keyRef: string | undefined,\n): string | undefined {\n const normalized = keyRef?.trim();\n return normalized\n ? `${PROPERTIES_DENSITY_STORAGE_PREFIX}:${normalized}:density`\n : undefined;\n}\n\nfunction isPropertiesDensity(value: unknown): value is PropertiesDensity {\n return value === \"compact\" || value === \"comfortable\" || value === \"spacious\";\n}\n\nfunction ActionList<V>({\n actions,\n item,\n className,\n}: {\n actions: PropertiesAction<V>[] | undefined;\n item: PropertiesItem<V>;\n className?: string;\n}) {\n if (!actions || actions.length === 0) return null;\n const rendered = actions.filter(\n (action) => !action.visible || action.visible(item.key, item.value, item),\n );\n if (rendered.length === 0) return null;\n return (\n <span className={cn(\"inline-flex items-center\", className)}>\n {rendered.map((action) => (\n <PropertiesActionButton key={action.id} action={action} item={item} />\n ))}\n </span>\n );\n}\n\nfunction PropertiesActionButton<V>({\n action,\n item,\n}: {\n action: PropertiesAction<V>;\n item: PropertiesItem<V>;\n}) {\n const label = action.label(item.key, item.value, item);\n const disabled = action.disabled?.(item.key, item.value, item) ?? false;\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n disabled={disabled}\n className={cn(\n \"inline-flex h-5 w-5 items-center justify-center rounded text-muted-foreground\",\n \"hover:bg-accent hover:text-foreground\",\n \"disabled:opacity-35 disabled:hover:bg-transparent disabled:hover:text-muted-foreground\",\n )}\n onClick={(event) => {\n event.stopPropagation();\n action.onClick(item.key, item.value, item);\n }}\n >\n <Icon\n {...(typeof action.icon === \"string\"\n ? { name: action.icon }\n : { icon: action.icon })}\n className=\"text-xs\"\n />\n </button>\n );\n}\n\nfunction defaultRenderValue(value: unknown): ReactNode {\n if (value === null || value === undefined) {\n return <span className=\"font-mono italic text-muted-foreground\">null</span>;\n }\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return <span className=\"font-mono\">{String(value)}</span>;\n }\n try {\n return (\n <pre className=\"max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-relaxed\">\n {JSON.stringify(value, null, 2)}\n </pre>\n );\n } catch {\n return String(value);\n }\n}\n"],"names":["UiRows","UiListFlat","UiListDashes","useContext","PropertiesContext","useState","useEffect","jsx","jsxs","cn","formatPropertyLabel","Fragment","Icon","DropdownMenu","IconButton","UiDotsVertical","UiCheck"],"mappings":";;;;;;;;;;;;;;;AA4FA,MAAM,oCAAoC;AAE1C,MAAM,6BAID;AAAA,EACH,EAAE,OAAO,WAAW,OAAO,WAAW,MAAMA,OAAAA,OAAA;AAAA,EAC5C,EAAE,OAAO,eAAe,OAAO,eAAe,MAAMC,WAAAA,WAAA;AAAA,EACpD,EAAE,OAAO,YAAY,OAAO,YAAY,MAAMC,aAAAA,aAAA;AAChD;AAEA,MAAM,kBAGF;AAAA,EACF,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,EAAA;AAAA,EAEvB,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,EAAA;AAAA,EAEvB,SAAS;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,qBAAqB;AAAA,E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MACC,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,OAAO;AAAA,MACP;AAAA,MACA,WAAWE,MAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAEF,SAAS,CAAC,UAAU;AAClB,cAAM,gBAAA;AACN,eAAO,QAAQ,KAAK,KAAK,KAAK,OAAO,IAAI;AAAA,MAC3C;AAAA,MAEA,UAAAF,2BAAAA;AAAAA,QAACK,KAAAA;AAAAA,QAAA;AAAA,UACE,GAAI,OAAO,OAAO,SAAS,WACxB,EAAE,MAAM,OAAO,SACf,EAAE,MAAM,OAAO,KAAA;AAAA,UACnB,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ;AAAA,EAAA;AAGN;AAEA,SAAS,mBAAmB,OAA2B;AACrD,MAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,WAAOL,2BAAAA,IAAC,QAAA,EAAK,WAAU,0CAAyC,UAAA,QAAI;AAAA,EACtE;AACA,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;AAC3D,0CAAQ,QAAA,EAAK,WAAU,aAAa,UAAA,OAAO,KAAK,GAAE;AAAA,EACpD;AACA,MAAI;AACF,WACEA,+BAAC,SAAI,WAAU,gGACZ,eAAK,UAAU,OAAO,MAAM,CAAC,EAAA,CAChC;AAAA,EAEJ,QAAQ;AACN,WAAO,OAAO,KAAK;AAAA,EACrB;AACF;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from '
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { StaticIconComponent } from './Icon';
|
|
3
3
|
export type PropertiesAction<V = unknown> = {
|
|
4
4
|
/** Stable action id. */
|
|
@@ -23,7 +23,7 @@ export type PropertiesItem<V = unknown> = {
|
|
|
23
23
|
subtitle?: ReactNode;
|
|
24
24
|
/** Hide this row without removing it from the item array. */
|
|
25
25
|
hidden?: boolean;
|
|
26
|
-
/** Enables
|
|
26
|
+
/** Enables a child area spanning both columns, with nested labels indented. */
|
|
27
27
|
expandable?: boolean;
|
|
28
28
|
/** Controlled expanded state. */
|
|
29
29
|
expanded?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../src/data/Properties.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../src/data/Properties.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAWf,OAAO,EAAQ,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAIxD,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC1C,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACnC,wDAAwD;IACxD,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IAClE,0DAA0D;IAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACtE,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACvE,6CAA6C;IAC7C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,G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ACxC,aAAa,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACtC,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oDAAoD;IACpD,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAsCF,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,EACtC,KAAK,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,OAAuB,EACvB,MAAM,EACN,eAAsB,EACtB,YAA8B,GAC/B,EAAE,eAAe,CAAC,CAAC,CAAC,+BA0HpB"}
|
package/dist/data/Properties.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
2
|
+
import { useContext, useState, useEffect, Fragment } from "react";
|
|
3
3
|
import { IconButton } from "../components/IconButton.js";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
import { DropdownMenu } from "../overlay/DropdownMenu.js";
|
|
6
6
|
import { Icon } from "./Icon.js";
|
|
7
7
|
import { formatPropertyLabel } from "./properties-utils.js";
|
|
8
|
+
import { PropertiesContext } from "./properties-context.js";
|
|
8
9
|
import { UiRows } from "../icons/components/UiRows.js";
|
|
9
10
|
import { UiListFlat } from "../icons/components/UiListFlat.js";
|
|
10
11
|
import { UiListDashes } from "../icons/components/UiListDashes.js";
|
|
@@ -53,14 +54,17 @@ function Properties({
|
|
|
53
54
|
showDensityMenu = true,
|
|
54
55
|
emptyMessage = "No properties"
|
|
55
56
|
}) {
|
|
57
|
+
const parent = useContext(PropertiesContext);
|
|
56
58
|
const [densityOverride, setDensityOverride] = useState();
|
|
57
59
|
useEffect(() => setDensityOverride(readStoredDensity(keyRef)), [keyRef]);
|
|
58
60
|
const visible = items.filter((item) => !item.hidden);
|
|
59
61
|
if (visible.length === 0) {
|
|
60
62
|
return /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: emptyMessage });
|
|
61
63
|
}
|
|
62
|
-
const activeDensity = densityOverride ?? density;
|
|
64
|
+
const activeDensity = (parent == null ? void 0 : parent.density) ?? densityOverride ?? density;
|
|
63
65
|
const styles = DENSITY_CLASSES[activeDensity];
|
|
66
|
+
const columns = (parent == null ? void 0 : parent.columns) ?? gridTemplateColumns ?? styles.gridTemplateColumns;
|
|
67
|
+
const depth = (parent == null ? void 0 : parent.depth) ?? 0;
|
|
64
68
|
const updateDensity = (next) => {
|
|
65
69
|
setDensityOverride(next);
|
|
66
70
|
writeStoredDensity(keyRef, next);
|
|
@@ -69,50 +73,97 @@ function Properties({
|
|
|
69
73
|
"dl",
|
|
70
74
|
{
|
|
71
75
|
className: cn(
|
|
72
|
-
"divide-y divide-border rounded-md border border-border bg-muted/20",
|
|
76
|
+
"grid gap-x-density-3 divide-y divide-border rounded-md border border-border bg-muted/20",
|
|
77
|
+
parent && "col-span-full rounded-none border-0 bg-transparent",
|
|
73
78
|
className
|
|
74
79
|
),
|
|
80
|
+
style: { gridTemplateColumns: parent ? "subgrid" : columns },
|
|
75
81
|
children: [
|
|
76
|
-
showDensityMenu ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end px-density-2 py-density-1", children: [
|
|
82
|
+
showDensityMenu && !parent ? /* @__PURE__ */ jsxs("div", { className: "col-span-full flex items-center justify-end px-density-2 py-density-1", children: [
|
|
77
83
|
/* @__PURE__ */ jsx("dt", { className: "sr-only", children: "Properties display options" }),
|
|
78
|
-
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(
|
|
84
|
+
/* @__PURE__ */ jsx("dd", { children: /* @__PURE__ */ jsx(
|
|
85
|
+
PropertiesDensityMenu,
|
|
86
|
+
{
|
|
87
|
+
density: activeDensity,
|
|
88
|
+
onChange: updateDensity
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
79
91
|
] }) : null,
|
|
80
92
|
visible.map((item) => {
|
|
81
93
|
const iconName = typeof labelIcon === "function" ? labelIcon(item.key, item.value, item) : labelIcon;
|
|
82
94
|
const renderedLabel = renderLabel ? renderLabel(item.key, item.value, item) : formatPropertyLabel(item.key);
|
|
83
95
|
const ariaLabel = typeof renderedLabel === "string" ? renderedLabel : item.key;
|
|
84
|
-
return /* @__PURE__ */ jsxs(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{
|
|
93
|
-
"aria-label": ariaLabel,
|
|
94
|
-
className: cn("min-w-0 truncate", styles.label, labelClassName),
|
|
95
|
-
children: [
|
|
96
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-density-1", children: [
|
|
97
|
-
iconName ? /* @__PURE__ */ jsx(Icon, { name: iconName, className: "text-xs shrink-0" }) : null,
|
|
98
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: renderedLabel })
|
|
99
|
-
] }),
|
|
100
|
-
item.subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[10px] font-normal text-muted-foreground/80", children: item.subtitle }) : null
|
|
101
|
-
]
|
|
102
|
-
}
|
|
96
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
|
+
/* @__PURE__ */ jsxs(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: cn(
|
|
101
|
+
"col-span-full grid min-w-0 grid-cols-subgrid gap-density-3",
|
|
102
|
+
styles.row,
|
|
103
|
+
rowClassName
|
|
103
104
|
),
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */ jsxs(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsxs(
|
|
107
|
+
"dt",
|
|
108
|
+
{
|
|
109
|
+
"aria-label": ariaLabel,
|
|
110
|
+
className: cn("min-w-0 truncate", styles.label, labelClassName),
|
|
111
|
+
style: { paddingInlineStart: depth * 16 },
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-density-1", children: [
|
|
114
|
+
iconName ? /* @__PURE__ */ jsx(Icon, { name: iconName, className: "text-xs shrink-0" }) : null,
|
|
115
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: renderedLabel })
|
|
116
|
+
] }),
|
|
117
|
+
item.subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[10px] font-normal text-muted-foreground/80", children: item.subtitle }) : null
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx("dd", { className: cn("min-w-0 space-y-density-1", valueClassName), children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-start gap-density-1", children: [
|
|
122
|
+
/* @__PURE__ */ jsx(
|
|
123
|
+
ActionList,
|
|
124
|
+
{
|
|
125
|
+
actions: prefixActions,
|
|
126
|
+
item,
|
|
127
|
+
className: "shrink-0 pt-0.5"
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: cn("min-w-0 max-w-full flex-1", styles.value),
|
|
134
|
+
children: renderValue ? renderValue(item.key, item.value, item) : defaultRenderValue(item.value)
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsx(
|
|
138
|
+
ActionList,
|
|
139
|
+
{
|
|
140
|
+
actions: suffixActions,
|
|
141
|
+
item,
|
|
142
|
+
className: "shrink-0 pt-0.5"
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
] }) })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
item.expandable && item.expanded && item.renderChildren ? /* @__PURE__ */ jsxs("div", { className: "col-span-full grid grid-cols-subgrid", children: [
|
|
150
|
+
/* @__PURE__ */ jsxs("dt", { className: "sr-only", children: [
|
|
151
|
+
ariaLabel,
|
|
152
|
+
" properties"
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsx("dd", { className: "col-span-full grid min-w-0 grid-cols-subgrid", children: /* @__PURE__ */ jsx(
|
|
155
|
+
PropertiesContext.Provider,
|
|
156
|
+
{
|
|
157
|
+
value: {
|
|
158
|
+
depth: depth + 1,
|
|
159
|
+
columns,
|
|
160
|
+
density: activeDensity
|
|
161
|
+
},
|
|
162
|
+
children: item.renderChildren()
|
|
163
|
+
}
|
|
164
|
+
) })
|
|
165
|
+
] }) : null
|
|
166
|
+
] }, item.key);
|
|
116
167
|
})
|
|
117
168
|
]
|
|
118
169
|
}
|