@citizenplane/pimp 18.9.3 → 18.9.5

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,10 +1,10 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "18.9.3",
3
+ "version": "18.9.5",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
7
- "build": "vite build && vite build --config vite.resolver.config.cjs",
7
+ "build": "vite build && vite build --config vite.resolver.config.js",
8
8
  "lint": "biome check .",
9
9
  "lint:fix": "biome check --write .",
10
10
  "lint:style": "stylelint \"**/*.{css,scss,vue}\"",
@@ -52,54 +52,54 @@
52
52
  "feather-icons": "^4.29.2",
53
53
  "floating-vue": "^5.2.2",
54
54
  "luxon": "^3.7.2",
55
- "maska": "^3.1.1",
55
+ "maska": "^3.2.0",
56
56
  "modern-normalize": "^3.0.1",
57
- "primevue": "^4.5.4",
58
- "vue": "^3.5.34",
57
+ "primevue": "^4.5.5",
58
+ "vue": "^3.5.38",
59
59
  "vue-bind-once": "^0.2.1",
60
- "vue-tel-input": "^9.5.0",
60
+ "vue-tel-input": "^9.8.0",
61
61
  "web-haptics": "^0.0.6"
62
62
  },
63
63
  "devDependencies": {
64
- "@babel/core": "^7.28.6",
65
- "@biomejs/biome": "2.4.16",
66
- "@commitlint/cli": "20.5.3",
67
- "@storybook/addon-docs": "^10.3.6",
68
- "@storybook/addon-onboarding": "^10.3.6",
69
- "@storybook/addon-vitest": "^10.3.6",
64
+ "@babel/core": "^7.29.7",
65
+ "@biomejs/biome": "2.5.1",
66
+ "@commitlint/cli": "21.1.0",
67
+ "@storybook/addon-docs": "^10.4.6",
68
+ "@storybook/addon-onboarding": "^10.4.6",
69
+ "@storybook/addon-vitest": "^10.4.6",
70
70
  "@storybook/preset-scss": "^1.0.3",
71
- "@storybook/vue3-vite": "^10.3.6",
71
+ "@storybook/vue3-vite": "^10.4.6",
72
72
  "@types/feather-icons": "^4.29.4",
73
73
  "@types/vue-tel-input": "^9.7.91",
74
- "@vitejs/plugin-vue": "^6.0.3",
75
- "@vitest/browser": "^4.0.18",
76
- "@vitest/coverage-v8": "^4.0.18",
77
- "@vue/babel-preset-app": "^5.0.8",
78
- "@vue/test-utils": "^2.4.10",
74
+ "@vitejs/plugin-vue": "^6.0.7",
75
+ "@vitest/browser": "^4.1.9",
76
+ "@vitest/coverage-v8": "^4.1.9",
77
+ "@vue/babel-preset-app": "^5.0.9",
78
+ "@vue/test-utils": "^2.4.11",
79
79
  "@vue/vue3-jest": "^29.2.6",
80
80
  "babel-core": "^7.0.0-bridge.0",
81
81
  "commitlint-config-gitmoji": "2.3.1",
82
82
  "husky": "^9.1.7",
83
83
  "jest": "~29.7.0",
84
- "jest-environment-jsdom": "^30.2.0",
85
- "lint-staged": "^17.0.0",
86
- "playwright": "^1.58.0",
87
- "sass": "~1.99.0",
88
- "sass-loader": "^16.0.6",
89
- "storybook": "^10.3.5",
90
- "stylelint": "16.26.1",
84
+ "jest-environment-jsdom": "^30.4.1",
85
+ "lint-staged": "^17.0.8",
86
+ "playwright": "^1.61.0",
87
+ "sass": "~1.101.0",
88
+ "sass-loader": "^16.0.8",
89
+ "storybook": "^10.4.6",
90
+ "stylelint": "17.13.0",
91
91
  "stylelint-config-html": "1.1.0",
92
92
  "stylelint-config-idiomatic-order": "10.0.0",
93
- "stylelint-config-recommended-scss": "16.0.2",
93
+ "stylelint-config-recommended-scss": " 17.0.1",
94
94
  "stylelint-config-recommended-vue": "1.6.1",
95
- "stylelint-config-standard-scss": "16.0.0",
96
- "stylelint-order": "7.0.1",
97
- "ts-jest": "^29.4.6",
98
- "unplugin-vue-components": "^32.0.0",
99
- "vite": "^7.3.2",
100
- "vite-plugin-dts": "^5.0.0",
101
- "vitest": "^4.0.18",
102
- "vue-tsc": "3.2.8"
95
+ "stylelint-config-standard-scss": "17.0.0",
96
+ "stylelint-order": "8.1.1",
97
+ "ts-jest": "^29.4.11",
98
+ "unplugin-vue-components": "^32.1.0",
99
+ "vite": "^8.1.0",
100
+ "vite-plugin-dts": "^5.0.2",
101
+ "vitest": "^4.1.9",
102
+ "vue-tsc": "3.3.5"
103
103
  },
104
104
  "engines": {
105
105
  "npm": "11",
@@ -1,5 +1,5 @@
1
1
  // Sass function to convert px into rem
2
- @use 'sass:math';
2
+ @use "sass:math";
3
3
 
4
4
  // Defining base font size
5
5
  // The default font size for html is 16px
@@ -1,4 +1,4 @@
1
- @use '../helpers/functions' as fn;
1
+ @use "../helpers/functions" as fn;
2
2
 
3
3
  // Popover
4
4
  @mixin popover-desktop($transitionName) {
@@ -42,9 +42,7 @@
42
42
 
43
43
  @mixin v-dropdown-transition() {
44
44
  .v-popper__wrapper {
45
- transition:
46
- scale 200ms var(--cp-easing-elastic),
47
- opacity 200ms ease;
45
+ transition: scale 200ms var(--cp-easing-elastic), opacity 200ms ease;
48
46
  }
49
47
 
50
48
  .v-popper__popper--hidden .v-popper__wrapper {
@@ -1,4 +1,4 @@
1
- @use '../helpers/functions' as fn;
1
+ @use "../helpers/functions" as fn;
2
2
 
3
3
  .u-text-ellipsis,
4
4
  %u-text-ellipsis {
@@ -23,7 +23,7 @@
23
23
  line-height: normal;
24
24
 
25
25
  &::after {
26
- content: ' ';
26
+ content: " ";
27
27
  }
28
28
  }
29
29
 
@@ -54,15 +54,7 @@ label .u-asterisk {
54
54
  radial-gradient(farthest-side at 100% 50%, #3e3e5b33, #3e3e5b00) 0 100%;
55
55
  background-attachment: local, local, scroll, scroll;
56
56
  background-color: var(--cp-background-primary);
57
- background-position:
58
- 0 0,
59
- 100%,
60
- 0 0,
61
- 100%;
57
+ background-position: 0 0, 100%, 0 0, 100%;
62
58
  background-repeat: no-repeat;
63
- background-size:
64
- 40px 100%,
65
- 40px 100%,
66
- 14px 100%,
67
- 14px 100%;
59
+ background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
68
60
  }
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <!-- biome-ignore lint/a11y/useSemanticElements: <can be button or link> -->
2
3
  <component
3
4
  :is="tag"
4
5
  :aria-disabled="isButtonDisabled"
@@ -115,10 +116,12 @@ const handleClick = (event: MouseEvent) => {
115
116
  background-color: $hoverBackgroundColor;
116
117
  }
117
118
 
118
- &:focus,
119
119
  &:focus-visible,
120
120
  &:active {
121
121
  background-color: $hoverBackgroundColor;
122
+ }
123
+
124
+ &:focus-visible {
122
125
  outline: fn.px-to-rem(2) solid $hoverBackgroundColor;
123
126
  }
124
127
  }
@@ -141,10 +144,12 @@ const handleClick = (event: MouseEvent) => {
141
144
  0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft-hover);
142
145
  }
143
146
 
144
- &:focus,
145
147
  &:focus-visible,
146
148
  &:active {
147
149
  background-color: var(--cp-background-primary-hover);
150
+ }
151
+
152
+ &:focus-visible {
148
153
  outline: fn.px-to-rem(2) solid var(--cp-background-primary-hover);
149
154
  }
150
155
  }
@@ -162,10 +167,12 @@ const handleClick = (event: MouseEvent) => {
162
167
  color: $hoverColor;
163
168
  }
164
169
 
165
- &:focus,
166
170
  &:focus-visible,
167
171
  &:active {
168
172
  color: $hoverColor;
173
+ }
174
+
175
+ &:focus-visible {
169
176
  outline: fn.px-to-rem(2) solid $color;
170
177
  }
171
178
  }
@@ -180,7 +187,7 @@ const handleClick = (event: MouseEvent) => {
180
187
  line-height: var(--cp-line-height-md);
181
188
  outline-offset: fn.px-to-rem(2);
182
189
  text-decoration: none;
183
- transition-duration: 150ms;
190
+ transition-duration: 250ms;
184
191
  transition-property: box-shadow, background-color, transform, width;
185
192
  transition-timing-function: ease;
186
193
 
@@ -196,12 +203,8 @@ const handleClick = (event: MouseEvent) => {
196
203
  color: var(--cp-text-primary);
197
204
  }
198
205
 
199
- &:hover {
200
- transform: translateY(fn.px-to-rem(-1));
201
- }
202
-
203
206
  &:active {
204
- transform: translateY(fn.px-to-rem(1));
207
+ transform: scale3d(0.97, 0.97, 1);
205
208
  }
206
209
 
207
210
  // Primary appearance
@@ -88,18 +88,17 @@ const handleClick = (event: MouseEvent) => {
88
88
  color: var(--cp-text-disabled);
89
89
  cursor: not-allowed;
90
90
  }
91
-
91
+
92
92
  &:hover:not(:disabled) {
93
93
  background-color: var(--cp-background-primary-hover);
94
94
  box-shadow:
95
95
  var(--cp-shadows-3xs-inset),
96
96
  0 0 0 var(--cp-dimensions-0_25) var(--cp-border-soft-hover);
97
97
  color: var(--cp-text-secondary-hover);
98
- transform: translateY(fn.px-to-rem(-1));
99
98
  }
100
99
 
101
100
  &:active:not(:disabled) {
102
- transform: translateY(fn.px-to-rem(1));
101
+ transform: scale3d(0.97, 0.97, 1);
103
102
  }
104
103
 
105
104
  &__leading {
@@ -64,7 +64,7 @@
64
64
  </div>
65
65
  </div>
66
66
  <div key="action" class="asd__recurency--action">
67
- <cp-button class="asd__button-switch" @click.stop="isDaysDisplayed ? removeRecurency() : addRecurency()">
67
+ <cp-button class="asd__button-switch" @click.stop="handleRecurency">
68
68
  {{ isDaysDisplayed ? 'Remove recurency' : 'Add recurency' }}
69
69
  </cp-button>
70
70
  <cp-button
@@ -181,6 +181,14 @@ const toggleDay = (index: number): void => {
181
181
  emitToParent()
182
182
  }
183
183
 
184
+ const handleRecurency = (): void => {
185
+ if (isDaysDisplayed.value) {
186
+ removeRecurency()
187
+ } else {
188
+ addRecurency()
189
+ }
190
+ }
191
+
184
192
  const addRecurency = (): void => {
185
193
  const dt = DateTime.local()
186
194
  mode.value = 'range'
@@ -200,11 +208,11 @@ const removeRecurency = (): void => {
200
208
 
201
209
  const emitToParent = (): void => {
202
210
  let dates = [dateOne.value]
203
-
211
+
204
212
  if (isDaysDisplayed.value) {
205
213
  dates = recurenceDates.value.length ? datesToStringArray(recurenceDates.value) : []
206
214
  }
207
-
215
+
208
216
  emit('dates', dates)
209
217
  }
210
218
 
@@ -5,7 +5,6 @@
5
5
  class="cpSelectableButton"
6
6
  :class="dynamicClasses"
7
7
  :disabled="disabled"
8
- role="button"
9
8
  type="button"
10
9
  @click="emit('click', $event)"
11
10
  >
@@ -135,7 +134,6 @@ const dynamicClasses = computed(() => {
135
134
  var(--cp-selectable-box-shadow),
136
135
  0 0 0 var(--cp-dimensions-0_25) var(--cp-selectable-border-color-hover);
137
136
  color: var(--cp-selectable-text-color-hover);
138
- transform: translateY(var(--cp-dimensions-minus-0_25));
139
137
 
140
138
  & > .cpSelectableButton__body {
141
139
  background-color: var(--cp-selectable-body-background-color-hover);
@@ -143,7 +141,7 @@ const dynamicClasses = computed(() => {
143
141
  }
144
142
 
145
143
  &:active:not(.cpSelectableButton--isDisabled) {
146
- transform: translateY(var(--cp-dimensions-0_25));
144
+ transform: scale3d(0.97, 0.97, 1);
147
145
  }
148
146
 
149
147
  &__icon i,
@@ -5,7 +5,6 @@
5
5
  :aria-labelledby="uniqueId"
6
6
  class="cpTable__container"
7
7
  :class="containerClasses"
8
- role="region"
9
8
  tabindex="0"
10
9
  >
11
10
  <table class="cpTable__table">
package/vite.config.js ADDED
@@ -0,0 +1,62 @@
1
+ import vue from '@vitejs/plugin-vue'
2
+ import path from 'path'
3
+ import { defineConfig } from 'vite'
4
+ import dts from 'vite-plugin-dts'
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+ plugins: [
9
+ vue(),
10
+ dts({
11
+ tsconfigPath: path.resolve(__dirname, 'tsconfig.build.json'),
12
+ // Types for the package root are resolved via package.json "types"
13
+ // pointing at dist/components/index.d.ts (library entry lives there).
14
+ insertTypesEntry: false,
15
+ }),
16
+ ],
17
+ resolve: {
18
+ alias: {
19
+ '@': path.resolve(__dirname, 'src'),
20
+ },
21
+ },
22
+ server: {
23
+ port: 8080,
24
+ },
25
+ css: {
26
+ preprocessorOptions: {
27
+ scss: {
28
+ additionalData: `
29
+ @use "sass:math";
30
+ @use '@/assets/styles/helpers/functions' as fn;
31
+ @use '@/assets/styles/helpers/mixins' as mx;
32
+ @use '@/assets/styles/utilities';`,
33
+ api: 'modern-compiler',
34
+ },
35
+ },
36
+ },
37
+ build: {
38
+ lib: {
39
+ entry: path.resolve(__dirname, 'src/components/index.ts'),
40
+ name: 'Pimp',
41
+ fileName: (format) => `pimp.${format}.js`,
42
+ cssFileName: 'style',
43
+ },
44
+ rollupOptions: {
45
+ // make sure to externalize deps that shouldn't be bundled
46
+ // into your library
47
+ external: ['vue'],
48
+ output: {
49
+ // Avoid emitting a separate chunk for dynamic imports (e.g. libphonenumber).
50
+ // A sibling chunk can declare top-level `var h` while the main entry imports
51
+ // `openBlock as h` from Vue; some downstream bundlers merge those scopes and
52
+ // hit "Identifier 'h' has already been declared".
53
+ codeSplitting: false,
54
+ // Provide global variables to use in the UMD build
55
+ // for externalized deps
56
+ globals: {
57
+ vue: 'Vue',
58
+ },
59
+ },
60
+ },
61
+ },
62
+ })
@@ -0,0 +1,20 @@
1
+ import path from 'path'
2
+ import { defineConfig } from 'vite'
3
+ import dts from 'vite-plugin-dts'
4
+
5
+ export default defineConfig({
6
+ plugins: [
7
+ dts({
8
+ tsconfigPath: path.resolve(__dirname, 'tsconfig.resolver.json'),
9
+ insertTypesEntry: false,
10
+ }),
11
+ ],
12
+ build: {
13
+ emptyOutDir: false,
14
+ lib: {
15
+ entry: path.resolve(__dirname, 'src/resolver.ts'),
16
+ fileName: () => 'resolver.js',
17
+ formats: ['es'],
18
+ },
19
+ },
20
+ })
@@ -7,9 +7,9 @@ const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(file
7
7
 
8
8
  // More info at: https://storybook.js.org/docs/writing-tests/test-addon
9
9
  export default defineWorkspace([
10
- 'vite.config.cjs',
10
+ 'vite.config.js',
11
11
  {
12
- extends: 'vite.config.cjs',
12
+ extends: 'vite.config.js',
13
13
  plugins: [
14
14
  // The plugin will run tests for the stories defined in your Storybook config
15
15
  // See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest