@castlabs/ui 7.17.0 → 7.19.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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/select-disabled.svg +1 -1
  3. package/dist/castlabs-ui-editor.css +1 -1
  4. package/dist/castlabs-ui-editor.umd.js +1 -1
  5. package/dist/castlabs-ui.common.js +3 -3
  6. package/dist/castlabs-ui.common.js.map +1 -1
  7. package/dist/castlabs-ui.core.js +97 -5
  8. package/dist/castlabs-ui.css +1 -1
  9. package/dist/castlabs-ui.module.d.ts +4 -0
  10. package/dist/castlabs-ui.module.js +97 -5
  11. package/dist/castlabs-ui.umd.js +4 -4
  12. package/dist/castlabs-ui.umd.js.map +1 -1
  13. package/dist/{select-disabled.c5e07724.svg → select-disabled.1065ea4c.svg} +1 -1
  14. package/dist/select.dark.efd5244b.svg +1 -0
  15. package/package.json +9 -9
  16. package/src/components/ClBadge/style.variables.scss +1 -1
  17. package/src/components/ClButton/style.scss +18 -0
  18. package/src/components/ClDropdown/style.scss +1 -1
  19. package/src/components/ClDropzone/style.scss +1 -1
  20. package/src/components/ClHighlight/style.scss +2 -4
  21. package/src/components/ClList/style.variables.scss +5 -0
  22. package/src/components/ClPagination/style.scss +2 -3
  23. package/src/components/ClToggle/style.scss +1 -1
  24. package/src/components/ClWizard/style.scss +4 -4
  25. package/src/components/form/ClField/style.scss +1 -1
  26. package/src/components/form/ClFieldCheck/style.scss +23 -8
  27. package/src/components/form/ClFieldGroup/style.scss +1 -1
  28. package/src/components/form/ClFieldInput/style.scss +3 -2
  29. package/src/components/modal/ClModal/style.scss +3 -1
  30. package/src/components/navigation/ClNavSide/ClNavDrawer/style.scss +3 -5
  31. package/src/components/navigation/ClNavSide/ClNavItemDarkMode/style.scss +44 -0
  32. package/src/components/navigation/ClNavTop/style.scss +5 -1
  33. package/src/components/widget/ClPage/style.scss +1 -1
  34. package/src/styles/_global.scss +1 -0
  35. package/src/styles/abstracts/button.scss +10 -1
  36. package/src/styles/abstracts/color.scss +51 -15
  37. package/src/styles/abstracts/typography.scss +3 -1
  38. package/src/styles/layout/color.scss +0 -38
  39. package/src/styles/layout/grid.scss +4 -3
  40. package/src/styles/layout/meta.scss +1 -1
  41. package/src/styles/layout/typography.scss +1 -1
  42. package/src/styles/themes/dark.scss +160 -0
  43. package/src/styles/themes/dark.variables.scss +33 -0
  44. package/src/styles/ui.scss +6 -0
  45. package/types/castlabs-ui.module.d.ts +4 -0
  46. package/types/index.d.ts +5 -0
@@ -82,44 +82,6 @@
82
82
 
83
83
  // -----------------------------------------------------------------------------
84
84
 
85
- // primary/secondary/tertiary button colors
86
-
87
- .btn {
88
- &.cl-color-primary {
89
- @extend %cl-color-sea;
90
- }
91
-
92
- &.cl-color-secondary {
93
- @extend %cl-color-night;
94
- }
95
-
96
- &.cl-color-tertiary {
97
- @extend %cl-color-transparent;
98
- }
99
- }
100
-
101
- .cl-color-red,
102
- .cl-color-sky,
103
- .cl-color-ash,
104
- .cl-color-petrol,
105
- .cl-color-berry,
106
- .cl-color-black,
107
- .cl-color-text,
108
- .cl-color-dark,
109
- .cl-color-night {
110
- // on dark backgrounds secondary buttons need to be light
111
- .btn.cl-color-secondary {
112
- @extend %cl-color-eggshell;
113
- }
114
-
115
- // on dark backgrounds secondary buttons need to be outlined
116
- .btn.cl-color-tertiary {
117
- @extend %cl-color-transparent;
118
- }
119
- }
120
-
121
- // -----------------------------------------------------------------------------
122
-
123
85
  a,
124
86
  span,
125
87
  div {
@@ -84,7 +84,7 @@ section {
84
84
  }
85
85
 
86
86
  main {
87
- background-color: $color-ci-white;
87
+ background-color: var(--cl-color-background);
88
88
  display: table-row;
89
89
  height: 100%;
90
90
 
@@ -107,12 +107,13 @@ body,
107
107
  .cl-app {
108
108
  @extend %cl-p-medium;
109
109
 
110
- background-color: $color-ci-white;
111
- color: $color-text;
110
+ background-color: var(--cl-color-background);
111
+ color: var(--cl-color-text);
112
112
  height: 100%;
113
113
  }
114
114
 
115
115
  .cl-main {
116
+ background-color: var(--cl-color-background);
116
117
  display: table;
117
118
  height: 100%;
118
119
  table-layout: fixed;
@@ -1,3 +1,3 @@
1
1
  :root {
2
- #{'--cl-version'}: 'v7.17.0';
2
+ #{'--cl-version'}: 'v7.19.0';
3
3
  }
@@ -293,5 +293,5 @@ hr {
293
293
 
294
294
  ::selection {
295
295
  background: $color-ci-berry;
296
- color: $color-ci-white;
296
+ color: $color-ci-eggshell;
297
297
  }
@@ -0,0 +1,160 @@
1
+ $cl-url-prefix: '' !default;
2
+ $cl-url-postfix: '' !default;
3
+
4
+ @use '../global' as *;
5
+
6
+ @include cl-if-dark-mode {
7
+ @extend %cl-mode-dark;
8
+
9
+ .cl-color-haze,
10
+ .cl-section-alternate,
11
+ .card.cl-color-haze {
12
+ #{'--cl-color-icon'}: $color-ci-steel;
13
+ #{'--cl-color-code'}: $color-ci-sky;
14
+ #{'--cl-color-input-background'}: $color-ci-night;
15
+ #{'--cl-color-input-border'}: $color-ci-clay;
16
+ #{'--cl-color-text'}: $color-ci-eggshell;
17
+ #{'--cl-color-text-inverted'}: $color-ci-night;
18
+
19
+ textarea[disabled],
20
+ textarea.disabled,
21
+ input[disabled],
22
+ input.disabled,
23
+ select[disabled],
24
+ select.disabled {
25
+ &:disabled,
26
+ &.disabled {
27
+ #{'--cl-color-input-background'}: $color-ci-haze-dark;
28
+ }
29
+ }
30
+ }
31
+
32
+ .cl-nav-top,
33
+ .cl-nav-account,
34
+ .cl-nav-account::after {
35
+ // add haze line below nav
36
+ box-shadow: 0 -1px 0 $color-ci-night-2 inset;
37
+ }
38
+
39
+ .cl-badge {
40
+ @extend %cl-mode-dark;
41
+ @include cl-colors-ci;
42
+ @include cl-colors-admin;
43
+
44
+ #{'--cl-color-background'}: $color-ci-steel;
45
+ #{'--cl-color-border'}: $color-ci-steel;
46
+ }
47
+
48
+ .card {
49
+ @extend %cl-mode-dark;
50
+ @include cl-colors-ci;
51
+ @include cl-colors-admin;
52
+
53
+ #{'--cl-color-background'}: $color-ci-night;
54
+
55
+ &.cl-color-faded {
56
+ @extend %cl-color-faded;
57
+ }
58
+
59
+ &.cl-color-haze {
60
+ @extend %cl-color-haze;
61
+
62
+ &:not([class*='cl-color-text-']) {
63
+ #{'--cl-color-text'}: $color-ci-eggshell;
64
+ }
65
+ }
66
+
67
+ &.cl-color-red-outline {
68
+ @extend %cl-color-red-outline;
69
+
70
+ &:not([class*='cl-color-text-']) {
71
+ #{'--cl-color-text'}: $color-ci-eggshell;
72
+ }
73
+ }
74
+ }
75
+
76
+ .cl-form [type='range'] {
77
+ background: $color-ci-steel;
78
+ }
79
+
80
+ .cl-form [type='checkbox'],
81
+ .form-check-input[type='checkbox'] {
82
+ #{--cl-color-input-border}: var(--cl-color-text);
83
+ background-color: $color-ci-night !important;
84
+
85
+ &:checked {
86
+ background-color: $color-ci-night !important;
87
+ border: $brand-line-width solid $color-ci-eggshell !important;
88
+ }
89
+
90
+ &:disabled,
91
+ &.disabled {
92
+ background-color: $color-ci-night-2 !important;
93
+ border-color: $color-disabled !important;
94
+ }
95
+
96
+ &:indeterminate {
97
+ background-color: $color-ci-eggshell !important;
98
+ background-image: none;
99
+ border: $brand-line-width solid $color-ci-eggshell !important;
100
+ box-shadow: 0 0 0 px(2) $color-ci-night inset !important;
101
+
102
+ &:disabled,
103
+ &.disabled {
104
+ background-color: $color-disabled !important;
105
+ border-color: $color-disabled !important;
106
+ box-shadow: 0 0 0 px(2) $color-ci-night-2 inset !important;
107
+ }
108
+ }
109
+ }
110
+
111
+ .cl-form [type='radio'],
112
+ .form-check-input[type='radio'] {
113
+ background-color: $color-ci-night !important;
114
+
115
+ &:checked {
116
+ background-color: $color-ci-eggshell !important;
117
+ border: $brand-line-width solid $color-ci-eggshell !important;
118
+
119
+ &:disabled,
120
+ &.disabled {
121
+ background-color: $color-disabled !important;
122
+ border-color: $color-disabled !important;
123
+ }
124
+ }
125
+
126
+ &:disabled,
127
+ &.disabled {
128
+ background-color: $color-ci-night-2 !important;
129
+ border-color: $color-disabled !important;
130
+ }
131
+ }
132
+
133
+ .form-select {
134
+ background-image: url('#{$cl-url-prefix}select.dark.svg#{$cl-url-postfix}'), none, none;
135
+
136
+ &:disabled,
137
+ &.disabled {
138
+ background-image:
139
+ url('#{$cl-url-prefix}select-disabled.dark.svg#{$cl-url-postfix}'), none, none;
140
+ }
141
+ }
142
+
143
+ .modal {
144
+ @extend %cl-mode-dark;
145
+ }
146
+
147
+ .cl-toggle-checkbox {
148
+ + .cl-badge {
149
+ &:not([class*=' cl-color-']) {
150
+ @extend %cl-color-eggshell;
151
+ }
152
+ }
153
+
154
+ &:disabled + .cl-badge {
155
+ #{'--cl-color-background'}: $color-disabled;
156
+ #{'--cl-color-border'}: $color-disabled;
157
+ #{'--cl-color-text'}: $color-ci-eggshell;
158
+ }
159
+ }
160
+ }
@@ -0,0 +1,33 @@
1
+ @use '../abstracts/color.scss' as *;
2
+
3
+ %cl-mode-dark {
4
+ #{'--cl-color-accent'}: $color-ci-sky;
5
+ #{'--cl-color-active'}: $color-ci-berry;
6
+ #{'--cl-color-background'}: $color-ci-night;
7
+ #{'--cl-color-background-haze'}: $color-ci-haze-dark;
8
+ #{'--cl-color-border'}: $color-ci-eggshell;
9
+ #{'--cl-color-code'}: $color-ci-sky;
10
+ #{'--cl-color-disabled-background'}: $color-disabled;
11
+ #{'--cl-color-disabled-border'}: $color-disabled;
12
+ #{'--cl-color-disabled-text'}: $color-ci-eggshell;
13
+ #{'--cl-color-focus'}: $color-ci-eggshell;
14
+ #{'--cl-color-highlight'}: $color-ci-night-3;
15
+ #{'--cl-color-hover'}: $color-hover;
16
+ #{'--cl-color-icon'}: $color-ci-steel;
17
+ #{'--cl-color-input-background'}: $color-ci-night;
18
+ #{'--cl-color-input-border'}: $color-ci-clay;
19
+ #{'--cl-color-line'}: $color-ci-clay;
20
+ #{'--cl-color-link'}: $color-link;
21
+ #{'--cl-color-text'}: $color-ci-eggshell;
22
+ #{'--cl-color-text-faded'}: $color-ci-steel;
23
+ #{'--cl-color-text-inverted'}: $color-ci-night;
24
+ #{'--cl-opacity-active'}: $color-opacity-active;
25
+ }
26
+
27
+ @mixin cl-if-dark-mode {
28
+ // detect body class and toggle-checkbox
29
+ body:has(#cl-mode-dark:checked),
30
+ .cl-mode-dark {
31
+ @content;
32
+ }
33
+ }
@@ -73,6 +73,7 @@ $castlabs-ui-asset-postfix: '' !default;
73
73
  @use '../components/form/ClForm/style' as *;
74
74
  @use '../components/modal/ClModal/style' as *;
75
75
  @use '../components/navigation/ClNavSide/ClNavDrawer/style' as *;
76
+ @use '../components/navigation/ClNavSide/ClNavItemDarkMode/style' as *;
76
77
  @use '../components/navigation/ClNavSide/ClNavSideMenu/style' as *;
77
78
  @use '../components/navigation/ClNavSide/style' as *;
78
79
  @use '../components/navigation/ClNavTop/style' as *;
@@ -104,6 +105,11 @@ $castlabs-ui-asset-postfix: '' !default;
104
105
  @use '../components/widget/ClCookieBanner/style' as *;
105
106
  @use '../components/widget/ClPage/style' as *;
106
107
 
108
+ @use 'themes/dark' as * with (
109
+ $cl-url-prefix: $castlabs-ui-asset-prefix,
110
+ $cl-url-postfix: $castlabs-ui-asset-postfix
111
+ );
112
+
107
113
  html {
108
114
  font-size: 16px; // root font size
109
115
  }
@@ -73,6 +73,10 @@ declare module '@castlabs/ui/dist/castlabs-ui.module.js' {
73
73
  ): Promise<any>
74
74
  export function clReloadStore (component: any, forced?: any[], optional?: any[], loading?: boolean): Promise<any>
75
75
 
76
+ // theme utils
77
+ export function clThemeSetup (): boolean
78
+ export function clThemeSetDark (dark: boolean): void
79
+
76
80
  // search utils
77
81
  export function clMatch (string: string, expression?: string, caseSensitive?: boolean): boolean
78
82
 
package/types/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export const ClModal: DefineComponent
19
19
  export const ClModalConfirm: DefineComponent
20
20
  export const ClModalForm: DefineComponent
21
21
  export const ClModalOk: DefineComponent
22
+ export const ClNavItemDarkMode: DefineComponent
22
23
  export const ClNavSide: DefineComponent
23
24
  export const ClNavTop: DefineComponent
24
25
  export const ClPage: DefineComponent
@@ -131,6 +132,10 @@ export function clReload (
131
132
  ): Promise<any>
132
133
  export function clReloadStore (component: any, forced?: any[], optional?: any[], loading?: boolean): Promise<any>
133
134
 
135
+ // theme utils
136
+ export function clThemeSetup (): boolean
137
+ export function clThemeSetDark (dark: boolean): void
138
+
134
139
  // --- utils/search ------------------------------------------------------------
135
140
 
136
141
  export function clMatch (string: string, expression?: string, caseSensitive?: boolean): boolean