@alfadocs/ui-kit-debug 1.45.0 → 1.46.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/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js → actions-cell-renderer-B5m9lwgC.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js.map → actions-cell-renderer-B5m9lwgC.js.map} +1 -1
- package/dist/_chunks/ai-credits-notice-xszqOZTC.js +90 -0
- package/dist/_chunks/ai-credits-notice-xszqOZTC.js.map +1 -0
- package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +17 -0
- package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js.map +1 -0
- package/dist/_chunks/{ai-consent-banner-D7I2U-cz.js → ai-permission-notice-D7I2U-cz.js} +1 -1
- package/dist/_chunks/ai-permission-notice-D7I2U-cz.js.map +1 -0
- package/dist/_chunks/ai-sparkle-D23NT8Z_.js +45 -0
- package/dist/_chunks/ai-sparkle-D23NT8Z_.js.map +1 -0
- package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js → anamnesis-summary-rows-DI-UX5r6.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js.map → anamnesis-summary-rows-DI-UX5r6.js.map} +1 -1
- package/dist/_chunks/{appointment-card-TgR_2GKS.js → appointment-card-DluZy8Iv.js} +2 -2
- package/dist/_chunks/{appointment-card-TgR_2GKS.js.map → appointment-card-DluZy8Iv.js.map} +1 -1
- package/dist/_chunks/{appointment-peek-abiR0T9e.js → appointment-peek-BsfCpiJs.js} +3 -3
- package/dist/_chunks/{appointment-peek-abiR0T9e.js.map → appointment-peek-BsfCpiJs.js.map} +1 -1
- package/dist/_chunks/{appointment-timeline-CCnyUYKz.js → appointment-timeline-Cs5f9viN.js} +3 -3
- package/dist/_chunks/{appointment-timeline-CCnyUYKz.js.map → appointment-timeline-Cs5f9viN.js.map} +1 -1
- package/dist/_chunks/{appointment-tray-N0yEI8UF.js → appointment-tray-CLrGGnKR.js} +2 -2
- package/dist/_chunks/{appointment-tray-N0yEI8UF.js.map → appointment-tray-CLrGGnKR.js.map} +1 -1
- package/dist/_chunks/baby-Dku-Xvg9.js +23 -0
- package/dist/_chunks/baby-Dku-Xvg9.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell-o6LldMUA.js → balance-badge-cell-YGrYdrvR.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-o6LldMUA.js.map → balance-badge-cell-YGrYdrvR.js.map} +1 -1
- package/dist/_chunks/{booking-D43ASl8y.js → booking-B7gA9gFB.js} +279 -296
- package/dist/_chunks/booking-B7gA9gFB.js.map +1 -0
- package/dist/_chunks/button-group-CA1tmu39.js +325 -0
- package/dist/_chunks/button-group-CA1tmu39.js.map +1 -0
- package/dist/_chunks/{calendar-U6N0F99w.js → calendar-OzSeTb4V.js} +2 -2
- package/dist/_chunks/{calendar-U6N0F99w.js.map → calendar-OzSeTb4V.js.map} +1 -1
- package/dist/_chunks/{calendar-event-card-DKUnT9Be.js → calendar-event-card-B6N5h1dO.js} +57 -48
- package/dist/_chunks/{calendar-event-card-DKUnT9Be.js.map → calendar-event-card-B6N5h1dO.js.map} +1 -1
- package/dist/_chunks/{calendar-workspace-B7KvZ1_D.js → calendar-workspace-BB-BZT7W.js} +3002 -2912
- package/dist/_chunks/calendar-workspace-BB-BZT7W.js.map +1 -0
- package/dist/_chunks/{chart-PF2krCZC.js → chart-D8ucl8hH.js} +2 -2
- package/dist/_chunks/{chart-PF2krCZC.js.map → chart-D8ucl8hH.js.map} +1 -1
- package/dist/_chunks/{data-table-CcAx_I1w.js → data-table-DnKOmEVw.js} +2 -2
- package/dist/_chunks/{data-table-CcAx_I1w.js.map → data-table-DnKOmEVw.js.map} +1 -1
- package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js → editable-currency-cell-renderer-OUkUv7U4.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js.map → editable-currency-cell-renderer-OUkUv7U4.js.map} +1 -1
- package/dist/_chunks/{face-scheme-Bm6pe7R8.js → face-scheme-mIhwrQXt.js} +3 -3
- package/dist/_chunks/{face-scheme-Bm6pe7R8.js.map → face-scheme-mIhwrQXt.js.map} +1 -1
- package/dist/_chunks/{file-manager-BfLQxF5t.js → file-manager-DOcJGIx2.js} +4 -4
- package/dist/_chunks/{file-manager-BfLQxF5t.js.map → file-manager-DOcJGIx2.js.map} +1 -1
- package/dist/_chunks/{header-settings-CTe45iDy.js → header-settings-BEfx_-TF.js} +2 -2
- package/dist/_chunks/{header-settings-CTe45iDy.js.map → header-settings-BEfx_-TF.js.map} +1 -1
- package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js} +205 -199
- package/dist/_chunks/help-me-write-templates-DHIwa4xR.js.map +1 -0
- package/dist/_chunks/{hover-card-BMJBVqIf.js → hover-card-nUae8NPJ.js} +67 -62
- package/dist/_chunks/{hover-card-BMJBVqIf.js.map → hover-card-nUae8NPJ.js.map} +1 -1
- package/dist/_chunks/{icon-button-group-DkkdIygu.js → icon-button-group-DZKC6KGf.js} +181 -168
- package/dist/_chunks/icon-button-group-DZKC6KGf.js.map +1 -0
- package/dist/_chunks/kit-extensions-DuoFF1R3.js +94 -0
- package/dist/_chunks/kit-extensions-DuoFF1R3.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js → marketplace-app-shell-PB89Dkk_.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js.map → marketplace-app-shell-PB89Dkk_.js.map} +1 -1
- package/dist/_chunks/{notes-panel-Dkk9QPPX.js → notes-panel-CHbDDMx8.js} +83 -73
- package/dist/_chunks/notes-panel-CHbDDMx8.js.map +1 -0
- package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-DUj1htsH.js} +2 -2
- package/dist/_chunks/{patient-details-C8ImUrVg.js.map → patient-details-DUj1htsH.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-CO0WR7yA.js} +2 -2
- package/dist/_chunks/patient-field-row-CO0WR7yA.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-DNzdYjxE.js} +59 -45
- package/dist/_chunks/patient-summary-card-DNzdYjxE.js.map +1 -0
- package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
- package/dist/_chunks/rich-text-editor-BwDV2XkZ.js.map +1 -0
- package/dist/_chunks/{tasks-panel-CpcikOeY.js → tasks-panel-DncuBPIZ.js} +2 -2
- package/dist/_chunks/{tasks-panel-CpcikOeY.js.map → tasks-panel-DncuBPIZ.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-bI0pgDDv.js → theme-toggle-BP0XRGMM.js} +2 -2
- package/dist/_chunks/{theme-toggle-bI0pgDDv.js.map → theme-toggle-BP0XRGMM.js.map} +1 -1
- package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js +76 -0
- package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js.map +1 -0
- package/dist/_chunks/{workflow-status-xeaJTzD3.js → workflow-status-CuJAOuKL.js} +43 -42
- package/dist/_chunks/{workflow-status-xeaJTzD3.js.map → workflow-status-CuJAOuKL.js.map} +1 -1
- package/dist/agent-catalog.json +32 -4
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/_shared/field-value.d.ts.map +1 -1
- package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts +3 -0
- package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts.map +1 -0
- package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +48 -0
- package/dist/components/ai-credits-notice/ai-credits-notice.d.ts.map +1 -0
- package/dist/components/ai-credits-notice/index.d.ts +4 -0
- package/dist/components/ai-credits-notice/index.d.ts.map +1 -0
- package/dist/components/ai-credits-notice/index.js +7 -0
- package/dist/components/ai-credits-notice/index.js.map +1 -0
- package/dist/components/{ai-consent-banner/ai-consent-banner.agent.d.ts → ai-permission-notice/ai-permission-notice.agent.d.ts} +2 -2
- package/dist/components/ai-permission-notice/ai-permission-notice.agent.d.ts.map +1 -0
- package/dist/components/{ai-consent-banner/ai-consent-banner.d.ts → ai-permission-notice/ai-permission-notice.d.ts} +1 -1
- package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -0
- package/dist/components/ai-permission-notice/index.d.ts +4 -0
- package/dist/components/ai-permission-notice/index.d.ts.map +1 -0
- package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js +1 -1
- package/dist/components/ai-sparkle/ai-sparkle.d.ts +3 -3
- package/dist/components/ai-sparkle/ai-sparkle.d.ts.map +1 -1
- package/dist/components/ai-sparkle/index.js +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button-group/button-group.d.ts.map +1 -1
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/data-table/index.js +3 -3
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/hover-card/hover-card.d.ts +4 -0
- package/dist/components/hover-card/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card/index.d.ts +1 -1
- package/dist/components/hover-card/index.d.ts.map +1 -1
- package/dist/components/hover-card/index.js +3 -2
- package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +10 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-summary-card/patient-summary-card.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/rich-text-editor/editor-extensions.d.ts +54 -0
- package/dist/components/rich-text-editor/editor-extensions.d.ts.map +1 -0
- package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -1
- package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +4 -0
- package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.d.ts +2 -0
- package/dist/components/rich-text-editor/index.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +6 -4
- package/dist/components/rich-text-editor/index.js.map +1 -1
- package/dist/components/rich-text-editor/kit-extensions.d.ts +4 -0
- package/dist/components/rich-text-editor/kit-extensions.d.ts.map +1 -0
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +18 -2
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/components/workflow-status/workflow-status.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +51 -53
- package/dist/hooks/use-ai-sparkle.d.ts +7 -25
- package/dist/hooks/use-ai-sparkle.d.ts.map +1 -1
- package/dist/host-compat.css +2 -2
- package/dist/i18n/locales/ar.d.ts +31 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +33 -2
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +31 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +33 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +31 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +33 -2
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +31 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +33 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +31 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +33 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +31 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +33 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +31 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +33 -2
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +31 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +33 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +31 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +33 -2
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +31 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +33 -2
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +31 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +33 -2
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +31 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +33 -2
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +31 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +33 -2
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +31 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +33 -2
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +31 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +33 -2
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +31 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +33 -2
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +31 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +33 -2
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +31 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +33 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +646 -639
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +33 -2
- package/dist/locales/de.json +33 -2
- package/dist/locales/el.json +33 -2
- package/dist/locales/en.json +33 -2
- package/dist/locales/es.json +33 -2
- package/dist/locales/fr.json +33 -2
- package/dist/locales/hi.json +33 -2
- package/dist/locales/it.json +33 -2
- package/dist/locales/ja.json +33 -2
- package/dist/locales/nl.json +33 -2
- package/dist/locales/pl.json +33 -2
- package/dist/locales/pt.json +33 -2
- package/dist/locales/ro.json +33 -2
- package/dist/locales/ru.json +33 -2
- package/dist/locales/sq.json +33 -2
- package/dist/locales/sv.json +33 -2
- package/dist/locales/tr.json +33 -2
- package/dist/locales/zh.json +33 -2
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.data.d.ts +9 -0
- package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +16 -5
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.types.d.ts +3 -1
- package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +11 -2
- package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
- package/dist/patterns/help-me-write-templates/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +14 -4
- package/dist/_chunks/ai-consent-banner-D7I2U-cz.js.map +0 -1
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js +0 -52
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js.map +0 -1
- package/dist/_chunks/booking-D43ASl8y.js.map +0 -1
- package/dist/_chunks/button-group-R32U7SyV.js +0 -307
- package/dist/_chunks/button-group-R32U7SyV.js.map +0 -1
- package/dist/_chunks/calendar-workspace-B7KvZ1_D.js.map +0 -1
- package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +0 -1
- package/dist/_chunks/icon-button-group-DkkdIygu.js.map +0 -1
- package/dist/_chunks/notes-panel-Dkk9QPPX.js.map +0 -1
- package/dist/_chunks/patient-field-row-BRSOKvme.js.map +0 -1
- package/dist/_chunks/patient-summary-card-BhmKB2KR.js.map +0 -1
- package/dist/_chunks/rich-text-editor-BrAvNajV.js +0 -3779
- package/dist/_chunks/rich-text-editor-BrAvNajV.js.map +0 -1
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +0 -103
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js.map +0 -1
- package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts.map +0 -1
- package/dist/components/ai-consent-banner/ai-consent-banner.d.ts.map +0 -1
- package/dist/components/ai-consent-banner/index.d.ts +0 -4
- package/dist/components/ai-consent-banner/index.d.ts.map +0 -1
- /package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js.map +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useState as _, useEffect as v, useCallback as n } from "react";
|
|
2
|
+
import { u as y } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
3
|
+
const p = {
|
|
4
|
+
intro: 1840,
|
|
5
|
+
landed: 1440
|
|
6
|
+
}, f = {
|
|
7
|
+
intro: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_1]",
|
|
8
|
+
working: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_infinite]",
|
|
9
|
+
landed: "ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*4)_var(--ease-out)_1]"
|
|
10
|
+
}, g = {
|
|
11
|
+
intro: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*7)_var(--ease-in-out)_1_both]",
|
|
12
|
+
working: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*8)_linear_infinite]",
|
|
13
|
+
landed: "ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*5)_var(--ease-out)_1_both]"
|
|
14
|
+
}, b = "ds:pointer-events-none ds:absolute ds:[inset-block-start:0] ds:[inset-inline-start:0] ds:opacity-0 ds:[offset-path:inset(0_round_var(--radius-full))] ds:[offset-rotate:0deg]", C = [
|
|
15
|
+
{
|
|
16
|
+
key: 1,
|
|
17
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.2)]",
|
|
18
|
+
dot: "ds:size-2.5 ds:opacity-[var(--opacity-90)]"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: 2,
|
|
22
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.4)]",
|
|
23
|
+
dot: "ds:size-2 ds:opacity-[var(--opacity-70)]"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 3,
|
|
27
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.6)]",
|
|
28
|
+
dot: "ds:size-2 ds:opacity-[var(--opacity-50)]"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 4,
|
|
32
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*0.8)]",
|
|
33
|
+
dot: "ds:size-1.5 ds:opacity-[var(--opacity-30)]"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: 5,
|
|
37
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*1)]",
|
|
38
|
+
dot: "ds:size-1.5 ds:opacity-[var(--opacity-20)]"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 6,
|
|
42
|
+
lag: "ds:[animation-delay:calc(var(--animation-duration)*1.2)]",
|
|
43
|
+
dot: "ds:size-1 ds:opacity-[var(--opacity-10)]"
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
function w(e = {}) {
|
|
47
|
+
const { enabled: s = !0, reducedMotion: d = "auto" } = e, r = y(), o = d === "off" ? !1 : r, [a, t] = _(
|
|
48
|
+
s ? "intro" : null
|
|
49
|
+
);
|
|
50
|
+
v(() => {
|
|
51
|
+
if (a !== "intro" && a !== "landed") return;
|
|
52
|
+
const i = o ? 0 : p[a], u = window.setTimeout(() => t(null), i);
|
|
53
|
+
return () => window.clearTimeout(u);
|
|
54
|
+
}, [a, o]);
|
|
55
|
+
const c = n(() => t("working"), []), l = n(() => t("landed"), []), m = n(() => {
|
|
56
|
+
t((i) => i === "working" ? null : i);
|
|
57
|
+
}, []);
|
|
58
|
+
return {
|
|
59
|
+
state: a,
|
|
60
|
+
props: {
|
|
61
|
+
"data-ai-sparkle": a ?? void 0,
|
|
62
|
+
className: a ? f[a] : ""
|
|
63
|
+
},
|
|
64
|
+
start: c,
|
|
65
|
+
land: l,
|
|
66
|
+
reset: m
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
C,
|
|
71
|
+
f as S,
|
|
72
|
+
b as a,
|
|
73
|
+
g as b,
|
|
74
|
+
w as u
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=use-ai-sparkle-Cf4yVTLB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ai-sparkle-Cf4yVTLB.js","sources":["../../src/hooks/use-ai-sparkle.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\nimport { usePrefersReducedMotion } from './use-prefers-reduced-motion';\n\n/* -------------------------------------------------------------------- */\n/* Shared class tables — read by the hook (shimmer) and by the */\n/* `AiSparkle` presentational component (the comet layer), so both */\n/* sides key off the same three states. */\n/* -------------------------------------------------------------------- */\n\n/** Where the sparkle is: on first show, while an action runs, as it lands. */\nexport type AiSparkleState = 'intro' | 'working' | 'landed';\n\n// How long the one-off sparkles stay lit at the default 200ms\n// `--animation-duration` — everything the comet paints, plus one\n// `--animation-duration` of buffer so the clear never lands mid-fade.\n// `COMET_CLASS` runs the head's lap over 7 durations on intro and 5 on\n// landing, and the faintest tail dot starts 1.2 durations behind the head\n// (`COMET_TAIL`), so the last thing on screen ends a lap plus 1.2 durations\n// in: (7+1.2+1)*200 = 1840 and (5+1.2+1)*200 = 1440. Leave the tail's lag\n// out and the last dot is unmounted mid-flight. Scaled to 0 under reduced\n// motion (see `useAiSparkle`).\nconst SPARKLE_ONCE_MS: Record<'intro' | 'landed', number> = {\n intro: 1840,\n landed: 1440,\n};\n\n// Pill sparkle: a light sweep across the surface. Durations derive from\n// `--animation-duration`, so they drop to 0 (no motion) under\n// prefers-reduced-motion and in the accessible themes.\nexport const SHIMMER_CLASS: Record<AiSparkleState, string> = {\n intro:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_1]',\n working:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*6)_var(--ease-in-out)_infinite]',\n landed:\n 'ds:animate-[ai-pill-shimmer_calc(var(--animation-duration)*4)_var(--ease-out)_1]',\n};\n\n// The comet laps the pill: once on intro, faster on landing, looping while\n// an action runs. `offset-path` traces the pill's rounded outline; where it\n// is unsupported the comet simply never shows (it rests at opacity 0).\nexport const COMET_CLASS: Record<AiSparkleState, string> = {\n intro:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*7)_var(--ease-in-out)_1_both]',\n working:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*8)_linear_infinite]',\n landed:\n 'ds:animate-[ai-comet-orbit_calc(var(--animation-duration)*5)_var(--ease-out)_1_both]',\n};\n\n// The comet rides the host's rounded outline. Its tail is a row of dots on\n// the same path, each a step behind the head, so the tail bends with the\n// curve. Every piece rests at opacity 0 and shows only while it runs.\nexport const COMET_WRAPPER_CLASS =\n 'ds:pointer-events-none ds:absolute ds:[inset-block-start:0] ds:[inset-inline-start:0] ds:opacity-0 ds:[offset-path:inset(0_round_var(--radius-full))] ds:[offset-rotate:0deg]';\nexport const COMET_TAIL = [\n {\n key: 1,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.2)]',\n dot: 'ds:size-2.5 ds:opacity-[var(--opacity-90)]',\n },\n {\n key: 2,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.4)]',\n dot: 'ds:size-2 ds:opacity-[var(--opacity-70)]',\n },\n {\n key: 3,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.6)]',\n dot: 'ds:size-2 ds:opacity-[var(--opacity-50)]',\n },\n {\n key: 4,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*0.8)]',\n dot: 'ds:size-1.5 ds:opacity-[var(--opacity-30)]',\n },\n {\n key: 5,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*1)]',\n dot: 'ds:size-1.5 ds:opacity-[var(--opacity-20)]',\n },\n {\n key: 6,\n lag: 'ds:[animation-delay:calc(var(--animation-duration)*1.2)]',\n dot: 'ds:size-1 ds:opacity-[var(--opacity-10)]',\n },\n] as const;\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseAiSparkleOptions {\n /**\n * Whether the sparkle is available at all. Read once, at mount, to seed\n * the initial `'intro'` phase — matches how the RichTextEditor's\n * `aiSparkle` prop only ever gated the very first render. Default `true`.\n */\n enabled?: boolean;\n /**\n * `'auto'` (default) reads `prefers-reduced-motion` via\n * `usePrefersReducedMotion`. `'off'` forces full motion regardless of the\n * OS preference — useful for a story that wants to show the animated\n * states side by side with a reduced one.\n */\n reducedMotion?: 'auto' | 'off';\n}\n\nexport interface UseAiSparkleProps {\n /** Spread (or picked) onto the host element as a pure styling hook. */\n 'data-ai-sparkle': AiSparkleState | undefined;\n /**\n * The shimmer animation class for the current state — empty when at rest.\n * Layer it over the host's own base positioning classes; the comet layer\n * needs real DOM and lives in the `AiSparkle` component instead.\n */\n className: string;\n}\n\nexport interface UseAiSparkleReturn {\n /** `null` at rest — nothing to render for the comet layer either. */\n state: AiSparkleState | null;\n props: UseAiSparkleProps;\n /** An AI action started: swap to the looping `'working'` phase. */\n start: () => void;\n /** An action's result landed: swap to the one-off `'landed'` phase. */\n land: () => void;\n /**\n * Settle after an action ends. Clears back to rest only when still\n * `'working'` (the action errored or was cancelled before `land()`);\n * leaves `'landed'` alone so the one-off animation gets to play out.\n */\n reset: () => void;\n}\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Drives the AI-pill sparkle: lit on first show, looping while an action\n * runs, and a one-off flourish as the result lands.\n *\n * The hook owns the state machine and the timing only — it paints nothing.\n * `props['data-ai-sparkle']` is a plain styling hook for the host element;\n * `props.className` carries the shimmer layer's animation class from the\n * same lookup table the RichTextEditor's pill originally inlined. The\n * comet layer needs actual DOM (a head and a tail of dots), so it lives in\n * the sibling `AiSparkle` component, keyed off the same `state`.\n *\n * Both `intro` and `landed` are one-off: this hook clears them back to\n * `null` on a timer sized to the comet's lap plus a small buffer, at the\n * default 200ms `--animation-duration`. Under reduced\n * motion (`prefers-reduced-motion` or `reducedMotion: 'auto'`'s system\n * read) the CSS animations already collapse to 0ms, so the clear fires at\n * the next tick instead of waiting out the full lap — the pill still gets\n * its `data-ai-sparkle` attribute for a moment, but nothing visibly moves.\n */\nexport function useAiSparkle(\n options: UseAiSparkleOptions = {},\n): UseAiSparkleReturn {\n const { enabled = true, reducedMotion = 'auto' } = options;\n const systemReduced = usePrefersReducedMotion();\n const reduced = reducedMotion === 'off' ? false : systemReduced;\n\n const [state, setState] = useState<AiSparkleState | null>(\n enabled ? 'intro' : null,\n );\n\n useEffect(() => {\n if (state !== 'intro' && state !== 'landed') return undefined;\n const ms = reduced ? 0 : SPARKLE_ONCE_MS[state];\n const timer = window.setTimeout(() => setState(null), ms);\n return () => window.clearTimeout(timer);\n }, [state, reduced]);\n\n const start = useCallback(() => setState('working'), []);\n const land = useCallback(() => setState('landed'), []);\n const reset = useCallback(() => {\n setState((s) => (s === 'working' ? null : s));\n }, []);\n\n return {\n state,\n props: {\n 'data-ai-sparkle': state ?? undefined,\n className: state ? SHIMMER_CLASS[state] : '',\n },\n start,\n land,\n reset,\n };\n}\n"],"names":["SPARKLE_ONCE_MS","SHIMMER_CLASS","COMET_CLASS","COMET_WRAPPER_CLASS","COMET_TAIL","useAiSparkle","options","enabled","reducedMotion","systemReduced","usePrefersReducedMotion","reduced","state","setState","useState","useEffect","ms","timer","start","useCallback","land","reset","s"],"mappings":";;AAqBA,MAAMA,IAAsD;AAAA,EAC1D,OAAO;AAAA,EACP,QAA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,IAAQF,EAAY,MAAM;AAC9B,IAAAN,EAAS,CAACS,MAAOA,MAAM,YAAY,OAAOA,CAAE;AAAA,EAC9C,GAAG,CAAA,CAAE;AAEL,SAAO;AAAA,IACL,OAAAV;AAAA,IACA,OAAO;AAAA,MACL,mBAAmBA,KAAS;AAAA,MAC5B,WAAWA,IAAQX,EAAcW,CAAK,IAAI;AAAA,IAAA;AAAA,IAE5C,OAAAM;AAAA,IACA,MAAAE;AAAA,IACA,OAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -4,7 +4,7 @@ import { c as f } from "./index-D2ZczOXr.js";
|
|
|
4
4
|
import { useTranslation as L } from "react-i18next";
|
|
5
5
|
import { u as de } from "./registry-DvAUVLHh.js";
|
|
6
6
|
import { u as ie } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
|
-
import { a as
|
|
7
|
+
import { a as z } from "./input-surface-xyERuLU_.js";
|
|
8
8
|
import { D as p } from "./dropdown-menu-DU-Hrf33.js";
|
|
9
9
|
import { C as T } from "./circle-alert-rGDZ73Wh.js";
|
|
10
10
|
import { L as le } from "./loader-circle-BECIU_8N.js";
|
|
@@ -114,9 +114,9 @@ const ue = {
|
|
|
114
114
|
{
|
|
115
115
|
variants: {
|
|
116
116
|
size: {
|
|
117
|
-
sm: `${
|
|
118
|
-
md: `${
|
|
119
|
-
lg: `${
|
|
117
|
+
sm: `${z.sm} ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,
|
|
118
|
+
md: `${z.md} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,
|
|
119
|
+
lg: `${z.lg} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-md)]`
|
|
120
120
|
},
|
|
121
121
|
interactive: {
|
|
122
122
|
true: [
|
|
@@ -271,14 +271,14 @@ function A({
|
|
|
271
271
|
] }) : null
|
|
272
272
|
] });
|
|
273
273
|
}
|
|
274
|
-
const ve = I(function({ value: a, option: t, size: n = "md", workflowLabel: l, id: c, className: o, dir:
|
|
275
|
-
const { t:
|
|
274
|
+
const ve = I(function({ value: a, option: t, size: n = "md", workflowLabel: l, id: c, className: o, dir: k }, b) {
|
|
275
|
+
const { t: x } = L(), y = l ?? x("workflowStatus.label", "Workflow");
|
|
276
276
|
return /* @__PURE__ */ s(
|
|
277
277
|
"div",
|
|
278
278
|
{
|
|
279
|
-
ref:
|
|
279
|
+
ref: b,
|
|
280
280
|
id: c,
|
|
281
|
-
dir:
|
|
281
|
+
dir: k,
|
|
282
282
|
"data-component": "workflow-status",
|
|
283
283
|
"data-component-id": c,
|
|
284
284
|
"data-state": a,
|
|
@@ -288,7 +288,7 @@ const ve = I(function({ value: a, option: t, size: n = "md", workflowLabel: l, i
|
|
|
288
288
|
A,
|
|
289
289
|
{
|
|
290
290
|
option: t,
|
|
291
|
-
workflowLabel:
|
|
291
|
+
workflowLabel: y,
|
|
292
292
|
size: n,
|
|
293
293
|
interactive: !1,
|
|
294
294
|
error: !1
|
|
@@ -305,64 +305,64 @@ const we = I(function({
|
|
|
305
305
|
size: l = "md",
|
|
306
306
|
disabled: c = !1,
|
|
307
307
|
saving: o = !1,
|
|
308
|
-
error:
|
|
309
|
-
errorMessage:
|
|
310
|
-
workflowLabel:
|
|
311
|
-
menuLabel:
|
|
308
|
+
error: k = !1,
|
|
309
|
+
errorMessage: b,
|
|
310
|
+
workflowLabel: x,
|
|
311
|
+
menuLabel: y,
|
|
312
312
|
savingLabel: D,
|
|
313
313
|
open: E,
|
|
314
314
|
defaultOpen: K = !1,
|
|
315
315
|
onOpenChange: $,
|
|
316
316
|
id: u,
|
|
317
317
|
className: H,
|
|
318
|
-
dir:
|
|
318
|
+
dir: W,
|
|
319
319
|
"aria-label": M,
|
|
320
320
|
"aria-describedby": q
|
|
321
321
|
}, F) {
|
|
322
|
-
const { t: m } = L(), G = re(),
|
|
323
|
-
if (!
|
|
322
|
+
const { t: m } = L(), G = re(), S = ae(null), C = t.find((e) => e.value === a);
|
|
323
|
+
if (!C)
|
|
324
324
|
throw new Error(
|
|
325
325
|
`WorkflowStatusControl requires an option matching value "${a}".`
|
|
326
326
|
);
|
|
327
|
-
const P =
|
|
327
|
+
const P = x ?? m("workflowStatus.label", "Workflow"), U = y ?? m("workflowStatus.menuLabel", "Workflow statuses"), J = D ?? m("workflowStatus.saving", "Saving workflow status"), Q = b ?? m(
|
|
328
328
|
"workflowStatus.saveFailed",
|
|
329
329
|
"Could not change workflow status. The previous status is still shown."
|
|
330
330
|
), X = M ?? m("workflowStatus.changeLabel", "Change workflow status: {{status}}", {
|
|
331
|
-
status:
|
|
332
|
-
}), g =
|
|
331
|
+
status: C.label
|
|
332
|
+
}), g = k || !!b, d = c || o, _ = u ? `${u}-error` : G, Y = [q, g ? _ : void 0].filter(Boolean).join(" ") || void 0, j = o ? "saving" : c ? "disabled" : g ? "error" : "idle", [Z, v] = ie({
|
|
333
333
|
value: E,
|
|
334
334
|
defaultValue: K,
|
|
335
335
|
onChange: $
|
|
336
|
-
}),
|
|
336
|
+
}), h = !!Z && !d, N = te(
|
|
337
337
|
(e) => {
|
|
338
338
|
if (d || e === a) return;
|
|
339
|
-
const
|
|
340
|
-
if (!(!
|
|
339
|
+
const w = t.find((ee) => ee.value === e);
|
|
340
|
+
if (!(!w || w.disabled))
|
|
341
341
|
return n(e);
|
|
342
342
|
},
|
|
343
343
|
[d, n, t, a]
|
|
344
|
-
),
|
|
344
|
+
), V = oe(
|
|
345
345
|
() => ({
|
|
346
346
|
getValue: () => a,
|
|
347
|
-
getIsOpen: () =>
|
|
347
|
+
getIsOpen: () => h,
|
|
348
348
|
getIsSaving: () => o,
|
|
349
|
-
setValue:
|
|
349
|
+
setValue: N,
|
|
350
350
|
open: () => {
|
|
351
|
-
d ||
|
|
351
|
+
d || v(!0);
|
|
352
352
|
},
|
|
353
|
-
close: () =>
|
|
353
|
+
close: () => v(!1),
|
|
354
354
|
focus: () => {
|
|
355
355
|
var e;
|
|
356
|
-
return (e =
|
|
356
|
+
return (e = S.current) == null ? void 0 : e.focus();
|
|
357
357
|
}
|
|
358
358
|
}),
|
|
359
|
-
[
|
|
359
|
+
[N, d, h, o, v, a]
|
|
360
360
|
);
|
|
361
|
-
return ne(F, () =>
|
|
361
|
+
return ne(F, () => V, [V]), de(ue, V, u), /* @__PURE__ */ i(
|
|
362
362
|
"div",
|
|
363
363
|
{
|
|
364
364
|
id: u,
|
|
365
|
-
dir:
|
|
365
|
+
dir: W,
|
|
366
366
|
"data-component": "workflow-status",
|
|
367
367
|
"data-component-id": u,
|
|
368
368
|
"data-state": a,
|
|
@@ -374,36 +374,36 @@ const we = I(function({
|
|
|
374
374
|
/* @__PURE__ */ i(
|
|
375
375
|
p.Root,
|
|
376
376
|
{
|
|
377
|
-
dir:
|
|
378
|
-
open:
|
|
377
|
+
dir: W,
|
|
378
|
+
open: h,
|
|
379
379
|
onOpenChange: (e) => {
|
|
380
|
-
e && d ||
|
|
380
|
+
e && d || v(e);
|
|
381
381
|
},
|
|
382
382
|
children: [
|
|
383
383
|
/* @__PURE__ */ s(p.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
384
384
|
"button",
|
|
385
385
|
{
|
|
386
|
-
ref:
|
|
386
|
+
ref: S,
|
|
387
387
|
id: u ? `${u}-trigger` : void 0,
|
|
388
388
|
type: "button",
|
|
389
389
|
disabled: d,
|
|
390
390
|
"aria-label": X,
|
|
391
391
|
"aria-describedby": Y,
|
|
392
392
|
"aria-busy": o,
|
|
393
|
-
"data-open":
|
|
393
|
+
"data-open": h ? "" : void 0,
|
|
394
394
|
className: R({
|
|
395
395
|
size: l,
|
|
396
396
|
interactive: !0,
|
|
397
|
-
operation:
|
|
397
|
+
operation: j
|
|
398
398
|
}),
|
|
399
399
|
children: /* @__PURE__ */ s(
|
|
400
400
|
A,
|
|
401
401
|
{
|
|
402
|
-
option:
|
|
402
|
+
option: C,
|
|
403
403
|
workflowLabel: P,
|
|
404
404
|
size: l,
|
|
405
405
|
interactive: !0,
|
|
406
|
-
operation:
|
|
406
|
+
operation: j,
|
|
407
407
|
error: g
|
|
408
408
|
}
|
|
409
409
|
)
|
|
@@ -416,7 +416,8 @@ const we = I(function({
|
|
|
416
416
|
{
|
|
417
417
|
value: a,
|
|
418
418
|
onValueChange: (e) => {
|
|
419
|
-
|
|
419
|
+
var w;
|
|
420
|
+
v(!1), (w = S.current) == null || w.focus(), N(e);
|
|
420
421
|
},
|
|
421
422
|
children: t.map((e) => /* @__PURE__ */ s(
|
|
422
423
|
p.RadioItem,
|
|
@@ -459,7 +460,7 @@ const we = I(function({
|
|
|
459
460
|
children: o ? J : ""
|
|
460
461
|
}
|
|
461
462
|
),
|
|
462
|
-
g ? /* @__PURE__ */ i("div", { id:
|
|
463
|
+
g ? /* @__PURE__ */ i("div", { id: _, role: "alert", className: ge(), children: [
|
|
463
464
|
/* @__PURE__ */ s(T, { "aria-hidden": "true" }),
|
|
464
465
|
/* @__PURE__ */ s("span", { children: Q })
|
|
465
466
|
] }) : null
|
|
@@ -473,4 +474,4 @@ export {
|
|
|
473
474
|
ve as a,
|
|
474
475
|
ue as w
|
|
475
476
|
};
|
|
476
|
-
//# sourceMappingURL=workflow-status-
|
|
477
|
+
//# sourceMappingURL=workflow-status-CuJAOuKL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-status-xeaJTzD3.js","sources":["../../src/components/workflow-status/workflow-status.agent.ts","../../src/components/workflow-status/workflow-status.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { WorkflowStatusControlHandle } from './workflow-status';\n\nexport const workflowStatusAgent: AgentAdapter<WorkflowStatusControlHandle> = {\n id: 'workflow-status',\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.workflowStatus.state.value',\n description: 'The current non-sensitive workflow status key.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.workflowStatus.state.isOpen',\n description: 'Whether the permitted workflow status list is open.',\n read: (handle) => handle.getIsOpen(),\n },\n isSaving: {\n type: 'boolean',\n descriptionKey: 'ui.agent.workflowStatus.state.isSaving',\n description: 'Whether the host is saving a workflow status change.',\n read: (handle) => handle.getIsSaving(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'Permitted workflow status key to select.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n openWorld: false,\n errors: [\n 'The status is not in the host-provided transition list.',\n 'The status is disabled.',\n 'A status change is already being saved.',\n ],\n examples: [{ args: { value: 'review' } }],\n descriptionKey: 'ui.agent.workflowStatus.actions.setValue',\n description:\n 'Request a permitted workflow status through the host-owned change callback.',\n invoke: (handle, args: { value: string }) => handle.setValue(args.value),\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.workflowStatus.actions.open',\n description: 'Open the permitted workflow status list.',\n invoke: (handle) => handle.open(),\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.workflowStatus.actions.close',\n description: 'Close the workflow status list.',\n invoke: (handle) => handle.close(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'workflow-status',\n description: 'Marks the WorkflowStatus boundary.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description: 'Non-sensitive workflow status key for a permitted option.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { AlertCircle, ChevronDown, LoaderCircle } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { INPUT_SURFACE_HEIGHT } from '../_shared/input-surface';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { workflowStatusAgent } from './workflow-status.agent';\n\nexport type WorkflowStatusTone =\n | 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'error'\n | 'accent';\n\nexport type WorkflowStatusSize = 'sm' | 'md' | 'lg';\n\nexport interface WorkflowStatusOption {\n value: string;\n label: string;\n icon: ReactNode;\n tone: WorkflowStatusTone;\n disabled?: boolean;\n}\n\nconst rootVariants = cva(\n 'ds:inline-flex ds:max-w-full ds:flex-col ds:items-start ds:gap-[var(--spacing-2xs)]',\n {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst surfaceVariants = cva(\n [\n 'ds:group/workflow-status ds:inline-grid ds:max-w-full ds:w-fit ds:items-center',\n 'ds:overflow-hidden ds:text-start',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-transparent ds:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[ButtonBorder]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,\n md: `${INPUT_SURFACE_HEIGHT.md} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-md)]`,\n },\n interactive: {\n true: [\n 'ds:grid-cols-[auto_minmax(0,1fr)_auto] ds:appearance-none ds:cursor-pointer',\n 'ds:hover:enabled:bg-muted/10 ds:active:enabled:bg-muted/20',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:data-[open]:bg-muted/20 ds:data-[open]:border-[color:var(--primary)]',\n 'ds:forced-colors:data-[open]:border-[Highlight]',\n ].join(' '),\n false: 'ds:grid-cols-[auto_minmax(0,1fr)] ds:cursor-default',\n },\n operation: {\n idle: '',\n disabled: 'ds:cursor-not-allowed ds:opacity-50',\n saving: 'ds:cursor-wait ds:border-[color:var(--info-foreground)]',\n error: 'ds:border-[color:var(--error-foreground)]',\n },\n },\n defaultVariants: {\n size: 'md',\n interactive: false,\n operation: 'idle',\n },\n },\n);\n\nconst iconVariants = cva(\n [\n 'ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)] ds:border ds:[&>svg]:block',\n 'ds:forced-colors:bg-transparent ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n tone: {\n neutral:\n 'ds:bg-muted ds:text-muted-foreground ds:border-[color:var(--border)]',\n info: 'ds:bg-info/15 ds:text-[color:var(--info-foreground)] ds:border-[color:var(--info-foreground)]',\n success:\n 'ds:bg-success/15 ds:text-[color:var(--success-foreground)] ds:border-[color:var(--success-foreground)]',\n warning:\n 'ds:bg-warning/15 ds:text-[color:var(--warning-foreground)] ds:border-[color:var(--warning-foreground)]',\n error:\n 'ds:bg-destructive/15 ds:text-[color:var(--error-foreground)] ds:border-[color:var(--error-foreground)]',\n accent:\n 'ds:bg-[color:color-mix(in_srgb,var(--accent)_15%,transparent)] ds:text-[color:color-mix(in_srgb,var(--accent)_40%,var(--foreground))] ds:border-[color:color-mix(in_srgb,var(--accent)_40%,var(--foreground))]',\n },\n /* The ball is a SETTING for the glyph, not a container it fills: at\n the old 24px/16px the icon took two thirds of the circle and the two\n read as one crowded blob. Each step is smaller overall and gives the\n glyph roughly half its diameter, so the ring stays legible as a ring\n and the status colour has room to register. */\n size: {\n sm: 'ds:size-5 ds:[&>svg]:size-3',\n md: 'ds:size-[var(--spacing-lg)] ds:[&>svg]:size-3.5',\n lg: 'ds:size-7 ds:[&>svg]:size-[var(--icon-size-sm)]',\n menu: 'ds:size-5 ds:[&>svg]:size-3',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'md' },\n },\n);\n\nconst labelGroupVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:justify-center ds:text-start',\n {\n variants: {\n size: {\n sm: 'ds:gap-0',\n md: 'ds:gap-0',\n lg: 'ds:gap-0',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst valueVariants = cva(\n 'ds:block ds:min-w-0 ds:truncate ds:font-[var(--font-weight-semibold)] ds:text-[color:var(--foreground)]',\n {\n variants: {\n size: {\n sm: 'type-body-sm',\n md: 'type-label',\n lg: 'type-body',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst trailingVariants = cva(\n [\n 'ds:inline-flex ds:self-stretch ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-2xs)] ds:border-s ds:border-border',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:forced-colors:border-[ButtonBorder]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-[var(--spacing-xs)]',\n md: 'ds:ps-[var(--spacing-sm)]',\n lg: 'ds:ps-[var(--spacing-md)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst errorVariants = cva(\n [\n 'ds:flex ds:max-w-full ds:items-start ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:text-[color:var(--error-foreground)]',\n 'ds:[&>svg]:mt-[var(--spacing-2xs)] ds:[&>svg]:size-[var(--spacing-md)] ds:[&>svg]:shrink-0',\n 'ds:forced-colors:text-[CanvasText]',\n ].join(' '),\n);\n\ninterface WorkflowStatusSurfaceProps extends Pick<\n VariantProps<typeof surfaceVariants>,\n 'size'\n> {\n option: WorkflowStatusOption;\n workflowLabel: string;\n interactive: boolean;\n operation?: 'idle' | 'disabled' | 'saving' | 'error';\n error: boolean;\n}\n\nfunction WorkflowStatusSurface({\n option,\n workflowLabel,\n size = 'md',\n interactive,\n operation = 'idle',\n error,\n}: WorkflowStatusSurfaceProps) {\n return (\n <>\n <span\n aria-hidden=\"true\"\n data-workflow-status-icon=\"\"\n data-tone={option.tone}\n className={iconVariants({ tone: option.tone, size })}\n >\n {option.icon}\n </span>\n <span className={labelGroupVariants({ size })}>\n {size !== 'sm' ? (\n <span className=\"type-meta ds:font-[var(--font-weight-medium)] ds:text-[color:var(--muted-foreground)]\">\n {workflowLabel}\n </span>\n ) : null}\n <span\n data-workflow-status-value=\"\"\n title={option.label}\n className={valueVariants({ size })}\n >\n {option.label}\n </span>\n </span>\n {interactive ? (\n <span className={trailingVariants({ size })} aria-hidden=\"true\">\n {error ? (\n <AlertCircle\n data-testid=\"workflow-status-error-icon\"\n className=\"ds:size-[var(--spacing-md)] ds:shrink-0\"\n />\n ) : null}\n {operation === 'saving' ? (\n <LoaderCircle className=\"ds:size-[var(--spacing-md)] ds:shrink-0 ds:animate-spin ds:motion-reduce:animate-none\" />\n ) : (\n <ChevronDown\n data-testid=\"workflow-status-chevron\"\n className=\"ds:size-[var(--spacing-md)] ds:shrink-0 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-data-[open]/workflow-status:rotate-180\"\n />\n )}\n </span>\n ) : null}\n </>\n );\n}\n\nexport interface WorkflowStatusDisplayProps {\n value: string;\n option: WorkflowStatusOption;\n size?: WorkflowStatusSize;\n workflowLabel?: string;\n id?: string;\n className?: string;\n dir?: 'ltr' | 'rtl';\n}\n\nexport const WorkflowStatusDisplay = forwardRef<\n HTMLDivElement,\n WorkflowStatusDisplayProps\n>(function WorkflowStatusDisplay(\n { value, option, size = 'md', workflowLabel, id, className, dir },\n ref,\n) {\n const { t } = useTranslation();\n const resolvedWorkflowLabel =\n workflowLabel ?? t('workflowStatus.label', 'Workflow');\n\n return (\n <div\n ref={ref}\n id={id}\n dir={dir}\n data-component=\"workflow-status\"\n data-component-id={id}\n data-state={value}\n data-variant=\"display\"\n className={rootVariants({ size, className })}\n >\n <div className={surfaceVariants({ size, interactive: false })}>\n <WorkflowStatusSurface\n option={option}\n workflowLabel={resolvedWorkflowLabel}\n size={size}\n interactive={false}\n error={false}\n />\n </div>\n </div>\n );\n});\n\nWorkflowStatusDisplay.displayName = 'WorkflowStatusDisplay';\n\nexport interface WorkflowStatusControlHandle {\n getValue: () => string;\n getIsOpen: () => boolean;\n getIsSaving: () => boolean;\n setValue: (value: string) => void | Promise<void>;\n open: () => void;\n close: () => void;\n focus: () => void;\n}\n\nexport interface WorkflowStatusControlProps {\n value: string;\n options: readonly WorkflowStatusOption[];\n onValueChange: (value: string) => void | Promise<void>;\n size?: WorkflowStatusSize;\n disabled?: boolean;\n saving?: boolean;\n error?: boolean;\n errorMessage?: string;\n workflowLabel?: string;\n menuLabel?: string;\n savingLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n id?: string;\n className?: string;\n dir?: 'ltr' | 'rtl';\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\nexport const WorkflowStatusControl = forwardRef<\n WorkflowStatusControlHandle,\n WorkflowStatusControlProps\n>(function WorkflowStatusControl(\n {\n value,\n options,\n onValueChange,\n size = 'md',\n disabled = false,\n saving = false,\n error = false,\n errorMessage,\n workflowLabel,\n menuLabel,\n savingLabel,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n id,\n className,\n dir,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n },\n ref,\n) {\n const { t } = useTranslation();\n const generatedErrorId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const currentOption = options.find((option) => option.value === value);\n\n if (!currentOption) {\n throw new Error(\n `WorkflowStatusControl requires an option matching value \"${value}\".`,\n );\n }\n\n const resolvedWorkflowLabel =\n workflowLabel ?? t('workflowStatus.label', 'Workflow');\n const resolvedMenuLabel =\n menuLabel ?? t('workflowStatus.menuLabel', 'Workflow statuses');\n const resolvedSavingLabel =\n savingLabel ?? t('workflowStatus.saving', 'Saving workflow status');\n const resolvedErrorMessage =\n errorMessage ??\n t(\n 'workflowStatus.saveFailed',\n 'Could not change workflow status. The previous status is still shown.',\n );\n const resolvedAriaLabel =\n ariaLabel ??\n t('workflowStatus.changeLabel', 'Change workflow status: {{status}}', {\n status: currentOption.label,\n });\n const hasError = error || Boolean(errorMessage);\n const inactive = disabled || saving;\n const errorId = id ? `${id}-error` : generatedErrorId;\n const describedBy =\n [ariaDescribedBy, hasError ? errorId : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n const operation = saving\n ? 'saving'\n : disabled\n ? 'disabled'\n : hasError\n ? 'error'\n : 'idle';\n const [openValue, setOpen] = useControllableState<boolean>({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n const isOpen = Boolean(openValue) && !inactive;\n\n const changeValue = useCallback(\n (next: string): void | Promise<void> => {\n if (inactive || next === value) return;\n const nextOption = options.find((option) => option.value === next);\n if (!nextOption || nextOption.disabled) return;\n return onValueChange(next);\n },\n [inactive, onValueChange, options, value],\n );\n\n const handle = useMemo<WorkflowStatusControlHandle>(\n () => ({\n getValue: () => value,\n getIsOpen: () => isOpen,\n getIsSaving: () => saving,\n setValue: changeValue,\n open: () => {\n if (!inactive) setOpen(true);\n },\n close: () => setOpen(false),\n focus: () => triggerRef.current?.focus(),\n }),\n [changeValue, inactive, isOpen, saving, setOpen, value],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(workflowStatusAgent, handle, id);\n\n return (\n <div\n id={id}\n dir={dir}\n data-component=\"workflow-status\"\n data-component-id={id}\n data-state={value}\n data-variant=\"control\"\n data-saving={saving ? '' : undefined}\n data-error={hasError ? '' : undefined}\n className={rootVariants({ size, className })}\n >\n <DropdownMenu.Root\n dir={dir}\n open={isOpen}\n onOpenChange={(next) => {\n if (next && inactive) return;\n setOpen(next);\n }}\n >\n <DropdownMenu.Trigger asChild>\n <button\n ref={triggerRef}\n id={id ? `${id}-trigger` : undefined}\n type=\"button\"\n disabled={inactive}\n aria-label={resolvedAriaLabel}\n aria-describedby={describedBy}\n aria-busy={saving}\n data-open={isOpen ? '' : undefined}\n className={surfaceVariants({\n size,\n interactive: true,\n operation,\n })}\n >\n <WorkflowStatusSurface\n option={currentOption}\n workflowLabel={resolvedWorkflowLabel}\n size={size}\n interactive\n operation={operation}\n error={hasError}\n />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"start\">\n <DropdownMenu.Label>{resolvedMenuLabel}</DropdownMenu.Label>\n <DropdownMenu.RadioGroup\n value={value}\n onValueChange={(next) => {\n void changeValue(next);\n }}\n >\n {options.map((option) => (\n <DropdownMenu.RadioItem\n key={option.value}\n value={option.value}\n disabled={inactive || option.disabled}\n data-option-id={option.value}\n >\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n aria-hidden=\"true\"\n data-workflow-status-icon=\"\"\n data-tone={option.tone}\n className={iconVariants({\n tone: option.tone,\n size: 'menu',\n })}\n >\n {option.icon}\n </span>\n <span className=\"ds:min-w-0 ds:truncate\" title={option.label}>\n {option.label}\n </span>\n </span>\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n <span\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n >\n {saving ? resolvedSavingLabel : ''}\n </span>\n {hasError ? (\n <div id={errorId} role=\"alert\" className={errorVariants()}>\n <AlertCircle aria-hidden=\"true\" />\n <span>{resolvedErrorMessage}</span>\n </div>\n ) : null}\n </div>\n );\n});\n\nWorkflowStatusControl.displayName = 'WorkflowStatusControl';\n"],"names":["workflowStatusAgent","handle","args","rootVariants","cva","surfaceVariants","INPUT_SURFACE_HEIGHT","iconVariants","labelGroupVariants","valueVariants","trailingVariants","errorVariants","WorkflowStatusSurface","option","workflowLabel","size","interactive","operation","error","jsxs","Fragment","jsx","AlertCircle","LoaderCircle","ChevronDown","WorkflowStatusDisplay","forwardRef","value","id","className","dir","ref","t","useTranslation","resolvedWorkflowLabel","WorkflowStatusControl","options","onValueChange","disabled","saving","errorMessage","menuLabel","savingLabel","openProp","defaultOpen","onOpenChange","ariaLabel","ariaDescribedBy","generatedErrorId","useId","triggerRef","useRef","currentOption","resolvedMenuLabel","resolvedSavingLabel","resolvedErrorMessage","resolvedAriaLabel","hasError","inactive","errorId","describedBy","openValue","setOpen","useControllableState","isOpen","changeValue","useCallback","next","nextOption","useMemo","_a","useImperativeHandle","useAgentRegistration","DropdownMenu"],"mappings":";;;;;;;;;;;AAGO,MAAMA,KAAiE;AAAA,EAC5E,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,EACvC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,M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AAU6C,KAAY7C,EAAO;AAAA,wBAC7B,kBAAgBA,EAAO;AAAA,wBAEvB,UAAA,gBAAAM,EAAC,QAAA,EAAK,WAAU,iEACd,UAAA;AAAA,0BAAA,gBAAAE;AAAA,4BAAC;AAAA,4BAAA;AAAA,8BACC,eAAY;AAAA,8BACZ,6BAA0B;AAAA,8BAC1B,aAAWR,EAAO;AAAA,8BAClB,WAAWN,EAAa;AAAA,gCACtB,MAAMM,EAAO;AAAA,gCACb,MAAM;AAAA,8BAAA,CACP;AAAA,8BAEA,UAAAA,EAAO;AAAA,4BAAA;AAAA,0BAAA;AAAA,0BAEV,gBAAAQ,EAAC,UAAK,WAAU,0BAAyB,OAAOR,EAAO,OACpD,YAAO,MAAA,CACV;AAAA,wBAAA,EAAA,CACF;AAAA,sBAAA;AAAA,sBApBKA,EAAO;AAAA,oBAAA,CAsBf;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH,EAAA,CACF;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEF,gBAAAQ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,aAAU;AAAA,YACV,eAAY;AAAA,YACZ,WAAU;AAAA,YAET,cAASiC,IAAsB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEjCG,sBACE,OAAA,EAAI,IAAIE,GAAS,MAAK,SAAQ,WAAWhD,GAAA,GACxC,UAAA;AAAA,UAAA,gBAAAU,EAACC,GAAA,EAAY,eAAY,OAAA,CAAO;AAAA,UAChC,gBAAAD,EAAC,UAAM,UAAAkC,EAAA,CAAqB;AAAA,QAAA,EAAA,CAC9B,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AAEDpB,GAAsB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"workflow-status-CuJAOuKL.js","sources":["../../src/components/workflow-status/workflow-status.agent.ts","../../src/components/workflow-status/workflow-status.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { WorkflowStatusControlHandle } from './workflow-status';\n\nexport const workflowStatusAgent: AgentAdapter<WorkflowStatusControlHandle> = {\n id: 'workflow-status',\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.workflowStatus.state.value',\n description: 'The current non-sensitive workflow status key.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.workflowStatus.state.isOpen',\n description: 'Whether the permitted workflow status list is open.',\n read: (handle) => handle.getIsOpen(),\n },\n isSaving: {\n type: 'boolean',\n descriptionKey: 'ui.agent.workflowStatus.state.isSaving',\n description: 'Whether the host is saving a workflow status change.',\n read: (handle) => handle.getIsSaving(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description: 'Permitted workflow status key to select.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n openWorld: false,\n errors: [\n 'The status is not in the host-provided transition list.',\n 'The status is disabled.',\n 'A status change is already being saved.',\n ],\n examples: [{ args: { value: 'review' } }],\n descriptionKey: 'ui.agent.workflowStatus.actions.setValue',\n description:\n 'Request a permitted workflow status through the host-owned change callback.',\n invoke: (handle, args: { value: string }) => handle.setValue(args.value),\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.workflowStatus.actions.open',\n description: 'Open the permitted workflow status list.',\n invoke: (handle) => handle.open(),\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.workflowStatus.actions.close',\n description: 'Close the workflow status list.',\n invoke: (handle) => handle.close(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'workflow-status',\n description: 'Marks the WorkflowStatus boundary.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description: 'Non-sensitive workflow status key for a permitted option.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { AlertCircle, ChevronDown, LoaderCircle } from 'lucide-react';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { INPUT_SURFACE_HEIGHT } from '../_shared/input-surface';\nimport { DropdownMenu } from '../dropdown-menu';\nimport { workflowStatusAgent } from './workflow-status.agent';\n\nexport type WorkflowStatusTone =\n | 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'error'\n | 'accent';\n\nexport type WorkflowStatusSize = 'sm' | 'md' | 'lg';\n\nexport interface WorkflowStatusOption {\n value: string;\n label: string;\n icon: ReactNode;\n tone: WorkflowStatusTone;\n disabled?: boolean;\n}\n\nconst rootVariants = cva(\n 'ds:inline-flex ds:max-w-full ds:flex-col ds:items-start ds:gap-[var(--spacing-2xs)]',\n {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst surfaceVariants = cva(\n [\n 'ds:group/workflow-status ds:inline-grid ds:max-w-full ds:w-fit ds:items-center',\n 'ds:overflow-hidden ds:text-start',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:bg-transparent ds:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)]',\n 'ds:motion-reduce:transition-none',\n 'ds:forced-colors:border-[ButtonBorder]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,\n md: `${INPUT_SURFACE_HEIGHT.md} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-2xs)] ds:pe-[var(--spacing-sm)]`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-md)]`,\n },\n interactive: {\n true: [\n 'ds:grid-cols-[auto_minmax(0,1fr)_auto] ds:appearance-none ds:cursor-pointer',\n 'ds:hover:enabled:bg-muted/10 ds:active:enabled:bg-muted/20',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:data-[open]:bg-muted/20 ds:data-[open]:border-[color:var(--primary)]',\n 'ds:forced-colors:data-[open]:border-[Highlight]',\n ].join(' '),\n false: 'ds:grid-cols-[auto_minmax(0,1fr)] ds:cursor-default',\n },\n operation: {\n idle: '',\n disabled: 'ds:cursor-not-allowed ds:opacity-50',\n saving: 'ds:cursor-wait ds:border-[color:var(--info-foreground)]',\n error: 'ds:border-[color:var(--error-foreground)]',\n },\n },\n defaultVariants: {\n size: 'md',\n interactive: false,\n operation: 'idle',\n },\n },\n);\n\nconst iconVariants = cva(\n [\n 'ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)] ds:border ds:[&>svg]:block',\n 'ds:forced-colors:bg-transparent ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n tone: {\n neutral:\n 'ds:bg-muted ds:text-muted-foreground ds:border-[color:var(--border)]',\n info: 'ds:bg-info/15 ds:text-[color:var(--info-foreground)] ds:border-[color:var(--info-foreground)]',\n success:\n 'ds:bg-success/15 ds:text-[color:var(--success-foreground)] ds:border-[color:var(--success-foreground)]',\n warning:\n 'ds:bg-warning/15 ds:text-[color:var(--warning-foreground)] ds:border-[color:var(--warning-foreground)]',\n error:\n 'ds:bg-destructive/15 ds:text-[color:var(--error-foreground)] ds:border-[color:var(--error-foreground)]',\n accent:\n 'ds:bg-[color:color-mix(in_srgb,var(--accent)_15%,transparent)] ds:text-[color:color-mix(in_srgb,var(--accent)_40%,var(--foreground))] ds:border-[color:color-mix(in_srgb,var(--accent)_40%,var(--foreground))]',\n },\n /* The ball is a SETTING for the glyph, not a container it fills: at\n the old 24px/16px the icon took two thirds of the circle and the two\n read as one crowded blob. Each step is smaller overall and gives the\n glyph roughly half its diameter, so the ring stays legible as a ring\n and the status colour has room to register. */\n size: {\n sm: 'ds:size-5 ds:[&>svg]:size-3',\n md: 'ds:size-[var(--spacing-lg)] ds:[&>svg]:size-3.5',\n lg: 'ds:size-7 ds:[&>svg]:size-[var(--icon-size-sm)]',\n menu: 'ds:size-5 ds:[&>svg]:size-3',\n },\n },\n defaultVariants: { tone: 'neutral', size: 'md' },\n },\n);\n\nconst labelGroupVariants = cva(\n 'ds:flex ds:min-w-0 ds:flex-col ds:justify-center ds:text-start',\n {\n variants: {\n size: {\n sm: 'ds:gap-0',\n md: 'ds:gap-0',\n lg: 'ds:gap-0',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst valueVariants = cva(\n 'ds:block ds:min-w-0 ds:truncate ds:font-[var(--font-weight-semibold)] ds:text-[color:var(--foreground)]',\n {\n variants: {\n size: {\n sm: 'type-body-sm',\n md: 'type-label',\n lg: 'type-body',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst trailingVariants = cva(\n [\n 'ds:inline-flex ds:self-stretch ds:items-center ds:justify-center',\n 'ds:gap-[var(--spacing-2xs)] ds:border-s ds:border-border',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:forced-colors:border-[ButtonBorder]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-[var(--spacing-xs)]',\n md: 'ds:ps-[var(--spacing-sm)]',\n lg: 'ds:ps-[var(--spacing-md)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst errorVariants = cva(\n [\n 'ds:flex ds:max-w-full ds:items-start ds:gap-[var(--spacing-xs)]',\n 'type-meta ds:text-[color:var(--error-foreground)]',\n 'ds:[&>svg]:mt-[var(--spacing-2xs)] ds:[&>svg]:size-[var(--spacing-md)] ds:[&>svg]:shrink-0',\n 'ds:forced-colors:text-[CanvasText]',\n ].join(' '),\n);\n\ninterface WorkflowStatusSurfaceProps extends Pick<\n VariantProps<typeof surfaceVariants>,\n 'size'\n> {\n option: WorkflowStatusOption;\n workflowLabel: string;\n interactive: boolean;\n operation?: 'idle' | 'disabled' | 'saving' | 'error';\n error: boolean;\n}\n\nfunction WorkflowStatusSurface({\n option,\n workflowLabel,\n size = 'md',\n interactive,\n operation = 'idle',\n error,\n}: WorkflowStatusSurfaceProps) {\n return (\n <>\n <span\n aria-hidden=\"true\"\n data-workflow-status-icon=\"\"\n data-tone={option.tone}\n className={iconVariants({ tone: option.tone, size })}\n >\n {option.icon}\n </span>\n <span className={labelGroupVariants({ size })}>\n {size !== 'sm' ? (\n <span className=\"type-meta ds:font-[var(--font-weight-medium)] ds:text-[color:var(--muted-foreground)]\">\n {workflowLabel}\n </span>\n ) : null}\n <span\n data-workflow-status-value=\"\"\n title={option.label}\n className={valueVariants({ size })}\n >\n {option.label}\n </span>\n </span>\n {interactive ? (\n <span className={trailingVariants({ size })} aria-hidden=\"true\">\n {error ? (\n <AlertCircle\n data-testid=\"workflow-status-error-icon\"\n className=\"ds:size-[var(--spacing-md)] ds:shrink-0\"\n />\n ) : null}\n {operation === 'saving' ? (\n <LoaderCircle className=\"ds:size-[var(--spacing-md)] ds:shrink-0 ds:animate-spin ds:motion-reduce:animate-none\" />\n ) : (\n <ChevronDown\n data-testid=\"workflow-status-chevron\"\n className=\"ds:size-[var(--spacing-md)] ds:shrink-0 ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-data-[open]/workflow-status:rotate-180\"\n />\n )}\n </span>\n ) : null}\n </>\n );\n}\n\nexport interface WorkflowStatusDisplayProps {\n value: string;\n option: WorkflowStatusOption;\n size?: WorkflowStatusSize;\n workflowLabel?: string;\n id?: string;\n className?: string;\n dir?: 'ltr' | 'rtl';\n}\n\nexport const WorkflowStatusDisplay = forwardRef<\n HTMLDivElement,\n WorkflowStatusDisplayProps\n>(function WorkflowStatusDisplay(\n { value, option, size = 'md', workflowLabel, id, className, dir },\n ref,\n) {\n const { t } = useTranslation();\n const resolvedWorkflowLabel =\n workflowLabel ?? t('workflowStatus.label', 'Workflow');\n\n return (\n <div\n ref={ref}\n id={id}\n dir={dir}\n data-component=\"workflow-status\"\n data-component-id={id}\n data-state={value}\n data-variant=\"display\"\n className={rootVariants({ size, className })}\n >\n <div className={surfaceVariants({ size, interactive: false })}>\n <WorkflowStatusSurface\n option={option}\n workflowLabel={resolvedWorkflowLabel}\n size={size}\n interactive={false}\n error={false}\n />\n </div>\n </div>\n );\n});\n\nWorkflowStatusDisplay.displayName = 'WorkflowStatusDisplay';\n\nexport interface WorkflowStatusControlHandle {\n getValue: () => string;\n getIsOpen: () => boolean;\n getIsSaving: () => boolean;\n setValue: (value: string) => void | Promise<void>;\n open: () => void;\n close: () => void;\n focus: () => void;\n}\n\nexport interface WorkflowStatusControlProps {\n value: string;\n options: readonly WorkflowStatusOption[];\n onValueChange: (value: string) => void | Promise<void>;\n size?: WorkflowStatusSize;\n disabled?: boolean;\n saving?: boolean;\n error?: boolean;\n errorMessage?: string;\n workflowLabel?: string;\n menuLabel?: string;\n savingLabel?: string;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n id?: string;\n className?: string;\n dir?: 'ltr' | 'rtl';\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n}\n\nexport const WorkflowStatusControl = forwardRef<\n WorkflowStatusControlHandle,\n WorkflowStatusControlProps\n>(function WorkflowStatusControl(\n {\n value,\n options,\n onValueChange,\n size = 'md',\n disabled = false,\n saving = false,\n error = false,\n errorMessage,\n workflowLabel,\n menuLabel,\n savingLabel,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n id,\n className,\n dir,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedBy,\n },\n ref,\n) {\n const { t } = useTranslation();\n const generatedErrorId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const currentOption = options.find((option) => option.value === value);\n\n if (!currentOption) {\n throw new Error(\n `WorkflowStatusControl requires an option matching value \"${value}\".`,\n );\n }\n\n const resolvedWorkflowLabel =\n workflowLabel ?? t('workflowStatus.label', 'Workflow');\n const resolvedMenuLabel =\n menuLabel ?? t('workflowStatus.menuLabel', 'Workflow statuses');\n const resolvedSavingLabel =\n savingLabel ?? t('workflowStatus.saving', 'Saving workflow status');\n const resolvedErrorMessage =\n errorMessage ??\n t(\n 'workflowStatus.saveFailed',\n 'Could not change workflow status. The previous status is still shown.',\n );\n const resolvedAriaLabel =\n ariaLabel ??\n t('workflowStatus.changeLabel', 'Change workflow status: {{status}}', {\n status: currentOption.label,\n });\n const hasError = error || Boolean(errorMessage);\n const inactive = disabled || saving;\n const errorId = id ? `${id}-error` : generatedErrorId;\n const describedBy =\n [ariaDescribedBy, hasError ? errorId : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n const operation = saving\n ? 'saving'\n : disabled\n ? 'disabled'\n : hasError\n ? 'error'\n : 'idle';\n const [openValue, setOpen] = useControllableState<boolean>({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n const isOpen = Boolean(openValue) && !inactive;\n\n const changeValue = useCallback(\n (next: string): void | Promise<void> => {\n if (inactive || next === value) return;\n const nextOption = options.find((option) => option.value === next);\n if (!nextOption || nextOption.disabled) return;\n return onValueChange(next);\n },\n [inactive, onValueChange, options, value],\n );\n\n const handle = useMemo<WorkflowStatusControlHandle>(\n () => ({\n getValue: () => value,\n getIsOpen: () => isOpen,\n getIsSaving: () => saving,\n setValue: changeValue,\n open: () => {\n if (!inactive) setOpen(true);\n },\n close: () => setOpen(false),\n focus: () => triggerRef.current?.focus(),\n }),\n [changeValue, inactive, isOpen, saving, setOpen, value],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(workflowStatusAgent, handle, id);\n\n return (\n <div\n id={id}\n dir={dir}\n data-component=\"workflow-status\"\n data-component-id={id}\n data-state={value}\n data-variant=\"control\"\n data-saving={saving ? '' : undefined}\n data-error={hasError ? '' : undefined}\n className={rootVariants({ size, className })}\n >\n <DropdownMenu.Root\n dir={dir}\n open={isOpen}\n onOpenChange={(next) => {\n if (next && inactive) return;\n setOpen(next);\n }}\n >\n <DropdownMenu.Trigger asChild>\n <button\n ref={triggerRef}\n id={id ? `${id}-trigger` : undefined}\n type=\"button\"\n disabled={inactive}\n aria-label={resolvedAriaLabel}\n aria-describedby={describedBy}\n aria-busy={saving}\n data-open={isOpen ? '' : undefined}\n className={surfaceVariants({\n size,\n interactive: true,\n operation,\n })}\n >\n <WorkflowStatusSurface\n option={currentOption}\n workflowLabel={resolvedWorkflowLabel}\n size={size}\n interactive\n operation={operation}\n error={hasError}\n />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"start\">\n <DropdownMenu.Label>{resolvedMenuLabel}</DropdownMenu.Label>\n <DropdownMenu.RadioGroup\n value={value}\n onValueChange={(next) => {\n // Close explicitly. `isOpen` is derived (`openValue &&\n // !inactive`), so a caller flipping `saving` in this same\n // event already controls the Root to `open={false}`, and\n // Radix swallows its own `onOpenChange` when the value\n // matches. `openValue` would stay true and the menu would\n // spring back once `saving` cleared.\n setOpen(false);\n triggerRef.current?.focus();\n void changeValue(next);\n }}\n >\n {options.map((option) => (\n <DropdownMenu.RadioItem\n key={option.value}\n value={option.value}\n disabled={inactive || option.disabled}\n data-option-id={option.value}\n >\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n aria-hidden=\"true\"\n data-workflow-status-icon=\"\"\n data-tone={option.tone}\n className={iconVariants({\n tone: option.tone,\n size: 'menu',\n })}\n >\n {option.icon}\n </span>\n <span className=\"ds:min-w-0 ds:truncate\" title={option.label}>\n {option.label}\n </span>\n </span>\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n <span\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n >\n {saving ? resolvedSavingLabel : ''}\n </span>\n {hasError ? (\n <div id={errorId} role=\"alert\" className={errorVariants()}>\n <AlertCircle aria-hidden=\"true\" />\n <span>{resolvedErrorMessage}</span>\n </div>\n ) : null}\n </div>\n );\n});\n\nWorkflowStatusControl.displayName = 'WorkflowStatusControl';\n"],"names":["workflowStatusAgent","handle","args","rootVariants","cva","surfaceVariants","INPUT_SURFACE_HEIGHT","iconVariants","labelGroupVariants","valueVariants","trailingVariants","errorVariants","WorkflowStatusSurface","option","workflowLabel","size","interactive","operation","error","jsxs","Fragment","jsx","AlertCircle","LoaderCircle","ChevronDown","WorkflowStatusDisplay","forwardRef","value","id","className","dir","ref","t","useTranslation","resolvedWorkflowLabel","WorkflowStatusControl","options","onValueChange","disabled","saving","errorMessage","menuLabel","savingLabel","openProp","defaultOpen","onOpenChange","ariaLabel","ariaDescribedBy","generatedErrorId","useId","triggerRef","useRef","currentOption","resolvedMenuLabel","resolvedSavingLabel","resolvedErrorMessage","resolvedAriaLabel","hasError","inactive","errorId","describedBy","openValue","setOpen","useControllableState","isOpen","changeValue","useCallback","next","nextOption","useMemo","_a","useImperativeHandle","useAgentRegistration","DropdownMenu"],"mappings":";;;;;;;;;;;AAGO,MAAMA,KAAiE;AAAA,EAC5E,IAAI;AAAA,EACJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA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IAAsB;AAAA,UAAA;AAAA,QAAA;AAAA,QAEjCG,sBACE,OAAA,EAAI,IAAIE,GAAS,MAAK,SAAQ,WAAWhD,GAAA,GACxC,UAAA;AAAA,UAAA,gBAAAU,EAACC,GAAA,EAAY,eAAY,OAAA,CAAO;AAAA,UAChC,gBAAAD,EAAC,UAAM,UAAAkC,EAAA,CAAqB;AAAA,QAAA,EAAA,CAC9B,IACE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AAEDpB,GAAsB,cAAc;"}
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "1.
|
|
3
|
+
"packageVersion": "1.46.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -424,6 +424,20 @@
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
},
|
|
427
|
+
{
|
|
428
|
+
"kind": "component",
|
|
429
|
+
"id": "ai-credits-notice",
|
|
430
|
+
"capabilities": [],
|
|
431
|
+
"state": [],
|
|
432
|
+
"actions": [],
|
|
433
|
+
"domHooks": {
|
|
434
|
+
"root": {
|
|
435
|
+
"attr": "data-component",
|
|
436
|
+
"value": "ai-credits-notice",
|
|
437
|
+
"description": "Marks the element as a kit AiCreditsNotice card body. Carries a sibling `data-mode=\"included|bundles\"` attribute for which notice is showing."
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
427
441
|
{
|
|
428
442
|
"kind": "component",
|
|
429
443
|
"id": "ai-prompt-input",
|
|
@@ -16869,6 +16883,14 @@
|
|
|
16869
16883
|
"as": "bookingRow",
|
|
16870
16884
|
"entity": "appointment"
|
|
16871
16885
|
},
|
|
16886
|
+
{
|
|
16887
|
+
"component": "popover",
|
|
16888
|
+
"as": "backlogSettings"
|
|
16889
|
+
},
|
|
16890
|
+
{
|
|
16891
|
+
"component": "switch",
|
|
16892
|
+
"as": "backlogGapToggle"
|
|
16893
|
+
},
|
|
16872
16894
|
{
|
|
16873
16895
|
"component": "collapsible",
|
|
16874
16896
|
"as": "finderFilters"
|
|
@@ -17358,14 +17380,20 @@
|
|
|
17358
17380
|
{
|
|
17359
17381
|
"name": "triage_online_booking",
|
|
17360
17382
|
"safety": "phi",
|
|
17361
|
-
"description": "Review the online-bookings queue independently of the visible dates. The host owns membership and loading/error state. Show a row on the grid; completion is available only when the host enables it and the user can edit. Review-only rows remain in the queue on selection and cannot be dragged, resized or edited. Unknown last-seen data never marks a booking New. A host addresses one booking with the focusBookingId prop (bump focusBookingKey to repeat it): the tool docks, then the card carrying that data-booking-id takes focus and aria-current; an id outside the queue addresses nothing. An Assign patient or Assign operator segment opens the editor focused on that field.
|
|
17383
|
+
"description": "Review the online-bookings queue independently of the visible dates. The host owns membership and loading/error state. Show a row on the grid; completion is available only when the host enables it and the user can edit. Review-only rows remain in the queue on selection and cannot be dragged, resized or edited. Unknown last-seen data never marks a booking New. A host addresses one booking with the focusBookingId prop (bump focusBookingKey to repeat it): the tool docks, then the card carrying that data-booking-id takes focus and aria-current; an id outside the queue addresses nothing. An Assign patient or Assign operator segment opens the editor focused on that field. A settings cog in the panel header (data-backlog-settings) opens a popover holding three switches — without a patient, without an operator, without a chair, the chair one only where the practice has chairs — all on by default; a card stays listed while at least one of its own gaps is still switched on. Read the cog before reading the list: while any switch is off it carries data-narrowed and its accessible name says the list is filtered, so a short queue is not an empty backlog. Selection only; completing writes patient-identifiable data.",
|
|
17362
17384
|
"descriptionKey": "ui.agent.calendar.workflows.triageOnlineBooking",
|
|
17363
17385
|
"uiActions": [
|
|
17364
17386
|
"calendar.focus_event",
|
|
17365
|
-
"control-room-rail.open"
|
|
17387
|
+
"control-room-rail.open",
|
|
17388
|
+
"popover.open",
|
|
17389
|
+
"popover.close",
|
|
17390
|
+
"switch.set_checked",
|
|
17391
|
+
"switch.toggle"
|
|
17366
17392
|
],
|
|
17367
17393
|
"stateReads": [
|
|
17368
|
-
"control-room-rail.activeToolId"
|
|
17394
|
+
"control-room-rail.activeToolId",
|
|
17395
|
+
"popover.isOpen",
|
|
17396
|
+
"switch.checked"
|
|
17369
17397
|
],
|
|
17370
17398
|
"apiActions": [
|
|
17371
17399
|
"onlineBooking.list",
|
package/dist/agent-i18n/en.json
CHANGED
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"manageWaitingListEntry": "Add, amend or remove a waiting-list entry. The four-field form opens as a rail SUB-VIEW — from the toolbar split button's plus segment, from Add entry, or from a row's pencil — with a back arrow to the queue. Editing is refused on a row already linked to an appointment, because those fields belong to the appointment; the pencil stays focusable and names that reason. Remove deletes at once with no confirmation, platform parity, and its toast carries an Undo that puts the entry back. Writes patient-identifiable data.",
|
|
190
190
|
"scheduleWaitingPatient": "Give a waiting patient a slot. \"Schedule\" on an unlinked row hands off to the free-slot finder seeded from the entry — operator, chair, duration, patient, care and colour already filled in — and booking a slot opens the editor carrying the entry, so saving books the appointment and takes the entry off the list. A row already linked to an appointment reads \"Reschedule\" and seeds the same finder, but booking there MOVES the existing appointment rather than creating a second one. Writes patient-identifiable data.",
|
|
191
191
|
"findFreeSlot": "Search the practice for bookable time in the finder panel. Operator and chair scope are grouped checklists behind a popover per axis — a select-all row first, operators sectioned under their groups, nothing ticked searching every eligible resource — beside the care, the duration, the date range and, for a care that needs one, a medical-device select. The results list groups the slots under a day heading; when the viewer may write appointments, a click steers the grid to that day and docks the editor prefilled with the date, time, duration, chair, operator and any seeded patient or care; read-only viewers see the list and projection only, under a lock note, with no Book. The 185-day range warning is advisory (the search still runs), \"Show more slots\" pushes the To date out by 30 days and re-searches, and an alert names which business hours are missing when the practice or its operators hold none (it links to the scheduler only where the host supplies that navigation, which this workspace does not). Projected bands open a modal list of original options by click, Enter or Space; only an explicit Book action uses the finder booking path. Read-only viewers can scroll those options without Book. Dismissal restores focus to the band.",
|
|
192
|
-
"triageOnlineBooking": "Review the online-bookings queue independently of the visible dates. The host owns membership and loading/error state. Show a row on the grid; completion is available only when the host enables it and the user can edit. Review-only rows remain in the queue on selection and cannot be dragged, resized or edited. Unknown last-seen data never marks a booking New. A host addresses one booking with the focusBookingId prop (bump focusBookingKey to repeat it): the tool docks, then the card carrying that data-booking-id takes focus and aria-current; an id outside the queue addresses nothing. An Assign patient or Assign operator segment opens the editor focused on that field.
|
|
192
|
+
"triageOnlineBooking": "Review the online-bookings queue independently of the visible dates. The host owns membership and loading/error state. Show a row on the grid; completion is available only when the host enables it and the user can edit. Review-only rows remain in the queue on selection and cannot be dragged, resized or edited. Unknown last-seen data never marks a booking New. A host addresses one booking with the focusBookingId prop (bump focusBookingKey to repeat it): the tool docks, then the card carrying that data-booking-id takes focus and aria-current; an id outside the queue addresses nothing. An Assign patient or Assign operator segment opens the editor focused on that field. A settings cog in the panel header (data-backlog-settings) opens a popover holding three switches — without a patient, without an operator, without a chair, the chair one only where the practice has chairs — all on by default; a card stays listed while at least one of its own gaps is still switched on. Read the cog before reading the list: while any switch is off it carries data-narrowed and its accessible name says the list is filtered, so a short queue is not an empty backlog. Selection only; completing writes patient-identifiable data.",
|
|
193
193
|
"printDaySheet": "Print the front-desk call sheet. The toolbar's printer icon opens a dialog asking which day — one day, never the visible range — and Print renders that day's appointments through the browser, scoped by the filters in force and masked when privacy mode is on. Nothing is sent to a server, but the sheet itself is a patient-identifiable document."
|
|
194
194
|
}
|
|
195
195
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-value.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/field-value.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiCrD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,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E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-credits-notice.agent.d.ts","sourceRoot":"","sources":["../../../src/components/ai-credits-notice/ai-credits-notice.agent.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,YAclC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
/** The practice's current AI allowance, when the host tracks one. */
|
|
3
|
+
export interface AiCreditsNoticeAllowance {
|
|
4
|
+
/** AI actions left in the current period. */
|
|
5
|
+
remaining: number;
|
|
6
|
+
/** The monthly cap. */
|
|
7
|
+
limit: number;
|
|
8
|
+
/** When the allowance next resets. Omit if unknown. */
|
|
9
|
+
resetsOn?: Date;
|
|
10
|
+
}
|
|
11
|
+
interface AiCreditsNoticeSharedProps {
|
|
12
|
+
/**
|
|
13
|
+
* The practice's current AI allowance. In `included` mode it renders as an
|
|
14
|
+
* optional usage line + meter; in `bundles` mode it drives the heading
|
|
15
|
+
* ("{{remaining}} of {{limit}} credits") and the free-tier line in the
|
|
16
|
+
* body. Omit either mode's allowance to fall back to a generic line.
|
|
17
|
+
*/
|
|
18
|
+
allowance?: AiCreditsNoticeAllowance;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface AiCreditsNoticeIncludedProps extends AiCreditsNoticeSharedProps {
|
|
22
|
+
mode: 'included';
|
|
23
|
+
/** Shows a quiet "Learn more" link — wire it once the credits upsell page ships. */
|
|
24
|
+
onLearnMore?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Shows a quiet "Don't show again" link. The host decides what "again"
|
|
27
|
+
* means — typically stop rendering `aiCreditsNotice` on the editor for the
|
|
28
|
+
* rest of this mount, and persist the choice if it should survive a
|
|
29
|
+
* reload (see the component's docs for a `usePersistentState` example).
|
|
30
|
+
* Use a storage key scoped to the mode: switching from `included` to
|
|
31
|
+
* `bundles` is a different message and should show once more.
|
|
32
|
+
*/
|
|
33
|
+
onDismiss?: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface AiCreditsNoticeBundlesProps extends AiCreditsNoticeSharedProps {
|
|
36
|
+
mode: 'bundles';
|
|
37
|
+
/** Opens the host's AI-credits bundle picker. The kit never builds that page itself. */
|
|
38
|
+
onViewBundles: () => void;
|
|
39
|
+
/** Shows a quiet "What each action costs" link. */
|
|
40
|
+
onSeeCosts?: () => void;
|
|
41
|
+
/** Shows a quiet "Don't show again" link. See the `included` prop of the
|
|
42
|
+
* same name — the same mode-scoped-key guidance applies here too. */
|
|
43
|
+
onDismiss?: () => void;
|
|
44
|
+
}
|
|
45
|
+
export type AiCreditsNoticeProps = AiCreditsNoticeIncludedProps | AiCreditsNoticeBundlesProps;
|
|
46
|
+
export declare const AiCreditsNotice: import("react").ForwardRefExoticComponent<(AiCreditsNoticeProps & Omit<HTMLAttributes<HTMLDivElement>, "className">) & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=ai-credits-notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-credits-notice.d.ts","sourceRoot":"","sources":["../../../src/components/ai-credits-notice/ai-credits-notice.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAoCxD,qEAAqE;AACrE,MAAM,WAAW,wBAAwB;IACvC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,UAAU,0BAA0B;IAClC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;IAC9E,IAAI,EAAE,UAAU,CAAC;IACjB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,IAAI,EAAE,SAAS,CAAC;IAChB,wFAAwF;IACxF,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;0EACsE;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAC5B,4BAA4B,GAC5B,2BAA2B,CAAC;AAgBhC,eAAO,MAAM,eAAe,uKAmJ1B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AiCreditsNotice } from './ai-credits-notice';
|
|
2
|
+
export type { AiCreditsNoticeProps, AiCreditsNoticeIncludedProps, AiCreditsNoticeBundlesProps, AiCreditsNoticeAllowance, } from './ai-credits-notice';
|
|
3
|
+
export { aiCreditsNoticeAgent } from './ai-credits-notice.agent';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|