@scattered-light/loomiere-base-ui 0.7.1 → 0.9.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 +53 -2
- package/dist/{chunk-JUUPOOQQ.js → chunk-LQWPDLLQ.js} +66 -3
- package/dist/chunk-LQWPDLLQ.js.map +1 -0
- package/dist/custom/collection/index.d.ts +6 -1
- package/dist/custom/collection/index.js +18 -12
- 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/AppBar/README.md +58 -0
- package/dist/design-system/components/AppBar/preview.html +19 -0
- 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 +1 -1
- package/dist/design-system/components/DataTable/README.md +1 -1
- package/dist/design-system/components/DataTable/preview.html +38 -38
- 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/PickerButton/README.md +56 -0
- package/dist/design-system/components/PickerButton/preview.html +19 -0
- 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/ToggleGroup/README.md +2 -2
- package/dist/design-system/components/ToggleGroup/preview.html +1 -1
- 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 +531 -56
- package/dist/{index-ChJXlxzq.d.ts → index-DdHpYalU.d.ts} +84 -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 +42 -1
- package/dist/styles/components/Toolbar.css +1 -1
- package/dist/styles/components/Tooltip.css +1 -1
- package/dist/styles/custom/AppBar.css +33 -0
- 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 +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/PickerButton.css +85 -0
- 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 +6 -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 +6 -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
|
+
AppBar, AppBarSpacer, Combobox, ContextMenu, DatePicker, DatePresets, DescriptionItem, DescriptionList, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField, PickerButton,
|
|
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,57 @@ 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
|
+
|
|
169
|
+
### App bar: AppBar, PickerButton and a segmented ToggleGroup
|
|
170
|
+
|
|
171
|
+
`AppBar` is the bar across the top of an app window: one row on a line in the rule color, so an ink-rule brand gets the working-paper rule under it. `AppBarSpacer` pushes what follows it to the end, and a vertical `Separator` is a short divider between icon actions. Icon actions are quiet `Button`s holding only an icon, with an `aria-label`.
|
|
172
|
+
|
|
173
|
+
`PickerButton` names what it picks with a caps label before the choice. It opens nothing itself; render it as a trigger:
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
<AppBar>
|
|
177
|
+
<strong>tullo</strong>
|
|
178
|
+
<Menu.Root>
|
|
179
|
+
<Menu.Trigger render={(props) => <PickerButton {...props} label="Entity" value={entity.name} />} />
|
|
180
|
+
{/* Menu.Portal, Positioner, Popup, RadioGroup... */}
|
|
181
|
+
</Menu.Root>
|
|
182
|
+
<AppBarSpacer />
|
|
183
|
+
<ToggleGroup data-variant="segmented" aria-label="Modules" value={[module]} onValueChange={...}>
|
|
184
|
+
<Toggle value="accounting">Accounting</Toggle>
|
|
185
|
+
<Toggle value="tax">Tax</Toggle>
|
|
186
|
+
</ToggleGroup>
|
|
187
|
+
<Button emphasis="quiet" aria-label="Documents"><DocumentIcon /></Button>
|
|
188
|
+
<Separator orientation="vertical" />
|
|
189
|
+
<Button emphasis="quiet" aria-label="More"><MoreIcon /></Button>
|
|
190
|
+
</AppBar>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`data-variant="segmented"` on a `ToggleGroup` joins its toggles in one outline (`toggle-group.segmented-border-color`, the rule color) and fills the pressed one solid (`fill.inverse`), for switching between a few views or modules.
|
|
194
|
+
|
|
144
195
|
### Collection
|
|
145
196
|
|
|
146
197
|
Install the peer, then import the views from their own entry. `EditableList` does not need it, and comes from `./custom` like Badge.
|
|
@@ -3499,6 +3499,69 @@ 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
|
+
});
|
|
3550
|
+
var AppBar = React10.forwardRef(function AppBar2({ className, ...props }, ref) {
|
|
3551
|
+
return /* @__PURE__ */ jsx("header", { ref, className: cn("AppBar", className), ...props });
|
|
3552
|
+
});
|
|
3553
|
+
var AppBarSpacer = React10.forwardRef(function AppBarSpacer2({ className, ...props }, ref) {
|
|
3554
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("AppBarSpacer", className), "aria-hidden": "true", ...props });
|
|
3555
|
+
});
|
|
3556
|
+
var PickerButton = React10.forwardRef(function PickerButton2({ className, label, value, placeholder, type = "button", children, ...props }, ref) {
|
|
3557
|
+
const empty = value == null || value === "";
|
|
3558
|
+
return /* @__PURE__ */ jsxs("button", { ref, type, className: cn("PickerButton", className), ...props, children: [
|
|
3559
|
+
/* @__PURE__ */ jsx("span", { className: "PickerButtonLabel", children: label }),
|
|
3560
|
+
/* @__PURE__ */ jsx("span", { className: "PickerButtonValue", "data-placeholder": empty ? "" : void 0, children: empty ? placeholder : value }),
|
|
3561
|
+
children,
|
|
3562
|
+
/* @__PURE__ */ jsx("svg", { className: "PickerButtonIcon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" }) })
|
|
3563
|
+
] });
|
|
3564
|
+
});
|
|
3502
3565
|
var EditableListContext = React10.createContext(null);
|
|
3503
3566
|
function slug(value) {
|
|
3504
3567
|
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "field";
|
|
@@ -3718,6 +3781,6 @@ var EditableList = {
|
|
|
3718
3781
|
Balance: EditableListBalance
|
|
3719
3782
|
};
|
|
3720
3783
|
|
|
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-
|
|
3784
|
+
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, 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 };
|
|
3785
|
+
//# sourceMappingURL=chunk-LQWPDLLQ.js.map
|
|
3786
|
+
//# sourceMappingURL=chunk-LQWPDLLQ.js.map
|