@redvars/peacock 4.1.0 → 4.2.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/{BaseField-BMumJpkW.js → BaseField-_unSNU5x.js} +40 -4
- package/dist/BaseField-_unSNU5x.js.map +1 -0
- package/dist/{BaseInput-mWdyYv27.js → BaseInput-DtZH0fPJ.js} +3 -3
- package/dist/BaseInput-DtZH0fPJ.js.map +1 -0
- package/dist/ai-badge.js +32 -6
- package/dist/ai-badge.js.map +1 -1
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-progress-CvLVSjuy.js → base-progress-D7Nmfh1s.js} +2 -2
- package/dist/{base-progress-CvLVSjuy.js.map → base-progress-D7Nmfh1s.js.map} +1 -1
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/button.js +11 -5
- package/dist/button.js.map +1 -1
- package/dist/calendar.js +2 -2
- package/dist/{canvas-base-BTQMEVn_.js → canvas-base-CWQ4rQ2s.js} +2 -2
- package/dist/{canvas-base-BTQMEVn_.js.map → canvas-base-CWQ4rQ2s.js.map} +1 -1
- package/dist/{cartesian-chart-DM1FC_XT.js → cartesian-chart-CS5yRLfE.js} +2 -2
- package/dist/{cartesian-chart-DM1FC_XT.js.map → cartesian-chart-CS5yRLfE.js.map} +1 -1
- package/dist/{cb-group-base-B6fa4Lll.js → cb-group-base-CO30uFQZ.js} +2 -2
- package/dist/{cb-group-base-B6fa4Lll.js.map → cb-group-base-CO30uFQZ.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +4 -4
- package/dist/chart-bar.js +4 -4
- package/dist/{chart-base-Dhxuw_Mw.js → chart-base-C_XKVyhf.js} +2 -2
- package/dist/{chart-base-Dhxuw_Mw.js.map → chart-base-C_XKVyhf.js.map} +1 -1
- package/dist/chart-doughnut.js +3 -3
- package/dist/chart-line.js +4 -4
- package/dist/chart-pie.js +3 -3
- package/dist/chat-event.js +152 -0
- package/dist/chat-event.js.map +1 -0
- package/dist/chat-message.js +195 -19
- package/dist/chat-message.js.map +1 -1
- package/dist/chat-thread.js +26 -9
- package/dist/chat-thread.js.map +1 -1
- package/dist/checkbox-group.js +4 -4
- package/dist/checkbox.js +4 -4
- package/dist/chip-set.js +3 -3
- package/dist/chip.js +2 -2
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +4 -4
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +5 -5
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +5 -5
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +5 -5
- package/dist/custom-elements-jsdocs.json +174 -20
- package/dist/custom-elements.json +1122 -68
- package/dist/date-field.js +6 -6
- package/dist/date-picker.js +2 -2
- package/dist/date-range-field.js +6 -6
- package/dist/datetime-field.js +6 -6
- package/dist/dependency-map.js +3 -3
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/{diagram-2r11KySs.js → diagram-Va096vj9.js} +2 -2
- package/dist/{diagram-2r11KySs.js.map → diagram-Va096vj9.js.map} +1 -1
- package/dist/diagram-controls.js +2 -2
- package/dist/diagram-minimap.js +2 -2
- package/dist/diagram.js +4 -4
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +4 -4
- package/dist/discussion-comment.js +4 -4
- package/dist/{discussion-time-BegaYfhf.js → discussion-time-DqykqvNy.js} +2 -2
- package/dist/{discussion-time-BegaYfhf.js.map → discussion-time-DqykqvNy.js.map} +1 -1
- package/dist/discussion.js +7 -7
- package/dist/{document-editor-BnEugM3E.js → document-editor-Dc8JeFVB.js} +2 -2
- package/dist/{document-editor-BnEugM3E.js.map → document-editor-Dc8JeFVB.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +14 -4
- package/dist/draft-card.js.map +1 -1
- package/dist/dropdown-button.js +3 -2
- package/dist/dropdown-button.js.map +1 -1
- package/dist/erd.js +3 -3
- package/dist/file-upload.js +4 -4
- package/dist/filter-bar.js +2 -2
- package/dist/flow.js +4 -4
- package/dist/form.js +3 -3
- package/dist/{generative-view-BgOcLRXr.js → generative-view-BKlcuujw.js} +2 -2
- package/dist/{generative-view-BgOcLRXr.js.map → generative-view-BKlcuujw.js.map} +1 -1
- package/dist/generative-view.js +3 -3
- package/dist/html-editor.js +5 -5
- package/dist/{i18n-controller-Cp43HjJl.js → i18n-controller-DJHsE1YH.js} +2 -2
- package/dist/{i18n-controller-Cp43HjJl.js.map → i18n-controller-DJHsE1YH.js.map} +1 -1
- package/dist/icon-button.js +7 -5
- package/dist/icon-button.js.map +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +4 -4
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/link-button.js +7 -5
- package/dist/link-button.js.map +1 -1
- package/dist/listbox.js +3 -3
- package/dist/loader-full.js +13 -12
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +16 -12
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +5 -5
- package/dist/mention-input.js +5 -5
- package/dist/{menu-trigger-controller-DyLpTxM7.js → menu-trigger-controller-CEJq1ugC.js} +11 -14
- package/dist/menu-trigger-controller-CEJq1ugC.js.map +1 -0
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +3 -3
- package/dist/number-field.js +5 -5
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +5 -5
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +5 -5
- package/dist/{picker-field-dTlIMAQn.js → picker-field-CUI05sWc.js} +3 -3
- package/dist/{picker-field-dTlIMAQn.js.map → picker-field-CUI05sWc.js.map} +1 -1
- package/dist/pin-input.js +5 -5
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +5 -5
- package/dist/radio-group.js +1 -1
- package/dist/radio.js +4 -4
- package/dist/rating.js +4 -4
- package/dist/redvars-loader.js +2 -2
- package/dist/{relative-time-BVQXLuHm.js → relative-time-BNxqvEbg.js} +13 -2
- package/dist/relative-time-BNxqvEbg.js.map +1 -0
- package/dist/relative-time.js +3 -3
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-DM_BOzgk.js → rich-text-input-N_hqnXej.js} +3 -3
- package/dist/{rich-text-input-DM_BOzgk.js.map → rich-text-input-N_hqnXej.js.map} +1 -1
- package/dist/{schema-B8g30A_n.js → schema-Dy0z-80u.js} +2 -2
- package/dist/{schema-B8g30A_n.js.map → schema-Dy0z-80u.js.map} +1 -1
- package/dist/search.js +4 -4
- package/dist/select.js +5 -5
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +4 -4
- package/dist/slider.js +4 -4
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +109 -21
- package/dist/split-button.js.map +1 -1
- package/dist/src/__internal/ai/suggestion-controller.d.ts +2 -0
- package/dist/src/__internal/i18n/strings.d.ts +6 -0
- package/dist/src/__internal/menu-trigger-controller.d.ts +11 -8
- package/dist/src/__internal/utils/relative-time.d.ts +5 -0
- package/dist/src/ai-badge/ai-badge.d.ts +8 -0
- package/dist/src/button/button/button.d.ts +4 -0
- package/dist/src/chat-message/chat-message.d.ts +51 -10
- package/dist/src/chat-message/index.d.ts +1 -1
- package/dist/src/chat-thread/chat-event.d.ts +37 -0
- package/dist/src/chat-thread/chat-thread.d.ts +7 -4
- package/dist/src/chat-thread/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/input/BaseField.d.ts +12 -1
- package/dist/src/input/BaseInput.d.ts +1 -0
- package/dist/src/split-button/split-button.d.ts +7 -2
- package/dist/src/textarea/textarea.d.ts +2 -0
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-BJPuhKJk.js → strings-DnYjGbbc.js} +7 -1
- package/dist/{strings-BJPuhKJk.js.map → strings-DnYjGbbc.js.map} +1 -1
- package/dist/{suggestion-controller-CW17adxd.js → suggestion-controller-7YRQqkaI.js} +3 -1
- package/dist/{suggestion-controller-CW17adxd.js.map → suggestion-controller-7YRQqkaI.js.map} +1 -1
- package/dist/svg.js +2 -2
- package/dist/switch.js +4 -4
- package/dist/table.js +50 -11
- package/dist/table.js.map +1 -1
- package/dist/textarea.js +10 -5
- package/dist/textarea.js.map +1 -1
- package/dist/time-field.js +6 -6
- package/dist/time-picker.js +2 -2
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-BlaHalfS.js → toggle-base-CXmFSp3b.js} +2 -2
- package/dist/{toggle-base-BlaHalfS.js.map → toggle-base-CXmFSp3b.js.map} +1 -1
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +4 -4
- package/dist/tree-chart.js +3 -3
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +5 -5
- package/dist/user-menu.js +3 -3
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-timeline.js +2 -2
- package/dist/workflow.js +3 -3
- package/dist/workspace-switcher.js +3 -3
- package/package.json +1 -1
- package/src/__internal/ai/suggestion-controller.ts +3 -1
- package/src/__internal/i18n/strings.ts +6 -0
- package/src/__internal/menu-trigger-controller.ts +11 -15
- package/src/__internal/utils/relative-time.ts +20 -0
- package/src/ai-badge/ai-badge.scss +8 -0
- package/src/ai-badge/ai-badge.ts +21 -4
- package/src/button/button/button-base.scss +9 -2
- package/src/button/button/button-layers.scss +3 -1
- package/src/button/button/button.ts +4 -0
- package/src/chat-message/chat-message.scss +72 -0
- package/src/chat-message/chat-message.ts +137 -18
- package/src/chat-message/index.ts +1 -0
- package/src/chat-thread/chat-event.scss +36 -0
- package/src/chat-thread/chat-event.ts +79 -0
- package/src/chat-thread/chat-thread.scss +4 -1
- package/src/chat-thread/chat-thread.ts +22 -6
- package/src/chat-thread/index.ts +1 -0
- package/src/draft-card/draft-card.scss +16 -2
- package/src/dropdown-button/dropdown-button.ts +2 -1
- package/src/index.ts +2 -1
- package/src/input/BaseField.ts +42 -2
- package/src/input/BaseInput.ts +1 -1
- package/src/loader.ts +4 -0
- package/src/split-button/split-button-colors.scss +9 -0
- package/src/split-button/split-button-sizes.scss +32 -5
- package/src/split-button/split-button.scss +61 -8
- package/src/split-button/split-button.ts +15 -8
- package/src/table/table.scss +57 -9
- package/src/table/table.ts +3 -1
- package/src/textarea/textarea.ts +7 -0
- package/dist/BaseField-BMumJpkW.js.map +0 -1
- package/dist/BaseInput-mWdyYv27.js.map +0 -1
- package/dist/menu-trigger-controller-DyLpTxM7.js.map +0 -1
- package/dist/relative-time-BVQXLuHm.js.map +0 -1
package/dist/typing-indicator.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i, _ as __decorate, I as IndividualComponent, a as i$1, b } from './IndividualComponent-BK7XZjE2.js';
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
|
-
import { I as I18nController } from './i18n-controller-
|
|
4
|
-
import './strings-
|
|
3
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
4
|
+
import './strings-DnYjGbbc.js';
|
|
5
5
|
import './locale-DEsJZCQG.js';
|
|
6
6
|
|
|
7
7
|
var css_248z = i`* {
|
package/dist/url-field.js
CHANGED
|
@@ -3,16 +3,16 @@ import { n } from './property-B2TG3KEE.js';
|
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
5
|
import { s as spread } from './spread-B5cgadZl.js';
|
|
6
|
-
import { I as I18nController } from './i18n-controller-
|
|
7
|
-
import { B as BaseField } from './BaseField-
|
|
8
|
-
import { n as nativeValidity } from './BaseInput-
|
|
6
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
7
|
+
import { B as BaseField } from './BaseField-_unSNU5x.js';
|
|
8
|
+
import { n as nativeValidity } from './BaseInput-DtZH0fPJ.js';
|
|
9
9
|
import './base-Cl6v8-BZ.js';
|
|
10
10
|
import './directive-ZPhl09Yt.js';
|
|
11
|
-
import './strings-
|
|
11
|
+
import './strings-DnYjGbbc.js';
|
|
12
12
|
import './locale-DEsJZCQG.js';
|
|
13
13
|
import './element-internals-QME0yEz4.js';
|
|
14
14
|
import './form-associated-BHbg72PG.js';
|
|
15
|
-
import './suggestion-controller-
|
|
15
|
+
import './suggestion-controller-7YRQqkaI.js';
|
|
16
16
|
import './ai-controller-DR_Tg0sN.js';
|
|
17
17
|
|
|
18
18
|
var css_248z = i`* {
|
package/dist/user-menu.js
CHANGED
|
@@ -2,10 +2,10 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './
|
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
|
-
import { I as I18nController } from './i18n-controller-
|
|
6
|
-
import { M as MenuTriggerController } from './menu-trigger-controller-
|
|
5
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
6
|
+
import { M as MenuTriggerController } from './menu-trigger-controller-CEJq1ugC.js';
|
|
7
7
|
import './base-Cl6v8-BZ.js';
|
|
8
|
-
import './strings-
|
|
8
|
+
import './strings-DnYjGbbc.js';
|
|
9
9
|
import './locale-DEsJZCQG.js';
|
|
10
10
|
|
|
11
11
|
var css_248z = i`* {
|
package/dist/virtual-list.js
CHANGED
|
@@ -2,11 +2,11 @@ import { i, _ as __decorate, I as IndividualComponent, a as i$1, D, A, b } from
|
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { c } from './repeat-D_ERDRYT.js';
|
|
5
|
-
import { I as I18nController } from './i18n-controller-
|
|
5
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
6
6
|
import { v as virtualWindow } from './virtual-window-5OYyIqZh.js';
|
|
7
7
|
import './directive-ZPhl09Yt.js';
|
|
8
8
|
import './directive-helpers-Bx3mu42O.js';
|
|
9
|
-
import './strings-
|
|
9
|
+
import './strings-DnYjGbbc.js';
|
|
10
10
|
import './locale-DEsJZCQG.js';
|
|
11
11
|
|
|
12
12
|
var css_248z = i`* {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i, _ as __decorate, I as IndividualComponent, a as i$1, A, b } from './IndividualComponent-BK7XZjE2.js';
|
|
2
2
|
import { n } from './property-B2TG3KEE.js';
|
|
3
3
|
import { e } from './class-map-NDIkZErE.js';
|
|
4
|
-
import { I as I18nController } from './i18n-controller-
|
|
4
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
5
5
|
import { D as DiagramCanvasLink } from './canvas-link-CtgsALq4.js';
|
|
6
6
|
import { w as walk } from './workflow-model-CauduOG2.js';
|
|
7
7
|
import { f as formatDuration } from './workflow-format-BsyveyeC.js';
|
|
8
8
|
import './directive-ZPhl09Yt.js';
|
|
9
|
-
import './strings-
|
|
9
|
+
import './strings-DnYjGbbc.js';
|
|
10
10
|
import './locale-DEsJZCQG.js';
|
|
11
11
|
import './host-CZK7xhzh.js';
|
|
12
12
|
|
package/dist/workflow.js
CHANGED
|
@@ -3,15 +3,15 @@ import { n } from './property-B2TG3KEE.js';
|
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
5
|
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
6
|
-
import { D as DiagramCanvasElement, p as prefersReducedMotion, a as animateOut } from './canvas-base-
|
|
6
|
+
import { D as DiagramCanvasElement, p as prefersReducedMotion, a as animateOut } from './canvas-base-CWQ4rQ2s.js';
|
|
7
7
|
import { r as roundedPath } from './geometry-INg82Lxq.js';
|
|
8
8
|
import { H as History } from './history-YbTSQZHj.js';
|
|
9
9
|
import { W as WORKFLOW_LOGIC_STEPS, f as findStep, w as walk, i as isReached, r as replaceStep, a as removeStep, g as getList, c as createStep, b as allIds, d as insertStep, m as moveStep, l as listKey, e as cloneWithNewIds, h as contains, j as countInside, k as listTerminates, s as stepTerminates } from './workflow-model-CauduOG2.js';
|
|
10
10
|
import { f as formatDuration } from './workflow-format-BsyveyeC.js';
|
|
11
11
|
import './base-Cl6v8-BZ.js';
|
|
12
12
|
import './directive-ZPhl09Yt.js';
|
|
13
|
-
import './i18n-controller-
|
|
14
|
-
import './strings-
|
|
13
|
+
import './i18n-controller-DJHsE1YH.js';
|
|
14
|
+
import './strings-DnYjGbbc.js';
|
|
15
15
|
import './locale-DEsJZCQG.js';
|
|
16
16
|
import './host-CZK7xhzh.js';
|
|
17
17
|
|
|
@@ -3,11 +3,11 @@ import { n } from './property-B2TG3KEE.js';
|
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
5
|
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
6
|
-
import { I as I18nController } from './i18n-controller-
|
|
7
|
-
import { M as MenuTriggerController } from './menu-trigger-controller-
|
|
6
|
+
import { I as I18nController } from './i18n-controller-DJHsE1YH.js';
|
|
7
|
+
import { M as MenuTriggerController } from './menu-trigger-controller-CEJq1ugC.js';
|
|
8
8
|
import './base-Cl6v8-BZ.js';
|
|
9
9
|
import './directive-ZPhl09Yt.js';
|
|
10
|
-
import './strings-
|
|
10
|
+
import './strings-DnYjGbbc.js';
|
|
11
11
|
import './locale-DEsJZCQG.js';
|
|
12
12
|
|
|
13
13
|
var css_248z = i`* {
|
package/package.json
CHANGED
|
@@ -156,9 +156,10 @@ export class SuggestionController implements ReactiveController {
|
|
|
156
156
|
/**
|
|
157
157
|
* The Suggested badge with its clear button, while the suggestion shows. With `withReason` the
|
|
158
158
|
* badge carries the reason in its tooltip, for controls that have no helper text to show it in.
|
|
159
|
+
* With `iconOnly` it shows just the sparkle, for a field too narrow for the label.
|
|
159
160
|
*/
|
|
160
161
|
badge(
|
|
161
|
-
options: { slot?: string; withReason?: boolean } = {},
|
|
162
|
+
options: { slot?: string; withReason?: boolean; iconOnly?: boolean } = {},
|
|
162
163
|
): TemplateResult | typeof nothing {
|
|
163
164
|
if (!this.visible) return nothing;
|
|
164
165
|
return html`<wc-ai-badge
|
|
@@ -166,6 +167,7 @@ export class SuggestionController implements ReactiveController {
|
|
|
166
167
|
part="suggestion-badge"
|
|
167
168
|
slot=${options.slot ?? nothing}
|
|
168
169
|
reason=${options.withReason ? this.reason : ''}
|
|
170
|
+
?icon-only=${options.iconOnly}
|
|
169
171
|
dismissible
|
|
170
172
|
@click=${this.onBadgeClick}
|
|
171
173
|
@dismiss=${this.onBadgeDismiss}
|
|
@@ -1175,6 +1175,12 @@ export const defaultStrings = {
|
|
|
1175
1175
|
/** Who wrote a message, read before it. */
|
|
1176
1176
|
chatYou: 'You',
|
|
1177
1177
|
chatAssistant: 'Assistant',
|
|
1178
|
+
/** Who wrote a message from another person, when it has no `author`. */
|
|
1179
|
+
chatParticipant: 'Participant',
|
|
1180
|
+
/** Where a message came from, for example "via Teams". */
|
|
1181
|
+
chatVia: (channel: string): string => `via ${channel}`,
|
|
1182
|
+
/** Accessible name of the quick replies under a message. */
|
|
1183
|
+
chatQuickReplies: 'Suggested replies',
|
|
1178
1184
|
chatCopy: 'Copy',
|
|
1179
1185
|
chatRegenerate: 'Try again',
|
|
1180
1186
|
chatGoodAnswer: 'Good answer',
|
|
@@ -17,17 +17,22 @@ export interface MenuTriggerOptions {
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The menu wiring shared by buttons that open a `wc-menu` (dropdown button, split button):
|
|
20
|
-
* show / close / toggle, Arrow Up / Down on the trigger, the trigger's
|
|
21
|
-
* `aria-expanded
|
|
20
|
+
* show / close / toggle, Arrow Up / Down on the trigger, the open state behind the trigger's
|
|
21
|
+
* `aria-expanded`, and the host's `open` / `close` events (ADR-030001).
|
|
22
22
|
*
|
|
23
23
|
* The menu's own `open` / `close` events are stopped inside the host, which fires its own `open`
|
|
24
|
-
* and `close` instead; `close` carries `detail.reason` from the menu's close event. The host
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* and `close` instead; `close` carries `detail.reason` from the menu's close event. The host
|
|
25
|
+
* renders the menu with `id=${trigger.menuId}`, `@open=${trigger.handleMenuOpen}` and
|
|
26
|
+
* `@close=${trigger.handleMenuClose}`, and the trigger button with `aria-haspopup="menu"`,
|
|
27
|
+
* `aria-expanded=${String(trigger.open)}`, `@click=${trigger.handleTriggerClick}` and
|
|
27
28
|
* `@keydown=${trigger.handleTriggerKeyDown}`.
|
|
29
|
+
*
|
|
30
|
+
* Add `aria-controls=${trigger.menuId}` only when the trigger is a native `<button>` in the same
|
|
31
|
+
* shadow root as the menu. A `wc-button` or `wc-icon-button` renders its `<button>` in its own
|
|
32
|
+
* shadow root, where an ID reference to the menu cannot resolve, so leave `aria-controls` off it.
|
|
28
33
|
*/
|
|
29
34
|
export class MenuTriggerController {
|
|
30
|
-
/** Id for the menu,
|
|
35
|
+
/** Id for the menu, for the `aria-controls` of a native trigger in the same shadow root. */
|
|
31
36
|
readonly menuId: string;
|
|
32
37
|
|
|
33
38
|
private readonly host: ReactiveControllerHost & HTMLElement;
|
|
@@ -50,15 +55,6 @@ export class MenuTriggerController {
|
|
|
50
55
|
return this._open;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
/** ARIA for the trigger button. */
|
|
54
|
-
get triggerAria(): Record<string, string> {
|
|
55
|
-
return {
|
|
56
|
-
'aria-haspopup': 'menu',
|
|
57
|
-
'aria-expanded': String(this._open),
|
|
58
|
-
'aria-controls': this.menuId,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
58
|
/** Opens the menu, anchored to the host, and focuses its first (or last) item. */
|
|
63
59
|
show(focusTarget: MenuFocusTarget = 'first') {
|
|
64
60
|
const menu = this.options.menu();
|
|
@@ -149,6 +149,26 @@ export function formatAbsoluteDate(
|
|
|
149
149
|
).format(time);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* `date` as a clock time in `locale` ("9:41 AM"), with the date before it when it is not today
|
|
154
|
+
* ("Nov 2, 9:41 AM"), for timestamps in a conversation.
|
|
155
|
+
*/
|
|
156
|
+
export function formatClockTime(
|
|
157
|
+
date: Date | number,
|
|
158
|
+
locale: string,
|
|
159
|
+
now: number = Date.now(),
|
|
160
|
+
): string {
|
|
161
|
+
const time = toTime(date);
|
|
162
|
+
const sameDay =
|
|
163
|
+
new Date(time).toDateString() === new Date(now).toDateString();
|
|
164
|
+
return dateFormat(
|
|
165
|
+
locale,
|
|
166
|
+
sameDay
|
|
167
|
+
? { hour: 'numeric', minute: '2-digit' }
|
|
168
|
+
: { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' },
|
|
169
|
+
).format(time);
|
|
170
|
+
}
|
|
171
|
+
|
|
152
172
|
/**
|
|
153
173
|
* `date` relative to now ("5 minutes ago"), or, when `absoluteAfter` is set and the date is
|
|
154
174
|
* farther from now than that, an absolute date ("Nov 2").
|
|
@@ -48,6 +48,14 @@
|
|
|
48
48
|
padding-inline-end: var(--spacing-025, 0.125rem);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
:host([icon-only]) .badge {
|
|
52
|
+
padding-inline-start: var(--spacing-050, 0.25rem);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([icon-only]:not([dismissible])) .badge {
|
|
56
|
+
padding-inline-end: var(--spacing-050, 0.25rem);
|
|
57
|
+
}
|
|
58
|
+
|
|
51
59
|
.label {
|
|
52
60
|
display: inline-flex;
|
|
53
61
|
align-items: center;
|
package/src/ai-badge/ai-badge.ts
CHANGED
|
@@ -31,6 +31,9 @@ export type AiBadgeKind = 'suggested' | 'draft' | 'generated';
|
|
|
31
31
|
* and is read as the badge's description. <code>dismissible</code> adds a clear button that fires
|
|
32
32
|
* <code>dismiss</code>; the app then removes the suggestion, discards the draft or hides the
|
|
33
33
|
* summary.</p>
|
|
34
|
+
* <p><code>icon-only</code> keeps just the sparkle where there is no room for the label, such as a
|
|
35
|
+
* narrow field: the label is still read and shows in the tooltip. Fields switch to it on their
|
|
36
|
+
* own when they are narrow.</p>
|
|
34
37
|
* <p>When AI is off for the page (<code>setPeacockAi({ enabled: false })</code>) the badge renders
|
|
35
38
|
* nothing, so a page that still passes AI state in never shows a stale marker.</p>
|
|
36
39
|
* <p>The label is always text, never only the color or the sparkle. Replace it with the default
|
|
@@ -74,6 +77,13 @@ export class AiBadge extends LitElement {
|
|
|
74
77
|
/** Adds a button that clears the output in one action. */
|
|
75
78
|
@property({ type: Boolean, reflect: true }) dismissible = false;
|
|
76
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Shows only the sparkle, for tight spaces such as a narrow field. The label stays the
|
|
82
|
+
* accessible name and shows in the tooltip.
|
|
83
|
+
*/
|
|
84
|
+
@property({ type: Boolean, reflect: true, attribute: 'icon-only' })
|
|
85
|
+
iconOnly = false;
|
|
86
|
+
|
|
77
87
|
/** Per-instance string overrides. */
|
|
78
88
|
@property({ attribute: false }) strings?: Partial<PeacockStrings>;
|
|
79
89
|
|
|
@@ -109,10 +119,17 @@ export class AiBadge extends LitElement {
|
|
|
109
119
|
render() {
|
|
110
120
|
if (!this._ai.available) return nothing;
|
|
111
121
|
const reason = this.reason.trim();
|
|
122
|
+
const { iconOnly } = this;
|
|
123
|
+
// Icon-only, the tooltip says what the sparkle stands for, then why.
|
|
124
|
+
const tooltip = iconOnly
|
|
125
|
+
? [this._label(), reason].filter(Boolean).join('. ')
|
|
126
|
+
: reason;
|
|
112
127
|
// The tooltip sits outside the badge so it doesn't inherit the badge's one-line label styles.
|
|
113
128
|
return html`<span class="badge" part="badge"
|
|
114
|
-
><span class="label" id="label" tabindex=${
|
|
115
|
-
>${sparkle}<
|
|
129
|
+
><span class="label" id="label" tabindex=${tooltip ? 0 : nothing}
|
|
130
|
+
>${sparkle}<span class=${iconOnly ? 'screen-reader-only' : 'text'}
|
|
131
|
+
><slot>${this._label()}</slot></span
|
|
132
|
+
></span
|
|
116
133
|
>${this.dismissible
|
|
117
134
|
? html`<button
|
|
118
135
|
class="dismiss"
|
|
@@ -124,9 +141,9 @@ export class AiBadge extends LitElement {
|
|
|
124
141
|
<wc-icon name="close"></wc-icon>
|
|
125
142
|
</button>`
|
|
126
143
|
: nothing}</span
|
|
127
|
-
>${
|
|
144
|
+
>${tooltip
|
|
128
145
|
? html`<wc-tooltip for="label" placement="bottom-start"
|
|
129
|
-
>${
|
|
146
|
+
>${tooltip}</wc-tooltip
|
|
130
147
|
>`
|
|
131
148
|
: nothing}`;
|
|
132
149
|
}
|
|
@@ -48,8 +48,15 @@
|
|
|
48
48
|
align-items: center;
|
|
49
49
|
justify-content: center;
|
|
50
50
|
height: var(--button-height);
|
|
51
|
-
padding: 0
|
|
52
|
-
|
|
51
|
+
padding-block: 0;
|
|
52
|
+
padding-inline-start: var(
|
|
53
|
+
--button-container-padding-start,
|
|
54
|
+
var(--button-container-padding, var(--_button-container-padding))
|
|
55
|
+
);
|
|
56
|
+
padding-inline-end: var(
|
|
57
|
+
--button-container-padding-end,
|
|
58
|
+
var(--button-container-padding, var(--_button-container-padding))
|
|
59
|
+
);
|
|
53
60
|
width: 100%;
|
|
54
61
|
|
|
55
62
|
.label {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// Mixin for the shared transition logic
|
|
4
4
|
@mixin button-transition {
|
|
5
|
-
transition-property:
|
|
5
|
+
transition-property:
|
|
6
|
+
inset, width, height, transform, opacity, border-start-start-radius,
|
|
7
|
+
border-start-end-radius, border-end-start-radius, border-end-end-radius;
|
|
6
8
|
transition-duration: 200ms;
|
|
7
9
|
transition-timing-function: var(--easing-standard);
|
|
8
10
|
will-change: inset, transform, opacity;
|
|
@@ -50,6 +50,10 @@ export type {
|
|
|
50
50
|
* @cssprop --button-container-shape-end-start - Defines the start position of the button container shape.
|
|
51
51
|
* @cssprop --button-container-shape-end-end - Defines the end position of the button container shape.
|
|
52
52
|
*
|
|
53
|
+
* @cssprop --button-container-padding - Inline padding of the button container, on both sides.
|
|
54
|
+
* @cssprop --button-container-padding-start - Inline-start padding of the button container; overrides `--button-container-padding`.
|
|
55
|
+
* @cssprop --button-container-padding-end - Inline-end padding of the button container; overrides `--button-container-padding`.
|
|
56
|
+
*
|
|
53
57
|
*
|
|
54
58
|
* @cssprop --filled-button-container-color - Color of the filled button container.
|
|
55
59
|
* @cssprop --filled-button-label-text-color - Text color of the filled button label.
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
* @prop --chat-message-bubble-color: Text color of the person's bubble
|
|
15
15
|
*/
|
|
16
16
|
--chat-message-bubble-color: var(--color-on-secondary-container);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @prop --chat-message-participant-background: Background of a participant's bubble
|
|
20
|
+
*/
|
|
21
|
+
--chat-message-participant-background: var(--color-surface-container-high);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @prop --chat-message-participant-color: Text color of a participant's bubble
|
|
25
|
+
*/
|
|
26
|
+
--chat-message-participant-color: var(--color-on-surface);
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
.message {
|
|
@@ -57,6 +67,68 @@
|
|
|
57
67
|
var(--shape-corner-large) var(--shape-corner-extra-small);
|
|
58
68
|
}
|
|
59
69
|
|
|
70
|
+
// A participant's bubble starts the line, so its square corner is at the start.
|
|
71
|
+
.participant .bubble {
|
|
72
|
+
color: var(--chat-message-participant-color);
|
|
73
|
+
background: var(--chat-message-participant-background);
|
|
74
|
+
border-radius: var(--shape-corner-extra-small) var(--shape-corner-large)
|
|
75
|
+
var(--shape-corner-large) var(--shape-corner-large);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host(:dir(rtl)) .participant .bubble {
|
|
79
|
+
border-radius: var(--shape-corner-large) var(--shape-corner-extra-small)
|
|
80
|
+
var(--shape-corner-large) var(--shape-corner-large);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.header {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--spacing-050, 0.25rem) var(--spacing-100, 0.5rem);
|
|
88
|
+
min-block-size: 1.25rem;
|
|
89
|
+
color: var(--color-on-surface-variant);
|
|
90
|
+
@include mixin.get-typography-not-important(label-medium);
|
|
91
|
+
|
|
92
|
+
&[hidden] {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.user .header {
|
|
98
|
+
justify-content: flex-end;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// The gap after the header is the body's; pull the bubble closer to its own name.
|
|
102
|
+
.header:not([hidden]) + slot + .bubble,
|
|
103
|
+
.header:not([hidden]) + slot + .content {
|
|
104
|
+
margin-block-start: calc(-1 * var(--spacing-100, 0.5rem));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.author {
|
|
108
|
+
color: var(--color-on-surface);
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.channel::before,
|
|
113
|
+
.time::before {
|
|
114
|
+
margin-inline-end: var(--spacing-100, 0.5rem);
|
|
115
|
+
content: '·';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
::slotted([slot='meta']) {
|
|
119
|
+
flex: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.suggestions {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
gap: var(--spacing-100, 0.5rem);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.user .suggestions {
|
|
129
|
+
justify-content: flex-end;
|
|
130
|
+
}
|
|
131
|
+
|
|
60
132
|
.content {
|
|
61
133
|
min-inline-size: 0;
|
|
62
134
|
}
|