@akad/design-system 2.0.1 → 4.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.
Files changed (46) hide show
  1. package/css/core.css +1 -1
  2. package/package.json +1 -1
  3. package/react/react-lib.js +2643 -2247
  4. package/react/react-lib.umd.cjs +5 -5
  5. package/react/src/components/atoms/Card/Card.config.d.ts +29 -11
  6. package/react/src/components/atoms/Card/Card.d.ts +8 -5
  7. package/react/src/components/atoms/Card/Card.stories.d.ts +31 -5
  8. package/react/src/components/atoms/Radio/Radio.d.ts +5 -0
  9. package/react/src/components/index.d.ts +1 -0
  10. package/react/src/components/molecules/CheckboxCard/CheckboxCard.config.d.ts +70 -0
  11. package/react/src/components/molecules/CheckboxCard/CheckboxCard.d.ts +21 -0
  12. package/react/src/components/molecules/CheckboxCard/CheckboxCard.stories.d.ts +135 -0
  13. package/react/src/components/molecules/CheckboxCard/CheckboxCard.test.d.ts +1 -0
  14. package/react/src/components/molecules/CheckboxCard/CheckboxCardForm.stories.d.ts +36 -0
  15. package/react/src/components/molecules/CheckboxCard/CheckboxCardGroup.config.d.ts +88 -0
  16. package/react/src/components/molecules/CheckboxCard/CheckboxCardGroup.d.ts +34 -0
  17. package/react/src/components/molecules/CheckboxCard/CheckboxCardGroup.stories.d.ts +94 -0
  18. package/react/src/components/molecules/CheckboxCard/CheckboxCardGroup.test.d.ts +1 -0
  19. package/react/src/components/molecules/CheckboxCard/index.d.ts +8 -0
  20. package/scss/core/components/atoms/card.scss +114 -8
  21. package/scss/core/components/atoms/chip.scss +1 -1
  22. package/scss/core/components/atoms/input.scss +1 -1
  23. package/scss/core/components/atoms/loading.scss +4 -4
  24. package/scss/core/components/atoms/progress.scss +2 -2
  25. package/scss/core/components/atoms/radio-card.scss +1 -1
  26. package/scss/core/components/atoms/radio.scss +2 -2
  27. package/scss/core/components/atoms/segment-control.scss +2 -2
  28. package/scss/core/components/atoms/select.scss +1 -1
  29. package/scss/core/components/atoms/textarea.scss +1 -1
  30. package/scss/core/components/atoms/tooltip.scss +1 -1
  31. package/scss/core/components/index.scss +1 -0
  32. package/scss/core/components/molecules/accordion.scss +5 -3
  33. package/scss/core/components/molecules/active-tags.scss +3 -2
  34. package/scss/core/components/molecules/carousel.scss +1 -1
  35. package/scss/core/components/molecules/checkbox-card.scss +473 -0
  36. package/scss/core/components/molecules/editable-select.scss +2 -2
  37. package/scss/core/components/molecules/indicator.scss +1 -1
  38. package/scss/core/components/molecules/modal.scss +2 -2
  39. package/scss/core/components/molecules/notification.scss +2 -2
  40. package/scss/core/components/molecules/stepper.scss +1 -1
  41. package/scss/core/components/molecules/table.scss +11 -6
  42. package/scss/core/helpers/index.scss +0 -1
  43. package/scss/core/tokens/borders.scss +24 -5
  44. package/scss/themes/aon/index.scss +4 -1
  45. package/scss/themes/linker/index.scss +4 -1
  46. package/scss/core/helpers/borders.scss +0 -105
@@ -0,0 +1,8 @@
1
+ export * from './CheckboxCard';
2
+ export * from './CheckboxCardGroup';
3
+ export * from './CheckboxCard.config';
4
+ export * from './CheckboxCardGroup.config';
5
+ export { default as DsCheckboxCard } from './CheckboxCard';
6
+ export { default as DsCheckboxCardGroup } from './CheckboxCardGroup';
7
+ export { default as checkboxCardConfig } from './CheckboxCard.config';
8
+ export { default as checkboxCardGroupConfig } from './CheckboxCardGroup.config';
@@ -1,12 +1,35 @@
1
1
  // Card component
2
+ $card__border-radius: $border__radius--sm !default;
3
+
4
+ // Degraus da escala que o card expõe. Declarados aqui, e não derivados de
5
+ // map-keys($border__radius), porque expor um degrau é decisão do componente —
6
+ // o mesmo motivo pelo qual CardSize oferece 6 dos 11 degraus de $spacing.
7
+ // Precisa espelhar o enum CardRadius do Card.config.ts.
8
+ $card__radius-options: (
9
+ 'none',
10
+ 'xs',
11
+ 'sm',
12
+ 'md',
13
+ 'lg',
14
+ 'xl',
15
+ 'xxl',
16
+ 'xxxl',
17
+ 'pill'
18
+ ) !default;
19
+
2
20
  .ds-card {
21
+ // CSS vars (light mode default - same for dark mode)
22
+ --card-border-color: var(--color__neutral--30);
23
+
24
+ // CSS var for Sass var override (mesmo padrão de --button__border-radius)
25
+ --card__border-radius: #{$card__border-radius};
26
+
3
27
  // Defaults (uses theme globals - can be overridden with utilities)
4
28
  background-color: var(--background__color);
5
29
 
6
30
  // Propriedades CSS (ordem alfabética)
7
- border-left-style: solid;
8
- border-left-width: 0;
9
- border-radius: $border__radius--sm;
31
+ border: 1px solid var(--card-border-color);
32
+ border-radius: var(--card__border-radius);
10
33
  color: var(--text__color);
11
34
  display: flex;
12
35
  flex-direction: column;
@@ -39,9 +62,92 @@
39
62
  padding: $spacing--xs;
40
63
  }
41
64
 
42
- // NO utility classes here
43
- // Use global utilities instead:
44
- // - Background: .bg-color__primary, .bg-color__secondary, etc.
45
- // - Border: .border-color__primary, .border-color__secondary, etc.
46
- // - Elevation: .elevation-1, .elevation-2, .elevation-3, .elevation-4
65
+ // Modificadores estruturais da borda. Derivam do valor da prop `border`:
66
+ // "full" é o estado da classe base e não emite modificador.
67
+ &--border-side {
68
+ border-left: $spacing--quark solid var(--card-border-color);
69
+ }
70
+
71
+ // Um modificador por degrau exposto. A interpolação é obrigatória: custom
72
+ // property não é parseada pelo Sass, então sem o #{} o valor sairia como o
73
+ // texto literal da chamada e o border-radius cairia no valor inicial.
74
+ // Se um degrau sair da escala, o get-token avisa no build e a classe não é
75
+ // gerada — em vez de emitir um valor errado em silêncio.
76
+ @each $radius in $card__radius-options {
77
+ &--radius-#{$radius} {
78
+ --card__border-radius: #{get-token($border__radius, $radius)};
79
+ }
80
+ }
81
+
82
+ $card-brand-color-shades: (
83
+ 'darker',
84
+ 'dark',
85
+ 'default',
86
+ 'light',
87
+ 'lighter',
88
+ 'lightest'
89
+ );
90
+ $card-semantic-color-shades: ('dark', 'default', 'light', 'lighter');
91
+ $card-neutral-scale: (
92
+ '00',
93
+ '05',
94
+ '10',
95
+ '20',
96
+ '30',
97
+ '40',
98
+ '50',
99
+ '60',
100
+ '70',
101
+ '80',
102
+ '90'
103
+ );
104
+
105
+ // Modificadores de cor da borda, da prop `borderColor`. O prefixo carrega o
106
+ // nome da propriedade (`--border-color-`) para não disputar o `--border-` com
107
+ // os modificadores estruturais acima. Mesmo critério do `--radius-`, que
108
+ // existe porque `size` e `radius` compartilham os valores `none` e `xs`.
109
+ @each $brand in ('primary', 'secondary') {
110
+ @each $variant in $card-brand-color-shades {
111
+ @if $variant == 'default' {
112
+ &--border-color-#{$brand} {
113
+ --card-border-color: var(--color__#{$brand});
114
+ }
115
+ } @else {
116
+ &--border-color-#{$brand}-#{$variant} {
117
+ --card-border-color: var(--color__#{$brand}--#{$variant});
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ @each $variant in $card-neutral-scale {
124
+ &--border-color-neutral-#{$variant} {
125
+ --card-border-color: var(--color__neutral--#{$variant});
126
+ }
127
+ }
128
+
129
+ @each $semantic in ('success', 'warning', 'danger', 'info') {
130
+ @each $variant in $card-semantic-color-shades {
131
+ @if $variant == 'default' {
132
+ &--border-color-#{$semantic} {
133
+ --card-border-color: var(--color__#{$semantic});
134
+ }
135
+ } @else {
136
+ &--border-color-#{$semantic}-#{$variant} {
137
+ --card-border-color: var(--color__#{$semantic}--#{$variant});
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ // Declarado DEPOIS dos @each de cor de propósito. O prefixo distinto já evita
144
+ // colisão de NOME, mas não a de cascata: as duas famílias setam a mesma custom
145
+ // property com a mesma especificidade. O React não emite classe de cor quando
146
+ // border="none", então não há conflito — mas se as duas forem escritas à mão,
147
+ // a estrutural tem que ganhar (vence a última declarada).
148
+ // Transparente em vez de `border: 0` para preservar o box model: card com e
149
+ // sem borda mantêm o mesmo tamanho e não desalinham em grid.
150
+ &--border-none {
151
+ --card-border-color: transparent;
152
+ }
47
153
  }
@@ -7,7 +7,7 @@ $chip__letter-spacing: 0 !default;
7
7
  $chip__padding--y: $spacing__inset--quark !default; // 4px
8
8
  $chip__padding--x: $spacing__inset--quark + $spacing__inset--nano !default; // 4px + 8px = 12px
9
9
  $chip__min-height: $spacing__inset--sm !default; // 24px
10
- $chip__border-radius: $border__radius--sm !default;
10
+ $chip__border-radius: $border__radius--xs !default;
11
11
  $chip__border-width: $border__width--hairline !default;
12
12
  $chip__icon--gap: 6px !default;
13
13
  $chip__colors: primary, secondary, success, danger, warning, info, neutral;
@@ -44,7 +44,7 @@
44
44
  appearance: none;
45
45
  background: var(--input__background);
46
46
  border: none;
47
- border-radius: $border__radius--sm;
47
+ border-radius: $border__radius--xs;
48
48
  box-shadow: 0 0 0 $border__width--hairline var(--box-shadow-color);
49
49
  box-sizing: border-box;
50
50
  color: var(--input__text--color);
@@ -44,7 +44,7 @@
44
44
  animation: dot-flashing 1s infinite linear alternate;
45
45
  animation-delay: 0.5s;
46
46
  background-color: var(--color__primary);
47
- border-radius: 5px;
47
+ border-radius: $border__radius--pill;
48
48
  color: var(--color__primary);
49
49
  height: 8px;
50
50
  position: relative;
@@ -54,7 +54,7 @@
54
54
  &::before {
55
55
  animation: dot-flashing 1s infinite alternate;
56
56
  background-color: var(--color__primary);
57
- border-radius: 5px;
57
+ border-radius: $border__radius--pill;
58
58
  color: var(--color__primary);
59
59
  content: '';
60
60
  display: inline-block;
@@ -86,13 +86,13 @@
86
86
  }
87
87
 
88
88
  &--large {
89
- border-radius: 10px;
89
+ // sem border-radius: o pill da base clampa em metade do elemento,
90
+ // seja qual for o tamanho da variante
90
91
  height: 15px;
91
92
  width: 15px;
92
93
 
93
94
  &::after,
94
95
  &::before {
95
- border-radius: 10px;
96
96
  height: 15px;
97
97
  width: 15px;
98
98
  }
@@ -3,12 +3,12 @@
3
3
 
4
4
  &__container {
5
5
  background-color: var(--color__neutral--30);
6
- border-radius: $border__radius--lg;
6
+ border-radius: $border__radius--pill;
7
7
  width: 100%;
8
8
  }
9
9
 
10
10
  &__progress {
11
- border-radius: $border__radius--lg;
11
+ border-radius: $border__radius--pill;
12
12
  padding: $spacing__inset--quark 0;
13
13
  transition: 0.2s ease all;
14
14
  width: 100%;
@@ -2,7 +2,7 @@ $radio-card__padding: $spacing__inset--quark + $spacing__inset--nano !default;
2
2
  $radio-card__gap: $spacing__inset--quark + $spacing__inset--nano !default;
3
3
  $radio-card__min-height: $spacing--lg !default;
4
4
  $radio-card__text-gap: $spacing--quark !default;
5
- $radio-card__border-radius: $border__radius--sm !default;
5
+ $radio-card__border-radius: $border__radius--xs !default;
6
6
  $radio-card__border-width: $border__width--hairline !default;
7
7
  $radio-card__outline-width: $border__width--thin !default;
8
8
 
@@ -21,7 +21,7 @@ $radio__control-color: var(--color__neutral--80) !default;
21
21
 
22
22
  &__control {
23
23
  border: $border__width--thin solid var(--radio__control-color);
24
- border-radius: 50%;
24
+ border-radius: $border__radius--pill;
25
25
  box-sizing: border-box;
26
26
  flex-shrink: 0;
27
27
  height: $radio__control-size;
@@ -33,7 +33,7 @@ $radio__control-color: var(--color__neutral--80) !default;
33
33
 
34
34
  &__input:checked + &__control::after {
35
35
  background-color: var(--radio__control-color);
36
- border-radius: 50%;
36
+ border-radius: $border__radius--pill;
37
37
  content: '';
38
38
  height: $radio__control-dot-size;
39
39
  left: 50%;
@@ -1,8 +1,8 @@
1
1
  // === SEGMENT CONTROL TOKENS ===
2
2
  $segment-control__padding: $spacing__inset--quark !default;
3
3
  $segment-control__gap: $spacing--quark !default; // 4px
4
- $segment-control__border-radius: $border__radius--md !default;
5
- $segment-control__item-radius: $border__radius--sm !default;
4
+ $segment-control__border-radius: $border__radius--sm !default;
5
+ $segment-control__item-radius: $border__radius--xs !default;
6
6
  $segment-control__padding-y--sm: $spacing__inset--quark !default;
7
7
  $segment-control__padding-x--sm: $spacing__inset--xs !default;
8
8
  $segment-control__padding-y--md: $spacing__inset--nano !default;
@@ -74,7 +74,7 @@
74
74
  appearance: none;
75
75
  background: var(--select__background);
76
76
  border: none;
77
- border-radius: $border__radius--sm;
77
+ border-radius: $border__radius--xs;
78
78
  box-shadow: 0 0 0 $border__width--hairline var(--box-shadow-color);
79
79
  color: var(--select__text--color);
80
80
  font-family: inherit;
@@ -47,7 +47,7 @@
47
47
  &__textarea {
48
48
  background: var(--textarea__background);
49
49
  border: 0;
50
- border-radius: $border__radius--sm;
50
+ border-radius: $border__radius--xs;
51
51
  box-shadow: 0 0 0 $border__width--hairline var(--box-shadow-color);
52
52
  box-sizing: border-box;
53
53
  color: var(--textarea__text--color);
@@ -169,7 +169,7 @@ $arrow__size: $spacing--nano;
169
169
  &__wrapper {
170
170
  align-items: center;
171
171
  background-color: var(--tooltip-background-color);
172
- border-radius: $border__radius--sm;
172
+ border-radius: $border__radius--xs;
173
173
  color: var(--tooltip-text-color);
174
174
  font-family: var(--font__family--base);
175
175
  font-size: $font__size--xs;
@@ -33,6 +33,7 @@
33
33
  @import 'molecules/accordion';
34
34
  @import 'molecules/active-tags';
35
35
  @import 'molecules/carousel';
36
+ @import 'molecules/checkbox-card';
36
37
  @import 'molecules/editable-select';
37
38
  @import 'molecules/indicator';
38
39
  @import 'molecules/inline-editable';
@@ -7,7 +7,7 @@
7
7
  --accordion-border-color: var(--color__neutral--40);
8
8
 
9
9
  border: $border__width--hairline solid var(--accordion-border-color);
10
- border-radius: $spacing--quark;
10
+ border-radius: $border__radius--xs;
11
11
  list-style: none;
12
12
  margin: 0;
13
13
  padding: 0;
@@ -23,13 +23,15 @@
23
23
 
24
24
  &:first-child {
25
25
  .ds-accordion-item__button {
26
- border-radius: $spacing--quark $spacing--quark 0 0;
26
+ border-radius: $border__radius--xs $border__radius--xs
27
+ $border__radius--none $border__radius--none;
27
28
  }
28
29
  }
29
30
 
30
31
  &:last-child {
31
32
  .ds-accordion-item__button {
32
- border-radius: 0 0 $spacing--quark $spacing--quark;
33
+ border-radius: $border__radius--none $border__radius--none
34
+ $border__radius--xs $border__radius--xs;
33
35
  }
34
36
  }
35
37
 
@@ -6,7 +6,8 @@
6
6
  &__title {
7
7
  align-items: center;
8
8
  background-color: var(--color__primary);
9
- border-radius: $border__radius--sm 0 0 $border__radius--sm;
9
+ border-radius: $border__radius--xs $border__radius--none
10
+ $border__radius--none $border__radius--xs;
10
11
  color: var(--color__neutral--00);
11
12
  display: flex;
12
13
  font-weight: $font__weight--bold;
@@ -39,7 +40,7 @@
39
40
  &__item {
40
41
  align-items: center;
41
42
  background-color: var(--color__primary--lighter);
42
- border-radius: $border__radius--sm;
43
+ border-radius: $border__radius--xs;
43
44
  color: var(--color__neutral--90);
44
45
  display: flex;
45
46
  gap: $spacing--quark;
@@ -55,7 +55,7 @@
55
55
  .dot {
56
56
  background-color: var(--color__neutral--30);
57
57
  border: none;
58
- border-radius: 50%;
58
+ border-radius: $border__radius--pill;
59
59
  cursor: pointer;
60
60
  height: 16px;
61
61
  transition: all 0.3s ease-in-out;