@sincpro/web-ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +157 -2
- 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/chatter/Chatter.d.ts +161 -0
- package/dist/components/chatter/Chatter.js +232 -0
- package/dist/components/chatter/Messages.d.ts +66 -0
- package/dist/components/chatter/Messages.js +43 -0
- package/dist/components/chatter/Timeline.d.ts +21 -0
- package/dist/components/chatter/Timeline.js +30 -0
- package/dist/components/chatter/index.d.ts +3 -0
- package/dist/components/chatter/index.js +4 -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 +43 -0
- package/dist/components/form/Sheet.js +83 -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 +74 -0
- package/dist/components/lines/LineItems.js +229 -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 +73 -0
- package/dist/components/listing/ListingBar.js +105 -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 +106 -0
- package/dist/components/listing/Row.js +122 -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 +71 -0
- package/dist/components/record/RecordHeader.js +72 -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 +619 -0
- package/dist/foundations/copy.es.d.ts +2 -0
- package/dist/foundations/copy.es.js +377 -0
- package/dist/foundations/copy.js +472 -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 +16 -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 +24 -0
- package/dist/primitives/choice/SearchField.js +27 -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 +110 -0
- package/dist/primitives/date/DatePicker.d.ts +34 -0
- package/dist/primitives/date/DatePicker.js +99 -0
- package/dist/primitives/date/index.d.ts +2 -0
- package/dist/primitives/date/index.js +4 -0
- package/dist/primitives/dialog/Dialog.d.ts +118 -0
- package/dist/primitives/dialog/Dialog.js +121 -0
- package/dist/primitives/dialog/index.d.ts +1 -0
- package/dist/primitives/dialog/index.js +2 -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 +166 -0
- package/dist/primitives/field/Field.js +240 -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/index.d.ts +7 -0
- package/dist/primitives/field/index.js +11 -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/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 +19 -0
- package/dist/primitives/index.js +20 -0
- package/dist/primitives/menu/Menu.d.ts +100 -0
- package/dist/primitives/menu/Menu.js +59 -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/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 +3 -0
- package/dist/primitives/notice/index.js +5 -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/Tooltip.d.ts +38 -0
- package/dist/primitives/overlay/Tooltip.js +74 -0
- package/dist/primitives/overlay/index.d.ts +3 -0
- package/dist/primitives/overlay/index.js +5 -0
- package/dist/primitives/picker/Picker.d.ts +48 -0
- package/dist/primitives/picker/Picker.js +150 -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/CellEditor.d.ts +14 -0
- package/dist/primitives/table/CellEditor.js +83 -0
- package/dist/primitives/table/DataTable.d.ts +135 -0
- package/dist/primitives/table/DataTable.js +244 -0
- package/dist/primitives/table/EditableTable.d.ts +96 -0
- package/dist/primitives/table/EditableTable.js +423 -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 +70 -0
- package/dist/primitives/table/SheetTable.js +197 -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 +32 -0
- package/dist/primitives/tag/TagsField.js +182 -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/value/Copyable.d.ts +37 -0
- package/dist/primitives/value/Copyable.js +50 -0
- package/dist/primitives/value/Fecha.d.ts +12 -0
- package/dist/primitives/value/Fecha.js +80 -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/Relation.d.ts +69 -0
- package/dist/primitives/value/Relation.js +57 -0
- package/dist/primitives/value/Totals.d.ts +26 -0
- package/dist/primitives/value/Totals.js +4 -0
- package/dist/primitives/value/Value.d.ts +77 -0
- package/dist/primitives/value/Value.js +119 -0
- package/dist/primitives/value/index.d.ts +8 -0
- package/dist/primitives/value/index.js +9 -0
- package/dist/tokens.css +1025 -0
- package/dist/views/index.d.ts +2 -0
- package/dist/views/index.js +3 -0
- package/dist/views/list/List.d.ts +113 -0
- package/dist/views/list/List.js +97 -0
- package/dist/views/list/ListView.d.ts +6 -0
- package/dist/views/list/ListView.js +269 -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 +76 -0
- package/dist/views/list/derive.js +181 -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 +103 -0
- package/dist/views/list/types.d.ts +272 -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 +126 -0
- package/dist/views/record/Record.js +141 -0
- package/dist/views/record/index.d.ts +1 -0
- package/dist/views/record/index.js +2 -0
- package/package.json +109 -4
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type SheetField, type SheetLayout } from "../../components/form/Sheet.js";
|
|
2
|
+
import type { Crumb } from "../../components/record/Breadcrumb.js";
|
|
3
|
+
import type { DirtyState } from "../../components/record/DirtyActions.js";
|
|
4
|
+
import { RecordSkeleton } from "../../components/record/RecordSkeleton.js";
|
|
5
|
+
import { type Stage } from "../../components/record/StatusBar.js";
|
|
6
|
+
import type { Surface, Tone } from "../../foundations/types.js";
|
|
7
|
+
import { type TabNotice } from "../../primitives/tabs/Tabs.js";
|
|
8
|
+
import type { LucideIcon } from "lucide-react";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
export type RecordIdentity = {
|
|
11
|
+
icon?: LucideIcon;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/** Who or what it is about, under the title — the customer of an invoice, the
|
|
14
|
+
* supplier of an order. Second in the hierarchy: bigger than a fact, smaller than
|
|
15
|
+
* the title. */
|
|
16
|
+
subtitle?: ReactNode;
|
|
17
|
+
tag?: {
|
|
18
|
+
label: string;
|
|
19
|
+
tone?: Tone;
|
|
20
|
+
};
|
|
21
|
+
/** THE figure of the record — the total of an invoice, the balance of an account —
|
|
22
|
+
* drawn as large as the title, on the right. A record usually has one number people
|
|
23
|
+
* open it for; set among the facts at body size it is just another fact. */
|
|
24
|
+
figure?: {
|
|
25
|
+
label: string;
|
|
26
|
+
value: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** What hangs off the record. It leads somewhere else; it is not a datum. */
|
|
30
|
+
export type SmartLink = {
|
|
31
|
+
icon: LucideIcon;
|
|
32
|
+
count?: number;
|
|
33
|
+
label: string;
|
|
34
|
+
onClick?: () => void;
|
|
35
|
+
};
|
|
36
|
+
/** My place in the set I came from. Not pagination: it says I can move to the
|
|
37
|
+
* next one without going back to the list. */
|
|
38
|
+
export type RecordPager = {
|
|
39
|
+
index: number;
|
|
40
|
+
total: number;
|
|
41
|
+
onPrev?: () => void;
|
|
42
|
+
onNext?: () => void;
|
|
43
|
+
};
|
|
44
|
+
export type { SheetField };
|
|
45
|
+
type RailProps = {
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
/** The rail's surface. `canvas` (the default) is a light control bar; `chrome` is the dark
|
|
48
|
+
* band, an explicit choice. The application bar is the screen's one dark band — a dark
|
|
49
|
+
* rail under it reads as two headers and the record loses its top. */
|
|
50
|
+
surface?: Surface;
|
|
51
|
+
};
|
|
52
|
+
type CrumbsProps = {
|
|
53
|
+
crumbs: readonly Crumb[];
|
|
54
|
+
};
|
|
55
|
+
type SmartProps = {
|
|
56
|
+
links: readonly SmartLink[];
|
|
57
|
+
};
|
|
58
|
+
type ActionsProps = {
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
};
|
|
61
|
+
type StatusProps = {
|
|
62
|
+
stages?: readonly Stage[];
|
|
63
|
+
/** Cuál de las etapas es la de ahora. Sin esto, la primera. */
|
|
64
|
+
current?: string;
|
|
65
|
+
failed?: boolean;
|
|
66
|
+
/** La escotilla del estado, para lo que no es ninguna de las dos. */
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
};
|
|
69
|
+
type PaperProps = {
|
|
70
|
+
/** Cómo ponen la etiqueta los campos de adentro. `horizontal` es etiqueta |
|
|
71
|
+
* valor, que es la forma de Odoo. */
|
|
72
|
+
layout?: SheetLayout;
|
|
73
|
+
columns?: 1 | 2 | 3 | 4;
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
};
|
|
76
|
+
type FactsProps = {
|
|
77
|
+
fields: readonly SheetField[];
|
|
78
|
+
};
|
|
79
|
+
type PagesProps = {
|
|
80
|
+
current?: string;
|
|
81
|
+
onChange?: (id: string) => void;
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
};
|
|
84
|
+
type PageProps = {
|
|
85
|
+
id: string;
|
|
86
|
+
label: string;
|
|
87
|
+
/** La marca de la cara. Con tres o más pestañas, el ícono es lo que se
|
|
88
|
+
* reconoce sin leer. */
|
|
89
|
+
icon?: LucideIcon;
|
|
90
|
+
/** Cuántas cosas hay detrás. `0` se dibuja apagado: «no hay ninguna» es una
|
|
91
|
+
* respuesta, y esconderla obliga a abrir la pestaña para averiguarla. */
|
|
92
|
+
count?: number;
|
|
93
|
+
/** Que algo de esta cara PIDE que lo mires — falló, cambió, llegó. Aparte del
|
|
94
|
+
* contador, porque son dos preguntas: ver `TabNotice`. */
|
|
95
|
+
notice?: TabNotice;
|
|
96
|
+
children?: ReactNode;
|
|
97
|
+
};
|
|
98
|
+
export type RecordProps = {
|
|
99
|
+
identity: RecordIdentity;
|
|
100
|
+
/** Lo que falló al operar sobre el registro. Va arriba del papel, adentro. */
|
|
101
|
+
error?: string | null;
|
|
102
|
+
/** Hay cambios sin guardar. Su presencia REEMPLAZA los botones de acción por
|
|
103
|
+
* guardar y descartar — ver la nota en `RecordHeader`. */
|
|
104
|
+
dirty?: DirtyState;
|
|
105
|
+
children?: ReactNode;
|
|
106
|
+
};
|
|
107
|
+
export declare function Record({ identity, error, dirty, children }: RecordProps): import("react").JSX.Element;
|
|
108
|
+
export declare namespace Record {
|
|
109
|
+
var Skeleton: typeof RecordSkeleton;
|
|
110
|
+
var Rail: ((props: RailProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"rail">;
|
|
111
|
+
var Crumbs: ((props: CrumbsProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"crumbs">;
|
|
112
|
+
var Pager: ((props: RecordPager) => ReactNode) & import("../../foundations/slots.js").Slotted<"pager">;
|
|
113
|
+
var Smart: ((props: SmartProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"smart">;
|
|
114
|
+
var Actions: ((props: ActionsProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"actions">;
|
|
115
|
+
var Status: ((props: StatusProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"status">;
|
|
116
|
+
var Paper: ((props: PaperProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"paper">;
|
|
117
|
+
var Chatter: ((props: {
|
|
118
|
+
children?: ReactNode;
|
|
119
|
+
/** `page` lo pone SIEMPRE debajo y a todo el ancho, como una hoja propia. Sin
|
|
120
|
+
* esto va al costado cuando hay ancho, que es la forma angosta. */
|
|
121
|
+
layout?: "aside" | "page";
|
|
122
|
+
}) => ReactNode) & import("../../foundations/slots.js").Slotted<"chatter">;
|
|
123
|
+
var Facts: ((props: FactsProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"facts">;
|
|
124
|
+
var Pages: ((props: PagesProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"pages">;
|
|
125
|
+
var Page: ((props: PageProps) => ReactNode) & import("../../foundations/slots.js").Slotted<"page">;
|
|
126
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Sheet, } from "../../components/form/Sheet.js";
|
|
4
|
+
import { Pager as PagerControl } from "../../components/record/Pager.js";
|
|
5
|
+
import { RecordHeader } from "../../components/record/RecordHeader.js";
|
|
6
|
+
import { RecordSkeleton } from "../../components/record/RecordSkeleton.js";
|
|
7
|
+
import { SmartButton, SmartButtons } from "../../components/record/SmartButtons.js";
|
|
8
|
+
import { StatusBar } from "../../components/record/StatusBar.js";
|
|
9
|
+
import { useUiCopy } from "../../foundations/copy.js";
|
|
10
|
+
import { byDensity, useDensity } from "../../foundations/density.js";
|
|
11
|
+
import { flatten, pick as pickSlot, propsOf, slot, slotOf, } from "../../foundations/slots.js";
|
|
12
|
+
import { Failed } from "../../primitives/notice/Notice.js";
|
|
13
|
+
import { Tabs } from "../../primitives/tabs/Tabs.js";
|
|
14
|
+
const pick = (nodes, name) => pickSlot(nodes, name);
|
|
15
|
+
/** El riel: mi lugar delante del registro. Sin él, no hay banda — y eso
|
|
16
|
+
* es exactamente lo que un diálogo quiere. */
|
|
17
|
+
const Rail = slot("rail", (_props) => null);
|
|
18
|
+
const Crumbs = slot("crumbs", (_props) => null);
|
|
19
|
+
const PagerSlot = slot("pager", (_props) => null);
|
|
20
|
+
const Smart = slot("smart", (_props) => null);
|
|
21
|
+
/** Los botones de acción. A lo sumo tres visibles + un `Menu` con `iconOnly`, y
|
|
22
|
+
* la regla de cuáles tres: los que PRODUCEN algo nuevo, nunca los de navegar.
|
|
23
|
+
* Van sin `surface`: lo toman del riel (claro por defecto; oscuro con `Rail surface="chrome"`).
|
|
24
|
+
*
|
|
25
|
+
* Context: on a narrow record (a phone, below `--container-handheld`) the one written
|
|
26
|
+
* with `role="primary"` leaves the rail for a bar stuck to the bottom of the screen,
|
|
27
|
+
* where the thumb is — and with `dirty`, Save and Discard take that bar instead. The
|
|
28
|
+
* rest stay here. Nothing to declare: see THE THUMB BAR in `RecordHeader`. */
|
|
29
|
+
const Actions = slot("actions", (_props) => null);
|
|
30
|
+
/** El estado, como DATOS y no como nodo: la barra vive en el riel y
|
|
31
|
+
* quien la pasaba armada tenía que acordarse de la superficie del riel. Olvidarlo
|
|
32
|
+
* pintaba la paleta del lienzo encima del chrome, y pasó. */
|
|
33
|
+
const Status = slot("status", (_props) => null);
|
|
34
|
+
/** El papel: el registro. El `<sheet>` blanco sobre el piso. */
|
|
35
|
+
const Paper = slot("paper", (_props) => null);
|
|
36
|
+
/** Lo que al registro le PASÓ, al costado: mensajes y eventos en una columna.
|
|
37
|
+
*
|
|
38
|
+
* Va al lado y no abajo porque la historia es el contexto de todo lo demás que
|
|
39
|
+
* está en pantalla — leer «la factura fue rechazada» mirando los datos que la
|
|
40
|
+
* produjeron es justamente para lo que sirve, y una sección más abajo obliga a
|
|
41
|
+
* ver una cosa o la otra. Lo que va adentro lo arma quien compone: el kit no
|
|
42
|
+
* sabe qué es un evento de este producto. */
|
|
43
|
+
const ChatterSlot = slot("chatter", (_props) => null);
|
|
44
|
+
/** Los hechos globales del registro. Están en TODAS las páginas, y por eso van
|
|
45
|
+
* arriba del cuaderno y no adentro de una. */
|
|
46
|
+
const Facts = slot("facts", (_props) => null);
|
|
47
|
+
/** El cuaderno. Las solapas salen de las páginas que tenga adentro: una página
|
|
48
|
+
* que no está escrita no tiene solapa, y ésa es toda la declaración. */
|
|
49
|
+
const Pages = slot("pages", (_props) => null);
|
|
50
|
+
const Page = slot("page", (_props) => null);
|
|
51
|
+
export function Record({ identity, error = null, dirty, children }) {
|
|
52
|
+
const d = useDensity();
|
|
53
|
+
const copy = useUiCopy();
|
|
54
|
+
const top = flatten(children);
|
|
55
|
+
const railNode = pick(top, "rail");
|
|
56
|
+
const paperNode = pick(top, "paper");
|
|
57
|
+
const chatterSlot = propsOf(pick(top, "chatter"));
|
|
58
|
+
const chatter = chatterSlot?.children;
|
|
59
|
+
/* La escotilla: lo que el arquetipo no previó se dibuja igual, en el papel.
|
|
60
|
+
Que aparezca algo acá es la señal de que al arquetipo le falta una pieza. */
|
|
61
|
+
const loose = top.filter((node) => slotOf(node) !== "rail" && slotOf(node) !== "paper" && slotOf(node) !== "chatter");
|
|
62
|
+
const rail = flatten(propsOf(railNode)?.children);
|
|
63
|
+
const crumbs = propsOf(pick(rail, "crumbs"))?.crumbs;
|
|
64
|
+
const pager = propsOf(pick(rail, "pager"));
|
|
65
|
+
const smart = propsOf(pick(rail, "smart"))?.links;
|
|
66
|
+
const actions = propsOf(pick(rail, "actions"))?.children;
|
|
67
|
+
const status = propsOf(pick(rail, "status"));
|
|
68
|
+
/* Las dos preguntas del estado, con la superficie ya resuelta: «¿dónde
|
|
69
|
+
está?» y «¿qué pasó para llegar acá?». */
|
|
70
|
+
const onTheRail = crumbs !== undefined ||
|
|
71
|
+
pager !== undefined ||
|
|
72
|
+
actions !== undefined ||
|
|
73
|
+
dirty !== undefined;
|
|
74
|
+
const railSurface = propsOf(railNode)?.surface ?? "canvas";
|
|
75
|
+
const surface = onTheRail && d === "comfortable" ? railSurface : "canvas";
|
|
76
|
+
const statusBlock = status === undefined ? undefined : (
|
|
77
|
+
/* Apiladas en un bloque: arriba dónde está, abajo qué pasó para llegar.
|
|
78
|
+
Lado a lado competían por el ancho con los botones y quedaban las dos
|
|
79
|
+
truncadas; una debajo de la otra, cada una tiene su línea entera. */
|
|
80
|
+
_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] }));
|
|
81
|
+
const paper = propsOf(paperNode);
|
|
82
|
+
const inPaper = [...flatten(paper?.children), ...loose];
|
|
83
|
+
const fields = propsOf(pick(inPaper, "facts"))?.fields;
|
|
84
|
+
const notebook = propsOf(pick(inPaper, "pages"));
|
|
85
|
+
const pages = flatten(notebook?.children).filter((node) => slotOf(node) === "page");
|
|
86
|
+
const tabs = pages
|
|
87
|
+
.map((node) => propsOf(node))
|
|
88
|
+
.filter((page) => page !== undefined)
|
|
89
|
+
.map(({ id, label, icon, count, notice }) => ({
|
|
90
|
+
id,
|
|
91
|
+
label,
|
|
92
|
+
...(icon === undefined ? {} : { icon }),
|
|
93
|
+
...(count === undefined ? {} : { count }),
|
|
94
|
+
...(notice === undefined ? {} : { notice }),
|
|
95
|
+
}));
|
|
96
|
+
const current = notebook?.current ?? tabs[0]?.id ?? "";
|
|
97
|
+
const pageBody = pages
|
|
98
|
+
.map((node) => propsOf(node))
|
|
99
|
+
.find((page) => page?.id === current)?.children;
|
|
100
|
+
/* El orden de lectura es el orden de la pantalla: lo escrito ARRIBA del
|
|
101
|
+
cuaderno se dibuja arriba —lo que antes era `sheetBody`—, lo escrito
|
|
102
|
+
debajo se dibuja debajo de la página en curso. Sin cuaderno, el papel es
|
|
103
|
+
sus hijos en orden y no hay una segunda regla. */
|
|
104
|
+
const notebookAt = inPaper.findIndex((node) => slotOf(node) === "pages");
|
|
105
|
+
const free = (nodes) => nodes.filter((node) => slotOf(node) === undefined);
|
|
106
|
+
const above = notebookAt === -1 ? [] : free(inPaper.slice(0, notebookAt));
|
|
107
|
+
const below = notebookAt === -1 ? free(inPaper) : free(inPaper.slice(notebookAt + 1));
|
|
108
|
+
const hasFacts = fields !== undefined && fields.length > 0;
|
|
109
|
+
const globalSheet = hasFacts || above.length > 0;
|
|
110
|
+
const aspectsNode = tabs.length === 0 ? undefined : (_jsx(Tabs, { tabs: tabs, current: current, ...(notebook?.onChange === undefined ? {} : { onSelect: notebook.onChange }) }));
|
|
111
|
+
return (
|
|
112
|
+
/* `flex-1`: the record takes the height its frame gives it, so on a phone the thumb
|
|
113
|
+
bar (last in it, `mt-auto`) reaches the bottom of the screen even when the record is
|
|
114
|
+
shorter than the screen. The extra height has no paint of its own: on a desk
|
|
115
|
+
nothing changes. */
|
|
116
|
+
_jsx("article", { className: "flex min-w-0 flex-1 flex-col", children: _jsx(RecordHeader, { railSurface: surface, ...(dirty === undefined ? {} : { dirty }), ...(crumbs === undefined ? {} : { crumbs }), ...(pager === undefined
|
|
117
|
+
? {}
|
|
118
|
+
: {
|
|
119
|
+
pager: (_jsx(PagerControl, { index: pager.index, total: pager.total, surface: surface, ...(pager.onPrev === undefined ? {} : { onPrev: pager.onPrev }), ...(pager.onNext === undefined ? {} : { onNext: pager.onNext }) })),
|
|
120
|
+
}), ...(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
|
|
121
|
+
? {}
|
|
122
|
+
: {
|
|
123
|
+
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))) })),
|
|
124
|
+
}), ...(aspectsNode === undefined || globalSheet ? {} : { aspects: aspectsNode }), ...(chatter === undefined ? {} : { chatter }), ...(chatterSlot?.layout === undefined ? {} : { chatterLayout: chatterSlot.layout }), children: _jsxs("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: [error === null ? null : (_jsx(Failed, { heading: copy.failed.operation, sentence: error })), _jsxs(Sheet, { layout: paper?.layout ?? "stacked", columns: paper?.columns ?? 2, ...(hasFacts ? { fields } : {}), ...(above.length > 0 || (globalSheet && aspectsNode !== undefined)
|
|
125
|
+
? {
|
|
126
|
+
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] })),
|
|
127
|
+
}
|
|
128
|
+
: {}), children: [pageBody, below] })] }) }) }));
|
|
129
|
+
}
|
|
130
|
+
Record.Skeleton = RecordSkeleton;
|
|
131
|
+
Record.Rail = Rail;
|
|
132
|
+
Record.Crumbs = Crumbs;
|
|
133
|
+
Record.Pager = PagerSlot;
|
|
134
|
+
Record.Smart = Smart;
|
|
135
|
+
Record.Actions = Actions;
|
|
136
|
+
Record.Status = Status;
|
|
137
|
+
Record.Paper = Paper;
|
|
138
|
+
Record.Chatter = ChatterSlot;
|
|
139
|
+
Record.Facts = Facts;
|
|
140
|
+
Record.Pages = Pages;
|
|
141
|
+
Record.Page = Page;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Record, type RecordIdentity, type RecordPager, type RecordProps, type SmartLink, } from "./Record.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,111 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.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
|
+
"repository": {
|
|
103
|
+
"type": "git",
|
|
104
|
+
"url": "git+https://github.com/Sincpro-SRL/sincpro_web_ui.git"
|
|
105
|
+
},
|
|
106
|
+
"author": "Gutierrez, Andres <andres.gutierrez@sincpro.com.bo>",
|
|
107
|
+
"license": "MIT",
|
|
108
|
+
"engines": {
|
|
109
|
+
"node": ">=26"
|
|
110
|
+
}
|
|
111
|
+
}
|