@scattered-light/loomiere-base-ui 0.8.0 → 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 +27 -1
- package/dist/{chunk-LJQ3RZDJ.js → chunk-LQWPDLLQ.js} +18 -3
- package/dist/chunk-LQWPDLLQ.js.map +1 -0
- 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/PickerButton/README.md +56 -0
- package/dist/design-system/components/PickerButton/preview.html +19 -0
- 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 +218 -57
- package/dist/{index-CBAo353T.d.ts → index-DdHpYalU.d.ts} +30 -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 +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 +1 -1
- package/dist/styles/custom/DataTable.css +1 -1
- package/dist/styles/custom/DatePicker.css +1 -1
- package/dist/styles/custom/DescriptionList.css +1 -1
- 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 +1 -1
- package/dist/styles/custom/Splitter.css +1 -1
- package/dist/styles/custom/StatFigure.css +1 -1
- package/dist/styles/custom/Table.css +1 -1
- package/dist/styles/index.css +3 -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 +3 -1
- package/package.json +2 -2
- package/dist/chunk-LJQ3RZDJ.js.map +0 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ 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, DescriptionItem, DescriptionList, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField,
|
|
33
|
+
AppBar, AppBarSpacer, Combobox, ContextMenu, DatePicker, DatePresets, DescriptionItem, DescriptionList, Dialog, Drawer, EmptyState, Field, Form, Input, ListDetail, Menu, Menubar, Meter, MoneyField, NumberField, PickerButton,
|
|
34
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';
|
|
@@ -166,6 +166,32 @@ Pieces for pages that read like an accountant's working paper. They use the them
|
|
|
166
166
|
|
|
167
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
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
|
+
|
|
169
195
|
### Collection
|
|
170
196
|
|
|
171
197
|
Install the peer, then import the views from their own entry. `EditableList` does not need it, and comes from `./custom` like Badge.
|
|
@@ -3547,6 +3547,21 @@ var DescriptionItem = React10.forwardRef(function DescriptionItem2({ className,
|
|
|
3547
3547
|
/* @__PURE__ */ jsx("dd", { className: "DescriptionDetails", children })
|
|
3548
3548
|
] });
|
|
3549
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
|
+
});
|
|
3550
3565
|
var EditableListContext = React10.createContext(null);
|
|
3551
3566
|
function slug(value) {
|
|
3552
3567
|
return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "field";
|
|
@@ -3766,6 +3781,6 @@ var EditableList = {
|
|
|
3766
3781
|
Balance: EditableListBalance
|
|
3767
3782
|
};
|
|
3768
3783
|
|
|
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-
|
|
3771
|
-
//# 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
|