@scattered-light/loomiere-base-ui 0.7.0 → 0.8.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 +29 -4
- package/dist/{chunk-JUUPOOQQ.js → chunk-LJQ3RZDJ.js} +51 -3
- package/dist/chunk-LJQ3RZDJ.js.map +1 -0
- package/dist/custom/collection/index.d.ts +13 -2
- package/dist/custom/collection/index.js +53 -29
- package/dist/custom/collection/index.js.map +1 -1
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +1 -1
- package/dist/design-system/components/Collection/README.md +1 -1
- package/dist/design-system/components/CollectionToolbar/README.md +7 -2
- package/dist/design-system/components/ContextMenu/README.md +1 -1
- package/dist/design-system/components/ContextMenu/preview.html +1 -1
- package/dist/design-system/components/DataList/README.md +1 -1
- package/dist/design-system/components/DataList/preview.html +171 -171
- package/dist/design-system/components/DataTable/README.md +1 -1
- package/dist/design-system/components/DataTable/preview.html +176 -176
- package/dist/design-system/components/DescriptionList/README.md +41 -0
- package/dist/design-system/components/DescriptionList/preview.html +19 -0
- package/dist/design-system/components/Drawer/README.md +1 -1
- package/dist/design-system/components/ScrollArea/preview.html +2 -2
- package/dist/design-system/components/Sheet/README.md +46 -0
- package/dist/design-system/components/Sheet/preview.html +19 -0
- package/dist/design-system/components/StatFigure/README.md +38 -0
- package/dist/design-system/components/StatFigure/preview.html +19 -0
- package/dist/design-system/components/Table/README.md +2 -2
- package/dist/design-system/components/Table/preview.html +2 -2
- package/dist/design-system/components/bundle.js +7 -7
- package/dist/design-system/components/index.d.ts +1 -1
- package/dist/design-system/components/styles.css +457 -60
- package/dist/{index-ChJXlxzq.d.ts → index-CBAo353T.d.ts} +55 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/components/Accordion.css +1 -1
- package/dist/styles/components/AlertDialog.css +1 -1
- package/dist/styles/components/Autocomplete.css +1 -1
- package/dist/styles/components/Avatar.css +1 -1
- package/dist/styles/components/Button.css +1 -1
- package/dist/styles/components/Checkbox.css +1 -1
- package/dist/styles/components/CheckboxGroup.css +1 -1
- package/dist/styles/components/Collapsible.css +1 -1
- package/dist/styles/components/Combobox.css +1 -1
- package/dist/styles/components/ContextMenu.css +1 -1
- package/dist/styles/components/Dialog.css +1 -1
- package/dist/styles/components/Drawer.css +8 -2
- package/dist/styles/components/Field.css +1 -1
- package/dist/styles/components/Fieldset.css +1 -1
- package/dist/styles/components/Form.css +1 -1
- package/dist/styles/components/Input.css +1 -1
- package/dist/styles/components/Menu.css +1 -1
- package/dist/styles/components/Menubar.css +1 -1
- package/dist/styles/components/Meter.css +1 -1
- package/dist/styles/components/NavigationMenu.css +1 -1
- package/dist/styles/components/NumberField.css +1 -1
- package/dist/styles/components/OTPField.css +1 -1
- package/dist/styles/components/Popover.css +1 -1
- package/dist/styles/components/PreviewCard.css +1 -1
- package/dist/styles/components/Progress.css +1 -1
- package/dist/styles/components/Radio.css +1 -1
- package/dist/styles/components/ScrollArea.css +1 -1
- package/dist/styles/components/Select.css +1 -1
- package/dist/styles/components/Separator.css +1 -1
- package/dist/styles/components/Slider.css +1 -1
- package/dist/styles/components/Switch.css +1 -1
- package/dist/styles/components/Tabs.css +1 -1
- package/dist/styles/components/Toast.css +1 -1
- package/dist/styles/components/Toggle.css +1 -1
- package/dist/styles/components/ToggleGroup.css +1 -1
- package/dist/styles/components/Toolbar.css +1 -1
- package/dist/styles/components/Tooltip.css +1 -1
- package/dist/styles/custom/Badge.css +1 -1
- package/dist/styles/custom/Collection.css +2 -2
- package/dist/styles/custom/CollectionPagination.css +1 -1
- package/dist/styles/custom/CollectionToolbar.css +87 -4
- package/dist/styles/custom/DataList.css +19 -1
- package/dist/styles/custom/DataTable.css +1 -1
- package/dist/styles/custom/DatePicker.css +1 -1
- package/dist/styles/custom/DescriptionList.css +75 -0
- package/dist/styles/custom/EditableList.css +1 -1
- package/dist/styles/custom/EmptyState.css +1 -1
- package/dist/styles/custom/ListDetail.css +1 -1
- package/dist/styles/custom/MoneyField.css +1 -1
- package/dist/styles/custom/Sheet.css +90 -0
- package/dist/styles/custom/Splitter.css +1 -1
- package/dist/styles/custom/StatFigure.css +60 -0
- package/dist/styles/custom/Table.css +63 -1
- package/dist/styles/index.css +4 -1
- package/dist/styles/reset/accessibility.css +1 -1
- package/dist/styles/reset/reset-accessibility.css +1 -1
- package/dist/styles/reset/reset-tailwind.css +2 -2
- package/dist/styles/reset/reset.css +2 -2
- package/dist/styles/tailwind.css +4 -1
- package/package.json +2 -2
- package/dist/chunk-JUUPOOQQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -30,8 +30,8 @@ Use Base UI as usual, with the class names the styles target, or the few wrapper
|
|
|
30
30
|
```tsx
|
|
31
31
|
import {
|
|
32
32
|
Accordion, AlertDialog, Autocomplete, Avatar, Badge, Button, Calendar, Checkbox, CheckboxGroup, Collapsible,
|
|
33
|
-
Combobox, ContextMenu, DatePicker, DatePresets, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField,
|
|
34
|
-
OTPField, Popover, PreviewCard, Progress, Radio, ScrollArea, Select, Separator, Slider, Splitter, Switch,
|
|
33
|
+
Combobox, ContextMenu, DatePicker, DatePresets, DescriptionItem, DescriptionList, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField,
|
|
34
|
+
OTPField, Popover, PreviewCard, Progress, Radio, ScrollArea, Select, Separator, Sheet, Slider, Splitter, StatFigure, Switch,
|
|
35
35
|
Tabs, Toast, Toggle, ToggleGroup, Toolbar, Tooltip, useListDetail,
|
|
36
36
|
} from '@scattered-light/loomiere-base-ui';
|
|
37
37
|
```
|
|
@@ -141,6 +141,31 @@ A filtered table keeps its header. The empty row does not hover:
|
|
|
141
141
|
</Combobox.Empty>
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
### Working papers: Sheet, StatFigure, DescriptionList and ruled totals
|
|
145
|
+
|
|
146
|
+
Pieces for pages that read like an accountant's working paper. They use the theme's rule color (`rule.color`) and the `caps-condense` and `figures-*` text styles, so they follow the brand.
|
|
147
|
+
|
|
148
|
+
`Sheet` is a section with a heavier rule across its top and an optional tab label sitting on the rule. The label names the section; without one, give it an `aria-label`. `action` sits at the end of the header row. Content runs edge to edge, and a Table, DataTable or DataList directly inside drops its own frame; `inset` pads free content instead.
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<Sheet label="Profile" action={<a href="/entity/edit">Edit</a>}>
|
|
152
|
+
<DescriptionList variant="leader">
|
|
153
|
+
<DescriptionItem label="Legal name">North Company LLC</DescriptionItem>
|
|
154
|
+
<DescriptionItem label="Fiscal year">Starts January</DescriptionItem>
|
|
155
|
+
</DescriptionList>
|
|
156
|
+
</Sheet>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`StatFigure` is one large figure with a caps label and an optional caption. `underline="double"` is the double rule under a final total, `tone="accent"` colors a figure that asks for action, and `size="sm"` fits a row of figures in a card. Pass the figure already formatted (`"(40.00)"`).
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
<StatFigure label="Book balance" value="75.00" caption="DR · Oct 29" underline="double" />
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`DescriptionList` holds `DescriptionItem` pairs (a `dt` and a `dd`). The default sets labels in a column beside their values; `variant="leader"` runs a dotted leader from each label to its value at the end of the row.
|
|
166
|
+
|
|
167
|
+
Totals in a plain table are rows: `<tr data-total="subtotal">` rules a line above, `<tr data-total="grand">` adds a double rule under. Put `data-rule="none"` on label and blank cells so the rules only run under the figures. In a DataTable, `totalStyle="subtotal"` or `"grand"` does the same to the footer (the default, `"band"`, keeps the header tray).
|
|
168
|
+
|
|
144
169
|
### Collection
|
|
145
170
|
|
|
146
171
|
Install the peer, then import the views from their own entry. `EditableList` does not need it, and comes from `./custom` like Badge.
|
|
@@ -158,9 +183,9 @@ import { EditableList } from '@scattered-light/loomiere-base-ui/custom';
|
|
|
158
183
|
|
|
159
184
|
Columns decide how a value sorts, searches, filters and totals. `rowHeader` names the row. One column may use a tabs filter. Money totals add in minor units. Search is deferred, not debounced.
|
|
160
185
|
|
|
161
|
-
The toolbar keeps the tabs and the search while rows are selected, and swaps the trailing controls for the selection bar, so the bar does not push the search down. A list sorts from the toolbar. A table sorts from its headers. Sort cycles ascending, descending, then back to the system's default.
|
|
186
|
+
The toolbar keeps the tabs and the search while rows are selected, and swaps the trailing controls for the selection bar, so the bar does not push the search down. The search grows to fill the row beside the filters and actions, and wraps to its own line before it gets narrower than `collection.search-min-width`. Its icon and its clear button sit inside the field, and that clear button is the only one: the toolbar has no Clear filters button. When nothing matches, the no-results state in the table or list offers Clear filters. A list sorts from the toolbar. A table sorts from its headers. Sort cycles ascending, descending, then back to the system's default.
|
|
162
187
|
|
|
163
|
-
Keyboard, on a table or a list, when a row can be activated: the row-header buttons are one tab stop. Up and Down move between rows. Home and End go to the first and last row on the page. Space toggles that row's checkbox. Enter activates the row. Escape clears the search when it has text. Arrow keys do nothing while focus is in a field inside a cell. This is a data table, not a grid.
|
|
188
|
+
Keyboard, on a table or a list, when a row can be activated: the row-header buttons are one tab stop. Up and Down move between rows. Home and End go to the first and last row on the page. Space toggles that row's checkbox. Enter activates the row. Escape clears the search when it has text, and so does the clear button inside the field. Arrow keys do nothing while focus is in a field inside a cell. This is a data table, not a grid.
|
|
164
189
|
|
|
165
190
|
State attributes on the view: `data-sorted`, `data-filtered`, `data-selecting`, `data-loading`, `data-grouped`, `data-view` (`table` or `list`), `data-size` (`sm` or `md`).
|
|
166
191
|
|
|
@@ -3499,6 +3499,54 @@ var ListDetail = {
|
|
|
3499
3499
|
List: ListDetailList,
|
|
3500
3500
|
Detail: ListDetailDetail
|
|
3501
3501
|
};
|
|
3502
|
+
var Sheet = React10.forwardRef(function Sheet2({ className, label, action, inset, children, ...props }, ref) {
|
|
3503
|
+
const labelId = React10.useId();
|
|
3504
|
+
const named = label != null && props["aria-label"] == null && props["aria-labelledby"] == null;
|
|
3505
|
+
return /* @__PURE__ */ jsxs(
|
|
3506
|
+
"section",
|
|
3507
|
+
{
|
|
3508
|
+
ref,
|
|
3509
|
+
className: cn("Sheet", className),
|
|
3510
|
+
"data-tab": label != null ? "" : void 0,
|
|
3511
|
+
"aria-labelledby": named ? labelId : void 0,
|
|
3512
|
+
...props,
|
|
3513
|
+
children: [
|
|
3514
|
+
label != null || action != null ? /* @__PURE__ */ jsxs("div", { className: "SheetHeader", children: [
|
|
3515
|
+
label != null ? /* @__PURE__ */ jsx("span", { className: "SheetTab", id: labelId, children: label }) : null,
|
|
3516
|
+
action != null ? /* @__PURE__ */ jsx("span", { className: "SheetAction", children: action }) : null
|
|
3517
|
+
] }) : null,
|
|
3518
|
+
/* @__PURE__ */ jsx("div", { className: "SheetBody", "data-inset": inset ? "" : void 0, children })
|
|
3519
|
+
]
|
|
3520
|
+
}
|
|
3521
|
+
);
|
|
3522
|
+
});
|
|
3523
|
+
var StatFigure = React10.forwardRef(function StatFigure2({ className, label, value, caption, underline, tone, size, ...props }, ref) {
|
|
3524
|
+
return /* @__PURE__ */ jsxs(
|
|
3525
|
+
"div",
|
|
3526
|
+
{
|
|
3527
|
+
ref,
|
|
3528
|
+
className: cn("StatFigure", className),
|
|
3529
|
+
"data-underline": underline === "double" ? "double" : void 0,
|
|
3530
|
+
"data-tone": tone === "accent" ? "accent" : void 0,
|
|
3531
|
+
"data-size": size === "sm" ? "sm" : void 0,
|
|
3532
|
+
...props,
|
|
3533
|
+
children: [
|
|
3534
|
+
/* @__PURE__ */ jsx("span", { className: "StatFigureLabel", children: label }),
|
|
3535
|
+
/* @__PURE__ */ jsx("span", { className: "StatFigureValue", children: value }),
|
|
3536
|
+
caption != null ? /* @__PURE__ */ jsx("span", { className: "StatFigureCaption", children: caption }) : null
|
|
3537
|
+
]
|
|
3538
|
+
}
|
|
3539
|
+
);
|
|
3540
|
+
});
|
|
3541
|
+
var DescriptionList = React10.forwardRef(function DescriptionList2({ className, variant, ...props }, ref) {
|
|
3542
|
+
return /* @__PURE__ */ jsx("dl", { ref, className: cn("DescriptionList", className), "data-variant": variant === "leader" ? "leader" : void 0, ...props });
|
|
3543
|
+
});
|
|
3544
|
+
var DescriptionItem = React10.forwardRef(function DescriptionItem2({ className, label, children, ...props }, ref) {
|
|
3545
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("DescriptionItem", className), ...props, children: [
|
|
3546
|
+
/* @__PURE__ */ jsx("dt", { className: "DescriptionTerm", children: label }),
|
|
3547
|
+
/* @__PURE__ */ jsx("dd", { className: "DescriptionDetails", children })
|
|
3548
|
+
] });
|
|
3549
|
+
});
|
|
3502
3550
|
var EditableListContext = React10.createContext(null);
|
|
3503
3551
|
function slug(value) {
|
|
3504
3552
|
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "field";
|
|
@@ -3718,6 +3766,6 @@ var EditableList = {
|
|
|
3718
3766
|
Balance: EditableListBalance
|
|
3719
3767
|
};
|
|
3720
3768
|
|
|
3721
|
-
export { Badge, CURRENCY_SEARCH_THRESHOLD, Calendar, CurrencySelect, DatePicker, DatePresets, Drawer, EditableList, Field, ListDetail, ListDetailDetail, ListDetailList, ListDetailRoot, MAX_MINOR_UNITS, MoneyField, MoneyFieldAffix, MoneyFieldGroup, MoneyFieldInput, MoneyFieldRoot, NumberField, Popover, Splitter, SplitterHandle, SplitterPanel, SplitterRoot, addDays, addMonths, affixSide, applyKey, applyStored, ariaPercents, builtinPresets, clampDate, createPanels, cssSize, currencyName, currencySymbol, daysInMonth, defaultPresets, defaultWeekStartsOn, endOfWeek, formatDay, formatFull, formatMoney2 as formatMoney, fromMinorUnits, getCurrencyDigits, handleTarget, inclusiveDays, isValidCurrency, isoWeek, last30Days, last7Days, lastMonth, lastWeek, layoutOf, lengthBlockReason, measure, monthCells, moveFocusDate, nextMonth, nextWeek, normalizePaste, orderRange, parseDate, parseDecimalString, parseSize, presetInBounds, resetToDefault, resizeByDelta, resolvePreset, roundHalfExpand, roundingChangesValue, sameSelection, serializeSize, settle, sizeText, startOfWeek, syncPanels, thisMonth, thisQuarter, thisWeek, toDecimalString, toMinorUnits, today, todayDate, toggleCollapsed, tomorrow, useListDetail, valueText, yearToDate, yesterday };
|
|
3722
|
-
//# sourceMappingURL=chunk-
|
|
3723
|
-
//# sourceMappingURL=chunk-
|
|
3769
|
+
export { Badge, CURRENCY_SEARCH_THRESHOLD, Calendar, CurrencySelect, DatePicker, DatePresets, DescriptionItem, DescriptionList, Drawer, EditableList, Field, ListDetail, ListDetailDetail, ListDetailList, ListDetailRoot, MAX_MINOR_UNITS, MoneyField, MoneyFieldAffix, MoneyFieldGroup, MoneyFieldInput, MoneyFieldRoot, NumberField, Popover, Sheet, Splitter, SplitterHandle, SplitterPanel, SplitterRoot, StatFigure, addDays, addMonths, affixSide, applyKey, applyStored, ariaPercents, builtinPresets, clampDate, createPanels, cssSize, currencyName, currencySymbol, daysInMonth, defaultPresets, defaultWeekStartsOn, endOfWeek, formatDay, formatFull, formatMoney2 as formatMoney, fromMinorUnits, getCurrencyDigits, handleTarget, inclusiveDays, isValidCurrency, isoWeek, last30Days, last7Days, lastMonth, lastWeek, layoutOf, lengthBlockReason, measure, monthCells, moveFocusDate, nextMonth, nextWeek, normalizePaste, orderRange, parseDate, parseDecimalString, parseSize, presetInBounds, resetToDefault, resizeByDelta, resolvePreset, roundHalfExpand, roundingChangesValue, sameSelection, serializeSize, settle, sizeText, startOfWeek, syncPanels, thisMonth, thisQuarter, thisWeek, toDecimalString, toMinorUnits, today, todayDate, toggleCollapsed, tomorrow, useListDetail, valueText, yearToDate, yesterday };
|
|
3770
|
+
//# sourceMappingURL=chunk-LJQ3RZDJ.js.map
|
|
3771
|
+
//# sourceMappingURL=chunk-LJQ3RZDJ.js.map
|