@scattered-light/loomiere-base-ui 0.9.0 → 0.11.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-LQWPDLLQ.js → chunk-2NAYVQ2U.js} +54 -3
- package/dist/chunk-2NAYVQ2U.js.map +1 -0
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +1 -1
- package/dist/design-system/components/SideNav/README.md +73 -0
- package/dist/design-system/components/SideNav/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 +242 -59
- package/dist/{index-DdHpYalU.d.ts → index-D4DT1VE-.d.ts} +49 -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 +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/Sheet.css +1 -1
- package/dist/styles/custom/SideNav.css +182 -0
- 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 +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-LQWPDLLQ.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, aC as CURRENCY_SEARCH_THRESHOLD, C as Calendar, e as CalendarProps, f as CurrencyCode, aD 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, aE as KeyOptions, L as ListDetail, u as ListDetailCloseReason, aF as ListDetailDetail, v as ListDetailDetailProps, w as ListDetailLayout, aG as ListDetailList, aH as ListDetailRoot, x as ListDetailRootProps, y as ListDetailValue, aI as MAX_MINOR_UNITS, aJ as MoneyChangeDetails, aK as MoneyDisplay, M as MoneyField, aL as MoneyFieldAffix, aM as MoneyFieldGroup, aN as MoneyFieldInput, z as MoneyFieldProps, aO as MoneyFieldRoot, F as MoneyFieldRootProps, aP as MoneyFieldSteps, aQ as NormalizedPaste, aR as PanelSpec, P as PickerButton, H as PickerButtonProps, I as Preset, J as PresetValue, aS as RuntimePanel, S as Sheet, K as SheetProps, O as SideNav, Q as SideNavGroup, R as SideNavGroupProps, T as SideNavItem, U as SideNavItemProps, V as SideNavProps, W as SideNavToggle, X as SideNavToggleProps, aT as Size, aU as SizeInput, Y as Splitter, aV as SplitterHandle, Z as SplitterHandleProps, aW as SplitterKey, aX as SplitterPanel, _ as SplitterPanelProps, aY as SplitterRoot, $ as SplitterRootProps, a0 as StatFigure, a1 as StatFigureProps, aZ as StoredLayout, a_ as StoredPanel, a2 as addDays, a3 as addMonths, a$ as affixSide, b0 as applyKey, b1 as applyStored, b2 as ariaPercents, a4 as builtinPresets, a5 as clampDate, b3 as createPanels, b4 as cssSize, b5 as currencyName, b6 as currencySymbol, a6 as daysInMonth, a7 as defaultPresets, a8 as defaultWeekStartsOn, a9 as endOfWeek, b7 as formatDay, b8 as formatFull, aa as formatMoney, ab as fromMinorUnits, ac as getCurrencyDigits, b9 as handleTarget, ad as inclusiveDays, ae as isValidCurrency, af as isoWeek, ag as last30Days, ah as last7Days, ai as lastMonth, aj as lastWeek, ba as layoutOf, ak as lengthBlockReason, bb as measure, bc as monthCells, bd as moveFocusDate, al as nextMonth, am as nextWeek, be as normalizePaste, an as orderRange, bf as parseDate, ao as parseDecimalString, bg as parseSize, bh as presetInBounds, bi as resetToDefault, bj as resizeByDelta, ap as resolvePreset, bk as roundHalfExpand, bl as roundingChangesValue, bm as sameSelection, bn as serializeSize, bo as settle, bp as sizeText, aq as startOfWeek, bq as syncPanels, ar as thisMonth, as as thisQuarter, at as thisWeek, au as toDecimalString, av as toMinorUnits, aw as today, ax as todayDate, br as toggleCollapsed, ay as tomorrow, az as useListDetail, bs as valueText, aA as yearToDate, aB as yesterday } from '../index-D4DT1VE-.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, Sheet, 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, 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-2NAYVQ2U.js';
|
|
2
2
|
export { EmptyState } from '../chunk-M7KJASGK.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# SideNav
|
|
2
|
+
|
|
3
|
+
Loomiere component, not part of Base UI. The column of links down the side of a workspace. Rows are ruled apart with a hairline; the current row (aria-current="page") sits on the raised surface with a rule under it in the working-paper ink; counts are figures; group headings are caps labels. SideNavToggle is a small tab-shaped handle on the column's edge, whose chevron turns with the state. The parent sets the width and must not clip the toggle (overflow: visible), since it hangs over the edge. Tokens: side-nav.* (tokens/component/side-nav.json).
|
|
4
|
+
|
|
5
|
+
Use `Loomiere.SideNav`, this package's component: it puts the class names on for you (`import { SideNav } 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
|
+
| `SideNav` | `data-collapsed` |
|
|
14
|
+
| `SideNavToggle` | |
|
|
15
|
+
| `SideNavItem` | `data-current`; `data-disabled` |
|
|
16
|
+
| `SideNavItemText` | |
|
|
17
|
+
| `SideNavItemLabel` | |
|
|
18
|
+
| `SideNavItemHint` | |
|
|
19
|
+
| `SideNavItemCount` | `data-tone`: `quiet` |
|
|
20
|
+
| `SideNavGroupLabel` | |
|
|
21
|
+
| `SideNavToggleIcon` | |
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
From the SideNav stories (`Default`):
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
render: function Render() {
|
|
32
|
+
const [collapsed, setCollapsed] = React.useState(false);
|
|
33
|
+
const [current, setCurrent] = React.useState('dashboard');
|
|
34
|
+
const go = (id: string) => (event: React.MouseEvent) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
setCurrent(id);
|
|
37
|
+
};
|
|
38
|
+
return (
|
|
39
|
+
<div style={{ display: 'flex', height: 520, width: collapsed ? 44 : 240, transition: 'width 150ms' }}>
|
|
40
|
+
<SideNav aria-label="Entity navigation" collapsed={collapsed} style={{ width: '100%' }}>
|
|
41
|
+
<SideNavItem current={current === 'dashboard'} onClick={go('dashboard')}>
|
|
42
|
+
Entity Dashboard
|
|
43
|
+
</SideNavItem>
|
|
44
|
+
<SideNavItem current={current === 'open'} count={5} onClick={go('open')}>
|
|
45
|
+
Open Items
|
|
46
|
+
</SideNavItem>
|
|
47
|
+
<SideNavItem current={current === 'review'} count={2} onClick={go('review')}>
|
|
48
|
+
For Review
|
|
49
|
+
</SideNavItem>
|
|
50
|
+
<SideNavGroup label="Books">
|
|
51
|
+
<SideNavItem current={current === 'accounts'} onClick={go('accounts')}>
|
|
52
|
+
Financial Accounts
|
|
53
|
+
</SideNavItem>
|
|
54
|
+
<SideNavItem current={current === 'chart'} onClick={go('chart')}>
|
|
55
|
+
Chart of Accounts
|
|
56
|
+
</SideNavItem>
|
|
57
|
+
</SideNavGroup>
|
|
58
|
+
<SideNavGroup label="Coming later">
|
|
59
|
+
<SideNavItem disabled hint="Not yet available">
|
|
60
|
+
Invoicing
|
|
61
|
+
</SideNavItem>
|
|
62
|
+
</SideNavGroup>
|
|
63
|
+
<SideNavToggle collapsed={collapsed} onCollapsedChange={setCollapsed} />
|
|
64
|
+
</SideNav>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** countTone="quiet" for a count that is only information, such as a total. */
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The preview also shows `QuietCount`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- @dsCard group="Navigation" height=240 subtitle="Default / QuietCount" -->
|
|
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 C=Object.create;var l=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),k=(e,t)=>{for(var n in t)l(e,n,{get:t[n],enumerable:!0})},D=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of I(t))!x.call(e,s)&&s!==n&&l(e,s,{get:()=>t[s],enumerable:!(r=E(t,s))||r.enumerable});return e};var S=(e,t,n)=>(n=e!=null?C(R(e)):{},D(t||!e||!e.__esModule?l(n,"default",{value:e,enumerable:!0}):n,e));var N=v((L,y)=>{y.exports=window.React});var g=v((Q,f)=>{f.exports=window.Loomiere});var p={};k(p,{Default:()=>F,QuietCount:()=>O,default:()=>u});var m=S(N(),1),a=S(g(),1);var d=window.React;function o(e,t,n){let{children:r,...s}=t||{};return n!==void 0&&(s.key=n),r===void 0?d.createElement(e,s):Array.isArray(r)?d.createElement(e,s,...r):d.createElement(e,s,r)}var T=d.Fragment;var A={title:"Components/Lib/SideNav",component:a.SideNav,parameters:{layout:"fullscreen"},tags:["autodocs","ds:lib"]},u=A,F={render:function(){let[t,n]=m.useState(!1),[r,s]=m.useState("dashboard"),c=w=>b=>{b.preventDefault(),s(w)};return o("div",{style:{display:"flex",height:520,width:t?44:240,transition:"width 150ms"},children:o(a.SideNav,{"aria-label":"Entity navigation",collapsed:t,style:{width:"100%"},children:[o(a.SideNavItem,{current:r==="dashboard",onClick:c("dashboard"),children:"Entity Dashboard"}),o(a.SideNavItem,{current:r==="open",count:5,onClick:c("open"),children:"Open Items"}),o(a.SideNavItem,{current:r==="review",count:2,onClick:c("review"),children:"For Review"}),o(a.SideNavGroup,{label:"Books",children:[o(a.SideNavItem,{current:r==="accounts",onClick:c("accounts"),children:"Financial Accounts"}),o(a.SideNavItem,{current:r==="chart",onClick:c("chart"),children:"Chart of Accounts"})]}),o(a.SideNavGroup,{label:"Coming later",children:o(a.SideNavItem,{disabled:!0,hint:"Not yet available",children:"Invoicing"})}),o(a.SideNavToggle,{collapsed:t,onCollapsedChange:n})]})})}},O={render:()=>o("div",{style:{width:240},children:o(a.SideNav,{"aria-label":"Client navigation",children:[o(a.SideNavItem,{current:!0,children:"Client Dashboard"}),o(a.SideNavItem,{count:6,children:"Open Items"}),o(a.SideNavItem,{count:2,countTone:"quiet",children:"All Entities"})]})})};var i=window.React,h=u||{},j=["Default","QuietCount"];function M({id:e}){let t=p[e],n={...h.args||{},...t.args||{}};return(t.render||(s=>i.createElement(h.component,s)))(n,{args:n,id:e,name:e})}var G=j.map(e=>i.createElement("section",{key:e,className:"ds-story"},i.createElement("p",{className:"ds-story-name"},e.replace(/([a-z])([A-Z])/g,"$1 $2")),i.createElement("div",{className:"ds-story-body"},i.createElement(M,{id:e}))));window.ReactDOM.createRoot(document.getElementById("root")).render(i.createElement(i.Fragment,null,G));})();
|
|
16
|
+
|
|
17
|
+
</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|