@open-dcp/vue-styles 0.0.1 → 0.2.1

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,14 +1,103 @@
1
1
  {
2
2
  "name": "@open-dcp/vue-styles",
3
- "version": "0.0.1",
4
- "description": "Package to initialize the Package",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
3
+ "version": "0.2.1",
4
+ "main": "dist/index.css",
5
+ "style": "dist/index.css",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.css",
9
+ "default": "./dist/index.css"
10
+ },
11
+ "./scss": {
12
+ "import": "./src/index.scss",
13
+ "default": "./src/index.scss"
14
+ },
15
+ "./scss/button": {
16
+ "import": "./src/components/button.scss",
17
+ "default": "./src/components/button.scss"
18
+ },
19
+ "./scss/dropdown": {
20
+ "import": "./src/components/dropdown.scss",
21
+ "default": "./src/components/dropdown.scss"
22
+ },
23
+ "./scss/input": {
24
+ "import": "./src/components/input.scss",
25
+ "default": "./src/components/input.scss"
26
+ },
27
+ "./scss/gxp-status": {
28
+ "import": "./src/components/gxp-status.scss",
29
+ "default": "./src/components/gxp-status.scss"
30
+ },
31
+ "./scss/form-group": {
32
+ "import": "./src/components/form-group.scss",
33
+ "default": "./src/components/form-group.scss"
34
+ },
35
+ "./scss/form-array": {
36
+ "import": "./src/components/form-array.scss",
37
+ "default": "./src/components/form-array.scss"
38
+ },
39
+ "./scss/form-generator": {
40
+ "import": "./src/components/form-generator.scss",
41
+ "default": "./src/components/form-generator.scss"
42
+ },
43
+ "./css/button": {
44
+ "import": "./dist/components/button.css",
45
+ "default": "./dist/components/button.css"
46
+ },
47
+ "./css/dropdown": {
48
+ "import": "./dist/components/dropdown.css",
49
+ "default": "./dist/components/dropdown.css"
50
+ },
51
+ "./css/input": {
52
+ "import": "./dist/components/input.css",
53
+ "default": "./dist/components/input.css"
54
+ },
55
+ "./css/gxp-status": {
56
+ "import": "./dist/components/gxp-status.css",
57
+ "default": "./dist/components/gxp-status.css"
58
+ },
59
+ "./css/form-group": {
60
+ "import": "./dist/components/form-group.css",
61
+ "default": "./dist/components/form-group.css"
62
+ },
63
+ "./css/form-array": {
64
+ "import": "./dist/components/form-array.css",
65
+ "default": "./dist/components/form-array.css"
66
+ },
67
+ "./css/form-generator": {
68
+ "import": "./dist/components/form-generator.css",
69
+ "default": "./dist/components/form-generator.css"
70
+ },
71
+ "./scss/variables": {
72
+ "import": "./src/abstracts/variables.scss",
73
+ "default": "./src/abstracts/variables.scss"
74
+ }
8
75
  },
9
- "keywords": [
10
- "open-dcp"
76
+ "files": [
77
+ "dist",
78
+ "dist/components",
79
+ "src"
11
80
  ],
12
- "author": "Tobias Ladner",
13
- "license": "Apache-2.0"
81
+ "scripts": {
82
+ "start": "npm run dev",
83
+ "dev": "chokidar 'src/**/*.scss' -c 'npm run build'",
84
+ "build": "sass --load-path=node_modules --no-source-map src/index.scss dist/index.css && cp src/index.scss dist/index.scss && npm run build:components",
85
+ "build:components": "sass --load-path=node_modules --no-source-map src/components:dist/components"
86
+ },
87
+ "peerDependencies": {
88
+ "@open-dcp/styles": ">=0.1.27"
89
+ },
90
+ "dependencies": {
91
+ "sass": "^1.83.0"
92
+ },
93
+ "devDependencies": {
94
+ "chokidar-cli": "^3.0.0"
95
+ },
96
+ "repository": {
97
+ "type": "git",
98
+ "url": "https://github.com/Roche/dcp-pkg-fe-scss-vue-styles.git"
99
+ },
100
+ "publishConfig": {
101
+ "access": "public"
102
+ }
14
103
  }
@@ -0,0 +1,51 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ .dcp-input {
4
+ position: relative;
5
+
6
+ // Input field
7
+ input {
8
+ padding-left: 4px;
9
+ }
10
+
11
+ // Label
12
+ .v-label {
13
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
14
+ transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
15
+ text-transform: uppercase;
16
+ opacity: 1;
17
+ margin-left: 4px;
18
+ }
19
+
20
+ // Error message
21
+ .dcp-input__error-message {
22
+ font-size: $font-size-sm;
23
+ color: $danger-color;
24
+ margin-top: $spacer-half;
25
+ }
26
+
27
+ // Disabled state
28
+ &.disabled {
29
+ input {
30
+ background-color: $disabled-color;
31
+ cursor: not-allowed;
32
+ }
33
+
34
+ label {
35
+ color: $text-color-disabled;
36
+ }
37
+ }
38
+ }
39
+
40
+ .v-textarea {
41
+ textarea {
42
+ padding-left: 4px;
43
+ }
44
+ .v-label {
45
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
46
+ transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
47
+ text-transform: uppercase;
48
+ opacity: 1;
49
+ margin-left: 0;
50
+ }
51
+ }
@@ -0,0 +1,70 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ // Base Button Styles
4
+ .dcp-button {
5
+ display: inline-block;
6
+ padding: $button-padding;
7
+ font-size: $button-font-size;
8
+ border-radius: $button-border-radius;
9
+ text-align: center;
10
+ cursor: pointer;
11
+ border: none;
12
+ transition: background-color 0.2s ease, color 0.2s ease;
13
+ box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
14
+ }
15
+
16
+ // Disabled state for all buttons
17
+ .dcp-button:disabled,
18
+ .dcp-button[disabled],
19
+ .v-btn:disabled,
20
+ .v-btn[disabled],
21
+ .v-btn.v-btn--disabled,
22
+ .dcp-page-switcher button:disabled,
23
+ .dcp-page-switcher button[disabled] {
24
+ background: $disabled-color !important;
25
+ color: $text-color-disabled !important;
26
+ cursor: not-allowed !important;
27
+ opacity: 0.6;
28
+ box-shadow: none;
29
+ pointer-events: none;
30
+ }
31
+
32
+ .v-btn.v-btn--variant-flat {
33
+ color: #ffffff;
34
+ background: color-mix(in srgb, var(--dcp-branding-primary-color, #{$branding-primary-color}) 55%, white);
35
+ }
36
+
37
+ .v-btn {
38
+ letter-spacing: normal;
39
+
40
+ .v-btn__overlay {
41
+ background: transparent !important;
42
+ }
43
+
44
+ .v-ripple__animation {
45
+ background: rgba(0, 0, 0, .2);
46
+ }
47
+ }
48
+
49
+ .dcp-page-switcher {
50
+ button {
51
+ background: color-mix(in srgb, var(--dcp-branding-primary-color, #{$branding-primary-color}) 15%, white);
52
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
53
+ text-transform: uppercase;
54
+ font-size: 12px;
55
+ font-weight: bold;
56
+ padding: 0 32px;
57
+ border-radius: 0;
58
+ letter-spacing: normal;
59
+
60
+ &:first-of-type {
61
+ border-bottom-left-radius: 3px;
62
+ border-top-left-radius: 3px;
63
+ }
64
+
65
+ &:last-of-type {
66
+ border-bottom-right-radius: 3px;
67
+ border-top-right-radius: 3px;
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,33 @@
1
+ // Variables for customization
2
+ $card-bg: #fff !default;
3
+ $card-border: 1px solid #ddd !default;
4
+ $card-border-radius: 0.25rem !default;
5
+ $card-padding: 1rem !default;
6
+ $card-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !default;
7
+
8
+ // Card Styles
9
+ .dcp-card {
10
+ background-color: $card-bg;
11
+ border: $card-border;
12
+ border-radius: $card-border-radius;
13
+ padding: $card-padding;
14
+ box-shadow: $card-shadow;
15
+
16
+ .dcp-card-header {
17
+ font-size: 1.25rem;
18
+ font-weight: bold;
19
+ margin-bottom: 0.5rem;
20
+ }
21
+
22
+ .dcp-card-body {
23
+ font-size: 1rem;
24
+ margin-bottom: 0.5rem;
25
+ }
26
+
27
+ .dcp-card-footer {
28
+ font-size: 0.875rem;
29
+ color: #666;
30
+ border-top: 1px solid #eee;
31
+ padding-top: 0.5rem;
32
+ }
33
+ }
@@ -0,0 +1,59 @@
1
+ .dcp-chip {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ padding: 4px 8px;
5
+ font-size: 14px;
6
+ font-weight: 500;
7
+ background-color: #e0e0e0;
8
+ border-radius: 16px;
9
+ margin: 4px;
10
+ cursor: default;
11
+ transition: background-color 0.2s ease, box-shadow 0.2s ease;
12
+
13
+ &:hover {
14
+ background-color: #d6d6d6;
15
+ }
16
+
17
+ &.editable {
18
+ cursor: text;
19
+ }
20
+
21
+ &.removable:hover {
22
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
23
+ }
24
+
25
+ .chip-content {
26
+ flex: 1;
27
+ white-space: nowrap;
28
+ overflow: hidden;
29
+ text-overflow: ellipsis;
30
+ }
31
+
32
+ .chip-edit {
33
+ border: none;
34
+ outline: none;
35
+ background: transparent;
36
+ width: 100%;
37
+ font: inherit;
38
+ padding: 0;
39
+ margin: 0;
40
+ }
41
+
42
+ .chip-close {
43
+ margin-left: 8px;
44
+ background: none;
45
+ border: none;
46
+ font-size: 16px;
47
+ line-height: 1;
48
+ cursor: pointer;
49
+ color: #888;
50
+
51
+ &:hover {
52
+ color: #000;
53
+ }
54
+ }
55
+
56
+ .cursor-pointer {
57
+ cursor: pointer;
58
+ }
59
+ }
@@ -0,0 +1,49 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ // Dropdown Styles
4
+ .dcp-dropdown {
5
+ position: relative;
6
+ display: inline-block;
7
+
8
+ .dcp-dropdown-toggle {
9
+ cursor: pointer;
10
+ padding: $button-padding; // Using button padding for consistency
11
+ background-color: var(--dcp-branding-primary-color, #{$button-primary-bg});
12
+ color: $button-primary-color;
13
+ border: none;
14
+ border-radius: $button-border-radius;
15
+
16
+ &:hover {
17
+ background-color: color-mix(in srgb, var(--dcp-branding-primary-color, #{$button-primary-bg}) 90%, black);
18
+ }
19
+ }
20
+
21
+ .dcp-dropdown-menu {
22
+ position: absolute;
23
+ top: 100%;
24
+ left: 0;
25
+ z-index: 1000;
26
+ display: none; // Hidden by default
27
+ min-width: 200px;
28
+ background-color: $dropdown-bg;
29
+ border: $dropdown-border;
30
+ border-radius: $dropdown-border-radius;
31
+ box-shadow: $dropdown-shadow;
32
+ padding: 0.5rem 0;
33
+
34
+ &.show {
35
+ display: block; // Display when open
36
+ }
37
+
38
+ .dcp-dropdown-item {
39
+ padding: 0.5rem 1rem;
40
+ color: $text-color-dark; // Default text color
41
+ cursor: pointer;
42
+ text-decoration: none;
43
+
44
+ &:hover {
45
+ background-color: $dropdown-item-hover-bg;
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,82 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ $dcp-form-array-padding-left: 0 !default;
4
+ $dcp-form-array-padding-right: 0 !default;
5
+ $dcp-form-array-element-gap: 20px !default;
6
+ $dcp-form-array-element-padding-right: 20px !default;
7
+ $dcp-form-array-form-gap: 30px !default;
8
+ $dcp-form-array-form-grid-columns: repeat(auto-fit, 260px) !default;
9
+ $dcp-form-array-button-size: 36px !default;
10
+ $dcp-form-array-button-icon-size: 18px !default;
11
+ $dcp-form-array-error-margin-left: 20px !default;
12
+ $dcp-form-array-error-margin-right: auto !default;
13
+
14
+ .dcp-form_array {
15
+ display: block;
16
+ width: 100%;
17
+ padding-left: $dcp-form-array-padding-left;
18
+ padding-right: $dcp-form-array-padding-right;
19
+
20
+ .dcp-form_array_header {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ }
25
+
26
+ .dcp-form_array_element {
27
+ .dcp-form_array_element_header {
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: space-between;
31
+ flex-grow: 1;
32
+ padding-right: $dcp-form-array-element-padding-right;
33
+ }
34
+
35
+ .dcp-form_array_element_content {
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: flex-start;
39
+ gap: $dcp-form-array-element-gap;
40
+ flex-wrap: wrap;
41
+ width: 100%;
42
+ }
43
+ }
44
+
45
+ .dcp-form_array_form {
46
+ display: grid;
47
+ gap: $dcp-form-array-form-gap;
48
+ grid-template-columns: $dcp-form-array-form-grid-columns;
49
+ grid-template-rows: auto;
50
+ }
51
+
52
+ .dcp-form_array_button_remove {
53
+ button {
54
+ min-width: $dcp-form-array-button-size !important;
55
+ width: $dcp-form-array-button-size;
56
+ height: $dcp-form-array-button-size;
57
+ padding: 0 !important;
58
+ display: inline-flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+
62
+ .v-icon,
63
+ [class*="mdi-"] {
64
+ margin: 0;
65
+ width: $dcp-form-array-button-icon-size;
66
+ height: $dcp-form-array-button-icon-size;
67
+ font-size: $dcp-form-array-button-icon-size;
68
+ line-height: $dcp-form-array-button-icon-size;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ }
73
+ }
74
+ }
75
+
76
+ .dcp-form_array_error {
77
+ margin-left: $dcp-form-array-error-margin-left;
78
+ margin-right: $dcp-form-array-error-margin-right;
79
+ padding: 0 !important;
80
+ }
81
+ }
82
+
@@ -0,0 +1,32 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ $dcp-form-group-gap: $spacer !default;
4
+ $dcp-form-group-padding: $spacer !default;
5
+ $dcp-form-group-border-radius: 4px !default;
6
+ $dcp-form-group-section-gap: 12px !default;
7
+
8
+ .dcp-form_group {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: $dcp-form-group-section-gap;
12
+ width: 100%;
13
+
14
+ &--with-header {
15
+ background: rgb(var(--v-theme-surface, 255 255 255));
16
+ border-radius: $dcp-form-group-border-radius;
17
+ box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14);
18
+ padding: $dcp-form-group-padding;
19
+ }
20
+
21
+ &__header {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ }
26
+
27
+ &__content {
28
+ display: grid;
29
+ gap: $dcp-form-group-gap;
30
+ }
31
+ }
32
+
@@ -0,0 +1,41 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ // Mixin to handle sizes
4
+ @mixin size($height, $font-size, $line-height, $padding) {
5
+ height: $height;
6
+ font-size: $font-size;
7
+ line-height: $line-height;
8
+ padding-left: $padding;
9
+ padding-right: $padding;
10
+ }
11
+
12
+ .dcp-gxp-status {
13
+ color: $white;
14
+ border-radius: 5px;
15
+ font-weight: 700;
16
+ user-select: none;
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: center;
20
+
21
+ &.gxp {
22
+ background-color: $gxp-green;
23
+ }
24
+
25
+ &.non-gxp {
26
+ background-color: $gxp-red;
27
+ }
28
+
29
+ // Default size
30
+ @include size(1.5rem, 0.75rem, 1rem, 0.5rem);
31
+
32
+ // Modifier for small size
33
+ &--small {
34
+ @include size(1rem, 0.625rem, 0.875rem, 0.25rem);
35
+ }
36
+
37
+ // Modifier for large size
38
+ &--large {
39
+ @include size(2rem, 1rem, 1.25rem, 0.75rem);
40
+ }
41
+ }
@@ -0,0 +1,80 @@
1
+ @use '@open-dcp/styles/src/abstracts/variables' as *;
2
+
3
+ .dcp-input {
4
+ padding-bottom: 22px;
5
+
6
+ // Input field
7
+ input {
8
+ padding-left: 4px;
9
+ }
10
+
11
+ .v-field__outline {
12
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
13
+ }
14
+
15
+ &--required {
16
+ label:after, .v-label:after {
17
+ content: ' *';
18
+ }
19
+ }
20
+ // Label
21
+ .v-label {
22
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
23
+ transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
24
+ text-transform: uppercase;
25
+ opacity: 1;
26
+ margin-left: 4px;
27
+ }
28
+
29
+ // Error message
30
+ .dcp-input__error-message {
31
+ font-size: $font-size-sm;
32
+ color: $danger-color;
33
+ margin-top: $spacer-half;
34
+ position: absolute;
35
+ bottom: 0;
36
+ animation: animateErrorSlide 0.3s ease;
37
+ }
38
+
39
+ &.error {
40
+ .v-field__outline, label, .v-label.v-field-label {
41
+ color: $danger-color;
42
+ }
43
+ }
44
+
45
+ // Disabled state
46
+ &.disabled {
47
+ input {
48
+ background-color: $disabled-color;
49
+ cursor: not-allowed;
50
+ }
51
+
52
+ label {
53
+ color: $text-color-disabled;
54
+ }
55
+ }
56
+ }
57
+
58
+ .v-textarea {
59
+ textarea {
60
+ padding-left: 4px;
61
+ }
62
+ .v-label {
63
+ color: var(--dcp-branding-primary-color, #{$branding-primary-color});
64
+ transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
65
+ text-transform: uppercase;
66
+ opacity: 1;
67
+ margin-left: 0;
68
+ }
69
+ }
70
+
71
+ @keyframes animateErrorSlide {
72
+ 0% {
73
+ opacity: 0;
74
+ transform: translateY(-10px);
75
+ }
76
+ 100% {
77
+ opacity: 1;
78
+ transform: translateY(0);
79
+ }
80
+ }