@energie360/ui-library 0.1.15 → 0.1.16

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 (35) hide show
  1. package/components/navigation-panel-tile/navigation-panel-tile.scss +1 -1
  2. package/components/navigation-panel-tile/u-navigation-panel-tile.vue +17 -13
  3. package/components/richtext/_wizard.scss +26 -0
  4. package/components/richtext/richtext.scss +2 -1
  5. package/elements/checkbox/checkbox.scss +150 -0
  6. package/elements/checkbox/u-checkbox.vue +42 -0
  7. package/elements/index.js +3 -0
  8. package/elements/radio/radio.scss +91 -2
  9. package/elements/radio/u-radio.vue +6 -3
  10. package/elements/radio-group/radio-group.scss +28 -0
  11. package/elements/radio-group/u-radio-group.vue +23 -3
  12. package/elements/select-chip/select-chip.scss +1 -0
  13. package/elements/select-chip/u-select-chip.vue +2 -2
  14. package/elements/select-chips/select-chips.scss +18 -0
  15. package/elements/select-chips/u-select-chips.vue +16 -3
  16. package/elements/select-tile/select-tile.scss +205 -0
  17. package/elements/select-tile/u-select-tile.vue +53 -0
  18. package/elements/select-tiles/select-tiles.scss +32 -0
  19. package/elements/select-tiles/u-select-tiles.vue +31 -0
  20. package/elements/text-field/u-text-field.vue +3 -1
  21. package/elements/toggle-switch/toggle-switch.scss +14 -4
  22. package/elements/toggle-switch/u-toggle-switch.vue +23 -20
  23. package/modules/index.js +3 -0
  24. package/modules/navigation-panel/navigation-panel.scss +1 -0
  25. package/modules/progress-indicator/progress-indicator.scss +84 -0
  26. package/modules/progress-indicator/u-progress-indicator.vue +34 -0
  27. package/modules/toast/toast-message.scss +67 -0
  28. package/modules/toast/toast.scss +14 -0
  29. package/modules/toast/u-toast-message.vue +46 -0
  30. package/modules/toast/u-toast.vue +26 -0
  31. package/modules/toast/useToast.ts +40 -0
  32. package/package.json +1 -1
  33. package/wizard/index.js +1 -0
  34. package/wizard/wizard-outro/u-wizard-outro.vue +49 -0
  35. package/wizard/wizard-outro/wizard-outro.scss +56 -0
@@ -21,7 +21,7 @@
21
21
  }
22
22
  }
23
23
 
24
- &.greyed:not(.disabled):not(:hover):not(.active) {
24
+ &.greyed:not(.disabled, :hover, .active) {
25
25
  background-color: var(--e-c-mono-50);
26
26
  border-color: var(--e-c-mono-200);
27
27
  }
@@ -2,20 +2,18 @@
2
2
  import { computed } from 'vue'
3
3
  import { UIcon } from '../../elements'
4
4
 
5
- enum IconBadge {
6
- Inactive = 'inactive',
7
- }
5
+ type IconBadge = 'inactive'
8
6
 
9
7
  interface Props {
10
- title: string
11
- description: string
12
- icon: string
13
- iconBadge?: IconBadge
14
- href?: string
15
- target?: string
16
8
  active?: boolean
17
- greyed?: boolean
9
+ description?: string
18
10
  disabled?: boolean
11
+ greyed?: boolean
12
+ href?: string
13
+ icon?: string
14
+ iconBadge?: IconBadge
15
+ target?: string
16
+ title?: string
19
17
  }
20
18
 
21
19
  const {
@@ -38,13 +36,19 @@ const tag = computed(() => (href ? 'a' : 'div'))
38
36
  >
39
37
  <div class="navigation-panel-tile__text-column">
40
38
  <div class="navigation-panel-tile__title">
41
- {{ title }}
39
+ <slot name="title">
40
+ {{ title }}
41
+ </slot>
42
+ </div>
43
+ <div class="navigation-panel-tile__description">
44
+ <slot name="description">
45
+ <div v-if="description" v-html="description" />
46
+ </slot>
42
47
  </div>
43
- <div class="navigation-panel-tile__description" v-html="description" />
44
48
  </div>
45
49
 
46
50
  <div class="navigation-panel-tile__icon-column">
47
- <div class="navigation-panel-tile__icon-wrapper">
51
+ <div v-if="icon" class="navigation-panel-tile__icon-wrapper">
48
52
  <span v-if="iconBadge" :class="['badge', iconBadge]" />
49
53
 
50
54
  <UIcon :name="icon" />
@@ -0,0 +1,26 @@
1
+ @use '../../base/abstracts' as a;
2
+
3
+ .richtext.richtext--wizard {
4
+ // Spacing rules
5
+ * + * {
6
+ margin-top: var(--e-spac-2);
7
+ }
8
+
9
+ * + h2,
10
+ * + h3,
11
+ * + .richtext__title-large,
12
+ * + .richtext__title-small {
13
+ margin-top: var(--e-space-6);
14
+ }
15
+
16
+ h2,
17
+ .richtext__title-large {
18
+ @include a.type(300, strong);
19
+
20
+ color: var(--e-c-mono-900);
21
+
22
+ @include a.bp(lg) {
23
+ @include a.type(200, strong);
24
+ }
25
+ }
26
+ }
@@ -1,4 +1,5 @@
1
- @use '../../base/abstracts/' as a;
1
+ @use '../../base/abstracts' as a;
2
+ @use './wizard';
2
3
 
3
4
  .richtext {
4
5
  // Spacing rules
@@ -0,0 +1,150 @@
1
+ @use '../../base/abstracts/' as a;
2
+
3
+ .checkbox {
4
+ &.disabled {
5
+ .checkbox__label {
6
+ color: var(--e-c-mono-500);
7
+ }
8
+ }
9
+
10
+ &.error {
11
+ .checkbox__label {
12
+ color: var(--e-c-signal-03-700);
13
+ }
14
+
15
+ .checkbox__input-icon::after {
16
+ border: 2px solid var(--e-c-signal-03-700);
17
+ }
18
+
19
+ .checkbox__error-text {
20
+ display: block;
21
+ }
22
+ }
23
+
24
+ &.checkbox--error {
25
+ .checkbox__error-text {
26
+ display: block;
27
+ }
28
+ }
29
+ }
30
+
31
+ .checkbox__wrapper {
32
+ display: flex;
33
+ align-items: flex-start;
34
+ flex-wrap: wrap;
35
+ column-gap: var(--e-space-1);
36
+ }
37
+
38
+ .checkbox__label {
39
+ @include a.type(200);
40
+
41
+ order: 2;
42
+ flex: 0 0 calc(100% - #{a.rem(34 + 4)});
43
+ padding-top: a.rem(5);
44
+ }
45
+
46
+ .checkbox__input {
47
+ z-index: 0;
48
+ order: 1;
49
+ position: relative;
50
+ width: a.rem(34);
51
+ height: a.rem(34);
52
+
53
+ input {
54
+ position: relative;
55
+ display: block;
56
+ width: 100%;
57
+ height: 100%;
58
+ border-radius: var(--e-brd-radius-1);
59
+
60
+ // States
61
+ &:hover:not(:disabled) + .checkbox__input-icon {
62
+ background-color: var(--e-c-mono-50);
63
+
64
+ &::after {
65
+ border-color: var(--e-c-primary-01-900);
66
+ }
67
+ }
68
+
69
+ &:active:not(:disabled) + .checkbox__input-icon {
70
+ background-color: var(--e-c-primary-01-50);
71
+ }
72
+
73
+ &:focus + .checkbox__input-icon {
74
+ &::after {
75
+ border-color: var(--e-c-primary-01-900);
76
+ }
77
+ }
78
+
79
+ &:checked + .checkbox__input-icon {
80
+ &::after {
81
+ border-color: var(--e-c-primary-01-900);
82
+ background-color: var(--e-c-primary-01-900);
83
+ }
84
+
85
+ svg {
86
+ position: relative;
87
+ z-index: 1;
88
+ fill: var(--e-c-mono-00);
89
+ }
90
+ }
91
+
92
+ &:disabled {
93
+ cursor: not-allowed;
94
+ }
95
+
96
+ &:disabled + .checkbox__input-icon {
97
+ &::after {
98
+ border-color: var(--e-c-mono-500);
99
+ }
100
+ }
101
+
102
+ &:disabled:checked + .checkbox__input-icon {
103
+ &::after {
104
+ background-color: var(--e-c-mono-500);
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ .checkbox__error-text {
111
+ @include a.type(50, strong);
112
+
113
+ order: 3;
114
+ display: none;
115
+ margin-top: var(--e-space-1);
116
+ padding-left: a.rem(34 + 4);
117
+ color: var(--e-c-signal-03-700);
118
+ }
119
+
120
+ .checkbox__input-icon {
121
+ z-index: -1;
122
+ position: absolute;
123
+ inset: 0;
124
+ border-radius: 100%;
125
+ background-color: transparent;
126
+ padding: a.rem(8);
127
+ transition: background-color var(--e-trs-duration-faster) var(--e-trs-easing-default);
128
+
129
+ svg {
130
+ display: block;
131
+ fill: transparent;
132
+ transition: fill var(--e-trs-duration-faster) var(--e-trs-easing-default);
133
+ }
134
+
135
+ &::after {
136
+ content: '';
137
+ position: absolute;
138
+ display: block;
139
+ top: 50%;
140
+ left: 50%;
141
+ transform: translate(-50%, -50%);
142
+ width: a.rem(18);
143
+ height: a.rem(18);
144
+ border: 2px solid var(--e-c-mono-700);
145
+ border-radius: var(--e-brd-radius-1);
146
+ transition:
147
+ border var(--e-trs-duration-faster) var(--e-trs-easing-default),
148
+ background var(--e-trs-duration-faster) var(--e-trs-easing-default);
149
+ }
150
+ }
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import { useId } from 'vue'
3
+
4
+ interface Props {
5
+ name: string
6
+ label?: string
7
+ error: boolean
8
+ disabled: boolean
9
+ errorMessage?: string
10
+ }
11
+
12
+ const { errorMessage = '' } = defineProps<Props>()
13
+
14
+ const model = defineModel<boolean>()
15
+ const cId = `checkbox-${useId()}`
16
+ </script>
17
+
18
+ <template>
19
+ <div :class="['checkbox', { disabled, error }]">
20
+ <div class="checkbox__wrapper">
21
+ <label :for="cId" class="checkbox__label">
22
+ <slot name="label">{{ label }}</slot>
23
+ </label>
24
+
25
+ <div class="checkbox__input">
26
+ <input :id="cId" v-model="model" type="checkbox" :name :disabled v-bind="$attrs" />
27
+
28
+ <div class="checkbox__input-icon">
29
+ <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
30
+ <path d="m7 14.42-5-5 1.41-1.41L7 11.59 14.59 4 16 5.42l-9 9Z" />
31
+ </svg>
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="checkbox__error-text">
37
+ <slot name="error-message">{{ errorMessage }}</slot>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <style scoped lang="scss" src="./checkbox.scss"></style>
package/elements/index.js CHANGED
@@ -19,3 +19,6 @@ export { default as USpectro } from './spectro/u-spectro.vue'
19
19
  export { default as UTextField } from './text-field/u-text-field.vue'
20
20
  export { default as UTextarea } from './textarea/u-textarea.vue'
21
21
  export { default as UToggleSwitch } from './toggle-switch/u-toggle-switch.vue'
22
+ export { default as UCheckbox } from './checkbox/u-checkbox.vue'
23
+ export { default as USelectTile } from './select-tile/u-select-tile.vue'
24
+ export { default as USelectTiles } from './select-tiles/u-select-tiles.vue'
@@ -1,7 +1,96 @@
1
+ @use '../../base/abstracts/' as a;
2
+
1
3
  .radio {
2
- display: block;
4
+ @include a.type(200);
5
+
6
+ display: inline-flex;
7
+ position: relative;
8
+ column-gap: var(--e-space-1);
9
+ align-items: center;
10
+
11
+ &:hover:not(.disabled) {
12
+ .radio__icon::before {
13
+ background-color: var(--e-c-primary-01-50);
14
+ }
15
+
16
+ .radio__icon::after {
17
+ border-color: var(--e-c-secondary-01-900);
18
+ }
19
+ }
20
+
21
+ &.disabled {
22
+ pointer-events: none;
23
+ color: var(--e-c-mono-500);
24
+ }
3
25
  }
4
26
 
5
27
  .radio__control {
6
- appearance: radio;
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ width: a.rem(40);
32
+ height: a.rem(40);
33
+ border-radius: 100%;
34
+
35
+ &:focus + .radio__icon {
36
+ &::before {
37
+ background-color: var(--e-c-primary-01-50);
38
+ }
39
+ }
40
+
41
+ &:active + .radio__icon {
42
+ &::before {
43
+ background-color: var(--e-c-primary-01-100);
44
+ }
45
+ }
46
+
47
+ &:checked + .radio__icon {
48
+ &::after {
49
+ border-color: var(--e-c-secondary-01-900);
50
+ border-width: 5px;
51
+ }
52
+ }
53
+
54
+ &:disabled {
55
+ pointer-events: none;
56
+
57
+ + .radio__icon::after {
58
+ border-color: var(--e-c-mono-200);
59
+ }
60
+
61
+ &:checked + .radio__icon::after {
62
+ border-width: 2px;
63
+ background-color: var(--e-c-mono-200);
64
+ box-shadow: 0 0 0 3px var(--e-c-mono-00) inset;
65
+ }
66
+ }
67
+ }
68
+
69
+ .radio__icon {
70
+ position: relative;
71
+ display: inline-block;
72
+ width: a.rem(40);
73
+ height: a.rem(40);
74
+ line-height: 1;
75
+ vertical-align: middle;
76
+
77
+ &::before {
78
+ content: '';
79
+ position: absolute;
80
+ inset: 0;
81
+ border-radius: 100%;
82
+ transition: background a.$trs-default;
83
+ }
84
+
85
+ &::after {
86
+ content: '';
87
+ position: absolute;
88
+ top: calc(50% - #{a.rem(10)});
89
+ left: calc(50% - #{a.rem(10)});
90
+ width: a.rem(20);
91
+ height: a.rem(20);
92
+ border-radius: 100%;
93
+ border: 2px solid var(--e-c-mono-900);
94
+ transition: border a.$trs-default;
95
+ }
7
96
  }
@@ -16,8 +16,7 @@ const { onChange } = useRadio({ model })
16
16
  </script>
17
17
 
18
18
  <template>
19
- <div class="radio">
20
- <label>{{ label }}</label>
19
+ <label :class="['radio', { checked: model === value, disabled }]">
21
20
  <input
22
21
  v-model="model"
23
22
  class="radio__control"
@@ -27,7 +26,11 @@ const { onChange } = useRadio({ model })
27
26
  :disabled
28
27
  @change="onChange"
29
28
  />
30
- </div>
29
+
30
+ <span class="radio__icon"></span>
31
+
32
+ <span>{{ label }}</span>
33
+ </label>
31
34
  </template>
32
35
 
33
36
  <style lang="scss" src="./radio.scss"></style>
@@ -1,3 +1,31 @@
1
+ @use '../../base/abstracts/' as a;
2
+
1
3
  .radio-group {
2
4
  display: block;
5
+
6
+ &.error {
7
+ .radio-group__error-message {
8
+ display: block;
9
+ }
10
+ }
11
+ }
12
+
13
+ .radio-group__title {
14
+ @include a.type(200, strong);
15
+
16
+ margin-bottom: var(--e-space-3);
17
+ }
18
+
19
+ .radio-group__items {
20
+ display: flex;
21
+ flex-wrap: wrap;
22
+ grid-gap: var(--e-space-3) var(--e-space-10);
23
+ }
24
+
25
+ .radio-group__error-message {
26
+ @include a.type(50, strong);
27
+
28
+ display: none;
29
+ margin-top: var(--e-space-1);
30
+ color: var(--e-c-signal-03-700);
3
31
  }
@@ -1,15 +1,35 @@
1
1
  <script setup lang="ts">
2
2
  import { useRadioGroup } from './radio-group-composables'
3
3
 
4
+ interface Props {
5
+ title?: string
6
+ error?: boolean
7
+ errorMessage?: string
8
+ }
9
+
10
+ defineProps<Props>()
11
+
4
12
  const model = defineModel<string>()
5
13
 
6
14
  useRadioGroup({ model })
7
15
  </script>
8
16
 
9
17
  <template>
10
- <div class="radio-group">
11
- <slot></slot>
12
- </div>
18
+ <fieldset :class="['radio-group', { error }]">
19
+ <legend v-if="title" class="radio-group__title">
20
+ <h3>
21
+ <slot name="title">{{ title }}</slot>
22
+ </h3>
23
+ </legend>
24
+
25
+ <div class="radio-group__items">
26
+ <slot></slot>
27
+ </div>
28
+
29
+ <div class="radio-group__error-message">
30
+ <slot name="error-message">{{ errorMessage }}</slot>
31
+ </div>
32
+ </fieldset>
13
33
  </template>
14
34
 
15
35
  <style lang="scss" src="./radio-group.scss"></style>
@@ -14,5 +14,6 @@
14
14
  position: absolute;
15
15
  inset: 0;
16
16
  cursor: pointer;
17
+ border-radius: 24px;
17
18
  }
18
19
  }
@@ -29,7 +29,7 @@ const classes = computed(() =>
29
29
  <template>
30
30
  <div class="select-chip">
31
31
  <label :class="classes" class="select-chip__button button">
32
- <UIcon v-if="model === value" name="mini-check"></UIcon>
32
+ <UIcon v-if="model === value" name="mini-check" />
33
33
  {{ label }}
34
34
 
35
35
  <slot>
@@ -39,6 +39,6 @@ const classes = computed(() =>
39
39
  </div>
40
40
  </template>
41
41
 
42
- <style lang="scss">
42
+ <style scoped lang="scss">
43
43
  @use './select-chip.scss';
44
44
  </style>
@@ -1,5 +1,23 @@
1
+ @use '../../base/abstracts/' as a;
2
+
1
3
  .select-chips {
4
+ &.error {
5
+ .select-chips__error-message {
6
+ display: block;
7
+ }
8
+ }
9
+ }
10
+
11
+ .select-chips__items {
2
12
  display: flex;
3
13
  flex-wrap: wrap;
4
14
  gap: var(--e-space-6);
5
15
  }
16
+
17
+ .select-chips__error-message {
18
+ @include a.type(50, strong);
19
+
20
+ display: none;
21
+ margin-top: var(--e-space-1);
22
+ color: var(--e-c-signal-03-700);
23
+ }
@@ -1,6 +1,13 @@
1
1
  <script setup lang="ts">
2
2
  import { useRadioGroup } from '../radio-group/radio-group-composables'
3
3
 
4
+ interface Props {
5
+ error?: boolean
6
+ errorMessage?: string
7
+ }
8
+
9
+ defineProps<Props>()
10
+
4
11
  const model = defineModel<string>()
5
12
 
6
13
  useRadioGroup({
@@ -10,11 +17,17 @@ useRadioGroup({
10
17
  </script>
11
18
 
12
19
  <template>
13
- <div class="select-chips">
14
- <slot></slot>
20
+ <div :class="['select-chips', { error }]">
21
+ <div class="select-chips__items">
22
+ <slot></slot>
23
+ </div>
24
+
25
+ <div class="select-chips__error-message">
26
+ <slot name="error-message">{{ errorMessage }}</slot>
27
+ </div>
15
28
  </div>
16
29
  </template>
17
30
 
18
- <style lang="scss">
31
+ <style scoped lang="scss">
19
32
  @use './select-chips.scss';
20
33
  </style>