@daffodil/design 0.75.0 → 0.76.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 (77) hide show
  1. package/article/src/article-theme.scss +18 -8
  2. package/breadcrumb/README.md +52 -0
  3. package/breadcrumb/breadcrumb/breadcrumb.component.d.ts +7 -0
  4. package/breadcrumb/breadcrumb-item/breadcrumb-item.directive.d.ts +9 -0
  5. package/breadcrumb/breadcrumb.d.ts +3 -0
  6. package/breadcrumb/breadcrumb.module.d.ts +9 -0
  7. package/breadcrumb/examples/basic-breadcrumb/basic-breadcrumb.component.d.ts +5 -0
  8. package/breadcrumb/examples/index.d.ts +1 -0
  9. package/breadcrumb/examples/public_api.d.ts +2 -0
  10. package/breadcrumb/index.d.ts +1 -0
  11. package/breadcrumb/public_api.d.ts +4 -0
  12. package/breadcrumb/src/breadcrumb-theme.scss +13 -0
  13. package/core/article-encapsulated/article-encapsulated.directive.d.ts +17 -5
  14. package/core/colorable/colorable.directive.d.ts +29 -2
  15. package/core/compactable/compactable.directive.d.ts +31 -2
  16. package/core/manage-container-layout/manage-container-layout.directive.d.ts +38 -1
  17. package/core/sizable/sizable.directive.d.ts +46 -3
  18. package/core/skeletonable/skeletonable.directive.d.ts +36 -3
  19. package/core/statusable/statusable.directive.d.ts +33 -6
  20. package/core/text-alignable/text-alignable.directive.d.ts +35 -4
  21. package/esm2022/article/article/article.component.mjs +2 -2
  22. package/esm2022/breadcrumb/breadcrumb/breadcrumb.component.mjs +25 -0
  23. package/esm2022/breadcrumb/breadcrumb-item/breadcrumb-item.directive.mjs +33 -0
  24. package/esm2022/breadcrumb/breadcrumb.mjs +7 -0
  25. package/esm2022/breadcrumb/breadcrumb.module.mjs +26 -0
  26. package/esm2022/breadcrumb/daffodil-design-breadcrumb.mjs +5 -0
  27. package/esm2022/breadcrumb/examples/basic-breadcrumb/basic-breadcrumb.component.mjs +15 -0
  28. package/esm2022/breadcrumb/examples/daffodil-design-breadcrumb-examples.mjs +5 -0
  29. package/esm2022/breadcrumb/examples/index.mjs +2 -0
  30. package/esm2022/breadcrumb/examples/public_api.mjs +5 -0
  31. package/esm2022/breadcrumb/index.mjs +2 -0
  32. package/esm2022/breadcrumb/public_api.mjs +5 -0
  33. package/esm2022/core/article-encapsulated/article-encapsulated.directive.mjs +18 -6
  34. package/esm2022/core/colorable/colorable.directive.mjs +30 -3
  35. package/esm2022/core/compactable/compactable.directive.mjs +32 -3
  36. package/esm2022/core/manage-container-layout/manage-container-layout.directive.mjs +39 -2
  37. package/esm2022/core/sizable/sizable.directive.mjs +47 -4
  38. package/esm2022/core/skeletonable/skeletonable.directive.mjs +37 -4
  39. package/esm2022/core/statusable/statusable.directive.mjs +34 -7
  40. package/esm2022/core/text-alignable/text-alignable.directive.mjs +36 -5
  41. package/esm2022/modal/examples/basic-modal/basic-modal.component.mjs +2 -2
  42. package/esm2022/modal/modal/modal-config.mjs +1 -1
  43. package/esm2022/modal/service/modal.service.mjs +4 -1
  44. package/esm2022/sidebar/helper/is-docked-mode.mjs +9 -0
  45. package/esm2022/sidebar/helper/is-floating-mode.mjs +9 -0
  46. package/esm2022/sidebar/public_api.mjs +5 -1
  47. package/esm2022/sidebar/service/registration.type.mjs +2 -0
  48. package/esm2022/sidebar/service/sidebar.service.mjs +36 -0
  49. package/esm2022/sidebar/sidebar-viewport/sidebar-viewport.component.mjs +3 -3
  50. package/esm2022/tree/tree/tree.component.mjs +2 -2
  51. package/esm2022/tree/tree-item/tree-item.directive.mjs +3 -3
  52. package/fesm2022/daffodil-design-article.mjs +2 -2
  53. package/fesm2022/daffodil-design-article.mjs.map +1 -1
  54. package/fesm2022/daffodil-design-breadcrumb-examples.mjs +26 -0
  55. package/fesm2022/daffodil-design-breadcrumb-examples.mjs.map +1 -0
  56. package/fesm2022/daffodil-design-breadcrumb.mjs +90 -0
  57. package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -0
  58. package/fesm2022/daffodil-design-modal-examples.mjs +1 -1
  59. package/fesm2022/daffodil-design-modal-examples.mjs.map +1 -1
  60. package/fesm2022/daffodil-design-modal.mjs +3 -0
  61. package/fesm2022/daffodil-design-modal.mjs.map +1 -1
  62. package/fesm2022/daffodil-design-sidebar.mjs +57 -5
  63. package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
  64. package/fesm2022/daffodil-design-tree.mjs +4 -4
  65. package/fesm2022/daffodil-design-tree.mjs.map +1 -1
  66. package/fesm2022/daffodil-design.mjs +265 -26
  67. package/fesm2022/daffodil-design.mjs.map +1 -1
  68. package/modal/README.md +14 -1
  69. package/modal/modal/modal-config.d.ts +2 -0
  70. package/package.json +1 -1
  71. package/scss/theme.scss +2 -0
  72. package/scss/theming/_theme-css-variables.scss +1 -1
  73. package/sidebar/helper/is-docked-mode.d.ts +5 -0
  74. package/sidebar/helper/is-floating-mode.d.ts +5 -0
  75. package/sidebar/public_api.d.ts +4 -0
  76. package/sidebar/service/registration.type.d.ts +11 -0
  77. package/sidebar/service/sidebar.service.d.ts +25 -0
@@ -17,20 +17,19 @@
17
17
  $table-border-color: theming.daff-illuminate($base, $neutral, 2);
18
18
 
19
19
  .daff-article {
20
+ color: $text-color;
21
+
20
22
  &__meta {
21
23
  color: theming.daff-illuminate($base-contrast, $neutral, 3);
22
24
  }
23
25
 
24
26
  @include stopsArticleCascade(a) {
25
27
  color: theming.daff-color($primary);
26
- }
27
-
28
- @include stopsArticleCascade(h1, h2, h3, h4, h5, h6) {
29
- color: $text-color;
30
- }
31
28
 
32
- @include stopsArticleCascade(p) {
33
- color: $text-color;
29
+ code {
30
+ background: theming.daff-illuminate($base, $primary, 1);
31
+ color: theming.daff-illuminate($base-contrast, $primary, 4);
32
+ }
34
33
  }
35
34
 
36
35
  pre {
@@ -56,12 +55,23 @@
56
55
  blockquote {
57
56
  background: rgba(theming.daff-color($primary), 0.1);
58
57
  border-left: 4px solid theming.daff-illuminate($base, $primary, 5);
59
- color: $base-contrast;
58
+ color: theming.daff-illuminate($base-contrast, $primary, 1);
60
59
 
61
60
  code {
62
61
  background: rgba(theming.daff-color($primary), 0.15);
63
62
  color: $base-contrast;
64
63
  }
64
+
65
+ @include stopsArticleCascade(a) {
66
+ color: theming.daff-illuminate($base, $primary, 7);
67
+ }
68
+
69
+ @include stopsArticleCascade(a) {
70
+ code {
71
+ background: rgba(theming.daff-color($primary), 0.15);
72
+ color: theming.daff-illuminate($base-contrast, $primary, 4);
73
+ }
74
+ }
65
75
  }
66
76
 
67
77
  table {
@@ -0,0 +1,52 @@
1
+ # Breadcrumb
2
+ Breadcrumbs are a secondary navigation that displays a user's location within a website or application.
3
+
4
+ ## Overview
5
+ Breadcrumbs are a visual representation of the site's navigational hierarchy. They indicate the current page's location and allows users to easily move up to a parent level. It's required for breadcrumbs to be used with the native HTML `<ol>` element, and for each item to be an `<li>`. This offers additional context for assistive technology.
6
+
7
+ ## Basic Breadcrumb
8
+ <design-land-example-viewer-container example="basic-breadcrumb"></design-land-example-viewer-container>
9
+
10
+ ## Usage
11
+
12
+ ## Within a standalone component
13
+ To use breadcrumb in a standalone component, import it directly into your custom component:
14
+
15
+ ```ts
16
+ @Component({
17
+ selector: 'custom-component',
18
+ templateUrl: './custom-component.component.html',
19
+ standalone: true,
20
+ imports: [
21
+ DAFF_BREADCRUMB_COMPONENTS,
22
+ ],
23
+ })
24
+ export class CustomComponent {}
25
+ ```
26
+
27
+ ## Within a module (deprecated)
28
+ To use breadcrumb in a module, import `DaffBreadcrumbModule` into your custom module:
29
+
30
+ ```ts
31
+ import { NgModule } from '@angular/core';
32
+
33
+ import { DaffBreadcrumbModule } from '@daffodil/design/breadcrumb';
34
+
35
+ @NgModule({
36
+ declarations: [
37
+ CustomComponent,
38
+ ],
39
+ exports: [
40
+ CustomComponent,
41
+ ],
42
+ imports: [
43
+ DaffBreadcrumbModule,
44
+ ],
45
+ })
46
+ export class CustomComponentModule { }
47
+ ```
48
+
49
+ > This method is deprecated. It's recommended to update all custom components to standalone.
50
+
51
+ ## Accessibility
52
+ Breadcrumbs should be wrapped in a native HTML `<nav>` element so that assistive technologies can present the breadcrumbs as a navigational element on the page. Use `aria-label="Breadcrumbs"` on the `nav` element to provide more context. `aria-current="page"` is added to a breadcrumb item when it's the current page, and `aria-current="false"` on all other items.
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@daffodil/design";
3
+ export declare class DaffBreadcrumbComponent {
4
+ class: boolean;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<DaffBreadcrumbComponent, "ol[daff-breadcrumb]", never, {}, {}, never, ["[daffBreadcrumbItem]"], true, [{ directive: typeof i1.DaffArticleEncapsulatedDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.DaffSkeletonableDirective; inputs: { "skeleton": "skeleton"; }; outputs: {}; }]>;
7
+ }
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class DaffBreadcrumbItemDirective {
3
+ class: boolean;
4
+ get ariaCurrent(): "page" | "false";
5
+ /** Whether or not the breadcrumb item is active */
6
+ active: boolean;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbItemDirective, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DaffBreadcrumbItemDirective, "li[daffBreadcrumbItem]", never, { "active": { "alias": "active"; "required": false; }; }, {}, never, never, true, never>;
9
+ }
@@ -0,0 +1,3 @@
1
+ import { DaffBreadcrumbComponent } from './breadcrumb/breadcrumb.component';
2
+ import { DaffBreadcrumbItemDirective } from './breadcrumb-item/breadcrumb-item.directive';
3
+ export declare const DAFF_BREADCRUMB_COMPONENTS: readonly [typeof DaffBreadcrumbComponent, typeof DaffBreadcrumbItemDirective];
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./breadcrumb/breadcrumb.component";
3
+ import * as i2 from "./breadcrumb-item/breadcrumb-item.directive";
4
+ /** @deprecated in favor of {@link DAFF_BREADCRUMB_COMPONENTS} */
5
+ export declare class DaffBreadcrumbModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffBreadcrumbModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DaffBreadcrumbModule, never, [typeof i1.DaffBreadcrumbComponent, typeof i2.DaffBreadcrumbItemDirective], [typeof i1.DaffBreadcrumbComponent, typeof i2.DaffBreadcrumbItemDirective]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<DaffBreadcrumbModule>;
9
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class BasicBreadcrumbComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<BasicBreadcrumbComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<BasicBreadcrumbComponent, "basic-breadcrumb", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './public_api';
@@ -0,0 +1,2 @@
1
+ import { BasicBreadcrumbComponent } from './basic-breadcrumb/basic-breadcrumb.component';
2
+ export declare const BREADCRUMB_EXAMPLES: (typeof BasicBreadcrumbComponent)[];
@@ -0,0 +1 @@
1
+ export * from './public_api';
@@ -0,0 +1,4 @@
1
+ export * from './breadcrumb/breadcrumb.component';
2
+ export * from './breadcrumb-item/breadcrumb-item.directive';
3
+ export { DAFF_BREADCRUMB_COMPONENTS } from './breadcrumb';
4
+ export { DaffBreadcrumbModule } from './breadcrumb.module';
@@ -0,0 +1,13 @@
1
+ @use 'sass:map';
2
+ @use '../../scss/core';
3
+ @use '../../scss/theming';
4
+
5
+ @mixin daff-breadcrumb-theme($theme) {
6
+ $base: core.daff-map-deep-get($theme, 'core.base');
7
+ $base-contrast: core.daff-map-deep-get($theme, 'core.base-contrast');
8
+ $neutral: core.daff-map-deep-get($theme, 'core.neutral');
9
+
10
+ .daff-breadcrumb__item {
11
+ color: theming.daff-illuminate($base-contrast, $neutral, 4);
12
+ }
13
+ }
@@ -1,16 +1,28 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * The `DaffArticleEncapsulatedDirective` is used to encapsulate custom components
4
- * within an article, preventing article styles from bleeding into the component.
3
+ * `DaffArticleEncapsulatedDirective` is used to encapsulate custom components within an article,
4
+ * preventing {@link DaffArticleComponent } styles from bleeding into the component.
5
5
  *
6
- * ## Example
6
+ * ## Usage
7
+ *
8
+ * ### Implementing it as an attribute directive
7
9
  *
8
10
  * ```html
9
11
  * <my-custom-component daffArticleEncapsulated></my-custom-component>
10
12
  * ```
11
13
  *
12
- * This directive will apply the `daff-ae` class to your component, ensuring that it is encapsulated
13
- * from the article's styles.
14
+ * ### Implementing it as an Angular host directive
15
+ *
16
+ * ```ts
17
+ * @Component({
18
+ * standalone: true,
19
+ * selector: 'custom-component',
20
+ * template: 'custom-component.html',
21
+ * hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
22
+ * })
23
+ * export class CustomComponent { }
24
+ *
25
+ * This directive will apply the `daff-ae` class to your component, ensuring that it is encapsulated from the article's styles.
14
26
  */
15
27
  export declare class DaffArticleEncapsulatedDirective {
16
28
  class: boolean;
@@ -2,18 +2,45 @@ import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { DaffColorable, DaffPalette } from './colorable';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * The `DaffColorableDirective` allows a component to conditionally apply color-specific
5
+ * `DaffColorableDirective` allows a component to conditionally apply color-specific
6
6
  * styles by setting CSS classes based on the specified color. This directive is useful
7
7
  * for applying different color palettes to a component in an Angular application.
8
8
  *
9
9
  * ## Usage
10
10
  *
11
- * ## Example
11
+ * ### Implementing it as an attribute directive
12
12
  *
13
13
  * ```html
14
14
  * <div daffColorable [color]="componentColor">Colored content</div>
15
15
  * ```
16
16
  *
17
+ * ### Implementing it as an Angular host directive
18
+ *
19
+ * ```ts
20
+ * @Component({
21
+ * standalone: true,
22
+ * selector: 'custom-component',
23
+ * template: 'custom-component.html',
24
+ * hostDirectives: [
25
+ * {
26
+ * directive: DaffColorableDirective,
27
+ * inputs: ['color'],
28
+ * },
29
+ * ],
30
+ * })
31
+ * export class CustomComponent { }
32
+ * ```
33
+ *
34
+ * ```scss
35
+ * .custom-component {
36
+ *
37
+ * &.daff-primary {
38
+ * background: daff-color($primary, 10);
39
+ * color: daff-color($primary, 90);
40
+ * }
41
+ * }
42
+ * ```
43
+ *
17
44
  * ## Styles
18
45
  *
19
46
  * The directive applies the following CSS classes based on the color:
@@ -1,10 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * The `DaffCompactableDirective` allows a component to conditionally apply a compact
3
+ * `DaffCompactableDirective` allows a component to conditionally apply a compact
4
4
  * style by toggling a CSS class. This is useful for creating components that can
5
5
  * switch between regular and compact styles based on the `compact` property.
6
6
  *
7
- * ## Example
7
+ * ## Usage
8
+ *
9
+ * ### Implementing it as an attribute directive
8
10
  *
9
11
  * ```html
10
12
  * <div daffCompactable [compact]="isCompact">Content goes here</div>
@@ -13,6 +15,33 @@ import * as i0 from "@angular/core";
13
15
  * In this example, the `daff-compact` class is applied to the `div` element when
14
16
  * `isCompact` is `true`, making the `div` display its compact state.
15
17
  *
18
+ * ### Implementing it as an Angular host directive
19
+ *
20
+ * ```ts
21
+ * @Component({
22
+ * standalone: true,
23
+ * selector: 'custom-component',
24
+ * template: 'custom-component.html',
25
+ * hostDirectives: [
26
+ * {
27
+ * directive: DaffCompactableDirective,
28
+ * inputs: ['compact'],
29
+ * },
30
+ * ],
31
+ * })
32
+ * export class CustomComponent { }
33
+ * ```
34
+ *
35
+ * ```scss
36
+ * .custom-component {
37
+ * padding: 8px 16px;
38
+ *
39
+ * &.daff-compact {
40
+ * padding: 4px 8px;
41
+ * }
42
+ * }
43
+ * ```
44
+ *
16
45
  * ## Styles
17
46
  *
18
47
  * The `daff-compact` class should be defined in your styles to display the compact
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * A directive that gives a component the ability to manage a DaffContainerComponent's layout.
3
+ * `DaffManageContainerLayoutDirective` gives a component the ability to manage a `DaffContainerComponent`'s layout.
4
4
  * By including this directive, predetermined layout styles are passed down to the container.
5
5
  *
6
6
  * To understand the motivation for this directive, consider:
@@ -21,6 +21,43 @@ import * as i0 from "@angular/core";
21
21
  * The former may inappropriately constrain the width of its child elements,
22
22
  * while the latter (without `DaffManageContainerLayoutDirective`) may unexpectedly
23
23
  * interfere in the layout features of its parent element (i.e. display: grid, display: flex).
24
+ *
25
+ * ## Usage
26
+ *
27
+ * ### Implementing it as an attribute directive
28
+ *
29
+ * ```html
30
+ * <my-custom-component daffManageContainerLayout>
31
+ * <daff-container size="lg"></daff-container>
32
+ * </my-custom-component>
33
+ * ```
34
+ *
35
+ * ```scss
36
+ * :host {
37
+ * display: grid;
38
+ * grid-template-columns: 1fr 1fr;
39
+ * }
40
+ * ```
41
+ *
42
+ * ### Implementing it as an Angular host directive
43
+ *
44
+ * ```ts
45
+ * @Component({
46
+ * standalone: true,
47
+ * selector: 'my-custom-component',
48
+ * template: 'my-custom-component.html',
49
+ * hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
50
+ * })
51
+ * export class MyCustomComponent { }
52
+ *
53
+ * ```scss
54
+ * :host {
55
+ * display: grid;
56
+ * grid-template-columns: 1fr 1fr;
57
+ * }
58
+ * ```
59
+ *
60
+ * This directive will apply the `daff-manage-container-layout` class to your component, ensuring that the styles set on `:host` are passed down to the container.
24
61
  */
25
62
  export declare class DaffManageContainerLayoutDirective {
26
63
  class: boolean;
@@ -2,14 +2,57 @@ import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { DaffSizable, DaffSizeAllType } from './sizable';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * The `DaffSizableDirective` allows for dynamic sizing of a component by setting
5
+ * `DaffSizableDirective` allows for dynamic sizing of a component by setting
6
6
  * CSS classes based on the specified size.
7
7
  *
8
- * ## Example
8
+ * ## Usage
9
+ *
10
+ * ### Implementing it as an attribute directive
9
11
  *
10
12
  * ```html
11
- * <div daffSizable [size]="componentSize">Sized content</div>
13
+ * <div daffSizable [size]="small">Sized content</div>
14
+ * ```
15
+ * In this example, the `daff-small` class is applied to the `div` element, allowing you to
16
+ * use the class to style the `div`.
17
+ *
18
+ * ### Implementing it as an Angular host directive
19
+ *
20
+ * ```ts
21
+ * @Component({
22
+ * standalone: true,
23
+ * selector: 'custom-component',
24
+ * template: 'custom-component.html',
25
+ * hostDirectives: [
26
+ * {
27
+ * directive: DaffSizableDirective,
28
+ * inputs: ['size'],
29
+ * },
30
+ * ],
31
+ * })
32
+ * export class CustomComponent { }
33
+ * ```
34
+ *
35
+ * ```scss
36
+ * .custom-component {
37
+ * &.daff-sm {
38
+ * width: 24px;
39
+ * }
40
+ *
41
+ * &.daff-md {
42
+ * width: 32px;
43
+ * }
44
+ * }
12
45
  * ```
46
+ *
47
+ * ## Styles
48
+ *
49
+ * The directive applies the following CSS classes based on the size:
50
+ *
51
+ * - `daff-xs`: Applied when the size is `xs`.
52
+ * - `daff-sm`: Applied when the size is `sm`.
53
+ * - `daff-md`: Applied when the size is `md`.
54
+ * - `daff-lg`: Applied when the size is `lg`.
55
+ * - `daff-xl`: Applied when the size is `xl`.
13
56
  */
14
57
  export declare class DaffSizableDirective<T extends DaffSizeAllType> implements DaffSizable<T>, OnChanges, OnInit {
15
58
  /**
@@ -1,14 +1,47 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * The `DaffSkeletonableDirective` allows a component to display a skeleton loading
3
+ * `DaffSkeletonableDirective` allows a component to display a skeleton loading
4
4
  * state by conditionally applying a CSS class. This is useful for indicating to
5
5
  * users that content is loading or being processed. This directive can be used to
6
6
  * apply a skeleton loading state to any component by toggling the `skeleton`
7
7
  * input property. When `skeleton` is `true`, the `daff-skeleton` CSS class
8
8
  * is applied, which should style the component to look like a loading placeholder.
9
9
  *
10
- * The styles for the`daff-skeleton` class should be defined component's
11
- * stylesheets to display the loading state as desired.
10
+ * ## Usage
11
+ *
12
+ * ### Implementing it as an attribute directive
13
+ *
14
+ * ```html
15
+ * <div daffSkeletonable [skeleton]="isLoading">Content</div>
16
+ * ```
17
+ *
18
+ * ### Implementing it as an Angular host directive
19
+ *
20
+ * ```ts
21
+ * @Component({
22
+ * standalone: true,
23
+ * selector: 'custom-component',
24
+ * template: 'custom-component.html',
25
+ * hostDirectives: [
26
+ * {
27
+ * directive: DaffSkeletonableDirective,
28
+ * inputs: ['skeleton'],
29
+ * },
30
+ * ],
31
+ * })
32
+ * export class CustomComponent { }
33
+ * ```
34
+ *
35
+ * ```scss
36
+ * .daff-skeleton {
37
+ * @include state.skeleton-screen(48px, 24px);
38
+ * }
39
+ * ```
40
+ *
41
+ * ## Styles
42
+ *
43
+ * The `daff-skeleton` class should be defined in your styles to display the loading
44
+ * state as desired. It can be used in conjuction with the `skeleton-screen` mixin, which provides predefined loading styles.
12
45
  */
13
46
  export declare class DaffSkeletonableDirective {
14
47
  skeleton: boolean;
@@ -1,23 +1,50 @@
1
1
  import { DaffStatus, DaffStatusable } from './statusable';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
- * The `DaffStatusableDirective` allows a component to conditionally apply status-specific
4
+ * `DaffStatusableDirective` allows a component to conditionally apply status-specific
5
5
  * styles by setting CSS classes based on the specified status. This directive is useful
6
- * for indicating different statuses such as warnings, errors, or success states.
6
+ * for indicating different statuses such as warning, danger, or success states.
7
7
  *
8
- * ## Example
8
+ * ## Usage
9
+ *
10
+ * ### Implementing it as an attribute directive
9
11
  *
10
12
  * ```html
11
13
  * <div daffStatusable [status]="componentStatus">Status content</div>
12
14
  * ```
13
15
  *
16
+ * ### Implementing it as an Angular host directive
17
+ *
18
+ * ```ts
19
+ * @Component({
20
+ * standalone: true,
21
+ * selector: 'custom-component',
22
+ * template: 'custom-component.html',
23
+ * hostDirectives: [
24
+ * {
25
+ * directive: DaffStatusableDirective,
26
+ * inputs: ['status'],
27
+ * },
28
+ * ],
29
+ * })
30
+ * export class CustomComponent { }
31
+ *
32
+ * ```scss
33
+ * .custom-component {
34
+ *
35
+ * &.daff-danger {
36
+ * background: daff-color($red, 10);
37
+ * color: daff-color($red, 90);
38
+ * }
39
+ * }
40
+ * ```
14
41
  * ## Styles
15
42
  *
16
43
  * The directive applies the following CSS classes based on the status:
17
44
  *
18
- * - `daff-warn`: Applied when the status is `Warn`.
19
- * - `daff-danger`: Applied when the status is `Danger`.
20
- * - `daff-success`: Applied when the status is `Success`.
45
+ * - `daff-warn`: Applied when the status is `warn`.
46
+ * - `daff-danger`: Applied when the status is `danger`.
47
+ * - `daff-success`: Applied when the status is `success`.
21
48
  */
22
49
  export declare class DaffStatusableDirective implements DaffStatusable {
23
50
  /**
@@ -2,21 +2,52 @@ import { OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { DaffTextAlignable, DaffTextAlignment } from './text-alignable';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
- * The `DaffTextAlignableDirective` allows for dynamic text alignment of a component
6
- * by setting CSS classes based on the specified text alignment. This directive is
5
+ * `DaffTextAlignableDirective` allows for dynamic text alignment of a component by
6
+ * setting CSS classes based on the specified text alignment. This directive is
7
7
  * useful when text alignment needs to be managed dynamically in an Angular component.
8
8
  *
9
- * ## Example
9
+ * ## Usage
10
+ *
11
+ * ### Implementing it as an attribute directive
10
12
  *
11
13
  * ```html
12
14
  * <div daffTextAlignable textAlignment="center">Aligned text</div>
15
+ *
16
+ * In this example, the `daff-center` class is added to the `div` element, allowing
17
+ * you to style the `div` as you wish using the class.
18
+ *
19
+ * ```
20
+ *
21
+ * ### Implementing it as an Angular host directive
22
+ *
23
+ * ```ts
24
+ * @Component({
25
+ * standalone: true,
26
+ * selector: 'custom-component',
27
+ * template: 'custom-component.html',
28
+ * hostDirectives: [
29
+ * {
30
+ * directive: DaffTextAlignableDirective,
31
+ * inputs: ['textAlignment'],
32
+ * },
33
+ * ],
34
+ * })
35
+ * export class CustomComponent { }
36
+ * ```
37
+ *
38
+ * ```scss
39
+ * .custom-component {
40
+ * &.daff-left {
41
+ * text-align: left;
42
+ * }
43
+ * }
13
44
  * ```
14
45
  *
15
46
  * ## Why not just use CSS?
16
47
  *
17
48
  * While the native CSS `text-align` property can be used for static text alignment,
18
49
  * the `DaffTextAlignableDirective` provides a structured and consistent way to handle
19
- * dynamic text alignment within Angular components in more complex use-cases
50
+ * dynamic text alignment within Angular components in more complex use-cases where the
20
51
  * application of `text-align:center` would cause unexpected side effects.
21
52
  */
22
53
  export declare class DaffTextAlignableDirective implements DaffTextAlignable, OnChanges {
@@ -15,11 +15,11 @@ export class DaffArticleComponent {
15
15
  this.role = 'article';
16
16
  }
17
17
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffArticleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
18
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: DaffArticleComponent, selector: "daff-article", host: { properties: { "class.daff-article": "this.class", "attr.role": "this.role" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:600;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-bottom:1.5rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-top:2.5rem}.daff-article h1:not(.daff-ae *,.daff-ae){font-weight:700;font-size:2rem;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;line-height:1.75rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1.25rem;line-height:1.5rem;font-weight:400}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;line-height:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;line-height:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:700}.daff-article pre{display:block;border-radius:.25em;font-size:.875rem;line-height:1.5rem;margin:1.5rem 0;padding:1.5rem;overflow:auto;white-space:pre-wrap}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;padding:0}.daff-article code{border-radius:.25em;font-size:.875rem;line-height:1rem;padding:.25em}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25em;margin:1.5rem 0;padding:1rem 1.5rem}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:block;border-collapse:collapse;margin:1.5rem 0;overflow:auto;width:100%}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:bottom;box-sizing:border-box}.daff-article table td{padding:.5rem 1rem;vertical-align:top;box-sizing:border-box}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
18
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: DaffArticleComponent, selector: "daff-article", host: { properties: { "class.daff-article": "this.class", "attr.role": "this.role" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:600;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-bottom:1.5rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-top:2.5rem}.daff-article h1:not(.daff-ae *,.daff-ae){font-weight:700;font-size:2rem;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;line-height:1.75rem;font-weight:400}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;line-height:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;line-height:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:700}.daff-article pre{display:block;border-radius:.25em;font-size:.875rem;line-height:1.5rem;margin:1.5rem 0;padding:1.5rem;overflow:auto;white-space:pre-wrap}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;padding:0}.daff-article code{border-radius:.25em;font-size:.875rem;line-height:1rem;padding:.125em .25em}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25em;margin:1.5rem 0;padding:1rem 1.5rem}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:block;border-collapse:collapse;margin:1.5rem 0;overflow:auto;width:100%}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:bottom;box-sizing:border-box}.daff-article table td{padding:.5rem 1rem;vertical-align:top;box-sizing:border-box}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
19
19
  }
20
20
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: DaffArticleComponent, decorators: [{
21
21
  type: Component,
22
- args: [{ selector: 'daff-article', template: '<ng-content></ng-content>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:600;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-bottom:1.5rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-top:2.5rem}.daff-article h1:not(.daff-ae *,.daff-ae){font-weight:700;font-size:2rem;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;line-height:1.75rem;font-weight:400}.daff-article h1:not(.daff-ae *,.daff-ae)+p code{font-size:1.25rem;line-height:1.5rem;font-weight:400}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;line-height:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;line-height:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:700}.daff-article pre{display:block;border-radius:.25em;font-size:.875rem;line-height:1.5rem;margin:1.5rem 0;padding:1.5rem;overflow:auto;white-space:pre-wrap}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;padding:0}.daff-article code{border-radius:.25em;font-size:.875rem;line-height:1rem;padding:.25em}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25em;margin:1.5rem 0;padding:1rem 1.5rem}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:block;border-collapse:collapse;margin:1.5rem 0;overflow:auto;width:100%}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:bottom;box-sizing:border-box}.daff-article table td{padding:.5rem 1rem;vertical-align:top;box-sizing:border-box}\n"] }]
22
+ args: [{ selector: 'daff-article', template: '<ng-content></ng-content>', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".daff-article{display:block;overflow:hidden}.daff-article a:not(.daff-ae *,.daff-ae){font-weight:600;text-decoration:none}.daff-article a:not(.daff-ae *,.daff-ae):hover{text-decoration:underline}.daff-article a:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h1:not(.daff-ae *,.daff-ae),.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-bottom:1.5rem;word-wrap:break-word}.daff-article h1:not(.daff-ae *,.daff-ae) code,.daff-article h2:not(.daff-ae *,.daff-ae) code,.daff-article h3:not(.daff-ae *,.daff-ae) code,.daff-article h4:not(.daff-ae *,.daff-ae) code,.daff-article h5:not(.daff-ae *,.daff-ae) code,.daff-article h6:not(.daff-ae *,.daff-ae) code{font-size:.875em;font-weight:600;line-height:.875em}.daff-article h2:not(.daff-ae *,.daff-ae),.daff-article h3:not(.daff-ae *,.daff-ae),.daff-article h4:not(.daff-ae *,.daff-ae),.daff-article h5:not(.daff-ae *,.daff-ae),.daff-article h6:not(.daff-ae *,.daff-ae){margin-top:2.5rem}.daff-article h1:not(.daff-ae *,.daff-ae){font-weight:700;font-size:2rem;line-height:2.25rem}@media (min-width: 768px){.daff-article h1:not(.daff-ae *,.daff-ae){font-size:3rem;line-height:3.5rem}}.daff-article h1:not(.daff-ae *,.daff-ae)+p{font-size:1.25rem;line-height:1.75rem;font-weight:400}.daff-article h2:not(.daff-ae *,.daff-ae){font-size:2rem;line-height:2.5rem}.daff-article h3:not(.daff-ae *,.daff-ae){font-size:1.5rem;line-height:2rem}.daff-article h4:not(.daff-ae *,.daff-ae){font-size:1.25rem;line-height:1.5rem}.daff-article h5:not(.daff-ae *,.daff-ae){font-size:1.125rem;line-height:1.5rem}.daff-article h6:not(.daff-ae *,.daff-ae){font-size:1rem;line-height:1.5rem}.daff-article p:not(.daff-ae *,.daff-ae){margin:0 0 1rem}.daff-article strong{font-weight:700}.daff-article pre{display:block;border-radius:.25em;font-size:.875rem;line-height:1.5rem;margin:1.5rem 0;padding:1.5rem;overflow:auto;white-space:pre-wrap}.daff-article pre:last-child{margin-bottom:0}.daff-article pre code{display:block;padding:0}.daff-article code{border-radius:.25em;font-size:.875rem;line-height:1rem;padding:.125em .25em}.daff-article__meta{font-size:.875rem}.daff-article hr{border:0;height:1px;margin:2rem 0}.daff-article blockquote{border-radius:.25em;margin:1.5rem 0;padding:1rem 1.5rem}.daff-article blockquote:last-child{margin-bottom:0}.daff-article blockquote cite{font-size:.875rem;font-weight:400;line-height:1.25rem;display:block;margin-top:1rem}.daff-article blockquote p:last-of-type{margin:0}.daff-article table{display:block;border-collapse:collapse;margin:1.5rem 0;overflow:auto;width:100%}.daff-article table:last-child{margin-bottom:0}.daff-article table th{font-weight:600;outline:0;padding:1rem;text-align:left;vertical-align:bottom;box-sizing:border-box}.daff-article table td{padding:.5rem 1rem;vertical-align:top;box-sizing:border-box}\n"] }]
23
23
  }], propDecorators: { class: [{
24
24
  type: HostBinding,
25
25
  args: ['class.daff-article']