@khipu/design-system 0.3.3 → 0.3.5-alpha.1

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.
@@ -13,7 +13,7 @@
13
13
  *
14
14
  * AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
15
15
  * Source: design-system/src/tokens/tokens.json
16
- * Generated: 2026-08-12T20:53:27.253Z
16
+ * Generated: 2026-08-12T21:54:49.906Z
17
17
  *
18
18
  * To regenerate:
19
19
  * cd design-system && npm run tokens:generate
@@ -685,6 +685,37 @@ body.dark,
685
685
  --outline: var(--kds-color-input-border);
686
686
  --outline-variant: var(--kds-border-light);
687
687
 
688
+ /* ========================================
689
+ EXTENDED BRAND ROLES
690
+
691
+ Several roles used to resolve straight to --kds-color-primary-main, which
692
+ meant a brand could not have (say) a green link next to a navy button.
693
+ They are split into their own tokens:
694
+
695
+ --kds-color-accent form icon, expand toggle, checkbox/radio
696
+ --kds-color-accent-soft form icon backdrop
697
+ --kds-font-family-heading display/heading tier
698
+ --kds-invoice-amount-font-family
699
+ --kds-invoice-amount-color
700
+ --kds-button-font-family
701
+ --kds-button-text-transform
702
+ --kds-button-primary-bg
703
+ --kds-button-primary-bg-hover
704
+
705
+ These are deliberately NOT declared here. Each one is consumed as
706
+ var(--new-token, <the expression it used to be>), so the default is
707
+ supplied at the point of use.
708
+
709
+ Declaring them as :root aliases looks equivalent but is not. A custom
710
+ property is substituted on the element that DECLARES it, so
711
+ `--kds-color-accent: var(--kds-color-primary-main)` on :root freezes to
712
+ whatever the primary is at :root. A brand that sets its primary further
713
+ down the tree (which is how khenshin-web applies merchant styles) would
714
+ inherit the already-resolved Khipu purple and lose its own colour. Using
715
+ them as fallbacks resolves against the primary in effect at the consuming
716
+ element, so unbranded output and existing brands are both unchanged.
717
+ ======================================== */
718
+
688
719
  /* ========================================
689
720
  ONBOARDING COMPONENTS TOKENS
690
721
  ======================================== */
@@ -1010,12 +1041,12 @@ a.kds-btn {
1010
1041
  width: 100%;
1011
1042
 
1012
1043
  /* Typography - Using design tokens */
1013
- font-family: var(--kds-font-family-secondary);
1044
+ font-family: var(--kds-button-font-family, var(--kds-font-family-secondary));
1014
1045
  font-weight: var(--kds-font-weight-medium); /* 500 */
1015
1046
  font-size: var(--kds-typography-button-font-size); /* 0.875rem = 14px */
1016
1047
  line-height: var(--kds-typography-button-line-height); /* 1.5 */
1017
1048
  letter-spacing: var(--kds-typography-button-letter-spacing); /* 0.46px */
1018
- text-transform: uppercase;
1049
+ text-transform: var(--kds-button-text-transform, uppercase);
1019
1050
 
1020
1051
  /* Spacing - Using design tokens */
1021
1052
  padding: var(--kds-spacing-button-padding); /* 0 16px */
@@ -1072,16 +1103,19 @@ a.kds-btn:disabled {
1072
1103
  /* Primary button - Khipu purple */
1073
1104
  button.kds-btn-primary,
1074
1105
  a.kds-btn-primary {
1075
- background: var(--kds-color-primary-main); /* #8347AD */
1106
+ background: var(--kds-button-primary-bg, var(--kds-color-primary-main)); /* #8347AD */
1076
1107
  color: var(--kds-color-primary-contrast); /* #FFF light / dark-purple on dark (lavender bg) */
1077
1108
  border: none;
1078
1109
  box-shadow: 0 1px 2px rgba(131, 71, 173, .25);
1079
1110
  }
1080
1111
 
1081
- /* Hover State - background más oscuro */
1112
+ /* Hover State - background más oscuro.
1113
+ Its own token, not primary-dark: once a brand sets the button background
1114
+ independently of the primary, deriving hover from the primary would snap it
1115
+ back to the brand's other colour on the first pointer-over. */
1082
1116
  button.kds-btn-primary:hover:not(:disabled),
1083
1117
  a.kds-btn-primary:hover:not(:disabled) {
1084
- background: var(--kds-color-primary-dark); /* #5B3179 */
1118
+ background: var(--kds-button-primary-bg-hover, var(--kds-color-primary-dark)); /* #5B3179 */
1085
1119
  }
1086
1120
 
1087
1121
  /* Active/Focus State */
@@ -1089,7 +1123,7 @@ button.kds-btn-primary:active:not(:disabled),
1089
1123
  button.kds-btn-primary:focus-visible:not(:disabled),
1090
1124
  a.kds-btn-primary:active:not(:disabled),
1091
1125
  a.kds-btn-primary:focus-visible:not(:disabled) {
1092
- background: var(--kds-color-primary-dark);
1126
+ background: var(--kds-button-primary-bg-hover, var(--kds-color-primary-dark));
1093
1127
  }
1094
1128
 
1095
1129
  /* Dark mode: the button is a light lavender with dark text, so hover/active must
@@ -2422,6 +2456,12 @@ a.kds-btn-google:disabled {
2422
2456
  /* Llena y centra dentro de contenedores flex (pantalla de carga); en flujo
2423
2457
  normal (contenedor no-flex) se reduce a su contenido. */
2424
2458
  flex: 1 1 auto;
2459
+ /* Alto propio: el loader es contenido minimo por definicion, asi que sin esto la
2460
+ card queda del alto del spinner y se lee como un recorte. Ocupa el body completo
2461
+ de un telefono para que la pantalla de carga se lea como una pantalla y no como
2462
+ una franja. Va aca y no en la card para que el minimo aplique solo a la carga:
2463
+ el resto de las pantallas crece con su contenido. */
2464
+ min-height: 36rem;
2425
2465
  }
2426
2466
 
2427
2467
  .kds-secure-loader-text {
@@ -3234,7 +3274,7 @@ label.radio span {
3234
3274
  /* Checked state */
3235
3275
  label.checkbox input[type="checkbox"]:checked,
3236
3276
  label.radio input[type="radio"]:checked {
3237
- accent-color: var(--primary);
3277
+ accent-color: var(--kds-color-accent, var(--primary));
3238
3278
  }
3239
3279
 
3240
3280
  /* Disabled state */
@@ -5003,9 +5043,12 @@ dialog#surveyModal button.circle {
5003
5043
  background-color: var(--kds-color-info-soft);
5004
5044
  }
5005
5045
 
5006
- /* ── Typography variants ── */
5046
+ /* ── Typography variants ──
5047
+ The display/heading tier resolves through --kds-font-family-heading so a
5048
+ brand can pair a display face with a different body face. Unset by default,
5049
+ so it falls through to the primary family and output is unchanged. */
5007
5050
  .kds-text-display1 {
5008
- font-family: var(--kds-font-family-primary, 'Public Sans', sans-serif);
5051
+ font-family: var(--kds-font-family-heading, var(--kds-font-family-primary, 'Public Sans', sans-serif));
5009
5052
  font-size: var(--kds-font-size-4xl, 36px);
5010
5053
  font-weight: var(--kds-font-weight-bold, 700);
5011
5054
  line-height: var(--kds-line-height-tight, 1.2);
@@ -5013,7 +5056,7 @@ dialog#surveyModal button.circle {
5013
5056
  }
5014
5057
 
5015
5058
  .kds-text-display2 {
5016
- font-family: var(--kds-font-family-primary, 'Public Sans', sans-serif);
5059
+ font-family: var(--kds-font-family-heading, var(--kds-font-family-primary, 'Public Sans', sans-serif));
5017
5060
  font-size: var(--kds-font-size-3xl, 30px);
5018
5061
  font-weight: var(--kds-font-weight-bold, 700);
5019
5062
  line-height: var(--kds-line-height-tight, 1.2);
@@ -5021,21 +5064,21 @@ dialog#surveyModal button.circle {
5021
5064
  }
5022
5065
 
5023
5066
  .kds-text-heading1 {
5024
- font-family: var(--kds-font-family-primary, 'Public Sans', sans-serif);
5067
+ font-family: var(--kds-font-family-heading, var(--kds-font-family-primary, 'Public Sans', sans-serif));
5025
5068
  font-size: var(--kds-font-size-2xl, 24px);
5026
5069
  font-weight: var(--kds-font-weight-semibold, 600);
5027
5070
  line-height: var(--kds-line-height-snug, 1.375);
5028
5071
  }
5029
5072
 
5030
5073
  .kds-text-heading2 {
5031
- font-family: var(--kds-font-family-primary, 'Public Sans', sans-serif);
5074
+ font-family: var(--kds-font-family-heading, var(--kds-font-family-primary, 'Public Sans', sans-serif));
5032
5075
  font-size: var(--kds-font-size-xl, 20px);
5033
5076
  font-weight: var(--kds-font-weight-semibold, 600);
5034
5077
  line-height: var(--kds-line-height-snug, 1.375);
5035
5078
  }
5036
5079
 
5037
5080
  .kds-text-heading3 {
5038
- font-family: var(--kds-font-family-primary, 'Public Sans', sans-serif);
5081
+ font-family: var(--kds-font-family-heading, var(--kds-font-family-primary, 'Public Sans', sans-serif));
5039
5082
  font-size: var(--kds-font-size-lg, 18px);
5040
5083
  font-weight: var(--kds-font-weight-semibold, 600);
5041
5084
  line-height: var(--kds-line-height-normal, 1.5);
@@ -6261,7 +6304,7 @@ button.kds-fab:active:not(:disabled) {
6261
6304
  irregular arriba (pegado al resumen) y abajo (~26px hasta el panel). Con height
6262
6305
  auto el botón ajusta a su contenido y el ritmo lo gobiernan los márgenes. */
6263
6306
  height: auto;
6264
- color: var(--kds-color-primary-main);
6307
+ color: var(--kds-color-accent, var(--kds-color-primary-main));
6265
6308
  font-weight: var(--kds-font-weight-medium);
6266
6309
  font-size: var(--kds-font-size-sm);
6267
6310
  cursor: pointer;
@@ -7091,11 +7134,13 @@ div.kds-invoice-header,
7091
7134
  }
7092
7135
 
7093
7136
  .kds-invoice-amount {
7137
+ /* inherit: the amount had no family of its own before, it took the body's. */
7138
+ font-family: var(--kds-invoice-amount-font-family, inherit);
7094
7139
  font-weight: var(--kds-font-weight-semibold);
7095
7140
  font-size: var(--kds-font-size-3xl);
7096
7141
  line-height: var(--kds-line-height-tight);
7097
7142
  letter-spacing: var(--kds-letter-spacing-wide);
7098
- color: var(--kds-color-gray-900);
7143
+ color: var(--kds-invoice-amount-color, var(--kds-color-gray-900));
7099
7144
  margin: 0;
7100
7145
  }
7101
7146
 
@@ -7178,8 +7223,23 @@ div.kds-invoice-header,
7178
7223
  padding: var(--kds-spacing-0-5);
7179
7224
  }
7180
7225
 
7226
+ /* Titulo del body de la card: alineado a la izquierda, sin importar que el consumidor
7227
+ traiga .kds-text-center. Va con especificidad de contexto (screen + card) a proposito:
7228
+ el centrado se venia pidiendo app por app y el resultado era inconsistente entre
7229
+ pantallas. Si alguna necesita centrarlo, el modificador explicito es
7230
+ .kds-card-title--centered. */
7231
+ .kds-screen > .kds-card-elevated :is(h1, .kds-card-title) {
7232
+ text-align: left;
7233
+ }
7234
+
7235
+ .kds-screen > .kds-card-elevated :is(h1, .kds-card-title).kds-card-title--centered {
7236
+ text-align: center;
7237
+ }
7238
+
7181
7239
  /* -- Card Title -- */
7182
7240
  .kds-card-title {
7241
+ /* inherit: the card title had no family of its own before. */
7242
+ font-family: var(--kds-font-family-heading, inherit);
7183
7243
  font-weight: var(--kds-font-weight-semibold);
7184
7244
  font-size: var(--kds-font-size-base);
7185
7245
  line-height: 1.5;
@@ -9061,7 +9121,11 @@ a.kds-copy-all-btn.copied:hover {
9061
9121
 
9062
9122
  .kds-form-icon-box {
9063
9123
  align-items: center;
9064
- background: var(--kds-color-background-brand-subtle, #f0f0fa);
9124
+ background: var(--kds-color-accent-soft, var(--kds-color-background-brand-subtle, #f0f0fa));
9125
+ /* The glyph inherits this, so the icon tracks the accent role without the
9126
+ markup having to name a colour utility. Falls back to the primary, which
9127
+ is what the .kds-text-primary utility on the glyph resolved to. */
9128
+ color: var(--kds-color-accent, var(--kds-color-primary-main));
9065
9129
  border-radius: var(--kds-radius-md);
9066
9130
  display: flex;
9067
9131
  height: 52px;