@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
@@ -1460,18 +1460,45 @@ const validateColor = (color) => {
1460
1460
  }
1461
1461
  };
1462
1462
  /**
1463
- * The `DaffColorableDirective` allows a component to conditionally apply color-specific
1463
+ * `DaffColorableDirective` allows a component to conditionally apply color-specific
1464
1464
  * styles by setting CSS classes based on the specified color. This directive is useful
1465
1465
  * for applying different color palettes to a component in an Angular application.
1466
1466
  *
1467
1467
  * ## Usage
1468
1468
  *
1469
- * ## Example
1469
+ * ### Implementing it as an attribute directive
1470
1470
  *
1471
1471
  * ```html
1472
1472
  * <div daffColorable [color]="componentColor">Colored content</div>
1473
1473
  * ```
1474
1474
  *
1475
+ * ### Implementing it as an Angular host directive
1476
+ *
1477
+ * ```ts
1478
+ * @Component({
1479
+ * standalone: true,
1480
+ * selector: 'custom-component',
1481
+ * template: 'custom-component.html',
1482
+ * hostDirectives: [
1483
+ * {
1484
+ * directive: DaffColorableDirective,
1485
+ * inputs: ['color'],
1486
+ * },
1487
+ * ],
1488
+ * })
1489
+ * export class CustomComponent { }
1490
+ * ```
1491
+ *
1492
+ * ```scss
1493
+ * .custom-component {
1494
+ *
1495
+ * &.daff-primary {
1496
+ * background: daff-color($primary, 10);
1497
+ * color: daff-color($primary, 90);
1498
+ * }
1499
+ * }
1500
+ * ```
1501
+ *
1475
1502
  * ## Styles
1476
1503
  *
1477
1504
  * The directive applies the following CSS classes based on the color:
@@ -1585,23 +1612,50 @@ var DaffStatusEnum;
1585
1612
  })(DaffStatusEnum || (DaffStatusEnum = {}));
1586
1613
 
1587
1614
  /**
1588
- * The `DaffStatusableDirective` allows a component to conditionally apply status-specific
1615
+ * `DaffStatusableDirective` allows a component to conditionally apply status-specific
1589
1616
  * styles by setting CSS classes based on the specified status. This directive is useful
1590
- * for indicating different statuses such as warnings, errors, or success states.
1617
+ * for indicating different statuses such as warning, danger, or success states.
1618
+ *
1619
+ * ## Usage
1591
1620
  *
1592
- * ## Example
1621
+ * ### Implementing it as an attribute directive
1593
1622
  *
1594
1623
  * ```html
1595
1624
  * <div daffStatusable [status]="componentStatus">Status content</div>
1596
1625
  * ```
1597
1626
  *
1627
+ * ### Implementing it as an Angular host directive
1628
+ *
1629
+ * ```ts
1630
+ * @Component({
1631
+ * standalone: true,
1632
+ * selector: 'custom-component',
1633
+ * template: 'custom-component.html',
1634
+ * hostDirectives: [
1635
+ * {
1636
+ * directive: DaffStatusableDirective,
1637
+ * inputs: ['status'],
1638
+ * },
1639
+ * ],
1640
+ * })
1641
+ * export class CustomComponent { }
1642
+ *
1643
+ * ```scss
1644
+ * .custom-component {
1645
+ *
1646
+ * &.daff-danger {
1647
+ * background: daff-color($red, 10);
1648
+ * color: daff-color($red, 90);
1649
+ * }
1650
+ * }
1651
+ * ```
1598
1652
  * ## Styles
1599
1653
  *
1600
1654
  * The directive applies the following CSS classes based on the status:
1601
1655
  *
1602
- * - `daff-warn`: Applied when the status is `Warn`.
1603
- * - `daff-danger`: Applied when the status is `Danger`.
1604
- * - `daff-success`: Applied when the status is `Success`.
1656
+ * - `daff-warn`: Applied when the status is `warn`.
1657
+ * - `daff-danger`: Applied when the status is `danger`.
1658
+ * - `daff-success`: Applied when the status is `success`.
1605
1659
  */
1606
1660
  class DaffStatusableDirective {
1607
1661
  /**
@@ -1632,15 +1686,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1632
1686
  }] } });
1633
1687
 
1634
1688
  /**
1635
- * The `DaffSkeletonableDirective` allows a component to display a skeleton loading
1689
+ * `DaffSkeletonableDirective` allows a component to display a skeleton loading
1636
1690
  * state by conditionally applying a CSS class. This is useful for indicating to
1637
1691
  * users that content is loading or being processed. This directive can be used to
1638
1692
  * apply a skeleton loading state to any component by toggling the `skeleton`
1639
1693
  * input property. When `skeleton` is `true`, the `daff-skeleton` CSS class
1640
1694
  * is applied, which should style the component to look like a loading placeholder.
1641
1695
  *
1642
- * The styles for the`daff-skeleton` class should be defined component's
1643
- * stylesheets to display the loading state as desired.
1696
+ * ## Usage
1697
+ *
1698
+ * ### Implementing it as an attribute directive
1699
+ *
1700
+ * ```html
1701
+ * <div daffSkeletonable [skeleton]="isLoading">Content</div>
1702
+ * ```
1703
+ *
1704
+ * ### Implementing it as an Angular host directive
1705
+ *
1706
+ * ```ts
1707
+ * @Component({
1708
+ * standalone: true,
1709
+ * selector: 'custom-component',
1710
+ * template: 'custom-component.html',
1711
+ * hostDirectives: [
1712
+ * {
1713
+ * directive: DaffSkeletonableDirective,
1714
+ * inputs: ['skeleton'],
1715
+ * },
1716
+ * ],
1717
+ * })
1718
+ * export class CustomComponent { }
1719
+ * ```
1720
+ *
1721
+ * ```scss
1722
+ * .daff-skeleton {
1723
+ * @include state.skeleton-screen(48px, 24px);
1724
+ * }
1725
+ * ```
1726
+ *
1727
+ * ## Styles
1728
+ *
1729
+ * The `daff-skeleton` class should be defined in your styles to display the loading
1730
+ * state as desired. It can be used in conjuction with the `skeleton-screen` mixin, which provides predefined loading styles.
1644
1731
  */
1645
1732
  class DaffSkeletonableDirective {
1646
1733
  constructor() {
@@ -1670,21 +1757,52 @@ var DaffTextAlignmentEnum;
1670
1757
  })(DaffTextAlignmentEnum || (DaffTextAlignmentEnum = {}));
1671
1758
 
1672
1759
  /**
1673
- * The `DaffTextAlignableDirective` allows for dynamic text alignment of a component
1674
- * by setting CSS classes based on the specified text alignment. This directive is
1760
+ * `DaffTextAlignableDirective` allows for dynamic text alignment of a component by
1761
+ * setting CSS classes based on the specified text alignment. This directive is
1675
1762
  * useful when text alignment needs to be managed dynamically in an Angular component.
1676
1763
  *
1677
- * ## Example
1764
+ * ## Usage
1765
+ *
1766
+ * ### Implementing it as an attribute directive
1678
1767
  *
1679
1768
  * ```html
1680
1769
  * <div daffTextAlignable textAlignment="center">Aligned text</div>
1770
+ *
1771
+ * In this example, the `daff-center` class is added to the `div` element, allowing
1772
+ * you to style the `div` as you wish using the class.
1773
+ *
1774
+ * ```
1775
+ *
1776
+ * ### Implementing it as an Angular host directive
1777
+ *
1778
+ * ```ts
1779
+ * @Component({
1780
+ * standalone: true,
1781
+ * selector: 'custom-component',
1782
+ * template: 'custom-component.html',
1783
+ * hostDirectives: [
1784
+ * {
1785
+ * directive: DaffTextAlignableDirective,
1786
+ * inputs: ['textAlignment'],
1787
+ * },
1788
+ * ],
1789
+ * })
1790
+ * export class CustomComponent { }
1791
+ * ```
1792
+ *
1793
+ * ```scss
1794
+ * .custom-component {
1795
+ * &.daff-left {
1796
+ * text-align: left;
1797
+ * }
1798
+ * }
1681
1799
  * ```
1682
1800
  *
1683
1801
  * ## Why not just use CSS?
1684
1802
  *
1685
1803
  * While the native CSS `text-align` property can be used for static text alignment,
1686
1804
  * the `DaffTextAlignableDirective` provides a structured and consistent way to handle
1687
- * dynamic text alignment within Angular components in more complex use-cases
1805
+ * dynamic text alignment within Angular components in more complex use-cases where the
1688
1806
  * application of `text-align:center` would cause unexpected side effects.
1689
1807
  */
1690
1808
  class DaffTextAlignableDirective {
@@ -1720,11 +1838,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1720
1838
  }] } });
1721
1839
 
1722
1840
  /**
1723
- * The `DaffCompactableDirective` allows a component to conditionally apply a compact
1841
+ * `DaffCompactableDirective` allows a component to conditionally apply a compact
1724
1842
  * style by toggling a CSS class. This is useful for creating components that can
1725
1843
  * switch between regular and compact styles based on the `compact` property.
1726
1844
  *
1727
- * ## Example
1845
+ * ## Usage
1846
+ *
1847
+ * ### Implementing it as an attribute directive
1728
1848
  *
1729
1849
  * ```html
1730
1850
  * <div daffCompactable [compact]="isCompact">Content goes here</div>
@@ -1733,6 +1853,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1733
1853
  * In this example, the `daff-compact` class is applied to the `div` element when
1734
1854
  * `isCompact` is `true`, making the `div` display its compact state.
1735
1855
  *
1856
+ * ### Implementing it as an Angular host directive
1857
+ *
1858
+ * ```ts
1859
+ * @Component({
1860
+ * standalone: true,
1861
+ * selector: 'custom-component',
1862
+ * template: 'custom-component.html',
1863
+ * hostDirectives: [
1864
+ * {
1865
+ * directive: DaffCompactableDirective,
1866
+ * inputs: ['compact'],
1867
+ * },
1868
+ * ],
1869
+ * })
1870
+ * export class CustomComponent { }
1871
+ * ```
1872
+ *
1873
+ * ```scss
1874
+ * .custom-component {
1875
+ * padding: 8px 16px;
1876
+ *
1877
+ * &.daff-compact {
1878
+ * padding: 4px 8px;
1879
+ * }
1880
+ * }
1881
+ * ```
1882
+ *
1736
1883
  * ## Styles
1737
1884
  *
1738
1885
  * The `daff-compact` class should be defined in your styles to display the compact
@@ -1759,7 +1906,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1759
1906
  }] } });
1760
1907
 
1761
1908
  /**
1762
- * A directive that gives a component the ability to manage a DaffContainerComponent's layout.
1909
+ * `DaffManageContainerLayoutDirective` gives a component the ability to manage a `DaffContainerComponent`'s layout.
1763
1910
  * By including this directive, predetermined layout styles are passed down to the container.
1764
1911
  *
1765
1912
  * To understand the motivation for this directive, consider:
@@ -1780,6 +1927,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1780
1927
  * The former may inappropriately constrain the width of its child elements,
1781
1928
  * while the latter (without `DaffManageContainerLayoutDirective`) may unexpectedly
1782
1929
  * interfere in the layout features of its parent element (i.e. display: grid, display: flex).
1930
+ *
1931
+ * ## Usage
1932
+ *
1933
+ * ### Implementing it as an attribute directive
1934
+ *
1935
+ * ```html
1936
+ * <my-custom-component daffManageContainerLayout>
1937
+ * <daff-container size="lg"></daff-container>
1938
+ * </my-custom-component>
1939
+ * ```
1940
+ *
1941
+ * ```scss
1942
+ * :host {
1943
+ * display: grid;
1944
+ * grid-template-columns: 1fr 1fr;
1945
+ * }
1946
+ * ```
1947
+ *
1948
+ * ### Implementing it as an Angular host directive
1949
+ *
1950
+ * ```ts
1951
+ * @Component({
1952
+ * standalone: true,
1953
+ * selector: 'my-custom-component',
1954
+ * template: 'my-custom-component.html',
1955
+ * hostDirectives: [{ directive: DaffManageContainerLayoutDirective }],
1956
+ * })
1957
+ * export class MyCustomComponent { }
1958
+ *
1959
+ * ```scss
1960
+ * :host {
1961
+ * display: grid;
1962
+ * grid-template-columns: 1fr 1fr;
1963
+ * }
1964
+ * ```
1965
+ *
1966
+ * 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.
1783
1967
  */
1784
1968
  class DaffManageContainerLayoutDirective {
1785
1969
  constructor() {
@@ -1800,17 +1984,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImpo
1800
1984
  }] } });
1801
1985
 
1802
1986
  /**
1803
- * The `DaffArticleEncapsulatedDirective` is used to encapsulate custom components
1804
- * within an article, preventing article styles from bleeding into the component.
1987
+ * `DaffArticleEncapsulatedDirective` is used to encapsulate custom components within an article,
1988
+ * preventing {@link DaffArticleComponent } styles from bleeding into the component.
1989
+ *
1990
+ * ## Usage
1805
1991
  *
1806
- * ## Example
1992
+ * ### Implementing it as an attribute directive
1807
1993
  *
1808
1994
  * ```html
1809
1995
  * <my-custom-component daffArticleEncapsulated></my-custom-component>
1810
1996
  * ```
1811
1997
  *
1812
- * This directive will apply the `daff-ae` class to your component, ensuring that it is encapsulated
1813
- * from the article's styles.
1998
+ * ### Implementing it as an Angular host directive
1999
+ *
2000
+ * ```ts
2001
+ * @Component({
2002
+ * standalone: true,
2003
+ * selector: 'custom-component',
2004
+ * template: 'custom-component.html',
2005
+ * hostDirectives: [{ directive: DaffArticleEncapsulatedDirective }],
2006
+ * })
2007
+ * export class CustomComponent { }
2008
+ *
2009
+ * This directive will apply the `daff-ae` class to your component, ensuring that it is encapsulated from the article's styles.
1814
2010
  */
1815
2011
  class DaffArticleEncapsulatedDirective {
1816
2012
  constructor() {
@@ -2155,14 +2351,57 @@ var DaffSizableEnum;
2155
2351
  })(DaffSizableEnum || (DaffSizableEnum = {}));
2156
2352
 
2157
2353
  /**
2158
- * The `DaffSizableDirective` allows for dynamic sizing of a component by setting
2354
+ * `DaffSizableDirective` allows for dynamic sizing of a component by setting
2159
2355
  * CSS classes based on the specified size.
2160
2356
  *
2161
- * ## Example
2357
+ * ## Usage
2358
+ *
2359
+ * ### Implementing it as an attribute directive
2162
2360
  *
2163
2361
  * ```html
2164
- * <div daffSizable [size]="componentSize">Sized content</div>
2362
+ * <div daffSizable [size]="small">Sized content</div>
2165
2363
  * ```
2364
+ * In this example, the `daff-small` class is applied to the `div` element, allowing you to
2365
+ * use the class to style the `div`.
2366
+ *
2367
+ * ### Implementing it as an Angular host directive
2368
+ *
2369
+ * ```ts
2370
+ * @Component({
2371
+ * standalone: true,
2372
+ * selector: 'custom-component',
2373
+ * template: 'custom-component.html',
2374
+ * hostDirectives: [
2375
+ * {
2376
+ * directive: DaffSizableDirective,
2377
+ * inputs: ['size'],
2378
+ * },
2379
+ * ],
2380
+ * })
2381
+ * export class CustomComponent { }
2382
+ * ```
2383
+ *
2384
+ * ```scss
2385
+ * .custom-component {
2386
+ * &.daff-sm {
2387
+ * width: 24px;
2388
+ * }
2389
+ *
2390
+ * &.daff-md {
2391
+ * width: 32px;
2392
+ * }
2393
+ * }
2394
+ * ```
2395
+ *
2396
+ * ## Styles
2397
+ *
2398
+ * The directive applies the following CSS classes based on the size:
2399
+ *
2400
+ * - `daff-xs`: Applied when the size is `xs`.
2401
+ * - `daff-sm`: Applied when the size is `sm`.
2402
+ * - `daff-md`: Applied when the size is `md`.
2403
+ * - `daff-lg`: Applied when the size is `lg`.
2404
+ * - `daff-xl`: Applied when the size is `xl`.
2166
2405
  */
2167
2406
  class DaffSizableDirective {
2168
2407
  /**