@daffodil/design 0.93.0 → 0.94.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 (138) hide show
  1. package/README.md +0 -1
  2. package/accordion/src/accordion-theme.scss +2 -2
  3. package/article/src/article/_stops-article-cascade.scss +5 -1
  4. package/article/src/article-theme.scss +2 -2
  5. package/badge/README.md +85 -0
  6. package/badge/src/badge-theme.scss +197 -0
  7. package/beacon/README.md +61 -0
  8. package/beacon/src/beacon-theme.scss +61 -0
  9. package/breadcrumb/src/breadcrumb-theme.scss +2 -2
  10. package/button/src/button/basic/button-theme.scss +2 -2
  11. package/button/src/button/flat/flat-theme.scss +2 -2
  12. package/button/src/button/icon/icon-theme.scss +2 -2
  13. package/button/src/button/raised/raised-theme.scss +13 -13
  14. package/button/src/button/stroked/stroked-theme.scss +2 -2
  15. package/button/src/button/underline/underline-theme.scss +2 -2
  16. package/callout/src/callout-theme.scss +12 -2
  17. package/card/src/card/stroked/stroked-theme.scss +14 -22
  18. package/card/src/card-base-theme.scss +4 -4
  19. package/card/src/card-base.scss +13 -16
  20. package/fesm2022/daffodil-design-accordion.mjs +9 -15
  21. package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
  22. package/fesm2022/daffodil-design-article.mjs +2 -2
  23. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  24. package/fesm2022/daffodil-design-badge.mjs +87 -0
  25. package/fesm2022/daffodil-design-badge.mjs.map +1 -0
  26. package/fesm2022/daffodil-design-beacon.mjs +48 -0
  27. package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
  28. package/fesm2022/daffodil-design-breadcrumb.mjs +1 -1
  29. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
  30. package/fesm2022/daffodil-design-button.mjs +1 -1
  31. package/fesm2022/daffodil-design-button.mjs.map +1 -1
  32. package/fesm2022/daffodil-design-callout.mjs +2 -2
  33. package/fesm2022/daffodil-design-card.mjs +9 -11
  34. package/fesm2022/daffodil-design-card.mjs.map +1 -1
  35. package/fesm2022/daffodil-design-form-field.mjs +95 -115
  36. package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
  37. package/fesm2022/daffodil-design-form.mjs +5 -7
  38. package/fesm2022/daffodil-design-form.mjs.map +1 -1
  39. package/fesm2022/daffodil-design-image.mjs +41 -98
  40. package/fesm2022/daffodil-design-image.mjs.map +1 -1
  41. package/fesm2022/daffodil-design-input.mjs +3 -3
  42. package/fesm2022/daffodil-design-input.mjs.map +1 -1
  43. package/fesm2022/daffodil-design-list.mjs +16 -21
  44. package/fesm2022/daffodil-design-list.mjs.map +1 -1
  45. package/fesm2022/daffodil-design-media-gallery.mjs +56 -61
  46. package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
  47. package/fesm2022/daffodil-design-menu.mjs +61 -38
  48. package/fesm2022/daffodil-design-menu.mjs.map +1 -1
  49. package/fesm2022/daffodil-design-modal.mjs +2 -2
  50. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  51. package/fesm2022/daffodil-design-native-select.mjs +3 -3
  52. package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
  53. package/fesm2022/daffodil-design-notification.mjs +17 -20
  54. package/fesm2022/daffodil-design-notification.mjs.map +1 -1
  55. package/fesm2022/daffodil-design-paginator.mjs +71 -76
  56. package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
  57. package/fesm2022/daffodil-design-progress-bar.mjs +33 -53
  58. package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
  59. package/fesm2022/daffodil-design-select.mjs +1 -1
  60. package/fesm2022/daffodil-design-select.mjs.map +1 -1
  61. package/fesm2022/daffodil-design-sidebar.mjs +2 -2
  62. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  63. package/fesm2022/daffodil-design-spinner.mjs +17 -16
  64. package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
  65. package/fesm2022/daffodil-design-switch.mjs +20 -29
  66. package/fesm2022/daffodil-design-switch.mjs.map +1 -1
  67. package/fesm2022/daffodil-design-tabs.mjs +86 -88
  68. package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
  69. package/fesm2022/daffodil-design-tag.mjs +33 -28
  70. package/fesm2022/daffodil-design-tag.mjs.map +1 -1
  71. package/fesm2022/daffodil-design-text-snippet.mjs +18 -23
  72. package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
  73. package/fesm2022/daffodil-design-textarea.mjs +3 -3
  74. package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
  75. package/fesm2022/daffodil-design-toast.mjs +19 -20
  76. package/fesm2022/daffodil-design-toast.mjs.map +1 -1
  77. package/fesm2022/daffodil-design.mjs +111 -80
  78. package/fesm2022/daffodil-design.mjs.map +1 -1
  79. package/form/src/hint/hint-theme.scss +2 -2
  80. package/form-field/src/form-field-theme.scss +2 -2
  81. package/hero/src/hero-theme.scss +12 -2
  82. package/list/README.md +10 -0
  83. package/list/src/list-theme.scss +2 -2
  84. package/media-gallery/README.md +0 -5
  85. package/media-gallery/src/media-gallery-theme.scss +2 -2
  86. package/menu/README.md +5 -0
  87. package/menu/src/menu-theme.scss +4 -4
  88. package/notification/src/notification-theme.scss +2 -2
  89. package/package.json +1 -1
  90. package/paginator/src/paginator-theme.scss +2 -2
  91. package/progress-bar/README.md +1 -1
  92. package/progress-bar/src/progress-bar-theme.scss +2 -2
  93. package/scss/global.scss +4 -0
  94. package/scss/state/skeleton/_mixins.scss +2 -2
  95. package/scss/theme/default.scss +15 -0
  96. package/scss/theme.scss +4 -8
  97. package/scss/theming/_configure-palette.scss +5 -1
  98. package/scss/theming/_get-theme-mode.scss +1 -1
  99. package/scss/theming/_index.scss +2 -3
  100. package/scss/theming/_light-dark.scss +37 -12
  101. package/scss/theming/color-shift/_color-shift.scss +56 -0
  102. package/scss/theming/color-shift/_color-shift.spec.scss +107 -0
  103. package/scss/theming/color-shift/_index.scss +1 -0
  104. package/scss/theming/{_daff-theme.scss → default/_daff-theme.scss} +4 -4
  105. package/scss/theming/default/_index.scss +1 -0
  106. package/select/src/select-theme.scss +5 -3
  107. package/switch/src/switch-theme.scss +2 -2
  108. package/tabs/src/tabs-theme.scss +2 -2
  109. package/tag/README.md +10 -6
  110. package/tag/src/tag-theme.scss +102 -5
  111. package/toast/src/toast-theme.scss +2 -2
  112. package/tree/src/tree-theme.scss +2 -2
  113. package/types/daffodil-design-accordion.d.ts +4 -4
  114. package/types/daffodil-design-badge.d.ts +63 -0
  115. package/types/daffodil-design-beacon.d.ts +26 -0
  116. package/types/daffodil-design-card.d.ts +2 -2
  117. package/types/daffodil-design-form-field.d.ts +34 -31
  118. package/types/daffodil-design-form.d.ts +2 -2
  119. package/types/daffodil-design-image.d.ts +15 -28
  120. package/types/daffodil-design-list.d.ts +3 -3
  121. package/types/daffodil-design-media-gallery.d.ts +31 -20
  122. package/types/daffodil-design-menu.d.ts +51 -20
  123. package/types/daffodil-design-notification.d.ts +5 -6
  124. package/types/daffodil-design-paginator.d.ts +20 -25
  125. package/types/daffodil-design-progress-bar.d.ts +16 -21
  126. package/types/daffodil-design-spinner.d.ts +2 -2
  127. package/types/daffodil-design-switch.d.ts +7 -8
  128. package/types/daffodil-design-tabs.d.ts +29 -29
  129. package/types/daffodil-design-tag.d.ts +22 -16
  130. package/types/daffodil-design-text-snippet.d.ts +9 -9
  131. package/types/daffodil-design.d.ts +61 -41
  132. package/fesm2022/daffodil-design-loading-icon.mjs +0 -67
  133. package/fesm2022/daffodil-design-loading-icon.mjs.map +0 -1
  134. package/loading-icon/README.md +0 -59
  135. package/loading-icon/src/loading-icon-theme.scss +0 -103
  136. package/scss/theming/illuminate/illuminate.scss +0 -149
  137. package/scss/theming/illuminate/illuminate.spec.scss +0 -15
  138. package/types/daffodil-design-loading-icon.d.ts +0 -31
@@ -1,59 +0,0 @@
1
- # Loading Icon
2
- Loading icons are used as an indicator of an event in progress.
3
-
4
- ## Overview
5
- Loading icons are used to indicate to users that an event is ocurring and is still in progress. They should only be used for short loading processes. For events that can take a considerable amount of time, use the [Progress Bar](/libs/design/progress-bar/README.md) component instead.
6
-
7
- ## Usage
8
-
9
- ### Within a standalone component
10
- To use loading icon in a standalone component, import `DAFF_LOADING_ICON_COMPONENTS` directly into your custom component:
11
-
12
- ```ts
13
- import { DAFF_LOADING_ICON_COMPONENTS } from '@daffodil/design/loading-icon';
14
-
15
- @Component({
16
- selector: 'custom-component',
17
- templateUrl: './custom-component.component.html',
18
- imports: [
19
- DAFF_LOADING_ICON_COMPONENTS,
20
- ],
21
- })
22
- export class CustomComponent {}
23
- ```
24
-
25
- ### Within a module (deprecated)
26
- To use loading icon in a module, import `DaffLoadingIconModule` into your custom module:
27
-
28
- ```ts
29
- import { NgModule } from '@angular/core';
30
- import { DaffLoadingIconModule } from '@daffodil/design/loading-icon';
31
- import { CustomComponent } from './custom.component';
32
-
33
- @NgModule({
34
- declarations: [
35
- CustomComponent,
36
- ],
37
- exports: [
38
- CustomComponent,
39
- ],
40
- imports: [
41
- DaffLoadingIconModule,
42
- ],
43
- })
44
- export class CustomComponentModule { }
45
- ```
46
-
47
- > This method is deprecated. It's recommended to update all custom components to standalone.
48
-
49
- ## Colors
50
- Use the `color` property to change the color of a loading icon. The default color is gray.
51
-
52
- > `theme` and `white` should be used on a darker background in order to have sufficient contrast.
53
-
54
- <daff-docs-example-viewer example="loading-icon-color"></daff-docs-example-viewer>
55
-
56
- ## Accessibility
57
- Loading icons should be given meaningful labels by using `aria-label` or `aria-labelledby`.
58
-
59
- If a loading icon is used to indicate a process in progress, using [aria-live](https://www.w3.org/TR/wai-aria-1.0/states_and_properties#aria-live) and [aria-busy](https://www.w3.org/TR/wai-aria-1.0/states_and_properties#aria-busy") should be strongly considered.
@@ -1,103 +0,0 @@
1
- @use '../../scss/theming' as *;
2
-
3
- @mixin daff-loading-icon-light-variant($loader-color) {
4
- .daff-loading-icon__loader {
5
- stroke: $loader-color;
6
- }
7
-
8
- .daff-loading-icon__bg {
9
- stroke: rgba($loader-color, 0.1);
10
- }
11
- }
12
-
13
- @mixin daff-loading-icon-dark-variant($loader-color) {
14
- .daff-loading-icon__loader {
15
- stroke: $loader-color;
16
- }
17
-
18
- .daff-loading-icon__bg {
19
- stroke: rgba($loader-color, 0.3);
20
- }
21
- }
22
-
23
- @mixin daff-loading-icon-theme($theme) {
24
- $primary: daff-get-palette($theme, primary);
25
- $secondary: daff-get-palette($theme, secondary);
26
- $tertiary: daff-get-palette($theme, tertiary);
27
- $base: daff-get-base-color($theme, base);
28
- $base-contrast: daff-get-base-color($theme, base-contrast);
29
- $white: daff-get-base-color($theme, 'white');
30
- $black: daff-get-base-color($theme, 'black');
31
- $neutral: daff-get-palette($theme, neutral);
32
- $mode: daff-get-theme-mode($theme);
33
-
34
- .daff-loading-icon {
35
- @include light($mode) {
36
- @include daff-loading-icon-light-variant(
37
- daff-color($neutral, 60)
38
- );
39
-
40
- &.daff-primary {
41
- @include daff-loading-icon-light-variant(daff-color($primary));
42
- }
43
-
44
- &.daff-secondary {
45
- @include daff-loading-icon-light-variant(
46
- daff-color($secondary)
47
- );
48
- }
49
-
50
- &.daff-tertiary {
51
- @include daff-loading-icon-light-variant(daff-color($tertiary));
52
- }
53
-
54
- &.daff-theme {
55
- @include daff-loading-icon-light-variant($base);
56
- }
57
-
58
- &.daff-theme-contrast {
59
- @include daff-loading-icon-light-variant($base-contrast);
60
- }
61
-
62
- &.daff-black {
63
- @include daff-loading-icon-light-variant($black);
64
- }
65
-
66
- &.daff-white {
67
- @include daff-loading-icon-light-variant($white);
68
- }
69
- }
70
-
71
- @include dark($mode) {
72
- @include daff-loading-icon-dark-variant(daff-color($neutral, 40));
73
-
74
- &.daff-primary {
75
- @include daff-loading-icon-dark-variant(daff-color($primary));
76
- }
77
-
78
- &.daff-secondary {
79
- @include daff-loading-icon-dark-variant(daff-color($secondary));
80
- }
81
-
82
- &.daff-tertiary {
83
- @include daff-loading-icon-dark-variant(daff-color($tertiary));
84
- }
85
-
86
- &.daff-theme {
87
- @include daff-loading-icon-dark-variant($base);
88
- }
89
-
90
- &.daff-theme-contrast {
91
- @include daff-loading-icon-dark-variant($base-contrast);
92
- }
93
-
94
- &.daff-black {
95
- @include daff-loading-icon-dark-variant($black);
96
- }
97
-
98
- &.daff-white {
99
- @include daff-loading-icon-dark-variant($white);
100
- }
101
- }
102
- }
103
- }
@@ -1,149 +0,0 @@
1
- @use 'sass:list';
2
- @use 'sass:map';
3
- @use 'sass:math';
4
- @use 'sass:meta';
5
- @use '../contrast/luminance/luminance';
6
-
7
- /// @deprecated Deprecated in version 0.87.0. Will be removed in version 0.90.0.
8
- ///
9
- /// Take a numeric map and sort it.
10
- ///
11
- /// https://gist.github.com/Jakobud/a0ac11e80a1de453cd86f0d3fc0a1410
12
- /// Credit to: https://gist.github.com/iamandrewluca
13
- ///
14
- @function _daff-illuminate-sort($map) {
15
- // Transform map to zipped list
16
- $keys: ();
17
- $values: ();
18
-
19
- @each $key, $val in $map {
20
- $keys: list.append($keys, $key);
21
- $values: list.append($values, $val);
22
- }
23
-
24
- $list: list.zip($keys, $values);
25
-
26
- $sorted-map: ();
27
-
28
- @while list.length($list) > 0 {
29
- // Find smallest pair
30
- $smallest-pair: list.nth($list, 1);
31
-
32
- @each $pair in $list {
33
- $value: list.nth($pair, 2);
34
- $smallest-value: list.nth($smallest-pair, 2);
35
-
36
- @if $value < $smallest-value {
37
- $smallest-pair: $pair;
38
- }
39
- }
40
-
41
- // Add smallest pair to sorted map
42
- $key: list.nth($smallest-pair, 1);
43
- $value: list.nth($smallest-pair, 2);
44
- $sorted-map: map.merge(
45
- $sorted-map,
46
- (
47
- $key: $value
48
- )
49
- );
50
-
51
- // Remove from list smallest pair
52
- $smallest-pair-index: list.index($list, $smallest-pair);
53
- $new-list: ();
54
-
55
- @for $i from 1 through list.length($list) {
56
- @if $i != $smallest-pair-index {
57
- $new-list: list.append($new-list, list.nth($list, $i), 'space');
58
- }
59
- }
60
-
61
- $list: $new-list;
62
- }
63
-
64
- @return $sorted-map;
65
- }
66
-
67
- // Given a map of key, luminance pairs, find the key
68
- // of the value that is "nth" away from zero.
69
- //
70
- // @param $map: a map of key, luminance pairs,
71
- // @param $nth: nth steps away from zero
72
- @function _daff-illuminate-get-key($map, $nth: 1) {
73
- //Cap off "nth" to prevent going out-of-bounds.
74
- @if ($nth > list.length($map)) {
75
- $nth: list.length(map);
76
- }
77
-
78
- $map: _daff-illuminate-sort($map);
79
- @return list.nth(list.nth($map, $nth), 1);
80
- }
81
-
82
- // Takes a $color and palette and returns the color in
83
- // the palette which would "illuminate" against that color.
84
- //
85
- // @usage
86
- // ```
87
- // daff-illuminate($palette);
88
- // ```
89
- //
90
- @function daff-illuminate($color, $palette, $nth: 1) {
91
- $luminance-map: ();
92
-
93
- //Validate
94
- @each $key, $palette-color in $palette {
95
- @if (meta.type-of($key) == 'string') {
96
- $palette: map.remove($palette, $key);
97
- }
98
- }
99
-
100
- //Transform into usable values
101
- @each $key, $palette-color in $palette {
102
- $luminance-map: map.merge(
103
- $luminance-map,
104
- (
105
- $key: (
106
- luminance.daff-luminance($palette-color) - luminance.daff-luminance($color)
107
- )
108
- )
109
- );
110
- }
111
-
112
-
113
- //Calculate which color to get
114
- $brighter-colors: ();
115
- $darker-colors: ();
116
-
117
- @each $key, $luminance in $luminance-map {
118
- @if ($luminance > 0) {
119
- $brighter-colors: map.merge(
120
- $brighter-colors,
121
- (
122
- $key: $luminance
123
- )
124
- );
125
- }
126
-
127
- @if ($luminance < 0) {
128
- $darker-colors: map.merge(
129
- $darker-colors,
130
- (
131
- $key: math.abs($luminance)
132
- )
133
- );
134
- }
135
- }
136
-
137
- $key: null;
138
-
139
- @if (luminance.daff-luminance($color) >= 0.5) {
140
- //If the color is bright
141
- $key: _daff-illuminate-get-key($darker-colors, $nth);
142
- }
143
- @else {
144
- //If the color is dark
145
- $key: _daff-illuminate-get-key($brighter-colors, $nth);
146
- }
147
-
148
- @return map.get($palette, $key);
149
- }
@@ -1,15 +0,0 @@
1
- @use 'true' as *;
2
-
3
- @include describe('illuminate') {
4
- //stylelint-disable
5
- @include it('should return a lighter color if the color is dark') {
6
-
7
- }
8
- @include it('should return a darker color if the color is light') {
9
-
10
- }
11
- @include it('should return the expected color for given scenarios') {
12
-
13
- }
14
- //stylelint-enable
15
- }
@@ -1,31 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import * as i1$1 from '@angular/common';
3
- import * as i1 from '@daffodil/design';
4
-
5
- /**
6
- * @deprecated in favor of `DaffSpinnerComponent`. Deprecated in version 0.91.1. Will be removed in version 0.94.0.
7
- */
8
- declare class DaffLoadingIconComponent {
9
- /**
10
- * @docs-private
11
- */
12
- class: boolean;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffLoadingIconComponent, never>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<DaffLoadingIconComponent, "daff-loading-icon", never, {}, {}, never, never, true, [{ directive: typeof i1.DaffColorableDirective; inputs: { "color": "color"; }; outputs: {}; }]>;
15
- }
16
-
17
- /**
18
- * @deprecated in favor of {@link DAFF_LOADING_ICON_COMPONENTS}. Deprecated in version 0.78.0. Will be removed in version 1.0.0.
19
- */
20
- declare class DaffLoadingIconModule {
21
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffLoadingIconModule, never>;
22
- static ɵmod: i0.ɵɵNgModuleDeclaration<DaffLoadingIconModule, never, [typeof i1$1.CommonModule, typeof DaffLoadingIconComponent], [typeof DaffLoadingIconComponent]>;
23
- static ɵinj: i0.ɵɵInjectorDeclaration<DaffLoadingIconModule>;
24
- }
25
-
26
- /**
27
- * @docs-private
28
- */
29
- declare const DAFF_LOADING_ICON_COMPONENTS: readonly [typeof DaffLoadingIconComponent];
30
-
31
- export { DAFF_LOADING_ICON_COMPONENTS, DaffLoadingIconComponent, DaffLoadingIconModule };