@3fn/core 13.0.0 → 14.0.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/.kiro/agents/ada-prompt.md +80 -132
- package/.kiro/agents/ada-prompt.md.attribution.json +45 -0
- package/.kiro/agents/ada.json +44 -59
- package/.kiro/agents/ada.json.attribution.json +13 -0
- package/.kiro/agents/data-prompt.md +83 -74
- package/.kiro/agents/data-prompt.md.attribution.json +53 -0
- package/.kiro/agents/data.json +31 -38
- package/.kiro/agents/data.json.attribution.json +13 -0
- package/.kiro/agents/kenya-prompt.md +83 -72
- package/.kiro/agents/kenya-prompt.md.attribution.json +53 -0
- package/.kiro/agents/kenya.json +27 -35
- package/.kiro/agents/kenya.json.attribution.json +13 -0
- package/.kiro/agents/leonardo-prompt.md +176 -234
- package/.kiro/agents/leonardo-prompt.md.attribution.json +45 -0
- package/.kiro/agents/leonardo.json +28 -36
- package/.kiro/agents/leonardo.json.attribution.json +13 -0
- package/.kiro/agents/lina-prompt.md +110 -151
- package/.kiro/agents/lina-prompt.md.attribution.json +53 -0
- package/.kiro/agents/lina.json +46 -59
- package/.kiro/agents/lina.json.attribution.json +13 -0
- package/.kiro/agents/sparky-prompt.md +89 -72
- package/.kiro/agents/sparky-prompt.md.attribution.json +53 -0
- package/.kiro/agents/sparky.json +37 -37
- package/.kiro/agents/sparky.json.attribution.json +13 -0
- package/.kiro/agents/stacy-prompt.md +74 -48
- package/.kiro/agents/stacy-prompt.md.attribution.json +45 -0
- package/.kiro/agents/stacy.json +28 -30
- package/.kiro/agents/stacy.json.attribution.json +13 -0
- package/.kiro/agents/thurgood-prompt.md +94 -138
- package/.kiro/agents/thurgood-prompt.md.attribution.json +45 -0
- package/.kiro/agents/thurgood.json +31 -35
- package/.kiro/agents/thurgood.json.attribution.json +13 -0
- package/.kiro/steering/AI-Collaboration-Principles.md +3 -3
- package/.kiro/steering/Civitas-System-Overview.md +5 -5
- package/.kiro/steering/DesignerPunk-Systems-Overview.md +6 -6
- package/.kiro/steering/Task-Completion-Protocol.md +98 -17
- package/.kiro/steering/core-goals.md +3 -3
- package/.kiro/steering/personal-note.md +1 -1
- package/.kiro/steering/start-up-tasks.md +14 -3
- package/application-mcp-server/src/index.ts +26 -0
- package/dist/ComponentTokens.android.kt +1 -1
- package/dist/ComponentTokens.ios.swift +1 -1
- package/dist/ComponentTokens.web.css +1 -1
- package/dist/DesignTokens.android.kt +1 -1
- package/dist/DesignTokens.dtcg.json +8 -5
- package/dist/DesignTokens.figma.json +2 -2
- package/dist/DesignTokens.ios.swift +1 -1
- package/dist/DesignTokens.web.css +1 -1
- package/dist/android/DesignTokens.android.kt +1 -1
- package/dist/blend/OklchBlendCalculator.js +1 -0
- package/dist/blend/ThemeAwareBlendUtilities.web.d.ts +13 -2
- package/dist/blend/ThemeAwareBlendUtilities.web.js +6 -1
- package/dist/browser/designerpunk.esm.js +22 -81
- package/dist/browser/designerpunk.esm.min.js +29 -32
- package/dist/browser/designerpunk.umd.js +22 -81
- package/dist/browser/designerpunk.umd.min.js +42 -45
- package/dist/browser/tokens.css +1 -1
- package/dist/components/core/Avatar-Base/platforms/web/Avatar.web.js +24 -5
- package/dist/components/core/Button-CTA/examples/BasicUsage.d.ts +16 -28
- package/dist/components/core/Button-CTA/examples/BasicUsage.js +18 -43
- package/dist/components/core/Button-CTA/platforms/web/ButtonCTA.web.d.ts +3 -15
- package/dist/components/core/Button-CTA/platforms/web/ButtonCTA.web.js +9 -58
- package/dist/components/core/Button-CTA/types.d.ts +0 -24
- package/dist/components/core/Button-CTA/types.js +6 -0
- package/dist/components/core/Input-Text-Base/types.d.ts +13 -1
- package/dist/components/core/Input-Text-Password/platforms/web/InputTextPassword.web.js +11 -2
- package/dist/generators/DTCGFormatGenerator.js +8 -0
- package/dist/integration/BuildErrorHandler.js +2 -2
- package/dist/ios/DesignTokens.ios.swift +1 -1
- package/dist/mcp/application-mcp.js +24 -0
- package/dist/mcp/docs-mcp.js +130 -15
- package/dist/mcp/product-mcp.js +25 -0
- package/dist/tokens/OpacityTokens.js +1 -1
- package/dist/tokens/semantic/BlendTokens.d.ts +10 -3
- package/dist/tokens/semantic/BlendTokens.js +17 -5
- package/dist/tokens/semantic/OpacityTokens.d.ts +4 -4
- package/dist/tokens/semantic/OpacityTokens.js +4 -4
- package/dist/types/ComponentTypes.d.ts +1 -1
- package/dist/types/generated/TokenTypes.d.ts +1 -1
- package/dist/types/generated/TokenTypes.js +1 -1
- package/dist/validators/StemmaTokenUsageValidator.js +3 -2
- package/dist/web/DesignTokens.web.css +1 -1
- package/governance/Component-Development-Guide.md +22 -12
- package/governance/Component-Development-Standards.md +2 -2
- package/governance/Component-Family-Avatar.md +0 -1
- package/governance/Component-Family-Badge.md +0 -1
- package/governance/Component-Family-Button.md +4 -17
- package/governance/Component-Family-Chip.md +0 -1
- package/governance/Component-Family-Container.md +0 -1
- package/governance/Component-Family-Data-Display.md +1 -2
- package/governance/Component-Family-Divider.md +1 -2
- package/governance/Component-Family-Form-Inputs.md +5 -5
- package/governance/Component-Family-Icon.md +1 -2
- package/governance/Component-Family-Loading.md +1 -2
- package/governance/Component-Family-Modal.md +1 -2
- package/governance/Component-Family-Navigation.md +0 -1
- package/governance/Component-Family-Progress.md +0 -1
- package/governance/Component-Inheritance-Structures.md +195 -76
- package/governance/Component-MCP-Document-Template.md +6 -5
- package/governance/Component-Primitive-vs-Semantic-Philosophy.md +1 -1
- package/governance/Component-Quick-Reference.md +33 -33
- package/governance/Component-Readiness-Status.md +54 -38
- package/governance/Component-Templates.md +32 -36
- package/governance/Contract-System-Reference.md +6 -6
- package/governance/MCP-Integration-Guide.md +1 -1
- package/governance/Process-Cross-Reference-Standards.md +31 -13
- package/governance/Process-Development-Workflow.md +49 -59
- package/governance/Process-File-Organization.md +24 -24
- package/governance/Process-Hook-Operations.md +19 -7
- package/governance/Process-Orchestration-Model-Selection.md +92 -0
- package/governance/Process-Spec-Planning.md +91 -39
- package/governance/Process-Task-Type-Definitions.md +80 -4
- package/governance/Product-Handoff-Protocol.md +2 -0
- package/governance/Rosetta-System-Architecture.md +6 -6
- package/governance/Test-Behavioral-Contract-Validation.md +38 -31
- package/governance/Test-Failure-Audit-Methodology.md +1 -1
- package/governance/Token-Family-Accessibility.md +1 -2
- package/governance/Token-Family-Blend.md +18 -16
- package/governance/Token-Family-Blur.md +0 -1
- package/governance/Token-Family-Border.md +1 -2
- package/governance/Token-Family-Color.md +0 -1
- package/governance/Token-Family-Glow.md +1 -2
- package/governance/Token-Family-Layering.md +0 -1
- package/governance/Token-Family-Motion.md +1 -2
- package/governance/Token-Family-Opacity.md +0 -1
- package/governance/Token-Family-Radius.md +1 -2
- package/governance/Token-Family-Responsive.md +1 -2
- package/governance/Token-Family-Shadow.md +1 -2
- package/governance/Token-Family-Sizing.md +0 -1
- package/governance/Token-Family-Spacing.md +1 -2
- package/governance/Token-Family-Typography.md +1 -2
- package/governance/Token-Governance.md +8 -8
- package/governance/Token-Quick-Reference.md +21 -21
- package/governance/Token-Resolution-Patterns.md +1 -1
- package/governance/Token-Semantic-Structure.md +1 -1
- package/governance/Web-Authoring-Standards.md +5 -5
- package/governance/browser-distribution-guide.md +1 -4
- package/governance/classification-map.md +368 -0
- package/governance/completion-documentation-guide.md +11 -8
- package/governance/component-meta-authoring-guide.md +1 -1
- package/governance/cross-platform-vs-platform-specific-decision-framework.md +1 -1
- package/governance/platform-implementation-guidelines.md +1 -1
- package/governance/release-management-system.md +2 -2
- package/governance/rosetta-system-principles.md +8 -6
- package/governance/stemma-system-principles.md +18 -17
- package/mcp-server/src/index.ts +24 -6
- package/mcp-server/src/indexer/DocumentIndexer.ts +119 -9
- package/mcp-server/src/indexer/__tests__/bare-id-crossrefs.test.ts +250 -0
- package/mcp-server/src/indexer/cross-ref-parser.ts +29 -1
- package/mcp-server/src/indexer/index-health.ts +27 -2
- package/mcp-server/src/query/__tests__/find-docs-calibration.test.ts +11 -26
- package/mcp-server/src/relocation-integrity-gate/__tests__/relocation-integrity-gate.test.ts +72 -5
- package/mcp-server/src/relocation-integrity-gate/relocation-integrity-gate.ts +81 -24
- package/mcp-server/src/tools/list-cross-references.ts +2 -2
- package/package.json +23 -21
- package/src/__tests__/browser-distribution/css-bundling.test.ts +6 -4
- package/src/__tests__/console-allowlist.json +14 -0
- package/src/__tests__/console-fail-setup.ts +169 -0
- package/src/__tests__/integration/Spec107-DesignLanguageContext.test.ts +16 -0
- package/src/__tests__/stemma-system/behavioral-contract-validation.test.ts +70 -17
- package/src/__tests__/stemma-system/contract-catalog-name-validation.test.ts +28 -0
- package/src/__tests__/stemma-system/form-inputs-contracts.test.ts +223 -16
- package/src/__tests__/stemma-system/input-text-native-base-call-alignment.test.ts +298 -0
- package/src/blend/OklchBlendCalculator.ts +3 -0
- package/src/blend/ThemeAwareBlendUtilities.android.kt +3 -0
- package/src/blend/ThemeAwareBlendUtilities.ios.swift +3 -0
- package/src/blend/ThemeAwareBlendUtilities.web.ts +9 -1
- package/src/blend/__tests__/InteractionStateAudit.test.ts +12 -9
- package/src/build/errors/__tests__/ErrorHandler.integration.test.ts +8 -0
- package/src/build/errors/__tests__/ErrorHandler.test.ts +5 -0
- package/src/build/workflow/__tests__/CICDIntegration.test.ts +12 -1
- package/src/cli/__tests__/init.test.ts +45 -11
- package/src/components/core/Avatar-Base/Avatar-Base.schema.yaml +1 -1
- package/src/components/core/Avatar-Base/__tests__/Avatar.accessibility.test.ts +121 -7
- package/src/components/core/Avatar-Base/__tests__/Avatar.image.test.ts +3 -0
- package/src/components/core/Avatar-Base/__tests__/Avatar.test.ts +15 -6
- package/src/components/core/Avatar-Base/contracts.yaml +11 -1
- package/src/components/core/Avatar-Base/platforms/web/Avatar.web.ts +24 -5
- package/src/components/core/Badge-Count-Base/contracts.yaml +1 -1
- package/src/components/core/Badge-Label-Base/contracts.yaml +1 -1
- package/src/components/core/Button-CTA/Button-CTA.schema.yaml +2 -12
- package/src/components/core/Button-CTA/README.md +3 -6
- package/src/components/core/Button-CTA/__tests__/ButtonCTA.test.ts +35 -89
- package/src/components/core/Button-CTA/__tests__/setup.test.ts +0 -2
- package/src/components/core/Button-CTA/__tests__/test-utils.ts +0 -2
- package/src/components/core/Button-CTA/contracts.yaml +6 -29
- package/src/components/core/Button-CTA/examples/BasicUsage.html +2 -14
- package/src/components/core/Button-CTA/examples/BasicUsage.tsx +17 -44
- package/src/components/core/Button-CTA/platforms/android/ButtonCTA.android.kt +12 -20
- package/src/components/core/Button-CTA/platforms/ios/ButtonCTA.ios.swift +12 -51
- package/src/components/core/Button-CTA/platforms/web/ButtonCTA.web.css +2 -26
- package/src/components/core/Button-CTA/platforms/web/ButtonCTA.web.ts +18 -71
- package/src/components/core/Button-CTA/types.ts +10 -28
- package/src/components/core/Chip-Base/__tests__/ChipBase.test.ts +13 -0
- package/src/components/core/Chip-Filter/__tests__/ChipFilter.test.ts +13 -0
- package/src/components/core/Chip-Input/__tests__/ChipInput.test.ts +13 -0
- package/src/components/core/Input-Text-Base/Input-Text-Base.schema.yaml +30 -2
- package/src/components/core/Input-Text-Base/README.md +25 -2
- package/src/components/core/Input-Text-Base/__tests__/focusIndicators.test.ts +16 -15
- package/src/components/core/Input-Text-Base/contracts.yaml +90 -0
- package/src/components/core/Input-Text-Base/platforms/android/InputTextBase.android.kt +26 -12
- package/src/components/core/Input-Text-Base/platforms/ios/InputTextBase.ios.swift +195 -59
- package/src/components/core/Input-Text-Base/types.ts +13 -1
- package/src/components/core/Input-Text-Email/Input-Text-Email.schema.yaml +5 -1
- package/src/components/core/Input-Text-Email/README.md +8 -7
- package/src/components/core/Input-Text-Email/platforms/android/InputTextEmail.android.kt +1 -4
- package/src/components/core/Input-Text-Email/platforms/ios/InputTextEmail.ios.swift +2 -16
- package/src/components/core/Input-Text-Password/Input-Text-Password.schema.yaml +10 -3
- package/src/components/core/Input-Text-Password/README.md +9 -8
- package/src/components/core/Input-Text-Password/contracts.yaml +5 -0
- package/src/components/core/Input-Text-Password/platforms/android/InputTextPassword.android.kt +17 -7
- package/src/components/core/Input-Text-Password/platforms/ios/InputTextPassword.ios.swift +22 -20
- package/src/components/core/Input-Text-Password/platforms/web/InputTextPassword.web.ts +11 -2
- package/src/components/core/Input-Text-PhoneNumber/Input-Text-PhoneNumber.schema.yaml +5 -1
- package/src/components/core/Input-Text-PhoneNumber/README.md +9 -8
- package/src/components/core/Input-Text-PhoneNumber/platforms/android/InputTextPhoneNumber.android.kt +2 -5
- package/src/components/core/Input-Text-PhoneNumber/platforms/ios/InputTextPhoneNumber.ios.swift +3 -17
- package/src/components/core/Nav-Header-App/contracts.yaml +1 -1
- package/src/components/core/Nav-SegmentedChoice-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Connector-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Label-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Node-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Stepper-Base/__tests__/StepperBase.test.ts +5 -2
- package/src/components/core/Progress-Stepper-Detailed/__tests__/StepperDetailed.test.ts +5 -2
- package/src/generators/DTCGFormatGenerator.ts +6 -0
- package/src/generators/__tests__/DTCGConfigOptions.test.ts +14 -5
- package/src/integration/BuildErrorHandler.ts +2 -2
- package/src/tokens/OpacityTokens.ts +1 -1
- package/src/tokens/__tests__/OpacityTokens.test.ts +3 -1
- package/src/tokens/semantic/BlendTokens.ts +26 -5
- package/src/tokens/semantic/OpacityTokens.ts +4 -4
- package/src/tools/release/__tests__/ReleasePipeline.test.ts +1 -1
- package/src/types/ComponentTypes.ts +1 -1
- package/src/types/generated/TokenTypes.ts +1 -1
- package/src/validators/StemmaTokenUsageValidator.ts +3 -2
- package/token-index/semantics.yaml +1 -2
|
@@ -193,7 +193,11 @@ var BlendTokenValues = {
|
|
|
193
193
|
pressedDarker: 0.12,
|
|
194
194
|
/** Focus state saturation increase - blend200 (8%) */
|
|
195
195
|
focusSaturate: 0.08,
|
|
196
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Disabled state desaturation - blend300 (12%)
|
|
198
|
+
* @deprecated 2026-07-15 — DesignerPunk does not support disabled states; if an action
|
|
199
|
+
* is unavailable, do not render the component. Scheduled for removal at the next major.
|
|
200
|
+
*/
|
|
197
201
|
disabledDesaturate: 0.12,
|
|
198
202
|
/** Icon optical balance lightening - blend200 (8%) */
|
|
199
203
|
iconLighter: 0.08
|
|
@@ -240,6 +244,7 @@ function createBlendUtilities() {
|
|
|
240
244
|
hoverColor: (baseColor) => darkerBlend(baseColor, BlendTokenValues.hoverDarker),
|
|
241
245
|
pressedColor: (baseColor) => darkerBlend(baseColor, BlendTokenValues.pressedDarker),
|
|
242
246
|
focusColor: (baseColor) => saturate(baseColor, BlendTokenValues.focusSaturate),
|
|
247
|
+
// deprecated 2026-07-15 (no-disabled-states philosophy) — removal at next major
|
|
243
248
|
disabledColor: (baseColor) => desaturate(baseColor, BlendTokenValues.disabledDesaturate),
|
|
244
249
|
iconColor: (baseColor) => lighterBlend(baseColor, BlendTokenValues.iconLighter),
|
|
245
250
|
// Generic blend functions for custom usage
|
|
@@ -1697,6 +1702,9 @@ var InputTextPassword = class extends HTMLElement {
|
|
|
1697
1702
|
"error-message",
|
|
1698
1703
|
"is-success",
|
|
1699
1704
|
"show-info-icon",
|
|
1705
|
+
// read-only is accepted for API stability but IGNORED — readOnly is
|
|
1706
|
+
// contracted out of Input-Text-Password (see render(), and
|
|
1707
|
+
// contracts.yaml excludes.state_readonly).
|
|
1700
1708
|
"read-only",
|
|
1701
1709
|
"required",
|
|
1702
1710
|
"max-length",
|
|
@@ -1766,7 +1774,6 @@ var InputTextPassword = class extends HTMLElement {
|
|
|
1766
1774
|
const propsErrorMessage = this.getAttribute("error-message") || "";
|
|
1767
1775
|
const isSuccess = this.getAttribute("is-success") === "true";
|
|
1768
1776
|
const showInfoIcon = this.getAttribute("show-info-icon") === "true";
|
|
1769
|
-
const readOnly = this.hasAttribute("read-only");
|
|
1770
1777
|
const required = this.hasAttribute("required");
|
|
1771
1778
|
const maxLength = this.getAttribute("max-length");
|
|
1772
1779
|
const showToggle = this.getAttribute("show-toggle") !== "false";
|
|
@@ -1801,7 +1808,6 @@ var InputTextPassword = class extends HTMLElement {
|
|
|
1801
1808
|
${errorMessage ? `error-message="${errorMessage}"` : ""}
|
|
1802
1809
|
${isSuccess ? 'is-success="true"' : ""}
|
|
1803
1810
|
${showInfoIcon ? 'show-info-icon="true"' : ""}
|
|
1804
|
-
${readOnly ? "read-only" : ""}
|
|
1805
1811
|
${required ? "required" : ""}
|
|
1806
1812
|
${maxLength ? `max-length="${maxLength}"` : ""}
|
|
1807
1813
|
></input-text-base>
|
|
@@ -2663,7 +2669,7 @@ var ButtonCTA_web_default = `/**
|
|
|
2663
2669
|
* The --_cta-hover-bg custom property is set by the component
|
|
2664
2670
|
* using darkerBlend(color.primary, blend.hoverDarker) = 8% darker.
|
|
2665
2671
|
*/
|
|
2666
|
-
.button-cta--primary:hover
|
|
2672
|
+
.button-cta--primary:hover {
|
|
2667
2673
|
background-color: var(--_cta-hover-bg);
|
|
2668
2674
|
}
|
|
2669
2675
|
|
|
@@ -2676,7 +2682,7 @@ var ButtonCTA_web_default = `/**
|
|
|
2676
2682
|
* The --_cta-pressed-bg custom property is set by the component
|
|
2677
2683
|
* using darkerBlend(color.primary, blend.pressedDarker) = 12% darker.
|
|
2678
2684
|
*/
|
|
2679
|
-
.button-cta--primary:active
|
|
2685
|
+
.button-cta--primary:active {
|
|
2680
2686
|
background-color: var(--_cta-pressed-bg);
|
|
2681
2687
|
}
|
|
2682
2688
|
|
|
@@ -2706,30 +2712,6 @@ var ButtonCTA_web_default = `/**
|
|
|
2706
2712
|
outline: none;
|
|
2707
2713
|
}
|
|
2708
2714
|
|
|
2709
|
-
/**
|
|
2710
|
-
* Disabled state.
|
|
2711
|
-
*
|
|
2712
|
-
* Uses blend utility calculated color (desaturate with blend.disabledDesaturate)
|
|
2713
|
-
* instead of opacity workaround for cross-platform consistency.
|
|
2714
|
-
*
|
|
2715
|
-
* The --button-disabled-color custom property is set by the component
|
|
2716
|
-
* using desaturate(color.primary, blend.disabledDesaturate) = 12% less saturated.
|
|
2717
|
-
*
|
|
2718
|
-
* - Cursor changes to not-allowed
|
|
2719
|
-
* - Prevents interaction
|
|
2720
|
-
* - Maintains color contrast for accessibility
|
|
2721
|
-
*/
|
|
2722
|
-
.button-cta:disabled,
|
|
2723
|
-
.button-cta--disabled {
|
|
2724
|
-
cursor: not-allowed;
|
|
2725
|
-
pointer-events: none;
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2728
|
-
.button-cta--primary:disabled,
|
|
2729
|
-
.button-cta--primary.button-cta--disabled {
|
|
2730
|
-
background-color: var(--_cta-disabled-bg);
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
2715
|
/* ==========================================================================
|
|
2734
2716
|
Responsive Behavior
|
|
2735
2717
|
========================================================================== */
|
|
@@ -2844,7 +2826,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2844
2826
|
// Cached blend colors for state styling
|
|
2845
2827
|
this._hoverColor = "";
|
|
2846
2828
|
this._pressedColor = "";
|
|
2847
|
-
this._disabledColor = "";
|
|
2848
2829
|
this._iconColor = "";
|
|
2849
2830
|
this._iconOpticalBalanceColor = "";
|
|
2850
2831
|
/**
|
|
@@ -2853,11 +2834,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2853
2834
|
* Dispatches a custom 'press' event that bubbles up to parent elements.
|
|
2854
2835
|
*/
|
|
2855
2836
|
this._handleClick = (event) => {
|
|
2856
|
-
if (this.disabled) {
|
|
2857
|
-
event.preventDefault();
|
|
2858
|
-
event.stopPropagation();
|
|
2859
|
-
return;
|
|
2860
|
-
}
|
|
2861
2837
|
this.dispatchEvent(new CustomEvent("press", {
|
|
2862
2838
|
bubbles: true,
|
|
2863
2839
|
composed: true,
|
|
@@ -2874,9 +2850,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2874
2850
|
* @param event - The keyboard event
|
|
2875
2851
|
*/
|
|
2876
2852
|
this._handleKeyDown = (event) => {
|
|
2877
|
-
if (this.disabled) {
|
|
2878
|
-
return;
|
|
2879
|
-
}
|
|
2880
2853
|
if (event.key === "Enter" || event.key === " ") {
|
|
2881
2854
|
event.preventDefault();
|
|
2882
2855
|
this.dispatchEvent(new CustomEvent("press", {
|
|
@@ -2895,7 +2868,7 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2895
2868
|
* When these attributes change, attributeChangedCallback is invoked.
|
|
2896
2869
|
*/
|
|
2897
2870
|
static get observedAttributes() {
|
|
2898
|
-
return ["label", "size", "variant", "icon", "no-wrap", "
|
|
2871
|
+
return ["label", "size", "variant", "icon", "no-wrap", "test-id"];
|
|
2899
2872
|
}
|
|
2900
2873
|
/**
|
|
2901
2874
|
* Called when the element is added to the DOM.
|
|
@@ -2942,15 +2915,14 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2942
2915
|
* Calculate blend colors from CSS custom properties.
|
|
2943
2916
|
*
|
|
2944
2917
|
* Reads base colors from CSS custom properties and applies theme-aware blend
|
|
2945
|
-
* utilities to generate state colors (hover, pressed,
|
|
2946
|
-
*
|
|
2918
|
+
* utilities to generate state colors (hover, pressed, icon).
|
|
2919
|
+
*
|
|
2947
2920
|
* Uses getBlendUtilities() factory functions instead of direct blend calculations
|
|
2948
2921
|
* for cross-platform consistency with iOS and Android implementations.
|
|
2949
|
-
*
|
|
2922
|
+
*
|
|
2950
2923
|
* State color mappings:
|
|
2951
2924
|
* - Hover: darkerBlend(color.action.primary, blend.hoverDarker) - 8% darker
|
|
2952
2925
|
* - Pressed: darkerBlend(color.action.primary, blend.pressedDarker) - 12% darker
|
|
2953
|
-
* - Disabled: desaturate(color.action.primary, blend.disabledDesaturate) - 12% less saturated
|
|
2954
2926
|
* - Icon: lighterBlend(color.contrast.onAction, blend.iconLighter) - 8% lighter
|
|
2955
2927
|
*
|
|
2956
2928
|
* @see Requirements: 7.1, 7.2, 7.3, 7.4 - Button-CTA state colors
|
|
@@ -2969,7 +2941,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
2969
2941
|
}
|
|
2970
2942
|
this._hoverColor = this._blendUtils.hoverColor(primaryColor);
|
|
2971
2943
|
this._pressedColor = this._blendUtils.pressedColor(primaryColor);
|
|
2972
|
-
this._disabledColor = this._blendUtils.disabledColor(primaryColor);
|
|
2973
2944
|
this._iconColor = this._blendUtils.iconColor(onActionColor);
|
|
2974
2945
|
this._iconOpticalBalanceColor = this._blendUtils.iconColor(primaryColor);
|
|
2975
2946
|
}
|
|
@@ -3061,22 +3032,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
3061
3032
|
set noWrap(value) {
|
|
3062
3033
|
this.setAttribute("no-wrap", value.toString());
|
|
3063
3034
|
}
|
|
3064
|
-
/**
|
|
3065
|
-
* Get the disabled state.
|
|
3066
|
-
*/
|
|
3067
|
-
get disabled() {
|
|
3068
|
-
return this.hasAttribute("disabled");
|
|
3069
|
-
}
|
|
3070
|
-
/**
|
|
3071
|
-
* Set the disabled state.
|
|
3072
|
-
*/
|
|
3073
|
-
set disabled(value) {
|
|
3074
|
-
if (value) {
|
|
3075
|
-
this.setAttribute("disabled", "");
|
|
3076
|
-
} else {
|
|
3077
|
-
this.removeAttribute("disabled");
|
|
3078
|
-
}
|
|
3079
|
-
}
|
|
3080
3035
|
/**
|
|
3081
3036
|
* Get the test ID.
|
|
3082
3037
|
*/
|
|
@@ -3135,31 +3090,27 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
3135
3090
|
const variant = this.buttonVariant;
|
|
3136
3091
|
const icon = this.icon;
|
|
3137
3092
|
const noWrap = this.noWrap;
|
|
3138
|
-
const disabled = this.disabled;
|
|
3139
3093
|
const testID = this.testID;
|
|
3140
3094
|
const buttonClasses = [
|
|
3141
3095
|
"button-cta",
|
|
3142
3096
|
`button-cta--${size}`,
|
|
3143
|
-
`button-cta--${variant}
|
|
3144
|
-
|
|
3145
|
-
].filter(Boolean).join(" ");
|
|
3097
|
+
`button-cta--${variant}`
|
|
3098
|
+
].join(" ");
|
|
3146
3099
|
const iconSize = getIconSizeForButton(size);
|
|
3147
3100
|
const labelClass = noWrap ? "button-cta__label--no-wrap" : "button-cta__label";
|
|
3148
3101
|
const testIDAttr = testID ? ` data-testid="${testID}"` : "";
|
|
3149
3102
|
const blendColorStyles = `
|
|
3150
3103
|
--_cta-hover-bg: ${this._hoverColor};
|
|
3151
3104
|
--_cta-pressed-bg: ${this._pressedColor};
|
|
3152
|
-
--_cta-disabled-bg: ${this._disabledColor};
|
|
3153
3105
|
--_cta-icon-color: ${this._iconColor};
|
|
3154
3106
|
--_cta-icon-optical: ${this._iconOpticalBalanceColor};
|
|
3155
3107
|
`;
|
|
3156
3108
|
this._shadowRoot.innerHTML = `
|
|
3157
3109
|
<style>${ButtonCTA_web_default}</style>
|
|
3158
|
-
<button
|
|
3110
|
+
<button
|
|
3159
3111
|
class="${buttonClasses}"
|
|
3160
3112
|
type="button"
|
|
3161
3113
|
role="button"
|
|
3162
|
-
${disabled ? 'disabled aria-disabled="true"' : 'aria-disabled="false"'}
|
|
3163
3114
|
${testIDAttr}
|
|
3164
3115
|
aria-label="${label}"
|
|
3165
3116
|
style="${blendColorStyles}"
|
|
@@ -3195,23 +3146,14 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
3195
3146
|
const variant = this.buttonVariant;
|
|
3196
3147
|
const icon = this.icon;
|
|
3197
3148
|
const noWrap = this.noWrap;
|
|
3198
|
-
const disabled = this.disabled;
|
|
3199
3149
|
const testID = this.testID;
|
|
3200
3150
|
const iconSize = getIconSizeForButton(size);
|
|
3201
3151
|
const buttonClasses = [
|
|
3202
3152
|
"button-cta",
|
|
3203
3153
|
`button-cta--${size}`,
|
|
3204
|
-
`button-cta--${variant}
|
|
3205
|
-
|
|
3206
|
-
].filter(Boolean).join(" ");
|
|
3154
|
+
`button-cta--${variant}`
|
|
3155
|
+
].join(" ");
|
|
3207
3156
|
this._button.className = buttonClasses;
|
|
3208
|
-
if (disabled) {
|
|
3209
|
-
this._button.setAttribute("disabled", "");
|
|
3210
|
-
this._button.setAttribute("aria-disabled", "true");
|
|
3211
|
-
} else {
|
|
3212
|
-
this._button.removeAttribute("disabled");
|
|
3213
|
-
this._button.setAttribute("aria-disabled", "false");
|
|
3214
|
-
}
|
|
3215
3157
|
this._button.setAttribute("aria-label", label);
|
|
3216
3158
|
if (testID) {
|
|
3217
3159
|
this._button.setAttribute("data-testid", testID);
|
|
@@ -3220,7 +3162,6 @@ var ButtonCTA = class extends HTMLElement {
|
|
|
3220
3162
|
}
|
|
3221
3163
|
this._button.style.setProperty("--_cta-hover-bg", this._hoverColor);
|
|
3222
3164
|
this._button.style.setProperty("--_cta-pressed-bg", this._pressedColor);
|
|
3223
|
-
this._button.style.setProperty("--_cta-disabled-bg", this._disabledColor);
|
|
3224
3165
|
this._button.style.setProperty("--_cta-icon-color", this._iconColor);
|
|
3225
3166
|
this._button.style.setProperty("--_cta-icon-optical", this._iconOpticalBalanceColor);
|
|
3226
3167
|
this._labelEl.textContent = label;
|
|
@@ -9065,9 +9006,9 @@ var AvatarBaseElement = class extends HTMLElement {
|
|
|
9065
9006
|
].filter(Boolean).join(" ");
|
|
9066
9007
|
const testIDAttr = testID ? ` data-testid="${this.escapeHtml(testID)}"` : "";
|
|
9067
9008
|
const ariaHiddenAttr = decorative ? ' aria-hidden="true"' : "";
|
|
9068
|
-
if (src &&
|
|
9009
|
+
if (type === "human" && src && alt == null && !decorative && typeof console !== "undefined") {
|
|
9069
9010
|
console.warn(
|
|
9070
|
-
'AvatarBaseElement: "alt"
|
|
9011
|
+
'AvatarBaseElement: "alt" is required when "src" is provided. Add an alt description of the image; or, if this avatar is purely decorative (non-informative), set the "decorative" prop to hide it from screen readers.'
|
|
9071
9012
|
);
|
|
9072
9013
|
}
|
|
9073
9014
|
if (type === "agent") {
|