@common-origin/design-system 2.20.0 → 2.21.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/client.js +844 -344
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/AILabel/AILabel.d.mts +30 -0
- package/dist/components/atoms/AILabel/AILabel.d.ts +30 -0
- package/dist/components/atoms/AILabel/AILabel.mjs +94 -0
- package/dist/components/atoms/AILabel/AILabel.mjs.map +1 -0
- package/dist/components/atoms/AILabel/index.d.mts +1 -0
- package/dist/components/atoms/AILabel/index.d.ts +1 -0
- package/dist/components/atoms/Chip/SuggestionChip.d.mts +24 -0
- package/dist/components/atoms/Chip/SuggestionChip.d.ts +24 -0
- package/dist/components/atoms/Chip/SuggestionChip.mjs +61 -0
- package/dist/components/atoms/Chip/SuggestionChip.mjs.map +1 -0
- package/dist/components/atoms/Chip/index.d.mts +1 -0
- package/dist/components/atoms/Chip/index.d.ts +1 -0
- package/dist/components/atoms/index.d.mts +1 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/molecules/AgentInput/AgentInput.d.mts +63 -1
- package/dist/components/molecules/AgentInput/AgentInput.d.ts +63 -1
- package/dist/components/molecules/AgentInput/AgentInput.mjs +476 -112
- package/dist/components/molecules/AgentInput/agentInputSpeech.d.mts +2 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.d.ts +2 -0
- package/dist/components/molecules/AgentInput/agentInputSpeech.mjs +5 -1
- package/dist/components/molecules/AgentInput/agentInputSpeech.mjs.map +1 -1
- package/dist/components/molecules/AgentInput/index.d.mts +1 -1
- package/dist/components/molecules/AgentInput/index.d.ts +1 -1
- package/dist/components/molecules/CardLarge/CardLarge.mjs +1 -0
- package/dist/components/molecules/ChipGroup/ChipGroup.mjs +2 -0
- package/dist/components/molecules/FeatureBlock/FeatureBlock.mjs +1 -0
- package/dist/data.js +316 -3
- package/dist/data.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/lib/tokenAliases.mjs +1 -0
- package/dist/lib/tokenAliases.mjs.map +1 -1
- package/dist/styles/icons.json +30 -1
- package/dist/styles/icons.json.mjs +33 -2
- package/dist/styles/icons.json.mjs.map +1 -1
- package/dist/styles/tokens.d.mts +545 -1
- package/dist/styles/tokens.d.ts +545 -1
- package/dist/styles/tokens.json +284 -2
- package/dist/styles/tokens.json.mjs +284 -2
- package/dist/styles/tokens.json.mjs.map +1 -1
- package/dist/tokens/index.js +284 -2
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +284 -2
- package/dist/tokens/index.mjs.map +1 -1
- package/dist/tokens/styles/tokens.d.mts +545 -1
- package/dist/tokens/styles/tokens.d.ts +545 -1
- package/dist/tokens.css +242 -0
- package/dist/types/icons.d.mts +1 -1
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/icons.mjs.map +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -156,31 +156,31 @@ function withCssVariables(tree, path) {
|
|
|
156
156
|
var tokens = withCssVariables(data.tokensJson);
|
|
157
157
|
|
|
158
158
|
// Destructure tokens
|
|
159
|
-
var semantic$
|
|
159
|
+
var semantic$n = tokens.semantic;
|
|
160
160
|
var initials = tokens.component.avatar.initials;
|
|
161
|
-
var color$
|
|
162
|
-
size$
|
|
163
|
-
var radius$6 = semantic$
|
|
161
|
+
var color$d = semantic$n.color,
|
|
162
|
+
size$4 = semantic$n.size;
|
|
163
|
+
var radius$6 = semantic$n.radius;
|
|
164
164
|
var AvatarContainer = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
165
165
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
166
166
|
return !prop.startsWith('$');
|
|
167
167
|
},
|
|
168
168
|
displayName: "Avatar__AvatarContainer",
|
|
169
169
|
componentId: "sc-ezn4ax-0"
|
|
170
|
-
})(templateObject_1$
|
|
170
|
+
})(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"])), function (_a) {
|
|
171
171
|
var $size = _a.$size;
|
|
172
|
-
return size$
|
|
172
|
+
return size$4.avatar[$size];
|
|
173
173
|
}, function (_a) {
|
|
174
174
|
var $size = _a.$size;
|
|
175
|
-
return size$
|
|
176
|
-
}, radius$6.full, color$
|
|
175
|
+
return size$4.avatar[$size];
|
|
176
|
+
}, radius$6.full, color$d.fill.muted);
|
|
177
177
|
var AvatarImage = /*#__PURE__*/styled__default.default.img.withConfig({
|
|
178
178
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
179
179
|
return !prop.startsWith('$');
|
|
180
180
|
},
|
|
181
181
|
displayName: "Avatar__AvatarImage",
|
|
182
182
|
componentId: "sc-ezn4ax-1"
|
|
183
|
-
})(templateObject_2$
|
|
183
|
+
})(templateObject_2$z || (templateObject_2$z = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"])), radius$6.full);
|
|
184
184
|
var AvatarInitials = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
185
185
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
186
186
|
return !prop.startsWith('$');
|
|
@@ -192,7 +192,7 @@ var AvatarInitials = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
192
192
|
])), initials.fontFamily, initials.fontWeight, function (_a) {
|
|
193
193
|
var $size = _a.$size;
|
|
194
194
|
return initials.fontSize[$size];
|
|
195
|
-
}, color$
|
|
195
|
+
}, color$d.text["default"], initials.lineHeight);
|
|
196
196
|
// Helper function to get initials from name
|
|
197
197
|
var getInitials = function getInitials(name) {
|
|
198
198
|
return name.split(' ').map(function (word) {
|
|
@@ -246,7 +246,7 @@ var Avatar = function Avatar(_a) {
|
|
|
246
246
|
})
|
|
247
247
|
}));
|
|
248
248
|
};
|
|
249
|
-
var templateObject_1$
|
|
249
|
+
var templateObject_1$O, templateObject_2$z, templateObject_3$w;
|
|
250
250
|
|
|
251
251
|
// Breakpoints from the semantic tokens (decision 0014)
|
|
252
252
|
var breakpoints$1 = {
|
|
@@ -281,7 +281,7 @@ var forcedColorsEdge = "".concat(forcedColors, " {\n border: ").concat(tokens.s
|
|
|
281
281
|
var reducedMotion = '@media (prefers-reduced-motion: reduce)';
|
|
282
282
|
// No `from` keyframe: the fade starts from the element's current opacity, including a
|
|
283
283
|
// still-running entrance, so closing mid-entrance doesn't jump back to fully visible.
|
|
284
|
-
var fadeOut$1 = styled.keyframes(templateObject_1$
|
|
284
|
+
var fadeOut$1 = styled.keyframes(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n to { opacity: 0; }\n"], ["\n to { opacity: 0; }\n"
|
|
285
285
|
// Exit for overlays that unmount (use with usePresence). Append `exitAnimation` to each of
|
|
286
286
|
// the element's `animation` declarations while it exits: the entrance stays in the list,
|
|
287
287
|
// so it isn't restarted, and the fade runs on top of it. A fade is already the
|
|
@@ -295,7 +295,7 @@ var fadeOut$1 = styled.keyframes(templateObject_1$L || (templateObject_1$L = __m
|
|
|
295
295
|
// reduced-motion form, so it needs no fallback of its own. While it fades, the backdrop
|
|
296
296
|
// still catches clicks (so they can't reach the page behind it) and the panel is inert.
|
|
297
297
|
// Exits accelerate: things leaving speed up as they go (decision 0037).
|
|
298
|
-
var exitAnimation = styled.css(templateObject_2$
|
|
298
|
+
var exitAnimation = styled.css(templateObject_2$y || (templateObject_2$y = __makeTemplateObject([", ", " ", " ", " forwards"], [", ", " ", " ", " forwards"
|
|
299
299
|
// Content for screen readers only. The 1px size and -1px margin are part of the standard
|
|
300
300
|
// visually-hidden technique, not design values, so they aren't tokens.
|
|
301
301
|
])), fadeOut$1, tokens.semantic.motion.duration.fast, tokens.semantic.motion.easing.accelerate);
|
|
@@ -399,44 +399,44 @@ var rowForcedColors = function rowForcedColors(_a) {
|
|
|
399
399
|
// the descendants' own rules.
|
|
400
400
|
return "".concat(forcedColors, " {\n ").concat(selected ? "background-color: Highlight;\n ".concat(text('HighlightText'), "\n && * {\n color: inherit;\n background-color: transparent;\n }") : '', "\n ").concat(!disabled && focused ? hover : '', "\n ").concat(disabled ? '' : "&:hover {\n ".concat(hover, "\n }"), "\n }");
|
|
401
401
|
};
|
|
402
|
-
var templateObject_1$
|
|
402
|
+
var templateObject_1$N, templateObject_2$y, templateObject_3$v;
|
|
403
403
|
|
|
404
404
|
var _a$a = tokens.semantic,
|
|
405
|
-
typography$
|
|
406
|
-
color$
|
|
405
|
+
typography$3 = _a$a.typography,
|
|
406
|
+
color$c = _a$a.color,
|
|
407
407
|
letterSpacing = _a$a.letterSpacing;
|
|
408
408
|
var getTypographyStyles = function getTypographyStyles(variant) {
|
|
409
409
|
var styles = {
|
|
410
|
-
display: "font: ".concat(typography$
|
|
411
|
-
h1: "font: ".concat(typography$
|
|
412
|
-
h2: "font: ".concat(typography$
|
|
413
|
-
h3: "font: ".concat(typography$
|
|
414
|
-
h4: "font: ".concat(typography$
|
|
415
|
-
h5: "font: ".concat(typography$
|
|
416
|
-
h6: "font: ".concat(typography$
|
|
417
|
-
subtitle: "font: ".concat(typography$
|
|
418
|
-
body: "font: ".concat(typography$
|
|
419
|
-
small: "font: ".concat(typography$
|
|
420
|
-
overline: "font: ".concat(typography$
|
|
421
|
-
caption: "font: ".concat(typography$
|
|
410
|
+
display: "font: ".concat(typography$3.display, "; letter-spacing: ").concat(letterSpacing.tighter, ";"),
|
|
411
|
+
h1: "font: ".concat(typography$3.h1, "; letter-spacing: ").concat(letterSpacing.tighter, ";"),
|
|
412
|
+
h2: "font: ".concat(typography$3.h2, "; letter-spacing: ").concat(letterSpacing.tight, ";"),
|
|
413
|
+
h3: "font: ".concat(typography$3.h3, "; letter-spacing: ").concat(letterSpacing.tight, ";"),
|
|
414
|
+
h4: "font: ".concat(typography$3.h4, "; letter-spacing: ").concat(letterSpacing.tight, ";"),
|
|
415
|
+
h5: "font: ".concat(typography$3.h5, "; letter-spacing: ").concat(letterSpacing.normal, ";"),
|
|
416
|
+
h6: "font: ".concat(typography$3.h6, "; letter-spacing: ").concat(letterSpacing.normal, ";"),
|
|
417
|
+
subtitle: "font: ".concat(typography$3.subtitle, ";"),
|
|
418
|
+
body: "font: ".concat(typography$3.body, ";"),
|
|
419
|
+
small: "font: ".concat(typography$3.small, ";"),
|
|
420
|
+
overline: "font: ".concat(typography$3.overline, ";"),
|
|
421
|
+
caption: "font: ".concat(typography$3.caption, "; text-transform: uppercase;"),
|
|
422
422
|
button1: "font: ".concat(tokens.component.button.sizes.large.font, ";"),
|
|
423
423
|
button2: "font: ".concat(tokens.component.button.sizes.medium.font, ";"),
|
|
424
424
|
button3: "font: ".concat(tokens.component.button.sizes.small.font, ";"),
|
|
425
|
-
label: "font: ".concat(typography$
|
|
425
|
+
label: "font: ".concat(typography$3.label, ";")
|
|
426
426
|
};
|
|
427
427
|
return styles[variant] || styles.body;
|
|
428
428
|
};
|
|
429
429
|
var getTextColor = function getTextColor(colorVariant) {
|
|
430
430
|
var colorMap = {
|
|
431
|
-
"default": color$
|
|
432
|
-
emphasis: color$
|
|
433
|
-
subdued: color$
|
|
434
|
-
inverse: color$
|
|
435
|
-
disabled: color$
|
|
436
|
-
interactive: color$
|
|
437
|
-
error: color$
|
|
438
|
-
success: color$
|
|
439
|
-
warning: color$
|
|
431
|
+
"default": color$c.text["default"],
|
|
432
|
+
emphasis: color$c.text.emphasis,
|
|
433
|
+
subdued: color$c.text.muted,
|
|
434
|
+
inverse: color$c.text.inverse,
|
|
435
|
+
disabled: color$c.text.disabled,
|
|
436
|
+
interactive: color$c.text.accent,
|
|
437
|
+
error: color$c.text.danger,
|
|
438
|
+
success: color$c.text.success,
|
|
439
|
+
warning: color$c.text.warning
|
|
440
440
|
};
|
|
441
441
|
return colorMap[colorVariant] || colorMap["default"];
|
|
442
442
|
};
|
|
@@ -467,7 +467,7 @@ var StyledTypography = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
467
467
|
},
|
|
468
468
|
displayName: "Typography__StyledTypography",
|
|
469
469
|
componentId: "sc-17mqo4k-0"
|
|
470
|
-
})(templateObject_1$
|
|
470
|
+
})(templateObject_1$M || (templateObject_1$M = __makeTemplateObject(["\n ", "\n color: ", ";\n margin: 0;\n"], ["\n ", "\n color: ", ";\n margin: 0;\n"
|
|
471
471
|
/**
|
|
472
472
|
* Typography is an atomic component for rendering text with semantic meaning and consistent styling.
|
|
473
473
|
*
|
|
@@ -529,20 +529,20 @@ var Typography = function Typography(_a) {
|
|
|
529
529
|
children: children
|
|
530
530
|
});
|
|
531
531
|
};
|
|
532
|
-
var templateObject_1$
|
|
532
|
+
var templateObject_1$M;
|
|
533
533
|
|
|
534
|
-
var semantic$
|
|
535
|
-
var color$
|
|
536
|
-
var radius$5 = semantic$
|
|
534
|
+
var semantic$m = tokens.semantic;
|
|
535
|
+
var color$b = semantic$m.color;
|
|
536
|
+
var radius$5 = semantic$m.radius;
|
|
537
537
|
var _a$9 = tokens.component.badge,
|
|
538
538
|
dot = _a$9.dot,
|
|
539
539
|
count = _a$9.count,
|
|
540
540
|
ring = _a$9.ring;
|
|
541
|
-
var scaleIn$2 = styled.keyframes(templateObject_1$
|
|
541
|
+
var scaleIn$2 = styled.keyframes(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"], ["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"])));
|
|
542
542
|
var BadgeWrapper = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
543
543
|
displayName: "Badge__BadgeWrapper",
|
|
544
544
|
componentId: "sc-tjz4pp-0"
|
|
545
|
-
})(templateObject_2$
|
|
545
|
+
})(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"])));
|
|
546
546
|
var BadgeIndicator = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
547
547
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
548
548
|
return !prop.startsWith('$');
|
|
@@ -556,23 +556,23 @@ var BadgeIndicator = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
556
556
|
}, function (props) {
|
|
557
557
|
return props.$isDot ? dot.size : count.height;
|
|
558
558
|
}, function (props) {
|
|
559
|
-
return props.$isDot ? '0' : "0 ".concat(semantic$
|
|
560
|
-
}, radius$5.full, count.lineHeight, ring.width, semantic$
|
|
561
|
-
return props.$isDot ? "".concat(forcedColors, " { forced-color-adjust: none; background-color: CanvasText; }") : "".concat(forcedColors, " { border: ").concat(semantic$
|
|
559
|
+
return props.$isDot ? '0' : "0 ".concat(semantic$m.space.inset.xs);
|
|
560
|
+
}, radius$5.full, count.lineHeight, ring.width, semantic$m.surface.base, scaleIn$2, semantic$m.motion.duration.moderate, semantic$m.motion.easing.decelerate, reducedMotion, function (props) {
|
|
561
|
+
return props.$isDot ? "".concat(forcedColors, " { forced-color-adjust: none; background-color: CanvasText; }") : "".concat(forcedColors, " { border: ").concat(semantic$m.border.width.thin, " solid currentColor; }");
|
|
562
562
|
}, function (props) {
|
|
563
563
|
switch (props.$variant) {
|
|
564
564
|
case 'accent':
|
|
565
565
|
case 'primary':
|
|
566
566
|
// Deprecated alias for 'accent', removed in 3.0 (#169)
|
|
567
|
-
return "\n background-color: ".concat(color$
|
|
567
|
+
return "\n background-color: ".concat(color$b.fill.accent, ";\n color: ").concat(color$b.text.inverse, ";\n ");
|
|
568
568
|
case 'error':
|
|
569
|
-
return "\n background-color: ".concat(color$
|
|
569
|
+
return "\n background-color: ".concat(color$b.fill.danger, ";\n color: ").concat(color$b.text.inverse, ";\n ");
|
|
570
570
|
case 'warning':
|
|
571
|
-
return "\n background-color: ".concat(color$
|
|
571
|
+
return "\n background-color: ".concat(color$b.fill.warning, ";\n color: ").concat(color$b.text.inverse, ";\n ");
|
|
572
572
|
case 'success':
|
|
573
|
-
return "\n background-color: ".concat(color$
|
|
573
|
+
return "\n background-color: ".concat(color$b.fill.success, ";\n color: ").concat(color$b.text.inverse, ";\n ");
|
|
574
574
|
default:
|
|
575
|
-
return "\n background-color: ".concat(color$
|
|
575
|
+
return "\n background-color: ".concat(color$b.fill.emphasis, ";\n color: ").concat(color$b.text.inverse, ";\n ");
|
|
576
576
|
}
|
|
577
577
|
});
|
|
578
578
|
var ScreenReaderOnly$1 = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
@@ -616,16 +616,16 @@ var Badge = function Badge(_a) {
|
|
|
616
616
|
})]
|
|
617
617
|
});
|
|
618
618
|
};
|
|
619
|
-
var templateObject_1$
|
|
619
|
+
var templateObject_1$L, templateObject_2$x, templateObject_3$u, templateObject_4$n;
|
|
620
620
|
|
|
621
621
|
// Props whose values are token keys keep their published vocabulary in 2.x (P7), but read the
|
|
622
622
|
// semantic grammar's names (decision 0031, #189). Each map covers every key the prop type allows,
|
|
623
623
|
// so TypeScript fails here if a key is added without a mapping.
|
|
624
|
-
var semantic$
|
|
625
|
-
var color$
|
|
626
|
-
space$e = semantic$
|
|
627
|
-
radius$4 = semantic$
|
|
628
|
-
surface = semantic$
|
|
624
|
+
var semantic$l = tokens.semantic;
|
|
625
|
+
var color$a = semantic$l.color,
|
|
626
|
+
space$e = semantic$l.space,
|
|
627
|
+
radius$4 = semantic$l.radius,
|
|
628
|
+
surface = semantic$l.surface;
|
|
629
629
|
/** Box's spacing props (`p`, `m`, `gap`…): the old layout scale's keys, read from `space`. */
|
|
630
630
|
var spaceByLayoutKey = {
|
|
631
631
|
none: space$e[0],
|
|
@@ -645,7 +645,7 @@ var spaceByLayoutKey = {
|
|
|
645
645
|
'10xl': space$e[2000],
|
|
646
646
|
'11xl': space$e[2400],
|
|
647
647
|
// A keyword, not a step: it stays until the keyword question is settled (0031)
|
|
648
|
-
auto: semantic$
|
|
648
|
+
auto: semantic$l.spacing.layout.auto
|
|
649
649
|
};
|
|
650
650
|
/** Box's `borderRadius` prop: the old radius keys, read from `radius`. */
|
|
651
651
|
var radiusByKey = {
|
|
@@ -665,73 +665,74 @@ var backgroundByKey = {
|
|
|
665
665
|
page: surface.base,
|
|
666
666
|
subtle: surface.raised,
|
|
667
667
|
overlay: surface.scrim,
|
|
668
|
-
emphasis: color$
|
|
669
|
-
'emphasis-hover': color$
|
|
670
|
-
'emphasis-active': color$
|
|
671
|
-
surface: color$
|
|
672
|
-
inverse: color$
|
|
673
|
-
interactive: color$
|
|
674
|
-
'interactive-hover': color$
|
|
675
|
-
'interactive-active': color$
|
|
676
|
-
'interactive-subtle': color$
|
|
677
|
-
'interactive-subtle-hover': color$
|
|
678
|
-
'interactive-subtle-active': color$
|
|
679
|
-
error: color$
|
|
680
|
-
'error-hover': color$
|
|
681
|
-
'error-active': color$
|
|
682
|
-
'error-subtle': color$
|
|
683
|
-
success: color$
|
|
684
|
-
'success-subtle': color$
|
|
685
|
-
warning: color$
|
|
686
|
-
'warning-subtle': color$
|
|
687
|
-
disabled: color$
|
|
688
|
-
neutral: color$
|
|
689
|
-
'neutral-hover': color$
|
|
690
|
-
'neutral-active': color$
|
|
691
|
-
transparent: color$
|
|
692
|
-
'hover-overlay': color$
|
|
693
|
-
'active-overlay': color$
|
|
694
|
-
'inverse-overlay': color$
|
|
668
|
+
emphasis: color$a.fill.emphasis,
|
|
669
|
+
'emphasis-hover': color$a.fill['emphasis-hover'],
|
|
670
|
+
'emphasis-active': color$a.fill['emphasis-pressed'],
|
|
671
|
+
surface: color$a.fill.muted,
|
|
672
|
+
inverse: color$a.fill.inverse,
|
|
673
|
+
interactive: color$a.fill.accent,
|
|
674
|
+
'interactive-hover': color$a.fill['accent-hover'],
|
|
675
|
+
'interactive-active': color$a.fill['accent-pressed'],
|
|
676
|
+
'interactive-subtle': color$a.fill['accent-muted'],
|
|
677
|
+
'interactive-subtle-hover': color$a.fill['accent-muted-hover'],
|
|
678
|
+
'interactive-subtle-active': color$a.fill['accent-muted-pressed'],
|
|
679
|
+
error: color$a.fill.danger,
|
|
680
|
+
'error-hover': color$a.fill['danger-hover'],
|
|
681
|
+
'error-active': color$a.fill['danger-pressed'],
|
|
682
|
+
'error-subtle': color$a.fill['danger-muted'],
|
|
683
|
+
success: color$a.fill.success,
|
|
684
|
+
'success-subtle': color$a.fill['success-muted'],
|
|
685
|
+
warning: color$a.fill.warning,
|
|
686
|
+
'warning-subtle': color$a.fill['warning-muted'],
|
|
687
|
+
disabled: color$a.fill.disabled,
|
|
688
|
+
neutral: color$a.fill["default"],
|
|
689
|
+
'neutral-hover': color$a.fill['default-hover'],
|
|
690
|
+
'neutral-active': color$a.fill['default-pressed'],
|
|
691
|
+
transparent: color$a.fill.none,
|
|
692
|
+
'hover-overlay': color$a.fill['none-hover'],
|
|
693
|
+
'active-overlay': color$a.fill['none-pressed'],
|
|
694
|
+
'inverse-overlay': color$a.fill['inverse-none-hover'],
|
|
695
695
|
// Moved to the component tier (decision 0031 §6)
|
|
696
696
|
progressTrack: tokens.component.track.background
|
|
697
697
|
};
|
|
698
698
|
/** Box's `color` prop: text colours, old and new keys. */
|
|
699
699
|
var textColorByKey = {
|
|
700
|
-
"default": color$
|
|
701
|
-
emphasis: color$
|
|
702
|
-
inverse: color$
|
|
703
|
-
disabled: color$
|
|
704
|
-
success: color$
|
|
705
|
-
warning: color$
|
|
706
|
-
muted: color$
|
|
707
|
-
accent: color$
|
|
708
|
-
'accent-hover': color$
|
|
709
|
-
'accent-pressed': color$
|
|
710
|
-
danger: color$
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
'interactive-
|
|
715
|
-
|
|
700
|
+
"default": color$a.text["default"],
|
|
701
|
+
emphasis: color$a.text.emphasis,
|
|
702
|
+
inverse: color$a.text.inverse,
|
|
703
|
+
disabled: color$a.text.disabled,
|
|
704
|
+
success: color$a.text.success,
|
|
705
|
+
warning: color$a.text.warning,
|
|
706
|
+
muted: color$a.text.muted,
|
|
707
|
+
accent: color$a.text.accent,
|
|
708
|
+
'accent-hover': color$a.text['accent-hover'],
|
|
709
|
+
'accent-pressed': color$a.text['accent-pressed'],
|
|
710
|
+
danger: color$a.text.danger,
|
|
711
|
+
ai: color$a.text.ai,
|
|
712
|
+
subdued: color$a.text.muted,
|
|
713
|
+
interactive: color$a.text.accent,
|
|
714
|
+
'interactive-hover': color$a.text['accent-hover'],
|
|
715
|
+
'interactive-active': color$a.text['accent-pressed'],
|
|
716
|
+
error: color$a.text.danger
|
|
716
717
|
};
|
|
717
718
|
/** Box's border props: border colours, old and new keys. */
|
|
718
719
|
var borderColorByKey = {
|
|
719
|
-
"default": color$
|
|
720
|
-
success: color$
|
|
721
|
-
warning: color$
|
|
722
|
-
none: color$
|
|
723
|
-
emphasis: color$
|
|
724
|
-
input: color$
|
|
725
|
-
'input-hover': color$
|
|
726
|
-
focus: color$
|
|
727
|
-
accent: color$
|
|
728
|
-
danger: color$
|
|
729
|
-
subtle: color$
|
|
730
|
-
control: color$
|
|
720
|
+
"default": color$a.border["default"],
|
|
721
|
+
success: color$a.border.success,
|
|
722
|
+
warning: color$a.border.warning,
|
|
723
|
+
none: color$a.border.none,
|
|
724
|
+
emphasis: color$a.border.emphasis,
|
|
725
|
+
input: color$a.border.input,
|
|
726
|
+
'input-hover': color$a.border['input-hover'],
|
|
727
|
+
focus: color$a.border.focus,
|
|
728
|
+
accent: color$a.border.accent,
|
|
729
|
+
danger: color$a.border.danger,
|
|
730
|
+
subtle: color$a.border.emphasis,
|
|
731
|
+
control: color$a.border.input,
|
|
731
732
|
// `strong` split by use (0031); as a generic firm outline it is the hovered-input border
|
|
732
|
-
strong: color$
|
|
733
|
-
interactive: color$
|
|
734
|
-
error: color$
|
|
733
|
+
strong: color$a.border['input-hover'],
|
|
734
|
+
interactive: color$a.border.accent,
|
|
735
|
+
error: color$a.border.danger
|
|
735
736
|
};
|
|
736
737
|
|
|
737
738
|
var StyledBox = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
@@ -743,9 +744,9 @@ var StyledBox = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
743
744
|
})(templateObject_51 || (templateObject_51 = __makeTemplateObject(["\n ", "\n \n // Flexbox\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Margin\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Padding\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Size\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Position\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Borders\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Background & Color\n ", "\n ", "\n \n // Elevation (shadow)\n ", "\n \n // Cursor\n ", "\n \n // Transition\n ", "\n \n // Hover states\n ", "\n \n // Overflow\n ", "\n ", "\n ", "\n"], ["\n ", "\n \n // Flexbox\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Margin\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Padding\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Size\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Position\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Borders\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n \n // Background & Color\n ", "\n ", "\n \n // Elevation (shadow)\n ", "\n \n // Cursor\n ", "\n \n // Transition\n ", "\n \n // Hover states\n ", "\n \n // Overflow\n ", "\n ", "\n ", "\n"
|
|
744
745
|
// Transform component that maps clean props to $-prefixed props for styled-components
|
|
745
746
|
])), function (props) {
|
|
746
|
-
return props.$display && styled.css(templateObject_1$
|
|
747
|
+
return props.$display && styled.css(templateObject_1$K || (templateObject_1$K = __makeTemplateObject(["display: ", ";"], ["display: ", ";"])), props.$display);
|
|
747
748
|
}, function (props) {
|
|
748
|
-
return props.$flexDirection && styled.css(templateObject_2$
|
|
749
|
+
return props.$flexDirection && styled.css(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["flex-direction: ", ";"], ["flex-direction: ", ";"])), props.$flexDirection);
|
|
749
750
|
}, function (props) {
|
|
750
751
|
return props.$justifyContent && styled.css(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["justify-content: ", ";"], ["justify-content: ", ";"])), props.$justifyContent);
|
|
751
752
|
}, function (props) {
|
|
@@ -779,35 +780,35 @@ var StyledBox = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
779
780
|
}, function (props) {
|
|
780
781
|
return props.$pl && styled.css(templateObject_18$2 || (templateObject_18$2 = __makeTemplateObject(["padding-left: ", ";"], ["padding-left: ", ";"])), spaceByLayoutKey[props.$pl]);
|
|
781
782
|
}, function (props) {
|
|
782
|
-
return props.$px && styled.css(templateObject_19$
|
|
783
|
+
return props.$px && styled.css(templateObject_19$2 || (templateObject_19$2 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n padding-left: ", ";\n padding-right: ", ";\n "])), spaceByLayoutKey[props.$px], spaceByLayoutKey[props.$px]);
|
|
783
784
|
}, function (props) {
|
|
784
|
-
return props.$py && styled.css(templateObject_20$
|
|
785
|
+
return props.$py && styled.css(templateObject_20$2 || (templateObject_20$2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n "])), spaceByLayoutKey[props.$py], spaceByLayoutKey[props.$py]);
|
|
785
786
|
}, function (props) {
|
|
786
|
-
return props.$width && styled.css(templateObject_21$
|
|
787
|
+
return props.$width && styled.css(templateObject_21$2 || (templateObject_21$2 = __makeTemplateObject(["width: ", ";"], ["width: ", ";"])), props.$width);
|
|
787
788
|
}, function (props) {
|
|
788
|
-
return props.$height && styled.css(templateObject_22$
|
|
789
|
+
return props.$height && styled.css(templateObject_22$2 || (templateObject_22$2 = __makeTemplateObject(["height: ", ";"], ["height: ", ";"])), props.$height);
|
|
789
790
|
}, function (props) {
|
|
790
|
-
return props.$maxWidth && styled.css(templateObject_23$
|
|
791
|
+
return props.$maxWidth && styled.css(templateObject_23$2 || (templateObject_23$2 = __makeTemplateObject(["max-width: ", ";"], ["max-width: ", ";"])), props.$maxWidth);
|
|
791
792
|
}, function (props) {
|
|
792
|
-
return props.$maxHeight && styled.css(templateObject_24$
|
|
793
|
+
return props.$maxHeight && styled.css(templateObject_24$2 || (templateObject_24$2 = __makeTemplateObject(["max-height: ", ";"], ["max-height: ", ";"])), props.$maxHeight);
|
|
793
794
|
}, function (props) {
|
|
794
|
-
return props.$minWidth && styled.css(templateObject_25$
|
|
795
|
+
return props.$minWidth && styled.css(templateObject_25$2 || (templateObject_25$2 = __makeTemplateObject(["min-width: ", ";"], ["min-width: ", ";"])), props.$minWidth);
|
|
795
796
|
}, function (props) {
|
|
796
|
-
return props.$minHeight && styled.css(templateObject_26$
|
|
797
|
+
return props.$minHeight && styled.css(templateObject_26$2 || (templateObject_26$2 = __makeTemplateObject(["min-height: ", ";"], ["min-height: ", ";"])), props.$minHeight);
|
|
797
798
|
}, function (props) {
|
|
798
|
-
return props.$position && styled.css(templateObject_27$
|
|
799
|
+
return props.$position && styled.css(templateObject_27$2 || (templateObject_27$2 = __makeTemplateObject(["position: ", ";"], ["position: ", ";"])), props.$position);
|
|
799
800
|
}, function (props) {
|
|
800
|
-
return props.$top && styled.css(templateObject_28$
|
|
801
|
+
return props.$top && styled.css(templateObject_28$2 || (templateObject_28$2 = __makeTemplateObject(["top: ", ";"], ["top: ", ";"])), props.$top);
|
|
801
802
|
}, function (props) {
|
|
802
|
-
return props.$right && styled.css(templateObject_29$
|
|
803
|
+
return props.$right && styled.css(templateObject_29$2 || (templateObject_29$2 = __makeTemplateObject(["right: ", ";"], ["right: ", ";"])), props.$right);
|
|
803
804
|
}, function (props) {
|
|
804
|
-
return props.$bottom && styled.css(templateObject_30$
|
|
805
|
+
return props.$bottom && styled.css(templateObject_30$2 || (templateObject_30$2 = __makeTemplateObject(["bottom: ", ";"], ["bottom: ", ";"])), props.$bottom);
|
|
805
806
|
}, function (props) {
|
|
806
|
-
return props.$left && styled.css(templateObject_31$
|
|
807
|
+
return props.$left && styled.css(templateObject_31$2 || (templateObject_31$2 = __makeTemplateObject(["left: ", ";"], ["left: ", ";"])), props.$left);
|
|
807
808
|
}, function (props) {
|
|
808
|
-
return props.$borderRadius && styled.css(templateObject_32$
|
|
809
|
+
return props.$borderRadius && styled.css(templateObject_32$2 || (templateObject_32$2 = __makeTemplateObject(["border-radius: ", ";"], ["border-radius: ", ";"])), radiusByKey[props.$borderRadius]);
|
|
809
810
|
}, function (props) {
|
|
810
|
-
return props.$border && styled.css(templateObject_33$
|
|
811
|
+
return props.$border && styled.css(templateObject_33$2 || (templateObject_33$2 = __makeTemplateObject(["border: ", " solid ", ";"], ["border: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$border]);
|
|
811
812
|
}, function (props) {
|
|
812
813
|
return props.$borderTop && styled.css(templateObject_34$1 || (templateObject_34$1 = __makeTemplateObject(["border-top: ", " solid ", ";"], ["border-top: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderTop]);
|
|
813
814
|
}, function (props) {
|
|
@@ -967,7 +968,7 @@ var BoxTransform = function BoxTransform(props) {
|
|
|
967
968
|
}));
|
|
968
969
|
};
|
|
969
970
|
var Box = BoxTransform;
|
|
970
|
-
var templateObject_1$
|
|
971
|
+
var templateObject_1$K, templateObject_2$w, templateObject_3$t, templateObject_4$m, templateObject_5$i, templateObject_6$d, templateObject_7$b, templateObject_8$8, templateObject_9$6, templateObject_10$4, templateObject_11$4, templateObject_12$4, templateObject_13$4, templateObject_14$2, templateObject_15$2, templateObject_16$2, templateObject_17$2, templateObject_18$2, templateObject_19$2, templateObject_20$2, templateObject_21$2, templateObject_22$2, templateObject_23$2, templateObject_24$2, templateObject_25$2, templateObject_26$2, templateObject_27$2, templateObject_28$2, templateObject_29$2, templateObject_30$2, templateObject_31$2, templateObject_32$2, templateObject_33$2, templateObject_34$1, templateObject_35$1, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50, templateObject_51;
|
|
971
972
|
|
|
972
973
|
var IconStyled = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
973
974
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -975,7 +976,7 @@ var IconStyled = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
975
976
|
},
|
|
976
977
|
displayName: "Icon__IconStyled",
|
|
977
978
|
componentId: "sc-1105czq-0"
|
|
978
|
-
})(templateObject_1$
|
|
979
|
+
})(templateObject_1$J || (templateObject_1$J = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n \n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n \n /* Use semantic icon colors */\n color: ", ";\n"])), function (_a) {
|
|
979
980
|
var $size = _a.$size;
|
|
980
981
|
return tokens.semantic.size.icon[$size];
|
|
981
982
|
}, function (_a) {
|
|
@@ -1052,17 +1053,17 @@ var Icon = function Icon(_a) {
|
|
|
1052
1053
|
}))
|
|
1053
1054
|
});
|
|
1054
1055
|
};
|
|
1055
|
-
var templateObject_1$
|
|
1056
|
+
var templateObject_1$J;
|
|
1056
1057
|
|
|
1057
1058
|
var button$1 = tokens.component.button,
|
|
1058
|
-
semantic$
|
|
1059
|
+
semantic$k = tokens.semantic;
|
|
1059
1060
|
// Height comes from size.control as a minimum and the content is centred, so there is no
|
|
1060
1061
|
// vertical padding (decision 0034). Horizontal padding comes from the semantic spacing scale:
|
|
1061
1062
|
// no component spacing tokens (decision 0022)
|
|
1062
|
-
var inset = semantic$
|
|
1063
|
-
var control$1 = semantic$
|
|
1063
|
+
var inset = semantic$k.space.inset;
|
|
1064
|
+
var control$1 = semantic$k.size.control;
|
|
1064
1065
|
// Base styles shared between button and link
|
|
1065
|
-
var baseButtonStyles = "\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ".concat(tokens.semantic.space[100], ";\n height: max-content;\n cursor: pointer;\n border: none;\n text-decoration: none;\n transition: ").concat(semantic$
|
|
1066
|
+
var baseButtonStyles = "\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ".concat(tokens.semantic.space[100], ";\n height: max-content;\n cursor: pointer;\n border: none;\n text-decoration: none;\n transition: ").concat(semantic$k.motion.transition.feedback, ";\n white-space: nowrap;\n user-select: none;\n \n &:focus {\n outline: ").concat(button$1.focus.outline, ";\n outline-offset: ").concat(semantic$k.border.focusOffset, ";\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ").concat(forcedColorsEdge, "\n");
|
|
1066
1067
|
// Dynamic variant styles using component tokens
|
|
1067
1068
|
var getVariantStyles$1 = function getVariantStyles(_a) {
|
|
1068
1069
|
var $variant = _a.$variant;
|
|
@@ -1139,14 +1140,14 @@ var StyledButton = /*#__PURE__*/styled__default.default.button.withConfig({
|
|
|
1139
1140
|
},
|
|
1140
1141
|
displayName: "Button__StyledButton",
|
|
1141
1142
|
componentId: "sc-1eiuum9-0"
|
|
1142
|
-
})(templateObject_1$
|
|
1143
|
+
})(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"], ["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"])), baseButtonStyles, button$1.primary.borderRadius, getVariantStyles$1, getSizeStyles);
|
|
1143
1144
|
var StyledLink = /*#__PURE__*/styled__default.default.a.withConfig({
|
|
1144
1145
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
1145
1146
|
return !prop.startsWith('$');
|
|
1146
1147
|
},
|
|
1147
1148
|
displayName: "Button__StyledLink",
|
|
1148
1149
|
componentId: "sc-1eiuum9-1"
|
|
1149
|
-
})(templateObject_2$
|
|
1150
|
+
})(templateObject_2$v || (templateObject_2$v = __makeTemplateObject(["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"], ["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"
|
|
1150
1151
|
// Helper function to get icon size based on button size
|
|
1151
1152
|
])), baseButtonStyles, button$1.primary.borderRadius, getVariantStyles$1, getSizeStyles);
|
|
1152
1153
|
// Helper function to get icon size based on button size
|
|
@@ -1249,15 +1250,15 @@ var Button = function Button(_a) {
|
|
|
1249
1250
|
children: renderButtonContent(children, iconName, size)
|
|
1250
1251
|
}));
|
|
1251
1252
|
};
|
|
1252
|
-
var templateObject_1$
|
|
1253
|
+
var templateObject_1$I, templateObject_2$v;
|
|
1253
1254
|
|
|
1254
|
-
var semantic$
|
|
1255
|
-
var color$
|
|
1255
|
+
var semantic$j = tokens.semantic;
|
|
1256
|
+
var color$9 = semantic$j.color;
|
|
1256
1257
|
var label$2 = tokens.component.badge.label;
|
|
1257
|
-
var category = color$
|
|
1258
|
-
var radius$3 = semantic$
|
|
1259
|
-
var space$d = semantic$
|
|
1260
|
-
var labelHeight$1 = semantic$
|
|
1258
|
+
var category = color$9.category;
|
|
1259
|
+
var radius$3 = semantic$j.radius;
|
|
1260
|
+
var space$d = semantic$j.space;
|
|
1261
|
+
var labelHeight$1 = semantic$j.size.label;
|
|
1261
1262
|
// Text on white or the -subtle fill (outlined and minimal), at least 4.5:1 (#115)
|
|
1262
1263
|
var categoryText = {
|
|
1263
1264
|
blue: category['blue-text'],
|
|
@@ -1275,10 +1276,10 @@ var StyledCategoryLabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
1275
1276
|
},
|
|
1276
1277
|
displayName: "CategoryLabel__StyledCategoryLabel",
|
|
1277
1278
|
componentId: "sc-1jx7bjo-0"
|
|
1278
|
-
})(templateObject_1$
|
|
1279
|
+
})(templateObject_1$H || (templateObject_1$H = __makeTemplateObject(["\n box-sizing: border-box; /* the height includes padding and border, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n white-space: nowrap;\n user-select: none;\n border-style: solid;\n border-width: ", ";\n \n /* Size styles */\n height: ", ";\n padding: ", ";\n font: ", ";\n /* After the font shorthand, which would otherwise reset it */\n font-weight: ", ";\n gap: ", ";\n \n /* Variant + Color styles */\n background-color: ", ";\n \n /* Outlined and minimal text uses the AA text token, not the base colour (issue 115) */\n color: ", ";\n \n border-color: ", ";\n"], ["\n box-sizing: border-box; /* the height includes padding and border, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n white-space: nowrap;\n user-select: none;\n border-style: solid;\n border-width: ", ";\n \n /* Size styles */\n height: ", ";\n padding: ", ";\n font: ", ";\n /* After the font shorthand, which would otherwise reset it */\n font-weight: ", ";\n gap: ", ";\n \n /* Variant + Color styles */\n background-color: ", ";\n \n /* Outlined and minimal text uses the AA text token, not the base colour (issue 115) */\n color: ", ";\n \n border-color: ", ";\n"
|
|
1279
1280
|
// The visible content, hidden from assistive technology when an aria-label replaces it.
|
|
1280
1281
|
// display: contents keeps the root's flex layout and gap.
|
|
1281
|
-
])), radius$3.full, semantic$
|
|
1282
|
+
])), radius$3.full, semantic$j.border.width.thin, function (_a) {
|
|
1282
1283
|
var $size = _a.$size;
|
|
1283
1284
|
return labelHeight$1[$size];
|
|
1284
1285
|
}, function (_a) {
|
|
@@ -1302,7 +1303,7 @@ var StyledCategoryLabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
1302
1303
|
var $color = _a.$color,
|
|
1303
1304
|
$variant = _a.$variant;
|
|
1304
1305
|
if ($variant === 'filled') {
|
|
1305
|
-
return color$
|
|
1306
|
+
return color$9.text.inverse;
|
|
1306
1307
|
}
|
|
1307
1308
|
return categoryText[$color];
|
|
1308
1309
|
}, function (_a) {
|
|
@@ -1318,7 +1319,7 @@ var StyledCategoryLabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
1318
1319
|
var VisibleContent$1 = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
1319
1320
|
displayName: "CategoryLabel__VisibleContent",
|
|
1320
1321
|
componentId: "sc-1jx7bjo-1"
|
|
1321
|
-
})(templateObject_2$
|
|
1322
|
+
})(templateObject_2$u || (templateObject_2$u = __makeTemplateObject(["\n display: contents;\n"], ["\n display: contents;\n"])));
|
|
1322
1323
|
var HiddenLabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
1323
1324
|
displayName: "CategoryLabel__HiddenLabel",
|
|
1324
1325
|
componentId: "sc-1jx7bjo-2"
|
|
@@ -1389,7 +1390,7 @@ var CategoryLabel = function CategoryLabel(_a) {
|
|
|
1389
1390
|
});
|
|
1390
1391
|
};
|
|
1391
1392
|
CategoryLabel.displayName = 'CategoryLabel';
|
|
1392
|
-
var templateObject_1$
|
|
1393
|
+
var templateObject_1$H, templateObject_2$u, templateObject_3$s;
|
|
1393
1394
|
|
|
1394
1395
|
// CategoryBadge sizes on the decision 0018 scale
|
|
1395
1396
|
var toLabelSize = {
|
|
@@ -1413,8 +1414,8 @@ var CategoryBadge = function CategoryBadge(_a) {
|
|
|
1413
1414
|
};
|
|
1414
1415
|
CategoryBadge.displayName = 'CategoryBadge';
|
|
1415
1416
|
|
|
1416
|
-
var chip$
|
|
1417
|
-
semantic$
|
|
1417
|
+
var chip$2 = tokens.component.chip,
|
|
1418
|
+
semantic$i = tokens.semantic;
|
|
1418
1419
|
// Helper function to get variant styles matching Button's approach
|
|
1419
1420
|
var getVariantStyles = function getVariantStyles(_a) {
|
|
1420
1421
|
var $variant = _a.$variant,
|
|
@@ -1427,7 +1428,7 @@ var getVariantStyles = function getVariantStyles(_a) {
|
|
|
1427
1428
|
// A selected disabled chip looks like any disabled chip; the checkmark keeps the
|
|
1428
1429
|
// selected state visible (#110)
|
|
1429
1430
|
if ($disabled) {
|
|
1430
|
-
var disabled = chip$
|
|
1431
|
+
var disabled = chip$2.variants.subtle.disabled;
|
|
1431
1432
|
return "\n background-color: ".concat(disabled.backgroundColor, ";\n color: ").concat(disabled.textColor, ";\n ");
|
|
1432
1433
|
}
|
|
1433
1434
|
var _b = tokens.semantic.color,
|
|
@@ -1438,23 +1439,23 @@ var getVariantStyles = function getVariantStyles(_a) {
|
|
|
1438
1439
|
}
|
|
1439
1440
|
switch ($variant) {
|
|
1440
1441
|
case 'emphasis':
|
|
1441
|
-
return "\n background-color: ".concat(chip$
|
|
1442
|
+
return "\n background-color: ".concat(chip$2.variants.emphasis.backgroundColor, ";\n color: ").concat(chip$2.variants.emphasis.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip$2.variants.emphasis.disabled.backgroundColor : $clickable ? chip$2.variants.emphasis.hover.backgroundColor : chip$2.variants.emphasis.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip$2.variants.emphasis.disabled.backgroundColor : $clickable ? chip$2.variants.emphasis.active.backgroundColor : chip$2.variants.emphasis.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip$2.variants.emphasis.disabled.backgroundColor, ";\n color: ").concat(chip$2.variants.emphasis.disabled.textColor, ";\n ") : '', "\n ");
|
|
1442
1443
|
case 'subtle':
|
|
1443
|
-
return "\n background-color: ".concat(chip$
|
|
1444
|
+
return "\n background-color: ".concat(chip$2.variants.subtle.backgroundColor, ";\n color: ").concat(chip$2.variants.subtle.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip$2.variants.subtle.disabled.backgroundColor : $clickable ? chip$2.variants.subtle.hover.backgroundColor : chip$2.variants.subtle.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip$2.variants.subtle.disabled.backgroundColor : $clickable ? chip$2.variants.subtle.active.backgroundColor : chip$2.variants.subtle.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip$2.variants.subtle.disabled.backgroundColor, ";\n color: ").concat(chip$2.variants.subtle.disabled.textColor, ";\n ") : '', "\n ");
|
|
1444
1445
|
case 'interactive':
|
|
1445
|
-
return "\n background-color: ".concat(chip$
|
|
1446
|
+
return "\n background-color: ".concat(chip$2.variants.interactive.backgroundColor, ";\n color: ").concat(chip$2.variants.interactive.textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip$2.variants.interactive.disabled.backgroundColor : $clickable ? chip$2.variants.interactive.hover.backgroundColor : chip$2.variants.interactive.backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip$2.variants.interactive.disabled.backgroundColor : $clickable ? chip$2.variants.interactive.active.backgroundColor : chip$2.variants.interactive.backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip$2.variants.interactive.disabled.backgroundColor, ";\n color: ").concat(chip$2.variants.interactive.disabled.textColor, ";\n ") : '', "\n ");
|
|
1446
1447
|
case 'default':
|
|
1447
1448
|
default:
|
|
1448
|
-
return "\n background-color: ".concat(chip$
|
|
1449
|
+
return "\n background-color: ".concat(chip$2["default"].backgroundColor, ";\n color: ").concat(chip$2["default"].textColor, ";\n \n &:hover {\n background-color: ").concat($disabled ? chip$2.disabled.backgroundColor : $clickable ? chip$2.hover.backgroundColor : chip$2["default"].backgroundColor, ";\n }\n \n &:active {\n background-color: ").concat($disabled ? chip$2.disabled.backgroundColor : $clickable ? chip$2.active.backgroundColor : chip$2["default"].backgroundColor, ";\n }\n \n ").concat($disabled ? "\n background-color: ".concat(chip$2.disabled.backgroundColor, ";\n color: ").concat(chip$2.disabled.textColor, ";\n ") : '', "\n ");
|
|
1449
1450
|
}
|
|
1450
1451
|
};
|
|
1451
1452
|
// Chips have one size: 24px from the label scale as a minimum, with the content centred
|
|
1452
1453
|
// and no vertical padding (decisions 0034 and 0035). Horizontal padding comes from the
|
|
1453
1454
|
// semantic spacing scale (decision 0022).
|
|
1454
|
-
var sizeStyles = "\n font: ".concat(chip$
|
|
1455
|
+
var sizeStyles = "\n font: ".concat(chip$2.sizes.medium.font, ";\n min-height: ").concat(semantic$i.size.label.medium, ";\n padding: 0 ").concat(semantic$i.space.inset.sm, ";\n");
|
|
1455
1456
|
|
|
1456
|
-
var chip = tokens.component.chip,
|
|
1457
|
-
semantic$
|
|
1457
|
+
var chip$1 = tokens.component.chip,
|
|
1458
|
+
semantic$h = tokens.semantic;
|
|
1458
1459
|
// Base styled component using direct prop interpolation like Button
|
|
1459
1460
|
var StyledChip = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
1460
1461
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -1462,18 +1463,18 @@ var StyledChip = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
1462
1463
|
},
|
|
1463
1464
|
displayName: "ChipBase__StyledChip",
|
|
1464
1465
|
componentId: "sc-moa6zc-0"
|
|
1465
|
-
})(templateObject_1$
|
|
1466
|
+
})(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: ", ";\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n cursor: ", ";\n \n /* Forced colours: an edge, and GrayText when disabled, since a span gets no system disabled\n colour (decision 0038). Before the variant styles, so a selected chip's Highlight border wins. */\n ", "\n ", "\n\n ", "\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: ", ";\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n cursor: ", ";\n \n /* Forced colours: an edge, and GrayText when disabled, since a span gets no system disabled\n colour (decision 0038). Before the variant styles, so a selected chip's Highlight border wins. */\n ", "\n ", "\n\n ", "\n ", "\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n"
|
|
1466
1467
|
// Icon container for selected indicator or leading icons
|
|
1467
|
-
])), chip["default"].borderRadius, semantic$
|
|
1468
|
+
])), chip$1["default"].borderRadius, semantic$h.motion.transition.feedback, function (props) {
|
|
1468
1469
|
return props.$disabled ? 'not-allowed' : props.$clickable ? 'pointer' : 'default';
|
|
1469
1470
|
}, forcedColorsEdge, function (props) {
|
|
1470
1471
|
return props.$disabled ? "".concat(forcedColors, " { color: GrayText; }") : '';
|
|
1471
|
-
}, getVariantStyles, sizeStyles, chip.focus.outline, semantic$
|
|
1472
|
+
}, getVariantStyles, sizeStyles, chip$1.focus.outline, semantic$h.border.focusOffset);
|
|
1472
1473
|
// Icon container for selected indicator or leading icons
|
|
1473
1474
|
var IconContainer = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
1474
1475
|
displayName: "ChipBase__IconContainer",
|
|
1475
1476
|
componentId: "sc-moa6zc-1"
|
|
1476
|
-
})(templateObject_2$
|
|
1477
|
+
})(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n margin-right: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n margin-right: ", ";\n"
|
|
1477
1478
|
// Close button for dismissible chips
|
|
1478
1479
|
])), tokens.semantic.space[100]);
|
|
1479
1480
|
// Close button for dismissible chips
|
|
@@ -1483,10 +1484,10 @@ var CloseButton = /*#__PURE__*/styled__default.default.button.withConfig({
|
|
|
1483
1484
|
},
|
|
1484
1485
|
displayName: "ChipBase__CloseButton",
|
|
1485
1486
|
componentId: "sc-moa6zc-2"
|
|
1486
|
-
})(templateObject_3$r || (templateObject_3$r = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"])), tokens.semantic.space[200], chip.closeButton.size, chip.closeButton.size, tokens.semantic.space[0], semantic$
|
|
1487
|
+
})(templateObject_3$r || (templateObject_3$r = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n margin-left: ", ";\n background: transparent;\n border: none;\n position: relative;\n width: ", ";\n height: ", ";\n padding: ", ";\n\n /* The pointer target is at least 24 \xD7 24px (WCAG 2.5.8, decision 0039): an invisible hit area\n as tall as the chip, centred on the 20px button. It stays inside the chip and its padding, so\n it can't overlap another target. */\n &::before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: ", ";\n height: ", ";\n transform: translate(-50%, -50%);\n }\n border-radius: ", ";\n cursor: ", ";\n color: inherit;\n transition: ", ";\n \n &:hover:not(:disabled) {\n background-color: ", ";\n }\n \n &:active:not(:disabled) {\n background-color: ", ";\n }\n \n &:disabled {\n color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n border-radius: ", ";\n }\n"])), tokens.semantic.space[200], chip$1.closeButton.size, chip$1.closeButton.size, tokens.semantic.space[0], semantic$h.size.label.medium, semantic$h.size.label.medium, tokens.semantic.radius.xs, function (props) {
|
|
1487
1488
|
return props.$disabled ? 'not-allowed' : 'pointer';
|
|
1488
|
-
}, semantic$
|
|
1489
|
-
var templateObject_1$
|
|
1489
|
+
}, semantic$h.motion.transition.feedback, tokens.semantic.color.fill['none-hover'], tokens.semantic.color.fill['none-pressed'], tokens.semantic.color.text.disabled, chip$1.focus.outline, semantic$h.border.focusOffset, chip$1["default"].borderRadius);
|
|
1490
|
+
var templateObject_1$G, templateObject_2$t, templateObject_3$r;
|
|
1490
1491
|
|
|
1491
1492
|
/**
|
|
1492
1493
|
* Chip - a static, non-interactive label for tags, categories and metadata.
|
|
@@ -1723,11 +1724,61 @@ var BooleanChip = function BooleanChip(_a) {
|
|
|
1723
1724
|
}));
|
|
1724
1725
|
};
|
|
1725
1726
|
|
|
1727
|
+
var chip = tokens.component.chip,
|
|
1728
|
+
semantic$g = tokens.semantic;
|
|
1729
|
+
var color$8 = semantic$g.color;
|
|
1730
|
+
// Outlined, with the naked fill ladder on hover and press (decisions 0030, 0046): the edge keeps it
|
|
1731
|
+
// visible on white, the page and AgentInput's docked band
|
|
1732
|
+
var StyledSuggestionChip = /*#__PURE__*/styled__default.default.button.withConfig({
|
|
1733
|
+
displayName: "SuggestionChip__StyledSuggestionChip",
|
|
1734
|
+
componentId: "sc-1k0njm-0"
|
|
1735
|
+
})(templateObject_1$F || (templateObject_1$F = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n margin: 0;\n box-sizing: border-box;\n border: ", " solid ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n cursor: pointer;\n text-align: start;\n /* A long suggestion wraps inside the chip rather than being cut off (issue 279) */\n white-space: normal;\n overflow-wrap: anywhere;\n transition: ", ";\n ", "\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n /* Forced colours: a native button gets ButtonBorder and GrayText; keep the edge (decision 0038) */\n ", " {\n border-color: ButtonBorder;\n\n &:disabled {\n border-color: GrayText;\n }\n }\n"], ["\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n margin: 0;\n box-sizing: border-box;\n border: ", " solid ", ";\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n cursor: pointer;\n text-align: start;\n /* A long suggestion wraps inside the chip rather than being cut off (issue 279) */\n white-space: normal;\n overflow-wrap: anywhere;\n transition: ", ";\n ", "\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n border-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n /* Forced colours: a native button gets ButtonBorder and GrayText; keep the edge (decision 0038) */\n ", " {\n border-color: ButtonBorder;\n\n &:disabled {\n border-color: GrayText;\n }\n }\n"
|
|
1736
|
+
/**
|
|
1737
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
1738
|
+
*
|
|
1739
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
1740
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
1741
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
1742
|
+
*
|
|
1743
|
+
* Features:
|
|
1744
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
1745
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
1746
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
1747
|
+
*/])), semantic$g.border.width.thin, color$8.border.input, chip["default"].borderRadius, color$8.fill.none, color$8.text["default"], semantic$g.motion.transition.feedback, sizeStyles, color$8.fill['none-hover'], color$8.fill['none-pressed'], chip.focus.outline, semantic$g.border.focusOffset, color$8.border.emphasis, color$8.text.disabled, forcedColors);
|
|
1748
|
+
/**
|
|
1749
|
+
* SuggestionChip - Offers text to put in the agent input
|
|
1750
|
+
*
|
|
1751
|
+
* The Suggestion chip type from decision 0046 (amending 0016): the one chip that acts on click.
|
|
1752
|
+
* Picking it fills the input so the user can edit before sending; it never sends or runs a command,
|
|
1753
|
+
* which is why it's a chip and not a Button. AgentInput renders these from its `suggestions` prop.
|
|
1754
|
+
*
|
|
1755
|
+
* Features:
|
|
1756
|
+
* - A native button: Enter and Space pick it, and its text is its accessible name
|
|
1757
|
+
* - Outlined, with the naked hover and pressed fills; no selected state
|
|
1758
|
+
* - One chip height (24px minimum, decision 0035); long text wraps instead of being cut off
|
|
1759
|
+
*/
|
|
1760
|
+
var SuggestionChip = function SuggestionChip(_a) {
|
|
1761
|
+
var children = _a.children,
|
|
1762
|
+
onClick = _a.onClick,
|
|
1763
|
+
_b = _a.disabled,
|
|
1764
|
+
disabled = _b === void 0 ? false : _b,
|
|
1765
|
+
dataTestId = _a["data-testid"];
|
|
1766
|
+
return jsxRuntime.jsx(StyledSuggestionChip, {
|
|
1767
|
+
type: "button",
|
|
1768
|
+
onClick: onClick,
|
|
1769
|
+
disabled: disabled,
|
|
1770
|
+
"data-testid": dataTestId,
|
|
1771
|
+
children: children
|
|
1772
|
+
});
|
|
1773
|
+
};
|
|
1774
|
+
SuggestionChip.displayName = 'SuggestionChip';
|
|
1775
|
+
var templateObject_1$F;
|
|
1776
|
+
|
|
1726
1777
|
var space$c = tokens.semantic.space;
|
|
1727
1778
|
var StyledContainer$2 = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
1728
1779
|
displayName: "Container__StyledContainer",
|
|
1729
1780
|
componentId: "sc-17dbj6n-0"
|
|
1730
|
-
})(templateObject_1$
|
|
1781
|
+
})(templateObject_1$E || (templateObject_1$E = __makeTemplateObject(["\n width: 100%;\n margin-left: auto;\n margin-right: auto;\n padding-left: ", ";\n padding-right: ", ";\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n"], ["\n width: 100%;\n margin-left: auto;\n margin-right: auto;\n padding-left: ", ";\n padding-right: ", ";\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n \n ", " {\n max-width: ", ";\n }\n"])), space$c[600], space$c[600], media$1.sm, breakpoints$1.sm, media$1.md, breakpoints$1.md, media$1.lg, breakpoints$1.lg, media$1.xl, breakpoints$1.xl, media$1['2xl'], breakpoints$1['2xl']);
|
|
1731
1782
|
var Container$1 = function Container(_a) {
|
|
1732
1783
|
var children = _a.children,
|
|
1733
1784
|
props = __rest(_a, ["children"]);
|
|
@@ -1735,12 +1786,12 @@ var Container$1 = function Container(_a) {
|
|
|
1735
1786
|
children: children
|
|
1736
1787
|
}));
|
|
1737
1788
|
};
|
|
1738
|
-
var templateObject_1$
|
|
1789
|
+
var templateObject_1$E;
|
|
1739
1790
|
|
|
1740
1791
|
var PictureWrapper = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
1741
1792
|
displayName: "Picture__PictureWrapper",
|
|
1742
1793
|
componentId: "sc-11d9tei-0"
|
|
1743
|
-
})(templateObject_1$
|
|
1794
|
+
})(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n margin: 0 auto;\n \n ", " {\n margin-left: 0;\n margin-right: 0;\n }\n"], ["\n margin: 0 auto;\n \n ", " {\n margin-left: 0;\n margin-right: 0;\n }\n"
|
|
1744
1795
|
// A clickable image answers input on the image itself (decision 0029, #185): it fades on hover and
|
|
1745
1796
|
// one step further while pressed, and draws the system focus ring around the image, following its
|
|
1746
1797
|
// rounded corners. Fading isn't movement, so it stays under reduced motion.
|
|
@@ -1748,7 +1799,7 @@ var PictureWrapper = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
1748
1799
|
// A clickable image answers input on the image itself (decision 0029, #185): it fades on hover and
|
|
1749
1800
|
// one step further while pressed, and draws the system focus ring around the image, following its
|
|
1750
1801
|
// rounded corners. Fading isn't movement, so it stays under reduced motion.
|
|
1751
|
-
var clickableImage = styled.css(templateObject_2$
|
|
1802
|
+
var clickableImage = styled.css(templateObject_2$s || (templateObject_2$s = __makeTemplateObject(["\n display: block;\n cursor: pointer;\n\n img {\n transition: ", ";\n }\n\n &:hover img {\n opacity: ", ";\n }\n\n &:active img {\n opacity: ", ";\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible img {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n display: block;\n cursor: pointer;\n\n img {\n transition: ", ";\n }\n\n &:hover img {\n opacity: ", ";\n }\n\n &:active img {\n opacity: ", ";\n }\n\n &:focus-visible {\n outline: none;\n }\n\n &:focus-visible img {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), tokens.semantic.motion.transition.press, tokens.semantic.opacity.hover, tokens.semantic.opacity.pressed, tokens.semantic.border.focus, tokens.semantic.border.focusOffset);
|
|
1752
1803
|
var ImageLink = /*#__PURE__*/styled__default.default.a.withConfig({
|
|
1753
1804
|
displayName: "Picture__ImageLink",
|
|
1754
1805
|
componentId: "sc-11d9tei-1"
|
|
@@ -1790,18 +1841,18 @@ var Picture = function Picture(_a) {
|
|
|
1790
1841
|
}) : image
|
|
1791
1842
|
});
|
|
1792
1843
|
};
|
|
1793
|
-
var templateObject_1$
|
|
1844
|
+
var templateObject_1$D, templateObject_2$s, templateObject_3$q, templateObject_4$l, templateObject_5$h;
|
|
1794
1845
|
|
|
1795
1846
|
var _a$8 = tokens.semantic,
|
|
1796
|
-
typography$
|
|
1797
|
-
color$
|
|
1847
|
+
typography$2 = _a$8.typography,
|
|
1848
|
+
color$7 = _a$8.color;
|
|
1798
1849
|
var TimeStyled = /*#__PURE__*/styled__default.default.time.withConfig({
|
|
1799
1850
|
displayName: "DateFormatter__TimeStyled",
|
|
1800
1851
|
componentId: "sc-5464cc-0"
|
|
1801
|
-
})(templateObject_1$
|
|
1852
|
+
})(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n"], ["\n font: ", ";\n color: ", ";\n"
|
|
1802
1853
|
/**
|
|
1803
1854
|
* Formats a date with smart relative/absolute logic
|
|
1804
|
-
*/])), typography$
|
|
1855
|
+
*/])), typography$2.label, color$7.text.muted);
|
|
1805
1856
|
/**
|
|
1806
1857
|
* Formats a date with smart relative/absolute logic
|
|
1807
1858
|
*/
|
|
@@ -1844,21 +1895,21 @@ var DateFormatter = function DateFormatter(_a) {
|
|
|
1844
1895
|
children: displayText
|
|
1845
1896
|
});
|
|
1846
1897
|
};
|
|
1847
|
-
var templateObject_1$
|
|
1898
|
+
var templateObject_1$C;
|
|
1848
1899
|
|
|
1849
1900
|
var _a$7 = tokens.semantic,
|
|
1850
1901
|
motion$5 = _a$7.motion,
|
|
1851
1902
|
border$3 = _a$7.border,
|
|
1852
1903
|
space$b = _a$7.space,
|
|
1853
|
-
size$
|
|
1904
|
+
size$3 = _a$7.size,
|
|
1854
1905
|
_b$2 = tokens.component,
|
|
1855
1906
|
iconButton = _b$2.iconButton,
|
|
1856
1907
|
button = _b$2.button;
|
|
1857
1908
|
// Height and width come from size.control as a minimum (decision 0034)
|
|
1858
1909
|
var control = {
|
|
1859
|
-
small: size$
|
|
1860
|
-
medium: size$
|
|
1861
|
-
large: size$
|
|
1910
|
+
small: size$3.control.sm,
|
|
1911
|
+
medium: size$3.control.md,
|
|
1912
|
+
large: size$3.control.lg
|
|
1862
1913
|
};
|
|
1863
1914
|
// Padding comes from the semantic spacing scale: no component spacing tokens (decision 0022)
|
|
1864
1915
|
var padding = {
|
|
@@ -1905,7 +1956,7 @@ var IconButtonStyled = /*#__PURE__*/styled__default.default.button.withConfig({
|
|
|
1905
1956
|
},
|
|
1906
1957
|
displayName: "IconButton__IconButtonStyled",
|
|
1907
1958
|
componentId: "sc-k8b14t-0"
|
|
1908
|
-
})(templateObject_1$
|
|
1959
|
+
})(templateObject_1$B || (templateObject_1$B = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n border: none;\n border-radius: ", ";\n transition: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n height: max-content;\n cursor: pointer;\n position: relative;\n\n min-width: ", ";\n min-height: ", ";\n padding: ", ";\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n ", "\n"], ["\n background-color: ", ";\n color: ", ";\n border: none;\n border-radius: ", ";\n transition: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n height: max-content;\n cursor: pointer;\n position: relative;\n\n min-width: ", ";\n min-height: ", ";\n padding: ", ";\n\n &:hover:not(:disabled) {\n background-color: ", ";\n }\n\n &:active:not(:disabled) {\n background-color: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n color: ", ";\n cursor: not-allowed;\n }\n\n ", "\n"])), function (_a) {
|
|
1909
1960
|
var $variant = _a.$variant;
|
|
1910
1961
|
return colours($variant).bg;
|
|
1911
1962
|
}, function (_a) {
|
|
@@ -1983,7 +2034,7 @@ var IconButton = function IconButton(_a) {
|
|
|
1983
2034
|
})
|
|
1984
2035
|
}));
|
|
1985
2036
|
};
|
|
1986
|
-
var templateObject_1$
|
|
2037
|
+
var templateObject_1$B;
|
|
1987
2038
|
|
|
1988
2039
|
var StyledWrapper = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
1989
2040
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -1991,7 +2042,7 @@ var StyledWrapper = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
1991
2042
|
},
|
|
1992
2043
|
displayName: "MoneyDisplay__StyledWrapper",
|
|
1993
2044
|
componentId: "sc-1mddej3-0"
|
|
1994
|
-
})(templateObject_1$
|
|
2045
|
+
})(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n text-align: ", ";\n font-weight: ", ";\n"
|
|
1995
2046
|
// Map size to Typography variant
|
|
1996
2047
|
])), function (_a) {
|
|
1997
2048
|
var $align = _a.$align;
|
|
@@ -2098,14 +2149,14 @@ var MoneyDisplay = function MoneyDisplay(_a) {
|
|
|
2098
2149
|
})]
|
|
2099
2150
|
});
|
|
2100
2151
|
};
|
|
2101
|
-
var templateObject_1$
|
|
2152
|
+
var templateObject_1$A;
|
|
2102
2153
|
|
|
2103
2154
|
// Destructure tokens
|
|
2104
|
-
var semantic$
|
|
2105
|
-
var _a$6 = __assign(__assign({}, semantic$
|
|
2155
|
+
var semantic$f = tokens.semantic;
|
|
2156
|
+
var _a$6 = __assign(__assign({}, semantic$f), {
|
|
2106
2157
|
component: tokens.component
|
|
2107
2158
|
}),
|
|
2108
|
-
color$
|
|
2159
|
+
color$6 = _a$6.color,
|
|
2109
2160
|
motion$4 = _a$6.motion,
|
|
2110
2161
|
radius$2 = _a$6.radius,
|
|
2111
2162
|
component$2 = _a$6.component;
|
|
@@ -2116,9 +2167,9 @@ var ProgressBarContainer = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
2116
2167
|
displayName: "ProgressBar__ProgressBarContainer",
|
|
2117
2168
|
componentId: "sc-1nco33q-0"
|
|
2118
2169
|
})(templateObject_3$p || (templateObject_3$p = __makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n overflow: hidden;\n\n /* Forced colours drop the track's fill, so the track gets an edge (decision 0038) */\n ", "\n\n ", "\n\n ", "\n"], ["\n background-color: ", ";\n border-radius: ", ";\n overflow: hidden;\n\n /* Forced colours drop the track's fill, so the track gets an edge (decision 0038) */\n ", "\n\n ", "\n\n ", "\n"])), tokens.component.track.background, radius$2.xs, forcedColorsEdge, function (props) {
|
|
2119
|
-
return props.$variant === 'horizontal' && styled.css(templateObject_1$
|
|
2170
|
+
return props.$variant === 'horizontal' && styled.css(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n width: 100%;\n height: ", ";\n "], ["\n width: 100%;\n height: ", ";\n "])), props.$height ? component$2.progressBar.sizes[props.$height].height : component$2.progressBar.sizes.md.height);
|
|
2120
2171
|
}, function (props) {
|
|
2121
|
-
return props.$variant === 'vertical' && styled.css(templateObject_2$
|
|
2172
|
+
return props.$variant === 'vertical' && styled.css(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n width: ", ";\n height: 100%;\n "], ["\n width: ", ";\n height: 100%;\n "])), props.$width ? component$2.progressBar.sizes[props.$width].height : component$2.progressBar.sizes.md.height);
|
|
2122
2173
|
});
|
|
2123
2174
|
var ProgressBarFill = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
2124
2175
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -2130,15 +2181,15 @@ var ProgressBarFill = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
2130
2181
|
var backgroundColor;
|
|
2131
2182
|
switch (props.$color) {
|
|
2132
2183
|
case 'success':
|
|
2133
|
-
backgroundColor = color$
|
|
2184
|
+
backgroundColor = color$6.fill.success;
|
|
2134
2185
|
break;
|
|
2135
2186
|
case 'error':
|
|
2136
|
-
backgroundColor = color$
|
|
2187
|
+
backgroundColor = color$6.fill.danger;
|
|
2137
2188
|
break;
|
|
2138
2189
|
case 'default':
|
|
2139
2190
|
default:
|
|
2140
2191
|
// Near-black, like Slider's fill (decision 0029)
|
|
2141
|
-
backgroundColor = color$
|
|
2192
|
+
backgroundColor = color$6.fill.emphasis;
|
|
2142
2193
|
break;
|
|
2143
2194
|
}
|
|
2144
2195
|
return styled.css(templateObject_4$k || (templateObject_4$k = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), backgroundColor);
|
|
@@ -2179,7 +2230,7 @@ var ProgressBar = function ProgressBar(_a) {
|
|
|
2179
2230
|
})
|
|
2180
2231
|
});
|
|
2181
2232
|
};
|
|
2182
|
-
var templateObject_1$
|
|
2233
|
+
var templateObject_1$z, templateObject_2$r, templateObject_3$p, templateObject_4$k, templateObject_5$g, templateObject_6$c, templateObject_7$a;
|
|
2183
2234
|
|
|
2184
2235
|
// Destructure tokens for cleaner access
|
|
2185
2236
|
var separatorTokens = tokens.component.separator;
|
|
@@ -2191,7 +2242,7 @@ var StyledDivider = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
2191
2242
|
},
|
|
2192
2243
|
displayName: "Divider__StyledDivider",
|
|
2193
2244
|
componentId: "sc-1l0c8ja-0"
|
|
2194
|
-
})(templateObject_1$
|
|
2245
|
+
})(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"], ["\n border: none;\n \n /* Apply orientation */\n ", "\n \n /* Apply variant styles */\n ", "\n \n /* Apply size styles (spacing) */\n ", "\n"
|
|
2195
2246
|
/**
|
|
2196
2247
|
* Divider is an atomic component that provides visual separation between content sections.
|
|
2197
2248
|
*
|
|
@@ -2304,7 +2355,7 @@ var Divider = function Divider(_a) {
|
|
|
2304
2355
|
"aria-orientation": orientation
|
|
2305
2356
|
});
|
|
2306
2357
|
};
|
|
2307
|
-
var templateObject_1$
|
|
2358
|
+
var templateObject_1$y;
|
|
2308
2359
|
|
|
2309
2360
|
var StyledStack = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
2310
2361
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
@@ -2312,7 +2363,7 @@ var StyledStack = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
|
2312
2363
|
},
|
|
2313
2364
|
displayName: "Stack__StyledStack",
|
|
2314
2365
|
componentId: "sc-1ehkxgy-0"
|
|
2315
|
-
})(templateObject_1$
|
|
2366
|
+
})(templateObject_1$x || (templateObject_1$x = __makeTemplateObject(["\n display: flex;\n flex-direction: var(--stack-direction);\n align-items: var(--stack-align-items);\n justify-content: var(--stack-justify-content);\n gap: var(--stack-gap);\n flex-wrap: var(--stack-wrap);\n"], ["\n display: flex;\n flex-direction: var(--stack-direction);\n align-items: var(--stack-align-items);\n justify-content: var(--stack-justify-content);\n gap: var(--stack-gap);\n flex-wrap: var(--stack-wrap);\n"
|
|
2316
2367
|
// Each gap name maps to the space step that replaced its old spacing.layout token (decision 0031),
|
|
2317
2368
|
// so every gap keeps its value
|
|
2318
2369
|
])));
|
|
@@ -2366,7 +2417,7 @@ var Stack = function Stack(_a) {
|
|
|
2366
2417
|
children: children
|
|
2367
2418
|
});
|
|
2368
2419
|
};
|
|
2369
|
-
var templateObject_1$
|
|
2420
|
+
var templateObject_1$x;
|
|
2370
2421
|
|
|
2371
2422
|
// Destructure tokens for cleaner access
|
|
2372
2423
|
var statusColors = tokens.component.status;
|
|
@@ -2379,7 +2430,7 @@ var _b$1 = tokens.semantic.motion,
|
|
|
2379
2430
|
easing$3 = _b$1.easing;
|
|
2380
2431
|
var labelHeight = tokens.semantic.size.label;
|
|
2381
2432
|
var label$1 = tokens.component.badge.label;
|
|
2382
|
-
var scaleIn$1 = styled.keyframes(templateObject_1$
|
|
2433
|
+
var scaleIn$1 = styled.keyframes(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n from {\n opacity: 0;\n transform: scale(0.8);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n"], ["\n from {\n opacity: 0;\n transform: scale(0.8);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n"])));
|
|
2383
2434
|
var getStatusConfig = function getStatusConfig(status) {
|
|
2384
2435
|
var configs = {
|
|
2385
2436
|
pending: {
|
|
@@ -2424,7 +2475,7 @@ var getStatusConfig = function getStatusConfig(status) {
|
|
|
2424
2475
|
return configs[status];
|
|
2425
2476
|
};
|
|
2426
2477
|
// Size configuration
|
|
2427
|
-
var sizeConfig$
|
|
2478
|
+
var sizeConfig$2 = {
|
|
2428
2479
|
small: {
|
|
2429
2480
|
height: labelHeight.small,
|
|
2430
2481
|
padding: "".concat(space$9[100], " ").concat(space$9[200]),
|
|
@@ -2446,9 +2497,9 @@ var StyledStatusLabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
2446
2497
|
},
|
|
2447
2498
|
displayName: "StatusLabelBase__StyledStatusLabel",
|
|
2448
2499
|
componentId: "sc-1ye9xz5-0"
|
|
2449
|
-
})(templateObject_2$
|
|
2500
|
+
})(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n box-sizing: border-box; /* the height includes padding, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n white-space: nowrap;\n user-select: none;\n animation: ", " ", " ", ";\n transition: ", ";\n\n /* Under reduced motion the label appears without scaling in, and colours change at once */\n ", " {\n animation: none;\n transition: none;\n }\n\n /* Forced colours drop the fill, so the label keeps its shape with an edge (decision 0038) */\n ", "\n \n /* Size styles */\n ", "\n \n /* Status color styles */\n ", "\n"], ["\n box-sizing: border-box; /* the height includes padding, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n white-space: nowrap;\n user-select: none;\n animation: ", " ", " ", ";\n transition: ", ";\n\n /* Under reduced motion the label appears without scaling in, and colours change at once */\n ", " {\n animation: none;\n transition: none;\n }\n\n /* Forced colours drop the fill, so the label keeps its shape with an edge (decision 0038) */\n ", "\n \n /* Size styles */\n ", "\n \n /* Status color styles */\n ", "\n"])), radius$1.full, scaleIn$1, duration$3.moderate, easing$3.decelerate, transition.feedback, reducedMotion, forcedColorsEdge, function (_a) {
|
|
2450
2501
|
var $size = _a.$size;
|
|
2451
|
-
var size = sizeConfig$
|
|
2502
|
+
var size = sizeConfig$2[$size];
|
|
2452
2503
|
return "\n height: ".concat(size.height, ";\n padding: ").concat(size.padding, ";\n font: ").concat(size.font, ";\n font-weight: ").concat(label$1.fontWeight, ";\n gap: ").concat(size.gap, ";\n ");
|
|
2453
2504
|
}, function (_a) {
|
|
2454
2505
|
var $status = _a.$status;
|
|
@@ -2490,7 +2541,7 @@ var StatusLabelBase = function StatusLabelBase(_a) {
|
|
|
2490
2541
|
dataTestId = _a["data-testid"],
|
|
2491
2542
|
ariaLabel = _a["aria-label"];
|
|
2492
2543
|
var statusConfig = getStatusConfig(status);
|
|
2493
|
-
var sizeStyles = sizeConfig$
|
|
2544
|
+
var sizeStyles = sizeConfig$2[size];
|
|
2494
2545
|
var displayLabel = label || statusConfig.label;
|
|
2495
2546
|
// A blank aria-label is no label at all, so it falls back like a missing one
|
|
2496
2547
|
var accessibleLabel = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) ? ariaLabel : undefined;
|
|
@@ -2516,7 +2567,7 @@ var StatusLabelBase = function StatusLabelBase(_a) {
|
|
|
2516
2567
|
})]
|
|
2517
2568
|
});
|
|
2518
2569
|
};
|
|
2519
|
-
var templateObject_1$
|
|
2570
|
+
var templateObject_1$w, templateObject_2$q, templateObject_3$o, templateObject_4$j;
|
|
2520
2571
|
|
|
2521
2572
|
/**
|
|
2522
2573
|
* StatusBadge displays a transaction or task status.
|
|
@@ -2550,19 +2601,19 @@ var StatusLabel = function StatusLabel(props) {
|
|
|
2550
2601
|
};
|
|
2551
2602
|
StatusLabel.displayName = 'StatusLabel';
|
|
2552
2603
|
|
|
2553
|
-
var semantic$
|
|
2554
|
-
var color$
|
|
2555
|
-
size$
|
|
2604
|
+
var semantic$e = tokens.semantic;
|
|
2605
|
+
var color$5 = semantic$e.color,
|
|
2606
|
+
size$2 = semantic$e.size;
|
|
2556
2607
|
var label = tokens.component.badge.label;
|
|
2557
|
-
var space$8 = semantic$
|
|
2558
|
-
var radius = semantic$
|
|
2608
|
+
var space$8 = semantic$e.space;
|
|
2609
|
+
var radius = semantic$e.radius;
|
|
2559
2610
|
var StyledTag = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
2560
2611
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
2561
2612
|
return !prop.startsWith('$');
|
|
2562
2613
|
},
|
|
2563
2614
|
displayName: "Tag__StyledTag",
|
|
2564
2615
|
componentId: "sc-lzfmti-0"
|
|
2565
|
-
})(templateObject_1$
|
|
2616
|
+
})(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n box-sizing: border-box; /* the height includes padding and border, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n user-select: none;\n white-space: nowrap;\n\n /* Size (decision 0018): small has no vertical padding so the text line fits inside 20px */\n height: ", ";\n padding: ", ";\n font: ", ";\n font-weight: ", ";\n \n /* Variant styles */\n background-color: ", ";\n \n color: ", ";\n \n border: ", ";\n"], ["\n box-sizing: border-box; /* the height includes padding and border, without relying on a global reset */\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: ", ";\n user-select: none;\n white-space: nowrap;\n\n /* Size (decision 0018): small has no vertical padding so the text line fits inside 20px */\n height: ", ";\n padding: ", ";\n font: ", ";\n font-weight: ", ";\n \n /* Variant styles */\n background-color: ", ";\n \n color: ", ";\n \n border: ", ";\n"
|
|
2566
2617
|
/**
|
|
2567
2618
|
* Tag component for categorizing and labeling content
|
|
2568
2619
|
*
|
|
@@ -2570,7 +2621,7 @@ var StyledTag = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
2570
2621
|
* Tags help users quickly identify and understand content classification.
|
|
2571
2622
|
*/])), radius.sm, function (_a) {
|
|
2572
2623
|
var $size = _a.$size;
|
|
2573
|
-
return size$
|
|
2624
|
+
return size$2.label[$size];
|
|
2574
2625
|
}, function (_a) {
|
|
2575
2626
|
var $size = _a.$size;
|
|
2576
2627
|
return $size === 'small' ? "0 ".concat(space$8[200]) : "".concat(space$8[100], " ").concat(space$8[200]);
|
|
@@ -2578,33 +2629,33 @@ var StyledTag = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
2578
2629
|
var $variant = _a.$variant;
|
|
2579
2630
|
switch ($variant) {
|
|
2580
2631
|
case 'interactive':
|
|
2581
|
-
return color$
|
|
2632
|
+
return color$5.fill['accent-muted'];
|
|
2582
2633
|
case 'success':
|
|
2583
|
-
return color$
|
|
2634
|
+
return color$5.fill['success-muted'];
|
|
2584
2635
|
case 'warning':
|
|
2585
|
-
return color$
|
|
2636
|
+
return color$5.fill['warning-muted'];
|
|
2586
2637
|
case 'error':
|
|
2587
|
-
return color$
|
|
2638
|
+
return color$5.fill['danger-muted'];
|
|
2588
2639
|
case 'emphasis':
|
|
2589
|
-
return color$
|
|
2640
|
+
return color$5.fill.emphasis;
|
|
2590
2641
|
default:
|
|
2591
|
-
return color$
|
|
2642
|
+
return color$5.fill.muted;
|
|
2592
2643
|
}
|
|
2593
2644
|
}, function (_a) {
|
|
2594
2645
|
var $variant = _a.$variant;
|
|
2595
2646
|
switch ($variant) {
|
|
2596
2647
|
case 'interactive':
|
|
2597
|
-
return color$
|
|
2648
|
+
return color$5.text.accent;
|
|
2598
2649
|
case 'success':
|
|
2599
|
-
return color$
|
|
2650
|
+
return color$5.text.success;
|
|
2600
2651
|
case 'warning':
|
|
2601
|
-
return color$
|
|
2652
|
+
return color$5.text.warning;
|
|
2602
2653
|
case 'error':
|
|
2603
|
-
return color$
|
|
2654
|
+
return color$5.text.danger;
|
|
2604
2655
|
case 'emphasis':
|
|
2605
|
-
return color$
|
|
2656
|
+
return color$5.text.inverse;
|
|
2606
2657
|
default:
|
|
2607
|
-
return color$
|
|
2658
|
+
return color$5.text["default"];
|
|
2608
2659
|
}
|
|
2609
2660
|
}, function (_a) {
|
|
2610
2661
|
var $variant = _a.$variant,
|
|
@@ -2612,17 +2663,17 @@ var StyledTag = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
|
2612
2663
|
if (!$border) return 'none';
|
|
2613
2664
|
switch ($variant) {
|
|
2614
2665
|
case 'interactive':
|
|
2615
|
-
return "".concat(semantic$
|
|
2666
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.border.accent);
|
|
2616
2667
|
case 'success':
|
|
2617
|
-
return "".concat(semantic$
|
|
2668
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.border.success);
|
|
2618
2669
|
case 'warning':
|
|
2619
|
-
return "".concat(semantic$
|
|
2670
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.border.warning);
|
|
2620
2671
|
case 'error':
|
|
2621
|
-
return "".concat(semantic$
|
|
2672
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.border.danger);
|
|
2622
2673
|
case 'emphasis':
|
|
2623
|
-
return "".concat(semantic$
|
|
2674
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.fill.emphasis);
|
|
2624
2675
|
default:
|
|
2625
|
-
return "".concat(semantic$
|
|
2676
|
+
return "".concat(semantic$e.border.width.thin, " solid ").concat(color$5.border["default"]);
|
|
2626
2677
|
}
|
|
2627
2678
|
});
|
|
2628
2679
|
/**
|
|
@@ -2654,7 +2705,91 @@ var Tag = function Tag(_a) {
|
|
|
2654
2705
|
children: children
|
|
2655
2706
|
}));
|
|
2656
2707
|
};
|
|
2657
|
-
var templateObject_1$
|
|
2708
|
+
var templateObject_1$v;
|
|
2709
|
+
|
|
2710
|
+
var semantic$d = tokens.semantic;
|
|
2711
|
+
var color$4 = semantic$d.color,
|
|
2712
|
+
typography$1 = semantic$d.typography,
|
|
2713
|
+
size$1 = semantic$d.size;
|
|
2714
|
+
var labels = {
|
|
2715
|
+
suggested: 'Suggested',
|
|
2716
|
+
removal: 'Will be removed'
|
|
2717
|
+
};
|
|
2718
|
+
var sizeConfig$1 = {
|
|
2719
|
+
small: {
|
|
2720
|
+
font: typography$1.caption,
|
|
2721
|
+
gap: semantic$d.space[100],
|
|
2722
|
+
icon: 'xs'
|
|
2723
|
+
},
|
|
2724
|
+
medium: {
|
|
2725
|
+
font: typography$1.small,
|
|
2726
|
+
gap: semantic$d.space[200],
|
|
2727
|
+
icon: 'sm'
|
|
2728
|
+
}
|
|
2729
|
+
};
|
|
2730
|
+
var StyledAILabel = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
2731
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
2732
|
+
return !prop.startsWith('$');
|
|
2733
|
+
},
|
|
2734
|
+
displayName: "AILabel__StyledAILabel",
|
|
2735
|
+
componentId: "sc-qknkn-0"
|
|
2736
|
+
})(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n min-height: ", ";\n gap: ", ";\n font: ", ";\n color: ", ";\n white-space: nowrap;\n"], ["\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n min-height: ", ";\n gap: ", ";\n font: ", ";\n color: ", ";\n white-space: nowrap;\n"])), function (_a) {
|
|
2737
|
+
var $size = _a.$size;
|
|
2738
|
+
return size$1.label[$size];
|
|
2739
|
+
}, function (_a) {
|
|
2740
|
+
var $size = _a.$size;
|
|
2741
|
+
return sizeConfig$1[$size].gap;
|
|
2742
|
+
}, function (_a) {
|
|
2743
|
+
var $size = _a.$size;
|
|
2744
|
+
return sizeConfig$1[$size].font;
|
|
2745
|
+
}, color$4.text.ai);
|
|
2746
|
+
var StyledIcon = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
2747
|
+
displayName: "AILabel__StyledIcon",
|
|
2748
|
+
componentId: "sc-qknkn-1"
|
|
2749
|
+
})(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n display: inline-flex;\n color: ", ";\n"], ["\n display: inline-flex;\n color: ", ";\n"
|
|
2750
|
+
/**
|
|
2751
|
+
* AILabel marks content an agent has proposed but the user hasn't accepted (decision 0046): the AI
|
|
2752
|
+
* icon and a fixed label in the AI colour, never colour alone (decision 0043). It isn't a status
|
|
2753
|
+
* (use StatusLabel) or a category (use CategoryLabel), and it doesn't label AI features in general.
|
|
2754
|
+
*
|
|
2755
|
+
* @example
|
|
2756
|
+
* ```tsx
|
|
2757
|
+
* <AILabel /> // "Suggested"
|
|
2758
|
+
* <AILabel kind="removal" /> // "Will be removed"
|
|
2759
|
+
* ```
|
|
2760
|
+
*/])), color$4.icon.ai);
|
|
2761
|
+
/**
|
|
2762
|
+
* AILabel marks content an agent has proposed but the user hasn't accepted (decision 0046): the AI
|
|
2763
|
+
* icon and a fixed label in the AI colour, never colour alone (decision 0043). It isn't a status
|
|
2764
|
+
* (use StatusLabel) or a category (use CategoryLabel), and it doesn't label AI features in general.
|
|
2765
|
+
*
|
|
2766
|
+
* @example
|
|
2767
|
+
* ```tsx
|
|
2768
|
+
* <AILabel /> // "Suggested"
|
|
2769
|
+
* <AILabel kind="removal" /> // "Will be removed"
|
|
2770
|
+
* ```
|
|
2771
|
+
*/
|
|
2772
|
+
var AILabel = function AILabel(_a) {
|
|
2773
|
+
var _b = _a.kind,
|
|
2774
|
+
kind = _b === void 0 ? 'suggested' : _b,
|
|
2775
|
+
_c = _a.size,
|
|
2776
|
+
labelSize = _c === void 0 ? 'medium' : _c,
|
|
2777
|
+
dataTestId = _a["data-testid"];
|
|
2778
|
+
return jsxRuntime.jsxs(StyledAILabel, {
|
|
2779
|
+
"$size": labelSize,
|
|
2780
|
+
"data-testid": dataTestId,
|
|
2781
|
+
children: [jsxRuntime.jsx(StyledIcon, {
|
|
2782
|
+
"aria-hidden": "true",
|
|
2783
|
+
children: jsxRuntime.jsx(Icon, {
|
|
2784
|
+
name: "ai",
|
|
2785
|
+
size: sizeConfig$1[labelSize].icon,
|
|
2786
|
+
iconColor: "inherit"
|
|
2787
|
+
})
|
|
2788
|
+
}), labels[kind]]
|
|
2789
|
+
});
|
|
2790
|
+
};
|
|
2791
|
+
AILabel.displayName = 'AILabel';
|
|
2792
|
+
var templateObject_1$u, templateObject_2$p;
|
|
2658
2793
|
|
|
2659
2794
|
// Destructure tokens for cleaner access
|
|
2660
2795
|
var semantic$c = tokens.semantic;
|
|
@@ -3370,6 +3505,10 @@ function detectSpeechRecognitionConstructor(targetWindow) {
|
|
|
3370
3505
|
function normalizeTranscript(input) {
|
|
3371
3506
|
return input.replace(/\s+/g, ' ').trim();
|
|
3372
3507
|
}
|
|
3508
|
+
/** Typed text: like a transcript, but line breaks are kept (spaces around them are dropped). */
|
|
3509
|
+
function normalizeMessage(input) {
|
|
3510
|
+
return input.replace(/[^\S\n]+/g, ' ').replace(/ ?\n ?/g, '\n').trim();
|
|
3511
|
+
}
|
|
3373
3512
|
function mapSpeechErrorCode(error) {
|
|
3374
3513
|
switch (error) {
|
|
3375
3514
|
case 'not-allowed':
|
|
@@ -3456,94 +3595,165 @@ function agentInputStateTransition(currentState, event) {
|
|
|
3456
3595
|
|
|
3457
3596
|
var semantic$a = tokens.semantic,
|
|
3458
3597
|
component$1 = tokens.component;
|
|
3459
|
-
var DEFAULT_IDLE_HELPER = 'Ask about transactions, spending, or transfers';
|
|
3460
3598
|
var DEFAULT_LISTENING_MESSAGE = 'Listening… speak now';
|
|
3461
3599
|
var DEFAULT_PROCESSING_MESSAGE = 'Finishing voice input…';
|
|
3600
|
+
// The counter appears from this share of maxLength
|
|
3601
|
+
var COUNTER_THRESHOLD = 0.8;
|
|
3602
|
+
// Layout effects warn during server rendering in React 18
|
|
3603
|
+
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
3462
3604
|
var rotateRing = styled.keyframes(templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"], ["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
3463
3605
|
var Container = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3606
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3607
|
+
return !prop.startsWith('$');
|
|
3608
|
+
},
|
|
3464
3609
|
displayName: "AgentInput__Container",
|
|
3465
3610
|
componentId: "sc-fhl996-0"
|
|
3466
|
-
})(
|
|
3611
|
+
})(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ", ";\n width: 100%;\n\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n gap: ", ";\n width: 100%;\n\n ", "\n"])), semantic$a.space[200], function (_a) {
|
|
3612
|
+
var $docked = _a.$docked;
|
|
3613
|
+
return $docked && styled.css(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n position: sticky;\n bottom: 0;\n z-index: ", ";\n /* The band hides content scrolling past the field and status line (decisions 0006, 0031) */\n background-color: ", ";\n padding-top: ", ";\n /* Clears the home indicator; zero unless the page sets viewport-fit=cover */\n padding-bottom: env(safe-area-inset-bottom, 0px);\n "], ["\n position: sticky;\n bottom: 0;\n z-index: ", ";\n /* The band hides content scrolling past the field and status line (decisions 0006, 0031) */\n background-color: ", ";\n padding-top: ", ";\n /* Clears the home indicator; zero unless the page sets viewport-fit=cover */\n padding-bottom: env(safe-area-inset-bottom, 0px);\n "])), semantic$a.layer.sticky, semantic$a.surface.base, semantic$a.space[300]);
|
|
3614
|
+
});
|
|
3467
3615
|
var ControlsRow = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3468
3616
|
displayName: "AgentInput__ControlsRow",
|
|
3469
3617
|
componentId: "sc-fhl996-1"
|
|
3470
|
-
})(
|
|
3618
|
+
})(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
3471
3619
|
var InputShell = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3472
3620
|
displayName: "AgentInput__InputShell",
|
|
3473
3621
|
componentId: "sc-fhl996-2"
|
|
3474
|
-
})(
|
|
3475
|
-
|
|
3622
|
+
})(templateObject_5$c || (templateObject_5$c = __makeTemplateObject(["\n display: flex;\n /* Actions sit beside the last line as the field grows */\n align-items: flex-end;\n gap: ", ";\n width: 100%;\n padding: ", " ", " ", " ", ";\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n transition: border-color ", " ", ", outline ", " ", ";\n\n &:focus-within {\n border-color: ", ";\n outline: ", ";\n outline-offset: ", ";\n }\n\n &[data-disabled='true'] {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n display: flex;\n /* Actions sit beside the last line as the field grows */\n align-items: flex-end;\n gap: ", ";\n width: 100%;\n padding: ", " ", " ", " ", ";\n background-color: ", ";\n border: ", " solid ", ";\n border-radius: ", ";\n box-shadow: ", ";\n transition: border-color ", " ", ", outline ", " ", ";\n\n &:focus-within {\n border-color: ", ";\n outline: ", ";\n outline-offset: ", ";\n }\n\n &[data-disabled='true'] {\n background-color: ", ";\n border-color: ", ";\n }\n"
|
|
3623
|
+
// One row is a control-height field; it grows with its content to six rows, then scrolls.
|
|
3624
|
+
// The height is set from scrollHeight in resizeField; 1lh is the body line height.
|
|
3625
|
+
])), semantic$a.space[200], semantic$a.space[100], semantic$a.space[200], semantic$a.space[100], semantic$a.space.inset.lg, component$1.input["default"].backgroundColor, component$1.input["default"].borderWidth, component$1.input["default"].borderColor, semantic$a.radius['3xl'], semantic$a.elevation.raised, semantic$a.motion.duration.moderate, semantic$a.motion.easing.standard, semantic$a.motion.duration.moderate, semantic$a.motion.easing.standard, component$1.input.focus.borderColor, component$1.input.focus.outline, semantic$a.border.focusOffset, component$1.input.disabled.backgroundColor, component$1.input.disabled.borderColor);
|
|
3626
|
+
// One row is a control-height field; it grows with its content to six rows, then scrolls.
|
|
3627
|
+
// The height is set from scrollHeight in resizeField; 1lh is the body line height.
|
|
3628
|
+
var Input = /*#__PURE__*/styled__default.default.textarea.withConfig({
|
|
3476
3629
|
displayName: "AgentInput__Input",
|
|
3477
3630
|
componentId: "sc-fhl996-3"
|
|
3478
|
-
})(
|
|
3631
|
+
})(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n display: block;\n flex: 1;\n min-width: 0;\n box-sizing: border-box;\n height: ", ";\n min-height: ", ";\n max-height: calc(5lh + ", ");\n margin: 0;\n padding: calc((", " - 1lh) / 2) 0;\n resize: none;\n overflow-y: hidden;\n border: none;\n background: transparent;\n font: ", ";\n color: ", ";\n outline: none;\n\n &::placeholder {\n color: ", ";\n /* Firefox fades placeholders to 0.54 by default, which would undo the 4.5:1 contrast */\n opacity: 1;\n }\n\n &:disabled {\n color: ", ";\n cursor: not-allowed;\n }\n"], ["\n display: block;\n flex: 1;\n min-width: 0;\n box-sizing: border-box;\n height: ", ";\n min-height: ", ";\n max-height: calc(5lh + ", ");\n margin: 0;\n padding: calc((", " - 1lh) / 2) 0;\n resize: none;\n overflow-y: hidden;\n border: none;\n background: transparent;\n font: ", ";\n color: ", ";\n outline: none;\n\n &::placeholder {\n color: ", ";\n /* Firefox fades placeholders to 0.54 by default, which would undo the 4.5:1 contrast */\n opacity: 1;\n }\n\n &:disabled {\n color: ", ";\n cursor: not-allowed;\n }\n"])), semantic$a.size.control.lg, semantic$a.size.control.lg, semantic$a.size.control.lg, semantic$a.size.control.lg, semantic$a.typography.body, semantic$a.color.text["default"], component$1.input.placeholder.textColor, semantic$a.color.text.disabled);
|
|
3479
3632
|
var InputActions = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3480
3633
|
displayName: "AgentInput__InputActions",
|
|
3481
3634
|
componentId: "sc-fhl996-4"
|
|
3482
|
-
})(
|
|
3635
|
+
})(templateObject_7$7 || (templateObject_7$7 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n /* Centres the buttons on a one-row field, and keeps them level with the last line as it grows */\n padding-bottom: calc((", " - ", ") / 2);\n"], ["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n /* Centres the buttons on a one-row field, and keeps them level with the last line as it grows */\n padding-bottom: calc((", " - ", ") / 2);\n"])), semantic$a.space[200], semantic$a.size.control.lg, semantic$a.size.control.md);
|
|
3483
3636
|
var CircularActionIconButton = /*#__PURE__*/styled__default.default(IconButton).withConfig({
|
|
3484
3637
|
displayName: "AgentInput__CircularActionIconButton",
|
|
3485
3638
|
componentId: "sc-fhl996-5"
|
|
3486
|
-
})(
|
|
3639
|
+
})(templateObject_8$6 || (templateObject_8$6 = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), semantic$a.radius.full);
|
|
3487
3640
|
var InputWrapper = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3488
3641
|
displayName: "AgentInput__InputWrapper",
|
|
3489
3642
|
componentId: "sc-fhl996-6"
|
|
3490
|
-
})(
|
|
3643
|
+
})(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\n flex: 1;\n min-width: 0;\n"], ["\n flex: 1;\n min-width: 0;\n"])));
|
|
3491
3644
|
var MicButtonWrapper = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3492
3645
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3493
3646
|
return !prop.startsWith('$');
|
|
3494
3647
|
},
|
|
3495
3648
|
displayName: "AgentInput__MicButtonWrapper",
|
|
3496
3649
|
componentId: "sc-fhl996-7"
|
|
3497
|
-
})(
|
|
3650
|
+
})(templateObject_10$3 || (templateObject_10$3 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n border-radius: ", ";\n\n & > button {\n position: relative;\n z-index: 1;\n }\n"], ["\n position: relative;\n display: inline-flex;\n border-radius: ", ";\n\n & > button {\n position: relative;\n z-index: 1;\n }\n"
|
|
3498
3651
|
// Masks read only alpha, so the opaque stop is a mask value, not a colour (decision 0010).
|
|
3499
3652
|
// eslint-disable-next-line no-restricted-syntax
|
|
3500
3653
|
])), semantic$a.radius.full);
|
|
3501
3654
|
// Masks read only alpha, so the opaque stop is a mask value, not a colour (decision 0010).
|
|
3502
3655
|
// eslint-disable-next-line no-restricted-syntax
|
|
3503
|
-
var ringMask = styled.css(
|
|
3656
|
+
var ringMask = styled.css(templateObject_11$3 || (templateObject_11$3 = __makeTemplateObject(["radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 calc(100% - var(--ring-thickness)))"], ["radial-gradient(farthest-side, transparent calc(100% - var(--ring-thickness)), #000 calc(100% - var(--ring-thickness)))"])));
|
|
3504
3657
|
var MicListeningRing = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
3505
3658
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3506
3659
|
return !prop.startsWith('$');
|
|
3507
3660
|
},
|
|
3508
3661
|
displayName: "AgentInput__MicListeningRing",
|
|
3509
3662
|
componentId: "sc-fhl996-8"
|
|
3510
|
-
})(
|
|
3663
|
+
})(templateObject_13$3 || (templateObject_13$3 = __makeTemplateObject(["\n --ring-thickness: ", ";\n position: absolute;\n inset: calc(-1 * ", " - ", ");\n border-radius: ", ";\n pointer-events: none;\n z-index: 0;\n background: conic-gradient(\n from 0deg,\n ", " 0deg,\n ", " 110deg,\n ", " 210deg,\n ", " 300deg,\n ", " 360deg\n );\n mask: ", ";\n -webkit-mask: ", ";\n\n ", "\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n"], ["\n --ring-thickness: ", ";\n position: absolute;\n inset: calc(-1 * ", " - ", ");\n border-radius: ", ";\n pointer-events: none;\n z-index: 0;\n background: conic-gradient(\n from 0deg,\n ", " 0deg,\n ", " 110deg,\n ", " 210deg,\n ", " 300deg,\n ", " 360deg\n );\n mask: ", ";\n -webkit-mask: ", ";\n\n ", "\n\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n }\n"
|
|
3664
|
+
// Maximum suggestions shown (decision 0046, #280)
|
|
3665
|
+
])), semantic$a.border.width.thick, semantic$a.space[100], semantic$a.border.focusOffset, semantic$a.radius.full, semantic$a.color.fill['accent-muted'], semantic$a.color.fill.accent, semantic$a.color.fill['accent-hover'], semantic$a.color.fill.accent, semantic$a.color.fill['accent-muted'], ringMask, ringMask, function (_a) {
|
|
3511
3666
|
var $reducedMotion = _a.$reducedMotion;
|
|
3512
|
-
return !$reducedMotion && styled.css(
|
|
3667
|
+
return !$reducedMotion && styled.css(templateObject_12$3 || (templateObject_12$3 = __makeTemplateObject(["\n animation: ", " 1300ms linear infinite;\n "], ["\n animation: ", " 1300ms linear infinite;\n "])), rotateRing);
|
|
3513
3668
|
});
|
|
3669
|
+
// Maximum suggestions shown (decision 0046, #280)
|
|
3670
|
+
var MAX_SUGGESTIONS = 3;
|
|
3671
|
+
var regionEnter = styled.keyframes(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n from {\n opacity: 0;\n transform: translateY(", ");\n }\n"], ["\n from {\n opacity: 0;\n transform: translateY(", ");\n }\n"])), semantic$a.motion.distance.sm);
|
|
3672
|
+
var regionFadeIn = styled.keyframes(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n"], ["\n from {\n opacity: 0;\n }\n"
|
|
3673
|
+
// Leaving content fades, then its space closes, as with Alert's dismiss (decision 0015). A grid
|
|
3674
|
+
// row from 1fr to 0fr collapses to the content's own height without measuring it.
|
|
3675
|
+
])));
|
|
3676
|
+
// Leaving content fades, then its space closes, as with Alert's dismiss (decision 0015). A grid
|
|
3677
|
+
// row from 1fr to 0fr collapses to the content's own height without measuring it.
|
|
3678
|
+
var regionFadeThenCollapse = styled.keyframes(templateObject_16$1 || (templateObject_16$1 = __makeTemplateObject(["\n 0%, 50% {\n grid-template-rows: 1fr;\n }\n 0% {\n opacity: 1;\n }\n 50%, 100% {\n opacity: 0;\n }\n 100% {\n grid-template-rows: 0fr;\n }\n"], ["\n 0%, 50% {\n grid-template-rows: 1fr;\n }\n 0% {\n opacity: 1;\n }\n 50%, 100% {\n opacity: 0;\n }\n 100% {\n grid-template-rows: 0fr;\n }\n"])));
|
|
3679
|
+
var regionFadeOut = styled.keyframes(templateObject_17$1 || (templateObject_17$1 = __makeTemplateObject(["\n to {\n opacity: 0;\n }\n"], ["\n to {\n opacity: 0;\n }\n"
|
|
3680
|
+
// One part of the region above the field: the review bar or the suggestions
|
|
3681
|
+
])));
|
|
3682
|
+
// One part of the region above the field: the review bar or the suggestions
|
|
3683
|
+
var RegionItem = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3684
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3685
|
+
return !prop.startsWith('$');
|
|
3686
|
+
},
|
|
3687
|
+
displayName: "AgentInput__RegionItem",
|
|
3688
|
+
componentId: "sc-fhl996-9"
|
|
3689
|
+
})(templateObject_21$1 || (templateObject_21$1 = __makeTemplateObject(["\n display: grid;\n grid-template-rows: 1fr;\n animation: ", " ", " ", ";\n\n ", " {\n animation-name: ", ";\n }\n\n ", "\n"], ["\n display: grid;\n grid-template-rows: 1fr;\n animation: ", " ", " ", ";\n\n ", " {\n animation-name: ", ";\n }\n\n ", "\n"
|
|
3690
|
+
// Clips while the row collapses. Its bottom padding is the space to the next part, so it closes too.
|
|
3691
|
+
])), regionEnter, semantic$a.motion.duration.moderate, semantic$a.motion.easing.decelerate, reducedMotion, regionFadeIn, function (_a) {
|
|
3692
|
+
var $exiting = _a.$exiting,
|
|
3693
|
+
$reducedExit = _a.$reducedExit;
|
|
3694
|
+
return $exiting && styled.css(templateObject_20$1 || (templateObject_20$1 = __makeTemplateObject(["\n pointer-events: none;\n animation: ", ";\n "], ["\n pointer-events: none;\n animation: ", ";\n "])), $reducedExit ? styled.css(templateObject_18$1 || (templateObject_18$1 = __makeTemplateObject(["", " ", " ", " forwards"], ["", " ", " ", " forwards"])), regionFadeOut, semantic$a.motion.duration.fast, semantic$a.motion.easing.accelerate) : styled.css(templateObject_19$1 || (templateObject_19$1 = __makeTemplateObject(["", " calc(2 * ", ") ", " forwards"], ["", " calc(2 * ", ") ", " forwards"])), regionFadeThenCollapse, semantic$a.motion.duration.fast, semantic$a.motion.easing.accelerate));
|
|
3695
|
+
});
|
|
3696
|
+
// Clips while the row collapses. Its bottom padding is the space to the next part, so it closes too.
|
|
3697
|
+
var RegionItemContent = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3698
|
+
displayName: "AgentInput__RegionItemContent",
|
|
3699
|
+
componentId: "sc-fhl996-10"
|
|
3700
|
+
})(templateObject_22$1 || (templateObject_22$1 = __makeTemplateObject(["\n min-height: 0;\n overflow: hidden;\n padding-bottom: ", ";\n padding-left: ", ";\n"], ["\n min-height: 0;\n overflow: hidden;\n padding-bottom: ", ";\n padding-left: ", ";\n"
|
|
3701
|
+
// The summary first, then the actions, left-aligned after it; they wrap below on narrow screens (0021)
|
|
3702
|
+
])), semantic$a.space[200], semantic$a.space[500]);
|
|
3703
|
+
// The summary first, then the actions, left-aligned after it; they wrap below on narrow screens (0021)
|
|
3704
|
+
var ReviewBar = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3705
|
+
displayName: "AgentInput__ReviewBar",
|
|
3706
|
+
componentId: "sc-fhl996-11"
|
|
3707
|
+
})(templateObject_23$1 || (templateObject_23$1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: ", ";\n row-gap: ", ";\n"], ["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n column-gap: ", ";\n row-gap: ", ";\n"])), semantic$a.space[300], semantic$a.space[200]);
|
|
3708
|
+
var ReviewActions = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3709
|
+
displayName: "AgentInput__ReviewActions",
|
|
3710
|
+
componentId: "sc-fhl996-12"
|
|
3711
|
+
})(templateObject_24$1 || (templateObject_24$1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n"])), semantic$a.space[200]);
|
|
3712
|
+
var SuggestionList = /*#__PURE__*/styled__default.default.ul.withConfig({
|
|
3713
|
+
displayName: "AgentInput__SuggestionList",
|
|
3714
|
+
componentId: "sc-fhl996-13"
|
|
3715
|
+
})(templateObject_25$1 || (templateObject_25$1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n margin: 0;\n padding: 0;\n list-style: none;\n\n & > li {\n max-width: 100%;\n }\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: ", ";\n margin: 0;\n padding: 0;\n list-style: none;\n\n & > li {\n max-width: 100%;\n }\n"])), semantic$a.space[200]);
|
|
3514
3716
|
var StatusRow = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3515
3717
|
displayName: "AgentInput__StatusRow",
|
|
3516
|
-
componentId: "sc-fhl996-
|
|
3517
|
-
})(
|
|
3718
|
+
componentId: "sc-fhl996-14"
|
|
3719
|
+
})(templateObject_26$1 || (templateObject_26$1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n min-height: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ", ";\n min-height: ", ";\n"])), semantic$a.space[300], semantic$a.space[600]);
|
|
3518
3720
|
var StatusText = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3519
3721
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3520
3722
|
return !prop.startsWith('$');
|
|
3521
3723
|
},
|
|
3522
3724
|
displayName: "AgentInput__StatusText",
|
|
3523
|
-
componentId: "sc-fhl996-
|
|
3524
|
-
})(
|
|
3725
|
+
componentId: "sc-fhl996-15"
|
|
3726
|
+
})(templateObject_27$1 || (templateObject_27$1 = __makeTemplateObject(["\n padding-left: ", ";\n"], ["\n padding-left: ", ";\n"])), semantic$a.space[500]);
|
|
3525
3727
|
var StatusAnnouncement = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3526
3728
|
displayName: "AgentInput__StatusAnnouncement",
|
|
3527
|
-
componentId: "sc-fhl996-
|
|
3528
|
-
})(
|
|
3729
|
+
componentId: "sc-fhl996-16"
|
|
3730
|
+
})(templateObject_28$1 || (templateObject_28$1 = __makeTemplateObject([""], [""])));
|
|
3731
|
+
var StatusEnd = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3732
|
+
displayName: "AgentInput__StatusEnd",
|
|
3733
|
+
componentId: "sc-fhl996-17"
|
|
3734
|
+
})(templateObject_29$1 || (templateObject_29$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n"], ["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n"])), semantic$a.space[300]);
|
|
3735
|
+
var VisuallyHidden = /*#__PURE__*/styled__default.default.span.withConfig({
|
|
3736
|
+
displayName: "AgentInput__VisuallyHidden",
|
|
3737
|
+
componentId: "sc-fhl996-18"
|
|
3738
|
+
})(templateObject_30$1 || (templateObject_30$1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), visuallyHidden);
|
|
3529
3739
|
var MeterContainer = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3530
3740
|
displayName: "AgentInput__MeterContainer",
|
|
3531
|
-
componentId: "sc-fhl996-
|
|
3532
|
-
})(
|
|
3741
|
+
componentId: "sc-fhl996-19"
|
|
3742
|
+
})(templateObject_31$1 || (templateObject_31$1 = __makeTemplateObject(["\n display: inline-flex;\n align-items: flex-end;\n gap: ", ";\n height: ", ";\n"], ["\n display: inline-flex;\n align-items: flex-end;\n gap: ", ";\n height: ", ";\n"])), semantic$a.space[100], semantic$a.space[400]);
|
|
3533
3743
|
var MeterBar = /*#__PURE__*/styled__default.default.div.withConfig({
|
|
3534
3744
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
3535
3745
|
return !prop.startsWith('$');
|
|
3536
3746
|
},
|
|
3537
3747
|
displayName: "AgentInput__MeterBar",
|
|
3538
|
-
componentId: "sc-fhl996-
|
|
3539
|
-
})(
|
|
3748
|
+
componentId: "sc-fhl996-20"
|
|
3749
|
+
})(templateObject_32$1 || (templateObject_32$1 = __makeTemplateObject(["\n width: ", ";\n border-radius: ", ";\n background-color: ", ";\n height: ", ";\n transition: height ", " ", ";\n"], ["\n width: ", ";\n border-radius: ", ";\n background-color: ", ";\n height: ", ";\n transition: height ", " ", ";\n"])), semantic$a.space[100], semantic$a.radius.xs, semantic$a.color.fill.accent, function (_a) {
|
|
3540
3750
|
var $height = _a.$height;
|
|
3541
3751
|
return "".concat($height * 100, "%");
|
|
3542
3752
|
}, semantic$a.motion.duration.fast, semantic$a.motion.easing.decelerate);
|
|
3543
3753
|
var VisuallyHiddenLabel = /*#__PURE__*/styled__default.default.label.withConfig({
|
|
3544
3754
|
displayName: "AgentInput__VisuallyHiddenLabel",
|
|
3545
|
-
componentId: "sc-fhl996-
|
|
3546
|
-
})(
|
|
3755
|
+
componentId: "sc-fhl996-21"
|
|
3756
|
+
})(templateObject_33$1 || (templateObject_33$1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), visuallyHidden);
|
|
3547
3757
|
function getInitialState(hasText) {
|
|
3548
3758
|
return hasText ? 'typing' : 'idle';
|
|
3549
3759
|
}
|
|
@@ -3551,60 +3761,104 @@ function createMeterBars(level) {
|
|
|
3551
3761
|
var clampedLevel = Math.max(0, Math.min(level, 1));
|
|
3552
3762
|
return [0.25 + clampedLevel * 0.75, 0.2 + clampedLevel * 0.6, 0.3 + clampedLevel * 0.7, 0.2 + clampedLevel * 0.5];
|
|
3553
3763
|
}
|
|
3554
|
-
|
|
3764
|
+
// Declared separately so the react-hooks lint rules analyse it (they skip functions inline in forwardRef)
|
|
3765
|
+
// Development builds warn about props that break the pattern. Bundlers replace process.env.NODE_ENV
|
|
3766
|
+
// with a literal; without a bundler, a browser has no process, so reading it throws.
|
|
3767
|
+
function readIsProduction() {
|
|
3768
|
+
try {
|
|
3769
|
+
return process.env.NODE_ENV === 'production';
|
|
3770
|
+
} catch (_a) {
|
|
3771
|
+
return false;
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
var isProduction = readIsProduction();
|
|
3775
|
+
// A part of the region above the field. It stays mounted while it fades out and its space closes.
|
|
3776
|
+
function RegionPart(_a) {
|
|
3777
|
+
var show = _a.show,
|
|
3778
|
+
reducedExit = _a.reducedExit,
|
|
3779
|
+
children = _a.children;
|
|
3780
|
+
var _b = usePresence(show, reducedExit ? EXIT_DURATION_MS : EXIT_DURATION_MS * 2),
|
|
3781
|
+
isPresent = _b.isPresent,
|
|
3782
|
+
isExiting = _b.isExiting;
|
|
3783
|
+
var ref = React.useRef(null);
|
|
3784
|
+
// Leaving controls drop out of the tab order and can't be activated
|
|
3785
|
+
useInert(ref, isExiting);
|
|
3786
|
+
if (!isPresent) return null;
|
|
3787
|
+
return jsxRuntime.jsx(RegionItem, {
|
|
3788
|
+
ref: ref,
|
|
3789
|
+
"$exiting": isExiting,
|
|
3790
|
+
"$reducedExit": reducedExit,
|
|
3791
|
+
"aria-hidden": isExiting || undefined,
|
|
3792
|
+
children: jsxRuntime.jsx(RegionItemContent, {
|
|
3793
|
+
children: children
|
|
3794
|
+
})
|
|
3795
|
+
});
|
|
3796
|
+
}
|
|
3797
|
+
function AgentInputWithRef(_a, ref) {
|
|
3798
|
+
var _this = this;
|
|
3799
|
+
var _b;
|
|
3555
3800
|
var value = _a.value,
|
|
3556
|
-
|
|
3557
|
-
defaultValue =
|
|
3801
|
+
_c = _a.defaultValue,
|
|
3802
|
+
defaultValue = _c === void 0 ? '' : _c,
|
|
3558
3803
|
onChange = _a.onChange,
|
|
3559
3804
|
onSubmit = _a.onSubmit,
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3805
|
+
onStop = _a.onStop,
|
|
3806
|
+
review = _a.review,
|
|
3807
|
+
suggestions = _a.suggestions,
|
|
3808
|
+
onSuggestionSelect = _a.onSuggestionSelect,
|
|
3809
|
+
_d = _a.placeholder,
|
|
3810
|
+
placeholder = _d === void 0 ? 'Ask a question' : _d,
|
|
3811
|
+
maxLength = _a.maxLength,
|
|
3812
|
+
_e = _a.disabled,
|
|
3813
|
+
disabled = _e === void 0 ? false : _e,
|
|
3564
3814
|
isSubmitting = _a.isSubmitting,
|
|
3565
|
-
|
|
3566
|
-
enableVoice =
|
|
3567
|
-
|
|
3568
|
-
autoSubmitOnVoiceFinal =
|
|
3569
|
-
|
|
3570
|
-
voiceLanguage =
|
|
3571
|
-
|
|
3572
|
-
noSpeechTimeoutMs =
|
|
3815
|
+
_f = _a.enableVoice,
|
|
3816
|
+
enableVoice = _f === void 0 ? true : _f,
|
|
3817
|
+
_g = _a.autoSubmitOnVoiceFinal,
|
|
3818
|
+
autoSubmitOnVoiceFinal = _g === void 0 ? true : _g,
|
|
3819
|
+
_h = _a.voiceLanguage,
|
|
3820
|
+
voiceLanguage = _h === void 0 ? 'en-AU' : _h,
|
|
3821
|
+
_j = _a.noSpeechTimeoutMs,
|
|
3822
|
+
noSpeechTimeoutMs = _j === void 0 ? 8000 : _j,
|
|
3573
3823
|
onVoiceStart = _a.onVoiceStart,
|
|
3574
3824
|
onVoiceStop = _a.onVoiceStop,
|
|
3575
3825
|
onVoiceInterim = _a.onVoiceInterim,
|
|
3576
3826
|
onVoiceFinal = _a.onVoiceFinal,
|
|
3577
3827
|
onVoiceError = _a.onVoiceError,
|
|
3828
|
+
_k = _a.helperText,
|
|
3829
|
+
helperText = _k === void 0 ? '' : _k,
|
|
3578
3830
|
statusMessage = _a.statusMessage,
|
|
3579
3831
|
errorMessage = _a.errorMessage,
|
|
3580
|
-
|
|
3581
|
-
label =
|
|
3832
|
+
_l = _a.label,
|
|
3833
|
+
label = _l === void 0 ? 'Agent input' : _l,
|
|
3834
|
+
_m = _a.docked,
|
|
3835
|
+
docked = _m === void 0 ? false : _m,
|
|
3582
3836
|
dataTestId = _a["data-testid"];
|
|
3583
3837
|
var isControlled = value !== undefined;
|
|
3584
|
-
var
|
|
3585
|
-
internalValue =
|
|
3586
|
-
setInternalValue =
|
|
3587
|
-
var
|
|
3588
|
-
machineState =
|
|
3589
|
-
setMachineState =
|
|
3590
|
-
var
|
|
3591
|
-
interimTranscript =
|
|
3592
|
-
setInterimTranscript =
|
|
3593
|
-
var _o = React.useState(false),
|
|
3594
|
-
internalSubmitting = _o[0],
|
|
3595
|
-
setInternalSubmitting = _o[1];
|
|
3596
|
-
var _p = React.useState(undefined),
|
|
3597
|
-
internalErrorMessage = _p[0],
|
|
3598
|
-
setInternalErrorMessage = _p[1];
|
|
3599
|
-
var _q = React.useState(false),
|
|
3600
|
-
voiceSupported = _q[0],
|
|
3601
|
-
setVoiceSupported = _q[1];
|
|
3838
|
+
var _o = React.useState(defaultValue),
|
|
3839
|
+
internalValue = _o[0],
|
|
3840
|
+
setInternalValue = _o[1];
|
|
3841
|
+
var _p = React.useState(getInitialState(normalizeTranscript(value !== null && value !== void 0 ? value : defaultValue).length > 0)),
|
|
3842
|
+
machineState = _p[0],
|
|
3843
|
+
setMachineState = _p[1];
|
|
3844
|
+
var _q = React.useState(''),
|
|
3845
|
+
interimTranscript = _q[0],
|
|
3846
|
+
setInterimTranscript = _q[1];
|
|
3602
3847
|
var _r = React.useState(false),
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
var _s = React.useState(
|
|
3606
|
-
|
|
3607
|
-
|
|
3848
|
+
internalSubmitting = _r[0],
|
|
3849
|
+
setInternalSubmitting = _r[1];
|
|
3850
|
+
var _s = React.useState(undefined),
|
|
3851
|
+
internalErrorMessage = _s[0],
|
|
3852
|
+
setInternalErrorMessage = _s[1];
|
|
3853
|
+
var _t = React.useState(false),
|
|
3854
|
+
voiceSupported = _t[0],
|
|
3855
|
+
setVoiceSupported = _t[1];
|
|
3856
|
+
var _u = React.useState(false),
|
|
3857
|
+
prefersReducedMotion = _u[0],
|
|
3858
|
+
setPrefersReducedMotion = _u[1];
|
|
3859
|
+
var _v = React.useState(0),
|
|
3860
|
+
meterLevel = _v[0],
|
|
3861
|
+
setMeterLevel = _v[1];
|
|
3608
3862
|
var recognitionRef = React.useRef(null);
|
|
3609
3863
|
var noSpeechTimeoutRef = React.useRef(null);
|
|
3610
3864
|
var isStoppingRef = React.useRef(false);
|
|
@@ -3612,10 +3866,19 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3612
3866
|
var audioStreamRef = React.useRef(null);
|
|
3613
3867
|
var audioContextRef = React.useRef(null);
|
|
3614
3868
|
var meterRafRef = React.useRef(null);
|
|
3869
|
+
var inputRef = React.useRef(null);
|
|
3615
3870
|
var inputId = React.useId();
|
|
3616
3871
|
var statusId = "".concat(inputId, "-status");
|
|
3872
|
+
var counterId = "".concat(inputId, "-counter");
|
|
3617
3873
|
var currentValue = isControlled ? value !== null && value !== void 0 ? value : '' : internalValue;
|
|
3874
|
+
// Read after onSubmit settles, when the closure's value may be stale
|
|
3875
|
+
var currentValueRef = React.useRef(currentValue);
|
|
3876
|
+
React.useEffect(function () {
|
|
3877
|
+
currentValueRef.current = currentValue;
|
|
3878
|
+
}, [currentValue]);
|
|
3618
3879
|
var hasText = normalizeTranscript(currentValue).length > 0;
|
|
3880
|
+
var messageLength = normalizeMessage(currentValue).length;
|
|
3881
|
+
var isOverLimit = maxLength !== undefined && messageLength > maxLength;
|
|
3619
3882
|
var effectiveSubmitting = isSubmitting !== null && isSubmitting !== void 0 ? isSubmitting : internalSubmitting;
|
|
3620
3883
|
var effectiveState = disabled ? 'disabled' : machineState;
|
|
3621
3884
|
var isListening = effectiveState === 'listening';
|
|
@@ -3638,7 +3901,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3638
3901
|
}
|
|
3639
3902
|
}, []);
|
|
3640
3903
|
var stopMeter = React.useCallback(function () {
|
|
3641
|
-
return __awaiter(
|
|
3904
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3642
3905
|
return __generator(this, function (_a) {
|
|
3643
3906
|
switch (_a.label) {
|
|
3644
3907
|
case 0:
|
|
@@ -3666,7 +3929,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3666
3929
|
});
|
|
3667
3930
|
}, []);
|
|
3668
3931
|
var startMeter = React.useCallback(function () {
|
|
3669
|
-
return __awaiter(
|
|
3932
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3670
3933
|
var stream, audioContext, analyser_1, source, data_1, _loop_;
|
|
3671
3934
|
var _b;
|
|
3672
3935
|
return __generator(this, function (_c) {
|
|
@@ -3727,15 +3990,22 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3727
3990
|
});
|
|
3728
3991
|
}, [onVoiceError, updateMachineState]);
|
|
3729
3992
|
var submitPayload = React.useCallback(function (rawText, source) {
|
|
3730
|
-
return __awaiter(
|
|
3993
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3731
3994
|
var text;
|
|
3732
3995
|
return __generator(this, function (_b) {
|
|
3733
3996
|
switch (_b.label) {
|
|
3734
3997
|
case 0:
|
|
3735
|
-
text = normalizeTranscript(rawText);
|
|
3998
|
+
text = source === 'text' ? normalizeMessage(rawText) : normalizeTranscript(rawText);
|
|
3736
3999
|
if (!text || disabled || effectiveSubmitting) {
|
|
3737
4000
|
return [2 /*return*/];
|
|
3738
4001
|
}
|
|
4002
|
+
if (maxLength !== undefined && text.length > maxLength) {
|
|
4003
|
+
// A long transcript goes into the field to be shortened, unless the user has typed since
|
|
4004
|
+
if (source === 'voice-final' && !normalizeMessage(currentValueRef.current)) {
|
|
4005
|
+
updateValue(text);
|
|
4006
|
+
}
|
|
4007
|
+
return [2 /*return*/];
|
|
4008
|
+
}
|
|
3739
4009
|
updateMachineState({
|
|
3740
4010
|
type: 'SUBMIT'
|
|
3741
4011
|
});
|
|
@@ -3757,14 +4027,18 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3757
4027
|
type: 'SUBMIT_SUCCESS'
|
|
3758
4028
|
});
|
|
3759
4029
|
setInterimTranscript('');
|
|
3760
|
-
|
|
4030
|
+
// Keep a follow-up typed while submitting
|
|
4031
|
+
if (normalizeMessage(currentValueRef.current) === text) {
|
|
4032
|
+
updateValue('');
|
|
4033
|
+
}
|
|
3761
4034
|
return [3 /*break*/, 5];
|
|
3762
4035
|
case 3:
|
|
3763
4036
|
_b.sent();
|
|
3764
4037
|
updateMachineState({
|
|
3765
4038
|
type: 'SUBMIT_ERROR'
|
|
3766
4039
|
});
|
|
3767
|
-
|
|
4040
|
+
// Restore the transcript unless the user has typed something since
|
|
4041
|
+
if (source === 'voice-final' && !normalizeMessage(currentValueRef.current)) {
|
|
3768
4042
|
updateValue(text);
|
|
3769
4043
|
}
|
|
3770
4044
|
setInternalErrorMessage('Submission failed. Please try again.');
|
|
@@ -3779,13 +4053,13 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3779
4053
|
}
|
|
3780
4054
|
});
|
|
3781
4055
|
});
|
|
3782
|
-
}, [disabled, effectiveSubmitting, isSubmitting, onSubmit, updateMachineState, updateValue]);
|
|
4056
|
+
}, [disabled, effectiveSubmitting, isSubmitting, maxLength, onSubmit, updateMachineState, updateValue]);
|
|
3783
4057
|
var stopListening = React.useCallback(function (emitStopEvent_1) {
|
|
3784
4058
|
var args_1 = [];
|
|
3785
4059
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3786
4060
|
args_1[_i - 1] = arguments[_i];
|
|
3787
4061
|
}
|
|
3788
|
-
return __awaiter(
|
|
4062
|
+
return __awaiter(_this, __spreadArray([emitStopEvent_1], args_1, true), void 0, function (emitStopEvent, preserveState) {
|
|
3789
4063
|
if (preserveState === void 0) {
|
|
3790
4064
|
preserveState = false;
|
|
3791
4065
|
}
|
|
@@ -3821,7 +4095,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3821
4095
|
});
|
|
3822
4096
|
}, [clearNoSpeechTimeout, hasText, onVoiceStop, stopMeter, updateMachineState]);
|
|
3823
4097
|
var onNoSpeechTimeout = React.useCallback(function () {
|
|
3824
|
-
return __awaiter(
|
|
4098
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3825
4099
|
var message;
|
|
3826
4100
|
return __generator(this, function (_a) {
|
|
3827
4101
|
switch (_a.label) {
|
|
@@ -3845,7 +4119,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3845
4119
|
});
|
|
3846
4120
|
}, [clearNoSpeechTimeout, onVoiceError, stopListening, updateMachineState]);
|
|
3847
4121
|
var beginListening = React.useCallback(function () {
|
|
3848
|
-
return __awaiter(
|
|
4122
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3849
4123
|
return __generator(this, function (_b) {
|
|
3850
4124
|
switch (_b.label) {
|
|
3851
4125
|
case 0:
|
|
@@ -3889,7 +4163,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3889
4163
|
recognition.interimResults = true;
|
|
3890
4164
|
recognition.continuous = false;
|
|
3891
4165
|
recognition.onresult = function (event) {
|
|
3892
|
-
return __awaiter(
|
|
4166
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3893
4167
|
var interim, finalText, index, result, normalizedInterim, normalizedFinal;
|
|
3894
4168
|
return __generator(this, function (_a) {
|
|
3895
4169
|
switch (_a.label) {
|
|
@@ -3947,7 +4221,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3947
4221
|
});
|
|
3948
4222
|
};
|
|
3949
4223
|
recognition.onerror = function (event) {
|
|
3950
|
-
return __awaiter(
|
|
4224
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3951
4225
|
var mappedCode;
|
|
3952
4226
|
return __generator(this, function (_a) {
|
|
3953
4227
|
switch (_a.label) {
|
|
@@ -3963,7 +4237,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3963
4237
|
});
|
|
3964
4238
|
};
|
|
3965
4239
|
recognition.onend = function () {
|
|
3966
|
-
return __awaiter(
|
|
4240
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
3967
4241
|
return __generator(this, function (_a) {
|
|
3968
4242
|
switch (_a.label) {
|
|
3969
4243
|
case 0:
|
|
@@ -3992,6 +4266,95 @@ var AgentInput = function AgentInput(_a) {
|
|
|
3992
4266
|
stopMeter();
|
|
3993
4267
|
};
|
|
3994
4268
|
}, [autoSubmitOnVoiceFinal, clearNoSpeechTimeout, emitVoiceError, enableVoice, hasText, noSpeechTimeoutMs, onNoSpeechTimeout, onVoiceFinal, onVoiceInterim, stopListening, stopMeter, submitPayload, updateMachineState, updateValue, voiceLanguage]);
|
|
4269
|
+
var focusField = React.useCallback(function (cursor) {
|
|
4270
|
+
var input = inputRef.current;
|
|
4271
|
+
if (!input) return;
|
|
4272
|
+
input.focus();
|
|
4273
|
+
if (!cursor) return;
|
|
4274
|
+
var placeCursor = function placeCursor() {
|
|
4275
|
+
if (cursor === 'all') {
|
|
4276
|
+
input.select();
|
|
4277
|
+
return;
|
|
4278
|
+
}
|
|
4279
|
+
var position = cursor === 'start' ? 0 : input.value.length;
|
|
4280
|
+
input.setSelectionRange(position, position);
|
|
4281
|
+
};
|
|
4282
|
+
placeCursor();
|
|
4283
|
+
// Again after the render a prefill in the same handler triggers, so 'end' lands after the new text
|
|
4284
|
+
window.setTimeout(placeCursor, 0);
|
|
4285
|
+
}, []);
|
|
4286
|
+
React.useImperativeHandle(ref, function () {
|
|
4287
|
+
return {
|
|
4288
|
+
focus: function focus(options) {
|
|
4289
|
+
return focusField(options === null || options === void 0 ? void 0 : options.cursor);
|
|
4290
|
+
},
|
|
4291
|
+
clear: function clear() {
|
|
4292
|
+
setInterimTranscript('');
|
|
4293
|
+
updateValue('');
|
|
4294
|
+
}
|
|
4295
|
+
};
|
|
4296
|
+
}, [focusField, updateValue]);
|
|
4297
|
+
// The region above the field (decision 0046). The last review and suggestions shown are kept, so
|
|
4298
|
+
// they can fade out after the product removes them.
|
|
4299
|
+
var _w = React.useState(review),
|
|
4300
|
+
shownReview = _w[0],
|
|
4301
|
+
setShownReview = _w[1];
|
|
4302
|
+
var _x = React.useState(null),
|
|
4303
|
+
lastReviewAction = _x[0],
|
|
4304
|
+
setLastReviewAction = _x[1];
|
|
4305
|
+
if (review && review !== shownReview) {
|
|
4306
|
+
setShownReview(review);
|
|
4307
|
+
// A new proposal or change replaces what the last Discard or Undo announced
|
|
4308
|
+
if (lastReviewAction) setLastReviewAction(null);
|
|
4309
|
+
}
|
|
4310
|
+
// A proposal replacing an open one is announced as an update (decision 0047). Consecutive
|
|
4311
|
+
// replacements alternate a trailing no-break space, so the live region's text changes each time
|
|
4312
|
+
// even when the summary doesn't; screen readers don't speak it.
|
|
4313
|
+
var openProposalId = (review === null || review === void 0 ? void 0 : review.state) === 'proposal' ? review.id : null;
|
|
4314
|
+
var _y = React.useState(openProposalId),
|
|
4315
|
+
announcedProposalId = _y[0],
|
|
4316
|
+
setAnnouncedProposalId = _y[1];
|
|
4317
|
+
var _z = React.useState(0),
|
|
4318
|
+
replacementCount = _z[0],
|
|
4319
|
+
setReplacementCount = _z[1];
|
|
4320
|
+
if (openProposalId !== announcedProposalId) {
|
|
4321
|
+
setAnnouncedProposalId(openProposalId);
|
|
4322
|
+
setReplacementCount(openProposalId !== null && announcedProposalId !== null ? replacementCount + 1 : 0);
|
|
4323
|
+
}
|
|
4324
|
+
var cappedSuggestions = React.useMemo(function () {
|
|
4325
|
+
return (suggestions !== null && suggestions !== void 0 ? suggestions : []).slice(0, MAX_SUGGESTIONS);
|
|
4326
|
+
}, [suggestions]);
|
|
4327
|
+
var showSuggestions = cappedSuggestions.length > 0 && !hasText && (review === null || review === void 0 ? void 0 : review.state) !== 'proposal';
|
|
4328
|
+
var _0 = React.useState(cappedSuggestions),
|
|
4329
|
+
shownSuggestions = _0[0],
|
|
4330
|
+
setShownSuggestions = _0[1];
|
|
4331
|
+
if (showSuggestions && cappedSuggestions !== shownSuggestions) {
|
|
4332
|
+
setShownSuggestions(cappedSuggestions);
|
|
4333
|
+
}
|
|
4334
|
+
var suggestionCount = (_b = suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) !== null && _b !== void 0 ? _b : 0;
|
|
4335
|
+
React.useEffect(function () {
|
|
4336
|
+
if (!isProduction && suggestionCount > MAX_SUGGESTIONS) {
|
|
4337
|
+
console.warn("AgentInput shows at most ".concat(MAX_SUGGESTIONS, " suggestions (decision 0046); ").concat(suggestionCount, " were passed, so the rest are hidden."));
|
|
4338
|
+
}
|
|
4339
|
+
}, [suggestionCount]);
|
|
4340
|
+
var reviewAnnouncement = review ? review.state === 'proposal' ? "".concat(replacementCount > 0 ? 'Proposal updated. ' : '').concat(review.summary, ". Accept or discard.").concat(replacementCount > 0 && replacementCount % 2 === 0 ? "\xA0" : '') : 'Changes applied. Undo available.' : lastReviewAction === 'discarded' ? 'Suggestion discarded.' : lastReviewAction === 'undone' ? 'Changes undone.' : '';
|
|
4341
|
+
var onReviewDiscard = function onReviewDiscard(onDiscard) {
|
|
4342
|
+
setLastReviewAction('discarded');
|
|
4343
|
+
onDiscard();
|
|
4344
|
+
// The bar is leaving, so focus goes to the field rather than being lost
|
|
4345
|
+
focusField();
|
|
4346
|
+
};
|
|
4347
|
+
var onReviewUndo = function onReviewUndo(onUndo) {
|
|
4348
|
+
setLastReviewAction('undone');
|
|
4349
|
+
onUndo();
|
|
4350
|
+
focusField();
|
|
4351
|
+
};
|
|
4352
|
+
var onPickSuggestion = function onPickSuggestion(text) {
|
|
4353
|
+
updateValue(text);
|
|
4354
|
+
onSuggestionSelect === null || onSuggestionSelect === void 0 ? void 0 : onSuggestionSelect(text);
|
|
4355
|
+
// Fills, never sends: the user reviews the text in the field first
|
|
4356
|
+
focusField('end');
|
|
4357
|
+
};
|
|
3995
4358
|
React.useEffect(function () {
|
|
3996
4359
|
var mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
3997
4360
|
var sync = function sync() {
|
|
@@ -4023,8 +4386,40 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4023
4386
|
if (!interimTranscript) {
|
|
4024
4387
|
return currentValue;
|
|
4025
4388
|
}
|
|
4026
|
-
return
|
|
4389
|
+
return normalizeMessage([currentValue, interimTranscript].filter(Boolean).join(' '));
|
|
4027
4390
|
}, [currentValue, interimTranscript]);
|
|
4391
|
+
var lastFieldWidthRef = React.useRef(0);
|
|
4392
|
+
var resizeField = React.useCallback(function () {
|
|
4393
|
+
var field = inputRef.current;
|
|
4394
|
+
// Hidden (for example in a closed sheet): measure when it's shown, via the observer below
|
|
4395
|
+
if (!field || field.clientWidth === 0) return;
|
|
4396
|
+
lastFieldWidthRef.current = field.clientWidth;
|
|
4397
|
+
// Collapsing the field to measure it shrinks the page for a moment; some engines clamp a page
|
|
4398
|
+
// scrolled to the bottom when that happens, so restore its scroll position
|
|
4399
|
+
var scrollX = window.scrollX,
|
|
4400
|
+
scrollY = window.scrollY;
|
|
4401
|
+
field.style.height = 'auto';
|
|
4402
|
+
field.style.height = "".concat(field.scrollHeight, "px");
|
|
4403
|
+
if (window.scrollY !== scrollY) window.scrollTo(scrollX, scrollY);
|
|
4404
|
+
// Scroll only once max-height (six rows) clips the content
|
|
4405
|
+
field.style.overflowY = field.scrollHeight > field.clientHeight ? 'auto' : 'hidden';
|
|
4406
|
+
}, []);
|
|
4407
|
+
useIsomorphicLayoutEffect(function () {
|
|
4408
|
+
resizeField();
|
|
4409
|
+
}, [displayedValue, resizeField]);
|
|
4410
|
+
// Text rewraps when the field's width changes (layout, or being shown), not only the window's
|
|
4411
|
+
React.useEffect(function () {
|
|
4412
|
+
var field = inputRef.current;
|
|
4413
|
+
if (!field || typeof ResizeObserver === 'undefined') return;
|
|
4414
|
+
var observer = new ResizeObserver(function () {
|
|
4415
|
+
// Its own height changes trigger this too; only a width change can rewrap the text
|
|
4416
|
+
if (field.clientWidth !== lastFieldWidthRef.current) resizeField();
|
|
4417
|
+
});
|
|
4418
|
+
observer.observe(field);
|
|
4419
|
+
return function () {
|
|
4420
|
+
return observer.disconnect();
|
|
4421
|
+
};
|
|
4422
|
+
}, [resizeField]);
|
|
4028
4423
|
var onTextChange = function onTextChange(event) {
|
|
4029
4424
|
updateValue(event.target.value);
|
|
4030
4425
|
if (effectiveState === 'error') {
|
|
@@ -4036,10 +4431,18 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4036
4431
|
}
|
|
4037
4432
|
};
|
|
4038
4433
|
var onInputKeyDown = function onInputKeyDown(event) {
|
|
4039
|
-
return __awaiter(
|
|
4434
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
4435
|
+
var isComposing;
|
|
4040
4436
|
return __generator(this, function (_a) {
|
|
4041
4437
|
switch (_a.label) {
|
|
4042
4438
|
case 0:
|
|
4439
|
+
isComposing = event.nativeEvent.isComposing || event.keyCode === 229;
|
|
4440
|
+
// Escape during an IME composition cancels the composition, not the request
|
|
4441
|
+
if (event.key === 'Escape' && onStop && effectiveSubmitting && !isComposing) {
|
|
4442
|
+
event.preventDefault();
|
|
4443
|
+
onStop();
|
|
4444
|
+
return [2 /*return*/];
|
|
4445
|
+
}
|
|
4043
4446
|
if (!(event.key === 'Escape' && isListening)) return [3 /*break*/, 2];
|
|
4044
4447
|
event.preventDefault();
|
|
4045
4448
|
return [4 /*yield*/, stopListening(true)];
|
|
@@ -4047,7 +4450,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4047
4450
|
_a.sent();
|
|
4048
4451
|
return [2 /*return*/];
|
|
4049
4452
|
case 2:
|
|
4050
|
-
if (!(event.key === 'Enter')) return [3 /*break*/, 4];
|
|
4453
|
+
if (!(event.key === 'Enter' && !event.shiftKey && !isComposing)) return [3 /*break*/, 4];
|
|
4051
4454
|
event.preventDefault();
|
|
4052
4455
|
return [4 /*yield*/, submitPayload(currentValue, 'text')];
|
|
4053
4456
|
case 3:
|
|
@@ -4060,7 +4463,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4060
4463
|
});
|
|
4061
4464
|
};
|
|
4062
4465
|
var onMicToggle = function onMicToggle() {
|
|
4063
|
-
return __awaiter(
|
|
4466
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
4064
4467
|
return __generator(this, function (_a) {
|
|
4065
4468
|
switch (_a.label) {
|
|
4066
4469
|
case 0:
|
|
@@ -4080,40 +4483,105 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4080
4483
|
});
|
|
4081
4484
|
};
|
|
4082
4485
|
var statusByState = {
|
|
4083
|
-
idle: statusMessage ||
|
|
4084
|
-
typing: statusMessage ||
|
|
4486
|
+
idle: statusMessage || helperText,
|
|
4487
|
+
typing: statusMessage || helperText,
|
|
4085
4488
|
listening: statusMessage || DEFAULT_LISTENING_MESSAGE,
|
|
4086
4489
|
processingFinalTranscript: statusMessage || DEFAULT_PROCESSING_MESSAGE,
|
|
4087
4490
|
submitting: statusMessage || 'Submitting…',
|
|
4088
4491
|
error: errorMessage || internalErrorMessage || 'Voice input failed. Try again.',
|
|
4089
|
-
disabled: statusMessage ||
|
|
4492
|
+
disabled: statusMessage || helperText
|
|
4090
4493
|
};
|
|
4091
|
-
var
|
|
4092
|
-
|
|
4093
|
-
var resolvedStatus =
|
|
4094
|
-
var isStatusError = effectiveState === 'error'
|
|
4494
|
+
var overLimitMessage = isOverLimit && maxLength !== undefined ? "Over the ".concat(maxLength, "-character limit. Shorten your message to send.") : undefined;
|
|
4495
|
+
// A product-set error shows in any state. Unsupported voice hides the mic without a message.
|
|
4496
|
+
var resolvedStatus = errorMessage || overLimitMessage || statusByState[effectiveState];
|
|
4497
|
+
var isStatusError = Boolean(errorMessage) || isOverLimit || effectiveState === 'error';
|
|
4095
4498
|
var meterBars = createMeterBars(meterLevel);
|
|
4096
|
-
var
|
|
4499
|
+
var showStop = Boolean(onStop) && effectiveSubmitting;
|
|
4500
|
+
var sendDisabled = disabled || effectiveSubmitting || isOverLimit || messageLength === 0;
|
|
4501
|
+
var showCounter = maxLength !== undefined && messageLength >= maxLength * COUNTER_THRESHOLD;
|
|
4502
|
+
// Announced once when the limit is reached; going over is announced by the status line
|
|
4503
|
+
var limitAnnouncement = maxLength !== undefined && messageLength === maxLength ? "Character limit reached: ".concat(maxLength, " characters") : '';
|
|
4097
4504
|
return jsxRuntime.jsxs(Container, {
|
|
4098
4505
|
"data-testid": dataTestId,
|
|
4506
|
+
"$docked": docked,
|
|
4507
|
+
"data-docked": docked || undefined,
|
|
4099
4508
|
children: [jsxRuntime.jsx(VisuallyHiddenLabel, {
|
|
4100
4509
|
htmlFor: inputId,
|
|
4101
4510
|
children: label
|
|
4102
|
-
}), jsxRuntime.
|
|
4103
|
-
children: jsxRuntime.jsx(
|
|
4511
|
+
}), jsxRuntime.jsxs(ControlsRow, {
|
|
4512
|
+
children: [jsxRuntime.jsx(RegionPart, {
|
|
4513
|
+
show: Boolean(review),
|
|
4514
|
+
reducedExit: prefersReducedMotion,
|
|
4515
|
+
children: shownReview && jsxRuntime.jsxs(ReviewBar, {
|
|
4516
|
+
"data-testid": "agent-input-review",
|
|
4517
|
+
children: [jsxRuntime.jsx(Typography, {
|
|
4518
|
+
variant: "small",
|
|
4519
|
+
color: "default",
|
|
4520
|
+
children: shownReview.state === 'proposal' ? shownReview.summary : 'Changes applied'
|
|
4521
|
+
}), jsxRuntime.jsx(ReviewActions, {
|
|
4522
|
+
children: shownReview.state === 'proposal' ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4523
|
+
children: [jsxRuntime.jsx(Button, {
|
|
4524
|
+
variant: "primary",
|
|
4525
|
+
size: "small",
|
|
4526
|
+
onClick: shownReview.onAccept,
|
|
4527
|
+
children: "Accept"
|
|
4528
|
+
}), jsxRuntime.jsx(Button, {
|
|
4529
|
+
variant: "secondary",
|
|
4530
|
+
size: "small",
|
|
4531
|
+
onClick: function onClick() {
|
|
4532
|
+
return onReviewDiscard(shownReview.onDiscard);
|
|
4533
|
+
},
|
|
4534
|
+
children: "Discard"
|
|
4535
|
+
})]
|
|
4536
|
+
}) : jsxRuntime.jsx(Button, {
|
|
4537
|
+
variant: "naked",
|
|
4538
|
+
size: "small",
|
|
4539
|
+
onClick: function onClick() {
|
|
4540
|
+
return onReviewUndo(shownReview.onUndo);
|
|
4541
|
+
},
|
|
4542
|
+
children: "Undo"
|
|
4543
|
+
})
|
|
4544
|
+
})]
|
|
4545
|
+
})
|
|
4546
|
+
}), jsxRuntime.jsx(RegionPart, {
|
|
4547
|
+
show: showSuggestions,
|
|
4548
|
+
reducedExit: prefersReducedMotion,
|
|
4549
|
+
children: jsxRuntime.jsx(SuggestionList, {
|
|
4550
|
+
"aria-label": "Suggestions",
|
|
4551
|
+
"data-testid": "agent-input-suggestions",
|
|
4552
|
+
children: shownSuggestions.map(function (suggestion, index) {
|
|
4553
|
+
return jsxRuntime.jsx("li", {
|
|
4554
|
+
children: jsxRuntime.jsx(SuggestionChip, {
|
|
4555
|
+
onClick: function onClick() {
|
|
4556
|
+
return onPickSuggestion(suggestion);
|
|
4557
|
+
},
|
|
4558
|
+
children: suggestion
|
|
4559
|
+
})
|
|
4560
|
+
}, "".concat(index, "-").concat(suggestion));
|
|
4561
|
+
})
|
|
4562
|
+
})
|
|
4563
|
+
}), jsxRuntime.jsx(VisuallyHidden, {
|
|
4564
|
+
"aria-live": "polite",
|
|
4565
|
+
"aria-atomic": "true",
|
|
4566
|
+
"data-testid": "agent-input-review-announcement",
|
|
4567
|
+
children: reviewAnnouncement
|
|
4568
|
+
}), jsxRuntime.jsx(InputWrapper, {
|
|
4104
4569
|
children: jsxRuntime.jsxs(InputShell, {
|
|
4105
|
-
"data-disabled": disabled
|
|
4570
|
+
"data-disabled": disabled,
|
|
4106
4571
|
children: [jsxRuntime.jsx(Input, {
|
|
4572
|
+
ref: inputRef,
|
|
4107
4573
|
id: inputId,
|
|
4108
|
-
|
|
4574
|
+
rows: 1,
|
|
4575
|
+
enterKeyHint: "send",
|
|
4109
4576
|
"aria-label": label,
|
|
4110
4577
|
value: displayedValue,
|
|
4111
4578
|
onChange: onTextChange,
|
|
4112
4579
|
onKeyDown: onInputKeyDown,
|
|
4113
4580
|
placeholder: placeholder,
|
|
4114
|
-
disabled: disabled
|
|
4581
|
+
disabled: disabled,
|
|
4115
4582
|
readOnly: isListening,
|
|
4116
|
-
"aria-describedby": statusId
|
|
4583
|
+
"aria-describedby": showCounter ? "".concat(statusId, " ").concat(counterId) : statusId,
|
|
4584
|
+
"aria-invalid": isOverLimit || undefined
|
|
4117
4585
|
}), jsxRuntime.jsxs(InputActions, {
|
|
4118
4586
|
children: [hasVoice && jsxRuntime.jsxs(MicButtonWrapper, {
|
|
4119
4587
|
"$isListening": isListening,
|
|
@@ -4133,7 +4601,17 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4133
4601
|
disabled: disabled || effectiveSubmitting,
|
|
4134
4602
|
type: "button"
|
|
4135
4603
|
})]
|
|
4136
|
-
}), jsxRuntime.jsx(CircularActionIconButton, {
|
|
4604
|
+
}), showStop ? jsxRuntime.jsx(CircularActionIconButton, {
|
|
4605
|
+
variant: "secondary",
|
|
4606
|
+
size: "medium",
|
|
4607
|
+
iconName: "stop",
|
|
4608
|
+
onClick: function onClick() {
|
|
4609
|
+
return onStop === null || onStop === void 0 ? void 0 : onStop();
|
|
4610
|
+
},
|
|
4611
|
+
disabled: disabled,
|
|
4612
|
+
"aria-label": "Stop",
|
|
4613
|
+
type: "button"
|
|
4614
|
+
}) : jsxRuntime.jsx(CircularActionIconButton, {
|
|
4137
4615
|
variant: "secondary",
|
|
4138
4616
|
size: "medium",
|
|
4139
4617
|
iconName: "directionUp",
|
|
@@ -4146,7 +4624,7 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4146
4624
|
})]
|
|
4147
4625
|
})]
|
|
4148
4626
|
})
|
|
4149
|
-
})
|
|
4627
|
+
})]
|
|
4150
4628
|
}), jsxRuntime.jsxs(StatusRow, {
|
|
4151
4629
|
children: [jsxRuntime.jsx(StatusText, {
|
|
4152
4630
|
"$isError": isStatusError,
|
|
@@ -4155,24 +4633,44 @@ var AgentInput = function AgentInput(_a) {
|
|
|
4155
4633
|
role: "status",
|
|
4156
4634
|
"aria-live": "polite",
|
|
4157
4635
|
"aria-atomic": "true",
|
|
4158
|
-
children: jsxRuntime.jsx(Typography, {
|
|
4636
|
+
children: resolvedStatus && jsxRuntime.jsx(Typography, {
|
|
4159
4637
|
variant: "small",
|
|
4160
4638
|
color: isStatusError ? 'error' : 'subdued',
|
|
4161
4639
|
children: resolvedStatus
|
|
4162
4640
|
})
|
|
4163
4641
|
})
|
|
4164
|
-
}),
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4642
|
+
}), jsxRuntime.jsxs(StatusEnd, {
|
|
4643
|
+
children: [isListening && !prefersReducedMotion && jsxRuntime.jsx(MeterContainer, {
|
|
4644
|
+
"aria-hidden": "true",
|
|
4645
|
+
children: meterBars.map(function (barHeight, index) {
|
|
4646
|
+
return jsxRuntime.jsx(MeterBar, {
|
|
4647
|
+
"$height": barHeight
|
|
4648
|
+
}, "meter-".concat(index));
|
|
4649
|
+
})
|
|
4650
|
+
}), showCounter && jsxRuntime.jsx(Typography, {
|
|
4651
|
+
variant: "small",
|
|
4652
|
+
color: isOverLimit ? 'error' : 'subdued',
|
|
4653
|
+
children: jsxRuntime.jsxs("span", {
|
|
4654
|
+
id: counterId,
|
|
4655
|
+
"data-testid": "agent-input-counter",
|
|
4656
|
+
children: [messageLength, "/", maxLength, jsxRuntime.jsx(VisuallyHidden, {
|
|
4657
|
+
children: " characters"
|
|
4658
|
+
})]
|
|
4659
|
+
})
|
|
4660
|
+
})]
|
|
4661
|
+
}), maxLength !== undefined && jsxRuntime.jsx(VisuallyHidden, {
|
|
4662
|
+
role: "status",
|
|
4663
|
+
"aria-live": "polite",
|
|
4664
|
+
"aria-atomic": "true",
|
|
4665
|
+
"data-testid": "agent-input-limit-announcement",
|
|
4666
|
+
children: limitAnnouncement
|
|
4171
4667
|
})]
|
|
4172
4668
|
})]
|
|
4173
4669
|
});
|
|
4174
|
-
}
|
|
4175
|
-
var
|
|
4670
|
+
}
|
|
4671
|
+
var AgentInput = /*#__PURE__*/React.forwardRef(AgentInputWithRef);
|
|
4672
|
+
AgentInput.displayName = 'AgentInput';
|
|
4673
|
+
var templateObject_1$q, templateObject_2$l, templateObject_3$k, templateObject_4$f, templateObject_5$c, templateObject_6$9, templateObject_7$7, templateObject_8$6, templateObject_9$5, templateObject_10$3, templateObject_11$3, templateObject_12$3, templateObject_13$3, templateObject_14$1, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21$1, templateObject_22$1, templateObject_23$1, templateObject_24$1, templateObject_25$1, templateObject_26$1, templateObject_27$1, templateObject_28$1, templateObject_29$1, templateObject_30$1, templateObject_31$1, templateObject_32$1, templateObject_33$1;
|
|
4176
4674
|
|
|
4177
4675
|
var semantic$9 = tokens.semantic;
|
|
4178
4676
|
var alert = tokens.component.alert;
|
|
@@ -8292,6 +8790,7 @@ var ResponsiveGrid = function ResponsiveGrid(_a) {
|
|
|
8292
8790
|
};
|
|
8293
8791
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35;
|
|
8294
8792
|
|
|
8793
|
+
exports.AILabel = AILabel;
|
|
8295
8794
|
exports.AccountCard = AccountCard;
|
|
8296
8795
|
exports.ActionSheet = ActionSheet;
|
|
8297
8796
|
exports.AgentInput = AgentInput;
|
|
@@ -8343,6 +8842,7 @@ exports.StatusBadge = StatusBadge;
|
|
|
8343
8842
|
exports.StatusLabel = StatusLabel;
|
|
8344
8843
|
exports.StyledInputBase = StyledInputBase;
|
|
8345
8844
|
exports.StyledTextAreaBase = StyledTextAreaBase;
|
|
8845
|
+
exports.SuggestionChip = SuggestionChip;
|
|
8346
8846
|
exports.TabBar = TabBar;
|
|
8347
8847
|
exports.Tag = Tag;
|
|
8348
8848
|
exports.TextField = TextField;
|