@kerf-js/veneer 0.0.0-stage → 0.1.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/LICENSE +16 -0
- package/README.md +1338 -2
- package/package.json +56 -3
- package/plugin.d.mts +187 -0
- package/plugin.mjs +399 -0
- package/src/Accordion.tsx +98 -0
- package/src/Alert.tsx +55 -0
- package/src/Badge.tsx +39 -0
- package/src/Button.tsx +175 -0
- package/src/Calendar-month.tsx +140 -0
- package/src/Calendar.tsx +335 -0
- package/src/Canvas.tsx +221 -0
- package/src/Card.tsx +85 -0
- package/src/Chart.tsx +278 -0
- package/src/Charts.tsx +158 -0
- package/src/Chip.tsx +61 -0
- package/src/Choice-checkbox.tsx +53 -0
- package/src/Choice-parts.tsx +7 -0
- package/src/Choice-radio.tsx +78 -0
- package/src/Choice-segmented.tsx +76 -0
- package/src/Choice-switch.tsx +51 -0
- package/src/Choice.tsx +4 -0
- package/src/CloseX.tsx +14 -0
- package/src/CodeBlock.tsx +81 -0
- package/src/CodeInput.tsx +256 -0
- package/src/Combobox.tsx +281 -0
- package/src/CommandPalette-controller.ts +314 -0
- package/src/CommandPalette-rows.tsx +137 -0
- package/src/CommandPalette.tsx +196 -0
- package/src/DataGrid-actions.ts +119 -0
- package/src/DataGrid-body.tsx +58 -0
- package/src/DataGrid-controller.ts +145 -0
- package/src/DataGrid-header.tsx +108 -0
- package/src/DataGrid-model.ts +248 -0
- package/src/DataGrid-pivot.tsx +108 -0
- package/src/DataGrid-rows.tsx +296 -0
- package/src/DataGrid-toolbar.tsx +127 -0
- package/src/DataGrid-tree.ts +149 -0
- package/src/DataGrid-viewport.tsx +37 -0
- package/src/DataGrid.tsx +145 -0
- package/src/DateField-presets.tsx +27 -0
- package/src/DateField-range.tsx +370 -0
- package/src/DateField.tsx +295 -0
- package/src/Dither.tsx +313 -0
- package/src/Drawer.tsx +123 -0
- package/src/DurationField.tsx +227 -0
- package/src/Feed.tsx +78 -0
- package/src/Field/view.tsx +147 -0
- package/src/Field.tsx +238 -0
- package/src/HamburgerMenu.tsx +119 -0
- package/src/Icon.tsx +15 -0
- package/src/Kbd.tsx +6 -0
- package/src/KeyValueEditor/actions.ts +75 -0
- package/src/KeyValueEditor/rows.tsx +104 -0
- package/src/KeyValueEditor.tsx +112 -0
- package/src/Layout.tsx +221 -0
- package/src/Markdown.tsx +127 -0
- package/src/MentionsInput/actions.ts +161 -0
- package/src/MentionsInput/end.tsx +82 -0
- package/src/MentionsInput.tsx +103 -0
- package/src/Menu.tsx +221 -0
- package/src/Modal.tsx +109 -0
- package/src/MonthPicker/month.tsx +117 -0
- package/src/MonthPicker/period.tsx +197 -0
- package/src/MonthPicker/shared.tsx +272 -0
- package/src/MonthPicker/week.tsx +103 -0
- package/src/MonthPicker.tsx +11 -0
- package/src/MultiSelect.tsx +139 -0
- package/src/Nav.tsx +36 -0
- package/src/NumberField.tsx +156 -0
- package/src/Pagination.tsx +335 -0
- package/src/PaymentCard.tsx +111 -0
- package/src/Picker.tsx +228 -0
- package/src/PlaceField.tsx +285 -0
- package/src/Popover.tsx +88 -0
- package/src/Presence.tsx +37 -0
- package/src/Progress.tsx +71 -0
- package/src/RecurrenceField.tsx +372 -0
- package/src/RichSelect/codes.tsx +94 -0
- package/src/RichSelect/list.tsx +380 -0
- package/src/RichSelect/phone-view.tsx +114 -0
- package/src/RichSelect/phone.tsx +305 -0
- package/src/RichSelect/search-keys.ts +28 -0
- package/src/RichSelect/timezone.tsx +53 -0
- package/src/RichSelect.tsx +13 -0
- package/src/RichTextEditor/controller.tsx +305 -0
- package/src/RichTextEditor/editor.tsx +61 -0
- package/src/RichTextEditor/tools.tsx +132 -0
- package/src/RichTextEditor/view.tsx +210 -0
- package/src/RichTextEditor.tsx +9 -0
- package/src/ScrollGrid/measure.ts +39 -0
- package/src/ScrollGrid/parts.tsx +112 -0
- package/src/ScrollGrid.tsx +375 -0
- package/src/ScrollRail.tsx +114 -0
- package/src/ScrollView.tsx +57 -0
- package/src/Segments/controller.tsx +148 -0
- package/src/Segments/events.ts +99 -0
- package/src/Segments/view.tsx +77 -0
- package/src/Segments.tsx +2 -0
- package/src/Select.tsx +343 -0
- package/src/Shape.tsx +41 -0
- package/src/Shell/branches.tsx +108 -0
- package/src/Shell/button.tsx +33 -0
- package/src/Shell/shared.tsx +220 -0
- package/src/Shell/shell.tsx +25 -0
- package/src/Shell/state.ts +138 -0
- package/src/Shell/view.tsx +280 -0
- package/src/Shell.tsx +17 -0
- package/src/SideNav/sections.tsx +50 -0
- package/src/SideNav/state.ts +140 -0
- package/src/SideNav.tsx +130 -0
- package/src/SideNavTitle.tsx +25 -0
- package/src/SignaturePad/state.ts +172 -0
- package/src/SignaturePad/view.tsx +69 -0
- package/src/SignaturePad.tsx +76 -0
- package/src/Skeleton.tsx +46 -0
- package/src/Slider.tsx +81 -0
- package/src/Spinner.tsx +21 -0
- package/src/Stage-director.ts +361 -0
- package/src/Stage-look.ts +75 -0
- package/src/Stage-poster.tsx +62 -0
- package/src/Stage-types.ts +206 -0
- package/src/Stage.tsx +147 -0
- package/src/TabBar.tsx +114 -0
- package/src/Table-actions.tsx +51 -0
- package/src/Table-base.ts +70 -0
- package/src/Table-body.tsx +84 -0
- package/src/Table-columns.tsx +58 -0
- package/src/Table-details.tsx +66 -0
- package/src/Table-editor.tsx +66 -0
- package/src/Table-head.tsx +52 -0
- package/src/Table-model.ts +82 -0
- package/src/Table-notice.ts +39 -0
- package/src/Table-paging.ts +50 -0
- package/src/Table-rows.tsx +308 -0
- package/src/Table-selection.ts +63 -0
- package/src/Table-sortbar.tsx +41 -0
- package/src/Table-source.ts +66 -0
- package/src/Table-toolbar.tsx +71 -0
- package/src/Table-types.ts +115 -0
- package/src/Table-view.tsx +87 -0
- package/src/Table.tsx +31 -0
- package/src/Tabs.tsx +129 -0
- package/src/Tag.tsx +40 -0
- package/src/Ticker.tsx +42 -0
- package/src/TimeField-date-model.ts +77 -0
- package/src/TimeField-date-view.tsx +152 -0
- package/src/TimeField-model.ts +80 -0
- package/src/TimeField-options.tsx +224 -0
- package/src/TimeField-slots.tsx +32 -0
- package/src/TimeField-types.ts +33 -0
- package/src/TimeField-view.tsx +124 -0
- package/src/TimeField.tsx +126 -0
- package/src/Toast.tsx +143 -0
- package/src/Toggle.tsx +75 -0
- package/src/Tooltip.tsx +69 -0
- package/src/Type.tsx +136 -0
- package/src/VirtualList-controls.ts +105 -0
- package/src/VirtualList-data.ts +43 -0
- package/src/VirtualList-measure.ts +169 -0
- package/src/VirtualList-metrics.ts +41 -0
- package/src/VirtualList-mount.ts +145 -0
- package/src/VirtualList-rows.tsx +91 -0
- package/src/VirtualList-types.ts +76 -0
- package/src/VirtualList-view.tsx +123 -0
- package/src/VirtualList.tsx +81 -0
- package/src/admin/ApiKeys-actions.ts +124 -0
- package/src/admin/ApiKeys-form.tsx +64 -0
- package/src/admin/ApiKeys-view.tsx +101 -0
- package/src/admin/ApiKeys.tsx +224 -0
- package/src/admin/Audit.tsx +246 -0
- package/src/admin/Billing.tsx +307 -0
- package/src/admin/Cart.tsx +177 -0
- package/src/admin/Checkout-address.tsx +125 -0
- package/src/admin/Checkout-cart.tsx +78 -0
- package/src/admin/Checkout-coupon.ts +34 -0
- package/src/admin/Checkout-done.tsx +31 -0
- package/src/admin/Checkout-model.ts +33 -0
- package/src/admin/Checkout-navigation.ts +76 -0
- package/src/admin/Checkout-payment-view.tsx +49 -0
- package/src/admin/Checkout-payment.ts +80 -0
- package/src/admin/Checkout-review.tsx +60 -0
- package/src/admin/Checkout-shipping.tsx +47 -0
- package/src/admin/Checkout-state.ts +122 -0
- package/src/admin/Checkout-steps.ts +10 -0
- package/src/admin/Checkout-summary.tsx +97 -0
- package/src/admin/Checkout-types.ts +60 -0
- package/src/admin/Checkout-view.tsx +51 -0
- package/src/admin/Checkout.tsx +72 -0
- package/src/admin/CsvImport-actions.ts +131 -0
- package/src/admin/CsvImport.tsx +379 -0
- package/src/admin/Danger.tsx +240 -0
- package/src/admin/Integrations/Card.tsx +82 -0
- package/src/admin/Integrations/Webhooks.tsx +341 -0
- package/src/admin/Integrations.tsx +169 -0
- package/src/admin/InviteDialog.tsx +153 -0
- package/src/admin/Members/columns.tsx +181 -0
- package/src/admin/Members.tsx +316 -0
- package/src/admin/Order.tsx +115 -0
- package/src/admin/PlainTable.tsx +34 -0
- package/src/admin/Plans.tsx +375 -0
- package/src/admin/SaveBar/actions.ts +86 -0
- package/src/admin/SaveBar.tsx +153 -0
- package/src/admin/Secret.tsx +74 -0
- package/src/admin/Settings.tsx +145 -0
- package/src/admin/StepBar.tsx +66 -0
- package/src/admin/TagsInput/actions.ts +60 -0
- package/src/admin/TagsInput.tsx +95 -0
- package/src/admin/atoms.tsx +73 -0
- package/src/admin/index.ts +67 -0
- package/src/agent/Actions/reasons.tsx +38 -0
- package/src/agent/Actions.tsx +166 -0
- package/src/agent/AgentPlan.tsx +86 -0
- package/src/agent/ArtifactPanel.tsx +299 -0
- package/src/agent/Assistant.tsx +168 -0
- package/src/agent/Checkpoint.tsx +19 -0
- package/src/agent/Cite.tsx +70 -0
- package/src/agent/ContextMeter.tsx +70 -0
- package/src/agent/Conversation.tsx +70 -0
- package/src/agent/Message.tsx +92 -0
- package/src/agent/ModelPicker.tsx +167 -0
- package/src/agent/Prompt-model.ts +118 -0
- package/src/agent/Prompt-view.tsx +246 -0
- package/src/agent/Prompt.tsx +128 -0
- package/src/agent/Prose.tsx +118 -0
- package/src/agent/Question.tsx +137 -0
- package/src/agent/Reasoning.tsx +31 -0
- package/src/agent/Shimmer.tsx +11 -0
- package/src/agent/Sources.tsx +23 -0
- package/src/agent/SpeechInput.tsx +243 -0
- package/src/agent/Suggestions.tsx +36 -0
- package/src/agent/ToolCall.tsx +219 -0
- package/src/agent/TraceViewer.tsx +96 -0
- package/src/agent/bits.tsx +88 -0
- package/src/agent/index.ts +38 -0
- package/src/bind.ts +57 -0
- package/src/collab/AutoTrack.tsx +91 -0
- package/src/collab/Comments.tsx +204 -0
- package/src/collab/Composer/state.ts +125 -0
- package/src/collab/Composer/view.tsx +155 -0
- package/src/collab/Composer.tsx +141 -0
- package/src/collab/ConversationList.tsx +120 -0
- package/src/collab/Cursors.tsx +71 -0
- package/src/collab/DataIntegrity.tsx +103 -0
- package/src/collab/Kanban-card.ts +74 -0
- package/src/collab/Kanban.tsx +368 -0
- package/src/collab/Lock.tsx +36 -0
- package/src/collab/PresenceStack.tsx +176 -0
- package/src/collab/ShareDialog.tsx +273 -0
- package/src/collab/Status.tsx +101 -0
- package/src/collab/SyncedForm.tsx +42 -0
- package/src/collab/Thread/Message.tsx +265 -0
- package/src/collab/Thread/rows.tsx +56 -0
- package/src/collab/Thread.tsx +323 -0
- package/src/collab/VersionHistory.tsx +173 -0
- package/src/collab/ViewportRail.tsx +73 -0
- package/src/collab/index.ts +37 -0
- package/src/collab/peer.tsx +42 -0
- package/src/fields.ts +5 -0
- package/src/flow/AuthScreen.tsx +81 -0
- package/src/flow/AuthSteps.tsx +296 -0
- package/src/flow/Checklist.tsx +211 -0
- package/src/flow/ConnBanner.tsx +304 -0
- package/src/flow/Flow.tsx +97 -0
- package/src/flow/MfaSetup.tsx +244 -0
- package/src/flow/Otp.tsx +243 -0
- package/src/flow/ReauthDialog.tsx +79 -0
- package/src/flow/ShortcutsOverlay.tsx +121 -0
- package/src/flow/SignGate.tsx +184 -0
- package/src/flow/SignIn.tsx +136 -0
- package/src/flow/SignUp.tsx +149 -0
- package/src/flow/Sso.tsx +96 -0
- package/src/flow/SystemPage/accounts.tsx +74 -0
- package/src/flow/SystemPage/art.tsx +113 -0
- package/src/flow/SystemPage.tsx +395 -0
- package/src/flow/Tour.tsx +207 -0
- package/src/flow/index.ts +29 -0
- package/src/flow/kit.tsx +334 -0
- package/src/index.ts +237 -0
- package/src/layout.css +4 -0
- package/src/links.css +4 -0
- package/src/live/ActivityFeed.tsx +88 -0
- package/src/live/Bell.tsx +108 -0
- package/src/live/Connection.tsx +113 -0
- package/src/live/Inbox.tsx +113 -0
- package/src/live/InboxFeed.tsx +67 -0
- package/src/live/InboxGestures.ts +41 -0
- package/src/live/InboxHandlers.ts +102 -0
- package/src/live/InboxHeader.tsx +81 -0
- package/src/live/InboxModel.ts +81 -0
- package/src/live/InboxRow.tsx +125 -0
- package/src/live/MeetingRoom.tsx +22 -0
- package/src/live/MeetingRoomControlBar.tsx +197 -0
- package/src/live/MeetingRoomHandlers.ts +53 -0
- package/src/live/MeetingRoomLayout.tsx +27 -0
- package/src/live/MeetingRoomModel.ts +49 -0
- package/src/live/MeetingRoomMount.ts +49 -0
- package/src/live/MeetingRoomParts.tsx +178 -0
- package/src/live/MeetingRoomPerson.tsx +21 -0
- package/src/live/MeetingRoomState.ts +88 -0
- package/src/live/MeetingRoomTile.tsx +84 -0
- package/src/live/MeetingRoomTypes.ts +68 -0
- package/src/live/MeetingRoomView.tsx +36 -0
- package/src/live/NotificationPreferences.tsx +99 -0
- package/src/live/NotificationPreferencesActions.ts +55 -0
- package/src/live/NotificationPreferencesCell.tsx +26 -0
- package/src/live/NotificationPreferencesCells.tsx +59 -0
- package/src/live/NotificationPreferencesGrid.tsx +129 -0
- package/src/live/NotificationPreferencesModel.tsx +91 -0
- package/src/live/NotificationPreferencesSave.ts +85 -0
- package/src/live/NotificationPreferencesWatch.ts +31 -0
- package/src/live/Prejoin.tsx +238 -0
- package/src/live/PrejoinMeter.tsx +26 -0
- package/src/live/PrejoinPreview.tsx +53 -0
- package/src/live/PushSoftAsk.tsx +63 -0
- package/src/live/TransportPicker.tsx +341 -0
- package/src/live/TransportPickerDetails.tsx +130 -0
- package/src/live/index.ts +31 -0
- package/src/live/notify.tsx +22 -0
- package/src/live/shared.tsx +110 -0
- package/src/parts.tsx +199 -0
- package/src/plugin/catalog.mjs +129 -0
- package/src/plugin/dtcg.mjs +79 -0
- package/src/plugin/icons.mjs +7 -0
- package/src/plugin/seed.mjs +40 -0
- package/src/plugin/theme-context.mjs +44 -0
- package/src/plugin/theme-css.mjs +143 -0
- package/src/plugin/theme-motion.mjs +43 -0
- package/src/plugin/theme-parts.d.mts +41 -0
- package/src/plugin/theme-parts.mjs +224 -0
- package/src/plugin/theme-text.mjs +93 -0
- package/src/plugin/theme-values.mjs +15 -0
- package/src/plugin/theme.d.mts +82 -0
- package/src/plugin/theme.mjs +316 -0
- package/src/schedule/Agenda.tsx +124 -0
- package/src/schedule/AgendaActions.ts +31 -0
- package/src/schedule/AgendaDay.tsx +124 -0
- package/src/schedule/AgendaGestures.ts +27 -0
- package/src/schedule/AgendaKeys.ts +52 -0
- package/src/schedule/AgendaModel.ts +82 -0
- package/src/schedule/AgendaNavigation.ts +38 -0
- package/src/schedule/AgendaPage.tsx +39 -0
- package/src/schedule/AgendaStrip.tsx +55 -0
- package/src/schedule/AvailabilityEditor-actions.ts +146 -0
- package/src/schedule/AvailabilityEditor-day.tsx +119 -0
- package/src/schedule/AvailabilityEditor-view.tsx +205 -0
- package/src/schedule/AvailabilityEditor.tsx +113 -0
- package/src/schedule/BookingCalendar.tsx +121 -0
- package/src/schedule/BookingCalendarActions.ts +85 -0
- package/src/schedule/BookingCalendarModel.ts +86 -0
- package/src/schedule/BookingCalendarParts.tsx +87 -0
- package/src/schedule/Calendar/AgendaView.tsx +45 -0
- package/src/schedule/Calendar/CalendarDialogs.tsx +105 -0
- package/src/schedule/Calendar/CalendarMain.tsx +47 -0
- package/src/schedule/Calendar/CalendarToolbar.tsx +106 -0
- package/src/schedule/Calendar/Column.tsx +129 -0
- package/src/schedule/Calendar/EventBlock.tsx +71 -0
- package/src/schedule/Calendar/MiniMonth.tsx +169 -0
- package/src/schedule/Calendar/MonthGrid.tsx +296 -0
- package/src/schedule/Calendar/TimeGrid.tsx +252 -0
- package/src/schedule/Calendar/Timeline.tsx +287 -0
- package/src/schedule/Calendar/ZoneChip.tsx +73 -0
- package/src/schedule/Calendar/calendar-shell.ts +160 -0
- package/src/schedule/Calendar/calendar-state.ts +30 -0
- package/src/schedule/Calendar/now-spans.tsx +33 -0
- package/src/schedule/Calendar/shared.ts +3 -0
- package/src/schedule/Calendar/state-actions.ts +189 -0
- package/src/schedule/Calendar/state-base.ts +143 -0
- package/src/schedule/Calendar/state-keys.ts +128 -0
- package/src/schedule/Calendar/time-fit.ts +84 -0
- package/src/schedule/Calendar.tsx +182 -0
- package/src/schedule/EventEditor.tsx +267 -0
- package/src/schedule/EventPopover.tsx +190 -0
- package/src/schedule/MeetingPlanner-model.ts +222 -0
- package/src/schedule/MeetingPlanner-view.tsx +310 -0
- package/src/schedule/MeetingPlanner.tsx +122 -0
- package/src/schedule/MoveSheet.tsx +168 -0
- package/src/schedule/YearView-model.ts +164 -0
- package/src/schedule/YearView-parts.tsx +147 -0
- package/src/schedule/YearView.tsx +100 -0
- package/src/schedule/bits.tsx +65 -0
- package/src/schedule/index.ts +25 -0
- package/src/skeleton-css.ts +4 -0
- package/src/styles.ts +13 -0
- package/src/type.css +15 -0
- package/src/ui.ts +41 -0
- package/src/use-ui.ts +10 -0
- package/tailwind.css +38 -0
- package/tokens/color.mjs +87 -0
package/src/fields.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The input family's shared CSS: its plumbing and the field shell (veneer-inputs.css §0–1).
|
|
2
|
+
import './styles'
|
|
3
|
+
import '@kerf-js/veneer-core/styles/inputs/base.css'
|
|
4
|
+
import '@kerf-js/veneer-core/styles/inputs/field.css'
|
|
5
|
+
import '@kerf-js/veneer-core/styles/inputs/keyframes.css'
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { WeaveIcon } from '@kerf-js/veneer-icons'
|
|
2
|
+
import '../styles'
|
|
3
|
+
import '@kerf-js/veneer-core/styles/flows/tokens.css'
|
|
4
|
+
import '@kerf-js/veneer-core/styles/flows/base.css'
|
|
5
|
+
import '@kerf-js/veneer-core/styles/flows/auth.css'
|
|
6
|
+
|
|
7
|
+
const THREADS = Array.from({ length: 24 }, (_, i) => ({ x: 12 + i * 26 }))
|
|
8
|
+
const KERF = [
|
|
9
|
+
[180, 0.15, 0.75],
|
|
10
|
+
[300, 0.35, 0.95],
|
|
11
|
+
[420, 0.05, 0.55],
|
|
12
|
+
[560, 0.25, 0.85],
|
|
13
|
+
].map(([y, a, b], i) => ({ i, d: `M${a! * 640} ${y} H${b! * 640}` }))
|
|
14
|
+
|
|
15
|
+
/** The woven lines of the brand panel: veneer threads, and kerf that draws once. */
|
|
16
|
+
const WeaveArt = () => (
|
|
17
|
+
<svg
|
|
18
|
+
data-part="weave"
|
|
19
|
+
viewBox="0 0 640 800"
|
|
20
|
+
preserveAspectRatio="xMidYMid slice"
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
>
|
|
23
|
+
{THREADS.map((t) => (
|
|
24
|
+
<line key={t.x} x1={t.x} y1="0" x2={t.x} y2="800" />
|
|
25
|
+
))}
|
|
26
|
+
{KERF.map((w) => (
|
|
27
|
+
<path key={w.i} pathLength="1" style={`--i:${w.i}`} d={w.d} />
|
|
28
|
+
))}
|
|
29
|
+
</svg>
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
/** The product's mark: a logo of the app's, or veneer's woven square. */
|
|
33
|
+
export const AuthLogo = ({ logo, name }: { logo?: unknown; name?: unknown }) => (
|
|
34
|
+
<span data-part="logo">
|
|
35
|
+
{logo ?? <WeaveIcon />}
|
|
36
|
+
{name}
|
|
37
|
+
</span>
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The auth layout (09 §2.2), by its own width: full-bleed under 600, a 420 card on the page at 600–999, split with the
|
|
42
|
+
* brand panel from 1000. The panel is decorative, so it is hidden from assistive tech; quiet flattens it by token.
|
|
43
|
+
*/
|
|
44
|
+
export function AuthScreen({
|
|
45
|
+
logo,
|
|
46
|
+
name,
|
|
47
|
+
quote,
|
|
48
|
+
cite,
|
|
49
|
+
brand,
|
|
50
|
+
children,
|
|
51
|
+
...rest
|
|
52
|
+
}: {
|
|
53
|
+
logo?: unknown
|
|
54
|
+
name?: unknown
|
|
55
|
+
quote?: unknown
|
|
56
|
+
cite?: unknown
|
|
57
|
+
brand?: unknown
|
|
58
|
+
children?: unknown
|
|
59
|
+
[attr: string]: unknown
|
|
60
|
+
}) {
|
|
61
|
+
return (
|
|
62
|
+
<div data-scope="auth" {...rest}>
|
|
63
|
+
<div data-part="layout">
|
|
64
|
+
<aside data-part="brand" aria-hidden="true">
|
|
65
|
+
<AuthLogo logo={logo} name={name} />
|
|
66
|
+
<WeaveArt />
|
|
67
|
+
{brand}
|
|
68
|
+
{quote !== undefined && (
|
|
69
|
+
<blockquote>
|
|
70
|
+
{quote}
|
|
71
|
+
{cite !== undefined && <cite>{cite}</cite>}
|
|
72
|
+
</blockquote>
|
|
73
|
+
)}
|
|
74
|
+
</aside>
|
|
75
|
+
<div data-part="main">
|
|
76
|
+
<div data-part="panel">{children}</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { KeyIcon, LeftIcon, MailIcon } from '@kerf-js/veneer-icons'
|
|
2
|
+
import { clockLabel, emailError, passwordRules, uid } from '@kerf-js/veneer-core'
|
|
3
|
+
import { derived, onCleanup, onMount, state, untrack } from '@kerf-js/core'
|
|
4
|
+
import { Avatar } from '../parts'
|
|
5
|
+
import { Badge } from '../Badge'
|
|
6
|
+
import { Button } from '../Button'
|
|
7
|
+
import { Input } from '../Field'
|
|
8
|
+
import {
|
|
9
|
+
FormError,
|
|
10
|
+
Mark,
|
|
11
|
+
Rail,
|
|
12
|
+
StepFrame,
|
|
13
|
+
Submit,
|
|
14
|
+
TextLink,
|
|
15
|
+
Title,
|
|
16
|
+
useCooldown,
|
|
17
|
+
useStepForm,
|
|
18
|
+
type FlowForm,
|
|
19
|
+
type Heading,
|
|
20
|
+
} from './kit'
|
|
21
|
+
import { PasswordMeter } from './SignUp'
|
|
22
|
+
import '../styles'
|
|
23
|
+
import '@kerf-js/veneer-core/styles/flows/auth.css'
|
|
24
|
+
import '@kerf-js/veneer-core/styles/layout/row.css'
|
|
25
|
+
|
|
26
|
+
const Back = ({ onBack }: { onBack: () => void }) => (
|
|
27
|
+
<div>
|
|
28
|
+
<Button emphasis="ghost" tone="neutral" size="sm" icon={LeftIcon} onClick={onBack}>
|
|
29
|
+
Back
|
|
30
|
+
</Button>
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
/** "Check your inbox" (09 §2.1): waiting, so no solid; the address, Open mail app, resend on a countdown, change email. */
|
|
35
|
+
export function MagicLinkSent({
|
|
36
|
+
email,
|
|
37
|
+
title,
|
|
38
|
+
lede,
|
|
39
|
+
heading,
|
|
40
|
+
resendIn = 30,
|
|
41
|
+
mailHref,
|
|
42
|
+
onResend,
|
|
43
|
+
onChangeEmail,
|
|
44
|
+
onBack,
|
|
45
|
+
}: {
|
|
46
|
+
email: string
|
|
47
|
+
title?: unknown
|
|
48
|
+
lede?: unknown
|
|
49
|
+
heading?: Heading
|
|
50
|
+
resendIn?: number
|
|
51
|
+
/** Shows Open email app (phones). */ mailHref?: string
|
|
52
|
+
onResend?: () => void
|
|
53
|
+
onChangeEmail?: () => void
|
|
54
|
+
onBack?: () => void
|
|
55
|
+
}) {
|
|
56
|
+
const round = state(0)
|
|
57
|
+
const left = useCooldown(() => (round.value, resendIn))
|
|
58
|
+
return (
|
|
59
|
+
<div data-scope="stack">
|
|
60
|
+
{onBack && <Back onBack={onBack} />}
|
|
61
|
+
<Mark>
|
|
62
|
+
<MailIcon />
|
|
63
|
+
</Mark>
|
|
64
|
+
<div>
|
|
65
|
+
<Title as={heading}>{title ?? 'Check your inbox'}</Title>
|
|
66
|
+
<p data-part="lede">
|
|
67
|
+
{lede ?? (
|
|
68
|
+
<>
|
|
69
|
+
We sent a sign-in link to <b>{email}</b>. It works once and expires in 15 minutes.
|
|
70
|
+
</>
|
|
71
|
+
)}
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
{mailHref && (
|
|
75
|
+
<Button emphasis="frame" full role="link" onClick={() => location.assign(mailHref)}>
|
|
76
|
+
Open email app
|
|
77
|
+
</Button>
|
|
78
|
+
)}
|
|
79
|
+
<div data-part="row">
|
|
80
|
+
{onResend && (
|
|
81
|
+
<TextLink
|
|
82
|
+
disabled={left.value > 0}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
onResend()
|
|
85
|
+
round.value++
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{left.value > 0 ? `Resend in ${clockLabel(left.value)}` : 'Resend link'}
|
|
89
|
+
</TextLink>
|
|
90
|
+
)}
|
|
91
|
+
{onChangeEmail && <TextLink onClick={onChangeEmail}>Use a different email</TextLink>}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** What the reset form collects, across its two steps. */
|
|
98
|
+
export interface ResetValues {
|
|
99
|
+
email?: string
|
|
100
|
+
password?: string
|
|
101
|
+
confirm?: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Props for ResetPassword. */
|
|
105
|
+
export interface ResetPasswordProps extends FlowForm<ResetValues> {
|
|
106
|
+
/** `request` asks for the email; `password` sets the new one (after the link or the code). */
|
|
107
|
+
stage?: 'request' | 'password' | undefined
|
|
108
|
+
onBack?: () => void
|
|
109
|
+
title?: unknown
|
|
110
|
+
lede?: unknown
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Reset (09 §2.1): email → link or code → new password and confirm. Never says whether the email has an account (§2.3). */
|
|
114
|
+
export function ResetPassword(p: ResetPasswordProps) {
|
|
115
|
+
const id = uid('reset')
|
|
116
|
+
const stage = untrack(() => p.stage ?? 'request')
|
|
117
|
+
const password = state('')
|
|
118
|
+
const ctl = useStepForm<ResetValues>(
|
|
119
|
+
untrack(() => p),
|
|
120
|
+
(v) =>
|
|
121
|
+
stage === 'request'
|
|
122
|
+
? { email: v.email ? emailError(v.email) : 'Enter the email you sign in with.' }
|
|
123
|
+
: {
|
|
124
|
+
password: passwordRules(v.password ?? '').every((r) => r.met)
|
|
125
|
+
? undefined
|
|
126
|
+
: 'Use at least 8 characters, with a letter and a number.',
|
|
127
|
+
confirm: v.confirm === v.password ? undefined : "Those passwords don't match.",
|
|
128
|
+
},
|
|
129
|
+
)
|
|
130
|
+
return (
|
|
131
|
+
<StepFrame ctl={ctl} embedded={!!p.form} labelledby={`${id}-t`}>
|
|
132
|
+
{p.onBack && <Back onBack={p.onBack} />}
|
|
133
|
+
<Mark>
|
|
134
|
+
<KeyIcon />
|
|
135
|
+
</Mark>
|
|
136
|
+
<div>
|
|
137
|
+
<Title as={p.heading} id={`${id}-t`}>
|
|
138
|
+
{p.title ?? (stage === 'request' ? 'Reset your password' : 'Choose a new password')}
|
|
139
|
+
</Title>
|
|
140
|
+
<p data-part="lede">
|
|
141
|
+
{p.lede ??
|
|
142
|
+
(stage === 'request'
|
|
143
|
+
? "We'll email a link that lets you choose a new one. It expires in 30 minutes."
|
|
144
|
+
: 'Then sign in with it everywhere.')}
|
|
145
|
+
</p>
|
|
146
|
+
</div>
|
|
147
|
+
<FormError ctl={ctl} />
|
|
148
|
+
{stage === 'request' ? (
|
|
149
|
+
<Input
|
|
150
|
+
label="Work email"
|
|
151
|
+
name="email"
|
|
152
|
+
type="email"
|
|
153
|
+
inputmode="email"
|
|
154
|
+
autocomplete="email"
|
|
155
|
+
hint=""
|
|
156
|
+
error={ctl.errors.value.email}
|
|
157
|
+
onBlur={(e: FocusEvent) =>
|
|
158
|
+
ctl.flag('email', emailError((e.target as HTMLInputElement).value))
|
|
159
|
+
}
|
|
160
|
+
/>
|
|
161
|
+
) : (
|
|
162
|
+
<>
|
|
163
|
+
<div>
|
|
164
|
+
<Input
|
|
165
|
+
label="New password"
|
|
166
|
+
name="password"
|
|
167
|
+
type="password"
|
|
168
|
+
autocomplete="new-password"
|
|
169
|
+
hint=""
|
|
170
|
+
error={ctl.errors.value.password}
|
|
171
|
+
onInput={(e) => (password.value = e.currentTarget.value)}
|
|
172
|
+
/>
|
|
173
|
+
<PasswordMeter value={password.value} />
|
|
174
|
+
</div>
|
|
175
|
+
<Input
|
|
176
|
+
label="Confirm password"
|
|
177
|
+
name="confirm"
|
|
178
|
+
type="password"
|
|
179
|
+
autocomplete="new-password"
|
|
180
|
+
hint=""
|
|
181
|
+
error={ctl.errors.value.confirm}
|
|
182
|
+
/>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
185
|
+
<Submit ctl={ctl}>{stage === 'request' ? 'Send reset link' : 'Continue'}</Submit>
|
|
186
|
+
</StepFrame>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Invite accept (09 §2.1): who invited you, the org and role, "You'll join as…", Join and Decline; `children` holds an inline sign-in or sign-up. */
|
|
191
|
+
export function InviteAccept({
|
|
192
|
+
inviter,
|
|
193
|
+
org,
|
|
194
|
+
role,
|
|
195
|
+
email,
|
|
196
|
+
description,
|
|
197
|
+
heading,
|
|
198
|
+
pending,
|
|
199
|
+
onAccept,
|
|
200
|
+
onDecline,
|
|
201
|
+
onOtherAccount,
|
|
202
|
+
onBack,
|
|
203
|
+
children,
|
|
204
|
+
}: {
|
|
205
|
+
inviter: string
|
|
206
|
+
org: string
|
|
207
|
+
role?: string
|
|
208
|
+
email?: unknown
|
|
209
|
+
description?: unknown
|
|
210
|
+
heading?: Heading
|
|
211
|
+
pending?: boolean | undefined
|
|
212
|
+
onAccept?: () => void
|
|
213
|
+
onDecline?: () => void
|
|
214
|
+
onOtherAccount?: () => void
|
|
215
|
+
onBack?: () => void
|
|
216
|
+
children?: unknown
|
|
217
|
+
}) {
|
|
218
|
+
const body = derived(() => children)
|
|
219
|
+
return (
|
|
220
|
+
<div data-scope="stack">
|
|
221
|
+
{onBack && <Back onBack={onBack} />}
|
|
222
|
+
<div data-scope="row" data-wrap="none">
|
|
223
|
+
<Avatar name={inviter} size="lg" />
|
|
224
|
+
<div>
|
|
225
|
+
<p data-part="lede">{inviter} invited you to</p>
|
|
226
|
+
<b>{org}</b> {role && <Badge tone="info">{role}</Badge>}
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div>
|
|
230
|
+
<Title as={heading}>Join {org}</Title>
|
|
231
|
+
{email !== undefined && (
|
|
232
|
+
<p data-part="lede">
|
|
233
|
+
You'll join as <b>{email}</b>. {description}
|
|
234
|
+
</p>
|
|
235
|
+
)}
|
|
236
|
+
</div>
|
|
237
|
+
{body.value !== undefined ? (
|
|
238
|
+
body.value
|
|
239
|
+
) : (
|
|
240
|
+
<Button size="lg" full loading={pending} onClick={onAccept}>
|
|
241
|
+
Join {org}
|
|
242
|
+
</Button>
|
|
243
|
+
)}
|
|
244
|
+
<div data-part="row">
|
|
245
|
+
{onOtherAccount && (
|
|
246
|
+
<TextLink onClick={onOtherAccount}>Sign in with another account</TextLink>
|
|
247
|
+
)}
|
|
248
|
+
{onDecline && (
|
|
249
|
+
<Button emphasis="ghost" tone="neutral" size="sm" onClick={onDecline}>
|
|
250
|
+
Decline
|
|
251
|
+
</Button>
|
|
252
|
+
)}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** Done (09 §2.1): the mark strokes in, then the flow continues after `delay` (at once under reduced motion). */
|
|
259
|
+
export function AuthDone({
|
|
260
|
+
title,
|
|
261
|
+
lede,
|
|
262
|
+
heading,
|
|
263
|
+
delay = 1200,
|
|
264
|
+
onContinue,
|
|
265
|
+
}: {
|
|
266
|
+
title?: unknown
|
|
267
|
+
lede?: unknown
|
|
268
|
+
heading?: Heading
|
|
269
|
+
delay?: number
|
|
270
|
+
onContinue?: (() => void) | undefined
|
|
271
|
+
}) {
|
|
272
|
+
onMount(() => {
|
|
273
|
+
const reduced =
|
|
274
|
+
matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ||
|
|
275
|
+
document.documentElement.dataset.motion === 'reduce'
|
|
276
|
+
const t = setTimeout(() => onContinue?.(), reduced ? 0 : untrack(() => delay))
|
|
277
|
+
onCleanup(() => clearTimeout(t))
|
|
278
|
+
})
|
|
279
|
+
return (
|
|
280
|
+
<div data-scope="stack">
|
|
281
|
+
<Mark tone="positive" draw />
|
|
282
|
+
<div>
|
|
283
|
+
<Title as={heading}>{title ?? "You're in"}</Title>
|
|
284
|
+
{lede !== undefined && <p data-part="lede">{lede}</p>}
|
|
285
|
+
</div>
|
|
286
|
+
<div data-scope="row">
|
|
287
|
+
<Rail value={100} aria-hidden="true" />
|
|
288
|
+
</div>
|
|
289
|
+
{onContinue && (
|
|
290
|
+
<Button full size="lg" onClick={onContinue}>
|
|
291
|
+
Continue
|
|
292
|
+
</Button>
|
|
293
|
+
)}
|
|
294
|
+
</div>
|
|
295
|
+
)
|
|
296
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { XIcon } from '@kerf-js/veneer-icons'
|
|
2
|
+
import { announce, uid } from '@kerf-js/veneer-core'
|
|
3
|
+
import { derived, state, watch, type State } from '@kerf-js/core'
|
|
4
|
+
import { Button } from '../Button'
|
|
5
|
+
import { Checkbox } from '../Choice'
|
|
6
|
+
import { toast } from '../Toast'
|
|
7
|
+
import { Mark, Rail } from './kit'
|
|
8
|
+
import '@kerf-js/veneer-core/styles/flows/checklist.css'
|
|
9
|
+
import '@kerf-js/veneer-core/styles/layout/row.css'
|
|
10
|
+
|
|
11
|
+
/** One onboarding task. */
|
|
12
|
+
export interface ChecklistItem {
|
|
13
|
+
id: string
|
|
14
|
+
title: unknown
|
|
15
|
+
description?: unknown
|
|
16
|
+
done?: boolean
|
|
17
|
+
/** The frame button on the row's end. */
|
|
18
|
+
action?: { label: string; onClick: () => void } | undefined
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Props for Checklist. */
|
|
22
|
+
export interface ChecklistProps {
|
|
23
|
+
title?: unknown
|
|
24
|
+
subtitle?: unknown
|
|
25
|
+
/** Derived from server state, never from clicks here: doing the task anywhere checks it. */
|
|
26
|
+
items: ChecklistItem[]
|
|
27
|
+
/** A user-checkable list instead; omit it and the boxes only report. */
|
|
28
|
+
onToggle?: (id: string, done: boolean) => void
|
|
29
|
+
doneTitle?: unknown
|
|
30
|
+
doneDescription?: unknown
|
|
31
|
+
/** Shows Hide; a Toast offers Undo for 10s. */
|
|
32
|
+
onHide?: () => void
|
|
33
|
+
onUndoHide?: () => void
|
|
34
|
+
/** A disclosure on the title (phones: "3 of 5"). */
|
|
35
|
+
collapsible?: boolean
|
|
36
|
+
/** A row under the list: "Take the tour". */
|
|
37
|
+
footer?: unknown
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The onboarding checklist (09 §3.1): a counter in the head, a rail that fills per item, rows, then "You're set up". */
|
|
41
|
+
export function Checklist({
|
|
42
|
+
title = 'Get set up',
|
|
43
|
+
subtitle,
|
|
44
|
+
items,
|
|
45
|
+
onToggle,
|
|
46
|
+
doneTitle = "You're set up",
|
|
47
|
+
doneDescription,
|
|
48
|
+
onHide,
|
|
49
|
+
onUndoHide,
|
|
50
|
+
collapsible,
|
|
51
|
+
footer,
|
|
52
|
+
}: ChecklistProps) {
|
|
53
|
+
const id = uid('ck')
|
|
54
|
+
const list = derived(() => items)
|
|
55
|
+
const count = derived(() => list.value.filter((i) => i.done).length)
|
|
56
|
+
const total = derived(() => list.value.length)
|
|
57
|
+
const hidden = state(false)
|
|
58
|
+
const closed = state(false)
|
|
59
|
+
watchChecklist(count, total)
|
|
60
|
+
const hide = checklistHide(
|
|
61
|
+
hidden,
|
|
62
|
+
() => onHide?.(),
|
|
63
|
+
() => onUndoHide?.(),
|
|
64
|
+
)
|
|
65
|
+
const toggle = (get: () => [string, boolean]) => onToggle?.(...get())
|
|
66
|
+
return (
|
|
67
|
+
<section
|
|
68
|
+
data-scope="checklist"
|
|
69
|
+
data-state={count.value === total.value && total.value > 0 ? 'complete' : undefined}
|
|
70
|
+
aria-labelledby={id}
|
|
71
|
+
hidden={hidden.value || undefined}
|
|
72
|
+
>
|
|
73
|
+
<div data-part="head">
|
|
74
|
+
<div>
|
|
75
|
+
<h4 data-part="title" id={id} aria-level="3">
|
|
76
|
+
{title}{' '}
|
|
77
|
+
<span data-part="count">
|
|
78
|
+
{count.value} of {total.value}
|
|
79
|
+
</span>
|
|
80
|
+
</h4>
|
|
81
|
+
{subtitle !== undefined && <p>{subtitle}</p>}
|
|
82
|
+
</div>
|
|
83
|
+
<div data-scope="row">
|
|
84
|
+
{collapsible && (
|
|
85
|
+
<Button
|
|
86
|
+
emphasis="ghost"
|
|
87
|
+
tone="neutral"
|
|
88
|
+
size="sm"
|
|
89
|
+
aria-expanded={closed.value ? 'false' : 'true'}
|
|
90
|
+
aria-controls={`${id}-l`}
|
|
91
|
+
onClick={() => (closed.value = !closed.value)}
|
|
92
|
+
>
|
|
93
|
+
{closed.value ? 'Show' : 'Collapse'}
|
|
94
|
+
</Button>
|
|
95
|
+
)}
|
|
96
|
+
{onHide && (
|
|
97
|
+
<Button
|
|
98
|
+
emphasis="ghost"
|
|
99
|
+
tone="neutral"
|
|
100
|
+
size="sm"
|
|
101
|
+
icon={XIcon}
|
|
102
|
+
label="Hide checklist"
|
|
103
|
+
onClick={hide}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<ChecklistProgress count={count} total={total} />
|
|
109
|
+
<ChecklistRows id={id} closed={closed} list={list} onToggle={onToggle} toggle={toggle} />
|
|
110
|
+
<div data-part="done">
|
|
111
|
+
<Mark tone="positive" draw />
|
|
112
|
+
<div>
|
|
113
|
+
<b>{doneTitle}</b>
|
|
114
|
+
{doneDescription !== undefined && <p>{doneDescription}</p>}
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
{footer}
|
|
118
|
+
</section>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function watchChecklist(count: { readonly value: number }, total: { readonly value: number }) {
|
|
123
|
+
watch(
|
|
124
|
+
() => count.value,
|
|
125
|
+
(n, was) => {
|
|
126
|
+
if (was !== undefined && n > was)
|
|
127
|
+
announce(document, n === total.value ? 'All set up.' : `${n} of ${total.value} done.`)
|
|
128
|
+
},
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
function checklistHide(hidden: State<boolean>, onHide: () => void, onUndoHide: () => void) {
|
|
132
|
+
return () => {
|
|
133
|
+
hidden.value = true
|
|
134
|
+
onHide()
|
|
135
|
+
toast.show({
|
|
136
|
+
title: 'Checklist hidden',
|
|
137
|
+
description: 'Find it again under Help.',
|
|
138
|
+
duration: 10000,
|
|
139
|
+
action: {
|
|
140
|
+
label: 'Undo',
|
|
141
|
+
onClick() {
|
|
142
|
+
hidden.value = false
|
|
143
|
+
onUndoHide()
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function ChecklistRows({
|
|
150
|
+
id,
|
|
151
|
+
closed,
|
|
152
|
+
list,
|
|
153
|
+
onToggle,
|
|
154
|
+
toggle,
|
|
155
|
+
}: {
|
|
156
|
+
id: string
|
|
157
|
+
closed: State<boolean>
|
|
158
|
+
list: { readonly value: ChecklistItem[] }
|
|
159
|
+
onToggle: ChecklistProps['onToggle']
|
|
160
|
+
toggle: (get: () => [string, boolean]) => void
|
|
161
|
+
}) {
|
|
162
|
+
return (
|
|
163
|
+
<ol id={`${id}-l`} hidden={closed.value || undefined}>
|
|
164
|
+
{list.value.map((it) => (
|
|
165
|
+
<li key={it.id} data-part="item" data-state={it.done ? 'done' : undefined}>
|
|
166
|
+
<Checkbox
|
|
167
|
+
checked={!!it.done}
|
|
168
|
+
disabled={!onToggle}
|
|
169
|
+
aria-labelledby={`${id}-${it.id}`}
|
|
170
|
+
onChange={(e: Event) =>
|
|
171
|
+
toggle(() => [it.id, (e.currentTarget as HTMLInputElement).checked])
|
|
172
|
+
}
|
|
173
|
+
/>
|
|
174
|
+
<b id={`${id}-${it.id}`}>
|
|
175
|
+
{it.title}
|
|
176
|
+
<span data-part="sr-only">{it.done ? ', done' : ', to do'}</span>
|
|
177
|
+
</b>
|
|
178
|
+
{it.action ? (
|
|
179
|
+
<Button data-part="action" emphasis="frame" size="sm" onClick={it.action.onClick}>
|
|
180
|
+
{it.action.label}
|
|
181
|
+
</Button>
|
|
182
|
+
) : (
|
|
183
|
+
<span></span>
|
|
184
|
+
)}
|
|
185
|
+
{it.description !== undefined && <p>{it.description}</p>}
|
|
186
|
+
</li>
|
|
187
|
+
))}
|
|
188
|
+
</ol>
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function ChecklistProgress({
|
|
193
|
+
count,
|
|
194
|
+
total,
|
|
195
|
+
}: {
|
|
196
|
+
count: { readonly value: number }
|
|
197
|
+
total: { readonly value: number }
|
|
198
|
+
}) {
|
|
199
|
+
return (
|
|
200
|
+
<div data-part="progress">
|
|
201
|
+
<Rail
|
|
202
|
+
value={total.value ? (count.value / total.value) * 100 : 0}
|
|
203
|
+
role="progressbar"
|
|
204
|
+
aria-label="Setup progress"
|
|
205
|
+
aria-valuemin="0"
|
|
206
|
+
aria-valuemax={total.value}
|
|
207
|
+
aria-valuenow={count.value}
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
)
|
|
211
|
+
}
|