@scattered-light/loomiere-base-ui 0.15.6 → 0.17.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 +16 -1
- package/dist/{chunk-RLXKWWZG.js → chunk-DBNGJCTF.js} +27 -3
- package/dist/chunk-DBNGJCTF.js.map +1 -0
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +1 -1
- package/dist/design-system/components/StatCard/README.md +52 -0
- package/dist/design-system/components/StatCard/preview.html +19 -0
- 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 +183 -62
- package/dist/{index-BlPgd6jW.d.ts → index-C-lxJXk8.d.ts} +27 -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 +1 -1
- 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/AppBar.css +1 -1
- package/dist/styles/custom/Badge.css +1 -1
- package/dist/styles/custom/Collection.css +1 -1
- package/dist/styles/custom/CollectionPagination.css +1 -1
- package/dist/styles/custom/CollectionToolbar.css +1 -1
- package/dist/styles/custom/DataList.css +1 -1
- package/dist/styles/custom/DataTable.css +1 -1
- package/dist/styles/custom/DatePicker.css +1 -1
- package/dist/styles/custom/DescriptionList.css +4 -2
- 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/PickerButton.css +1 -1
- package/dist/styles/custom/PickerSplit.css +1 -1
- package/dist/styles/custom/Sheet.css +1 -1
- package/dist/styles/custom/SideNav.css +1 -1
- package/dist/styles/custom/Splitter.css +1 -1
- package/dist/styles/custom/StatCard.css +118 -0
- package/dist/styles/custom/StatFigure.css +1 -1
- package/dist/styles/custom/Table.css +1 -1
- package/dist/styles/index.css +2 -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 +1 -1
- package/dist/styles/reset/reset.css +1 -1
- package/dist/styles/tailwind.css +2 -1
- package/package.json +2 -2
- package/dist/chunk-RLXKWWZG.js.map +0 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Use Base UI as usual, with the class names the styles target, or the few wrapper
|
|
|
31
31
|
import {
|
|
32
32
|
Accordion, AlertDialog, Autocomplete, Avatar, Badge, Button, Calendar, Checkbox, CheckboxGroup, Collapsible,
|
|
33
33
|
AppBar, AppBarSpacer, Combobox, ContextMenu, DatePicker, DatePresets, DescriptionItem, DescriptionList, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField, PickerButton, PickerSplit, PickerSplitMain, PickerSplitTrigger,
|
|
34
|
-
OTPField, Popover, PreviewCard, Progress, Radio, ScrollArea, Select, Separator, Sheet, SideNav, SideNavGroup, SideNavItem, SideNavToggle, Slider, Splitter, StatFigure, Switch,
|
|
34
|
+
OTPField, Popover, PreviewCard, Progress, Radio, ScrollArea, Select, Separator, Sheet, SideNav, SideNavGroup, SideNavItem, SideNavToggle, Slider, Splitter, StatCard, StatFigure, Switch,
|
|
35
35
|
Tabs, Toast, Toggle, ToggleGroup, Toolbar, Tooltip, useListDetail,
|
|
36
36
|
} from '@scattered-light/loomiere-base-ui';
|
|
37
37
|
```
|
|
@@ -162,6 +162,21 @@ Pieces for pages that read like an accountant's working paper. They use the them
|
|
|
162
162
|
<StatFigure label="Book balance" value="75.00" caption="DR · Oct 29" underline="double" />
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
`StatCard` is a card for one thing a page lists (an Entity, an account): a heading, a caption, and a row of figures ruled off under them. Give it `href` or `onOpen` and the whole card opens through its title, with one tab stop named by the title. `headingLevel` fits it to the page's outline. `footer` adds a line under the figures, and `tag` puts a small mark (a count of what is new, a status) at the top right.
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
<StatCard
|
|
169
|
+
title="North Company"
|
|
170
|
+
caption="USD · 1 account"
|
|
171
|
+
onOpen={() => open('north')}
|
|
172
|
+
facts={[
|
|
173
|
+
{ label: 'Questions', value: '1', tone: 'accent' },
|
|
174
|
+
{ label: 'Docs', value: '–' },
|
|
175
|
+
{ label: 'Review', value: '2', tone: 'accent' },
|
|
176
|
+
]}
|
|
177
|
+
/>
|
|
178
|
+
```
|
|
179
|
+
|
|
165
180
|
`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
181
|
|
|
167
182
|
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).
|
|
@@ -3538,6 +3538,30 @@ var StatFigure = React10.forwardRef(function StatFigure2({ className, label, val
|
|
|
3538
3538
|
}
|
|
3539
3539
|
);
|
|
3540
3540
|
});
|
|
3541
|
+
var StatCard = React10.forwardRef(function StatCard2({ className, title, caption, facts, href, onOpen, headingLevel = 3, footer, tag, ...props }, ref) {
|
|
3542
|
+
const Heading = `h${headingLevel}`;
|
|
3543
|
+
const interactive = href != null || onOpen != null;
|
|
3544
|
+
return /* @__PURE__ */ jsxs(
|
|
3545
|
+
"article",
|
|
3546
|
+
{
|
|
3547
|
+
ref,
|
|
3548
|
+
className: cn("StatCard", className),
|
|
3549
|
+
"data-interactive": interactive ? "" : void 0,
|
|
3550
|
+
...props,
|
|
3551
|
+
children: [
|
|
3552
|
+
/* @__PURE__ */ jsxs("header", { className: "StatCardHeader", children: [
|
|
3553
|
+
/* @__PURE__ */ jsxs("div", { className: "StatCardHeading", children: [
|
|
3554
|
+
/* @__PURE__ */ jsx(Heading, { className: "StatCardTitle", children: href != null ? /* @__PURE__ */ jsx("a", { className: "StatCardLink", href, children: title }) : onOpen != null ? /* @__PURE__ */ jsx("button", { className: "StatCardLink", type: "button", onClick: onOpen, children: title }) : title }),
|
|
3555
|
+
caption != null ? /* @__PURE__ */ jsx("p", { className: "StatCardCaption", children: caption }) : null
|
|
3556
|
+
] }),
|
|
3557
|
+
tag != null ? /* @__PURE__ */ jsx("span", { className: "StatCardTag", children: tag }) : null
|
|
3558
|
+
] }),
|
|
3559
|
+
/* @__PURE__ */ jsx("div", { className: "StatCardFacts", style: { gridTemplateColumns: `repeat(${Math.max(facts.length, 1)}, minmax(0, 1fr))` }, children: facts.map((fact, index) => /* @__PURE__ */ jsx(StatFigure, { size: "sm", ...fact }, index)) }),
|
|
3560
|
+
footer != null ? /* @__PURE__ */ jsx("div", { className: "StatCardFooter", children: footer }) : null
|
|
3561
|
+
]
|
|
3562
|
+
}
|
|
3563
|
+
);
|
|
3564
|
+
});
|
|
3541
3565
|
var DescriptionList = React10.forwardRef(function DescriptionList2({ className, variant, ...props }, ref) {
|
|
3542
3566
|
return /* @__PURE__ */ jsx("dl", { ref, className: cn("DescriptionList", className), "data-variant": variant === "leader" ? "leader" : void 0, ...props });
|
|
3543
3567
|
});
|
|
@@ -3847,6 +3871,6 @@ var EditableList = {
|
|
|
3847
3871
|
Balance: EditableListBalance
|
|
3848
3872
|
};
|
|
3849
3873
|
|
|
3850
|
-
export { AppBar, AppBarSpacer, 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, PickerButton, PickerSplit, PickerSplitMain, PickerSplitTrigger, Popover, Sheet, SideNav, SideNavGroup, SideNavItem, SideNavToggle, 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 };
|
|
3851
|
-
//# sourceMappingURL=chunk-
|
|
3852
|
-
//# sourceMappingURL=chunk-
|
|
3874
|
+
export { AppBar, AppBarSpacer, 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, PickerButton, PickerSplit, PickerSplitMain, PickerSplitTrigger, Popover, Sheet, SideNav, SideNavGroup, SideNavItem, SideNavToggle, Splitter, SplitterHandle, SplitterPanel, SplitterRoot, StatCard, 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 };
|
|
3875
|
+
//# sourceMappingURL=chunk-DBNGJCTF.js.map
|
|
3876
|
+
//# sourceMappingURL=chunk-DBNGJCTF.js.map
|