@hjmds/react 1.9.0 → 1.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 +14 -0
- package/THIRD_PARTY_NOTICES.md +78 -0
- package/dist/activity-heatmap.d.ts +10 -0
- package/dist/activity-heatmap.d.ts.map +1 -0
- package/dist/activity-heatmap.js +6 -0
- package/dist/activity-heatmap.js.map +1 -0
- package/dist/advanced-display.d.ts +3 -0
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +9 -7
- package/dist/advanced-display.js.map +1 -1
- package/dist/auth-screen.d.ts +8 -0
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +5 -2
- package/dist/auth-screen.js.map +1 -1
- package/dist/avatar-blobatar-motion.d.ts +6 -0
- package/dist/avatar-blobatar-motion.d.ts.map +1 -0
- package/dist/avatar-blobatar-motion.js +22 -0
- package/dist/avatar-blobatar-motion.js.map +1 -0
- package/dist/avatar-blobatar.d.ts +6 -0
- package/dist/avatar-blobatar.d.ts.map +1 -0
- package/dist/avatar-blobatar.js +10 -0
- package/dist/avatar-blobatar.js.map +1 -0
- package/dist/bottom-navigation.d.ts.map +1 -1
- package/dist/bottom-navigation.js +3 -3
- package/dist/bottom-navigation.js.map +1 -1
- package/dist/carousel-motion.d.ts +4 -1
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +12 -3
- package/dist/carousel-motion.js.map +1 -1
- package/dist/code-block.d.ts +8 -0
- package/dist/code-block.d.ts.map +1 -0
- package/dist/code-block.js +6 -0
- package/dist/code-block.js.map +1 -0
- package/dist/content-transition.d.ts +5 -2
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +6 -4
- package/dist/content-transition.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +10 -11
- package/dist/context-menu.js.map +1 -1
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +2 -1
- package/dist/data-table.js.map +1 -1
- package/dist/duration-field.d.ts +11 -0
- package/dist/duration-field.d.ts.map +1 -0
- package/dist/duration-field.js +9 -0
- package/dist/duration-field.js.map +1 -0
- package/dist/effect-surface.d.ts +10 -0
- package/dist/effect-surface.d.ts.map +1 -0
- package/dist/effect-surface.js +57 -0
- package/dist/effect-surface.js.map +1 -0
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/folder-preview.d.ts +12 -0
- package/dist/folder-preview.d.ts.map +1 -0
- package/dist/folder-preview.js +7 -0
- package/dist/folder-preview.js.map +1 -0
- package/dist/forms.d.ts +3 -1
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +2 -2
- package/dist/forms.js.map +1 -1
- package/dist/gravity-letters.d.ts +8 -0
- package/dist/gravity-letters.d.ts.map +1 -0
- package/dist/gravity-letters.js +24 -0
- package/dist/gravity-letters.js.map +1 -0
- package/dist/grid-reveal.d.ts +9 -0
- package/dist/grid-reveal.d.ts.map +1 -0
- package/dist/grid-reveal.js +21 -0
- package/dist/grid-reveal.js.map +1 -0
- package/dist/icon-lucide.d.ts +11 -0
- package/dist/icon-lucide.d.ts.map +1 -0
- package/dist/icon-lucide.js +11 -0
- package/dist/icon-lucide.js.map +1 -0
- package/dist/inline-confirm.d.ts +14 -0
- package/dist/inline-confirm.d.ts.map +1 -0
- package/dist/inline-confirm.js +37 -0
- package/dist/inline-confirm.js.map +1 -0
- package/dist/menu-morph.d.ts.map +1 -1
- package/dist/menu-morph.js +9 -6
- package/dist/menu-morph.js.map +1 -1
- package/dist/menu-typeahead.d.ts +13 -0
- package/dist/menu-typeahead.d.ts.map +1 -0
- package/dist/menu-typeahead.js +17 -0
- package/dist/menu-typeahead.js.map +1 -0
- package/dist/navigation-bar.d.ts +10 -0
- package/dist/navigation-bar.d.ts.map +1 -0
- package/dist/navigation-bar.js +10 -0
- package/dist/navigation-bar.js.map +1 -0
- package/dist/navigation.d.ts +3 -3
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +63 -22
- package/dist/navigation.js.map +1 -1
- package/dist/notification-bell.d.ts +11 -0
- package/dist/notification-bell.d.ts.map +1 -0
- package/dist/notification-bell.js +27 -0
- package/dist/notification-bell.js.map +1 -0
- package/dist/overlays.d.ts +0 -2
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +5 -18
- package/dist/overlays.js.map +1 -1
- package/dist/reaction-picker.d.ts +11 -0
- package/dist/reaction-picker.d.ts.map +1 -0
- package/dist/reaction-picker.js +9 -0
- package/dist/reaction-picker.js.map +1 -0
- package/dist/scroll-progress.d.ts +10 -0
- package/dist/scroll-progress.d.ts.map +1 -0
- package/dist/scroll-progress.js +34 -0
- package/dist/scroll-progress.js.map +1 -0
- package/dist/select.d.ts +0 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +0 -2
- package/dist/select.js.map +1 -1
- package/dist/sidebar.d.ts +3 -0
- package/dist/sidebar.d.ts.map +1 -1
- package/dist/sidebar.js +23 -4
- package/dist/sidebar.js.map +1 -1
- package/dist/step-player.d.ts +24 -0
- package/dist/step-player.d.ts.map +1 -0
- package/dist/step-player.js +16 -0
- package/dist/step-player.js.map +1 -0
- package/dist/styles.css +101 -13
- package/dist/styles.layered.css +101 -13
- package/dist/supplemental-display.d.ts +10 -2
- package/dist/supplemental-display.d.ts.map +1 -1
- package/dist/supplemental-display.js +2 -2
- package/dist/supplemental-display.js.map +1 -1
- package/dist/table-sort-button.d.ts +15 -0
- package/dist/table-sort-button.d.ts.map +1 -0
- package/dist/table-sort-button.js +7 -0
- package/dist/table-sort-button.js.map +1 -0
- package/dist/task-list.d.ts +16 -0
- package/dist/task-list.d.ts.map +1 -0
- package/dist/task-list.js +17 -0
- package/dist/task-list.js.map +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +9 -0
- package/dist/theme.js.map +1 -1
- package/dist/thinking-orb.d.ts +1 -1
- package/dist/thinking-orb.d.ts.map +1 -1
- package/dist/thinking-orb.js +4 -4
- package/dist/thinking-orb.js.map +1 -1
- package/dist/toast.d.ts.map +1 -1
- package/dist/toast.js +12 -7
- package/dist/toast.js.map +1 -1
- package/dist/voice-note.d.ts +24 -0
- package/dist/voice-note.d.ts.map +1 -0
- package/dist/voice-note.js +13 -0
- package/dist/voice-note.js.map +1 -0
- package/package.json +110 -5
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @hjmds/react
|
|
2
2
|
|
|
3
|
+
Login screens use `AuthScreenLayout` from `@hjmds/react/auth-screen`. Set `mainCard` and supply
|
|
4
|
+
provider buttons with name-only labels in `main`. During authentication, pass a localized
|
|
5
|
+
`pendingLabel`: the actions become hidden and inert, their layout preserves the card dimensions,
|
|
6
|
+
and one loader appears at its centre. Remove the prop on cancellation or failure to restore them.
|
|
7
|
+
Keep the same `main` content mounted and avoid setting each button's `busy` at the same time.
|
|
8
|
+
See the [login layout contract](../design-contracts/docs/auth-screen.md) for migration.
|
|
9
|
+
|
|
3
10
|
React 19 renderer for `@hjmds/design-contracts`. Components render native HTML,
|
|
4
11
|
keep controlled and uncontrolled state explicit, and expose stable `data-state`
|
|
5
12
|
and `data-*` recipe axes for styling and tests.
|
|
@@ -165,3 +172,10 @@ action alongside the accessible code.
|
|
|
165
172
|
## Optional interaction adapters
|
|
166
173
|
|
|
167
174
|
Stable `sortable`, `swipe-actions`, `content-transition`, `carousel-motion` and `celebration` entries are available through explicit subpath imports. See [installation, localized labels and behavior contracts](../../docs/interaction-adapters.md), including pinned peers and native verification limits. These adapters are not root exports.
|
|
175
|
+
|
|
176
|
+
### Reference-inspired navigation
|
|
177
|
+
|
|
178
|
+
`@hjmds/react/navigation-bar` exports [NavigationBar](../design-contracts/docs/navigation-bar.md),
|
|
179
|
+
a brand/navigation/actions composition with a progressive glass surface.
|
|
180
|
+
Existing [BottomNavigation](../design-contracts/docs/bottom-navigation.md) accepts
|
|
181
|
+
`configuration={{ presentation: "capsule" }}` with an adjacent `primaryAction`.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -55,3 +55,81 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
55
55
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
56
56
|
SOFTWARE.
|
|
57
57
|
app/page.tsx
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Blobatar optional runtime — 2.7.0
|
|
61
|
+
|
|
62
|
+
The optional avatar adapters import the pinned Blobatar packages; their generator is not copied or reimplemented. This notice is reproduced from the installed 2.7.0 LICENSE to accompany consumer bundles.
|
|
63
|
+
|
|
64
|
+
Source: https://github.com/Alain00/blobatar
|
|
65
|
+
|
|
66
|
+
MIT License
|
|
67
|
+
|
|
68
|
+
Copyright (c) 2026 Alain
|
|
69
|
+
|
|
70
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
72
|
+
in the Software without restriction, including without limitation the rights
|
|
73
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
75
|
+
furnished to do so, subject to the following conditions:
|
|
76
|
+
|
|
77
|
+
The above copyright notice and this permission notice shall be included in all
|
|
78
|
+
copies or substantial portions of the Software.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
86
|
+
|
|
87
|
+
## Lucide optional glyph adapters — 1.49.0
|
|
88
|
+
|
|
89
|
+
Only selected glyphs are imported by the host. The full installed upstream license, including Feather-derived icons, is preserved here for consumer bundle attribution.
|
|
90
|
+
|
|
91
|
+
Source: https://github.com/lucide-icons/lucide
|
|
92
|
+
|
|
93
|
+
ISC License
|
|
94
|
+
|
|
95
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
96
|
+
|
|
97
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
98
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
99
|
+
copyright notice and this permission notice appear in all copies.
|
|
100
|
+
|
|
101
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
102
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
103
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
104
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
105
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
106
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
107
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
The following Lucide icons are derived from the Feather project:
|
|
112
|
+
|
|
113
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
114
|
+
|
|
115
|
+
The MIT License (MIT) (for the icons listed above)
|
|
116
|
+
|
|
117
|
+
Copyright (c) 2013-present Cole Bemis
|
|
118
|
+
|
|
119
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
120
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
121
|
+
in the Software without restriction, including without limitation the rights
|
|
122
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
123
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
124
|
+
furnished to do so, subject to the following conditions:
|
|
125
|
+
|
|
126
|
+
The above copyright notice and this permission notice shall be included in all
|
|
127
|
+
copies or substantial portions of the Software.
|
|
128
|
+
|
|
129
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
130
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
131
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
132
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
133
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
134
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
135
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ActivityHeatmapDescriptor } from '@hjmds/design-contracts/activity-heatmap';
|
|
2
|
+
export type ActivityHeatmapProps = Readonly<{
|
|
3
|
+
descriptor: ActivityHeatmapDescriptor;
|
|
4
|
+
label: string;
|
|
5
|
+
formatDay: (date: string, value: number | null) => string;
|
|
6
|
+
view?: 'grid' | 'list';
|
|
7
|
+
}>;
|
|
8
|
+
/** The product formats both missing data and measured zero; color never owns meaning. */
|
|
9
|
+
export declare function ActivityHeatmap({ descriptor, label, formatDay, view }: ActivityHeatmapProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=activity-heatmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-heatmap.d.ts","sourceRoot":"","sources":["../src/activity-heatmap.tsx"],"names":[],"mappings":"AAAA,OAAM,EAAwB,KAAK,yBAAyB,EAAC,MAAI,0CAA0C,CAAC;AAC5G,MAAM,MAAM,oBAAoB,GAAC,QAAQ,CAAC;IAAC,UAAU,EAAC,yBAAyB,CAAC;IAAA,KAAK,EAAC,MAAM,CAAC;IAAA,SAAS,EAAC,CAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAC,IAAI,KAAG,MAAM,CAAC;IAAA,IAAI,CAAC,EAAC,MAAM,GAAC,MAAM,CAAA;CAAC,CAAC,CAAC;AAErK,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,IAAW,EAAC,EAAC,oBAAoB,+BAA+6B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { resolveActivityHeatmap } from '@hjmds/design-contracts/activity-heatmap';
|
|
3
|
+
// Compact data cells use a quarter of the control radius so the grid reads as dates, not round controls.
|
|
4
|
+
/** The product formats both missing data and measured zero; color never owns meaning. */
|
|
5
|
+
export function ActivityHeatmap({ descriptor, label, formatDay, view = 'grid' }) { const { days, columns } = resolveActivityHeatmap(descriptor); return _jsx("div", { role: "region", "aria-label": label, tabIndex: view === 'grid' ? 0 : undefined, style: { overflowX: 'auto' }, children: _jsx("ul", { "aria-label": label, style: view === 'grid' ? { display: 'grid', gridTemplateRows: 'repeat(7, 1rem)', gridTemplateColumns: `repeat(${columns}, 1rem)`, gap: 'var(--hjm-space-xxs)', listStyle: 'none', padding: 0, margin: 0 } : undefined, children: days.map(day => _jsx("li", { "aria-label": view === 'grid' ? formatDay(day.date, day.value) : undefined, title: formatDay(day.date, day.value), style: view === 'grid' ? { gridRow: day.row + 1, gridColumn: day.column + 1, borderRadius: 'calc(var(--hjm-radius-sm) / 4)', background: day.level === 0 ? 'var(--hjm-color-surface-alt)' : `color-mix(in srgb, var(--hjm-color-content-brand) ${25 * day.level}%, var(--hjm-color-surface-alt))`, outline: day.value === null ? '1px dashed var(--hjm-color-border)' : undefined } : undefined, children: view === 'list' ? formatDay(day.date, day.value) : null }, day.date)) }) }); }
|
|
6
|
+
//# sourceMappingURL=activity-heatmap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-heatmap.js","sourceRoot":"","sources":["../src/activity-heatmap.tsx"],"names":[],"mappings":";AAAA,OAAM,EAAC,sBAAsB,EAAgC,MAAI,0CAA0C,CAAC;AAE5G,yGAAyG;AACzG,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAAC,EAAC,UAAU,EAAC,KAAK,EAAC,SAAS,EAAC,IAAI,GAAC,MAAM,EAAsB,IAAE,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,GAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAA,OAAO,cAA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AC,IAAI,EAAC,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,CAAA,IAAI,IAAlgB,GAAG,CAAC,IAAI,CAAggB,CAAC,GAAM,GAAM,CAAC,CAAA,CAAC","sourcesContent":["import{resolveActivityHeatmap,type ActivityHeatmapDescriptor}from'@hjmds/design-contracts/activity-heatmap';\nexport type ActivityHeatmapProps=Readonly<{descriptor:ActivityHeatmapDescriptor;label:string;formatDay:(date:string,value:number|null)=>string;view?:'grid'|'list'}>;\n// Compact data cells use a quarter of the control radius so the grid reads as dates, not round controls.\n/** The product formats both missing data and measured zero; color never owns meaning. */\nexport function ActivityHeatmap({descriptor,label,formatDay,view='grid'}:ActivityHeatmapProps){const {days,columns}=resolveActivityHeatmap(descriptor);return <div role=\"region\" aria-label={label} tabIndex={view==='grid'?0:undefined} style={{overflowX:'auto'}}><ul aria-label={label} style={view==='grid'?{display:'grid',gridTemplateRows:'repeat(7, 1rem)',gridTemplateColumns:`repeat(${columns}, 1rem)`,gap:'var(--hjm-space-xxs)',listStyle:'none',padding:0,margin:0}:undefined}>{days.map(day=><li key={day.date} aria-label={view==='grid'?formatDay(day.date,day.value):undefined} title={formatDay(day.date,day.value)} style={view==='grid'?{gridRow:day.row+1,gridColumn:day.column+1,borderRadius:'calc(var(--hjm-radius-sm) / 4)',background:day.level===0?'var(--hjm-color-surface-alt)':`color-mix(in srgb, var(--hjm-color-content-brand) ${25*day.level}%, var(--hjm-color-surface-alt))`,outline:day.value===null?'1px dashed var(--hjm-color-border)':undefined}:undefined}>{view==='list'?formatDay(day.date,day.value):null}</li>)}</ul></div>;}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AvatarFallbackContext } from "@hjmds/design-contracts/avatar-fallback";
|
|
1
2
|
import { type DescriptionItemDescriptor, type DescriptionListColumns } from "@hjmds/design-contracts/components/description-list";
|
|
2
3
|
import { type ComposeTimelineAccessibleName, type TimelineItemDescriptor } from "@hjmds/design-contracts/components/timeline";
|
|
3
4
|
import { type ResolvedStatisticDescriptor, type StatisticDescriptor, type StatisticGroupDescriptor } from "@hjmds/design-contracts/components/statistic";
|
|
@@ -33,6 +34,7 @@ export type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, "children"> & Re
|
|
|
33
34
|
src?: string;
|
|
34
35
|
alt?: string;
|
|
35
36
|
fallback?: ReactNode;
|
|
37
|
+
renderFallback?: (context: AvatarFallbackContext) => ReactNode;
|
|
36
38
|
size?: AvatarSize;
|
|
37
39
|
shape?: AvatarShape;
|
|
38
40
|
imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "src">;
|
|
@@ -42,6 +44,7 @@ export declare const Avatar: import("react").ForwardRefExoticComponent<Omit<HTML
|
|
|
42
44
|
src?: string;
|
|
43
45
|
alt?: string;
|
|
44
46
|
fallback?: ReactNode;
|
|
47
|
+
renderFallback?: (context: AvatarFallbackContext) => ReactNode;
|
|
45
48
|
size?: AvatarSize;
|
|
46
49
|
shape?: AvatarShape;
|
|
47
50
|
imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "src">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-display.d.ts","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC5B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAGL,aAAa,EACb,UAAU,EAEV,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAWL,KAAK,cA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B,CAAC,CAAC;AA4FL,eAAO,MAAM,KAAK,EAA6B,CAAC,GAAG,EACjD,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KACrD,YAAY,CAAC;AAElB,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAC1D,cAAc,CAAC,gBAAgB,CAAC,EAChC,UAAU,CACX,GACC,QAAQ,CAAC;IACP,KAAK,EAAE,SAAS,sBAAsB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7C,qBAAqB,EAAE,6BAA6B,CAAC;CACtD,CAAC,CAAC;AAmDL,eAAO,MAAM,QAAQ,EAAgC,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAC9E,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KACvD,YAAY,CAAC"}
|
package/dist/advanced-display.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TableSortButton } from "./table-sort-button.js";
|
|
3
|
+
import { getNextDataTableSortState } from "@hjmds/design-contracts/components/data-table";
|
|
2
4
|
import { resolveDescriptionListColumnCount, resolveDescriptionListDescriptor, } from "@hjmds/design-contracts/components/description-list";
|
|
3
5
|
import { resolveTimelineDescriptor, } from "@hjmds/design-contracts/components/timeline";
|
|
4
6
|
import { resolveStatisticDescriptor, validateStatisticGroup, } from "@hjmds/design-contracts/components/statistic";
|
|
@@ -95,7 +97,7 @@ function initials(name) {
|
|
|
95
97
|
.join("")
|
|
96
98
|
.toLocaleUpperCase();
|
|
97
99
|
}
|
|
98
|
-
export const Avatar = forwardRef(function Avatar({ name, src, alt = name, fallback, size = avatarRecipe.defaults.size, shape = avatarRecipe.defaults.shape, imageProps, className, ...props }, ref) {
|
|
100
|
+
export const Avatar = forwardRef(function Avatar({ name, src, alt = name, fallback, renderFallback, size = avatarRecipe.defaults.size, shape = avatarRecipe.defaults.shape, imageProps, className, ...props }, ref) {
|
|
99
101
|
if (name.trim().length === 0)
|
|
100
102
|
throw new TypeError("Avatar name must not be empty");
|
|
101
103
|
const [imageAvailable, setImageAvailable] = useState(Boolean(src));
|
|
@@ -104,7 +106,7 @@ export const Avatar = forwardRef(function Avatar({ name, src, alt = name, fallba
|
|
|
104
106
|
return (_jsx("span", { ...props, ref: ref, className: classNames("hjm-avatar", className), "data-size": size, "data-shape": shape, "data-state": imageAvailable ? "image" : "fallback", children: src && imageAvailable ? (_jsx("img", { ...restImageProps, src: src, alt: alt, className: classNames("hjm-avatar__image", imageClassName), onError: (event) => {
|
|
105
107
|
setImageAvailable(false);
|
|
106
108
|
onError?.(event);
|
|
107
|
-
} })) : (_jsx("span", { className: "hjm-avatar__fallback", role: alt.length > 0 ? "img" : undefined, "aria-label": alt.length > 0 ? alt : undefined, "aria-hidden": alt.length === 0 || undefined, children: fallback ?? initials(name) })) }));
|
|
109
|
+
} })) : (_jsx("span", { className: "hjm-avatar__fallback", role: alt.length > 0 ? "img" : undefined, "aria-label": alt.length > 0 ? alt : undefined, "aria-hidden": alt.length === 0 || undefined, children: renderFallback?.({ size: avatarRecipe.sizes[size], decorative: true }) ?? fallback ?? initials(name) })) }));
|
|
108
110
|
});
|
|
109
111
|
/**
|
|
110
112
|
* Overlapping avatars. The overlap comes from the recipe ratio rather than a
|
|
@@ -175,6 +177,7 @@ function DescriptionListInner({ items, columns, className, layoutStyle, style, .
|
|
|
175
177
|
return (_jsx("dl", { ...props, ref: ref, className: classNames("hjm-description-list", className), "data-columns": resolvedColumns, "data-state": resolvedColumns < descriptor.columns ? "collapsed" : "ready", style: responsiveStyle, children: descriptor.items.map((item) => (_jsxs("div", { className: "hjm-description-list__item", children: [_jsx("dt", { className: "hjm-description-list__label", children: item.label }), _jsx("dd", { className: "hjm-description-list__value", children: item.value })] }, item.id))) }));
|
|
176
178
|
}
|
|
177
179
|
export const DescriptionList = forwardRef(DescriptionListInner);
|
|
180
|
+
// Table's callback cannot express null; share the sort policy with a two-state cycle.
|
|
178
181
|
function TableInner({ columns, rows, getRowKey, caption, emptyState, onSortChange, wrapperClassName, className, ...props }, ref) {
|
|
179
182
|
if (columns.length === 0)
|
|
180
183
|
throw new TypeError("Table requires at least one column");
|
|
@@ -198,11 +201,10 @@ function TableInner({ columns, rows, getRowKey, caption, emptyState, onSortChang
|
|
|
198
201
|
throw new TypeError(`Duplicate Table row key: ${rowKey}`);
|
|
199
202
|
seenRowKeys.add(rowKey);
|
|
200
203
|
}
|
|
201
|
-
return (_jsx("div", { className: classNames("hjm-table-scroll", wrapperClassName), tabIndex: 0, children: _jsxs("table", { ...props, ref: ref, className: classNames("hjm-table", className), children: [caption ? _jsx("caption", { className: "hjm-table__caption", children: caption }) : null, _jsx("thead", { children: _jsx("tr", { children: columns.map((column) => (_jsx("th", { scope: "col", className: "hjm-table__header", "data-align": column.align ?? "start", "aria-sort": column.sortDirection ?? (column.sortable ? "none" : undefined), children: column.sortable ? (
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
: " ↕" })] })) : column.header }, column.id))) }) }), _jsx("tbody", { children: rows.length === 0 ? (_jsx("tr", { children: _jsx("td", { className: "hjm-table__empty", colSpan: columns.length, children: emptyState }) })) : (rows.map((row, rowIndex) => (_jsx("tr", { className: "hjm-table__row", children: columns.map((column) => (_jsx("td", { className: "hjm-table__cell", "data-align": column.align ?? "start", children: column.cell(row, rowIndex) }, column.id))) }, rowKeys[rowIndex])))) })] }) }));
|
|
204
|
+
return (_jsx("div", { className: classNames("hjm-table-scroll", wrapperClassName), tabIndex: 0, children: _jsxs("table", { ...props, ref: ref, className: classNames("hjm-table", className), children: [caption ? _jsx("caption", { className: "hjm-table__caption", children: caption }) : null, _jsx("thead", { children: _jsx("tr", { children: columns.map((column) => (_jsx("th", { scope: "col", className: "hjm-table__header", "data-align": column.align ?? "start", "aria-sort": column.sortDirection ?? (column.sortable ? "none" : undefined), children: column.sortable ? (_jsx(TableSortButton, { header: column.header, ...(column.sortDirection === undefined ? {} : { direction: column.sortDirection }), glyphs: { ascending: " ↑", descending: " ↓", none: " ↕" }, className: "hjm-table__sort", onSort: () => {
|
|
205
|
+
const next = getNextDataTableSortState(column.sortDirection ? { columnId: column.id, direction: column.sortDirection } : null, column.id, "two-state");
|
|
206
|
+
onSortChange?.(column.id, next.direction);
|
|
207
|
+
} })) : column.header }, column.id))) }) }), _jsx("tbody", { children: rows.length === 0 ? (_jsx("tr", { children: _jsx("td", { className: "hjm-table__empty", colSpan: columns.length, children: emptyState }) })) : (rows.map((row, rowIndex) => (_jsx("tr", { className: "hjm-table__row", children: columns.map((column) => (_jsx("td", { className: "hjm-table__cell", "data-align": column.align ?? "start", children: column.cell(row, rowIndex) }, column.id))) }, rowKeys[rowIndex])))) })] }) }));
|
|
206
208
|
}
|
|
207
209
|
export const Table = forwardRef(TableInner);
|
|
208
210
|
function TimelineInner({ items, composeAccessibleName, className, ...props }, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-display.js","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GAGjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,yBAAyB,GAG1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAIvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,eAAe,GAMhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAUT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClF,OA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,EACP,gBAAM,SAAS,EAAC,uBAAuB,aACrC,gBAAM,SAAS,EAAC,uBAAuB,aACrC,iBAAQ,SAAS,EAAC,qBAAqB,YAAE,IAAI,CAAC,KAAK,GAAU,EAC5D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAChB,eAAM,SAAS,EAAC,yBAAyB,YAAE,IAAI,CAAC,SAAS,GAAQ,CAClE,CAAC,CAAC,CAAC,IAAI,IACH,EACN,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,eAAM,SAAS,EAAC,2BAA2B,YAAE,IAAI,CAAC,WAAW,GAAQ,CACtE,CAAC,CAAC,CAAC,IAAI,IACH,KAlBF,IAAI,CAAC,EAAE,CAmBT,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAE/B,CAAC","sourcesContent":["import {\n resolveDescriptionListColumnCount,\n resolveDescriptionListDescriptor,\n type DescriptionItemDescriptor,\n type DescriptionListColumns,\n} from \"@hjmds/design-contracts/components/description-list\";\nimport {\n resolveTimelineDescriptor,\n type ComposeTimelineAccessibleName,\n type TimelineItemDescriptor,\n} from \"@hjmds/design-contracts/components/timeline\";\nimport {\n resolveStatisticDescriptor,\n validateStatisticGroup,\n type ResolvedStatisticDescriptor,\n type StatisticDescriptor,\n type StatisticGroupDescriptor,\n} from \"@hjmds/design-contracts/components/statistic\";\nimport {\n accordionRecipe,\n avatarRecipe,\n dividerRecipe,\n listRecipe,\n statisticRecipe,\n type AccordionDensity,\n type AvatarShape,\n type AvatarSize,\n type StatisticDensity,\n type StatisticPresentation,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n createElement,\n forwardRef,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type ForwardedRef,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n type TableHTMLAttributes,\n} from \"react\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { classNames, useControllableState, useElementWidth } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\n\nexport type AccordionItem = Readonly<{\n id: string;\n title: ReactNode;\n panel: ReactNode;\n disabled?: boolean;\n}>;\n\nexport type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> &\n Readonly<{\n items: readonly AccordionItem[];\n value?: readonly string[];\n defaultValue?: readonly string[];\n onValueChange?: (value: readonly string[]) => void;\n allowsMultipleExpanded?: boolean;\n density?: AccordionDensity;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\nfunction validateAccordionItems(items: readonly AccordionItem[]): void {\n if (items.length === 0) throw new TypeError(\"Accordion requires at least one item\");\n const ids = new Set<string>();\n for (const item of items) {\n if (item.id.trim().length === 0) throw new TypeError(\"Accordion item id must not be empty\");\n if (ids.has(item.id)) throw new TypeError(`Duplicate Accordion item id: ${item.id}`);\n ids.add(item.id);\n }\n}\n\nfunction accordionFocusTarget(\n items: readonly AccordionItem[],\n currentIndex: number,\n key: string,\n): number | undefined {\n if (key === \"Home\") return items.findIndex((item) => !item.disabled);\n if (key === \"End\") {\n for (let index = items.length - 1; index >= 0; index -= 1) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n }\n const direction = key === \"ArrowDown\" ? 1 : key === \"ArrowUp\" ? -1 : 0;\n if (direction === 0) return undefined;\n for (let offset = 1; offset <= items.length; offset += 1) {\n const index = (currentIndex + direction * offset + items.length) % items.length;\n if (!items[index]?.disabled) return index;\n }\n return currentIndex;\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(\n function Accordion(\n {\n items,\n value: valueProp,\n defaultValue = [],\n onValueChange,\n allowsMultipleExpanded = accordionRecipe.defaults.allowsMultipleExpanded,\n density = accordionRecipe.defaults.density,\n headingLevel = 3,\n className,\n ...props\n },\n ref,\n ) {\n validateAccordionItems(items);\n const [value, setValue] = useControllableState<readonly string[]>({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const validIds = new Set(items.map((item) => item.id));\n const valueIds = new Set<string>();\n for (const id of value) {\n if (!validIds.has(id)) throw new RangeError(`Unknown Accordion value: ${id}`);\n if (valueIds.has(id)) throw new TypeError(`Duplicate Accordion value: ${id}`);\n valueIds.add(id);\n }\n if (!allowsMultipleExpanded && value.length > 1) {\n throw new RangeError(\"Accordion only allows one expanded item\");\n }\n const baseId = useId().replaceAll(\":\", \"\");\n const triggerRefs = useRef(new Map<string, HTMLButtonElement>());\n const toggle = (id: string) => {\n const expanded = value.includes(id);\n setValue(\n expanded\n ? value.filter((candidate) => candidate !== id)\n : allowsMultipleExpanded\n ? [...value, id]\n : [id],\n );\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-accordion\", className)}\n data-density={density}\n data-multiple={allowsMultipleExpanded || undefined}\n >\n {items.map((item, index) => {\n const expanded = value.includes(item.id);\n const triggerId = `${baseId}-accordion-trigger-${index}`;\n const panelId = `${baseId}-accordion-panel-${index}`;\n const trigger = (\n <button\n ref={(node) => {\n if (node) triggerRefs.current.set(item.id, node);\n else triggerRefs.current.delete(item.id);\n }}\n id={triggerId}\n type=\"button\"\n className=\"hjm-accordion__trigger\"\n aria-expanded={expanded}\n aria-controls={panelId}\n disabled={item.disabled}\n onClick={() => toggle(item.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n const target = accordionFocusTarget(items, index, event.key);\n if (target === undefined || target < 0) return;\n event.preventDefault();\n triggerRefs.current.get(items[target]!.id)?.focus();\n }}\n >\n <span className=\"hjm-accordion__title\">{item.title}</span>\n <span className=\"hjm-accordion__indicator\" aria-hidden=\"true\">\n {expanded ? \"−\" : \"+\"}\n </span>\n </button>\n );\n return (\n <div\n key={item.id}\n className=\"hjm-accordion__item\"\n data-state={item.disabled ? \"disabled\" : expanded ? \"expanded\" : \"collapsed\"}\n >\n {createElement(`h${headingLevel}`, { className: \"hjm-accordion__header\" }, trigger)}\n <div\n id={panelId}\n role=\"region\"\n className=\"hjm-accordion__panel\"\n aria-labelledby={triggerId}\n hidden={!expanded}\n >\n {item.panel}\n </div>\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nfunction initials(name: string): string {\n return name\n .trim()\n .split(/\\s+/u)\n .slice(0, 2)\n .map((part) => Array.from(part)[0] ?? \"\")\n .join(\"\")\n .toLocaleUpperCase();\n}\n\nexport type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n name: string;\n src?: string;\n alt?: string;\n fallback?: ReactNode;\n size?: AvatarSize;\n shape?: AvatarShape;\n imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, \"alt\" | \"src\">;\n }>;\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n alt = name,\n fallback,\n size = avatarRecipe.defaults.size,\n shape = avatarRecipe.defaults.shape,\n imageProps,\n className,\n ...props\n },\n ref,\n) {\n if (name.trim().length === 0) throw new TypeError(\"Avatar name must not be empty\");\n const [imageAvailable, setImageAvailable] = useState(Boolean(src));\n useEffect(() => setImageAvailable(Boolean(src)), [src]);\n const { onError, className: imageClassName, ...restImageProps } = imageProps ?? {};\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-avatar\", className)}\n data-size={size}\n data-shape={shape}\n data-state={imageAvailable ? \"image\" : \"fallback\"}\n >\n {src && imageAvailable ? (\n <img\n {...restImageProps}\n src={src}\n alt={alt}\n className={classNames(\"hjm-avatar__image\", imageClassName)}\n onError={(event) => {\n setImageAvailable(false);\n onError?.(event);\n }}\n />\n ) : (\n <span\n className=\"hjm-avatar__fallback\"\n role={alt.length > 0 ? \"img\" : undefined}\n aria-label={alt.length > 0 ? alt : undefined}\n aria-hidden={alt.length === 0 || undefined}\n >\n {fallback ?? initials(name)}\n </span>\n )}\n </span>\n );\n});\n\nexport type AvatarGroupProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n /** Required: a pile of faces is meaningless to a screen reader otherwise. */\n label: string;\n children: ReactNode;\n size?: AvatarSize;\n /** Product-composed overflow copy such as \"+3\"; the count is the product's. */\n overflow?: ReactNode;\n }>;\n\n/**\n * Overlapping avatars. The overlap comes from the recipe ratio rather than a\n * pixel value so it holds across all four sizes, and the group carries one\n * accessible name instead of letting a reader walk five unlabelled images.\n */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { label, children, size = avatarRecipe.defaults.size, overflow, className, ...props },\n ref,\n) {\n if (label.trim().length === 0) throw new TypeError(\"AvatarGroup label must not be empty\");\n const offset = Math.round(avatarRecipe.sizes[size] * avatarRecipe.overlapRatio);\n return (\n <span\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={classNames(\"hjm-avatar-group\", className)}\n data-size={size}\n style={{ \"--hjm-avatar-overlap\": `${offset}px` } as CSSProperties}\n >\n {children}\n {overflow ? <span className=\"hjm-avatar-group__overflow\" aria-hidden=\"true\">{overflow}</span> : null}\n </span>\n );\n});\n\nexport type DividerOrientation = \"horizontal\" | \"vertical\";\nexport type DividerInset = keyof typeof dividerRecipe.insets;\n\nexport type DividerProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n orientation?: DividerOrientation;\n inset?: DividerInset;\n decorative?: boolean;\n }>;\n\nexport const Divider = forwardRef<HTMLElement, DividerProps>(function Divider(\n {\n orientation = dividerRecipe.defaults.orientation,\n inset = dividerRecipe.defaults.inset,\n decorative = false,\n className,\n ...props\n },\n ref,\n) {\n return createElement(orientation === \"horizontal\" ? \"hr\" : \"div\", {\n ...props,\n ref,\n className: classNames(\"hjm-divider\", className),\n \"data-orientation\": orientation,\n \"data-inset\": inset,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-hidden\": decorative || undefined,\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n});\n\nexport type ListAppearance = \"grouped\" | \"plain\";\n\nexport type ListProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n label: string;\n children: ReactNode;\n separator?: keyof typeof listRecipe.separators;\n appearance?: ListAppearance;\n }>;\n\n/** Semantic list container that owns separators around composed rows. */\nexport const List = forwardRef<HTMLDivElement, ListProps>(function List(\n {\n label,\n children,\n separator = listRecipe.defaults.separator,\n appearance = \"plain\",\n className,\n ...props\n },\n ref,\n) {\n if (!label.trim()) throw new TypeError(\"List label must not be empty\");\n const items = Children.toArray(children);\n return (\n <div\n {...props}\n ref={ref}\n aria-label={label}\n className={classNames(\"hjm-list\", className)}\n data-appearance={appearance}\n data-separator={separator}\n role=\"list\"\n >\n {items.map((item, index) => (\n <div\n className=\"hjm-list__item\"\n key={isValidElement(item) && item.key !== null ? item.key : `hjm-list-${index}`}\n role=\"listitem\"\n >\n {item}\n </div>\n ))}\n </div>\n );\n});\n\nexport type StatisticTrendMarkRenderProps = Readonly<{\n name: \"trendUp\" | \"trendDown\" | \"trendFlat\";\n color: \"currentColor\";\n size: number;\n}>;\n\nexport type ComposeStatisticAccessibilityLabel<Id extends string = string> = (\n input: Readonly<{\n contextLabel?: string;\n descriptor: ResolvedStatisticDescriptor<Id>;\n valueText: string;\n }>,\n) => string;\n\nexport type StatisticProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\"\n> & Readonly<{\n descriptor: StatisticDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n contextLabel?: string;\n accessibilityLabel?: string;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n /** Optional visual adapter; the descriptor remains the accessible value source. */\n renderValue?: (value: string) => ReactNode;\n}>;\n\nexport function Statistic<Id extends string = string>({\n descriptor,\n density = \"comfortable\",\n presentation = \"plain\",\n contextLabel,\n accessibilityLabel,\n composeAccessibilityLabel,\n renderTrendMark,\n renderValue,\n className,\n ...props\n}: StatisticProps<Id>) {\n const resolved = resolveStatisticDescriptor(descriptor);\n const valueText = `${resolved.prefix ?? \"\"}${resolved.value}${resolved.suffix ?? \"\"}`;\n const announcement = accessibilityLabel ?? composeAccessibilityLabel?.({\n ...(contextLabel === undefined ? {} : { contextLabel }),\n descriptor: resolved,\n valueText,\n }) ?? [contextLabel, resolved.label, valueText, resolved.trend?.label, resolved.hint]\n .filter(Boolean)\n .join(\", \");\n if (!announcement.trim()) throw new TypeError(\"Statistic accessibility label must not be empty\");\n const trendName = resolved.trend\n ? statisticRecipe.trend.marks[resolved.trend.direction]\n : undefined;\n return (\n <article\n {...props}\n aria-label={announcement}\n className={classNames(\"hjm-statistic\", className)}\n data-density={density}\n data-presentation={presentation}\n >\n <span aria-hidden=\"true\" className=\"hjm-statistic__label\">{resolved.label}</span>\n <span aria-hidden=\"true\" className=\"hjm-statistic__value-row\">\n {resolved.prefix ? <span className=\"hjm-statistic__affix\">{resolved.prefix}</span> : null}\n <strong className=\"hjm-statistic__value\">{renderValue?.(resolved.value) ?? resolved.value}</strong>\n {resolved.suffix ? <span className=\"hjm-statistic__affix\">{resolved.suffix}</span> : null}\n </span>\n {resolved.trend ? (\n <span aria-hidden=\"true\" className=\"hjm-statistic__trend\" data-tone={resolved.trend.tone}>\n <span className=\"hjm-statistic__trend-mark\">\n {renderTrendMark?.({ name: trendName!, color: \"currentColor\", size: 16 }) ?? (\n resolved.trend.direction === \"up\" ? \"↑\" : resolved.trend.direction === \"down\" ? \"↓\" : \"—\"\n )}\n </span>\n {resolved.trend.label}\n </span>\n ) : null}\n {resolved.hint ? <span aria-hidden=\"true\" className=\"hjm-statistic__hint\">{resolved.hint}</span> : null}\n </article>\n );\n}\n\nexport type StatisticGroupProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\"\n> & Readonly<{\n label: string;\n descriptor: StatisticGroupDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n}>;\n\nexport function StatisticGroup<Id extends string = string>({\n label,\n descriptor,\n density,\n presentation,\n composeAccessibilityLabel,\n renderTrendMark,\n className,\n style,\n ...props\n}: StatisticGroupProps<Id>) {\n validateStatisticGroup(descriptor);\n if (!label.trim()) throw new TypeError(\"StatisticGroup label must not be empty\");\n return (\n <div\n {...props}\n aria-label={label}\n className={classNames(\"hjm-statistic-group\", className)}\n role=\"list\"\n style={{ ...style, \"--hjm-statistic-columns\": descriptor.columns ?? statisticRecipe.defaults.columns } as CSSProperties}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} role=\"listitem\">\n <Statistic\n contextLabel={label}\n descriptor={item}\n {...(composeAccessibilityLabel === undefined ? {} : { composeAccessibilityLabel })}\n {...(density === undefined ? {} : { density })}\n {...(presentation === undefined ? {} : { presentation })}\n {...(renderTrendMark === undefined ? {} : { renderTrendMark })}\n />\n </div>\n ))}\n </div>\n );\n}\n\nexport type DescriptionListProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly DescriptionItemDescriptor<Id>[];\n columns?: DescriptionListColumns;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nfunction DescriptionListInner<Id extends string>(\n { items, columns, className, layoutStyle, style, ...props }: DescriptionListProps<Id>,\n forwardedRef: ForwardedRef<HTMLDListElement>,\n) {\n const descriptor = resolveDescriptionListDescriptor({\n items,\n ...(columns === undefined ? {} : { columns }),\n });\n const [width, ref] = useElementWidth(forwardedRef);\n const theme = useOptionalHjmTheme();\n const resolvedColumns = resolveDescriptionListColumnCount(\n width ?? 0,\n descriptor.columns,\n theme?.environment.textScale ?? 1,\n );\n const responsiveStyle = {\n ...style,\n ...layoutStyle,\n \"--hjm-description-columns\": resolvedColumns,\n } as CSSProperties;\n return (\n <dl\n {...props}\n ref={ref}\n className={classNames(\"hjm-description-list\", className)}\n data-columns={resolvedColumns}\n data-state={resolvedColumns < descriptor.columns ? \"collapsed\" : \"ready\"}\n style={responsiveStyle}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} className=\"hjm-description-list__item\">\n <dt className=\"hjm-description-list__label\">{item.label}</dt>\n <dd className=\"hjm-description-list__value\">{item.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nexport const DescriptionList = forwardRef(DescriptionListInner) as <Id extends string = string>(\n props: DescriptionListProps<Id> & RefAttributes<HTMLDListElement>,\n) => ReactElement;\n\nexport type TableSortDirection = \"ascending\" | \"descending\";\n\nexport type TableColumn<Row> = Readonly<{\n id: string;\n header: ReactNode;\n cell: (row: Row, rowIndex: number) => ReactNode;\n align?: \"start\" | \"center\" | \"end\";\n sortable?: boolean;\n sortDirection?: TableSortDirection;\n}>;\n\nexport type TableProps<Row> = Omit<TableHTMLAttributes<HTMLTableElement>, \"children\"> &\n Readonly<{\n columns: readonly TableColumn<Row>[];\n rows: readonly Row[];\n getRowKey: (row: Row, rowIndex: number) => string;\n caption?: ReactNode;\n /** Localized content rendered when rows is empty. */\n emptyState: ReactNode;\n onSortChange?: (columnId: string, direction: TableSortDirection) => void;\n wrapperClassName?: string;\n }>;\n\nfunction TableInner<Row>(\n {\n columns,\n rows,\n getRowKey,\n caption,\n emptyState,\n onSortChange,\n wrapperClassName,\n className,\n ...props\n }: TableProps<Row>,\n ref: ForwardedRef<HTMLTableElement>,\n) {\n if (columns.length === 0) throw new TypeError(\"Table requires at least one column\");\n const ids = new Set<string>();\n for (const column of columns) {\n if (column.id.trim().length === 0) throw new TypeError(\"Table column id must not be empty\");\n if (ids.has(column.id)) throw new TypeError(`Duplicate Table column id: ${column.id}`);\n ids.add(column.id);\n if (column.sortDirection && !column.sortable) {\n throw new TypeError(`Table column ${column.id} has sortDirection but is not sortable`);\n }\n }\n const rowKeys = rows.map((row, rowIndex) => getRowKey(row, rowIndex));\n const seenRowKeys = new Set<string>();\n for (const rowKey of rowKeys) {\n if (rowKey.trim().length === 0) throw new TypeError(\"Table row key must not be empty\");\n if (seenRowKeys.has(rowKey)) throw new TypeError(`Duplicate Table row key: ${rowKey}`);\n seenRowKeys.add(rowKey);\n }\n return (\n <div className={classNames(\"hjm-table-scroll\", wrapperClassName)} tabIndex={0}>\n <table {...props} ref={ref} className={classNames(\"hjm-table\", className)}>\n {caption ? <caption className=\"hjm-table__caption\">{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.id}\n scope=\"col\"\n className=\"hjm-table__header\"\n data-align={column.align ?? \"start\"}\n aria-sort={column.sortDirection ?? (column.sortable ? \"none\" : undefined)}\n >\n {column.sortable ? (\n <button\n type=\"button\"\n className=\"hjm-table__sort\"\n onClick={() =>\n onSortChange?.(\n column.id,\n column.sortDirection === \"ascending\" ? \"descending\" : \"ascending\",\n )\n }\n >\n {column.header}\n <span aria-hidden=\"true\">\n {column.sortDirection === \"ascending\"\n ? \" ↑\"\n : column.sortDirection === \"descending\"\n ? \" ↓\"\n : \" ↕\"}\n </span>\n </button>\n ) : column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td className=\"hjm-table__empty\" colSpan={columns.length}>{emptyState}</td>\n </tr>\n ) : (\n rows.map((row, rowIndex) => (\n <tr key={rowKeys[rowIndex]} className=\"hjm-table__row\">\n {columns.map((column) => (\n <td\n key={column.id}\n className=\"hjm-table__cell\"\n data-align={column.align ?? \"start\"}\n >\n {column.cell(row, rowIndex)}\n </td>\n ))}\n </tr>\n ))\n )}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport const Table = forwardRef(TableInner) as <Row>(\n props: TableProps<Row> & RefAttributes<HTMLTableElement>,\n) => ReactElement;\n\nexport type TimelineProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLOListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly TimelineItemDescriptor<Id>[];\n composeAccessibleName: ComposeTimelineAccessibleName;\n }>;\n\nfunction TimelineInner<Id extends string = string>(\n {\n items,\n composeAccessibleName,\n className,\n ...props\n }: TimelineProps<Id>,\n ref: ForwardedRef<HTMLOListElement>,\n) {\n const resolved = resolveTimelineDescriptor(\n { items },\n { composeAccessibleName },\n );\n return (\n <ol\n {...props}\n ref={ref}\n className={classNames(\"hjm-timeline\", className)}\n >\n {resolved.map((item, index) => (\n <li\n aria-label={item.accessibleName}\n className=\"hjm-timeline__item\"\n data-tone={item.tone}\n key={item.id}\n >\n <span className=\"hjm-timeline__rail\" aria-hidden=\"true\">\n <span className=\"hjm-timeline__dot\" />\n {index < resolved.length - 1 ? (\n <span className=\"hjm-timeline__connector\" />\n ) : null}\n </span>\n <span className=\"hjm-timeline__content\">\n <span className=\"hjm-timeline__heading\">\n <strong className=\"hjm-timeline__label\">{item.label}</strong>\n {item.timestamp ? (\n <time className=\"hjm-timeline__timestamp\">{item.timestamp}</time>\n ) : null}\n </span>\n {item.description ? (\n <span className=\"hjm-timeline__description\">{item.description}</span>\n ) : null}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\nexport const Timeline = forwardRef(TimelineInner) as <Id extends string = string>(\n props: TimelineProps<Id> & RefAttributes<HTMLOListElement>,\n) => ReactElement;\n"]}
|
|
1
|
+
{"version":3,"file":"advanced-display.js","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GAGjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,yBAAyB,GAG1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAIvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,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/avatar-fallback\";\nimport { TableSortButton } from \"./table-sort-button.js\";\nimport { getNextDataTableSortState } from \"@hjmds/design-contracts/components/data-table\";\nimport {\n resolveDescriptionListColumnCount,\n resolveDescriptionListDescriptor,\n type DescriptionItemDescriptor,\n type DescriptionListColumns,\n} from \"@hjmds/design-contracts/components/description-list\";\nimport {\n resolveTimelineDescriptor,\n type ComposeTimelineAccessibleName,\n type TimelineItemDescriptor,\n} from \"@hjmds/design-contracts/components/timeline\";\nimport {\n resolveStatisticDescriptor,\n validateStatisticGroup,\n type ResolvedStatisticDescriptor,\n type StatisticDescriptor,\n type StatisticGroupDescriptor,\n} from \"@hjmds/design-contracts/components/statistic\";\nimport {\n accordionRecipe,\n avatarRecipe,\n dividerRecipe,\n listRecipe,\n statisticRecipe,\n type AccordionDensity,\n type AvatarShape,\n type AvatarSize,\n type StatisticDensity,\n type StatisticPresentation,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n createElement,\n forwardRef,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type ForwardedRef,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n type TableHTMLAttributes,\n} from \"react\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { classNames, useControllableState, useElementWidth } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\n\nexport type AccordionItem = Readonly<{\n id: string;\n title: ReactNode;\n panel: ReactNode;\n disabled?: boolean;\n}>;\n\nexport type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> &\n Readonly<{\n items: readonly AccordionItem[];\n value?: readonly string[];\n defaultValue?: readonly string[];\n onValueChange?: (value: readonly string[]) => void;\n allowsMultipleExpanded?: boolean;\n density?: AccordionDensity;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\nfunction validateAccordionItems(items: readonly AccordionItem[]): void {\n if (items.length === 0) throw new TypeError(\"Accordion requires at least one item\");\n const ids = new Set<string>();\n for (const item of items) {\n if (item.id.trim().length === 0) throw new TypeError(\"Accordion item id must not be empty\");\n if (ids.has(item.id)) throw new TypeError(`Duplicate Accordion item id: ${item.id}`);\n ids.add(item.id);\n }\n}\n\nfunction accordionFocusTarget(\n items: readonly AccordionItem[],\n currentIndex: number,\n key: string,\n): number | undefined {\n if (key === \"Home\") return items.findIndex((item) => !item.disabled);\n if (key === \"End\") {\n for (let index = items.length - 1; index >= 0; index -= 1) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n }\n const direction = key === \"ArrowDown\" ? 1 : key === \"ArrowUp\" ? -1 : 0;\n if (direction === 0) return undefined;\n for (let offset = 1; offset <= items.length; offset += 1) {\n const index = (currentIndex + direction * offset + items.length) % items.length;\n if (!items[index]?.disabled) return index;\n }\n return currentIndex;\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(\n function Accordion(\n {\n items,\n value: valueProp,\n defaultValue = [],\n onValueChange,\n allowsMultipleExpanded = accordionRecipe.defaults.allowsMultipleExpanded,\n density = accordionRecipe.defaults.density,\n headingLevel = 3,\n className,\n ...props\n },\n ref,\n ) {\n validateAccordionItems(items);\n const [value, setValue] = useControllableState<readonly string[]>({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const validIds = new Set(items.map((item) => item.id));\n const valueIds = new Set<string>();\n for (const id of value) {\n if (!validIds.has(id)) throw new RangeError(`Unknown Accordion value: ${id}`);\n if (valueIds.has(id)) throw new TypeError(`Duplicate Accordion value: ${id}`);\n valueIds.add(id);\n }\n if (!allowsMultipleExpanded && value.length > 1) {\n throw new RangeError(\"Accordion only allows one expanded item\");\n }\n const baseId = useId().replaceAll(\":\", \"\");\n const triggerRefs = useRef(new Map<string, HTMLButtonElement>());\n const toggle = (id: string) => {\n const expanded = value.includes(id);\n setValue(\n expanded\n ? value.filter((candidate) => candidate !== id)\n : allowsMultipleExpanded\n ? [...value, id]\n : [id],\n );\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-accordion\", className)}\n data-density={density}\n data-multiple={allowsMultipleExpanded || undefined}\n >\n {items.map((item, index) => {\n const expanded = value.includes(item.id);\n const triggerId = `${baseId}-accordion-trigger-${index}`;\n const panelId = `${baseId}-accordion-panel-${index}`;\n const trigger = (\n <button\n ref={(node) => {\n if (node) triggerRefs.current.set(item.id, node);\n else triggerRefs.current.delete(item.id);\n }}\n id={triggerId}\n type=\"button\"\n className=\"hjm-accordion__trigger\"\n aria-expanded={expanded}\n aria-controls={panelId}\n disabled={item.disabled}\n onClick={() => toggle(item.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n const target = accordionFocusTarget(items, index, event.key);\n if (target === undefined || target < 0) return;\n event.preventDefault();\n triggerRefs.current.get(items[target]!.id)?.focus();\n }}\n >\n <span className=\"hjm-accordion__title\">{item.title}</span>\n <span className=\"hjm-accordion__indicator\" aria-hidden=\"true\">\n {expanded ? \"−\" : \"+\"}\n </span>\n </button>\n );\n return (\n <div\n key={item.id}\n className=\"hjm-accordion__item\"\n data-state={item.disabled ? \"disabled\" : expanded ? \"expanded\" : \"collapsed\"}\n >\n {createElement(`h${headingLevel}`, { className: \"hjm-accordion__header\" }, trigger)}\n <div\n id={panelId}\n role=\"region\"\n className=\"hjm-accordion__panel\"\n aria-labelledby={triggerId}\n hidden={!expanded}\n >\n {item.panel}\n </div>\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nfunction initials(name: string): string {\n return name\n .trim()\n .split(/\\s+/u)\n .slice(0, 2)\n .map((part) => Array.from(part)[0] ?? \"\")\n .join(\"\")\n .toLocaleUpperCase();\n}\n\nexport type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n name: string;\n src?: string;\n alt?: string;\n fallback?: ReactNode;\n renderFallback?: (context: AvatarFallbackContext) => ReactNode;\n size?: AvatarSize;\n shape?: AvatarShape;\n imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, \"alt\" | \"src\">;\n }>;\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n alt = name,\n fallback,\n renderFallback,\n size = avatarRecipe.defaults.size,\n shape = avatarRecipe.defaults.shape,\n imageProps,\n className,\n ...props\n },\n ref,\n) {\n if (name.trim().length === 0) throw new TypeError(\"Avatar name must not be empty\");\n const [imageAvailable, setImageAvailable] = useState(Boolean(src));\n useEffect(() => setImageAvailable(Boolean(src)), [src]);\n const { onError, className: imageClassName, ...restImageProps } = imageProps ?? {};\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-avatar\", className)}\n data-size={size}\n data-shape={shape}\n data-state={imageAvailable ? \"image\" : \"fallback\"}\n >\n {src && imageAvailable ? (\n <img\n {...restImageProps}\n src={src}\n alt={alt}\n className={classNames(\"hjm-avatar__image\", imageClassName)}\n onError={(event) => {\n setImageAvailable(false);\n onError?.(event);\n }}\n />\n ) : (\n <span\n className=\"hjm-avatar__fallback\"\n role={alt.length > 0 ? \"img\" : undefined}\n aria-label={alt.length > 0 ? alt : undefined}\n aria-hidden={alt.length === 0 || undefined}\n >\n {renderFallback?.({ size: avatarRecipe.sizes[size], decorative: true }) ?? fallback ?? initials(name)}\n </span>\n )}\n </span>\n );\n});\n\nexport type AvatarGroupProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n /** Required: a pile of faces is meaningless to a screen reader otherwise. */\n label: string;\n children: ReactNode;\n size?: AvatarSize;\n /** Product-composed overflow copy such as \"+3\"; the count is the product's. */\n overflow?: ReactNode;\n }>;\n\n/**\n * Overlapping avatars. The overlap comes from the recipe ratio rather than a\n * pixel value so it holds across all four sizes, and the group carries one\n * accessible name instead of letting a reader walk five unlabelled images.\n */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { label, children, size = avatarRecipe.defaults.size, overflow, className, ...props },\n ref,\n) {\n if (label.trim().length === 0) throw new TypeError(\"AvatarGroup label must not be empty\");\n const offset = Math.round(avatarRecipe.sizes[size] * avatarRecipe.overlapRatio);\n return (\n <span\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={classNames(\"hjm-avatar-group\", className)}\n data-size={size}\n style={{ \"--hjm-avatar-overlap\": `${offset}px` } as CSSProperties}\n >\n {children}\n {overflow ? <span className=\"hjm-avatar-group__overflow\" aria-hidden=\"true\">{overflow}</span> : null}\n </span>\n );\n});\n\nexport type DividerOrientation = \"horizontal\" | \"vertical\";\nexport type DividerInset = keyof typeof dividerRecipe.insets;\n\nexport type DividerProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n orientation?: DividerOrientation;\n inset?: DividerInset;\n decorative?: boolean;\n }>;\n\nexport const Divider = forwardRef<HTMLElement, DividerProps>(function Divider(\n {\n orientation = dividerRecipe.defaults.orientation,\n inset = dividerRecipe.defaults.inset,\n decorative = false,\n className,\n ...props\n },\n ref,\n) {\n return createElement(orientation === \"horizontal\" ? \"hr\" : \"div\", {\n ...props,\n ref,\n className: classNames(\"hjm-divider\", className),\n \"data-orientation\": orientation,\n \"data-inset\": inset,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-hidden\": decorative || undefined,\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n});\n\nexport type ListAppearance = \"grouped\" | \"plain\";\n\nexport type ListProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n label: string;\n children: ReactNode;\n separator?: keyof typeof listRecipe.separators;\n appearance?: ListAppearance;\n }>;\n\n/** Semantic list container that owns separators around composed rows. */\nexport const List = forwardRef<HTMLDivElement, ListProps>(function List(\n {\n label,\n children,\n separator = listRecipe.defaults.separator,\n appearance = \"plain\",\n className,\n ...props\n },\n ref,\n) {\n if (!label.trim()) throw new TypeError(\"List label must not be empty\");\n const items = Children.toArray(children);\n return (\n <div\n {...props}\n ref={ref}\n aria-label={label}\n className={classNames(\"hjm-list\", className)}\n data-appearance={appearance}\n data-separator={separator}\n role=\"list\"\n >\n {items.map((item, index) => (\n <div\n className=\"hjm-list__item\"\n key={isValidElement(item) && item.key !== null ? item.key : `hjm-list-${index}`}\n role=\"listitem\"\n >\n {item}\n </div>\n ))}\n </div>\n );\n});\n\nexport type StatisticTrendMarkRenderProps = Readonly<{\n name: \"trendUp\" | \"trendDown\" | \"trendFlat\";\n color: \"currentColor\";\n size: number;\n}>;\n\nexport type ComposeStatisticAccessibilityLabel<Id extends string = string> = (\n input: Readonly<{\n contextLabel?: string;\n descriptor: ResolvedStatisticDescriptor<Id>;\n valueText: string;\n }>,\n) => string;\n\nexport type StatisticProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\"\n> & Readonly<{\n descriptor: StatisticDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n contextLabel?: string;\n accessibilityLabel?: string;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n /** Optional visual adapter; the descriptor remains the accessible value source. */\n renderValue?: (value: string) => ReactNode;\n}>;\n\nexport function Statistic<Id extends string = string>({\n descriptor,\n density = \"comfortable\",\n presentation = \"plain\",\n contextLabel,\n accessibilityLabel,\n composeAccessibilityLabel,\n renderTrendMark,\n renderValue,\n className,\n ...props\n}: StatisticProps<Id>) {\n const resolved = resolveStatisticDescriptor(descriptor);\n const valueText = `${resolved.prefix ?? \"\"}${resolved.value}${resolved.suffix ?? \"\"}`;\n const announcement = accessibilityLabel ?? composeAccessibilityLabel?.({\n ...(contextLabel === undefined ? {} : { contextLabel }),\n descriptor: resolved,\n valueText,\n }) ?? [contextLabel, resolved.label, valueText, resolved.trend?.label, resolved.hint]\n .filter(Boolean)\n .join(\", \");\n if (!announcement.trim()) throw new TypeError(\"Statistic accessibility label must not be empty\");\n const trendName = resolved.trend\n ? statisticRecipe.trend.marks[resolved.trend.direction]\n : undefined;\n return (\n <article\n {...props}\n aria-label={announcement}\n className={classNames(\"hjm-statistic\", className)}\n data-density={density}\n data-presentation={presentation}\n >\n <span aria-hidden=\"true\" className=\"hjm-statistic__label\">{resolved.label}</span>\n <span aria-hidden=\"true\" className=\"hjm-statistic__value-row\">\n {resolved.prefix ? <span className=\"hjm-statistic__affix\">{resolved.prefix}</span> : null}\n <strong className=\"hjm-statistic__value\">{renderValue?.(resolved.value) ?? resolved.value}</strong>\n {resolved.suffix ? <span className=\"hjm-statistic__affix\">{resolved.suffix}</span> : null}\n </span>\n {resolved.trend ? (\n <span aria-hidden=\"true\" className=\"hjm-statistic__trend\" data-tone={resolved.trend.tone}>\n <span className=\"hjm-statistic__trend-mark\">\n {renderTrendMark?.({ name: trendName!, color: \"currentColor\", size: 16 }) ?? (\n resolved.trend.direction === \"up\" ? \"↑\" : resolved.trend.direction === \"down\" ? \"↓\" : \"—\"\n )}\n </span>\n {resolved.trend.label}\n </span>\n ) : null}\n {resolved.hint ? <span aria-hidden=\"true\" className=\"hjm-statistic__hint\">{resolved.hint}</span> : null}\n </article>\n );\n}\n\nexport type StatisticGroupProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\"\n> & Readonly<{\n label: string;\n descriptor: StatisticGroupDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n}>;\n\nexport function StatisticGroup<Id extends string = string>({\n label,\n descriptor,\n density,\n presentation,\n composeAccessibilityLabel,\n renderTrendMark,\n className,\n style,\n ...props\n}: StatisticGroupProps<Id>) {\n validateStatisticGroup(descriptor);\n if (!label.trim()) throw new TypeError(\"StatisticGroup label must not be empty\");\n return (\n <div\n {...props}\n aria-label={label}\n className={classNames(\"hjm-statistic-group\", className)}\n role=\"list\"\n style={{ ...style, \"--hjm-statistic-columns\": descriptor.columns ?? statisticRecipe.defaults.columns } as CSSProperties}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} role=\"listitem\">\n <Statistic\n contextLabel={label}\n descriptor={item}\n {...(composeAccessibilityLabel === undefined ? {} : { composeAccessibilityLabel })}\n {...(density === undefined ? {} : { density })}\n {...(presentation === undefined ? {} : { presentation })}\n {...(renderTrendMark === undefined ? {} : { renderTrendMark })}\n />\n </div>\n ))}\n </div>\n );\n}\n\nexport type DescriptionListProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly DescriptionItemDescriptor<Id>[];\n columns?: DescriptionListColumns;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nfunction DescriptionListInner<Id extends string>(\n { items, columns, className, layoutStyle, style, ...props }: DescriptionListProps<Id>,\n forwardedRef: ForwardedRef<HTMLDListElement>,\n) {\n const descriptor = resolveDescriptionListDescriptor({\n items,\n ...(columns === undefined ? {} : { columns }),\n });\n const [width, ref] = useElementWidth(forwardedRef);\n const theme = useOptionalHjmTheme();\n const resolvedColumns = resolveDescriptionListColumnCount(\n width ?? 0,\n descriptor.columns,\n theme?.environment.textScale ?? 1,\n );\n const responsiveStyle = {\n ...style,\n ...layoutStyle,\n \"--hjm-description-columns\": resolvedColumns,\n } as CSSProperties;\n return (\n <dl\n {...props}\n ref={ref}\n className={classNames(\"hjm-description-list\", className)}\n data-columns={resolvedColumns}\n data-state={resolvedColumns < descriptor.columns ? \"collapsed\" : \"ready\"}\n style={responsiveStyle}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} className=\"hjm-description-list__item\">\n <dt className=\"hjm-description-list__label\">{item.label}</dt>\n <dd className=\"hjm-description-list__value\">{item.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nexport const DescriptionList = forwardRef(DescriptionListInner) as <Id extends string = string>(\n props: DescriptionListProps<Id> & RefAttributes<HTMLDListElement>,\n) => ReactElement;\n\nexport type TableSortDirection = \"ascending\" | \"descending\";\n\nexport type TableColumn<Row> = Readonly<{\n id: string;\n header: ReactNode;\n cell: (row: Row, rowIndex: number) => ReactNode;\n align?: \"start\" | \"center\" | \"end\";\n sortable?: boolean;\n sortDirection?: TableSortDirection;\n}>;\n\nexport type TableProps<Row> = Omit<TableHTMLAttributes<HTMLTableElement>, \"children\"> &\n Readonly<{\n columns: readonly TableColumn<Row>[];\n rows: readonly Row[];\n getRowKey: (row: Row, rowIndex: number) => string;\n caption?: ReactNode;\n /** Localized content rendered when rows is empty. */\n emptyState: ReactNode;\n onSortChange?: (columnId: string, direction: TableSortDirection) => void;\n wrapperClassName?: string;\n }>;\n\n// Table's callback cannot express null; share the sort policy with a two-state cycle.\nfunction TableInner<Row>(\n {\n columns,\n rows,\n getRowKey,\n caption,\n emptyState,\n onSortChange,\n wrapperClassName,\n className,\n ...props\n }: TableProps<Row>,\n ref: ForwardedRef<HTMLTableElement>,\n) {\n if (columns.length === 0) throw new TypeError(\"Table requires at least one column\");\n const ids = new Set<string>();\n for (const column of columns) {\n if (column.id.trim().length === 0) throw new TypeError(\"Table column id must not be empty\");\n if (ids.has(column.id)) throw new TypeError(`Duplicate Table column id: ${column.id}`);\n ids.add(column.id);\n if (column.sortDirection && !column.sortable) {\n throw new TypeError(`Table column ${column.id} has sortDirection but is not sortable`);\n }\n }\n const rowKeys = rows.map((row, rowIndex) => getRowKey(row, rowIndex));\n const seenRowKeys = new Set<string>();\n for (const rowKey of rowKeys) {\n if (rowKey.trim().length === 0) throw new TypeError(\"Table row key must not be empty\");\n if (seenRowKeys.has(rowKey)) throw new TypeError(`Duplicate Table row key: ${rowKey}`);\n seenRowKeys.add(rowKey);\n }\n return (\n <div className={classNames(\"hjm-table-scroll\", wrapperClassName)} tabIndex={0}>\n <table {...props} ref={ref} className={classNames(\"hjm-table\", className)}>\n {caption ? <caption className=\"hjm-table__caption\">{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.id}\n scope=\"col\"\n className=\"hjm-table__header\"\n data-align={column.align ?? \"start\"}\n aria-sort={column.sortDirection ?? (column.sortable ? \"none\" : undefined)}\n >\n {column.sortable ? (\n <TableSortButton\n header={column.header}\n {...(column.sortDirection === undefined ? {} : { direction: column.sortDirection })}\n glyphs={{ ascending: \" ↑\", descending: \" ↓\", none: \" ↕\" }}\n className=\"hjm-table__sort\"\n onSort={() => {\n const next = getNextDataTableSortState(\n column.sortDirection ? { columnId: column.id, direction: column.sortDirection } : null,\n column.id, \"two-state\",\n );\n onSortChange?.(column.id, next!.direction);\n }} />\n ) : column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td className=\"hjm-table__empty\" colSpan={columns.length}>{emptyState}</td>\n </tr>\n ) : (\n rows.map((row, rowIndex) => (\n <tr key={rowKeys[rowIndex]} className=\"hjm-table__row\">\n {columns.map((column) => (\n <td\n key={column.id}\n className=\"hjm-table__cell\"\n data-align={column.align ?? \"start\"}\n >\n {column.cell(row, rowIndex)}\n </td>\n ))}\n </tr>\n ))\n )}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport const Table = forwardRef(TableInner) as <Row>(\n props: TableProps<Row> & RefAttributes<HTMLTableElement>,\n) => ReactElement;\n\nexport type TimelineProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLOListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly TimelineItemDescriptor<Id>[];\n composeAccessibleName: ComposeTimelineAccessibleName;\n }>;\n\nfunction TimelineInner<Id extends string = string>(\n {\n items,\n composeAccessibleName,\n className,\n ...props\n }: TimelineProps<Id>,\n ref: ForwardedRef<HTMLOListElement>,\n) {\n const resolved = resolveTimelineDescriptor(\n { items },\n { composeAccessibleName },\n );\n return (\n <ol\n {...props}\n ref={ref}\n className={classNames(\"hjm-timeline\", className)}\n >\n {resolved.map((item, index) => (\n <li\n aria-label={item.accessibleName}\n className=\"hjm-timeline__item\"\n data-tone={item.tone}\n key={item.id}\n >\n <span className=\"hjm-timeline__rail\" aria-hidden=\"true\">\n <span className=\"hjm-timeline__dot\" />\n {index < resolved.length - 1 ? (\n <span className=\"hjm-timeline__connector\" />\n ) : null}\n </span>\n <span className=\"hjm-timeline__content\">\n <span className=\"hjm-timeline__heading\">\n <strong className=\"hjm-timeline__label\">{item.label}</strong>\n {item.timestamp ? (\n <time className=\"hjm-timeline__timestamp\">{item.timestamp}</time>\n ) : null}\n </span>\n {item.description ? (\n <span className=\"hjm-timeline__description\">{item.description}</span>\n ) : null}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\nexport const Timeline = forwardRef(TimelineInner) as <Id extends string = string>(\n props: TimelineProps<Id> & RefAttributes<HTMLOListElement>,\n) => ReactElement;\n"]}
|
package/dist/auth-screen.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export type AuthScreenLayoutProps = Omit<HTMLAttributes<HTMLElement>, "children"
|
|
|
7
7
|
hero: ReactNode;
|
|
8
8
|
/** The primary action block — provider buttons, or a product's own sign-in bundle. */
|
|
9
9
|
main: ReactNode;
|
|
10
|
+
/** Product-localized progress label; presence replaces actions with one centred loader. */
|
|
11
|
+
pendingLabel?: string;
|
|
12
|
+
/** Let the layout own the action card; omit when the product already supplies a surface. */
|
|
13
|
+
mainCard?: boolean;
|
|
10
14
|
/** Consent notice and policy links. Omit with `hasFooter: false`. */
|
|
11
15
|
footer?: ReactNode;
|
|
12
16
|
className?: string;
|
|
@@ -26,6 +30,10 @@ export declare const AuthScreenLayout: import("react").ForwardRefExoticComponent
|
|
|
26
30
|
hero: ReactNode;
|
|
27
31
|
/** The primary action block — provider buttons, or a product's own sign-in bundle. */
|
|
28
32
|
main: ReactNode;
|
|
33
|
+
/** Product-localized progress label; presence replaces actions with one centred loader. */
|
|
34
|
+
pendingLabel?: string;
|
|
35
|
+
/** Let the layout own the action card; omit when the product already supplies a surface. */
|
|
36
|
+
mainCard?: boolean;
|
|
29
37
|
/** Consent notice and policy links. Omit with `hasFooter: false`. */
|
|
30
38
|
footer?: ReactNode;
|
|
31
39
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-screen.d.ts","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,GAC/E,oBAAoB,GACpB,QAAQ,CAAC;IACP,8EAA8E;IAC9E,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC;IAChB,sFAAsF;IACtF,IAAI,EAAE,SAAS,CAAC;IAChB,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"auth-screen.d.ts","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,GAC/E,oBAAoB,GACpB,QAAQ,CAAC;IACP,8EAA8E;IAC9E,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC;IAChB,sFAAsF;IACtF,IAAI,EAAE,SAAS,CAAC;IAChB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEL;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;IApBzB,8EAA8E;SACzE,MAAM,GAAG,SAAS;IACvB,+EAA+E;UACzE,SAAS;IACf,sFAAsF;UAChF,SAAS;IACf,2FAA2F;mBAC5E,MAAM;IACrB,4FAA4F;eACjF,OAAO;IAClB,qEAAqE;aAC5D,SAAS;gBACN,MAAM;gDAmDrB,CAAC"}
|
package/dist/auth-screen.js
CHANGED
|
@@ -7,12 +7,15 @@ import { classNames } from "./internal.js";
|
|
|
7
7
|
* the bottom. The measurements come from the resolved descriptor as custom
|
|
8
8
|
* properties so the stylesheet keeps one source of truth with the contract.
|
|
9
9
|
*/
|
|
10
|
-
export const AuthScreenLayout = forwardRef(function AuthScreenLayout({ hero, main, footer, density, hasFooter, className, as: Element = "main", ...props }, forwardedRef) {
|
|
10
|
+
export const AuthScreenLayout = forwardRef(function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendingLabel, mainCard = false, className, as: Element = "main", ...props }, forwardedRef) {
|
|
11
11
|
const resolved = resolveAuthScreenDescriptor({
|
|
12
12
|
...(density === undefined ? {} : { density }),
|
|
13
13
|
...(hasFooter === undefined ? {} : { hasFooter }),
|
|
14
14
|
});
|
|
15
15
|
const showFooter = resolved.hasFooter && footer !== undefined && footer !== null;
|
|
16
|
+
const pending = pendingLabel !== undefined;
|
|
17
|
+
if (pending && !pendingLabel.trim())
|
|
18
|
+
throw new TypeError("AuthScreen pendingLabel must not be empty");
|
|
16
19
|
return (_jsxs(Element, { ...props, ref: forwardedRef, className: classNames("hjm-auth-screen", className), "data-density": resolved.density, style: {
|
|
17
20
|
["--hjm-auth-screen-max-width"]: `${resolved.maxWidth}px`,
|
|
18
21
|
["--hjm-auth-screen-hero-gap"]: `${resolved.heroGap}px`,
|
|
@@ -21,6 +24,6 @@ export const AuthScreenLayout = forwardRef(function AuthScreenLayout({ hero, mai
|
|
|
21
24
|
["--hjm-auth-screen-padding-inline"]: `${resolved.paddingInline}px`,
|
|
22
25
|
["--hjm-auth-screen-padding-block"]: `${resolved.paddingBlock}px`,
|
|
23
26
|
...props.style,
|
|
24
|
-
}, children: [_jsxs("div", { className: "hjm-auth-screen__block", children: [_jsx("div", { className: "hjm-auth-screen__hero", children: hero }),
|
|
27
|
+
}, children: [_jsxs("div", { className: "hjm-auth-screen__block", children: [_jsx("div", { className: "hjm-auth-screen__hero", children: hero }), _jsxs("div", { className: "hjm-auth-screen__main", "data-card": mainCard || undefined, "aria-busy": pending || undefined, children: [_jsx("div", { className: "hjm-auth-screen__actions", inert: pending, "aria-hidden": pending || undefined, style: pending ? { visibility: "hidden" } : undefined, children: main }), pending ? _jsx("div", { className: "hjm-auth-screen__pending", role: "status", "aria-label": pendingLabel, children: _jsx("span", { className: "hjm-auth-provider-button__spinner", "aria-hidden": "true" }) }) : null] })] }), showFooter ? _jsx("div", { className: "hjm-auth-screen__footer", children: footer }) : null] }));
|
|
25
28
|
});
|
|
26
29
|
//# sourceMappingURL=auth-screen.js.map
|
package/dist/auth-screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-screen.js","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,UAAU,EAAuC,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-screen.js","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,E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CAAC,8BAAwC,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,IAAI;YACrE,CAAC,kCAA4C,CAAC,EAAE,GAAG,QAAQ,CAAC,aAAa,IAAI;YAC7E,CAAC,iCAA2C,CAAC,EAAE,GAAG,QAAQ,CAAC,YAAY,IAAI;YAC3E,GAAG,KAAK,CAAC,KAAK;SACf,aAED,eAAK,SAAS,EAAC,wBAAwB,aACrC,cAAK,SAAS,EAAC,uBAAuB,YAAE,IAAI,GAAO,EACnD,eAAK,SAAS,EAAC,uBAAuB,eAAY,QAAQ,IAAI,SAAS,eAAa,OAAO,IAAI,SAAS,aAEtG,cAAK,SAAS,EAAC,0BAA0B,EAAC,KAAK,EAAE,OAAO,iBAAe,OAAO,IAAI,SAAS,EACzF,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,YAAG,IAAI,GAAO,EACpE,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,0BAA0B,EAAC,IAAI,EAAC,QAAQ,gBAAa,YAAY,YACzF,eAAM,SAAS,EAAC,mCAAmC,iBAAa,MAAM,GAAG,GACrE,CAAC,CAAC,CAAC,IAAI,IACT,IACF,EACL,UAAU,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,MAAM,GAAO,CAAC,CAAC,CAAC,IAAI,IACpE,CACX,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n resolveAuthScreenDescriptor,\n type AuthScreenDescriptor,\n} from \"@hjmds/design-contracts/components/auth-screen\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { classNames } from \"./internal.js\";\n\nexport type AuthScreenLayoutProps = Omit<HTMLAttributes<HTMLElement>, \"children\"> &\n AuthScreenDescriptor &\n Readonly<{\n /** Use section inside a product shell that already owns the main landmark. */\n as?: \"main\" | \"section\";\n /** Product mark, title and description. The product owns every string here. */\n hero: ReactNode;\n /** The primary action block — provider buttons, or a product's own sign-in bundle. */\n main: ReactNode;\n /** Product-localized progress label; presence replaces actions with one centred loader. */\n pendingLabel?: string;\n /** Let the layout own the action card; omit when the product already supplies a surface. */\n mainCard?: boolean;\n /** Consent notice and policy links. Omit with `hasFooter: false`. */\n footer?: ReactNode;\n className?: string;\n }>;\n\n/**\n * Two regions: hero + main stay one vertically centred block, the footer sits at\n * the bottom. The measurements come from the resolved descriptor as custom\n * properties so the stylesheet keeps one source of truth with the contract.\n */\nexport const AuthScreenLayout = forwardRef<HTMLElement, AuthScreenLayoutProps>(\n function AuthScreenLayout(\n { hero, main, footer, density, hasFooter, pendingLabel, mainCard = false, className, as: Element = \"main\", ...props },\n forwardedRef,\n ) {\n const resolved = resolveAuthScreenDescriptor({\n ...(density === undefined ? {} : { density }),\n ...(hasFooter === undefined ? {} : { hasFooter }),\n });\n const showFooter = resolved.hasFooter && footer !== undefined && footer !== null;\n const pending = pendingLabel !== undefined;\n if (pending && !pendingLabel.trim()) throw new TypeError(\"AuthScreen pendingLabel must not be empty\");\n return (\n <Element\n {...props}\n ref={forwardedRef}\n className={classNames(\"hjm-auth-screen\", className)}\n data-density={resolved.density}\n style={{\n [\"--hjm-auth-screen-max-width\" as string]: `${resolved.maxWidth}px`,\n [\"--hjm-auth-screen-hero-gap\" as string]: `${resolved.heroGap}px`,\n [\"--hjm-auth-screen-main-gap\" as string]: `${resolved.mainGap}px`,\n [\"--hjm-auth-screen-footer-gap\" as string]: `${resolved.footerGap}px`,\n [\"--hjm-auth-screen-padding-inline\" as string]: `${resolved.paddingInline}px`,\n [\"--hjm-auth-screen-padding-block\" as string]: `${resolved.paddingBlock}px`,\n ...props.style,\n }}\n >\n <div className=\"hjm-auth-screen__block\">\n <div className=\"hjm-auth-screen__hero\">{hero}</div>\n <div className=\"hjm-auth-screen__main\" data-card={mainCard || undefined} aria-busy={pending || undefined}>\n {/* Keep the action block in flow so the card never collapses; inert also removes keyboard access. */}\n <div className=\"hjm-auth-screen__actions\" inert={pending} aria-hidden={pending || undefined}\n style={pending ? { visibility: \"hidden\" } : undefined}>{main}</div>\n {pending ? <div className=\"hjm-auth-screen__pending\" role=\"status\" aria-label={pendingLabel}>\n <span className=\"hjm-auth-provider-button__spinner\" aria-hidden=\"true\" />\n </div> : null}\n </div>\n </div>\n {showFooter ? <div className=\"hjm-auth-screen__footer\">{footer}</div> : null}\n </Element>\n );\n },\n);\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import 'blobatar/motion.css';
|
|
3
|
+
import { type BlobatarMotionOptions, type AvatarFallbackContext } from '@hjmds/design-contracts/avatar-fallback';
|
|
4
|
+
/** Optional animated entry. Static avatar imports never load motion CSS. */
|
|
5
|
+
export declare function createAnimatedBlobatarFallback(options: BlobatarMotionOptions): (context: AvatarFallbackContext) => ReactNode;
|
|
6
|
+
//# sourceMappingURL=avatar-blobatar-motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-blobatar-motion.d.ts","sourceRoot":"","sources":["../src/avatar-blobatar-motion.tsx"],"names":[],"mappings":"AAAA,OAAM,EAA2B,KAAK,SAAS,EAAC,MAAI,OAAO,CAAC;AAAqH,OAAM,qBAAqB,CAAC;AAC7M,OAAM,EAAuB,KAAK,qBAAqB,EAAC,KAAK,qBAAqB,EAAC,MAAI,yCAAyC,CAAC;AAOjI,4EAA4E;AAC5E,wBAAgB,8BAA8B,CAAC,OAAO,EAAC,qBAAqB,GAAE,CAAC,OAAO,EAAC,qBAAqB,KAAG,SAAS,CAA0F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Blobatar } from '@blobatar/react';
|
|
4
|
+
import { idle, happy, sad, surprised, wink, sleepy, thinking } from 'blobatar/expression';
|
|
5
|
+
import 'blobatar/motion.css';
|
|
6
|
+
import { resolveBlobatarMotion } from '@hjmds/design-contracts/avatar-fallback';
|
|
7
|
+
import { useHjmTheme } from './provider.js';
|
|
8
|
+
const expressions = { idle, happy, sad, surprised, wink, sleepy, thinking };
|
|
9
|
+
function Artwork({ size, options }) {
|
|
10
|
+
const spec = resolveBlobatarMotion(options);
|
|
11
|
+
const { environment } = useHjmTheme();
|
|
12
|
+
const host = useRef(null);
|
|
13
|
+
const [visible, setVisible] = useState(false);
|
|
14
|
+
const [foreground, setForeground] = useState(false);
|
|
15
|
+
useEffect(() => { const update = () => setForeground(!document.hidden); update(); document.addEventListener('visibilitychange', update); const observer = new IntersectionObserver(entries => setVisible(entries.some(e => e.isIntersecting))); if (host.current)
|
|
16
|
+
observer.observe(host.current); return () => { observer.disconnect(); document.removeEventListener('visibilitychange', update); }; }, []);
|
|
17
|
+
const active = spec.active && spec.visible && visible && foreground && !environment.reducedMotion;
|
|
18
|
+
return _jsx("span", { ref: host, "aria-hidden": "true", style: { display: 'block' }, children: _jsx(Blobatar, { name: spec.seed, size: size, normalize: false, expression: expressions[spec.expression], animate: active ? 'always' : false, alt: "", "aria-hidden": "true" }) });
|
|
19
|
+
}
|
|
20
|
+
/** Optional animated entry. Static avatar imports never load motion CSS. */
|
|
21
|
+
export function createAnimatedBlobatarFallback(options) { resolveBlobatarMotion(options); return ({ size }) => _jsx(Artwork, { size: size, options: options }); }
|
|
22
|
+
//# sourceMappingURL=avatar-blobatar-motion.js.map
|