@sincpro/web-ui 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +184 -2
- package/dist/components/activity/Activity.d.ts +69 -0
- package/dist/components/activity/Activity.js +279 -0
- package/dist/components/activity/Messages.d.ts +66 -0
- package/dist/components/activity/Messages.js +46 -0
- package/dist/components/activity/Timeline.d.ts +21 -0
- package/dist/components/activity/Timeline.js +30 -0
- package/dist/components/activity/index.d.ts +3 -0
- package/dist/components/activity/index.js +4 -0
- package/dist/components/assist/AssistMark.d.ts +64 -0
- package/dist/components/assist/AssistMark.js +108 -0
- package/dist/components/assist/AssistPending.d.ts +24 -0
- package/dist/components/assist/AssistPending.js +26 -0
- package/dist/components/assist/AssistSuggestion.d.ts +42 -0
- package/dist/components/assist/AssistSuggestion.js +55 -0
- package/dist/components/assist/ChangeReview.d.ts +56 -0
- package/dist/components/assist/ChangeReview.js +121 -0
- package/dist/components/assist/assist.d.ts +77 -0
- package/dist/components/assist/assist.js +87 -0
- package/dist/components/assist/index.d.ts +5 -0
- package/dist/components/assist/index.js +7 -0
- package/dist/components/form/Form.d.ts +52 -0
- package/dist/components/form/Form.js +49 -0
- package/dist/components/form/Sheet.d.ts +47 -0
- package/dist/components/form/Sheet.js +90 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +4 -0
- package/dist/components/frame/Chart.d.ts +13 -0
- package/dist/components/frame/Chart.js +24 -0
- package/dist/components/frame/FrameView.d.ts +33 -0
- package/dist/components/frame/FrameView.js +125 -0
- package/dist/components/frame/index.d.ts +3 -0
- package/dist/components/frame/index.js +3 -0
- package/dist/components/frame/model.d.ts +43 -0
- package/dist/components/frame/model.js +101 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +11 -0
- package/dist/components/lines/LineItems.d.ts +111 -0
- package/dist/components/lines/LineItems.js +317 -0
- package/dist/components/lines/index.d.ts +1 -0
- package/dist/components/lines/index.js +2 -0
- package/dist/components/lines/lines.d.ts +23 -0
- package/dist/components/lines/lines.js +26 -0
- package/dist/components/listing/ColumnsMenu.d.ts +20 -0
- package/dist/components/listing/ColumnsMenu.js +46 -0
- package/dist/components/listing/GroupingLevels.d.ts +35 -0
- package/dist/components/listing/GroupingLevels.js +45 -0
- package/dist/components/listing/Listing.d.ts +27 -0
- package/dist/components/listing/Listing.js +86 -0
- package/dist/components/listing/ListingBar.d.ts +112 -0
- package/dist/components/listing/ListingBar.js +144 -0
- package/dist/components/listing/Pagination.d.ts +36 -0
- package/dist/components/listing/Pagination.js +69 -0
- package/dist/components/listing/RecordCard.d.ts +33 -0
- package/dist/components/listing/RecordCard.js +22 -0
- package/dist/components/listing/RecordLink.d.ts +7 -0
- package/dist/components/listing/RecordLink.js +22 -0
- package/dist/components/listing/Row.d.ts +110 -0
- package/dist/components/listing/Row.js +123 -0
- package/dist/components/listing/SortMenu.d.ts +62 -0
- package/dist/components/listing/SortMenu.js +105 -0
- package/dist/components/listing/ViewSwitcher.d.ts +24 -0
- package/dist/components/listing/ViewSwitcher.js +16 -0
- package/dist/components/listing/columns.d.ts +47 -0
- package/dist/components/listing/columns.js +72 -0
- package/dist/components/listing/grouping.d.ts +35 -0
- package/dist/components/listing/grouping.js +47 -0
- package/dist/components/listing/index.d.ts +17 -0
- package/dist/components/listing/index.js +20 -0
- package/dist/components/listing/modelColumns.d.ts +50 -0
- package/dist/components/listing/modelColumns.js +103 -0
- package/dist/components/listing/pages.d.ts +78 -0
- package/dist/components/listing/pages.js +135 -0
- package/dist/components/listing/selection.d.ts +21 -0
- package/dist/components/listing/selection.js +43 -0
- package/dist/components/listing/set.d.ts +48 -0
- package/dist/components/listing/set.js +24 -0
- package/dist/components/listing/tree.d.ts +28 -0
- package/dist/components/listing/tree.js +23 -0
- package/dist/components/navigation/CommandPalette.d.ts +40 -0
- package/dist/components/navigation/CommandPalette.js +114 -0
- package/dist/components/navigation/NavigationTree.d.ts +31 -0
- package/dist/components/navigation/NavigationTree.js +79 -0
- package/dist/components/navigation/commands.d.ts +30 -0
- package/dist/components/navigation/commands.js +30 -0
- package/dist/components/navigation/index.d.ts +3 -0
- package/dist/components/navigation/index.js +4 -0
- package/dist/components/record/Breadcrumb.d.ts +42 -0
- package/dist/components/record/Breadcrumb.js +98 -0
- package/dist/components/record/DirtyActions.d.ts +26 -0
- package/dist/components/record/DirtyActions.js +22 -0
- package/dist/components/record/Pager.d.ts +18 -0
- package/dist/components/record/Pager.js +33 -0
- package/dist/components/record/RecordHeader.d.ts +75 -0
- package/dist/components/record/RecordHeader.js +104 -0
- package/dist/components/record/RecordNotices.d.ts +37 -0
- package/dist/components/record/RecordNotices.js +75 -0
- package/dist/components/record/RecordSkeleton.d.ts +3 -0
- package/dist/components/record/RecordSkeleton.js +21 -0
- package/dist/components/record/SmartButtons.d.ts +35 -0
- package/dist/components/record/SmartButtons.js +38 -0
- package/dist/components/record/StatusBar.d.ts +51 -0
- package/dist/components/record/StatusBar.js +168 -0
- package/dist/components/record/ThumbBar.d.ts +36 -0
- package/dist/components/record/ThumbBar.js +86 -0
- package/dist/components/record/index.d.ts +6 -0
- package/dist/components/record/index.js +8 -0
- package/dist/components/search/CriteriaBuilder.d.ts +58 -0
- package/dist/components/search/CriteriaBuilder.js +278 -0
- package/dist/components/search/CriteriaChips.d.ts +22 -0
- package/dist/components/search/CriteriaChips.js +64 -0
- package/dist/components/search/FilterBuilder.d.ts +142 -0
- package/dist/components/search/FilterBuilder.js +421 -0
- package/dist/components/search/JoinWord.d.ts +8 -0
- package/dist/components/search/JoinWord.js +47 -0
- package/dist/components/search/JsonEditor.d.ts +19 -0
- package/dist/components/search/JsonEditor.js +78 -0
- package/dist/components/search/SearchBar.d.ts +78 -0
- package/dist/components/search/SearchBar.js +387 -0
- package/dist/components/search/criteria.d.ts +116 -0
- package/dist/components/search/criteria.js +159 -0
- package/dist/components/search/datePeriods.d.ts +122 -0
- package/dist/components/search/datePeriods.js +134 -0
- package/dist/components/search/dateRanges.d.ts +54 -0
- package/dist/components/search/dateRanges.js +89 -0
- package/dist/components/search/index.d.ts +9 -0
- package/dist/components/search/index.js +20 -0
- package/dist/components/search/model.d.ts +54 -0
- package/dist/components/search/model.js +37 -0
- package/dist/components/search/query.d.ts +166 -0
- package/dist/components/search/query.js +436 -0
- package/dist/components/shell/AppFrame.d.ts +14 -0
- package/dist/components/shell/AppFrame.js +80 -0
- package/dist/components/shell/TopBar.d.ts +73 -0
- package/dist/components/shell/TopBar.js +54 -0
- package/dist/components/shell/headerSlot.d.ts +17 -0
- package/dist/components/shell/headerSlot.js +21 -0
- package/dist/components/shell/index.d.ts +2 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/foundations/aria.d.ts +14 -0
- package/dist/foundations/aria.js +18 -0
- package/dist/foundations/calendar.d.ts +28 -0
- package/dist/foundations/calendar.js +183 -0
- package/dist/foundations/copy.d.ts +703 -0
- package/dist/foundations/copy.es.d.ts +2 -0
- package/dist/foundations/copy.es.js +430 -0
- package/dist/foundations/copy.js +520 -0
- package/dist/foundations/density.d.ts +16 -0
- package/dist/foundations/density.js +21 -0
- package/dist/foundations/grouping.d.ts +281 -0
- package/dist/foundations/grouping.js +0 -0
- package/dist/foundations/index.d.ts +14 -0
- package/dist/foundations/index.js +30 -0
- package/dist/foundations/layout.d.ts +9 -0
- package/dist/foundations/layout.js +9 -0
- package/dist/foundations/pivot.d.ts +222 -0
- package/dist/foundations/pivot.js +198 -0
- package/dist/foundations/pivotSheet.d.ts +61 -0
- package/dist/foundations/pivotSheet.js +0 -0
- package/dist/foundations/slots.d.ts +67 -0
- package/dist/foundations/slots.js +63 -0
- package/dist/foundations/sticky.d.ts +53 -0
- package/dist/foundations/sticky.js +150 -0
- package/dist/foundations/surface.d.ts +9 -0
- package/dist/foundations/surface.js +26 -0
- package/dist/foundations/theme.d.ts +42 -0
- package/dist/foundations/theme.js +88 -0
- package/dist/foundations/types.d.ts +23 -0
- package/dist/foundations/types.js +50 -0
- package/dist/foundations/variants.d.ts +19 -0
- package/dist/foundations/variants.js +48 -0
- package/dist/foundations/xlsx.d.ts +86 -0
- package/dist/foundations/xlsx.js +0 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/primitives/block/Block.d.ts +66 -0
- package/dist/primitives/block/Block.js +34 -0
- package/dist/primitives/block/Line.d.ts +18 -0
- package/dist/primitives/block/Line.js +45 -0
- package/dist/primitives/block/SectionGrid.d.ts +30 -0
- package/dist/primitives/block/SectionGrid.js +29 -0
- package/dist/primitives/block/Steps.d.ts +76 -0
- package/dist/primitives/block/Steps.js +43 -0
- package/dist/primitives/block/index.d.ts +4 -0
- package/dist/primitives/block/index.js +7 -0
- package/dist/primitives/button/Button.d.ts +137 -0
- package/dist/primitives/button/Button.js +234 -0
- package/dist/primitives/button/index.d.ts +1 -0
- package/dist/primitives/button/index.js +2 -0
- package/dist/primitives/cell/CellStack.d.ts +47 -0
- package/dist/primitives/cell/CellStack.js +33 -0
- package/dist/primitives/cell/index.d.ts +1 -0
- package/dist/primitives/cell/index.js +3 -0
- package/dist/primitives/choice/ComboBox.d.ts +19 -0
- package/dist/primitives/choice/ComboBox.js +52 -0
- package/dist/primitives/choice/RadioGroup.d.ts +18 -0
- package/dist/primitives/choice/RadioGroup.js +50 -0
- package/dist/primitives/choice/SearchField.d.ts +33 -0
- package/dist/primitives/choice/SearchField.js +46 -0
- package/dist/primitives/choice/SegmentedControl.d.ts +16 -0
- package/dist/primitives/choice/SegmentedControl.js +69 -0
- package/dist/primitives/choice/Slider.d.ts +16 -0
- package/dist/primitives/choice/Slider.js +46 -0
- package/dist/primitives/choice/Switch.d.ts +14 -0
- package/dist/primitives/choice/Switch.js +65 -0
- package/dist/primitives/choice/ThemeSwitcher.d.ts +10 -0
- package/dist/primitives/choice/ThemeSwitcher.js +25 -0
- package/dist/primitives/choice/index.d.ts +8 -0
- package/dist/primitives/choice/index.js +11 -0
- package/dist/primitives/choice/options.d.ts +28 -0
- package/dist/primitives/choice/options.js +6 -0
- package/dist/primitives/date/Calendar.d.ts +31 -0
- package/dist/primitives/date/Calendar.js +134 -0
- package/dist/primitives/date/DatePicker.d.ts +42 -0
- package/dist/primitives/date/DatePicker.js +103 -0
- package/dist/primitives/date/DateTime.d.ts +35 -0
- package/dist/primitives/date/DateTime.js +100 -0
- package/dist/primitives/date/index.d.ts +3 -0
- package/dist/primitives/date/index.js +6 -0
- package/dist/primitives/dialog/Dialog.d.ts +118 -0
- package/dist/primitives/dialog/Dialog.js +121 -0
- package/dist/primitives/dialog/Drill.d.ts +90 -0
- package/dist/primitives/dialog/Drill.js +172 -0
- package/dist/primitives/dialog/index.d.ts +2 -0
- package/dist/primitives/dialog/index.js +4 -0
- package/dist/primitives/disclosure/Disclosure.d.ts +36 -0
- package/dist/primitives/disclosure/Disclosure.js +52 -0
- package/dist/primitives/disclosure/index.d.ts +1 -0
- package/dist/primitives/disclosure/index.js +2 -0
- package/dist/primitives/field/Checks.d.ts +57 -0
- package/dist/primitives/field/Checks.js +72 -0
- package/dist/primitives/field/DropZone.d.ts +42 -0
- package/dist/primitives/field/DropZone.js +52 -0
- package/dist/primitives/field/Field.d.ts +178 -0
- package/dist/primitives/field/Field.js +251 -0
- package/dist/primitives/field/Suggest.d.ts +48 -0
- package/dist/primitives/field/Suggest.js +43 -0
- package/dist/primitives/field/aria.d.ts +61 -0
- package/dist/primitives/field/aria.js +70 -0
- package/dist/primitives/field/context.d.ts +30 -0
- package/dist/primitives/field/context.js +13 -0
- package/dist/primitives/field/copy.d.ts +16 -0
- package/dist/primitives/field/copy.js +69 -0
- package/dist/primitives/field/index.d.ts +9 -0
- package/dist/primitives/field/index.js +15 -0
- package/dist/primitives/field/layout.d.ts +24 -0
- package/dist/primitives/field/layout.js +10 -0
- package/dist/primitives/field/mode.d.ts +9 -0
- package/dist/primitives/field/mode.js +13 -0
- package/dist/primitives/field/note.d.ts +55 -0
- package/dist/primitives/field/note.js +117 -0
- package/dist/primitives/hint/Hint.d.ts +31 -0
- package/dist/primitives/hint/Hint.js +42 -0
- package/dist/primitives/hint/index.d.ts +1 -0
- package/dist/primitives/hint/index.js +1 -0
- package/dist/primitives/index.d.ts +20 -0
- package/dist/primitives/index.js +21 -0
- package/dist/primitives/menu/Menu.d.ts +128 -0
- package/dist/primitives/menu/Menu.js +89 -0
- package/dist/primitives/menu/index.d.ts +1 -0
- package/dist/primitives/menu/index.js +2 -0
- package/dist/primitives/notice/Callout.d.ts +49 -0
- package/dist/primitives/notice/Callout.js +28 -0
- package/dist/primitives/notice/Flag.d.ts +13 -0
- package/dist/primitives/notice/Flag.js +31 -0
- package/dist/primitives/notice/Notice.d.ts +45 -0
- package/dist/primitives/notice/Notice.js +61 -0
- package/dist/primitives/notice/Toast.d.ts +55 -0
- package/dist/primitives/notice/Toast.js +142 -0
- package/dist/primitives/notice/index.d.ts +4 -0
- package/dist/primitives/notice/index.js +6 -0
- package/dist/primitives/overlay/Popover.d.ts +6 -0
- package/dist/primitives/overlay/Popover.js +27 -0
- package/dist/primitives/overlay/PopoverTrigger.d.ts +55 -0
- package/dist/primitives/overlay/PopoverTrigger.js +38 -0
- package/dist/primitives/overlay/Preview.d.ts +19 -0
- package/dist/primitives/overlay/Preview.js +60 -0
- package/dist/primitives/overlay/Tooltip.d.ts +38 -0
- package/dist/primitives/overlay/Tooltip.js +74 -0
- package/dist/primitives/overlay/index.d.ts +4 -0
- package/dist/primitives/overlay/index.js +7 -0
- package/dist/primitives/picker/Picker.d.ts +89 -0
- package/dist/primitives/picker/Picker.js +204 -0
- package/dist/primitives/picker/index.d.ts +1 -0
- package/dist/primitives/picker/index.js +2 -0
- package/dist/primitives/surface/Peek.d.ts +60 -0
- package/dist/primitives/surface/Peek.js +71 -0
- package/dist/primitives/surface/index.d.ts +1 -0
- package/dist/primitives/surface/index.js +2 -0
- package/dist/primitives/table/CellCopy.d.ts +20 -0
- package/dist/primitives/table/CellCopy.js +23 -0
- package/dist/primitives/table/CellEditor.d.ts +14 -0
- package/dist/primitives/table/CellEditor.js +83 -0
- package/dist/primitives/table/DataTable.d.ts +189 -0
- package/dist/primitives/table/DataTable.js +330 -0
- package/dist/primitives/table/EditableTable.d.ts +191 -0
- package/dist/primitives/table/EditableTable.js +617 -0
- package/dist/primitives/table/PivotTable.d.ts +14 -0
- package/dist/primitives/table/PivotTable.js +0 -0
- package/dist/primitives/table/ReportTable.d.ts +38 -0
- package/dist/primitives/table/ReportTable.js +106 -0
- package/dist/primitives/table/RowActions.d.ts +16 -0
- package/dist/primitives/table/RowActions.js +28 -0
- package/dist/primitives/table/SheetTable.d.ts +73 -0
- package/dist/primitives/table/SheetTable.js +230 -0
- package/dist/primitives/table/Table.d.ts +106 -0
- package/dist/primitives/table/Table.js +116 -0
- package/dist/primitives/table/index.d.ts +7 -0
- package/dist/primitives/table/index.js +9 -0
- package/dist/primitives/tabs/Tabs.d.ts +91 -0
- package/dist/primitives/tabs/Tabs.js +56 -0
- package/dist/primitives/tabs/index.d.ts +1 -0
- package/dist/primitives/tabs/index.js +1 -0
- package/dist/primitives/tag/Tag.d.ts +36 -0
- package/dist/primitives/tag/Tag.js +68 -0
- package/dist/primitives/tag/Tags.d.ts +57 -0
- package/dist/primitives/tag/Tags.js +104 -0
- package/dist/primitives/tag/TagsField.d.ts +35 -0
- package/dist/primitives/tag/TagsField.js +186 -0
- package/dist/primitives/tag/choices.d.ts +38 -0
- package/dist/primitives/tag/choices.js +26 -0
- package/dist/primitives/tag/index.d.ts +4 -0
- package/dist/primitives/tag/index.js +8 -0
- package/dist/primitives/toolbar/Toolbar.d.ts +13 -0
- package/dist/primitives/toolbar/Toolbar.js +36 -0
- package/dist/primitives/toolbar/index.d.ts +1 -0
- package/dist/primitives/toolbar/index.js +2 -0
- package/dist/primitives/tree/Tree.d.ts +56 -0
- package/dist/primitives/tree/Tree.js +74 -0
- package/dist/primitives/tree/index.d.ts +1 -0
- package/dist/primitives/tree/index.js +3 -0
- package/dist/primitives/value/Copyable.d.ts +48 -0
- package/dist/primitives/value/Copyable.js +71 -0
- package/dist/primitives/value/Fecha.d.ts +12 -0
- package/dist/primitives/value/Fecha.js +89 -0
- package/dist/primitives/value/Meter.d.ts +29 -0
- package/dist/primitives/value/Meter.js +46 -0
- package/dist/primitives/value/Metric.d.ts +42 -0
- package/dist/primitives/value/Metric.js +38 -0
- package/dist/primitives/value/Person.d.ts +90 -0
- package/dist/primitives/value/Person.js +208 -0
- package/dist/primitives/value/ProgressBar.d.ts +31 -0
- package/dist/primitives/value/ProgressBar.js +53 -0
- package/dist/primitives/value/Relation.d.ts +74 -0
- package/dist/primitives/value/Relation.js +74 -0
- package/dist/primitives/value/Totals.d.ts +121 -0
- package/dist/primitives/value/Totals.js +54 -0
- package/dist/primitives/value/Value.d.ts +40 -0
- package/dist/primitives/value/Value.js +80 -0
- package/dist/primitives/value/index.d.ts +9 -0
- package/dist/primitives/value/index.js +10 -0
- package/dist/tokens.css +1062 -0
- package/dist/views/index.d.ts +2 -0
- package/dist/views/index.js +3 -0
- package/dist/views/list/List.d.ts +119 -0
- package/dist/views/list/List.js +101 -0
- package/dist/views/list/ListView.d.ts +6 -0
- package/dist/views/list/ListView.js +295 -0
- package/dist/views/list/columns.d.ts +18 -0
- package/dist/views/list/columns.js +27 -0
- package/dist/views/list/derive.d.ts +87 -0
- package/dist/views/list/derive.js +207 -0
- package/dist/views/list/index.d.ts +2 -0
- package/dist/views/list/index.js +4 -0
- package/dist/views/list/presentations.d.ts +39 -0
- package/dist/views/list/presentations.js +105 -0
- package/dist/views/list/types.d.ts +284 -0
- package/dist/views/list/types.js +1 -0
- package/dist/views/list/useNarrowList.d.ts +17 -0
- package/dist/views/list/useNarrowList.js +32 -0
- package/dist/views/record/Record.d.ts +145 -0
- package/dist/views/record/Record.js +211 -0
- package/dist/views/record/index.d.ts +1 -0
- package/dist/views/record/index.js +2 -0
- package/package.json +113 -4
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Activity } from "../../components/activity/Activity.js";
|
|
4
|
+
import { Sheet, } from "../../components/form/Sheet.js";
|
|
5
|
+
import { Pager as PagerControl } from "../../components/record/Pager.js";
|
|
6
|
+
import { RecordHeader } from "../../components/record/RecordHeader.js";
|
|
7
|
+
import { RecordBlocking, RecordNoticeIndicator, splitNotices, } from "../../components/record/RecordNotices.js";
|
|
8
|
+
import { RecordSkeleton } from "../../components/record/RecordSkeleton.js";
|
|
9
|
+
import { SmartButton, SmartButtons } from "../../components/record/SmartButtons.js";
|
|
10
|
+
import { StatusBar } from "../../components/record/StatusBar.js";
|
|
11
|
+
import { useUiCopy } from "../../foundations/copy.js";
|
|
12
|
+
import { byDensity, useDensity } from "../../foundations/density.js";
|
|
13
|
+
import { flatten, pick as pickSlot, pickAll, propsOf, slot, slotOf, } from "../../foundations/slots.js";
|
|
14
|
+
import { createNoteRegistry, NoteRegistryContext, } from "../../primitives/field/note.js";
|
|
15
|
+
import { Tabs } from "../../primitives/tabs/Tabs.js";
|
|
16
|
+
import { useEffect, useId, useState, useSyncExternalStore } from "react";
|
|
17
|
+
const pick = (nodes, name) => pickSlot(nodes, name);
|
|
18
|
+
/** El riel: mi lugar delante del registro. Sin él, no hay banda — y eso
|
|
19
|
+
* es exactamente lo que un diálogo quiere. */
|
|
20
|
+
const Rail = slot("rail", (_props) => null);
|
|
21
|
+
const Crumbs = slot("crumbs", (_props) => null);
|
|
22
|
+
const PagerSlot = slot("pager", (_props) => null);
|
|
23
|
+
const Smart = slot("smart", (_props) => null);
|
|
24
|
+
/** Los botones de acción. A lo sumo tres visibles + un `Menu` con `iconOnly`, y
|
|
25
|
+
* la regla de cuáles tres: los que PRODUCEN algo nuevo, nunca los de navegar.
|
|
26
|
+
* Van sin `surface`: lo toman del riel (claro por defecto; oscuro con `Rail surface="chrome"`).
|
|
27
|
+
*
|
|
28
|
+
* Context: on a narrow record (a phone, below `--container-handheld`) the one written
|
|
29
|
+
* with `role="primary"` leaves the rail for a bar stuck to the bottom of the screen,
|
|
30
|
+
* where the thumb is — and with `dirty`, Save and Discard take that bar instead. The
|
|
31
|
+
* rest stay here. Nothing to declare: see THE THUMB BAR in `RecordHeader`. */
|
|
32
|
+
const Actions = slot("actions", (_props) => null);
|
|
33
|
+
/** El estado, como DATOS y no como nodo: la barra vive en el riel y
|
|
34
|
+
* quien la pasaba armada tenía que acordarse de la superficie del riel. Olvidarlo
|
|
35
|
+
* pintaba la paleta del lienzo encima del chrome, y pasó. */
|
|
36
|
+
const Status = slot("status", (_props) => null);
|
|
37
|
+
/** What has to be known about THIS record before acting on it: «este cliente tiene
|
|
38
|
+
* Bs. 1.200 en créditos pendientes · Aplicar», «posible factura duplicada», «vencida
|
|
39
|
+
* hace 12 días», a blocking error from the backend. A `Callout` — the tone, one
|
|
40
|
+
* sentence, an optional `title`, an optional `action` (secondary or ghost: the primary
|
|
41
|
+
* belongs to the rail) and `onDismiss` when it can be put away.
|
|
42
|
+
*
|
|
43
|
+
* Context: written as a child of `Record` or of `Record.Paper`, as many as are true —
|
|
44
|
+
* `{overdue ? <Record.Notice tone="warn">…</Record.Notice> : null}`. Where they go is
|
|
45
|
+
* the record's, and NONE goes among the fields: a `bad` one (blocking) stays visible
|
|
46
|
+
* between the rail and the paper; the rest gather in one indicator in the rail —
|
|
47
|
+
* «⚠ 2 avisos», toned by the most urgent — that opens their list on press. Both in
|
|
48
|
+
* urgency order. A note about ONE field is that field's `note`. See `RecordNotices`.
|
|
49
|
+
*
|
|
50
|
+
* Named `Notice` and not `Alert`: an ARIA `alert` interrupts the screen reader, and a
|
|
51
|
+
* notice that was already true when the record opened interrupts nothing (`Callout`
|
|
52
|
+
* is `role="status"`). */
|
|
53
|
+
const NoticeSlot = slot("notice", (_props) => null);
|
|
54
|
+
/** El papel: el registro. El `<sheet>` blanco sobre el piso. */
|
|
55
|
+
const Paper = slot("paper", (_props) => null);
|
|
56
|
+
const ActivitySlot = slot("activity", (_props) => null);
|
|
57
|
+
/** Los hechos globales del registro. Están en TODAS las páginas, y por eso van
|
|
58
|
+
* arriba del cuaderno y no adentro de una. */
|
|
59
|
+
const Facts = slot("facts", (_props) => null);
|
|
60
|
+
/** El cuaderno. Las solapas salen de las páginas que tenga adentro: una página
|
|
61
|
+
* que no está escrita no tiene solapa, y ésa es toda la declaración. */
|
|
62
|
+
const Pages = slot("pages", (_props) => null);
|
|
63
|
+
const Page = slot("page", (_props) => null);
|
|
64
|
+
export function Record({ identity, error = null, dirty, children }) {
|
|
65
|
+
const d = useDensity();
|
|
66
|
+
const copy = useUiCopy();
|
|
67
|
+
const top = flatten(children);
|
|
68
|
+
const railNode = pick(top, "rail");
|
|
69
|
+
const paperNode = pick(top, "paper");
|
|
70
|
+
const activitySlot = propsOf(pick(top, "activity"));
|
|
71
|
+
/* La escotilla: lo que el arquetipo no previó se dibuja igual, en el papel.
|
|
72
|
+
Que aparezca algo acá es la señal de que al arquetipo le falta una pieza. */
|
|
73
|
+
const loose = top.filter((node) => slotOf(node) !== "rail" && slotOf(node) !== "paper" && slotOf(node) !== "activity");
|
|
74
|
+
const rail = flatten(propsOf(railNode)?.children);
|
|
75
|
+
const crumbs = propsOf(pick(rail, "crumbs"))?.crumbs;
|
|
76
|
+
const pager = propsOf(pick(rail, "pager"));
|
|
77
|
+
const smart = propsOf(pick(rail, "smart"))?.links;
|
|
78
|
+
const actions = propsOf(pick(rail, "actions"))?.children;
|
|
79
|
+
const status = propsOf(pick(rail, "status"));
|
|
80
|
+
/* Las dos preguntas del estado, con la superficie ya resuelta: «¿dónde
|
|
81
|
+
está?» y «¿qué pasó para llegar acá?». */
|
|
82
|
+
const onTheRail = crumbs !== undefined ||
|
|
83
|
+
pager !== undefined ||
|
|
84
|
+
actions !== undefined ||
|
|
85
|
+
dirty !== undefined;
|
|
86
|
+
const railSurface = propsOf(railNode)?.surface ?? "canvas";
|
|
87
|
+
const surface = onTheRail && d === "comfortable" ? railSurface : "canvas";
|
|
88
|
+
const statusBlock = status === undefined ? undefined : (
|
|
89
|
+
/* Apiladas en un bloque: arriba dónde está, abajo qué pasó para llegar.
|
|
90
|
+
Lado a lado competían por el ancho con los botones y quedaban las dos
|
|
91
|
+
truncadas; una debajo de la otra, cada una tiene su línea entera. */
|
|
92
|
+
_jsxs("div", { className: "flex min-w-0 flex-col items-end gap-1.5", children: [status.stages === undefined ? null : (_jsx(StatusBar, { stages: status.stages, current: status.current ?? status.stages[0]?.id ?? "", failed: status.failed ?? false, surface: surface })), status.children] }));
|
|
93
|
+
const paper = propsOf(paperNode);
|
|
94
|
+
const inPaper = [...flatten(paper?.children), ...loose];
|
|
95
|
+
const fields = propsOf(pick(inPaper, "facts"))?.fields;
|
|
96
|
+
/* Written at the top of the record or inside the paper: both are «on the record». */
|
|
97
|
+
const notices = pickAll(inPaper, "notice")
|
|
98
|
+
.map((node) => propsOf(node))
|
|
99
|
+
.filter((notice) => notice !== undefined);
|
|
100
|
+
const { blocking, rest } = splitNotices(notices);
|
|
101
|
+
/* The notes of the record's fields and rows, which the cards register as they mount. */
|
|
102
|
+
const [registry] = useState(createNoteRegistry);
|
|
103
|
+
const notes = useSyncExternalStore(registry.subscribe, registry.snapshot, registry.snapshot);
|
|
104
|
+
/* The panel's open state is the record's, so the rail's indicator can open it. */
|
|
105
|
+
const [ownOpen, setOwnOpen] = useState(activitySlot?.defaultOpen ?? true);
|
|
106
|
+
const activityOpen = activitySlot?.open ?? ownOpen;
|
|
107
|
+
const setActivityOpen = (next) => {
|
|
108
|
+
activitySlot?.onOpenChange?.(next);
|
|
109
|
+
if (activitySlot?.open === undefined)
|
|
110
|
+
setOwnOpen(next);
|
|
111
|
+
};
|
|
112
|
+
const alertsId = useId();
|
|
113
|
+
/* «⚠ 2 avisos» with a panel to go to: open it, then — once it is drawn — bring its
|
|
114
|
+
notices into view and put the focus on them. On a wide record they are beside the
|
|
115
|
+
sheet already; on a narrow one the panel is below and this is the scroll that finds
|
|
116
|
+
it. A counter and not a flag, so pressing it twice moves the focus twice. */
|
|
117
|
+
const [reveal, setReveal] = useState(0);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (reveal === 0)
|
|
120
|
+
return;
|
|
121
|
+
const section = document.getElementById(alertsId);
|
|
122
|
+
if (section === null)
|
|
123
|
+
return;
|
|
124
|
+
section.scrollIntoView({ block: "start" });
|
|
125
|
+
section.focus({ preventScroll: true });
|
|
126
|
+
}, [reveal, alertsId]);
|
|
127
|
+
const notebook = propsOf(pick(inPaper, "pages"));
|
|
128
|
+
const pages = flatten(notebook?.children).filter((node) => slotOf(node) === "page");
|
|
129
|
+
const tabs = pages
|
|
130
|
+
.map((node) => propsOf(node))
|
|
131
|
+
.filter((page) => page !== undefined)
|
|
132
|
+
.map(({ id, label, icon, count, notice }) => ({
|
|
133
|
+
id,
|
|
134
|
+
label,
|
|
135
|
+
...(icon === undefined ? {} : { icon }),
|
|
136
|
+
...(count === undefined ? {} : { count }),
|
|
137
|
+
...(notice === undefined ? {} : { notice }),
|
|
138
|
+
}));
|
|
139
|
+
const current = notebook?.current ?? tabs[0]?.id ?? "";
|
|
140
|
+
const pageBody = pages
|
|
141
|
+
.map((node) => propsOf(node))
|
|
142
|
+
.find((page) => page?.id === current)?.children;
|
|
143
|
+
/* El orden de lectura es el orden de la pantalla: lo escrito ARRIBA del
|
|
144
|
+
cuaderno se dibuja arriba —lo que antes era `sheetBody`—, lo escrito
|
|
145
|
+
debajo se dibuja debajo de la página en curso. Sin cuaderno, el papel es
|
|
146
|
+
sus hijos en orden y no hay una segunda regla. */
|
|
147
|
+
const notebookAt = inPaper.findIndex((node) => slotOf(node) === "pages");
|
|
148
|
+
const free = (nodes) => nodes.filter((node) => slotOf(node) === undefined);
|
|
149
|
+
const above = notebookAt === -1 ? [] : free(inPaper.slice(0, notebookAt));
|
|
150
|
+
const below = notebookAt === -1 ? free(inPaper) : free(inPaper.slice(notebookAt + 1));
|
|
151
|
+
const hasFacts = fields !== undefined && fields.length > 0;
|
|
152
|
+
const globalSheet = hasFacts || above.length > 0;
|
|
153
|
+
const aspectsNode = tabs.length === 0 ? undefined : (_jsx(Tabs, { tabs: tabs, current: current, ...(notebook?.onChange === undefined ? {} : { onSelect: notebook.onChange }) }));
|
|
154
|
+
return (
|
|
155
|
+
/* `flex-1`: the record takes the height its frame gives it, so on a phone the thumb
|
|
156
|
+
bar (last in it, `mt-auto`) reaches the bottom of the screen even when the record is
|
|
157
|
+
shorter than the screen. The extra height has no paint of its own: on a desk
|
|
158
|
+
nothing changes. */
|
|
159
|
+
/* The record knows the notes of its fields and rows: their cards register here. */
|
|
160
|
+
_jsx(NoteRegistryContext, { value: registry, children: _jsx("article", { className: "flex min-w-0 flex-1 flex-col", children: _jsx(RecordHeader, { railSurface: surface, ...(dirty === undefined ? {} : { dirty }), ...(crumbs === undefined ? {} : { crumbs }), ...(pager === undefined
|
|
161
|
+
? {}
|
|
162
|
+
: {
|
|
163
|
+
pager: (_jsx(PagerControl, { index: pager.index, total: pager.total, surface: surface, ...(pager.onPrev === undefined ? {} : { onPrev: pager.onPrev }), ...(pager.onNext === undefined ? {} : { onNext: pager.onNext }) })),
|
|
164
|
+
}), ...(actions === undefined ? {} : { actions }), ...(statusBlock === undefined ? {} : { status: statusBlock }), ...(identity.icon === undefined ? {} : { icon: identity.icon }), title: identity.title, ...(identity.subtitle === undefined ? {} : { subtitle: identity.subtitle }), ...(identity.figure === undefined ? {} : { figure: identity.figure }), ...(identity.tag === undefined ? {} : { tag: identity.tag }), ...(smart === undefined || smart.length === 0
|
|
165
|
+
? {}
|
|
166
|
+
: {
|
|
167
|
+
smart: (_jsx(SmartButtons, { children: smart.map((s) => (_jsx(SmartButton, { icon: s.icon, ...(s.count === undefined ? {} : { count: s.count }), label: s.label, layout: onTheRail && d === "comfortable" ? "inline" : "stacked", ...(s.onClick === undefined ? {} : { onClick: s.onClick }) }, s.label))) })),
|
|
168
|
+
}), ...(aspectsNode === undefined || globalSheet ? {} : { aspects: aspectsNode }), ...(activitySlot === undefined
|
|
169
|
+
? {}
|
|
170
|
+
: {
|
|
171
|
+
activity: (_jsx(Activity, { ...activitySlot, alerts: rest, alertsId: alertsId, open: activityOpen, onToggle: () => setActivityOpen(!activityOpen) })),
|
|
172
|
+
activityLayout: activitySlot.layout ?? "auto",
|
|
173
|
+
}), ...(blocking.length === 0 && error === null
|
|
174
|
+
? {}
|
|
175
|
+
: {
|
|
176
|
+
blocking: (_jsx(RecordBlocking, { notices: blocking, error: error, errorHeading: copy.failed.operation })),
|
|
177
|
+
}), ...(rest.length === 0 && (activitySlot === undefined || notes.length === 0)
|
|
178
|
+
? {}
|
|
179
|
+
: {
|
|
180
|
+
indicator: (_jsx(RecordNoticeIndicator, { notices: rest, anchored: notes.map((entry) => ({ tone: entry.note.tone ?? "info" })), ...(activitySlot === undefined
|
|
181
|
+
? {}
|
|
182
|
+
: {
|
|
183
|
+
/* With a panel, the notices live there: the indicator goes to them
|
|
184
|
+
instead of floating a second copy in a popover. */
|
|
185
|
+
reveal: {
|
|
186
|
+
target: alertsId,
|
|
187
|
+
onReveal: () => {
|
|
188
|
+
setActivityOpen(true);
|
|
189
|
+
setReveal((n) => n + 1);
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
}) })),
|
|
193
|
+
}), children: _jsx("div", { className: "min-w-0", children: _jsx("div", { className: `flex min-w-0 flex-col ${byDensity(d, "gap-(--spacing-block) px-4 pt-(--spacing-block) pb-4", "gap-2.5 pt-2.5 pb-2")}`, children: _jsxs(Sheet, { layout: paper?.layout ?? "stacked", columns: paper?.columns ?? 2, ...(hasFacts ? { fields } : {}), ...(above.length > 0 || (globalSheet && aspectsNode !== undefined)
|
|
194
|
+
? {
|
|
195
|
+
head: (_jsxs(_Fragment, { children: [above, globalSheet && aspectsNode !== undefined ? (_jsx("div", { className: `border-b border-line-strong ${byDensity(d, "-mx-4 px-4", "")}`, children: aspectsNode })) : null] })),
|
|
196
|
+
}
|
|
197
|
+
: {}), children: [pageBody, below] }) }) }) }) }) }));
|
|
198
|
+
}
|
|
199
|
+
Record.Skeleton = RecordSkeleton;
|
|
200
|
+
Record.Rail = Rail;
|
|
201
|
+
Record.Crumbs = Crumbs;
|
|
202
|
+
Record.Pager = PagerSlot;
|
|
203
|
+
Record.Smart = Smart;
|
|
204
|
+
Record.Actions = Actions;
|
|
205
|
+
Record.Status = Status;
|
|
206
|
+
Record.Paper = Paper;
|
|
207
|
+
Record.Activity = ActivitySlot;
|
|
208
|
+
Record.Facts = Facts;
|
|
209
|
+
Record.Pages = Pages;
|
|
210
|
+
Record.Page = Page;
|
|
211
|
+
Record.Notice = NoticeSlot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Record, type RecordIdentity, type RecordNotice, type RecordPager, type RecordProps, type SmartLink, } from "./Record.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,115 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./foundations": {
|
|
14
|
+
"types": "./dist/foundations/index.d.ts",
|
|
15
|
+
"default": "./dist/foundations/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./primitives": {
|
|
18
|
+
"types": "./dist/primitives/index.d.ts",
|
|
19
|
+
"default": "./dist/primitives/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"types": "./dist/components/index.d.ts",
|
|
23
|
+
"default": "./dist/components/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./views": {
|
|
26
|
+
"types": "./dist/views/index.d.ts",
|
|
27
|
+
"default": "./dist/views/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./tokens.css": "./dist/tokens.css"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"**/*.css"
|
|
40
|
+
],
|
|
41
|
+
"prettier": {
|
|
42
|
+
"printWidth": 94
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@tanstack/react-table": "^9.2.4",
|
|
46
|
+
"@tanstack/react-virtual": "^3.13.0",
|
|
47
|
+
"react": ">=19",
|
|
48
|
+
"react-dom": ">=19",
|
|
49
|
+
"tailwindcss": "^4.3.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
53
|
+
"@codemirror/lint": "^6.9.7",
|
|
54
|
+
"@fontsource/ibm-plex-mono": "^5.3.0",
|
|
55
|
+
"@fontsource/ibm-plex-sans": "^5.3.0",
|
|
56
|
+
"@internationalized/date": "^3.12.4",
|
|
57
|
+
"@uiw/react-codemirror": "^4.25.11",
|
|
58
|
+
"lucide-react": "^1.45.0",
|
|
59
|
+
"react-aria": "^3.53.1",
|
|
60
|
+
"react-aria-components": "^1.22.1",
|
|
61
|
+
"tailwind-variants": "^4.0.0",
|
|
62
|
+
"tailwindcss-react-aria-components": "^2.2.0"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@eslint/js": "^10.0.1",
|
|
66
|
+
"@storybook/addon-a11y": "10.6.0",
|
|
67
|
+
"@storybook/addon-docs": "10.6.0",
|
|
68
|
+
"@storybook/addon-mcp": "10.6.0",
|
|
69
|
+
"@storybook/react-vite": "10.6.0",
|
|
70
|
+
"@tailwindcss/vite": "4.3.3",
|
|
71
|
+
"@tanstack/react-table": "^9.2.4",
|
|
72
|
+
"@tanstack/react-virtual": "^3.14.12",
|
|
73
|
+
"@types/node": "^26.6.6",
|
|
74
|
+
"@types/react": "^19.3.0",
|
|
75
|
+
"@types/react-dom": "^19.3.0",
|
|
76
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
77
|
+
"eslint": "^10.11.0",
|
|
78
|
+
"eslint-config-prettier": "^10.1.8",
|
|
79
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
80
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
81
|
+
"prettier": "^3.9.8",
|
|
82
|
+
"puppeteer-core": "^23.11.1",
|
|
83
|
+
"react": "19.3.0",
|
|
84
|
+
"react-dom": "19.3.0",
|
|
85
|
+
"storybook": "10.6.0",
|
|
86
|
+
"tailwindcss": "4.3.3",
|
|
87
|
+
"tsc-alias": "^1.8.16",
|
|
88
|
+
"tsx": "^4.23.13",
|
|
89
|
+
"typescript": "~5.9.3",
|
|
90
|
+
"typescript-eslint": "^8.70.0",
|
|
91
|
+
"vite": "8.3.0"
|
|
92
|
+
},
|
|
93
|
+
"keywords": [
|
|
94
|
+
"design-system",
|
|
95
|
+
"enterprise",
|
|
96
|
+
"erp",
|
|
97
|
+
"react",
|
|
98
|
+
"tailwindcss",
|
|
99
|
+
"ui",
|
|
100
|
+
"sincpro"
|
|
101
|
+
],
|
|
102
|
+
"homepage": "https://github.com/Sincpro-SRL/sincpro_web_ui#readme",
|
|
103
|
+
"repository": {
|
|
104
|
+
"type": "git",
|
|
105
|
+
"url": "git+https://github.com/Sincpro-SRL/sincpro_web_ui.git"
|
|
106
|
+
},
|
|
107
|
+
"bugs": {
|
|
108
|
+
"url": "https://github.com/Sincpro-SRL/sincpro_web_ui/issues"
|
|
109
|
+
},
|
|
110
|
+
"author": "Gutierrez, Andres <andres.gutierrez@sincpro.com.bo>",
|
|
111
|
+
"license": "MIT",
|
|
112
|
+
"engines": {
|
|
113
|
+
"node": ">=26"
|
|
114
|
+
}
|
|
115
|
+
}
|