@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.
- package/README.md +0 -1
- package/accordion/src/accordion-theme.scss +2 -2
- package/article/src/article/_stops-article-cascade.scss +5 -1
- package/article/src/article-theme.scss +2 -2
- package/badge/README.md +85 -0
- package/badge/src/badge-theme.scss +197 -0
- package/beacon/README.md +61 -0
- package/beacon/src/beacon-theme.scss +61 -0
- package/breadcrumb/src/breadcrumb-theme.scss +2 -2
- package/button/src/button/basic/button-theme.scss +2 -2
- package/button/src/button/flat/flat-theme.scss +2 -2
- package/button/src/button/icon/icon-theme.scss +2 -2
- package/button/src/button/raised/raised-theme.scss +13 -13
- package/button/src/button/stroked/stroked-theme.scss +2 -2
- package/button/src/button/underline/underline-theme.scss +2 -2
- package/callout/src/callout-theme.scss +12 -2
- package/card/src/card/stroked/stroked-theme.scss +14 -22
- package/card/src/card-base-theme.scss +4 -4
- package/card/src/card-base.scss +13 -16
- package/fesm2022/daffodil-design-accordion.mjs +9 -15
- package/fesm2022/daffodil-design-accordion.mjs.map +1 -1
- package/fesm2022/daffodil-design-article.mjs +2 -2
- package/fesm2022/daffodil-design-article.mjs.map +1 -1
- package/fesm2022/daffodil-design-badge.mjs +87 -0
- package/fesm2022/daffodil-design-badge.mjs.map +1 -0
- package/fesm2022/daffodil-design-beacon.mjs +48 -0
- package/fesm2022/daffodil-design-beacon.mjs.map +1 -0
- package/fesm2022/daffodil-design-breadcrumb.mjs +1 -1
- package/fesm2022/daffodil-design-breadcrumb.mjs.map +1 -1
- package/fesm2022/daffodil-design-button.mjs +1 -1
- package/fesm2022/daffodil-design-button.mjs.map +1 -1
- package/fesm2022/daffodil-design-callout.mjs +2 -2
- package/fesm2022/daffodil-design-card.mjs +9 -11
- package/fesm2022/daffodil-design-card.mjs.map +1 -1
- package/fesm2022/daffodil-design-form-field.mjs +95 -115
- package/fesm2022/daffodil-design-form-field.mjs.map +1 -1
- package/fesm2022/daffodil-design-form.mjs +5 -7
- package/fesm2022/daffodil-design-form.mjs.map +1 -1
- package/fesm2022/daffodil-design-image.mjs +41 -98
- package/fesm2022/daffodil-design-image.mjs.map +1 -1
- package/fesm2022/daffodil-design-input.mjs +3 -3
- package/fesm2022/daffodil-design-input.mjs.map +1 -1
- package/fesm2022/daffodil-design-list.mjs +16 -21
- package/fesm2022/daffodil-design-list.mjs.map +1 -1
- package/fesm2022/daffodil-design-media-gallery.mjs +56 -61
- package/fesm2022/daffodil-design-media-gallery.mjs.map +1 -1
- package/fesm2022/daffodil-design-menu.mjs +61 -38
- package/fesm2022/daffodil-design-menu.mjs.map +1 -1
- package/fesm2022/daffodil-design-modal.mjs +2 -2
- package/fesm2022/daffodil-design-modal.mjs.map +1 -1
- package/fesm2022/daffodil-design-native-select.mjs +3 -3
- package/fesm2022/daffodil-design-native-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-notification.mjs +17 -20
- package/fesm2022/daffodil-design-notification.mjs.map +1 -1
- package/fesm2022/daffodil-design-paginator.mjs +71 -76
- package/fesm2022/daffodil-design-paginator.mjs.map +1 -1
- package/fesm2022/daffodil-design-progress-bar.mjs +33 -53
- package/fesm2022/daffodil-design-progress-bar.mjs.map +1 -1
- package/fesm2022/daffodil-design-select.mjs +1 -1
- package/fesm2022/daffodil-design-select.mjs.map +1 -1
- package/fesm2022/daffodil-design-sidebar.mjs +2 -2
- package/fesm2022/daffodil-design-sidebar.mjs.map +1 -1
- package/fesm2022/daffodil-design-spinner.mjs +17 -16
- package/fesm2022/daffodil-design-spinner.mjs.map +1 -1
- package/fesm2022/daffodil-design-switch.mjs +20 -29
- package/fesm2022/daffodil-design-switch.mjs.map +1 -1
- package/fesm2022/daffodil-design-tabs.mjs +86 -88
- package/fesm2022/daffodil-design-tabs.mjs.map +1 -1
- package/fesm2022/daffodil-design-tag.mjs +33 -28
- package/fesm2022/daffodil-design-tag.mjs.map +1 -1
- package/fesm2022/daffodil-design-text-snippet.mjs +18 -23
- package/fesm2022/daffodil-design-text-snippet.mjs.map +1 -1
- package/fesm2022/daffodil-design-textarea.mjs +3 -3
- package/fesm2022/daffodil-design-textarea.mjs.map +1 -1
- package/fesm2022/daffodil-design-toast.mjs +19 -20
- package/fesm2022/daffodil-design-toast.mjs.map +1 -1
- package/fesm2022/daffodil-design.mjs +111 -80
- package/fesm2022/daffodil-design.mjs.map +1 -1
- package/form/src/hint/hint-theme.scss +2 -2
- package/form-field/src/form-field-theme.scss +2 -2
- package/hero/src/hero-theme.scss +12 -2
- package/list/README.md +10 -0
- package/list/src/list-theme.scss +2 -2
- package/media-gallery/README.md +0 -5
- package/media-gallery/src/media-gallery-theme.scss +2 -2
- package/menu/README.md +5 -0
- package/menu/src/menu-theme.scss +4 -4
- package/notification/src/notification-theme.scss +2 -2
- package/package.json +1 -1
- package/paginator/src/paginator-theme.scss +2 -2
- package/progress-bar/README.md +1 -1
- package/progress-bar/src/progress-bar-theme.scss +2 -2
- package/scss/global.scss +4 -0
- package/scss/state/skeleton/_mixins.scss +2 -2
- package/scss/theme/default.scss +15 -0
- package/scss/theme.scss +4 -8
- package/scss/theming/_configure-palette.scss +5 -1
- package/scss/theming/_get-theme-mode.scss +1 -1
- package/scss/theming/_index.scss +2 -3
- package/scss/theming/_light-dark.scss +37 -12
- package/scss/theming/color-shift/_color-shift.scss +56 -0
- package/scss/theming/color-shift/_color-shift.spec.scss +107 -0
- package/scss/theming/color-shift/_index.scss +1 -0
- package/scss/theming/{_daff-theme.scss → default/_daff-theme.scss} +4 -4
- package/scss/theming/default/_index.scss +1 -0
- package/select/src/select-theme.scss +5 -3
- package/switch/src/switch-theme.scss +2 -2
- package/tabs/src/tabs-theme.scss +2 -2
- package/tag/README.md +10 -6
- package/tag/src/tag-theme.scss +102 -5
- package/toast/src/toast-theme.scss +2 -2
- package/tree/src/tree-theme.scss +2 -2
- package/types/daffodil-design-accordion.d.ts +4 -4
- package/types/daffodil-design-badge.d.ts +63 -0
- package/types/daffodil-design-beacon.d.ts +26 -0
- package/types/daffodil-design-card.d.ts +2 -2
- package/types/daffodil-design-form-field.d.ts +34 -31
- package/types/daffodil-design-form.d.ts +2 -2
- package/types/daffodil-design-image.d.ts +15 -28
- package/types/daffodil-design-list.d.ts +3 -3
- package/types/daffodil-design-media-gallery.d.ts +31 -20
- package/types/daffodil-design-menu.d.ts +51 -20
- package/types/daffodil-design-notification.d.ts +5 -6
- package/types/daffodil-design-paginator.d.ts +20 -25
- package/types/daffodil-design-progress-bar.d.ts +16 -21
- package/types/daffodil-design-spinner.d.ts +2 -2
- package/types/daffodil-design-switch.d.ts +7 -8
- package/types/daffodil-design-tabs.d.ts +29 -29
- package/types/daffodil-design-tag.d.ts +22 -16
- package/types/daffodil-design-text-snippet.d.ts +9 -9
- package/types/daffodil-design.d.ts +61 -41
- package/fesm2022/daffodil-design-loading-icon.mjs +0 -67
- package/fesm2022/daffodil-design-loading-icon.mjs.map +0 -1
- package/loading-icon/README.md +0 -59
- package/loading-icon/src/loading-icon-theme.scss +0 -103
- package/scss/theming/illuminate/illuminate.scss +0 -149
- package/scss/theming/illuminate/illuminate.spec.scss +0 -15
- package/types/daffodil-design-loading-icon.d.ts +0 -31
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
.daff-media-gallery {
|
|
9
9
|
$root: &;
|
|
10
10
|
|
|
11
|
-
@include light($mode) {
|
|
11
|
+
@include daff-light-mode($mode) {
|
|
12
12
|
.daff-thumbnail {
|
|
13
13
|
background: daff-color($neutral, 20);
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@include dark($mode) {
|
|
21
|
+
@include daff-dark-mode($mode) {
|
|
22
22
|
.daff-thumbnail {
|
|
23
23
|
background: daff-color($neutral, 70);
|
|
24
24
|
|
package/menu/README.md
CHANGED
|
@@ -81,6 +81,11 @@ Menus generate a unique id automatically. To set your own, add an `id` to the ac
|
|
|
81
81
|
|
|
82
82
|
<daff-docs-example-viewer example="menu-with-id"></daff-docs-example-viewer>
|
|
83
83
|
|
|
84
|
+
### Customize menu positions
|
|
85
|
+
By default a menu opens below its activator, aligned to its left edge. Set `yPosition` (`below` or `above`) on the activator to control whether it drops down or rises up, and `xPosition` (`after` or `before`) to align the menu's left or right edge with the activator. The menu stays anchored to the activator and scrolls in place when its content is taller than the available space.
|
|
86
|
+
|
|
87
|
+
<daff-docs-example-viewer example="menu-with-position"></daff-docs-example-viewer>
|
|
88
|
+
|
|
84
89
|
## Accessibility
|
|
85
90
|
Menu follows the [Menu and Menubar WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/).
|
|
86
91
|
|
package/menu/src/menu-theme.scss
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
$base-contrast: daff-get-base-color($theme, base-contrast);
|
|
8
8
|
$mode: daff-get-theme-mode($theme);
|
|
9
9
|
|
|
10
|
-
@include light($mode) {
|
|
10
|
+
@include daff-light-mode($mode) {
|
|
11
11
|
.daff-menu {
|
|
12
12
|
background: $base;
|
|
13
|
-
box-shadow: 0 0
|
|
13
|
+
box-shadow: 0 0 1.5rem rgb($black, 0.12);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.daff-menu-item {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
@include dark($mode) {
|
|
32
|
+
@include daff-dark-mode($mode) {
|
|
33
33
|
.daff-menu {
|
|
34
34
|
background: $base;
|
|
35
|
-
box-shadow: 0 0
|
|
35
|
+
box-shadow: 0 0 1.5rem rgb($black, 0.12);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.daff-menu-item {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
$mode: daff-get-theme-mode($theme);
|
|
13
13
|
|
|
14
14
|
.daff-notification {
|
|
15
|
-
@include light($mode) {
|
|
15
|
+
@include daff-light-mode($mode) {
|
|
16
16
|
background: daff-color($neutral, 10);
|
|
17
17
|
border: 1px solid daff-color($neutral, 20);
|
|
18
18
|
color: $base-contrast;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
@include dark($mode) {
|
|
61
|
+
@include daff-dark-mode($mode) {
|
|
62
62
|
background: daff-color($neutral, 90);
|
|
63
63
|
border: 1px solid daff-color($neutral, 80);
|
|
64
64
|
color: $base-contrast;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@daffodil/design","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/design"]}}},"version":"0.
|
|
1
|
+
{"name":"@daffodil/design","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/design"]}}},"version":"0.94.0","author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","description":"An Angular component library built to support ecommerce applications with accessible UI components and theming. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"peerDependencies":{"@angular/animations":"^21","@angular/common":"^21","@angular/core":"^21","@angular/forms":"^21","@angular/cdk":"^21","@daffodil/core":"0.94.0","@fortawesome/angular-fontawesome":"^4.0.0","@fortawesome/fontawesome-svg-core":"^7.1.0","@fortawesome/free-solid-svg-icons":"^7.1.0","@fortawesome/free-brands-svg-icons":"^7.1.0","@fortawesome/free-regular-svg-icons":"^7.1.0","modern-normalize":"^3.0.1","rxjs":"^7.0.0"},"optionalDependencies":{"@faker-js/faker":"^10.3.0"},"exports":{"./scss/global":{"sass":"./scss/global.scss"},"./scss/theme/default":{"sass":"./scss/theming/default/_index.scss"},"./scss/theme":{"sass":"./scss/theme.scss"},"./scss/utilities":{"sass":"./scss/utilities.scss"},"./scss/typography":{"sass":"./scss/typography/_index.scss"},"./package.json":{"default":"./package.json"},".":{"types":"./types/daffodil-design.d.ts","default":"./fesm2022/daffodil-design.mjs"},"./accordion":{"types":"./types/daffodil-design-accordion.d.ts","default":"./fesm2022/daffodil-design-accordion.mjs"},"./article":{"types":"./types/daffodil-design-article.d.ts","default":"./fesm2022/daffodil-design-article.mjs"},"./badge":{"types":"./types/daffodil-design-badge.d.ts","default":"./fesm2022/daffodil-design-badge.mjs"},"./beacon":{"types":"./types/daffodil-design-beacon.d.ts","default":"./fesm2022/daffodil-design-beacon.mjs"},"./breadcrumb":{"types":"./types/daffodil-design-breadcrumb.d.ts","default":"./fesm2022/daffodil-design-breadcrumb.mjs"},"./button":{"types":"./types/daffodil-design-button.d.ts","default":"./fesm2022/daffodil-design-button.mjs"},"./callout":{"types":"./types/daffodil-design-callout.d.ts","default":"./fesm2022/daffodil-design-callout.mjs"},"./card":{"types":"./types/daffodil-design-card.d.ts","default":"./fesm2022/daffodil-design-card.mjs"},"./checkbox":{"types":"./types/daffodil-design-checkbox.d.ts","default":"./fesm2022/daffodil-design-checkbox.mjs"},"./container":{"types":"./types/daffodil-design-container.d.ts","default":"./fesm2022/daffodil-design-container.mjs"},"./form":{"types":"./types/daffodil-design-form.d.ts","default":"./fesm2022/daffodil-design-form.mjs"},"./form-field":{"types":"./types/daffodil-design-form-field.d.ts","default":"./fesm2022/daffodil-design-form-field.mjs"},"./hero":{"types":"./types/daffodil-design-hero.d.ts","default":"./fesm2022/daffodil-design-hero.mjs"},"./image":{"types":"./types/daffodil-design-image.d.ts","default":"./fesm2022/daffodil-design-image.mjs"},"./input":{"types":"./types/daffodil-design-input.d.ts","default":"./fesm2022/daffodil-design-input.mjs"},"./link-set":{"types":"./types/daffodil-design-link-set.d.ts","default":"./fesm2022/daffodil-design-link-set.mjs"},"./list":{"types":"./types/daffodil-design-list.d.ts","default":"./fesm2022/daffodil-design-list.mjs"},"./media-gallery":{"types":"./types/daffodil-design-media-gallery.d.ts","default":"./fesm2022/daffodil-design-media-gallery.mjs"},"./menu":{"types":"./types/daffodil-design-menu.d.ts","default":"./fesm2022/daffodil-design-menu.mjs"},"./modal":{"types":"./types/daffodil-design-modal.d.ts","default":"./fesm2022/daffodil-design-modal.mjs"},"./native-select":{"types":"./types/daffodil-design-native-select.d.ts","default":"./fesm2022/daffodil-design-native-select.mjs"},"./navbar":{"types":"./types/daffodil-design-navbar.d.ts","default":"./fesm2022/daffodil-design-navbar.mjs"},"./notification":{"types":"./types/daffodil-design-notification.d.ts","default":"./fesm2022/daffodil-design-notification.mjs"},"./paginator":{"types":"./types/daffodil-design-paginator.d.ts","default":"./fesm2022/daffodil-design-paginator.mjs"},"./progress-bar":{"types":"./types/daffodil-design-progress-bar.d.ts","default":"./fesm2022/daffodil-design-progress-bar.mjs"},"./quantity-field":{"types":"./types/daffodil-design-quantity-field.d.ts","default":"./fesm2022/daffodil-design-quantity-field.mjs"},"./radio":{"types":"./types/daffodil-design-radio.d.ts","default":"./fesm2022/daffodil-design-radio.mjs"},"./select":{"types":"./types/daffodil-design-select.d.ts","default":"./fesm2022/daffodil-design-select.mjs"},"./sidebar":{"types":"./types/daffodil-design-sidebar.d.ts","default":"./fesm2022/daffodil-design-sidebar.mjs"},"./spinner":{"types":"./types/daffodil-design-spinner.d.ts","default":"./fesm2022/daffodil-design-spinner.mjs"},"./switch":{"types":"./types/daffodil-design-switch.d.ts","default":"./fesm2022/daffodil-design-switch.mjs"},"./tabs":{"types":"./types/daffodil-design-tabs.d.ts","default":"./fesm2022/daffodil-design-tabs.mjs"},"./tag":{"types":"./types/daffodil-design-tag.d.ts","default":"./fesm2022/daffodil-design-tag.mjs"},"./testing":{"types":"./types/daffodil-design-testing.d.ts","default":"./fesm2022/daffodil-design-testing.mjs"},"./text-snippet":{"types":"./types/daffodil-design-text-snippet.d.ts","default":"./fesm2022/daffodil-design-text-snippet.mjs"},"./textarea":{"types":"./types/daffodil-design-textarea.d.ts","default":"./fesm2022/daffodil-design-textarea.mjs"},"./toast":{"types":"./types/daffodil-design-toast.d.ts","default":"./fesm2022/daffodil-design-toast.mjs"},"./tree":{"types":"./types/daffodil-design-tree.d.ts","default":"./fesm2022/daffodil-design-tree.mjs"},"./youtube-player":{"types":"./types/daffodil-design-youtube-player.d.ts","default":"./fesm2022/daffodil-design-youtube-player.mjs"}},"module":"fesm2022/daffodil-design.mjs","typings":"types/daffodil-design.d.ts","sideEffects":false,"type":"module","dependencies":{"tslib":"^2.6.2"}}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
color: $base-contrast;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@include light($mode) {
|
|
17
|
+
@include daff-light-mode($mode) {
|
|
18
18
|
&__page-link {
|
|
19
19
|
@media (hover: hover) {
|
|
20
20
|
&:hover {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
@include dark($mode) {
|
|
35
|
+
@include daff-dark-mode($mode) {
|
|
36
36
|
&__page-link {
|
|
37
37
|
@media (hover: hover) {
|
|
38
38
|
&:hover {
|
package/progress-bar/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Use an indeterminate progress bar when the percentage of completion is unknown o
|
|
|
61
61
|
### Colors
|
|
62
62
|
The default color is `primary`. Use the `color` property to change a progress bar's color.
|
|
63
63
|
|
|
64
|
-
> `theme`, `
|
|
64
|
+
> `theme`, `light`, and `dark` should be used with caution to ensure that there is sufficient contrast.
|
|
65
65
|
|
|
66
66
|
<daff-docs-example-viewer example="progress-bar-themes"></daff-docs-example-viewer>
|
|
67
67
|
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
color: daff-text-contrast($base);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@include light($mode) {
|
|
21
|
+
@include daff-light-mode($mode) {
|
|
22
22
|
#{$root}__track {
|
|
23
23
|
background: daff-color($neutral, 30);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@include dark($mode) {
|
|
27
|
+
@include daff-dark-mode($mode) {
|
|
28
28
|
#{$root}__track {
|
|
29
29
|
background: daff-color($neutral, 80);
|
|
30
30
|
}
|
package/scss/global.scss
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
$mode: daff-get-theme-mode($theme);
|
|
8
8
|
|
|
9
9
|
.daff-skeleton {
|
|
10
|
-
@include light($mode) {
|
|
10
|
+
@include daff-light-mode($mode) {
|
|
11
11
|
&::before,
|
|
12
12
|
::before {
|
|
13
13
|
background: daff-color($neutral, 20);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@include dark($mode) {
|
|
17
|
+
@include daff-dark-mode($mode) {
|
|
18
18
|
&::before,
|
|
19
19
|
::before {
|
|
20
20
|
background: daff-color($neutral, 90);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file only exists for builds inside the Daffodil monorepo. Consumers of
|
|
2
|
+
// the published package never load it.
|
|
3
|
+
//
|
|
4
|
+
// Externally, `@daffodil/design/scss/theme/default` resolves through the `sass`
|
|
5
|
+
// condition of the `exports` map in package.json, which points straight at
|
|
6
|
+
// `scss/theming/default/_index.scss`.
|
|
7
|
+
//
|
|
8
|
+
// Inside the monorepo there is no `node_modules/@daffodil/design`, so the
|
|
9
|
+
// specifier instead resolves via the root tsconfig `paths` mapping
|
|
10
|
+
// (`@daffodil/*` -> `dist/*`). That mapping bypasses `exports` entirely, leaving
|
|
11
|
+
// Angular's Sass importer to fall back to joining the remaining specifier
|
|
12
|
+
// segments onto the package root verbatim. `scss/theme/default` therefore has to
|
|
13
|
+
// exist as a real file for the monorepo apps to resolve it.
|
|
14
|
+
|
|
15
|
+
@forward '../theming/default';
|
package/scss/theme.scss
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
// @daffodil/design components
|
|
20
20
|
@use './theming/theme-css-variables' as variables;
|
|
21
|
+
@use '../beacon/src/beacon-theme' as beacon;
|
|
21
22
|
@use '../breadcrumb/src/breadcrumb-theme' as breadcrumb;
|
|
23
|
+
@use '../badge/src/badge-theme' as badge;
|
|
22
24
|
@use '../button/src/button/basic/button-theme' as button;
|
|
23
25
|
@use '../button/src/button/flat/flat-theme' as flat-button;
|
|
24
26
|
@use '../button/src/button/icon/icon-theme' as icon-button;
|
|
@@ -31,7 +33,6 @@
|
|
|
31
33
|
@use '../form/src/hint/hint-theme' as hint;
|
|
32
34
|
@use '../form-field/src/form-field-theme' as form-field;
|
|
33
35
|
@use '../native-select/src/native-select-theme' as native-select;
|
|
34
|
-
@use '../loading-icon/src/loading-icon-theme' as loading-icon;
|
|
35
36
|
@use '../accordion/src/accordion-theme' as accordion;
|
|
36
37
|
@use '../callout/src/callout-theme' as callout;
|
|
37
38
|
@use '../card/src/card-base-theme' as card-base;
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
|
|
74
75
|
@include accordion.daff-accordion-theme($theme);
|
|
75
76
|
@include article.daff-article-theme($theme);
|
|
77
|
+
@include badge.daff-badge-theme($theme);
|
|
76
78
|
@include tag.daff-tag-theme($theme);
|
|
77
79
|
@include breadcrumb.daff-breadcrumb-theme($theme);
|
|
78
80
|
|
|
@@ -83,7 +85,6 @@
|
|
|
83
85
|
@include stroked-button.daff-stroked-button-theme($theme);
|
|
84
86
|
@include underline-button.daff-underline-button-theme($theme);
|
|
85
87
|
|
|
86
|
-
@include callout.daff-callout-theme($theme);
|
|
87
88
|
@include card-base.daff-card-base-theme($theme);
|
|
88
89
|
@include stroked-card.daff-stroked-card-theme($theme);
|
|
89
90
|
|
|
@@ -93,25 +94,20 @@
|
|
|
93
94
|
@include select.daff-select-theme($theme);
|
|
94
95
|
@include native-select.daff-native-select-theme($theme);
|
|
95
96
|
|
|
97
|
+
@include beacon.daff-beacon-theme($theme);
|
|
96
98
|
@include spinner.daff-spinner-theme($theme);
|
|
97
99
|
@include progress-bar.daff-progress-bar-theme($theme);
|
|
98
100
|
|
|
99
|
-
@include accordion.daff-accordion-theme($theme);
|
|
100
|
-
@include article.daff-article-theme($theme);
|
|
101
101
|
@include callout.daff-callout-theme($theme);
|
|
102
102
|
@include hero.daff-hero-theme($theme);
|
|
103
103
|
@include list.daff-list-theme($theme);
|
|
104
104
|
|
|
105
|
-
// deprecated
|
|
106
|
-
@include loading-icon.daff-loading-icon-theme($theme);
|
|
107
|
-
|
|
108
105
|
@include media-gallery.daff-media-gallery-theme($theme);
|
|
109
106
|
@include menu.daff-menu-theme($theme);
|
|
110
107
|
@include modal.daff-modal-theme($theme);
|
|
111
108
|
@include navbar.daff-navbar-theme($theme);
|
|
112
109
|
@include notification.daff-notification-theme($theme);
|
|
113
110
|
@include paginator.daff-paginator-theme($theme);
|
|
114
|
-
@include progress-bar.daff-progress-bar-theme($theme);
|
|
115
111
|
@include sidebar.daff-sidebar-theme($theme);
|
|
116
112
|
@include switch.daff-switch-theme($theme);
|
|
117
113
|
@include tabs.daff-tabs-theme($theme);
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
/// as the palette’s default color. The palette can then be used
|
|
8
8
|
/// to configure themes by setting them as primary, secondary, or tertiary colors.
|
|
9
9
|
///
|
|
10
|
+
/// The hue is recorded alongside the color as `default-hue`, so that colors can
|
|
11
|
+
/// be selected relative to the default with `daff-color-shift`.
|
|
12
|
+
///
|
|
10
13
|
/// @group Theming
|
|
11
14
|
///
|
|
12
15
|
/// @param {Map} $color-palette — A color palette map (e.g., `$daff-blue`, `$daff-purple`).
|
|
@@ -21,7 +24,8 @@
|
|
|
21
24
|
@return map.merge(
|
|
22
25
|
$color-palette,
|
|
23
26
|
(
|
|
24
|
-
'default': get-color.daff-color($color-palette, $hue)
|
|
27
|
+
'default': get-color.daff-color($color-palette, $hue),
|
|
28
|
+
'default-hue': $hue
|
|
25
29
|
)
|
|
26
30
|
);
|
|
27
31
|
}
|
package/scss/theming/_index.scss
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
@forward 'color-palettes';
|
|
2
2
|
@forward 'get-color';
|
|
3
|
+
@forward 'color-shift';
|
|
3
4
|
@forward 'contrast';
|
|
4
|
-
@forward 'illuminate/illuminate';
|
|
5
5
|
@forward 'configure-palette';
|
|
6
|
-
@forward 'create-theme
|
|
6
|
+
@forward 'create-theme';
|
|
7
7
|
@forward 'light-dark';
|
|
8
|
-
@forward 'daff-theme';
|
|
9
8
|
@forward 'get-palette';
|
|
10
9
|
@forward 'get-base-color';
|
|
11
10
|
@forward 'get-theme-mode';
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
/// @mixin custom-content-theme($theme) {
|
|
12
12
|
/// $mode: daff-theme.daff-get-theme-mode($theme);
|
|
13
13
|
///
|
|
14
|
-
/// @include daff-theme.light($mode) {
|
|
14
|
+
/// @include daff-theme.daff-light-mode($mode) {
|
|
15
15
|
/// color: blue;
|
|
16
16
|
///
|
|
17
|
-
///
|
|
18
|
-
///
|
|
19
|
-
///
|
|
20
|
-
///
|
|
17
|
+
/// .class {
|
|
18
|
+
/// background: white;
|
|
19
|
+
/// }
|
|
20
|
+
/// }
|
|
21
21
|
/// }
|
|
22
22
|
///
|
|
23
|
-
@mixin light($mode) {
|
|
23
|
+
@mixin daff-light-mode($mode) {
|
|
24
24
|
@if $mode == 'light' {
|
|
25
25
|
@content;
|
|
26
26
|
}
|
|
@@ -39,16 +39,41 @@
|
|
|
39
39
|
/// @mixin custom-content-theme($theme) {
|
|
40
40
|
/// $mode: daff-theme.daff-get-theme-mode($theme);
|
|
41
41
|
///
|
|
42
|
-
/// @include daff-theme.dark($mode) {
|
|
42
|
+
/// @include daff-theme.daff-dark-mode($mode) {
|
|
43
43
|
/// color: white;
|
|
44
44
|
///
|
|
45
|
-
///
|
|
46
|
-
///
|
|
47
|
-
///
|
|
48
|
-
///
|
|
45
|
+
/// .class {
|
|
46
|
+
/// background: blue;
|
|
47
|
+
/// }
|
|
48
|
+
/// }
|
|
49
49
|
/// }
|
|
50
|
-
|
|
50
|
+
///
|
|
51
|
+
@mixin daff-dark-mode($mode) {
|
|
51
52
|
@if $mode == 'dark' {
|
|
52
53
|
@content;
|
|
53
54
|
}
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
/// @deprecated Use `daff-light-mode` instead.
|
|
58
|
+
///
|
|
59
|
+
/// @group Theming
|
|
60
|
+
///
|
|
61
|
+
/// @alias daff-light-mode
|
|
62
|
+
///
|
|
63
|
+
@mixin light($mode) {
|
|
64
|
+
@include daff-light-mode($mode) {
|
|
65
|
+
@content;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// @deprecated Use `daff-dark-mode` instead.
|
|
70
|
+
///
|
|
71
|
+
/// @group Theming
|
|
72
|
+
///
|
|
73
|
+
/// @alias daff-dark-mode
|
|
74
|
+
///
|
|
75
|
+
@mixin dark($mode) {
|
|
76
|
+
@include daff-dark-mode($mode) {
|
|
77
|
+
@content;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// stylelint-disable @stylistic/max-line-length
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '../get-color';
|
|
4
|
+
@use '../../core/error/error-to-string';
|
|
5
|
+
|
|
6
|
+
/// @access private
|
|
7
|
+
/// The distance between two adjacent hues in a color palette.
|
|
8
|
+
$hue-step: 10;
|
|
9
|
+
|
|
10
|
+
/// Retrieves a color relative to a palette's default hue.
|
|
11
|
+
///
|
|
12
|
+
/// Positive steps move toward the darker end of the palette, negative steps
|
|
13
|
+
/// toward the lighter end. Use this instead of a hardcoded hue when a color is
|
|
14
|
+
/// meant to sit a fixed distance from a palette's default, such as the hover
|
|
15
|
+
/// and active states of a component.
|
|
16
|
+
///
|
|
17
|
+
/// The palette must be configured with `daff-configure-palette`, which records
|
|
18
|
+
/// the hue that the default was set from.
|
|
19
|
+
///
|
|
20
|
+
/// @group Theming
|
|
21
|
+
///
|
|
22
|
+
/// @param {Map} $palette — The palette to retrieve a color from.
|
|
23
|
+
/// @param {Number} $steps [0] — How many hue steps to shift from the default.
|
|
24
|
+
///
|
|
25
|
+
/// @return {Color} The color `$steps` away from the palette's default hue.
|
|
26
|
+
///
|
|
27
|
+
/// @throws Will throw an error if `$palette` was not configured with
|
|
28
|
+
/// `daff-configure-palette`, or if the shifted hue does not exist in `$palette`.
|
|
29
|
+
///
|
|
30
|
+
/// @example scss
|
|
31
|
+
/// // $primary configured at hue 60
|
|
32
|
+
/// .custom-content {
|
|
33
|
+
/// background-color: daff-color($primary); // hue 60
|
|
34
|
+
/// border-color: daff-color-shift($primary, 1); // hue 70
|
|
35
|
+
/// color: daff-color-shift($primary, -1); // hue 50
|
|
36
|
+
/// }
|
|
37
|
+
///
|
|
38
|
+
@function daff-color-shift($palette, $steps: 0) {
|
|
39
|
+
$default-hue: map.get($palette, 'default-hue');
|
|
40
|
+
|
|
41
|
+
@if ($default-hue == null) {
|
|
42
|
+
@return error-to-string.error-to-string(
|
|
43
|
+
'Palette has no `default-hue`. Configure it with `daff-configure-palette`.'
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$hue: $default-hue + ($steps * $hue-step);
|
|
48
|
+
|
|
49
|
+
@if (not map.has-key($palette, $hue)) {
|
|
50
|
+
@return error-to-string.error-to-string(
|
|
51
|
+
'Cannot shift `#{$steps}` step(s) from hue `#{$default-hue}`. `#{$hue}` does not exist in palette.'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@return get-color.daff-color($palette, $hue);
|
|
56
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
@use 'true' as *;
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '../color-shift' as *;
|
|
4
|
+
@use '../color-palettes' as palette;
|
|
5
|
+
@use '../configure-palette' as *;
|
|
6
|
+
@use '../get-color' as *;
|
|
7
|
+
@use '../../core/error/error-to-string';
|
|
8
|
+
|
|
9
|
+
@include describe('daff-color-shift') {
|
|
10
|
+
$default: daff-configure-palette(palette.$daff-blue);
|
|
11
|
+
$light: daff-configure-palette(palette.$daff-blue, 30);
|
|
12
|
+
$dark: daff-configure-palette(palette.$daff-blue, 50);
|
|
13
|
+
$lightest: daff-configure-palette(palette.$daff-blue, 10);
|
|
14
|
+
$darkest: daff-configure-palette(palette.$daff-blue, 100);
|
|
15
|
+
|
|
16
|
+
@include it('returns the default color when there is no shift') {
|
|
17
|
+
@include assert-equal(daff-color-shift($default), daff-color($default));
|
|
18
|
+
@include assert-equal(daff-color-shift($default, 0), daff-color($default, 60));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@include it('returns a darker color for positive steps') {
|
|
22
|
+
@include assert-equal(daff-color-shift($default, 1), daff-color($default, 70));
|
|
23
|
+
@include assert-equal(daff-color-shift($default, 2), daff-color($default, 80));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@include it('returns a lighter color for negative steps') {
|
|
27
|
+
@include assert-equal(daff-color-shift($dark, -1), daff-color($dark, 40));
|
|
28
|
+
@include assert-equal(daff-color-shift($dark, -2), daff-color($dark, 30));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include it('shifts relative to the hue the palette was configured with') {
|
|
32
|
+
@include assert-equal(daff-color-shift($light, 1), daff-color($light, 40));
|
|
33
|
+
@include assert-equal(daff-color-shift($light, 2), daff-color($light, 50));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include it('shifts across the whole palette') {
|
|
37
|
+
@include assert-equal(daff-color-shift($lightest, 9), daff-color($lightest, 100));
|
|
38
|
+
@include assert-equal(daff-color-shift($darkest, -9), daff-color($darkest, 10));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@include it('shifts relative to the configured hue, not a duplicate color earlier in the palette') {
|
|
42
|
+
$duplicate: daff-configure-palette((10: #ffffff, 20: #cccccc, 30: #cccccc, 40: #999999), 30);
|
|
43
|
+
|
|
44
|
+
@include assert-equal(daff-color-shift($duplicate, 1), #999999);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include error-to-string.set-use-string(true);
|
|
48
|
+
|
|
49
|
+
@include it('errors when the shift falls past the dark end of the palette') {
|
|
50
|
+
@include assert-equal(
|
|
51
|
+
daff-color-shift($darkest, 1),
|
|
52
|
+
'Cannot shift `1` step(s) from hue `100`. `110` does not exist in palette.'
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@include it('errors when the shift falls past the light end of the palette') {
|
|
57
|
+
@include assert-equal(
|
|
58
|
+
daff-color-shift($lightest, -1),
|
|
59
|
+
'Cannot shift `-1` step(s) from hue `10`. `0` does not exist in palette.'
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include it('errors when the shift lands between hues') {
|
|
64
|
+
@include assert-equal(
|
|
65
|
+
daff-color-shift($default, 0.5),
|
|
66
|
+
'Cannot shift `0.5` step(s) from hue `60`. `65` does not exist in palette.'
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include it('errors when the palette was not configured with daff-configure-palette') {
|
|
71
|
+
@include assert-equal(
|
|
72
|
+
daff-color-shift(palette.$daff-blue, 1),
|
|
73
|
+
'Palette has no `default-hue`. Configure it with `daff-configure-palette`.'
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@include it('errors when the palette has a default color but no default hue') {
|
|
78
|
+
$manual: map.merge(palette.$daff-blue, ('default': daff-color(palette.$daff-blue, 60)));
|
|
79
|
+
|
|
80
|
+
@include assert-equal(
|
|
81
|
+
daff-color-shift($manual, 1),
|
|
82
|
+
'Palette has no `default-hue`. Configure it with `daff-configure-palette`.'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@include error-to-string.set-use-string(false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@include describe('daff-configure-palette') {
|
|
90
|
+
@include it('records the hue the default was configured from') {
|
|
91
|
+
@include assert-equal(
|
|
92
|
+
map.get(daff-configure-palette(palette.$daff-blue), 'default-hue'),
|
|
93
|
+
60
|
|
94
|
+
);
|
|
95
|
+
@include assert-equal(
|
|
96
|
+
map.get(daff-configure-palette(palette.$daff-blue, 30), 'default-hue'),
|
|
97
|
+
30
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include it('replaces the recorded hue when a palette is reconfigured') {
|
|
102
|
+
$reconfigured: daff-configure-palette(daff-configure-palette(palette.$daff-blue, 30), 80);
|
|
103
|
+
|
|
104
|
+
@include assert-equal(map.get($reconfigured, 'default-hue'), 80);
|
|
105
|
+
@include assert-equal(map.get($reconfigured, 'default'), daff-color(palette.$daff-blue, 80));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'color-shift';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@use 'configure-palette';
|
|
2
|
-
@use '
|
|
3
|
-
@use 'color-palettes' as palette;
|
|
4
|
-
@use '
|
|
1
|
+
@use '../configure-palette';
|
|
2
|
+
@use '../create-theme/create-theme';
|
|
3
|
+
@use '../color-palettes' as palette;
|
|
4
|
+
@use '../../core';
|
|
5
5
|
|
|
6
6
|
$primary: configure-palette.daff-configure-palette(palette.$daff-blue, 60);
|
|
7
7
|
$secondary: configure-palette.daff-configure-palette(palette.$daff-purple, 60);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@forward 'daff-theme';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.daff-select {
|
|
15
15
|
$root: '.daff-select';
|
|
16
16
|
|
|
17
|
-
@include light($mode) {
|
|
17
|
+
@include daff-light-mode($mode) {
|
|
18
18
|
&.disabled {
|
|
19
19
|
#{$root}__field {
|
|
20
20
|
color: daff-color($neutral, 50);
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
@include dark($mode) {
|
|
47
|
+
@include daff-dark-mode($mode) {
|
|
48
48
|
&.disabled {
|
|
49
49
|
#{$root}__field {
|
|
50
50
|
color: daff-color($neutral, 70);
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
@media (hover: hover) {
|
|
66
|
-
|
|
66
|
+
&:hover {
|
|
67
|
+
background-color: daff-color($neutral, 90);
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
&.highlighted {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
@include light($mode) {
|
|
24
|
+
@include daff-light-mode($mode) {
|
|
25
25
|
&__toggle {
|
|
26
26
|
background-color: daff-color($neutral, 30);
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@include dark($mode) {
|
|
40
|
+
@include daff-dark-mode($mode) {
|
|
41
41
|
&__toggle {
|
|
42
42
|
background-color: daff-color($neutral, 70);
|
|
43
43
|
|
package/tabs/src/tabs-theme.scss
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
$base-contrast: daff-get-base-color($theme, base-contrast);
|
|
7
7
|
$mode: daff-get-theme-mode($theme);
|
|
8
8
|
|
|
9
|
-
@include light($mode) {
|
|
9
|
+
@include daff-light-mode($mode) {
|
|
10
10
|
.daff-tabs {
|
|
11
11
|
&__tab-list {
|
|
12
12
|
&::after {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
@include dark($mode) {
|
|
28
|
+
@include daff-dark-mode($mode) {
|
|
29
29
|
.daff-tabs {
|
|
30
30
|
&__tab-list {
|
|
31
31
|
&::after {
|