@scattered-light/loomiere-base-ui 0.15.5 → 0.16.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-TVZOM4US.js} +24 -3
- package/dist/chunk-TVZOM4US.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 +50 -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 +168 -61
- package/dist/{index-BlPgd6jW.d.ts → index-CoS-HLC1.d.ts} +25 -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 +11 -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 +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 +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 +96 -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/dist/custom/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AppBar, a as AppBarProps, b as AppBarSpacer, c as AppBarSpacerProps, B as Badge, d as BadgeProps,
|
|
1
|
+
export { A as AppBar, a as AppBarProps, b as AppBarSpacer, c as AppBarSpacerProps, B as Badge, d as BadgeProps, aL as CURRENCY_SEARCH_THRESHOLD, C as Calendar, e as CalendarProps, f as CurrencyCode, aM as CurrencySelect, D as DatePicker, g as DatePickerProps, h as DatePresets, i as DatePresetsProps, j as DateRange, k as DateValue, l as DescriptionItem, m as DescriptionItemProps, n as DescriptionList, o as DescriptionListProps, E as EditableList, p as EditableListApi, q as EditableListRootProps, r as EmptyState, s as EmptyStateKind, t as EmptyStateProps, aN as KeyOptions, L as ListDetail, u as ListDetailCloseReason, aO as ListDetailDetail, v as ListDetailDetailProps, w as ListDetailLayout, aP as ListDetailList, aQ as ListDetailRoot, x as ListDetailRootProps, y as ListDetailValue, aR as MAX_MINOR_UNITS, aS as MoneyChangeDetails, aT as MoneyDisplay, M as MoneyField, aU as MoneyFieldAffix, aV as MoneyFieldGroup, aW as MoneyFieldInput, z as MoneyFieldProps, aX as MoneyFieldRoot, F as MoneyFieldRootProps, aY as MoneyFieldSteps, aZ as NormalizedPaste, a_ as PanelSpec, P as PickerButton, H as PickerButtonProps, I as PickerSplit, J as PickerSplitMain, K as PickerSplitMainProps, O as PickerSplitProps, Q as PickerSplitTrigger, R as PickerSplitTriggerProps, S as Preset, T as PresetValue, a$ as RuntimePanel, U as Sheet, V as SheetProps, W as SideNav, X as SideNavGroup, Y as SideNavGroupProps, Z as SideNavItem, _ as SideNavItemProps, $ as SideNavProps, a0 as SideNavToggle, a1 as SideNavToggleProps, b0 as Size, b1 as SizeInput, a2 as Splitter, b2 as SplitterHandle, a3 as SplitterHandleProps, b3 as SplitterKey, b4 as SplitterPanel, a4 as SplitterPanelProps, b5 as SplitterRoot, a5 as SplitterRootProps, a6 as StatCard, a7 as StatCardFact, a8 as StatCardProps, a9 as StatFigure, aa as StatFigureProps, b6 as StoredLayout, b7 as StoredPanel, ab as addDays, ac as addMonths, b8 as affixSide, b9 as applyKey, ba as applyStored, bb as ariaPercents, ad as builtinPresets, ae as clampDate, bc as createPanels, bd as cssSize, be as currencyName, bf as currencySymbol, af as daysInMonth, ag as defaultPresets, ah as defaultWeekStartsOn, ai as endOfWeek, bg as formatDay, bh as formatFull, aj as formatMoney, ak as fromMinorUnits, al as getCurrencyDigits, bi as handleTarget, am as inclusiveDays, an as isValidCurrency, ao as isoWeek, ap as last30Days, aq as last7Days, ar as lastMonth, as as lastWeek, bj as layoutOf, at as lengthBlockReason, bk as measure, bl as monthCells, bm as moveFocusDate, au as nextMonth, av as nextWeek, bn as normalizePaste, aw as orderRange, bo as parseDate, ax as parseDecimalString, bp as parseSize, bq as presetInBounds, br as resetToDefault, bs as resizeByDelta, ay as resolvePreset, bt as roundHalfExpand, bu as roundingChangesValue, bv as sameSelection, bw as serializeSize, bx as settle, by as sizeText, az as startOfWeek, bz as syncPanels, aA as thisMonth, aB as thisQuarter, aC as thisWeek, aD as toDecimalString, aE as toMinorUnits, aF as today, aG as todayDate, bA as toggleCollapsed, aH as tomorrow, aI as useListDetail, bB as valueText, aJ as yearToDate, aK as yesterday } from '../index-CoS-HLC1.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '@base-ui/react';
|
package/dist/custom/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AppBar, AppBarSpacer, Badge, CURRENCY_SEARCH_THRESHOLD, Calendar, CurrencySelect, DatePicker, DatePresets, DescriptionItem, DescriptionList, EditableList, ListDetail, ListDetailDetail, ListDetailList, ListDetailRoot, MAX_MINOR_UNITS, MoneyField, MoneyFieldAffix, MoneyFieldGroup, MoneyFieldInput, MoneyFieldRoot, PickerButton, PickerSplit, PickerSplitMain, PickerSplitTrigger, 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, 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 } from '../chunk-
|
|
1
|
+
export { AppBar, AppBarSpacer, Badge, CURRENCY_SEARCH_THRESHOLD, Calendar, CurrencySelect, DatePicker, DatePresets, DescriptionItem, DescriptionList, EditableList, ListDetail, ListDetailDetail, ListDetailList, ListDetailRoot, MAX_MINOR_UNITS, MoneyField, MoneyFieldAffix, MoneyFieldGroup, MoneyFieldInput, MoneyFieldRoot, PickerButton, PickerSplit, PickerSplitMain, PickerSplitTrigger, 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, 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 } from '../chunk-TVZOM4US.js';
|
|
2
2
|
export { EmptyState } from '../chunk-M7KJASGK.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# StatCard
|
|
2
|
+
|
|
3
|
+
Loomiere component, not part of Base UI. A card for one thing a page lists: a name (the heading), a caption, and a row of StatFigures ruled off under them. With data-interactive the title is a link or a button and its ::after covers the card, so the whole card is the target and the title names it. The hover fill and the focus ring follow the card, not just the title. Tokens: stat-card.* (tokens/component/stat-card.json).
|
|
4
|
+
|
|
5
|
+
Use `Loomiere.StatCard`, this package's component: it puts the class names on for you (`import { StatCard } from '@scattered-light/loomiere-base-ui'`, or from `@scattered-light/loomiere-base-ui/custom`).
|
|
6
|
+
|
|
7
|
+
Not a Base UI part, so there is no base-ui.com page for it.
|
|
8
|
+
|
|
9
|
+
## Classes
|
|
10
|
+
|
|
11
|
+
| Class | Data attributes it answers to |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `StatCard` | `data-interactive` |
|
|
14
|
+
| `StatCardHeader` | |
|
|
15
|
+
| `StatCardTitle` | |
|
|
16
|
+
| `StatCardCaption` | |
|
|
17
|
+
| `StatCardLink` | |
|
|
18
|
+
| `StatCardFacts` | |
|
|
19
|
+
| `StatCardFooter` | |
|
|
20
|
+
|
|
21
|
+
Base UI sets the state attributes (`data-checked`, `data-open`, `data-disabled`...) itself. Set `data-size`, `data-emphasis`, `data-variant` and `data-color` yourself; `data-color` takes any palette name (`primary`, `secondary`, `error`...) and repaints the part in it.
|
|
22
|
+
|
|
23
|
+
## Example
|
|
24
|
+
|
|
25
|
+
From the StatCard stories (`Default`):
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
render: (args) => (
|
|
30
|
+
<div style={grid}>
|
|
31
|
+
<StatCard {...args} href="#north" />
|
|
32
|
+
<StatCard
|
|
33
|
+
{...args}
|
|
34
|
+
title="Boreal Company"
|
|
35
|
+
caption="USD · 3 accounts"
|
|
36
|
+
facts={[
|
|
37
|
+
{ label: 'Questions', value: '–' },
|
|
38
|
+
{ label: 'Docs', value: '4', tone: 'accent' },
|
|
39
|
+
{ label: 'Review', value: '12', tone: 'accent' },
|
|
40
|
+
]}
|
|
41
|
+
href="#boreal"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** onOpen makes the title a button, for an app that navigates without links. */
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The preview also shows `AsButton`, `Static`, `WithFooter`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- @dsCard group="Display" height=480 subtitle="Default / AsButton / Static / WithFooter" -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<style>
|
|
7
|
+
body { margin: 0; padding: var(--sl-space-4, 16px); background: var(--sl-surface-canvas); color: var(--sl-text-primary); }
|
|
8
|
+
#root { display: grid; gap: var(--sl-space-5, 20px); }
|
|
9
|
+
.ds-story-name { margin: 0 0 var(--sl-space-2, 8px); font: var(--sl-font-label-minimize-font, 500 10px sans-serif); color: var(--sl-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
|
|
10
|
+
</style>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script>
|
|
15
|
+
(()=>{var f=Object.create;var i=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),w=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},E=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of g(t))!x.call(e,a)&&a!==o&&i(e,a,{get:()=>t[a],enumerable:!(r=S(t,a))||r.enumerable});return e};var D=(e,t,o)=>(o=e!=null?f(b(e)):{},E(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e));var u=v((M,p)=>{p.exports=window.Loomiere});var d={};w(d,{AsButton:()=>F,Default:()=>C,Static:()=>A,TwoFigures:()=>O,WithFooter:()=>B,default:()=>m});var l=D(u(),1);var c=window.React;function s(e,t,o){let{children:r,...a}=t||{};return o!==void 0&&(a.key=o),r===void 0?c.createElement(e,a):Array.isArray(r)?c.createElement(e,a,...r):c.createElement(e,a,r)}var U=c.Fragment;var R={title:"Components/Lib/StatCard",component:l.StatCard,parameters:{layout:"padded"},tags:["autodocs","ds:lib"],args:{title:"North Company",caption:"USD \xB7 1 account",facts:[{label:"Questions",value:"1",tone:"accent"},{label:"Docs",value:"\u2013"},{label:"Review",value:"2",tone:"accent"}]}},m=R,h={display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(18rem, 1fr))",gap:"16px"},C={render:e=>s("div",{style:h,children:[s(l.StatCard,{...e,href:"#north"}),s(l.StatCard,{...e,title:"Boreal Company",caption:"USD \xB7 3 accounts",facts:[{label:"Questions",value:"\u2013"},{label:"Docs",value:"4",tone:"accent"},{label:"Review",value:"12",tone:"accent"}],href:"#boreal"})]})},F={args:{onOpen:()=>{}}},A={},B={args:{footer:"Last reconciled Oct 29"}},O={args:{facts:[{label:"Book balance",value:"75.00",caption:"DR"},{label:"Unposted",value:"2",tone:"accent"}]}};var n=window.React,y=m||{},j=["Default","AsButton","Static","WithFooter"];function N({id:e}){let t=d[e],o={...y.args||{},...t.args||{}};return(t.render||(a=>n.createElement(y.component,a)))(o,{args:o,id:e,name:e})}var k=j.map(e=>n.createElement("section",{key:e,className:"ds-story"},n.createElement("p",{className:"ds-story-name"},e.replace(/([a-z])([A-Z])/g,"$1 $2")),n.createElement("div",{className:"ds-story-body"},n.createElement(N,{id:e}))));window.ReactDOM.createRoot(document.getElementById("root")).render(n.createElement(n.Fragment,null,k));})();
|
|
16
|
+
|
|
17
|
+
</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|