@castlabs/ui 7.24.2 → 8.0.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/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "@castlabs/ui",
3
- "version": "7.24.2",
4
- "repository": "https://github.com/castlabs/ui-styleguide",
3
+ "version": "8.0.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/castlabs/ui-styleguide.git"
7
+ },
5
8
  "private": false,
6
9
  "description": "A vanilla HTML/CS/JS & Vue.js component library for Castlabs.",
7
10
  "engines": {
8
- "npm": ">=8.0.0"
11
+ "npm": ">=8.0.0",
12
+ "node": "^22.18.0 || >=24.12.0"
9
13
  },
10
14
  "scripts": {
11
15
  "build-lib": "vite build && npm run gulp dist",
12
16
  "build-only": "vite build",
13
17
  "package": "vite build && npm run gulp dist && npm pack",
14
-
15
18
  "test": "vitest run --environment jsdom --root tests/unit/",
16
19
  "test:unit": "vitest run --no-color --environment jsdom --root tests/unit/",
17
-
18
20
  "lint": "npm-run-all lint:stylelint lint:eslint lint:type-check",
19
21
  "lint:eslint": "eslint .",
20
22
  "lint:stylelint": "stylelint \"**/*.{css,scss}\" --ignore-path .gitignore",
21
23
  "lint:type-check": "vue-tsc --noEmit -p tsconfig.types.json",
22
-
23
24
  "fix": "npm-run-all fix:stylelint fix:prettier fix:eslint",
24
25
  "fix:eslint": "eslint . --fix",
25
26
  "fix:prettier": "prettier --write src/ tests/",
26
27
  "fix:stylelint": "stylelint \"**/*.{css,scss}\" --fix --ignore-path .gitignore",
27
-
28
28
  "gulp": "gulp"
29
29
  },
30
30
  "files": [
@@ -42,42 +42,43 @@
42
42
  "simplebar": "6.3.3"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@rollup/rollup-linux-x64-gnu": "4.62.2"
45
+ "@rollup/rollup-linux-x64-gnu": "4.62.3"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@castlabs/ui-editor": "file:../castlabs-ui-editor",
49
- "@tsconfig/node22": "22.0.5",
49
+ "@tsconfig/node24": "24.0.4",
50
50
  "@types/jsdom": "28.0.3",
51
- "@types/node": "26.1.0",
52
- "@vitejs/plugin-vue": "6.0.7",
53
- "@vitest/eslint-plugin": "1.6.21",
51
+ "@types/node": "26.1.2",
52
+ "@vitejs/plugin-vue": "6.0.8",
53
+ "@vitest/eslint-plugin": "1.6.24",
54
54
  "@vue/eslint-config-prettier": "10.2.0",
55
55
  "@vue/eslint-config-typescript": "14.9.0",
56
56
  "@vue/test-utils": "2.4.11",
57
57
  "@vue/tsconfig": "0.9.1",
58
58
  "core-js": "3.49.0",
59
59
  "dree": "5.1.5",
60
- "eslint-plugin-import": "2.32.0",
61
- "eslint-plugin-n": "18.2.1",
62
- "eslint-plugin-promise": "7.3.0",
63
- "eslint-plugin-vue": "10.9.2",
64
- "eslint": "9.39.4",
60
+ "eslint": "10.8.0",
61
+ "eslint-plugin-n": "18.2.2",
62
+ "eslint-plugin-promise": "^7.3.0",
63
+ "eslint-plugin-vue": "10.10.0",
64
+ "gulp": "5.0.1",
65
65
  "gulp-concat": "2.6.1",
66
66
  "gulp-replace": "1.1.4",
67
- "gulp": "5.0.1",
68
- "jsdom": "29.1.1",
67
+ "jsdom": "30.0.1",
69
68
  "npm-run-all": "4.1.5",
70
- "sass": "1.101.0",
69
+ "prettier": "3.9.6",
70
+ "sass": "1.102.0",
71
71
  "stylelint-config-sass-guidelines": "13.0.0",
72
- "stylelint-config-standard-vue": "1.0.0",
73
72
  "stylelint-config-standard": "40.0.0",
73
+ "stylelint-config-standard-vue": "1.0.0",
74
74
  "stylelint-order": "8.1.1",
75
75
  "stylelint-scss": "7.2.0",
76
76
  "typescript": "6.0.3",
77
- "vite": "8.1.3",
77
+ "vite": "8.1.5",
78
78
  "vitest": "4.1.10",
79
- "vue-tsc": "3.3.6",
80
- "vue": "3.5.39"
79
+ "vue": "3.5.40",
80
+ "vue-eslint-parser": "10.4.1",
81
+ "vue-tsc": "3.3.8"
81
82
  },
82
83
  "overrides": {
83
84
  "glob": "^13"
@@ -45,7 +45,7 @@
45
45
  margin-left: $spacing-small;
46
46
  }
47
47
 
48
- &.active {
48
+ &.active .page-link {
49
49
  @extend %cl-color-red;
50
50
 
51
51
  pointer-events: none;
@@ -41,7 +41,7 @@
41
41
  }
42
42
 
43
43
  &:not(:checked) + .cl-badge {
44
- background-color: transparent;
44
+ background-color: transparent !important;
45
45
  color: var(--cl-color-background);
46
46
  #{'--cl-color-focus'}: rgba($color-ci-night, 0.5);
47
47
 
@@ -217,20 +217,6 @@ $color-opacity-active: 0.8;
217
217
  }
218
218
  }
219
219
 
220
- /* @mixin cl-colors-named {
221
- &.cl-color-primary {
222
- @extend %cl-color-sea;
223
- }
224
-
225
- &.cl-color-secondary {
226
- @extend %cl-color-night;
227
- }
228
-
229
- &.cl-color-tertiary {
230
- @extend %cl-color-transparent;
231
- }
232
- } */
233
-
234
220
  %cl-color-root {
235
221
  // default colors = outline-night
236
222
  #{'--cl-color-accent'}: $color-accent;
@@ -286,6 +272,7 @@ $color-opacity-active: 0.8;
286
272
  #{'--cl-color-link'}: $color-ci-eggshell;
287
273
  #{'--cl-color-text'}: $color-ci-eggshell;
288
274
  #{'--cl-color-text-inverted'}: $color-ci-night;
275
+ background-color: var(--cl-color-background);
289
276
  }
290
277
 
291
278
  %cl-color-text-dark {
@@ -300,6 +287,7 @@ $color-opacity-active: 0.8;
300
287
  #{'--cl-color-link'}: $color-ci-night;
301
288
  #{'--cl-color-text'}: $color-ci-night;
302
289
  #{'--cl-color-text-inverted'}: $color-ci-eggshell;
290
+ background-color: var(--cl-color-background);
303
291
  }
304
292
 
305
293
  %cl-color-red {
@@ -92,76 +92,68 @@ div {
92
92
  }
93
93
  }
94
94
 
95
+ @mixin cl-color-text($color) {
96
+ #{'--cl-color-text'}: $color !important;
97
+ #{'--cl-color-link'}: $color !important;
98
+ color: var(--cl-color-text) !important;
99
+ }
100
+
95
101
  .cl-color-text-red {
96
- #{'--cl-color-text'}: $color-ci-red !important;
97
- #{'--cl-color-link'}: $color-ci-red !important;
102
+ @include cl-color-text($color-ci-red);
98
103
  }
99
104
 
100
105
  .cl-color-text-sky {
101
- #{'--cl-color-text'}: $color-ci-sky !important;
102
- #{'--cl-color-link'}: $color-ci-sky !important;
106
+ @include cl-color-text($color-ci-sky);
103
107
  }
104
108
 
105
109
  .cl-color-text-night {
106
- #{'--cl-color-text'}: $color-ci-night !important;
107
- #{'--cl-color-link'}: $color-ci-night !important;
110
+ @include cl-color-text($color-ci-night);
108
111
  }
109
112
 
110
113
  .cl-color-text-eggshell {
111
- #{'--cl-color-text'}: $color-ci-eggshell !important;
112
- #{'--cl-color-link'}: $color-ci-eggshell !important;
114
+ @include cl-color-text($color-ci-eggshell);
113
115
  }
114
116
 
115
117
  .cl-color-text-clay {
116
- #{'--cl-color-text'}: $color-ci-clay !important;
118
+ @include cl-color-text($color-ci-clay);
117
119
  }
118
120
 
119
121
  .cl-color-text-ash {
120
- #{'--cl-color-text'}: $color-ci-ash !important;
121
- #{'--cl-color-link'}: $color-ci-ash !important;
122
+ @include cl-color-text($color-ci-ash);
122
123
  }
123
124
 
124
125
  .cl-color-text-petrol {
125
- #{'--cl-color-text'}: $color-ci-petrol !important;
126
- #{'--cl-color-link'}: $color-ci-petrol !important;
126
+ @include cl-color-text($color-ci-petrol);
127
127
  }
128
128
 
129
129
  .cl-color-text-berry {
130
- #{'--cl-color-text'}: $color-ci-berry !important;
131
- #{'--cl-color-link'}: $color-ci-berry !important;
130
+ @include cl-color-text($color-ci-berry);
132
131
  }
133
132
 
134
133
  .cl-color-text-none {
135
- #{'--cl-color-text'}: transparent !important;
136
- #{'--cl-color-link'}: transparent !important;
134
+ @include cl-color-text(transparent);
137
135
  }
138
136
 
139
137
  .cl-color-text-brick {
140
- #{'--cl-color-text'}: $color-ci-brick !important;
141
- #{'--cl-color-link'}: $color-ci-brick !important;
138
+ @include cl-color-text($color-ci-brick);
142
139
  }
143
140
 
144
141
  .cl-color-text-honey {
145
- #{'--cl-color-text'}: $color-ci-honey !important;
146
- #{'--cl-color-link'}: $color-ci-honey !important;
142
+ @include cl-color-text($color-ci-honey);
147
143
  }
148
144
 
149
145
  .cl-color-text-leaf {
150
- #{'--cl-color-text'}: $color-ci-leaf !important;
151
- #{'--cl-color-link'}: $color-ci-leaf !important;
146
+ @include cl-color-text($color-ci-leaf);
152
147
  }
153
148
 
154
149
  .cl-color-text-sea {
155
- #{'--cl-color-text'}: $color-ci-sea !important;
156
- #{'--cl-color-link'}: $color-ci-sea !important;
150
+ @include cl-color-text($color-ci-sea);
157
151
  }
158
152
 
159
153
  .cl-color-text-orchid {
160
- #{'--cl-color-text'}: $color-ci-orchid !important;
161
- #{'--cl-color-link'}: $color-ci-orchid !important;
154
+ @include cl-color-text($color-ci-orchid);
162
155
  }
163
156
 
164
157
  .cl-color-text-steel {
165
- #{'--cl-color-text'}: $color-ci-steel !important;
166
- #{'--cl-color-link'}: $color-ci-steel !important;
158
+ @include cl-color-text($color-ci-steel);
167
159
  }
@@ -1,3 +1,3 @@
1
1
  :root {
2
- #{'--cl-version'}: 'v7.24.2';
2
+ #{'--cl-version'}: 'v8.0.0';
3
3
  }
@@ -104,7 +104,6 @@ $castlabs-ui-asset-postfix: '' !default;
104
104
  @use '../components/text/ClPlan/style' as *;
105
105
  @use '../components/text/ClRole/style' as *;
106
106
  @use '../components/widget/ClBackCancelOk/style' as *;
107
- @use '../components/widget/ClCookieBanner/style' as *;
108
107
  @use '../components/widget/ClPage/style' as *;
109
108
 
110
109
  @use 'themes/dark' as * with (
package/types/index.d.ts CHANGED
@@ -7,7 +7,6 @@ export function clUi (Vue: App): void
7
7
 
8
8
  export const ClAlert: DefineComponent
9
9
  export const ClBackCancelOk: DefineComponent
10
- export const ClCookieBanner: DefineComponent
11
10
  export const ClDropzone: DefineComponent
12
11
  export const ClField: DefineComponent
13
12
  export const ClFieldCheck: DefineComponent
@@ -1,5 +0,0 @@
1
- # Matomo Integration
2
-
3
- This standalone plugin is based on [vue-matomo](https://github.com/AmazingDreams/vue-matomo) (MIT license).
4
-
5
- It is not used by @castlabs/ui itself, but provided for Vue child projects to use.
@@ -1,93 +0,0 @@
1
- /**
2
- * Provide matomo integration without dependency to external package.
3
- */
4
-
5
- import VueMatomo from 'vue-matomo'
6
- import type { App } from 'vue'
7
- import type { Router, RouteLocationNormalized } from 'vue-router'
8
-
9
- export function setCookie (name: string, value: string, days = 365, path = '/') {
10
- document.cookie = `${name}=${value}; max-age=${60 * 60 * 24 * days}; path=${path}; SameSite=Lax;`
11
- }
12
-
13
- export function getCookie (cname: string): string {
14
- for (const cookie of document?.cookie?.split(/; */) ?? []) {
15
- const [name, value] = cookie.split('=')
16
- if (name === cname) return value ?? ''
17
- }
18
- return ''
19
- }
20
-
21
- function getPaq () {
22
- // cast potentialy non-exsisting _paq for typescript
23
- return (window as unknown as { _paq: (string | number)[][] })?._paq ?? []
24
- }
25
-
26
- export function hasCookieConsent (what: string): boolean {
27
- const value = getCookie('cl_banner_nok')
28
- for (const token of value.split('|')) {
29
- if (token === `+${what}`) return true
30
- }
31
- return false
32
- }
33
-
34
- export function enableMatomo (record = false, env = 'PROD') {
35
- // Enable detailed matomo tracking if user gave consent.
36
- const _paq = getPaq()
37
- if (hasCookieConsent('mtm') && getCookie('mtm_cookie_consent') === '') {
38
- // make Matomo create cookie 'mtm_cookie_consent' to remember consent. ~13 months=9480 hours.
39
- _paq.push(['rememberCookieConsentGiven', 9480])
40
- }
41
- if (record) trackPage(document?.title, window?.location?.pathname, env)
42
- }
43
-
44
- export function trackPage (title: string, path: string, env: string) {
45
- // Instruct Matomo to do the actual page tracking.
46
-
47
- let prettyPath = path
48
- const urnRegexp = /urn:[a-zA-Z]+:[a-zA-Z]+:[a-fA-F0-9]{32}/g
49
- const foundUrns = [...prettyPath.matchAll(urnRegexp)]
50
- foundUrns.forEach(elem => {
51
- prettyPath = prettyPath.replace(elem.toString(), (elem[0].split(':')[2] ?? '').toUpperCase())
52
- })
53
-
54
- const prettyTitle = `${window?.location?.hostname} / ${title.replace(/ *\|[^|]*$/, '')}${env === 'PROD' ? '' : env}`
55
-
56
- const _paq = getPaq()
57
- _paq.push(['setDocumentTitle', prettyTitle])
58
- _paq.push(['setCustomUrl', prettyPath])
59
- _paq.push(['trackPageView'])
60
- _paq.push(['enableLinkTracking'])
61
- }
62
-
63
- function trackViaMatomo (to: RouteLocationNormalized, env: string) {
64
- if (!to.meta.analyticsIgnore) {
65
- // matomo settings
66
- enableMatomo()
67
- trackPage(to.meta.title as string, to.fullPath, env)
68
- }
69
- }
70
-
71
- export default {
72
- install: (app: App, router: Router, env = 'PROD', siteId = 1) => {
73
- console.log('setup matomo', env, siteId)
74
- app.use(VueMatomo, {
75
- host: 'https://castlabs.matomo.cloud',
76
- siteId: siteId,
77
- enableLinkTracking: false,
78
- requireConsent: false,
79
- trackInitialView: false,
80
- disableCookies: false,
81
- requireCookieConsent: true,
82
- enableHeartBeatTimer: true,
83
- heartBeatTimerInterval: 15,
84
- trackerFileName: 'matomo',
85
- cookieDomain: '*.castlabs.com',
86
- domains: ['*.castlabs.com']
87
- })
88
-
89
- router.afterEach((to: RouteLocationNormalized) => {
90
- trackViaMatomo(to, env)
91
- })
92
- }
93
- }
@@ -1 +0,0 @@
1
- declare module 'vue-matomo'
@@ -1,48 +0,0 @@
1
- @use '../../../styles/global' as *;
2
-
3
- .cl-cookie-banner {
4
- bottom: $spacing-large + $spacing-small;
5
- // box-shadow: 1px 1px 2px 1px $color-black-25a;
6
- left: 50%;
7
- opacity: 1;
8
- position: fixed;
9
- transform: translate(-50%);
10
- z-index: $layer-z-sidenav;
11
-
12
- .btn {
13
- display: inline !important; // sass-lint:disable-line no-important
14
- width: 8rem !important; // sass-lint:disable-line no-important
15
- }
16
-
17
- .card-body {
18
- padding: $spacing-small;
19
- }
20
-
21
- @include media-breakpoint-up(md) {
22
- width: 640px;
23
- }
24
-
25
- @include media-breakpoint-down(md) {
26
- width: calc(100% - $spacing-small);
27
-
28
- .card-body {
29
- padding-left: $spacing-small;
30
- padding-right: $spacing-small;
31
-
32
- .cl-spacing-box.text-center {
33
- > * {
34
- margin-left: $spacing-tiny;
35
- margin-right: $spacing-tiny;
36
- }
37
- }
38
- }
39
- }
40
-
41
- &.cl-fade-away {
42
- opacity: 0;
43
- transform: translate(-50%, $spacing-large);
44
- transition:
45
- transform 0.4s,
46
- opacity 0.4s;
47
- }
48
- }