@design-factory/styles 21.0.0-next.0 → 21.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 (78) hide show
  1. package/README.md +30 -1
  2. package/bundle.css +2 -2
  3. package/package.json +11 -4
  4. package/scss/_common.mixins.scss +10 -10
  5. package/scss/_common.root.scss +0 -31
  6. package/scss/_common.scss +14 -10
  7. package/scss/_common.variables.scss +13 -59
  8. package/scss/_variables.scss +12 -8
  9. package/scss/bootstrap/_functions.scss +55 -0
  10. package/scss/bootstrap/_mixins-override.scss +8 -52
  11. package/scss/bootstrap/_variables.scss +235 -355
  12. package/scss/bundle.scss +5 -6
  13. package/scss/components/accordion/_accordion.variables.scss +1 -1
  14. package/scss/components/alert/_alert.scss +1 -1
  15. package/scss/components/badge/_badge.scss +1 -1
  16. package/scss/components/brand-color/_brand-color.mixins.scss +0 -2
  17. package/scss/components/brand-color/_brand-color.scss +0 -7
  18. package/scss/components/button/_button.mixins.scss +1 -1
  19. package/scss/components/button/_button.namespace.scss +42 -0
  20. package/scss/components/button/_button.scss +12 -12
  21. package/scss/components/button/_button.variables.scss +11 -4
  22. package/scss/components/card/_card.scss +4 -0
  23. package/scss/components/card/_card.variables.scss +1 -1
  24. package/scss/components/carousel/_carousel.namespace.scss +8 -0
  25. package/scss/components/checkbox/_checkbox.scss +14 -16
  26. package/scss/components/checkbox/_checkbox.variables.scss +2 -1
  27. package/scss/components/collapse/_collapse.scss +1 -1
  28. package/scss/components/datepicker/_datepicker.scss +16 -2
  29. package/scss/components/drawer/_drawer.scss +44 -10
  30. package/scss/components/dropdown/_dropdown.scss +2 -2
  31. package/scss/components/dropdown/_dropdown.variables.scss +1 -1
  32. package/scss/components/form/_form.scss +13 -5
  33. package/scss/components/form/_form.variables.scss +9 -3
  34. package/scss/components/icon/_amadeus-icon.scss +1 -1
  35. package/scss/components/inputs/_inputs.mixin.scss +0 -13
  36. package/scss/components/inputs/_inputs.scss +6 -39
  37. package/scss/components/inputs/_inputs.variables.scss +7 -0
  38. package/scss/components/link/_link.scss +1 -1
  39. package/scss/components/list-group/_list-group.scss +5 -5
  40. package/scss/components/media/_media.scss +1 -1
  41. package/scss/components/modal/_modal.namespace.scss +13 -0
  42. package/scss/components/modal/_modal.scss +6 -1
  43. package/scss/components/navbar/_navbar.scss +3 -2
  44. package/scss/components/pagination/_pagination.namespace.scss +15 -0
  45. package/scss/components/pagination/_pagination.scss +35 -34
  46. package/scss/components/pagination/_pagination.variables.scss +2 -2
  47. package/scss/components/popover/_popover.scss +2 -2
  48. package/scss/components/popover/_popover.variables.scss +1 -1
  49. package/scss/components/radio/_radio.scss +12 -12
  50. package/scss/components/rating/_rating.scss +1 -1
  51. package/scss/components/scrollspy/_scrollspy.scss +22 -1
  52. package/scss/components/select/_select.namespace.scss +13 -0
  53. package/scss/components/select/_select.scss +33 -17
  54. package/scss/components/select/_select.variables.scss +4 -6
  55. package/scss/components/sidenav/_sidenav-deprecated.scss +1 -1
  56. package/scss/components/sidenav/_sidenav.scss +26 -0
  57. package/scss/components/slider/_slider.scss +7 -7
  58. package/scss/components/speechbubble/_speechbubble.scss +6 -10
  59. package/scss/components/stepper/_stepper.scss +2 -2
  60. package/scss/components/table/_advancedtables.scss +8 -3
  61. package/scss/components/tabs/_tabs.scss +6 -1
  62. package/scss/components/toast/_toast.variables.scss +2 -1
  63. package/scss/components/toggle/_toggle.scss +2 -2
  64. package/scss/namespace.scss +54 -33
  65. package/scss/utilities.scss +0 -1
  66. package/scss/_new-brand-common.variables.scss +0 -7
  67. package/scss/bootstrap/_variables-dark.scss +0 -86
  68. package/scss/components/brand-color/_brand-color.variables.scss +0 -146
  69. package/scss/components/brand-color/_brand-color_container.scss +0 -23
  70. package/scss/components/button/_button_container.scss +0 -47
  71. package/scss/components/pagination/_pagination_container.scss +0 -17
  72. package/scss/components/popover/_popover_container.scss +0 -214
  73. package/scss/components/spinner/_spinner_container.scss +0 -43
  74. package/scss/components/tooltip/_tooltip_container.scss +0 -116
  75. package/scss/themes/brand2023/_variables.scss +0 -315
  76. package/scss/utilities/_common.utilities.scss +0 -98
  77. package/scss/utilities/_form.mixins.scss +0 -26
  78. package/scss/utilities/_rgb.scss +0 -10
package/package.json CHANGED
@@ -2,13 +2,14 @@
2
2
  "name": "@design-factory/styles",
3
3
  "description": "Amadeus design system styles",
4
4
  "license": "BSD-3-Clause",
5
- "version": "21.0.0-next.0",
5
+ "version": "21.0.0",
6
6
  "type": "module",
7
7
  "peerDependencies": {
8
8
  "bootstrap": "5.3.8",
9
- "@agnos-ui/core-bootstrap": "~0.10.0-next.4",
10
- "@design-factory/tokens": "21.0.0-next.0",
11
- "ag-grid-community": "^35.0.0"
9
+ "@agnos-ui/core-bootstrap": "~0.10.0",
10
+ "@design-factory/tokens": "21.0.0",
11
+ "ag-grid-community": "^35.0.0",
12
+ "@ng-select/ng-select": "^21.0.0"
12
13
  },
13
14
  "peerDependenciesMeta": {
14
15
  "bootstrap": {
@@ -19,6 +20,12 @@
19
20
  },
20
21
  "ag-grid-community": {
21
22
  "optional": true
23
+ },
24
+ "@design-factory/tokens": {
25
+ "optional": true
26
+ },
27
+ "@ng-select/ng-select": {
28
+ "optional": true
22
29
  }
23
30
  },
24
31
  "exports": {
@@ -1,4 +1,5 @@
1
- @import './utilities/form.mixins';
1
+ @use 'sass:map';
2
+
2
3
  @mixin rtl {
3
4
  @if $df-enable-rtl {
4
5
  [dir='rtl'] & {
@@ -18,13 +19,12 @@
18
19
  }
19
20
  }
20
21
 
21
- @mixin heading {
22
- h1,
23
- h2,
24
- h3,
25
- h4,
26
- h5,
27
- h6 {
28
- @content;
29
- }
22
+ @function get-font-sizing($extension, $ratio, $font-size-to-scale: $font-size-base, $body: false) {
23
+ $df-size-ratios-font: (
24
+ 'sm': var(--df-typo-sizing-small),
25
+ 'lg': var(--df-typo-sizing-large),
26
+ 'md': var(--df-typo-sizing-default),
27
+ 'xl': var(--df-typo-sizing-2xlarge)
28
+ );
29
+ @return map.get($df-size-ratios-font, $extension);
30
30
  }
@@ -1,35 +1,4 @@
1
1
  :root {
2
- --df-disabled-color: #{$df-disabled-color};
3
- --df-disabled-bg-color: #{$gray-100};
4
- --df-focus-outline: #{$df-focus-outline};
5
- --df-disabled-cursor: #{$df-disabled-cursor};
6
- --df-link-hover-text-decoration: #{$df-link-hover-text-decoration};
7
- --df-disabled-opacity: #{$df-disabled-opacity};
8
- --df-font-family: 'Design-Factory-icon';
9
-
10
- --df-white-color: #{color-contrast($white)};
11
- --df-black-color: #{color-contrast($black)};
12
-
13
- // Box-shadow
14
- --df-box-shadow: #{$df-box-shadow};
15
- --df-focused-box-shadow: #{$df-focused-box-shadow};
16
- --df-box-shadow-blur: #{$focus-ring-blur};
17
- --df-box-shadow-width: #{$focus-ring-width};
18
- --df-box-shadow-opacity: #{$focus-ring-opacity};
19
- --df-box-shadow-color: #{$focus-ring-color};
20
-
21
- @each $breakpoint, $value in $grid-breakpoints {
22
- --df-breakpoint-#{$breakpoint}: #{$value};
23
- }
24
-
25
- @each $color, $value in $shade-colors {
26
- --df-#{$color}: #{$value};
27
- }
28
-
29
- @each $color, $value in $shade-colors-text {
30
- --df-#{$color}-color: #{$value};
31
- }
32
-
33
2
  // have to set the body colors as CSS variables unfortunately as bootstrap has mixin based on $body-bg and $body-color
34
3
  --df-body-bg: var(--df-color-inert-neutral-pageBackground);
35
4
  --df-body-color: var(--df-color-inert-neutral-main-foreground);
package/scss/_common.scss CHANGED
@@ -1,17 +1,18 @@
1
+ @use 'common.variables' as df;
2
+
1
3
  .mandatory-indicator {
2
4
  // add
3
5
  color: var(--df-color-danger-alt-default-foreground);
4
- font-weight: $df-mandatory-indicator-font-weight;
5
- margin-left: $df-mandatory-indicator-margin;
6
- margin-right: $df-mandatory-indicator-margin;
6
+ font-weight: var(--df-typo-weight-regular);
7
+ margin-inline: var(--df-spacing-1);
7
8
  }
8
9
 
9
10
  .df-subtitle {
10
11
  // add
11
- color: $df-subtitle-color;
12
+ color: var(--df-color-subtext-foreground);
12
13
  }
13
14
 
14
- @each $extension, $ratio in $df-size-ratios {
15
+ @each $extension, $ratio in ('sm': 0.875, 'md': 1, 'lg': 1.125, 'xl': 1.25) {
15
16
  .df-font-#{$extension} {
16
17
  font-size: #{get-font-sizing($extension, $ratio)};
17
18
  }
@@ -26,13 +27,16 @@
26
27
  }
27
28
 
28
29
  .df-focused {
29
- border-radius: $df-focused-border-radius;
30
- box-shadow: $df-focused-box-shadow;
31
- border: $df-focused-border;
32
- outline: var(--df-focus-outline); //disable default
30
+ border-radius: var(--df-borderRadius-main-medium);
31
+ box-shadow: df.$df-focus-box-shadow;
32
+ border: 1px solid var(--df-color-primary-main-default-border);
33
+ outline: none; //disable default
33
34
  }
34
35
 
35
- @each $degree, $value in $df-degrees {
36
+ @each $degree,
37
+ $value
38
+ in (0: 0deg, 45: 45deg, 90: 90deg, 135: 135deg, 180: 180deg, 225: 225deg, 270: 270deg, 315: 315deg, 360: 360deg)
39
+ {
36
40
  .df-transform-r-#{$degree} {
37
41
  transform: rotate($value);
38
42
  }
@@ -1,62 +1,16 @@
1
- @use 'sass:math';
2
- @use 'sass:map';
3
- // Common variables DF
1
+ // the box shadow, mostly used for cards, popovers, modals, etc.
2
+ $df-box-shadow: 0px 0px 8px var(--df-color-shadow-1) !default;
3
+ // the focus box shadow, mostly used for focus states of buttons, inputs, etc.
4
+ $df-focus-box-shadow:
5
+ 0 0 0 2px var(--df-inner-box-shadow-color, var(--df-body-bg)),
6
+ 0 0 0 4px var(--df-box-shadow-color, var(--df-color-primary-main-default-border)) !default;
7
+ // the inset focus box shadow, mostly used for focus states of tabs, navlinks, etc.
8
+ $df-focus-inset-box-shadow:
9
+ inset 0 0 0 2px var(--df-inner-box-shadow-color, var(--df-body-bg)),
10
+ inset 0 0 0 4px var(--df-box-shadow-color, var(--df-color-primary-main-default-border)) !default;
4
11
 
5
- // stylelint-disable-next-line scss/dollar-variable-pattern
12
+ // the path to the fonts folder
13
+ // TODO refactor this one day
6
14
  $font-path: '../../../assets/fonts' !default;
7
- $df-font-icon-color: $gray-600 !default;
8
- $df-mandatory-indicator-font-weight: 700 !default;
9
- $df-mandatory-indicator-margin: 0.125rem !default;
10
- $df-subtitle-color: $gray-600 !default;
11
- // Merge DF Spacer with BS ones
12
- // @deprecated - will be removed in version 21, use $spacer-4 instead of '75'
13
- // stylelint-disable-next-line scss/dollar-variable-pattern, scss/dollar-variable-default
14
- $spacers: map.merge(
15
- (
16
- '75': (
17
- calc($spacer * 0.75)
18
- )
19
- ),
20
- $spacers
21
- );
22
-
23
- // stylelint-disable-next-line scss/dollar-variable-default
24
- $df-size-ratios: map.merge(
25
- (
26
- 'sm': math.div($font-size-sm, $font-size-base),
27
- 'lg': math.div($font-size-lg, $font-size-base)
28
- ),
29
- $df-size-ratios
30
- );
31
-
32
- $df-focused-border-radius: $border-radius !default;
33
- $df-focused-box-shadow: $input-btn-focus-box-shadow !default; // $input-btn-focus-box-shadow need to be customize for changing the whole box-shadow
34
- $df-focused-border: $border-width solid var(--df-color-primary-main-default-border) !default;
15
+ // enable right to left support
35
16
  $df-enable-rtl: false !default;
36
-
37
- // Disabled state
38
- $df-disabled-bg-color: var(--df-gray-100) !default;
39
- $df-disabled-color: var(--df-gray-300) !default;
40
- $df-disabled-opacity: 1 !default; //TODO: should be removed after all the clean up
41
- $df-disabled-cursor: not-allowed !default; //TODO: should be removed after all the clean up
42
- $df-focus-outline: none !default;
43
-
44
- // TODO propagate the usage of the variables for the link hover text-decoration
45
- $df-link-hover-text-decoration: none !default;
46
- // TODO same for visited / disabled / more link / icon in link ?
47
- // stylelint-disable scss/dollar-variable-pattern
48
- $shade-colors-rgb: map-loop($shade-colors, to-rgb, '$value') !default;
49
- $shade-colors-text: map-loop($shade-colors, color-contrast, '$value') !default;
50
- $shade-colors-text-rgb: map-loop($shade-colors-text, to-rgb, '$value') !default;
51
-
52
- $df-degrees: (
53
- 0: 0deg,
54
- 45: 45deg,
55
- 90: 90deg,
56
- 135: 135deg,
57
- 180: 180deg,
58
- 225: 225deg,
59
- 270: 270deg,
60
- 315: 315deg,
61
- 360: 360deg
62
- ) !default;
@@ -1,5 +1,14 @@
1
+ // Overriding bootstrap is done in this way:
2
+ // We declare sass vars BEFORE bootstrap sass vars.
3
+ // We redefine mixins and functions AFTER bootstrap mixins and functions.
4
+ // We declare component css override AFTER bootstrap component css.
5
+
6
+ // First we import bootstrap functions and override them.
1
7
  @import 'bootstrap/scss/functions';
2
- @import 'utilities/common.utilities';
8
+ @import 'bootstrap/functions';
9
+
10
+ // Following files override bootstrap variables
11
+ @import 'bootstrap/variables';
3
12
 
4
13
  @import 'components/fonts/fonts.variables';
5
14
  @import 'components/accordion/accordion.variables';
@@ -31,16 +40,11 @@
31
40
  @import 'components/toggle/toggle.variables';
32
41
  @import 'components/tooltip/tooltip.variables';
33
42
 
34
- // File to override bootstrap variables
35
- @import 'bootstrap/variables';
36
- @import 'bootstrap/variables-dark';
43
+ // Then the import of bootstrap variables
37
44
  @import 'bootstrap/scss/variables';
38
45
 
39
46
  // File to override agnosui variables
40
47
  @import 'agnosui/variables';
41
48
 
42
- // import common variables for components
49
+ // import common variables for components (no bootstrap variables here)
43
50
  @import 'common.variables';
44
-
45
- // import local variable DF of all components
46
- @import 'components/brand-color/brand-color.variables';
@@ -0,0 +1,55 @@
1
+ @use 'sass:color';
2
+ @use 'sass:map';
3
+ @use 'sass:math';
4
+ @use 'sass:string';
5
+ @use 'sass:list';
6
+ @use 'sass:meta';
7
+
8
+ @function to-rgb($value) {
9
+ @if meta.type-of($value) != color {
10
+ @return str-replace($value, ')', '-rgb)');
11
+ }
12
+ @return color.red($value), color.green($value), color.blue($value);
13
+ }
14
+
15
+ @function rgba-css-var($identifier, $target) {
16
+ @if not list.index(neutral primary danger warning success info tip accent chromatic1 chromatic2, $identifier) {
17
+ @error "#{$identifier} not managed, called with #{$target}";
18
+ }
19
+ @if $target == 'focus-ring' or $target == 'border' {
20
+ @return var(--df-color-#{$identifier}-main-default-border);
21
+ }
22
+ @if $target == 'text' {
23
+ @return var(--df-color-#{$identifier}-alt-default-foreground);
24
+ } @else {
25
+ @return var(--df-color-#{$identifier}-main-default-background);
26
+ }
27
+ }
28
+
29
+ @function color-contrast(
30
+ $background,
31
+ $color-contrast-dark: $color-contrast-dark,
32
+ $color-contrast-light: $color-contrast-light,
33
+ $min-contrast-ratio: $min-contrast-ratio
34
+ ) {
35
+ @if meta.type-of($background) != color {
36
+ @return str-replace($background, ')', '-color)');
37
+ }
38
+ $foregrounds: $color-contrast-light, $color-contrast-dark, $white, $black;
39
+ $max-ratio: 0;
40
+ $max-ratio-color: null;
41
+
42
+ @each $color in $foregrounds {
43
+ $contrast-ratio: contrast-ratio($background, $color);
44
+ @if $contrast-ratio > $min-contrast-ratio {
45
+ @return $color;
46
+ } @else if $contrast-ratio > $max-ratio {
47
+ $max-ratio: $contrast-ratio;
48
+ $max-ratio-color: $color;
49
+ }
50
+ }
51
+
52
+ @warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}...";
53
+
54
+ @return $max-ratio-color;
55
+ }
@@ -1,69 +1,25 @@
1
1
  @mixin border-end-radius($radius: $border-radius) {
2
- @if $enable-rounded {
3
- @include ltr {
4
- border-top-right-radius: valid-radius($radius);
5
- border-bottom-right-radius: valid-radius($radius);
6
- }
7
- @include rtl {
8
- border-top-left-radius: valid-radius($radius);
9
- border-bottom-left-radius: valid-radius($radius);
10
- }
11
- }
2
+ border-start-end-radius: valid-radius($radius);
3
+ border-end-end-radius: valid-radius($radius);
12
4
  }
13
5
 
14
6
  @mixin border-start-radius($radius: $border-radius) {
15
- @if $enable-rounded {
16
- @include ltr {
17
- border-top-left-radius: valid-radius($radius);
18
- border-bottom-left-radius: valid-radius($radius);
19
- }
20
- @include rtl {
21
- border-top-right-radius: valid-radius($radius);
22
- border-bottom-right-radius: valid-radius($radius);
23
- }
24
- }
7
+ border-start-start-radius: valid-radius($radius);
8
+ border-end-start-radius: valid-radius($radius);
25
9
  }
26
10
 
27
11
  @mixin border-top-start-radius($radius: $border-radius) {
28
- @if $enable-rounded {
29
- @include ltr {
30
- border-top-left-radius: valid-radius($radius);
31
- }
32
- @include rtl {
33
- border-top-right-radius: valid-radius($radius);
34
- }
35
- }
12
+ border-start-start-radius: valid-radius($radius);
36
13
  }
37
14
 
38
15
  @mixin border-top-end-radius($radius: $border-radius) {
39
- @if $enable-rounded {
40
- @include ltr {
41
- border-top-right-radius: valid-radius($radius);
42
- }
43
- @include rtl {
44
- border-top-left-radius: valid-radius($radius);
45
- }
46
- }
16
+ border-start-end-radius: valid-radius($radius);
47
17
  }
48
18
 
49
19
  @mixin border-bottom-end-radius($radius: $border-radius) {
50
- @if $enable-rounded {
51
- @include ltr {
52
- border-bottom-right-radius: valid-radius($radius);
53
- }
54
- @include rtl {
55
- border-bottom-left-radius: valid-radius($radius);
56
- }
57
- }
20
+ border-end-end-radius: valid-radius($radius);
58
21
  }
59
22
 
60
23
  @mixin border-bottom-start-radius($radius: $border-radius) {
61
- @if $enable-rounded {
62
- @include ltr {
63
- border-bottom-left-radius: valid-radius($radius);
64
- }
65
- @include rtl {
66
- border-bottom-right-radius: valid-radius($radius);
67
- }
68
- }
24
+ border-end-start-radius: valid-radius($radius);
69
25
  }