@dcs-tech/ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -6
- package/dist/ChartImageMenu-HILSfn5A.js +1115 -0
- package/dist/ChartView-Cehrcr05.js +1703 -0
- package/dist/SummaryChart-y27q_BBN.js +29 -0
- package/dist/SummaryImage-DDNEEu_K.js +18 -0
- package/dist/SummarySeeAll-0dX-_LFe.js +101 -0
- package/dist/defaults-DL745PK1.js +708 -0
- package/dist/exportContext-CdpsOzE8.js +235 -0
- package/dist/exportEngine-DL-jEXFU.js +890 -0
- package/dist/geometry-CG2nOEnw.js +1796 -0
- package/dist/index.js +23238 -15993
- package/dist/scrollArea-CkPGDYH2.js +210 -0
- package/dist/style.css +1 -1
- package/dist/summaryChartData-Djo73zb8.js +81 -0
- package/dist/types/components/AppBar/AppBar.d.ts +16 -0
- package/dist/types/components/ArrowKeyFocus/useArrowKeyFocus.d.ts +10 -0
- package/dist/types/components/Avatar/Avatar.d.ts +22 -0
- package/dist/types/{shared-web-ui/src → components}/Badge/Badge.d.ts +0 -11
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
- package/dist/types/{shared-web-ui/src → components}/Button/Button.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/index.d.ts +1 -1
- package/dist/types/components/Card/Card.d.ts +17 -0
- package/dist/types/components/Charts/AnchoredMenu.d.ts +17 -0
- package/dist/types/components/Charts/BarList.d.ts +12 -0
- package/dist/types/components/Charts/CalendarHeatmap.d.ts +17 -0
- package/dist/types/components/Charts/Chart.d.ts +20 -0
- package/dist/types/components/Charts/ChartIcon.d.ts +5 -0
- package/dist/types/components/Charts/ChartImageMenu.d.ts +4 -0
- package/dist/types/components/Charts/ChartTable.d.ts +8 -0
- package/dist/types/components/Charts/ChartTooltip.d.ts +58 -0
- package/dist/types/components/Charts/ChartView.d.ts +15 -0
- package/dist/types/components/Charts/ColumnChart.d.ts +15 -0
- package/dist/types/components/Charts/Donut.d.ts +14 -0
- package/dist/types/components/Charts/Funnel.d.ts +10 -0
- package/dist/types/components/Charts/Gauge.d.ts +15 -0
- package/dist/types/components/Charts/Legend.d.ts +6 -0
- package/dist/types/components/Charts/LineChart.d.ts +13 -0
- package/dist/types/components/Charts/NumberTrend.d.ts +21 -0
- package/dist/types/components/Charts/Progress.d.ts +12 -0
- package/dist/types/components/Charts/StackedBar.d.ts +11 -0
- package/dist/types/components/Charts/Treemap.d.ts +12 -0
- package/dist/types/components/Charts/chartData.d.ts +69 -0
- package/dist/types/components/Charts/chartImage.d.ts +121 -0
- package/dist/types/components/Charts/geometry.d.ts +180 -0
- package/dist/types/components/Charts/index.d.ts +32 -0
- package/dist/types/components/Charts/labels.d.ts +46 -0
- package/dist/types/components/Charts/menuPlacement.d.ts +25 -0
- package/dist/types/components/Charts/palette.d.ts +81 -0
- package/dist/types/components/Charts/parts.d.ts +25 -0
- package/dist/types/components/Charts/pointer.d.ts +41 -0
- package/dist/types/components/Charts/types.d.ts +51 -0
- package/dist/types/components/Charts/ui.d.ts +3 -0
- package/dist/types/components/Charts/useBoxSize.d.ts +6 -0
- package/dist/types/components/Charts/useLegendFit.d.ts +1 -0
- package/dist/types/components/Charts/useUiScale.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/ChipInput.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/ChipInput/useChipSuggestions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/Collapsible.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleItem.d.ts +1 -3
- package/dist/types/{shared-web-ui/src → components}/Collapsible/index.d.ts +1 -1
- package/dist/types/components/ColorSchemeSelect/ColorSchemeSelect.d.ts +11 -0
- package/dist/types/components/CommandPalette/CommandPalette.d.ts +25 -0
- package/dist/types/components/DataTable/DataTable.d.ts +16 -0
- package/dist/types/components/DataTable/DataTable.storyData.d.ts +23 -0
- package/dist/types/components/DataTable/DisplayPopover.d.ts +22 -0
- package/dist/types/components/DataTable/HeaderMenu.d.ts +31 -0
- package/dist/types/components/DataTable/ManageModal.d.ts +31 -0
- package/dist/types/components/DataTable/PressButton.d.ts +2 -0
- package/dist/types/components/DataTable/SingleRowView.d.ts +9 -0
- package/dist/types/components/DataTable/SortModal.d.ts +16 -0
- package/dist/types/components/DataTable/StatusRow.d.ts +49 -0
- package/dist/types/components/DataTable/TableColumnModal.d.ts +18 -0
- package/dist/types/components/DataTable/TableControls.d.ts +48 -0
- package/dist/types/components/DataTable/TablePagination.d.ts +38 -0
- package/dist/types/components/DataTable/TableScrollStrip.d.ts +2 -0
- package/dist/types/components/DataTable/TableToolbar.d.ts +69 -0
- package/dist/types/components/DataTable/TableView.d.ts +61 -0
- package/dist/types/components/DataTable/bulk/BulkConfirmDialog.d.ts +13 -0
- package/dist/types/components/DataTable/bulk/TableToast.d.ts +13 -0
- package/dist/types/components/DataTable/bulk/bulkActions.d.ts +23 -0
- package/dist/types/components/DataTable/cards/CardFieldsEditor.d.ts +16 -0
- package/dist/types/components/DataTable/cards/CardView.d.ts +50 -0
- package/dist/types/components/DataTable/cards/cardFields.d.ts +32 -0
- package/dist/types/components/DataTable/cards/rowParts.d.ts +38 -0
- package/dist/types/components/DataTable/data/useServerData.d.ts +28 -0
- package/dist/types/components/DataTable/defaults.d.ts +18 -0
- package/dist/types/components/DataTable/detail/BuiltInDetail.d.ts +10 -0
- package/dist/types/components/DataTable/detail/DetailHost.d.ts +13 -0
- package/dist/types/components/DataTable/export/ExportPopover.d.ts +18 -0
- package/dist/types/components/DataTable/export/ExportPreviewModal.d.ts +11 -0
- package/dist/types/components/DataTable/export/ExportSettingsModal.d.ts +31 -0
- package/dist/types/components/DataTable/export/ExportTemplateCards.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportContext.d.ts +10 -0
- package/dist/types/components/DataTable/export/exportEngine.d.ts +77 -0
- package/dist/types/components/DataTable/export/exportRows.d.ts +10 -0
- package/dist/types/components/DataTable/export/templateDisplay.d.ts +7 -0
- package/dist/types/components/DataTable/export/templateOptions.d.ts +6 -0
- package/dist/types/components/DataTable/export/useTableExport.d.ts +53 -0
- package/dist/types/components/DataTable/filters/ColumnFilterPopover.d.ts +14 -0
- package/dist/types/components/DataTable/filters/FilterChips.d.ts +9 -0
- package/dist/types/components/DataTable/filters/FilterConditionRow.d.ts +11 -0
- package/dist/types/components/DataTable/filters/FilterGroup.d.ts +12 -0
- package/dist/types/components/DataTable/filters/FilterModal.d.ts +14 -0
- package/dist/types/components/DataTable/filters/FilterRow.d.ts +20 -0
- package/dist/types/components/DataTable/filters/columnFilterModel.d.ts +29 -0
- package/dist/types/components/DataTable/filters/filterEngine.d.ts +16 -0
- package/dist/types/components/DataTable/filters/filterRowModel.d.ts +28 -0
- package/dist/types/components/DataTable/filters/quickFilterMatch.d.ts +3 -0
- package/dist/types/components/DataTable/grouping/GroupUi.d.ts +36 -0
- package/dist/types/components/DataTable/grouping/groupModel.d.ts +82 -0
- package/dist/types/components/DataTable/grouping/useGrouping.d.ts +39 -0
- package/dist/types/components/DataTable/host.d.ts +14 -0
- package/dist/types/components/DataTable/index.d.ts +18 -0
- package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +14 -0
- package/dist/types/components/DataTable/keyboard/shortcuts.d.ts +22 -0
- package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +48 -0
- package/dist/types/components/DataTable/labels.d.ts +618 -0
- package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +9 -0
- package/dist/types/components/DataTable/layout/layouts.d.ts +20 -0
- package/dist/types/components/DataTable/layout/scrollArea.d.ts +2 -0
- package/dist/types/components/DataTable/layout/useFillHeight.d.ts +11 -0
- package/dist/types/components/DataTable/menu/RowMenu.d.ts +56 -0
- package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +35 -0
- package/dist/types/components/DataTable/menu/clipboard.d.ts +4 -0
- package/dist/types/components/DataTable/menu/layers.d.ts +1 -0
- package/dist/types/components/DataTable/menu/valueFilter.d.ts +15 -0
- package/dist/types/components/DataTable/motion/useRowMotion.d.ts +32 -0
- package/dist/types/components/DataTable/persistence/adapters.d.ts +6 -0
- package/dist/types/components/DataTable/persistence/reconcile.d.ts +64 -0
- package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +51 -0
- package/dist/types/components/DataTable/persistence/useManagePrefs.d.ts +23 -0
- package/dist/types/components/DataTable/persistence/useOrphanPrefs.d.ts +3 -0
- package/dist/types/components/DataTable/pinning.d.ts +10 -0
- package/dist/types/components/DataTable/rows/PressRow.d.ts +7 -0
- package/dist/types/components/DataTable/rows/RowActions.d.ts +15 -0
- package/dist/types/components/DataTable/rows/rowPress.d.ts +35 -0
- package/dist/types/components/DataTable/sharing/Sharing.d.ts +21 -0
- package/dist/types/components/DataTable/split/SplitView.d.ts +29 -0
- package/dist/types/components/DataTable/summary/ManageSummaryCards.d.ts +18 -0
- package/dist/types/components/DataTable/summary/SummaryChart.d.ts +11 -0
- package/dist/types/components/DataTable/summary/SummaryControls.d.ts +33 -0
- package/dist/types/components/DataTable/summary/SummaryImage.d.ts +12 -0
- package/dist/types/components/DataTable/summary/SummarySeeAll.d.ts +17 -0
- package/dist/types/components/DataTable/summary/TableSummary.d.ts +34 -0
- package/dist/types/components/DataTable/summary/summaryCatalogue.d.ts +64 -0
- package/dist/types/components/DataTable/summary/summaryChartData.d.ts +9 -0
- package/dist/types/components/DataTable/summary/summaryModel.d.ts +152 -0
- package/dist/types/components/DataTable/summary/summaryWidth.d.ts +22 -0
- package/dist/types/components/DataTable/summary/useTableSummary.d.ts +18 -0
- package/dist/types/components/DataTable/types.d.ts +1145 -0
- package/dist/types/components/DataTable/ui-local/AutoHeight.d.ts +9 -0
- package/dist/types/components/DataTable/ui-local/DateRangePicker.d.ts +16 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +4 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +3 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +70 -0
- package/dist/types/components/DataTable/ui-local/ReactModal.d.ts +20 -0
- package/dist/types/components/DataTable/ui-local/scrollLock.d.ts +1 -0
- package/dist/types/components/DataTable/ui.d.ts +13 -0
- package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -0
- package/dist/types/components/DataTable/useTable.d.ts +12 -0
- package/dist/types/components/DataTable/vendor/columnOrder.d.ts +1 -0
- package/dist/types/components/DataTable/vendor/diff.d.ts +5 -0
- package/dist/types/components/DataTable/vendor/fileActions.d.ts +19 -0
- package/dist/types/components/DataTable/vendor/index.d.ts +3 -0
- package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +27 -0
- package/dist/types/components/DatePicker/Calendar.d.ts +14 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +5 -0
- package/dist/types/components/DatePicker/TimeField.d.ts +16 -0
- package/dist/types/components/DatePicker/index.d.ts +4 -0
- package/dist/types/components/DatePicker/useOneMonthPane.d.ts +2 -0
- package/dist/types/components/Dialog/Dialog.d.ts +56 -0
- package/dist/types/components/Dialog/DialogHost.d.ts +44 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +49 -0
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTable.d.ts +1 -6
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableActions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableCell.d.ts +2 -20
- package/dist/types/components/EditableTable/EditableTableRow.d.ts +14 -0
- package/dist/types/components/EditableTable/EditableTableSummary.d.ts +11 -0
- package/dist/types/{shared-web-ui/src → components}/EditableTable/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/useEditableTable.d.ts +3 -3
- package/dist/types/components/EditableTable/useRowAnimation.d.ts +12 -0
- package/dist/types/components/FieldContext/FieldContext.d.ts +3 -0
- package/dist/types/components/FieldContext/FieldProvider.d.ts +4 -0
- package/dist/types/{shared-web-ui/src → components}/FieldContext/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useField.d.ts +2 -29
- package/dist/types/components/FieldContext/useFieldSurface.d.ts +34 -0
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useFormKeyboard.d.ts +1 -4
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/FieldWrapper.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/Field.d.ts +1 -1
- package/dist/types/components/Fields/FieldButton.d.ts +17 -0
- package/dist/types/{shared-web-ui/src → components}/Fields/Fields.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldBlur.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldChange.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldCondition.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldDisabled.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldRender.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldSelect.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValidation.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValue.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/index.d.ts +1 -1
- package/dist/types/components/Floating/index.d.ts +3 -0
- package/dist/types/components/Floating/layers.d.ts +4 -0
- package/dist/types/components/Floating/scrollLock.d.ts +2 -0
- package/dist/types/components/Floating/useFloatingLayer.d.ts +20 -0
- package/dist/types/{shared-web-ui/src → components}/Form/Form.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Form/index.d.ts +1 -1
- package/dist/types/components/Image/ImagePicker.d.ts +23 -0
- package/dist/types/components/Image/ImageStrip.d.ts +13 -0
- package/dist/types/components/Image/ImageViewer.d.ts +16 -0
- package/dist/types/components/Image/index.d.ts +8 -0
- package/dist/types/components/Image/prepareImage.d.ts +19 -0
- package/dist/types/{shared-web-ui/src → components}/Input/Input.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Input/index.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +25 -0
- package/dist/types/components/Popover/floatingPosition.d.ts +17 -0
- package/dist/types/components/Press/index.d.ts +2 -0
- package/dist/types/components/Press/usePress.d.ts +9 -0
- package/dist/types/{shared-web-ui/src → components}/Radio/Radio.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/index.d.ts +1 -1
- package/dist/types/components/Scroll/ScrollRule.d.ts +2 -0
- package/dist/types/components/Scroll/ScrollStrip.d.ts +9 -0
- package/dist/types/components/Scroll/index.d.ts +4 -0
- package/dist/types/components/Scroll/labels.d.ts +5 -0
- package/dist/types/components/Scroll/scrollActivity.d.ts +14 -0
- package/dist/types/components/Scroll/ui.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Select/Select.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Select/index.d.ts +1 -1
- package/dist/types/components/Select/useSelect.d.ts +2 -0
- package/dist/types/components/Sidebar/Sidebar.d.ts +24 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/types/components/Stepper/Stepper.d.ts +17 -0
- package/dist/types/components/Stepper/index.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/Suggest/Suggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/SuggestionList.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/Suggest/searchFilters.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/useSuggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/Switch.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/index.d.ts +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts +36 -0
- package/dist/types/components/Toast/ToastHost.d.ts +8 -0
- package/dist/types/components/Toast/ToastItem.d.ts +10 -0
- package/dist/types/{shared-web-ui/src → components}/Toast/toast.types.d.ts +0 -13
- package/dist/types/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/types/components/Tooltip/useTooltip.d.ts +15 -0
- package/dist/types/{shared-web-ui/src → components}/Typography/Typography.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Typography/index.d.ts +1 -1
- package/dist/types/components/UIProvider/UIPortalContext.d.ts +2 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +13 -0
- package/dist/types/components/UIProvider/UIThemeContext.d.ts +9 -0
- package/dist/types/core/hooks/index.d.ts +3 -0
- package/dist/types/core/hooks/useDebounced.d.ts +7 -0
- package/dist/types/core/hooks/usePresence.d.ts +5 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/button.logic.d.ts +1 -1
- package/dist/types/core/logic/cellRules.logic.d.ts +32 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/chipinput.logic.d.ts +1 -13
- package/dist/types/{shared-logic/src/ui → core/logic}/collapsible.logic.d.ts +1 -8
- package/dist/types/{shared-logic/src/ui → core/logic}/colorScheme.d.ts +0 -14
- package/dist/types/core/logic/columnOrder.logic.d.ts +1 -0
- package/dist/types/core/logic/datePicker.logic.d.ts +136 -0
- package/dist/types/core/logic/displayOrder.logic.d.ts +4 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/editableTable.logic.d.ts +5 -28
- package/dist/types/core/logic/fieldControl.logic.d.ts +12 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/fieldWrapper.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/fields.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/form.logic.d.ts +0 -8
- package/dist/types/core/logic/index.d.ts +33 -0
- package/dist/types/core/logic/keyboard.logic.d.ts +12 -0
- package/dist/types/core/logic/motion.logic.d.ts +1 -0
- package/dist/types/core/logic/navigation.logic.d.ts +6 -0
- package/dist/types/core/logic/popover.logic.d.ts +59 -0
- package/dist/types/core/logic/popupList.logic.d.ts +19 -0
- package/dist/types/core/logic/press.logic.d.ts +14 -0
- package/dist/types/core/logic/quickAddGrid.logic.d.ts +183 -0
- package/dist/types/core/logic/select.logic.d.ts +17 -0
- package/dist/types/core/logic/stepper.logic.d.ts +6 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/suggest.logic.d.ts +1 -1
- package/dist/types/core/logic/tableLayout.logic.d.ts +13 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/tableSummary.logic.d.ts +1 -20
- package/dist/types/core/logic/timeField.logic.d.ts +26 -0
- package/dist/types/core/logic/tooltip.logic.d.ts +11 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/typography.logic.d.ts +1 -1
- package/dist/types/core/logic/uiScale.logic.d.ts +1 -0
- package/dist/types/core/logic/useMergeRefs.d.ts +2 -0
- package/dist/types/{shared-types/src/ui → core/types}/button.types.d.ts +1 -11
- package/dist/types/{shared-types/src/ui → core/types}/checkbox.types.d.ts +0 -4
- package/dist/types/{shared-types/src/ui → core/types}/chipinput.types.d.ts +0 -10
- package/dist/types/{shared-types/src/ui → core/types}/collapsible.types.d.ts +0 -18
- package/dist/types/core/types/common.types.d.ts +3 -0
- package/dist/types/core/types/control.types.d.ts +36 -0
- package/dist/types/core/types/datePicker.types.d.ts +46 -0
- package/dist/types/{shared-types/src/ui → core/types}/editableTable.types.d.ts +0 -79
- package/dist/types/core/types/field.types.d.ts +80 -0
- package/dist/types/{shared-types/src/ui → core/types}/fieldWrapper.types.d.ts +0 -10
- package/dist/types/{shared-types/src/ui → core/types}/fields.types.d.ts +0 -45
- package/dist/types/{shared-types/src/ui → core/types}/form.types.d.ts +0 -30
- package/dist/types/core/types/index.d.ts +22 -0
- package/dist/types/{shared-types/src/ui → core/types}/input.types.d.ts +0 -4
- package/dist/types/core/types/keyboard.types.d.ts +48 -0
- package/dist/types/core/types/navigation.types.d.ts +13 -0
- package/dist/types/{shared-types/src/ui → core/types}/radio.types.d.ts +0 -6
- package/dist/types/{shared-types/src/ui → core/types}/select.types.d.ts +0 -41
- package/dist/types/{shared-types/src/ui → core/types}/suggest.types.d.ts +1 -10
- package/dist/types/{shared-types/src/ui → core/types}/switch.types.d.ts +0 -4
- package/dist/types/{shared-types/src/ui → core/types}/table.types.d.ts +0 -59
- package/dist/types/core/types/tooltip.types.d.ts +43 -0
- package/dist/types/{shared-types/src/ui → core/types}/typography.types.d.ts +0 -4
- package/dist/types/index.d.ts +86 -0
- package/package.json +27 -26
- package/dist/types/published/dcs-ui/src/index.d.ts +0 -32
- package/dist/types/published/dcs-ui/src/publicLogic.d.ts +0 -35
- package/dist/types/published/dcs-ui/src/publicTypes.d.ts +0 -14
- package/dist/types/shared-logic/src/report/aggregate.d.ts +0 -29
- package/dist/types/shared-logic/src/report/canvas.d.ts +0 -106
- package/dist/types/shared-logic/src/report/conditions.d.ts +0 -18
- package/dist/types/shared-logic/src/report/constants.d.ts +0 -46
- package/dist/types/shared-logic/src/report/dataset.d.ts +0 -49
- package/dist/types/shared-logic/src/report/edit.d.ts +0 -188
- package/dist/types/shared-logic/src/report/fields.d.ts +0 -80
- package/dist/types/shared-logic/src/report/format.d.ts +0 -27
- package/dist/types/shared-logic/src/report/fromColumns.d.ts +0 -61
- package/dist/types/shared-logic/src/report/index.d.ts +0 -19
- package/dist/types/shared-logic/src/report/layout.d.ts +0 -85
- package/dist/types/shared-logic/src/report/metrics.d.ts +0 -62
- package/dist/types/shared-logic/src/report/migrate.d.ts +0 -77
- package/dist/types/shared-logic/src/report/paginate.d.ts +0 -40
- package/dist/types/shared-logic/src/report/renderers/html.d.ts +0 -29
- package/dist/types/shared-logic/src/report/renderers/pdfmake.d.ts +0 -45
- package/dist/types/shared-logic/src/report/resolve.d.ts +0 -40
- package/dist/types/shared-logic/src/report/scope.d.ts +0 -52
- package/dist/types/shared-logic/src/report/storage.d.ts +0 -112
- package/dist/types/shared-logic/src/report/validate.d.ts +0 -28
- package/dist/types/shared-logic/src/ui/cellRules.logic.d.ts +0 -67
- package/dist/types/shared-logic/src/ui/columnOrder.logic.d.ts +0 -12
- package/dist/types/shared-logic/src/ui/fieldControl.logic.d.ts +0 -24
- package/dist/types/shared-logic/src/ui/index.d.ts +0 -55
- package/dist/types/shared-logic/src/ui/keyboard.logic.d.ts +0 -72
- package/dist/types/shared-logic/src/ui/navigation.logic.d.ts +0 -30
- package/dist/types/shared-logic/src/ui/popover.logic.d.ts +0 -57
- package/dist/types/shared-logic/src/ui/popupList.logic.d.ts +0 -54
- package/dist/types/shared-logic/src/ui/select.logic.d.ts +0 -31
- package/dist/types/shared-logic/src/ui/tableLayout.logic.d.ts +0 -47
- package/dist/types/shared-logic/src/ui/tooltip.logic.d.ts +0 -35
- package/dist/types/shared-logic/src/ui/useMergeRefs.d.ts +0 -10
- package/dist/types/shared-types/src/report/bands.d.ts +0 -32
- package/dist/types/shared-types/src/report/blocks.d.ts +0 -181
- package/dist/types/shared-types/src/report/conditions.d.ts +0 -24
- package/dist/types/shared-types/src/report/dataset.d.ts +0 -106
- package/dist/types/shared-types/src/report/document.d.ts +0 -201
- package/dist/types/shared-types/src/report/index.d.ts +0 -9
- package/dist/types/shared-types/src/report/primitives.d.ts +0 -109
- package/dist/types/shared-types/src/report/registry.d.ts +0 -85
- package/dist/types/shared-types/src/report/storage.d.ts +0 -41
- package/dist/types/shared-types/src/report/template.d.ts +0 -92
- package/dist/types/shared-types/src/ui/common.types.d.ts +0 -14
- package/dist/types/shared-types/src/ui/control.types.d.ts +0 -133
- package/dist/types/shared-types/src/ui/field.types.d.ts +0 -200
- package/dist/types/shared-types/src/ui/index.d.ts +0 -37
- package/dist/types/shared-types/src/ui/keyboard.types.d.ts +0 -155
- package/dist/types/shared-types/src/ui/navigation.types.d.ts +0 -35
- package/dist/types/shared-types/src/ui/tooltip.types.d.ts +0 -68
- package/dist/types/shared-web-ui/src/AppBar/AppBar.d.ts +0 -25
- package/dist/types/shared-web-ui/src/ArrowKeyFocus/useArrowKeyFocus.d.ts +0 -29
- package/dist/types/shared-web-ui/src/Avatar/Avatar.d.ts +0 -36
- package/dist/types/shared-web-ui/src/Breadcrumbs/Breadcrumbs.d.ts +0 -70
- package/dist/types/shared-web-ui/src/Card/Card.d.ts +0 -33
- package/dist/types/shared-web-ui/src/ColorSchemeSelect/ColorSchemeSelect.d.ts +0 -26
- package/dist/types/shared-web-ui/src/CommandPalette/CommandPalette.d.ts +0 -52
- package/dist/types/shared-web-ui/src/Dialog/Dialog.d.ts +0 -101
- package/dist/types/shared-web-ui/src/Dialog/DialogHost.d.ts +0 -80
- package/dist/types/shared-web-ui/src/DropdownMenu/DropdownMenu.d.ts +0 -49
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableRow.d.ts +0 -25
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableSummary.d.ts +0 -22
- package/dist/types/shared-web-ui/src/EditableTable/useRowAnimation.d.ts +0 -44
- package/dist/types/shared-web-ui/src/FieldContext/FieldContext.d.ts +0 -18
- package/dist/types/shared-web-ui/src/FieldContext/FieldProvider.d.ts +0 -13
- package/dist/types/shared-web-ui/src/FieldContext/useFieldSurface.d.ts +0 -57
- package/dist/types/shared-web-ui/src/Fields/FieldButton.d.ts +0 -32
- package/dist/types/shared-web-ui/src/Popover/Popover.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportDesigner/AlignedRowsEditor.d.ts +0 -4
- package/dist/types/shared-web-ui/src/ReportDesigner/BandList.d.ts +0 -26
- package/dist/types/shared-web-ui/src/ReportDesigner/BlockEditor.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportDesigner/ColumnEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ConditionEditor.d.ts +0 -7
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldPicker.d.ts +0 -25
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldSelect.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/FormatEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/Inspector.d.ts +0 -14
- package/dist/types/shared-web-ui/src/ReportDesigner/OptionsEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ReportDesigner.d.ts +0 -34
- package/dist/types/shared-web-ui/src/ReportDesigner/StyleEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/TableEditor.d.ts +0 -10
- package/dist/types/shared-web-ui/src/ReportDesigner/WatermarkEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/chipSources.d.ts +0 -6
- package/dist/types/shared-web-ui/src/ReportDesigner/icons.d.ts +0 -21
- package/dist/types/shared-web-ui/src/ReportDesigner/index.d.ts +0 -16
- package/dist/types/shared-web-ui/src/ReportDesigner/labels.d.ts +0 -34
- package/dist/types/shared-web-ui/src/ReportDesigner/parts.d.ts +0 -63
- package/dist/types/shared-web-ui/src/ReportDesigner/types.d.ts +0 -106
- package/dist/types/shared-web-ui/src/ReportPreview/ReportPreview.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportPreview/index.d.ts +0 -1
- package/dist/types/shared-web-ui/src/Select/useSelect.d.ts +0 -2
- package/dist/types/shared-web-ui/src/Sidebar/Sidebar.d.ts +0 -55
- package/dist/types/shared-web-ui/src/Skeleton/Skeleton.d.ts +0 -33
- package/dist/types/shared-web-ui/src/Tabs/Tabs.d.ts +0 -79
- package/dist/types/shared-web-ui/src/Toast/ToastHost.d.ts +0 -22
- package/dist/types/shared-web-ui/src/Toast/ToastItem.d.ts +0 -19
- package/dist/types/shared-web-ui/src/Tooltip/Tooltip.d.ts +0 -25
- package/dist/types/shared-web-ui/src/Tooltip/useTooltip.d.ts +0 -24
- package/dist/types/shared-web-ui/src/UIProvider/UIPortalContext.d.ts +0 -16
- package/dist/types/shared-web-ui/src/UIProvider/UIProvider.d.ts +0 -54
- package/dist/types/shared-web-ui/src/UIProvider/UIThemeContext.d.ts +0 -17
- package/dist/types/shared-web-ui/src/index.d.ts +0 -78
- /package/dist/types/{shared-web-ui/src → components}/AppBar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Avatar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Badge/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Breadcrumbs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Card/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/ColorSchemeSelect/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/CommandPalette/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Dialog/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DropdownMenu/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Popover/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Sidebar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Skeleton/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Suggest/fuseSearch.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tabs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tooltip/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/UIProvider/index.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/checkbox.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/input.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/radio.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/switch.logic.d.ts +0 -0
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* The one vocabulary every control in @pdfinvoice/shared-web-ui speaks.
|
|
4
|
-
*
|
|
5
|
-
* Before this file each component re-spelled its own `Size`, `Layout` and
|
|
6
|
-
* `Color` unions by hand. They agreed today by coincidence, not by
|
|
7
|
-
* construction — `ButtonSize` and `FieldSize` listed the same six literals in
|
|
8
|
-
* two places, and `ChipInputLayout` said `vertical` for the thing every other
|
|
9
|
-
* control called `default`. Anything declared here is declared once; the
|
|
10
|
-
* per-component names remain, as aliases, so call sites and the published
|
|
11
|
-
* barrel are unaffected.
|
|
12
|
-
*
|
|
13
|
-
* Adding a step or a colour here widens every control at once — which is the
|
|
14
|
-
* point, and also the hazard: a literal with no CSS behind it ships a variant
|
|
15
|
-
* that renders as nothing. Widen the stylesheet in the same stroke.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* The size scale. Every control resolves to this, so `size="small"` means the
|
|
19
|
-
* same height, padding and font on an Input, a Checkbox and a Button standing
|
|
20
|
-
* next to each other.
|
|
21
|
-
*
|
|
22
|
-
* Each step maps to `--field-height-*`, `--field-padding-x/y-*`,
|
|
23
|
-
* `--control-size-*` and `--font-size-*` in @pdfinvoice/shared-styles.
|
|
24
|
-
*/
|
|
25
|
-
export type ControlSize = 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl';
|
|
26
|
-
/**
|
|
27
|
-
* The default every control falls back to when neither a `size` prop nor an
|
|
28
|
-
* enclosing FieldContext supplies one.
|
|
29
|
-
*
|
|
30
|
-
* It is `small` because this is a dense ERP: the invoice grid is the busiest
|
|
31
|
-
* screen in the product and sets the house density. Previously the fields
|
|
32
|
-
* defaulted to `small` and the toggles to `medium`, so a Checkbox beside an
|
|
33
|
-
* Input was a step larger with no props passed on either.
|
|
34
|
-
*/
|
|
35
|
-
export declare const DEFAULT_CONTROL_SIZE: ControlSize;
|
|
36
|
-
/**
|
|
37
|
-
* Surface treatment for controls that render a text-entry surface — Input,
|
|
38
|
-
* Select, Suggest, ChipInput. They share one border/background/radius/focus
|
|
39
|
-
* definition, so an outlined Select is the same surface as the outlined Input
|
|
40
|
-
* beside it.
|
|
41
|
-
*
|
|
42
|
-
* `underlined` only makes sense here: it draws a rule beneath the text line.
|
|
43
|
-
*/
|
|
44
|
-
export type ControlVariant = 'outlined' | 'filled' | 'standard' | 'underlined' | 'cell';
|
|
45
|
-
/**
|
|
46
|
-
* Surface treatment for the box-shaped toggles — Checkbox and Radio.
|
|
47
|
-
*
|
|
48
|
-
* Deliberately NOT ControlVariant: a checkbox has no text line to underline, so
|
|
49
|
-
* `underlined` would be a valid type with no styling behind it and the control
|
|
50
|
-
* would render with no border or fill. Switch has no variant at all — it has a
|
|
51
|
-
* single track/thumb look by design.
|
|
52
|
-
*/
|
|
53
|
-
export type ToggleVariant = 'outlined' | 'filled' | 'standard' | 'cell';
|
|
54
|
-
/** How a control arranges its label against its control box. */
|
|
55
|
-
export type ControlLayout = 'default' | 'horizontal' | 'inline' | 'cell';
|
|
56
|
-
/** Where a toggle's own label sits relative to its box. */
|
|
57
|
-
export type ControlLabelPosition = 'start' | 'end' | 'top' | 'bottom';
|
|
58
|
-
/**
|
|
59
|
-
* The palette's semantic axis. Each member has its own hue variable in
|
|
60
|
-
* `tokens.css` and its own `--on-*` contrast text.
|
|
61
|
-
*
|
|
62
|
-
* Components take a subset via `Extract`/`Exclude` rather than re-listing:
|
|
63
|
-
* `neutral` is a button/surface idea, not a state a field can be in.
|
|
64
|
-
*/
|
|
65
|
-
export type SemanticColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
66
|
-
/** What a form control can be tinted: every semantic except the neutral surface. */
|
|
67
|
-
export type FieldColor = Exclude<SemanticColor, 'neutral'>;
|
|
68
|
-
/**
|
|
69
|
-
* The minimum a change event carries.
|
|
70
|
-
*
|
|
71
|
-
* A native `ChangeEvent<HTMLInputElement>` satisfies this structurally, which
|
|
72
|
-
* is the whole trick: Input, Checkbox, Radio, Switch and Suggest keep emitting
|
|
73
|
-
* real DOM events (so `currentTarget` and `preventDefault` survive), while
|
|
74
|
-
* Select and ChipInput — which have no DOM event to forward — emit this shape.
|
|
75
|
-
* A single handler typed `(e: FieldChangeEvent) => void` therefore accepts a
|
|
76
|
-
* change from any field, which is what Fields, EditableTable and the keyboard
|
|
77
|
-
* grid need in order to write one handler per row instead of one per widget.
|
|
78
|
-
*
|
|
79
|
-
* Keep this narrow. Every property added here is one more thing the synthetic
|
|
80
|
-
* emitters have to fabricate.
|
|
81
|
-
*/
|
|
82
|
-
export interface FieldChangeTarget<V = any> {
|
|
83
|
-
name?: string;
|
|
84
|
-
value: V;
|
|
85
|
-
/** Mirrors the DOM `type` so `createChangeHandler` can branch on it. */
|
|
86
|
-
type?: string;
|
|
87
|
-
/** Only meaningful for checkbox/radio inputs. */
|
|
88
|
-
checked?: boolean;
|
|
89
|
-
}
|
|
90
|
-
export interface FieldChangeEvent<V = any> {
|
|
91
|
-
target: FieldChangeTarget<V>;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* What a container (Form, Fields, an editable-table row) hands down to the
|
|
95
|
-
* fields inside it. Every member optional and unset by default — a field has to
|
|
96
|
-
* be able to tell "nobody said" from "someone said small".
|
|
97
|
-
*/
|
|
98
|
-
export interface FieldContextValue {
|
|
99
|
-
size?: ControlSize;
|
|
100
|
-
variant?: ControlVariant;
|
|
101
|
-
layout?: ControlLayout;
|
|
102
|
-
disabled?: boolean;
|
|
103
|
-
readOnly?: boolean;
|
|
104
|
-
/**
|
|
105
|
-
* The keyboard policy for everything beneath. This is how a grid says
|
|
106
|
-
* "every cell in here is in grid mode" and a form says "Enter moves to the
|
|
107
|
-
* next field" — once, rather than on every field.
|
|
108
|
-
*
|
|
109
|
-
* @see FieldKeyboardConfig in `keyboard.types`. Typed structurally here to
|
|
110
|
-
* keep `control.types` a leaf that imports nothing.
|
|
111
|
-
*/
|
|
112
|
-
keyboard?: import('./keyboard.types').FieldKeyboardConfig;
|
|
113
|
-
}
|
|
114
|
-
export interface FieldProviderProps extends FieldContextValue {
|
|
115
|
-
children?: ReactNode;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* What an editable-table cell needs to tell the widget sitting in it.
|
|
119
|
-
*
|
|
120
|
-
* These five used to be five separate public props on Input, Select and Suggest
|
|
121
|
-
* — with Suggest re-declaring them inline and typing `registerCellRef` against
|
|
122
|
-
* `HTMLInputElement` where Input typed `HTMLElement`. Grouping them keeps the
|
|
123
|
-
* grid's plumbing out of the props panel and gives the two implementations one
|
|
124
|
-
* signature to agree on.
|
|
125
|
-
*/
|
|
126
|
-
export interface FieldCellContext {
|
|
127
|
-
rowIndex?: number;
|
|
128
|
-
/** Lower-case to match the `data-cellindex` attribute the DOM carries. */
|
|
129
|
-
cellindex?: number;
|
|
130
|
-
onCellFocus?: (rowIndex: number, cellindex: number) => void;
|
|
131
|
-
registerCellRef?: (rowIndex: number, cellindex: number, ref: HTMLElement | null) => void;
|
|
132
|
-
eTableProps?: Record<string, unknown>;
|
|
133
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, FocusEvent, KeyboardEvent, ReactNode } from 'react';
|
|
2
|
-
import type { DataAttributes } from './common.types';
|
|
3
|
-
import type { FieldTooltipSupport } from './fieldWrapper.types';
|
|
4
|
-
import type { ControlLabelPosition, ControlLayout, ControlSize, ControlVariant, FieldCellContext, FieldChangeEvent, FieldColor, ToggleVariant } from './control.types';
|
|
5
|
-
import type { FieldKeyboardConfig } from './keyboard.types';
|
|
6
|
-
/**
|
|
7
|
-
* The one field contract.
|
|
8
|
-
*
|
|
9
|
-
* `control.types` unified the *vocabulary* — `ControlSize`, `ControlVariant`,
|
|
10
|
-
* `FieldChangeEvent` — so the values could no longer drift. It did not unify
|
|
11
|
-
* the *shape*: all seven fields still spelled out their own prop lists by hand,
|
|
12
|
-
* and they had already drifted apart in ways nothing could catch.
|
|
13
|
-
*
|
|
14
|
-
* What the audit found, before this file existed:
|
|
15
|
-
*
|
|
16
|
-
* - `name`, `label`, `size`, `disabled`, `readOnly`, `required`, `error`,
|
|
17
|
-
* `autoFocus`, `tabIndex`, `onFocus`, `onBlur` and `className` were
|
|
18
|
-
* re-declared by hand in **all seven** props files. Checkbox declared `name`
|
|
19
|
-
* three times, in three different sub-interfaces.
|
|
20
|
-
* - `onFocus`/`onBlur` had **five different signatures**, and Select disagreed
|
|
21
|
-
* with itself: `onBlur: (e: SelectEvent)` beside `onFocus: (e: FocusEvent)`,
|
|
22
|
-
* declared 65 lines apart in two sub-interfaces.
|
|
23
|
-
* - `onKeyDown` existed on **three of seven**. Checkbox, Radio, Switch and
|
|
24
|
-
* ChipInput could not participate in grid navigation at all.
|
|
25
|
-
* - The helper line under a field was `hint` on Input/Suggest/ChipInput and
|
|
26
|
-
* `helperText` on Checkbox/Radio/Switch — for the same slot in the same
|
|
27
|
-
* FieldWrapper.
|
|
28
|
-
* - `FieldCellContext` reached three of seven, and Select imported it under the
|
|
29
|
-
* alias `InputEditableTableCellProps` — named after a different component.
|
|
30
|
-
*
|
|
31
|
-
* Every axis below is declared **once**. A field's own props file holds only
|
|
32
|
-
* what is genuinely its own; adding an axis later edits this file, not seven.
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* `C` — the change event a field emits — is a parameter rather than a fixed
|
|
36
|
-
* `FieldChangeEvent`, and deliberately so. Input, Suggest and the toggles
|
|
37
|
-
* forward a **real DOM event**, so their consumers keep `currentTarget` and
|
|
38
|
-
* `preventDefault()`; Select and ChipInput have no DOM event and emit the
|
|
39
|
-
* synthetic shape. Fixing `C` to `FieldChangeEvent` would unify the declaration
|
|
40
|
-
* by quietly taking capability away from five fields.
|
|
41
|
-
*
|
|
42
|
-
* A container still writes one handler for all of them: `FieldChangeEvent` is
|
|
43
|
-
* what a DOM `ChangeEvent` structurally satisfies, so a handler typed against
|
|
44
|
-
* the narrow shape is assignable to every field's `onChange`.
|
|
45
|
-
*/
|
|
46
|
-
export interface FieldIdentityProps<V = any, C = FieldChangeEvent<V>> {
|
|
47
|
-
id?: string;
|
|
48
|
-
name?: string;
|
|
49
|
-
value?: V;
|
|
50
|
-
defaultValue?: V;
|
|
51
|
-
onChange?: (event: C) => void;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* What every field shares. Resolved by `useFieldSurface`
|
|
55
|
-
* (own prop → FieldContext → default), never by a destructuring default.
|
|
56
|
-
*/
|
|
57
|
-
export interface FieldSurfaceProps {
|
|
58
|
-
size?: ControlSize;
|
|
59
|
-
disabled?: boolean;
|
|
60
|
-
readOnly?: boolean;
|
|
61
|
-
}
|
|
62
|
-
/** Fields that render a text-entry surface: Input, Select, Suggest, ChipInput. */
|
|
63
|
-
export interface ControlSurfaceProps extends FieldSurfaceProps {
|
|
64
|
-
variant?: ControlVariant;
|
|
65
|
-
layout?: ControlLayout;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* The box-shaped toggles: Checkbox, Radio, Switch.
|
|
69
|
-
*
|
|
70
|
-
* Separate from `ControlSurfaceProps` on purpose. A toggle has no text line, so
|
|
71
|
-
* `variant: 'underlined'` would type-check and render a box with neither border
|
|
72
|
-
* nor fill, and `layout` has nothing to arrange — a toggle positions its label
|
|
73
|
-
* with `labelPosition`. Handing toggles the text-field surface would make both
|
|
74
|
-
* expressible and meaningless.
|
|
75
|
-
*/
|
|
76
|
-
export interface ToggleSurfaceProps extends FieldSurfaceProps {
|
|
77
|
-
variant?: ToggleVariant;
|
|
78
|
-
color?: FieldColor;
|
|
79
|
-
labelPosition?: ControlLabelPosition;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* The label / helper / error furniture, all of which FieldWrapper renders.
|
|
83
|
-
*
|
|
84
|
-
* `ReactNode` rather than `string` for label, hint and error: the toggles
|
|
85
|
-
* already passed rich content through the wrapper while Input's types claimed
|
|
86
|
-
* `string`, so the wrapper's real contract was the wider one.
|
|
87
|
-
*/
|
|
88
|
-
export interface FieldChromeProps {
|
|
89
|
-
label?: ReactNode;
|
|
90
|
-
hint?: ReactNode;
|
|
91
|
-
error?: ReactNode;
|
|
92
|
-
required?: boolean;
|
|
93
|
-
className?: string;
|
|
94
|
-
labelClassName?: string;
|
|
95
|
-
style?: CSSProperties;
|
|
96
|
-
fullWidth?: boolean;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Re-declared per field before this existed, in four of the seven, with the
|
|
100
|
-
* other three simply dropping them.
|
|
101
|
-
*/
|
|
102
|
-
export interface FieldA11yProps {
|
|
103
|
-
'aria-label'?: string;
|
|
104
|
-
'aria-labelledby'?: string;
|
|
105
|
-
'aria-describedby'?: string;
|
|
106
|
-
'aria-required'?: boolean;
|
|
107
|
-
'aria-invalid'?: boolean;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* The focus event a container writes its handler against — the widest one, so
|
|
111
|
-
* `Fields` can pass a single `onBlur` to all seven fields.
|
|
112
|
-
*/
|
|
113
|
-
export type FieldFocusEvent = FocusEvent<HTMLElement>;
|
|
114
|
-
/**
|
|
115
|
-
* One focus/key signature, parameterised by the element the field actually
|
|
116
|
-
* focuses — `HTMLInputElement` for Input and the toggles, `HTMLDivElement` for
|
|
117
|
-
* Select's trigger, and so on.
|
|
118
|
-
*
|
|
119
|
-
* Parameterised rather than widened to a flat `HTMLElement` because widening
|
|
120
|
-
* would break every consumer whose handler is annotated with the narrow event
|
|
121
|
-
* type. A container's handler is unaffected either way: TypeScript checks
|
|
122
|
-
* function parameters contravariantly, so a broadly-typed
|
|
123
|
-
* `(e: KeyboardEvent) => void` — which is what the grid and form pass down —
|
|
124
|
-
* remains assignable to every field's `onKeyDown`.
|
|
125
|
-
*/
|
|
126
|
-
export interface FieldInteractionProps<E extends HTMLElement = HTMLElement> {
|
|
127
|
-
autoFocus?: boolean;
|
|
128
|
-
tabIndex?: number;
|
|
129
|
-
onFocus?: (event: FocusEvent<E>) => void;
|
|
130
|
-
onBlur?: (event: FocusEvent<E>) => void;
|
|
131
|
-
onKeyDown?: (event: KeyboardEvent<E>) => void;
|
|
132
|
-
/** @see FieldKeyboardConfig — arrow/Enter/edit-key policy. */
|
|
133
|
-
keyboard?: FieldKeyboardConfig;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Why a popup opened or closed.
|
|
137
|
-
*
|
|
138
|
-
* A boolean is not enough for the grid. "Closed because the user picked an
|
|
139
|
-
* option" must return the cell to navigate mode, while "closed because Escape"
|
|
140
|
-
* must leave it in edit mode with the typed text intact — two different
|
|
141
|
-
* behaviours that a bare `onOpenChange(false)` cannot distinguish.
|
|
142
|
-
*/
|
|
143
|
-
export type OpenReason = 'type' | 'focus' | 'key' | 'click' | 'select' | 'escape' | 'blur' | 'programmatic';
|
|
144
|
-
/**
|
|
145
|
-
* Fields with a popup: Select, Suggest, and any date/lookup field added later.
|
|
146
|
-
*
|
|
147
|
-
* Before this, popup state was private to each component — only Select had
|
|
148
|
-
* `onOpen`/`onClose`, neither field accepted `open`, and nothing could be
|
|
149
|
-
* controlled from outside. The grid's rule that an open popup owns the arrow
|
|
150
|
-
* keys had no state to read.
|
|
151
|
-
*/
|
|
152
|
-
export interface FieldPopupProps {
|
|
153
|
-
/** Controlled. Omit for the field to own its own state. */
|
|
154
|
-
open?: boolean;
|
|
155
|
-
defaultOpen?: boolean;
|
|
156
|
-
onOpenChange?: (open: boolean, reason: OpenReason) => void;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* What `ref` points at, for every field.
|
|
160
|
-
*
|
|
161
|
-
* It used to be four different DOM nodes and no behaviour, which is why the
|
|
162
|
-
* editable table resorted to `document.querySelector('.smartselect-trigger')`
|
|
163
|
-
* to move focus — there was no other way to focus a Select from outside it.
|
|
164
|
-
*
|
|
165
|
-
* `element` keeps the old capability available, so nothing that a DOM ref could
|
|
166
|
-
* do becomes impossible.
|
|
167
|
-
*/
|
|
168
|
-
export interface FieldHandle {
|
|
169
|
-
focus(opts?: {
|
|
170
|
-
select?: boolean;
|
|
171
|
-
caret?: 'start' | 'end';
|
|
172
|
-
}): void;
|
|
173
|
-
blur(): void;
|
|
174
|
-
/** Navigate → edit. `seed` replaces the value, as type-to-replace does. */
|
|
175
|
-
beginEdit(seed?: string): void;
|
|
176
|
-
endEdit(commit: boolean): void;
|
|
177
|
-
openPopup(reason?: OpenReason): void;
|
|
178
|
-
closePopup(reason?: OpenReason): void;
|
|
179
|
-
readonly isOpen: boolean;
|
|
180
|
-
readonly element: HTMLElement | null;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Everything every field has, whatever it renders.
|
|
184
|
-
*
|
|
185
|
-
* Surface is **not** included: text fields and toggles take different surface
|
|
186
|
-
* axes (see `ControlSurfaceProps` / `ToggleSurfaceProps`), and merging them
|
|
187
|
-
* would give a Checkbox a `layout` and an `underlined` variant that mean
|
|
188
|
-
* nothing. Each field extends this plus the surface interface for its family.
|
|
189
|
-
*
|
|
190
|
-
* @typeParam V — the value type
|
|
191
|
-
* @typeParam E — the element the field focuses
|
|
192
|
-
* @typeParam C — the change event it emits
|
|
193
|
-
*/
|
|
194
|
-
export type BaseFieldProps<V = any, E extends HTMLElement = HTMLElement, C = FieldChangeEvent<V>> = FieldIdentityProps<V, C> & FieldChromeProps & FieldA11yProps & FieldInteractionProps<E> & FieldCellContext & FieldTooltipSupport & DataAttributes;
|
|
195
|
-
/** The text-entry families: Input, Select, Suggest, ChipInput. */
|
|
196
|
-
export type TextFieldProps<V = any, E extends HTMLElement = HTMLElement, C = FieldChangeEvent<V>> = BaseFieldProps<V, E, C> & ControlSurfaceProps & {
|
|
197
|
-
placeholder?: string;
|
|
198
|
-
};
|
|
199
|
-
/** The toggle family: Checkbox, Radio, Switch. */
|
|
200
|
-
export type ToggleFieldProps<V = any, E extends HTMLElement = HTMLInputElement, C = FieldChangeEvent<V>> = BaseFieldProps<V, E, C> & ToggleSurfaceProps;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The UI half of `shared-types`, on its own — a privacy boundary, like its twin in
|
|
3
|
-
* `shared-logic/src/ui/index.ts`.
|
|
4
|
-
*
|
|
5
|
-
* The package barrel (`shared-types/src/index.ts`) re-exports this folder alongside the
|
|
6
|
-
* folders describing this business's own records. Anything importing the barrel pulls all of
|
|
7
|
-
* it into the TypeScript program, and `tsc` emits
|
|
8
|
-
* declarations for a whole program, so the domain then ships wherever those declarations do.
|
|
9
|
-
* That is how `@dcs-tech/ui@0.1.0` reached the public registry carrying them (audited
|
|
10
|
-
* 2026-09-28).
|
|
11
|
-
*
|
|
12
|
-
* `navigation.types` and `common.types` are included because the app-shell components are
|
|
13
|
-
* published and typed against them; neither describes any business record.
|
|
14
|
-
*
|
|
15
|
-
* ONLY `./ui/*` belongs here. Never add a domain module, and never re-export the parent barrel.
|
|
16
|
-
*/
|
|
17
|
-
export * from './control.types';
|
|
18
|
-
export * from './tooltip.types';
|
|
19
|
-
export * from './typography.types';
|
|
20
|
-
export * from './button.types';
|
|
21
|
-
export * from './fieldWrapper.types';
|
|
22
|
-
export * from './keyboard.types';
|
|
23
|
-
export * from './field.types';
|
|
24
|
-
export * from './checkbox.types';
|
|
25
|
-
export * from './radio.types';
|
|
26
|
-
export * from './switch.types';
|
|
27
|
-
export * from './input.types';
|
|
28
|
-
export * from './select.types';
|
|
29
|
-
export * from './suggest.types';
|
|
30
|
-
export * from './collapsible.types';
|
|
31
|
-
export * from './fields.types';
|
|
32
|
-
export * from './form.types';
|
|
33
|
-
export * from './chipinput.types';
|
|
34
|
-
export * from './table.types';
|
|
35
|
-
export * from './editableTable.types';
|
|
36
|
-
export * from './navigation.types';
|
|
37
|
-
export type { DataAttributes } from './common.types';
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The keyboard contract — one truth table for every field, in every container.
|
|
3
|
-
*
|
|
4
|
-
* Key handling used to be **field-first**: each field ran its own `handleKeyDown`
|
|
5
|
-
* and *might* forward what was left to the container. Three incompatible rules
|
|
6
|
-
* had grown out of that:
|
|
7
|
-
*
|
|
8
|
-
* - Input had no key logic at all, so the grid could only use keys an input
|
|
9
|
-
* ignores — which is why the editable table navigated on **Ctrl/Alt+Arrow**
|
|
10
|
-
* instead of the plain arrows every native ERP grid uses.
|
|
11
|
-
* - Suggest swallowed ArrowUp/ArrowDown/Enter/Escape unconditionally, open or
|
|
12
|
-
* closed, so a closed suggest cell ate the grid's arrows.
|
|
13
|
-
* - Select kept an ad-hoc allow-list of keys to forward *and* a boolean return
|
|
14
|
-
* from its hook — two arbitration mechanisms inside one component.
|
|
15
|
-
*
|
|
16
|
-
* Which key reached the grid therefore depended on which widget a cell happened
|
|
17
|
-
* to hold, and no truth table existed to test against.
|
|
18
|
-
*
|
|
19
|
-
* This inverts it. The **container arbitrates**; a field only reports what it
|
|
20
|
-
* currently needs, and one pure resolver decides. A field author never writes
|
|
21
|
-
* key handling — they spread the handlers `useField` returns.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* What kind of keyboard behaviour a field has. Not the same as the component:
|
|
25
|
-
* a number Input and a text Input are one component and two widgets, because
|
|
26
|
-
* they answer differently on the arrow keys.
|
|
27
|
-
*/
|
|
28
|
-
export type FieldWidget = 'text' | 'number' | 'textarea' | 'select' | 'suggest' | 'toggle'
|
|
29
|
-
/** A cell that ACTS instead of holding a value: Space presses it, Enter walks on. */
|
|
30
|
-
| 'button' | 'custom';
|
|
31
|
-
/** What the container is being asked to do. */
|
|
32
|
-
export type NavAction = 'next' | 'prev' | 'up' | 'down' | 'left' | 'right' | 'firstCell' | 'lastCell' | 'firstCellOfTable' | 'lastCellOfTable' | 'pageUp' | 'pageDown' | 'newRow' | 'copyRow' | 'deleteRow' | 'edit' | 'commit' | 'revert' | 'clear' | 'submit' | 'exitGrid' | 'none';
|
|
33
|
-
/** Which half of the cell's two-mode state is live. @see FIELD_KEYBOARD_NAVIGATION.md §2 */
|
|
34
|
-
export type GridMode = 'navigate' | 'edit';
|
|
35
|
-
/**
|
|
36
|
-
* The live field state the resolver needs. Everything here is knowable without
|
|
37
|
-
* touching the DOM at the point of decision, which is what keeps the resolver
|
|
38
|
-
* pure and its truth table runnable under plain Node.
|
|
39
|
-
*/
|
|
40
|
-
export interface FieldKeyState {
|
|
41
|
-
mode: GridMode;
|
|
42
|
-
isOpen: boolean;
|
|
43
|
-
/** A popup with nothing in it must not swallow Enter. */
|
|
44
|
-
hasOptions?: boolean;
|
|
45
|
-
caretAtStart?: boolean;
|
|
46
|
-
caretAtEnd?: boolean;
|
|
47
|
-
hasSelection?: boolean;
|
|
48
|
-
isEmpty?: boolean;
|
|
49
|
-
/** Multi-select keeps its popup open on Enter where single-select closes it. */
|
|
50
|
-
multi?: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* A `React.KeyboardEvent` satisfies this structurally — the same trick
|
|
54
|
-
* `FieldChangeEvent` uses. The resolver takes the minimum so it can live in
|
|
55
|
-
* shared-logic with no React or DOM import, and stay mechanically portable.
|
|
56
|
-
*/
|
|
57
|
-
export interface KeyEventLike {
|
|
58
|
-
key: string;
|
|
59
|
-
ctrlKey?: boolean;
|
|
60
|
-
shiftKey?: boolean;
|
|
61
|
-
altKey?: boolean;
|
|
62
|
-
metaKey?: boolean;
|
|
63
|
-
}
|
|
64
|
-
/** What the field does with a key it keeps. */
|
|
65
|
-
export type FieldKeyAction = 'native' | 'open' | 'close' | 'highlightNext' | 'highlightPrev' | 'highlightFirst' | 'highlightLast' | 'pick' | 'toggleOption' | 'beginEdit' | 'clear' | 'stepUp' | 'stepDown'
|
|
66
|
-
/**
|
|
67
|
-
* Put a line break in a multi-line cell (Alt+Enter, the Excel/Sheets convention).
|
|
68
|
-
*
|
|
69
|
-
* It needs an action of its own because a grid has no spare Enter: plain Enter moves to the
|
|
70
|
-
* next cell, Shift+Enter to the previous one, Ctrl+Enter adds a row. Alt+Enter is the one
|
|
71
|
-
* combination left, and the browser inserts nothing for it on its own — so unlike every
|
|
72
|
-
* other textual key this cannot resolve to `'native'`.
|
|
73
|
-
*/
|
|
74
|
-
| 'insertNewline';
|
|
75
|
-
/**
|
|
76
|
-
* Exactly one owner per key, always. A resolution that named neither owner is
|
|
77
|
-
* how keys used to go missing between a field and its container.
|
|
78
|
-
*/
|
|
79
|
-
export type KeyResolution = {
|
|
80
|
-
owner: 'field';
|
|
81
|
-
action: FieldKeyAction;
|
|
82
|
-
preventDefault: boolean;
|
|
83
|
-
} | {
|
|
84
|
-
owner: 'container';
|
|
85
|
-
action: NavAction;
|
|
86
|
-
preventDefault: boolean;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* How a field or container behaves on the keyboard.
|
|
90
|
-
*
|
|
91
|
-
* This is the **Interaction axis** of `BaseFieldProps`, so it lands on all seven
|
|
92
|
-
* fields at once rather than the three that happen to have `onKeyDown` today.
|
|
93
|
-
* A container sets it once through `FieldContext` and every field beneath obeys;
|
|
94
|
-
* resolution is the same own prop → provider → default order as `size`.
|
|
95
|
-
*/
|
|
96
|
-
export interface FieldKeyboardConfig {
|
|
97
|
-
/**
|
|
98
|
-
* `'field'` — an ordinary standalone field; the browser's behaviour, plus
|
|
99
|
-
* whatever `enter` says.
|
|
100
|
-
* `'grid'` — the two-mode navigate/edit model a cell needs.
|
|
101
|
-
*/
|
|
102
|
-
mode?: 'field' | 'grid';
|
|
103
|
-
/**
|
|
104
|
-
* What Enter does when no popup is open.
|
|
105
|
-
*
|
|
106
|
-
* The library default is `'submit'`, because a `<form>` submitting on Enter
|
|
107
|
-
* is the web standard and this package is published. Our apps set `'next'`
|
|
108
|
-
* once on the provider: traditional ERP data entry moves on Enter and
|
|
109
|
-
* submits on Ctrl+Enter or the action button.
|
|
110
|
-
*/
|
|
111
|
-
enter?: 'next' | 'submit' | 'native' | 'none';
|
|
112
|
-
/** Arrow keys in navigate mode. `'container'` moves between cells. */
|
|
113
|
-
arrows?: 'container' | 'native';
|
|
114
|
-
/**
|
|
115
|
-
* Up/Down while editing. `'cell'` commits and moves row — Sheets' "enter
|
|
116
|
-
* mode", which is what makes column-down entry fast. `'caret'` leaves them
|
|
117
|
-
* to the browser; a textarea forces this regardless.
|
|
118
|
-
*/
|
|
119
|
-
arrowsInEdit?: 'cell' | 'caret';
|
|
120
|
-
/** Navigate + a printable key. `'replace'` wipes the old value; `'append'` keeps it. */
|
|
121
|
-
typeBehaviour?: 'replace' | 'append';
|
|
122
|
-
/**
|
|
123
|
-
* Navigate → edit **without** wiping the value — the "alter" key, as
|
|
124
|
-
* against type-to-replace. Default `'Insert'`.
|
|
125
|
-
*
|
|
126
|
-
* A binding string rather than a fixed key so any table or form overrides it
|
|
127
|
-
* for its own audience: `Insert` is absent from Mac keyboards and most
|
|
128
|
-
* compact laptops, and those consumers pass `'F2'` or `'alt+enter'`.
|
|
129
|
-
*/
|
|
130
|
-
editKey?: string;
|
|
131
|
-
/**
|
|
132
|
-
* When a popup opens. `'focus'` is right for a standalone field and wrong in
|
|
133
|
-
* a grid, where arrowing across a row would pop a list in every cell.
|
|
134
|
-
*/
|
|
135
|
-
openOn?: 'focus' | 'type' | 'manual';
|
|
136
|
-
/** After picking from a popup: stay in the cell (default), or move on like Enter. */
|
|
137
|
-
advanceOnSelect?: boolean;
|
|
138
|
-
/**
|
|
139
|
-
* Whether Up/Down step a number's value. `'none'` everywhere by default —
|
|
140
|
-
* in a grid the arrows belong to navigation, and a key that silently edits
|
|
141
|
-
* a number while the user believes they are moving is a data-integrity bug,
|
|
142
|
-
* not a convenience.
|
|
143
|
-
*/
|
|
144
|
-
stepKeys?: 'none' | 'arrows' | 'ctrlArrows';
|
|
145
|
-
/** Overrides, keyed by binding string: `{ 'ctrl+enter': 'newRow' }`. */
|
|
146
|
-
bindings?: Record<string, NavAction>;
|
|
147
|
-
/** Supplied by the container, never by a consumer. */
|
|
148
|
-
onNavigate?: (action: NavAction, event: KeyEventLike) => void;
|
|
149
|
-
}
|
|
150
|
-
/** Everything `resolveFieldKey` needs, and nothing it does not. */
|
|
151
|
-
export interface KeyResolutionContext {
|
|
152
|
-
widget: FieldWidget;
|
|
153
|
-
state: FieldKeyState;
|
|
154
|
-
config: FieldKeyboardConfig;
|
|
155
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* One entry in a navigation structure — a sidebar row, a breadcrumb, a palette result, a tab.
|
|
4
|
-
*
|
|
5
|
-
* ONE shape on purpose. An app builds its route registry once and feeds Sidebar, Breadcrumbs
|
|
6
|
-
* and CommandPalette from the same array, instead of three parallel structures that drift.
|
|
7
|
-
* Nothing here knows where the items came from, which is exactly what makes a registry that
|
|
8
|
-
* changes at runtime — per-business reports generated from `businesses × templates` — work
|
|
9
|
-
* with no special support: it is just a different array.
|
|
10
|
-
*/
|
|
11
|
-
export interface NavItem {
|
|
12
|
-
/** Stable identity. Used for the active match and as the React key. */
|
|
13
|
-
id: string;
|
|
14
|
-
label: ReactNode;
|
|
15
|
-
icon?: ReactNode;
|
|
16
|
-
/** Trailing marker — a count, a status dot. */
|
|
17
|
-
badge?: ReactNode;
|
|
18
|
-
/** Extra terms for search surfaces (CommandPalette). Not rendered. */
|
|
19
|
-
keywords?: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/** Plain link target. */
|
|
22
|
-
href?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Extra props spread onto the rendered element — how a router link gets its target,
|
|
25
|
-
* e.g. `{ to: '/reports/monthly/sales' }` with `as={NavLink}`. Router-agnostic on purpose.
|
|
26
|
-
*/
|
|
27
|
-
props?: Record<string, unknown>;
|
|
28
|
-
/** Nested entries. Depth is not assumed anywhere. */
|
|
29
|
-
children?: NavItem[];
|
|
30
|
-
/**
|
|
31
|
-
* Render as a non-interactive section heading rather than a link. Its `children` still
|
|
32
|
-
* render beneath it.
|
|
33
|
-
*/
|
|
34
|
-
group?: boolean;
|
|
35
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
-
/**
|
|
4
|
-
* Where a field's tooltip is triggered from: a help icon beside the label
|
|
5
|
-
* (default — never fires while someone is typing), or the control itself.
|
|
6
|
-
*/
|
|
7
|
-
export type TooltipTrigger = 'icon' | 'control';
|
|
8
|
-
/**
|
|
9
|
-
* What a hover tooltip is positioned against.
|
|
10
|
-
*
|
|
11
|
-
* `auto` (default) anchors to the trigger's box, except when that box is wider
|
|
12
|
-
* than the tooltip itself — a full-width line of text, a table row — where
|
|
13
|
-
* centring on the element puts the tip nowhere near the cursor. Those anchor to
|
|
14
|
-
* the pointer instead.
|
|
15
|
-
*
|
|
16
|
-
* Keyboard focus always anchors to the element: there is no cursor involved.
|
|
17
|
-
*/
|
|
18
|
-
export type TooltipAnchorTo = 'auto' | 'element' | 'pointer';
|
|
19
|
-
export interface TooltipConfig {
|
|
20
|
-
content: ReactNode;
|
|
21
|
-
placement?: TooltipPlacement;
|
|
22
|
-
anchorTo?: TooltipAnchorTo;
|
|
23
|
-
/** ms before showing. Default 500 — 0 while another tooltip is still warm. */
|
|
24
|
-
delay?: number;
|
|
25
|
-
/** ms before hiding. Default 100. */
|
|
26
|
-
closeDelay?: number;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
className?: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* What every `tooltip` prop accepts: bare content for the common case
|
|
32
|
-
* (`tooltip="Delete row"`), or a config object when placement/delay matter.
|
|
33
|
-
*/
|
|
34
|
-
export type TooltipProp = ReactNode | TooltipConfig;
|
|
35
|
-
export interface TooltipProps extends TooltipConfig {
|
|
36
|
-
/** A single element — Tooltip clones it rather than wrapping it in a div. */
|
|
37
|
-
children: ReactElement;
|
|
38
|
-
id?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface TooltipRect {
|
|
41
|
-
top: number;
|
|
42
|
-
left: number;
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
}
|
|
46
|
-
export interface TooltipPositionInput {
|
|
47
|
-
/** Trigger box in viewport coordinates. */
|
|
48
|
-
anchor: TooltipRect;
|
|
49
|
-
tooltip: {
|
|
50
|
-
width: number;
|
|
51
|
-
height: number;
|
|
52
|
-
};
|
|
53
|
-
viewport: {
|
|
54
|
-
width: number;
|
|
55
|
-
height: number;
|
|
56
|
-
};
|
|
57
|
-
placement: TooltipPlacement;
|
|
58
|
-
/** Gap between trigger and tooltip. */
|
|
59
|
-
offset: number;
|
|
60
|
-
/** Minimum distance kept from the viewport edge. */
|
|
61
|
-
margin?: number;
|
|
62
|
-
}
|
|
63
|
-
export interface TooltipPosition {
|
|
64
|
-
top: number;
|
|
65
|
-
left: number;
|
|
66
|
-
/** Placement actually used — may differ from the request after flipping. */
|
|
67
|
-
placement: TooltipPlacement;
|
|
68
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type AppBarSize = 'small' | 'medium' | 'large';
|
|
3
|
-
export type AppBarVariant = 'default' | 'transparent' | 'elevated';
|
|
4
|
-
export interface AppBarProps {
|
|
5
|
-
/** Leading slot — logo, product name, a back button. */
|
|
6
|
-
brand?: React.ReactNode;
|
|
7
|
-
/** Middle slot, takes the slack. Tabs, a search box, breadcrumbs. */
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
/** Trailing slot, pinned to the end. */
|
|
10
|
-
actions?: React.ReactNode;
|
|
11
|
-
size?: AppBarSize;
|
|
12
|
-
variant?: AppBarVariant;
|
|
13
|
-
/** Opt-in — see the note in the stylesheet on why it is not the default. */
|
|
14
|
-
sticky?: boolean;
|
|
15
|
-
className?: string;
|
|
16
|
-
style?: React.CSSProperties;
|
|
17
|
-
'aria-label'?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The top bar: three slots, a height and a rule. It deliberately holds no navigation logic of
|
|
21
|
-
* its own — put `Tabs`, `Breadcrumbs` or a search trigger in the middle slot, which keeps one
|
|
22
|
-
* implementation of each of those rather than a bar-flavoured copy.
|
|
23
|
-
*/
|
|
24
|
-
declare const AppBar: React.FC<AppBarProps>;
|
|
25
|
-
export default AppBar;
|