@castlabs/ui 7.16.0 → 7.18.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 (52) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/select-disabled.svg +1 -1
  3. package/dist/castlabs-ui-editor.common.js +56 -56
  4. package/dist/castlabs-ui-editor.common.js.map +1 -1
  5. package/dist/castlabs-ui-editor.css +1 -1
  6. package/dist/castlabs-ui-editor.umd.js +57 -57
  7. package/dist/castlabs-ui-editor.umd.js.map +1 -1
  8. package/dist/castlabs-ui.common.js +4 -4
  9. package/dist/castlabs-ui.common.js.map +1 -1
  10. package/dist/castlabs-ui.core.js +49 -1
  11. package/dist/castlabs-ui.css +1 -1
  12. package/dist/castlabs-ui.module.d.ts +4 -0
  13. package/dist/castlabs-ui.module.js +49 -1
  14. package/dist/castlabs-ui.umd.js +5 -5
  15. package/dist/castlabs-ui.umd.js.map +1 -1
  16. package/dist/{select-disabled.c5e07724.svg → select-disabled.1065ea4c.svg} +1 -1
  17. package/dist/select-disabled.dark.1065ea4c.svg +1 -0
  18. package/dist/select.dark.efd5244b.svg +1 -0
  19. package/package.json +15 -15
  20. package/src/components/ClBadge/style.variables.scss +1 -1
  21. package/src/components/ClButton/style.scss +18 -0
  22. package/src/components/ClDropdown/style.scss +1 -1
  23. package/src/components/ClDropzone/style.scss +1 -1
  24. package/src/components/ClHighlight/style.scss +2 -4
  25. package/src/components/ClList/style.variables.scss +5 -0
  26. package/src/components/ClPagination/style.scss +2 -3
  27. package/src/components/ClToggle/style.scss +1 -1
  28. package/src/components/ClWizard/style.scss +4 -4
  29. package/src/components/form/ClField/style.scss +1 -1
  30. package/src/components/form/ClFieldCheck/style.scss +23 -8
  31. package/src/components/form/ClFieldGroup/style.scss +1 -1
  32. package/src/components/form/ClFieldInput/style.scss +3 -2
  33. package/src/components/modal/ClModal/style.scss +3 -1
  34. package/src/components/navigation/ClNavSide/ClNavDrawer/style.scss +3 -5
  35. package/src/components/navigation/ClNavSide/ClNavItemDarkMode/style.scss +44 -0
  36. package/src/components/navigation/ClNavTop/style.scss +5 -1
  37. package/src/components/widget/ClPage/style.scss +1 -1
  38. package/src/styles/_global.scss +1 -0
  39. package/src/styles/abstracts/button.scss +10 -1
  40. package/src/styles/abstracts/color.scss +50 -13
  41. package/src/styles/abstracts/typography.scss +3 -1
  42. package/src/styles/layout/color.scss +0 -38
  43. package/src/styles/layout/grid.scss +4 -3
  44. package/src/styles/layout/meta.scss +1 -1
  45. package/src/styles/layout/typography.scss +1 -1
  46. package/src/styles/themes/dark.scss +160 -0
  47. package/src/styles/themes/dark.variables.scss +33 -0
  48. package/src/styles/ui.scss +6 -0
  49. package/types/castlabs-ui.module.d.ts +4 -0
  50. package/types/index.d.ts +135 -12
  51. /package/dist/fonts/{DM_Mono_500.03f95844.woff2 → DM_Mono_500.3f958442.woff2} +0 -0
  52. /package/dist/fonts/{fa-brands-400.05faf876.woff2 → fa-brands-400.5faf8763.woff2} +0 -0
@@ -117,6 +117,7 @@ $typography-monospace-line-height: 1.375;
117
117
  // button styled as regular link
118
118
  @extend %cl-a;
119
119
 
120
+ background-color: transparent;
120
121
  background-position: left bottom 0.25em; // depends on underline
121
122
  background-repeat: no-repeat;
122
123
  background-size: 100% 1px;
@@ -139,6 +140,7 @@ $typography-monospace-line-height: 1.375;
139
140
  }
140
141
 
141
142
  &:hover {
143
+ background-color: transparent;
142
144
  color: var(--cl-color-hover);
143
145
  opacity: inherit;
144
146
  }
@@ -487,7 +489,7 @@ $typography-responsive-scale: 0.8;
487
489
  %cl-p-pre-box {
488
490
  @extend %cl-p-pre;
489
491
 
490
- background-color: $color-ci-haze;
492
+ background-color: var(--cl-color-background-haze);
491
493
  border-radius: $brand-border-radius;
492
494
  clip-path: inset(0 round $brand-border-radius);
493
495
  font-size: px(15);
@@ -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.16.0';
2
+ #{'--cl-version'}: 'v7.18.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
@@ -106,13 +107,13 @@ export function clTableSorter (
106
107
  initialOrder?: string
107
108
  ): any
108
109
  export function clTableSorterObjects<Type> (dataCallback: () => Type[], keys: string[], initialCol?: number, pageNoCallback?: () => number, pageSizeCallback?: () => number): {
109
- col: number,
110
- order: 'ASC' | 'DESC' | 'NONE',
111
- set: (col: number, order: string) => void,
112
- get: (col: number) => string,
113
- sorted: Type[],
114
- sorter: () => any,
115
- sort: (col?: number, order?: string) => 'ASC' | 'DESC' | 'NONE',
110
+ col: number
111
+ order: 'ASC' | 'DESC' | 'NONE'
112
+ set: (col: number, order: string) => void
113
+ get: (col: number) => string
114
+ sorted: Type[]
115
+ sorter: () => any
116
+ sort: (col?: number, order?: string) => 'ASC' | 'DESC' | 'NONE'
116
117
  }
117
118
  export function clDebounce (callback: any, ms?: number, key?: string): void
118
119
  export function clSanitizeId (id: string): string
@@ -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
@@ -283,12 +288,130 @@ type CsNavEntry = {
283
288
  badge: string | undefined
284
289
  }
285
290
 
291
+ type STATE = {
292
+ UNKNOWN: null,
293
+ ACTIVE: number
294
+ PENDING: number
295
+ DELETED: number
296
+ SUSPENDED: number
297
+ }
298
+
286
299
  export const CS: {
287
- SERVICE: Record<string, string>
288
- ROLE: Record<string, string>
289
- STATE: Record<string, number | null>
290
- LICENSE_STATE: Record<string, number | null>
291
- PLAN: Record<string, number | null>
300
+ SERVICE: {
301
+ CP: string
302
+ CP_TAGLINE: string
303
+ CP_URN: string
304
+ CS: string
305
+ CS_TAGLINE: string
306
+ CS_URN: string
307
+ DT: string
308
+ DT_TAGLINE: string
309
+ DT_URN: string
310
+ DTO: string
311
+ DTO_TAGLINE: string
312
+ DTO_URN: string
313
+ DTS: string
314
+ DTS_TAGLINE: string
315
+ DTS_URN: string
316
+ PP: string
317
+ PP_TAGLINE: string
318
+ PP_URN: string
319
+ PP_URN_ANDROID: string
320
+ PP_URN_BROWSER: string
321
+ PP_URN_GSTREAMER: string
322
+ PP_URN_IOS: string
323
+ PP_URN_REACTNATIVE: string
324
+ PP_URN_WEBRTC: string
325
+ VTK: string
326
+ VTK_TAGLINE: string
327
+ VTK_URN: string
328
+ WM: string
329
+ WM_TAGLINE: string
330
+ WM_URN: string
331
+ }
332
+ ROLE: {
333
+ CS_READONLY: string
334
+ CS_READONLY_URN: string
335
+
336
+ CS_ADMIN: string
337
+ CS_ADMIN_URN: string
338
+ CS_BILLING: string
339
+ CS_BILLING_URN: string
340
+ CS_REPORTS: string
341
+ CS_REPORTS_URN: string
342
+
343
+ PP_ADMIN: string
344
+ PP_ADMIN_URN: string
345
+ PP_USER: string
346
+ PP_USER_URN: string
347
+
348
+ DT_MEMBERS: string
349
+ DT_MEMBERS_URN: string
350
+ DT_SUBORGS: string
351
+ DT_SUBORGS_URN: string
352
+ DT_CONFIGURATION: string
353
+ DT_CONFIGURATION_URN: string
354
+ DT_KEYS_DELETE: string
355
+ DT_KEYS_DELETE_URN: string
356
+ DT_KEYS_INGEST: string
357
+ DT_KEYS_INGEST_URN: string
358
+ DT_ASSETS: string
359
+ DT_ASSETS_URN: string
360
+ DT_DELIVERIES: string
361
+ DT_DELIVERIES_URN: string
362
+
363
+ DTO_DEVICES: string
364
+ DTO_DEVICES_URN: string
365
+ DTO_KEYBOX: string
366
+ DTO_KEYBOX_URN: string
367
+ DTO_DOWNLOAD: string
368
+ DTO_DOWNLOAD_URN: string
369
+ DTO_REPORTS: string
370
+ DTO_REPORTS_URN: string
371
+ DTO_CONFIGURATION: string
372
+ DTO_CONFIGURATION_URN: string
373
+
374
+ DTS_MEMBERS: string
375
+ DTS_MEMBERS_URN: string
376
+ DTS_SUBORGS: string
377
+ DTS_SUBORGS_URN: string
378
+ DTS_CONFIGURATION: string
379
+ DTS_CONFIGURATION_URN: string
380
+ DTS_KEYS_DELETE: string
381
+ DTS_KEYS_DELETE_URN: string
382
+ DTS_KEYS_INGEST: string
383
+ DTS_KEYS_INGEST_URN: string
384
+ DTS_ASSETS: string
385
+ DTS_ASSETS_URN: string
386
+ DTS_DELIVERIES: string
387
+ DTS_DELIVERIES_URN: string
388
+
389
+ VTK_ADMIN: string
390
+ VTK_ADMIN_URN: string
391
+ VTK_USER: string
392
+ VTK_USER_URN: string
393
+
394
+ CP_USER: string
395
+ CP_USER_URN: string
396
+
397
+ WM_DEMO: string
398
+ WM_DEMO_URN: string
399
+ WM_EXTRACTION: string
400
+ WM_EXTRACTION_URN: string
401
+ }
402
+ STATE: STATE
403
+ LICENSE_STATE: {
404
+ APPROVAL_REQUIRED: number
405
+ APPROVAL_DENIED: number
406
+ APPROVAL_REVOKED: number
407
+ } & STATE
408
+ PLAN: {
409
+ UNKNOWN: null,
410
+ TRIAL: number
411
+ STARTER: number
412
+ ENTERPRISE: number
413
+ CUSTOM: number
414
+ }
292
415
  APPS: Record<string, CsApp>
293
416
  }
294
417