@kvass/widgets 1.2.7 → 1.2.8

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/package.json +4 -1
  2. package/.github/workflows/semantic-release.yml +0 -21
  3. package/.prettierrc +0 -6
  4. package/.releaserc +0 -3
  5. package/index.html +0 -38
  6. package/src/contact/README.md +0 -80
  7. package/src/contact/api.js +0 -82
  8. package/src/contact/components/Checkbox.ce.vue +0 -127
  9. package/src/contact/components/Field.ce.vue +0 -156
  10. package/src/contact/components/Fieldset.ce.vue +0 -63
  11. package/src/contact/components/Form.ce.vue +0 -407
  12. package/src/contact/main.js +0 -9
  13. package/src/contact/utils.js +0 -14
  14. package/src/flatfinder/README.md +0 -58
  15. package/src/flatfinder/components/Flatfinder.ce.vue +0 -34
  16. package/src/flatfinder/main.js +0 -4
  17. package/src/font-selector/README.md +0 -60
  18. package/src/font-selector/components/FontSelector.ce.vue +0 -246
  19. package/src/font-selector/main.js +0 -4
  20. package/src/font-selector/providers.js +0 -48
  21. package/src/font-selector/selector.svg +0 -7
  22. package/src/img-comparison-slider/README.md +0 -69
  23. package/src/img-comparison-slider/components/ImgComparisonSlider.ce.vue +0 -139
  24. package/src/img-comparison-slider/main.js +0 -7
  25. package/src/map/README.md +0 -59
  26. package/src/map/components/Map.ce.vue +0 -66
  27. package/src/map/main.js +0 -4
  28. package/src/project-portal/App.ce.vue +0 -308
  29. package/src/project-portal/api.js +0 -48
  30. package/src/project-portal/assets/logo.png +0 -0
  31. package/src/project-portal/assets/map-pin-solid.svg +0 -1
  32. package/src/project-portal/components/Card.ce.vue +0 -110
  33. package/src/project-portal/components/Category.ce.vue +0 -87
  34. package/src/project-portal/components/CategorySelector.ce.vue +0 -43
  35. package/src/project-portal/components/ProjectTypeSelector.ce.vue +0 -70
  36. package/src/project-portal/main.js +0 -16
  37. package/src/project-portal/styles/_variables.scss +0 -19
  38. package/src/project-portal/styles/components/_card.scss +0 -178
  39. package/src/utils/index.js +0 -40
  40. package/src/vimeo/README.md +0 -58
  41. package/src/vimeo/components/Vimeo.ce.vue +0 -311
  42. package/src/vimeo/main.js +0 -4
  43. package/src/youtube/README.md +0 -58
  44. package/src/youtube/components/Youtube.ce.vue +0 -322
  45. package/src/youtube/main.js +0 -4
  46. package/vite.config.js +0 -51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvass/widgets",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -16,6 +16,9 @@
16
16
  "vue": "^3.4.15",
17
17
  "webfontloader": "^1.6.28"
18
18
  },
19
+ "files": [
20
+ "dist"
21
+ ],
19
22
  "devDependencies": {
20
23
  "@types/webfontloader": "^1.6.38",
21
24
  "@vitejs/plugin-vue": "^5.0.3",
@@ -1,21 +0,0 @@
1
- name: CI
2
- on:
3
- push:
4
- branches:
5
- - master
6
- jobs:
7
- deploy:
8
- runs-on: ubuntu-20.04
9
- steps:
10
- - uses: actions/checkout@v3
11
- - uses: actions/setup-node@v3
12
- with:
13
- node-version: '20'
14
- - name: Authenticate with private NPM package
15
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
16
- - run: npm install
17
- - name: Release
18
- env:
19
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
21
- run: npx semantic-release
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "tabWidth": 2,
4
- "trailingComma": "all",
5
- "semi": false
6
- }
package/.releaserc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "ci": false
3
- }
package/index.html DELETED
@@ -1,38 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="nb">
3
-
4
- <head>
5
- <meta charset="UTF-8" />
6
- <link rel="icon" type="image/svg+xml" href="favicon.svg" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
- <title>Kvass Web Components</title>
9
- </head>
10
-
11
- <body
12
- style="font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;">
13
- <!-- <kvass-contact
14
- account-url="https://local.kvass.test"
15
- label-subtitle="Ønsker du å motta vårt nyhetsbrev?"
16
- tags="Test side"
17
- upsell
18
- references="Residential:630f5c19ffd25600331dcd05"
19
- default-assignees="630f5c19ffd25600331dcc06,627181d6009b8f0022b09ac8"
20
- />
21
-
22
- <script type="module" src="/src/contact/main.js"></script> -->
23
-
24
- <!-- <kvass-img-comparison-slider
25
- first-image="https://assets.lastdodo.com/image/ld_medium/plain/assets/catalog/assets/2013/12/2/2/8/7/pdf_287e8674-5b0f-11e3-90d5-a6d2687aed80.jpg,First image"
26
- second-image="https://seeklogo.com/images/I/Ilguciema_Kvass-logo-227537F6D4-seeklogo.com.png,Second imanr bge"
27
- options="keyboard:disabled,direction:vertical"></kvass-img-comparison-slider>
28
-
29
- <script type="module" src="/src/img-comparison-slider/main.js"></script> -->
30
- <!-- <kvass-map coordinates="10.745,59.9123" address="Klokkergårdveien 5, 1711 Sarpsborg" show-address /> -->
31
- <!-- <kvass-flatfinder project-url="https://alvebergtunet.production.kvass.no" project-id="65a4f48ed1ba5cd61468f235"
32
- path-prefix="/residential" />
33
- <script type="module" src="/dist/flatfinder.js"></script> -->
34
- <kvass-font-selector></kvass-font-selector>
35
- <script type="module" src="/src/font-selector/main.js"></script>
36
- </body>
37
-
38
- </html>
@@ -1,80 +0,0 @@
1
- # kvass-contact
2
-
3
- A simple, embeddable Web Component for sending leads to Kvass.
4
-
5
- `https://unpkg.com/@kvass/widgets@latest/dist/contact.js`
6
-
7
- ## Develop
8
-
9
- To run in development mode, first install the neccessary packages.
10
-
11
- ```
12
- npm install
13
- ```
14
-
15
- Then, run in development mode.
16
-
17
- ```
18
- npm run dev
19
- ```
20
-
21
- Open `localhost:3000` in the browser of your choice, and you will see the form widget.
22
-
23
- ## Build
24
-
25
- To build the widget for production, run `build` instead of `dev`.
26
-
27
- ```
28
- npm run build
29
- ```
30
-
31
- To use the widget, use the `<kvass-contact />` element as shown here.
32
-
33
- ```html
34
- <kvass-contact account-url="https://example.kvass.no" />
35
- ```
36
-
37
- ## Props
38
-
39
- The component has several props for easy configuration.
40
-
41
- | Name | Type | Description | Default |
42
- | :--------------------- | :------ | :--------------------------------------------------------------------------------------- | :-------------------------------------- |
43
- | account-url `required` | String | Account URL where data will be sent. | |
44
- | references `required` | String | Comma-separated list of references in {type}:{id} format | |
45
- | default-assignees | String | Comma-separated list of userIds. Used as fallback assignees of the created task in Kvass | |
46
- | projects | String | Comma-separated list of project ids. If not defined, a selection field will show | |
47
- | tags | String | Comma-separated list of tags | |
48
- | upsell | Boolean | If `true`, shows a checkbox for upsell | `false` |
49
- | label-title | String | Title of the lead form | `"Meld interesse"` |
50
- | label-subtitle | String | Optional subtitle shown under form title | |
51
- | label-submit | String | Label for the submit button | `"Meld interesse"` |
52
- | privacy-url | String | Optional URL to privacy statement | `{accountUrl}/api/legal/privacy/tenant` |
53
- | label-success | String | Message displayed after submit | `"Takk for interessen!"` |
54
- | success-theme | String | Success theme, enums: ['default', 'overlay'] | `"default"` |
55
- | submit-timeout | Number | Delay on submit reset | `2000` |
56
-
57
- ## Styling
58
-
59
- The widget's styles are based on CSS custom properties, and can be overwritten.
60
- These are the available CSS variables.
61
-
62
- | Name | Description | Default |
63
- | :------------------------------- | :---------------------------------------------------------- | :------------ |
64
- | --kvass-contact-background | The form's background color | `#ffffff` |
65
- | --kvass-contact-spacing | Base spacing amount. Other amounts are calculated from this | `2rem` |
66
- | --kvass-contact-padding | Outer padding of the form element | `2rem` |
67
- | --kvass-contact-max-width | Max width of the form | `720px` |
68
- | --kvass-contact-border-radius | Base border-radius | `4px` |
69
- | --kvass-contact-border-color | Color of the borders of the form fields | `#eaeaea` |
70
- | --kvass-contact-border-width | Border-width for input fields | `1px` |
71
- | --kvass-contact-color | Base text color | `#222222` |
72
- | --kvass-contact-color-inverted | Inverted text color. Used for the submit button | `#ffffff` |
73
- | --kvass-contact-primary | Primary color. Used for submit button and form elements | `#1d56d8` |
74
- | --kvass-contact-error | Error color. Used for error states | `#d81d1d` |
75
- | --kvass-contact-grid-columns | Amount of columns in the form | `1` |
76
- | --kvass-contact-disabled | Background color on disabled button | `#eaeaea` |
77
- | --kvass-contact-input-background | Background color for input fields | `transparent` |
78
- | --kvass-contact-outline-width | Width of focus outline | `2px` |
79
- | --kvass-contact-outline-offset | Offset between the form control and its outline | `0px` |
80
- | --kvass-contact-checkbox-size | Size of checkboxes | `1em` |
@@ -1,82 +0,0 @@
1
- function createLead(url, data, projects, defaultAssignees) {
2
- if (projects && projects instanceof Array && projects.length) {
3
- return Promise.all(
4
- projects.map((p) => {
5
- let projectRef = { onModel: 'Project', ref: p }
6
- return createLead(url, {
7
- ...data,
8
- project: p,
9
- references: [projectRef, ...data.references],
10
- })
11
- }),
12
- )
13
- }
14
-
15
- if (!projects?.length && defaultAssignees?.length) {
16
- return createContact(
17
- url,
18
- { ...data.contact, assignees: defaultAssignees },
19
- data.comment,
20
- )
21
- }
22
-
23
- return fetch(`${url}/api/graphql`, {
24
- method: 'POST',
25
- headers: {
26
- 'Content-Type': 'application/json',
27
- },
28
- body: JSON.stringify({
29
- query: `
30
- mutation ($data: LeadCreate!) {
31
- LeadCreate(data: $data) {
32
- id
33
- }
34
- }
35
- `,
36
- variables: { data },
37
- }),
38
- }).then((res) => res.json())
39
- }
40
-
41
- function createContact(url, data, comment) {
42
- return fetch(`${url}/api/graphql`, {
43
- method: 'POST',
44
- headers: {
45
- 'Content-Type': 'application/json',
46
- },
47
- body: JSON.stringify({
48
- query: `
49
- mutation ($data: ContactInput!, $comment: String) {
50
- ContactCreate(data: $data, comment: $comment) {
51
- id
52
- }
53
- }
54
- `,
55
- variables: { data, comment },
56
- }),
57
- }).then((res) => res.json())
58
- }
59
-
60
- function getProjects(url) {
61
- return fetch(`${url}/api/graphql`, {
62
- method: 'POST',
63
- headers: {
64
- 'Content-Type': 'application/json',
65
- },
66
- body: JSON.stringify({
67
- query: `
68
- query {
69
- Projects {
70
- id
71
- name
72
- isPublished
73
- }
74
- }
75
- `,
76
- }),
77
- })
78
- .then((res) => res.json())
79
- .then((res) => res.data.Projects.filter((d) => d.isPublished))
80
- }
81
-
82
- export { createLead, createContact, getProjects }
@@ -1,127 +0,0 @@
1
- <script>
2
- export default {
3
- // disable attrs on root element
4
- inheritAttrs: false,
5
- }
6
- </script>
7
-
8
- <script setup>
9
- const emit = defineEmits(['update:modelValue'])
10
- const props = defineProps({
11
- modelValue: [Boolean, Array],
12
- state: String,
13
- label: String,
14
- })
15
-
16
- function onChange(ev) {
17
- if (typeof props.modelValue === 'boolean')
18
- return emit('update:modelValue', ev.target.checked)
19
- return emit(
20
- 'update:modelValue',
21
- ev.target.checked
22
- ? [...props.modelValue, props.state]
23
- : props.modelValue.filter((v) => v !== props.state),
24
- )
25
- }
26
- </script>
27
-
28
- <template>
29
- <label
30
- class="kvass-contact-checkbox"
31
- :class="[
32
- { 'kvass-contact-checkbox--required': 'required' in $attrs },
33
- $attrs.class,
34
- ]"
35
- >
36
- <input
37
- class="kvass-contact-checkbox__element"
38
- type="checkbox"
39
- v-bind="$attrs"
40
- :value="modelValue"
41
- :checked="$attrs.checked"
42
- @change="onChange"
43
- />
44
- <span class="kvass-contact-checkbox__label" v-html="label"></span>
45
- </label>
46
- </template>
47
-
48
- <style lang="scss">
49
- .kvass-contact-checkbox {
50
- display: flex;
51
- align-items: start;
52
- gap: 0.75rem;
53
- cursor: pointer;
54
-
55
- &__element {
56
- cursor: inherit;
57
-
58
- margin: 0;
59
- appearance: none;
60
- background-color: var(--kvass-contact-input-background);
61
- flex-shrink: 0;
62
-
63
- font: inherit;
64
- color: currentColor;
65
- width: var(
66
- --kvass-contact-checkbox-size,
67
- var(--kvass-contact-default-checkbox-size)
68
- );
69
- aspect-ratio: 1;
70
- border: var(
71
- --kvass-contact-checkbox-border-width,
72
- var(--kvass-contact-default-checkbox-border-width)
73
- )
74
- solid currentColor;
75
- border-radius: var(
76
- --kvass-contact-checkbox-border-radius,
77
- var(--kvass-contact-default-checkbox-border-radius)
78
- );
79
-
80
- &:focus-visible {
81
- outline: var(
82
- --kvass-contact-outline-width,
83
- var(--kvass-contact-default-outline-width)
84
- )
85
- solid var(--kvass-contact-color, var(--kvass-contact-default-color));
86
- outline-offset: var(
87
- --kvass-contact-outline-offset,
88
- var(--kvass-contact-default-outline-offset)
89
- );
90
- }
91
-
92
- &:checked {
93
- position: relative;
94
- background-color: var(
95
- --kvass-contact-primary,
96
- var(--kvass-contact-default-primary)
97
- );
98
- border-color: var(
99
- --kvass-contact-primary,
100
- var(--kvass-contact-default-primary)
101
- );
102
-
103
- &::before {
104
- content: '✓';
105
- font-size: 0.75em;
106
- position: absolute;
107
- top: 50%;
108
- left: 50%;
109
- translate: -50% -50%;
110
-
111
- color: var(
112
- --kvass-contact-color-inverted,
113
- var(--kvass-contact-default-color-inverted)
114
- );
115
- }
116
- }
117
- }
118
-
119
- &--required {
120
- span:after {
121
- content: '*';
122
- color: var(--kvass-contact-error, var(--kvass-contact-default-error));
123
- margin-left: 0.3rem;
124
- }
125
- }
126
- }
127
- </style>
@@ -1,156 +0,0 @@
1
- <script>
2
- export default {
3
- // disable attrs on root element
4
- inheritAttrs: false,
5
- }
6
- </script>
7
-
8
- <script setup>
9
- import { computed, ref } from 'vue';
10
-
11
- const emit = defineEmits(['update:modelValue'])
12
- const props = defineProps({
13
- modelValue: [String, Array],
14
- label: String,
15
- type: String,
16
- })
17
-
18
- const component = computed(() => {
19
- switch (props.type) {
20
- case 'textarea':
21
- return 'textarea'
22
- case 'select':
23
- return 'select'
24
- default:
25
- return 'input'
26
- }
27
- })
28
-
29
- const focused = ref(false)
30
- const blurred = ref(false)
31
-
32
- function onInput(event) {
33
- emit('update:modelValue', event.target.value)
34
- focused.value = true
35
- }
36
-
37
- function onBlur() {
38
- if (!focused.value) return
39
- blurred.value = true
40
- }
41
- </script>
42
-
43
- <template>
44
- <label
45
- class="kvass-contact-field"
46
- :class="[
47
- {
48
- 'kvass-contact-field--required': 'required' in $attrs,
49
- 'kvass-contact-field--focused': blurred,
50
- },
51
- $attrs.class,
52
- ]"
53
- :for="$attrs.id"
54
- >
55
- <span class="kvass-contact-field__label" v-if="label">{{ label }}</span>
56
- <component
57
- :is="component"
58
- class="kvass-contact-field__element"
59
- v-bind="$attrs"
60
- :value="modelValue"
61
- @input="onInput"
62
- @blur="onBlur"
63
- >
64
- <slot />
65
- </component>
66
- </label>
67
- </template>
68
-
69
- <style lang="scss">
70
- .kvass-contact-field {
71
- display: flex;
72
- flex-direction: column;
73
- gap: 0.3rem;
74
-
75
- &__label {
76
- margin-left: var(--kvass-contact-label-transform, 0);
77
- font-weight: var(--kvass-contact-label-weight, initial);
78
- }
79
-
80
- input {
81
- -webkit-appearance: none;
82
- }
83
-
84
- &__element {
85
- padding: calc(
86
- var(--kvass-contact-spacing, var(--kvass-contact-default-spacing)) / 2
87
- );
88
-
89
- padding-left: var(
90
- --kvass-contact-field-input-tranform,
91
- calc(
92
- var(--kvass-contact-spacing, var(--kvass-contact-default-spacing)) / 2
93
- )
94
- );
95
-
96
- border-radius: var(
97
- --kvass-contact-border-radius,
98
- var(--kvass-contact-default-border-radius)
99
- );
100
- border: var(
101
- --kvass-contact-border-width,
102
- var(--kvass-contact-default-border-width)
103
- )
104
- solid
105
- var(
106
- --kvass-contact-border-color,
107
- var(--kvass-contact-default-border-color)
108
- );
109
- resize: vertical;
110
- font: inherit;
111
- color: inherit;
112
- background-color: var(
113
- --kvass-contact-input-background,
114
- var(--kvass-contact-default-input-background)
115
- );
116
-
117
- &:focus-visible {
118
- outline: var(
119
- --kvass-contact-outline-width,
120
- var(--kvass-contact-default-outline-width)
121
- )
122
- solid var(--kvass-contact-color, var(--kvass-contact-default-color));
123
-
124
- outline-offset: var(
125
- --kvass-contact-outline-offset,
126
- var(--kvass-contact-default-outline-offset)
127
- );
128
- }
129
- }
130
-
131
- &--required {
132
- .kvass-contact-field__label::after {
133
- content: '*';
134
- color: var(--kvass-contact-error, var(--kvass-contact-default-error));
135
- margin-left: 0.3rem;
136
- }
137
-
138
- &.kvass-contact-field--focused {
139
- .kvass-contact-field__element:invalid {
140
- border-color: var(
141
- --kvass-contact-error,
142
- var(--kvass-contact-default-error)
143
- );
144
- }
145
- }
146
- }
147
-
148
- &--full-width {
149
- grid-column-end: span
150
- var(
151
- --kvass-contact-grid-columns,
152
- var(--kvass-contact-default-grid-columns)
153
- );
154
- }
155
- }
156
- </style>
@@ -1,63 +0,0 @@
1
- <script setup>
2
- defineProps({
3
- label: String,
4
- })
5
- </script>
6
-
7
- <template>
8
- <fieldset class="kvass-contact-fieldset">
9
- <legend class="kvass-contact-fieldset__label" v-if="label">
10
- {{ label }}
11
- </legend>
12
- <slot />
13
- </fieldset>
14
- </template>
15
-
16
- <style lang="scss">
17
- .kvass-contact-fieldset {
18
- position: relative;
19
- display: flex;
20
- flex-direction: column;
21
- gap: calc(
22
- var(--kvass-contact-spacing, var(--kvass-contact-default-spacing)) / 4
23
- );
24
- margin: calc(
25
- var(--kvass-contact-spacing, var(--kvass-contact-default-spacing)) / 1.5
26
- )
27
- 0 0 0;
28
- padding: calc(
29
- var(--kvass-contact-spacing, var(--kvass-contact-default-spacing)) / 2
30
- );
31
- border-radius: var(
32
- --kvass-contact-border-radius,
33
- var(--kvass-contact-default-border-radius)
34
- );
35
- border: var(
36
- --kvass-contact-border-width,
37
- var(--kvass-contact-default-border-width)
38
- )
39
- solid
40
- var(--kvass-contact-border-color, var(--kvass-contact-default-border-color));
41
- font: inherit;
42
-
43
- &:focus-visible {
44
- outline: var(
45
- --kvass-contact-outline-width,
46
- var(--kvass-contact-default-outline-width)
47
- )
48
- solid var(--kvass-contact-color, var(--kvass-contact-default-color));
49
- outline-offset: var(
50
- --kvass-contact-outline-offset,
51
- var(--kvass-contact-default-outline-offset)
52
- );
53
- }
54
-
55
- &__label {
56
- margin: 0;
57
- padding: 0;
58
- position: absolute;
59
- top: -1.4rem;
60
- left: 0;
61
- }
62
- }
63
- </style>