@energie360/ui-library 0.1.0 → 0.1.2
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/base/_input-resets.scss +9 -3
- package/base/_resets.scss +5 -0
- package/base/abstracts/_mixins.scss +11 -5
- package/base/main-base.scss +1 -0
- package/components/accordion-item/accordion-item.scss +62 -0
- package/components/accordion-item/u-accordion-item.vue +44 -0
- package/components/card/card.scss +58 -0
- package/components/card/u-card.vue +26 -0
- package/components/card-header/card-header.scss +102 -0
- package/components/card-header/u-card-header.vue +51 -0
- package/components/card-hint/card-hint.scss +13 -0
- package/components/card-hint/u-card-hint.vue +23 -0
- package/components/card-price/card-price.scss +110 -0
- package/components/card-price/u-card-price.vue +47 -0
- package/components/card-table/card-table.scss +76 -0
- package/components/card-table/u-card-table.vue +77 -0
- package/components/card-toggle-switches/card-toggle-switches.scss +13 -0
- package/components/card-toggle-switches/u-card-toggle-switches.vue +30 -0
- package/components/collapsible/collapsible.scss +14 -0
- package/components/collapsible/u-collapsible.vue +81 -0
- package/components/collapsible-group/u-collapsible-group.vue +14 -0
- package/components/icon-teaser/icon-teaser.scss +58 -0
- package/components/icon-teaser/u-icon-teaser.vue +35 -0
- package/components/icon-teaser-group/icon-teaser-group.scss +10 -0
- package/components/icon-teaser-group/u-icon-teaser-group.vue +19 -0
- package/components/icon-text-block/{icon-text-block.vue → u-icon-text-block.vue} +11 -12
- package/components/index.js +14 -0
- package/components/language-nav/language-nav.scss +32 -0
- package/components/language-nav/u-language-nav.vue +27 -0
- package/components/panel/panel.scss +107 -0
- package/components/panel/u-panel.vue +48 -0
- package/components/progress-bar/progress-bar.scss +37 -0
- package/components/progress-bar/u-progress-bar.vue +21 -0
- package/components/richtext/richtext.scss +208 -0
- package/components/richtext/u-richtext.vue +21 -0
- package/components/table/cell-ctas.scss +12 -0
- package/components/table/cell-icon-group.scss +12 -0
- package/components/table/cell-icon-text.scss +22 -0
- package/components/table/cell-progress-bar.scss +23 -0
- package/components/table/table-cell.mixins.scss +60 -0
- package/components/table/table-cell.scss +24 -0
- package/components/table/table-header.scss +5 -0
- package/components/table/table-heading.scss +8 -0
- package/components/table/table-row.scss +20 -0
- package/components/table/table.scss +12 -0
- package/components/table/table.type.ts +31 -0
- package/components/table/u-cell-ctas.vue +28 -0
- package/components/table/u-cell-icon-group.vue +31 -0
- package/components/table/u-cell-icon-text.vue +23 -0
- package/components/table/u-cell-progress-bar.vue +22 -0
- package/components/table/u-table-cell.vue +37 -0
- package/components/table/u-table-header.vue +9 -0
- package/components/table/u-table-heading.vue +21 -0
- package/components/table/u-table-row.vue +17 -0
- package/components/table/u-table.vue +11 -0
- package/components/tooltip/dom.js +167 -0
- package/components/tooltip/popover.ts +208 -0
- package/components/tooltip/tooltip.scss +75 -0
- package/components/tooltip/u-tooltip.vue +72 -0
- package/components/tooltip/viewport.js +21 -0
- package/custom-elements.js +1 -0
- package/dist/base-style.css +409 -2
- package/dist/base-style.css.map +1 -0
- package/dist/elements/text-link.css +40 -0
- package/dist/elements/text-link.css.map +1 -0
- package/dist/layout/split.css +124 -0
- package/dist/layout/split.css.map +1 -0
- package/elements/button/_button-base.scss +1 -1
- package/elements/button/_button-filled-inverted.scss +3 -3
- package/elements/button/_button-filled.scss +3 -3
- package/elements/button/_button-outlined-inverted.scss +3 -3
- package/elements/button/_button-outlined.scss +3 -3
- package/elements/button/_button-plain.scss +3 -3
- package/elements/button/_button-secondary-outlined.scss +3 -3
- package/elements/button/button.js +2 -2
- package/elements/button/button.scss +1 -1
- package/elements/button/u-button.vue +41 -0
- package/elements/button-chip/button-chip.scss +83 -0
- package/elements/button-chip/u-button-chip.vue +45 -0
- package/elements/elements.js +35 -0
- package/elements/form-field/form-field-base.scss +141 -0
- package/elements/form-field/form-field-error.scss +20 -0
- package/elements/form-field/form-field-prefix-suffix.scss +80 -0
- package/elements/form-field/form-field-states.scss +59 -0
- package/elements/form-field/form-field.types.ts +8 -0
- package/elements/form-field/index.scss +4 -0
- package/elements/icon/icon.js +2 -2
- package/elements/icon/{icon.vue → u-icon.vue} +12 -18
- package/elements/icon-button/icon-button.js +2 -2
- package/elements/icon-button/{icon-button.vue → u-icon-button.vue} +14 -15
- package/elements/image/image.scss +3 -0
- package/elements/image/u-image.vue +17 -0
- package/elements/index.js +6 -31
- package/elements/loader/loader.js +2 -2
- package/elements/loader/{loader.vue → u-loader.vue} +6 -7
- package/elements/numeric-stepper/numeric-stepper.scss +110 -0
- package/elements/numeric-stepper/u-numeric-stepper.vue +135 -0
- package/elements/select/select.scss +32 -0
- package/elements/select/u-select.vue +130 -0
- package/elements/select-chip/select-chip.scss +18 -0
- package/elements/select-chip/u-select-chip.vue +50 -0
- package/elements/select-chips/select-chips.scss +5 -0
- package/elements/select-chips/u-select-chips.vue +23 -0
- package/elements/spectro/spectro.scss +10 -0
- package/elements/spectro/u-spectro.vue +11 -0
- package/elements/text-field/text-field.scss +30 -0
- package/elements/text-field/text-field.types.ts +6 -0
- package/elements/text-field/u-text-field.vue +180 -0
- package/elements/text-link/text-link.scss +57 -0
- package/elements/toggle-switch/toggle-switch-small.scss +40 -0
- package/elements/toggle-switch/toggle-switch.scss +149 -0
- package/elements/toggle-switch/u-toggle-switch.vue +68 -0
- package/elements/types.ts +19 -0
- package/env.d.ts +1 -0
- package/globals.js +1 -2
- package/helpers/transition-height.vue +39 -0
- package/i18n/i18n.ts +40 -0
- package/layout/grid/grid.mixin.scss +4 -11
- package/layout/grid/grid.scss +6 -7
- package/layout/split/split.scss +96 -0
- package/modules/footer/footer.scss +161 -0
- package/modules/footer/u-footer.vue +59 -0
- package/package.json +33 -13
- package/tsconfig.app.json +12 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +19 -0
- package/utility/elements/text-link.scss +1 -0
- package/utility/layout/split.scss +1 -0
- package/utility/utility-text.js +1 -0
- package/utils/object/deep-get.js +1 -2
- package/utils/translations/translate.js +13 -0
- package/{vite.config.js → vite.config.ts} +2 -1
- package/watch.js +27 -0
- package/wizard/index.js +4 -0
- package/wizard/wizard-intro/{wizard-intro.vue → u-wizard-intro.vue} +12 -9
- package/wizard/wizard-intro/wizard-intro.scss +4 -0
- package/wizard/wizard-layout/{wizard-layout-block.vue → u-wizard-layout-block.vue} +7 -5
- package/wizard/wizard-layout/{wizard-layout-element.vue → u-wizard-layout-element.vue} +1 -1
- package/wizard/wizard-layout/{wizard-layout.vue → u-wizard-layout.vue} +1 -1
- package/wizard/wizard-layout/wizard-layout.scss +6 -6
- package/dist/base-style.js +0 -2
- package/dist/base-style.js.map +0 -1
- package/dist/index.css +0 -1
- package/dist/index.js +0 -5194
- package/dist/index.js.map +0 -1
- package/elements/button/button.vue +0 -42
- package/index.js +0 -1
- /package/components/icon-text-block-group/{icon-text-block-group.vue → u-icon-text-block-group.vue} +0 -0
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
&.disabled:not(
|
|
33
|
-
&:disabled:not(
|
|
32
|
+
&.disabled:not(.loading),
|
|
33
|
+
&:disabled:not(.loading) {
|
|
34
34
|
background: none;
|
|
35
35
|
color: var(--e-c-mono-500);
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
&.loading {
|
|
44
44
|
.loader,
|
|
45
45
|
e-loader {
|
|
46
46
|
--dot-color: var(--e-c-secondary-01-700);
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
&:active,
|
|
22
|
-
|
|
22
|
+
&.loading {
|
|
23
23
|
background-color: transparent;
|
|
24
24
|
border-color: var(--e-c-secondary-02-200);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
&.disabled:not(
|
|
28
|
-
&:disabled:not(
|
|
27
|
+
&.disabled:not(.loading),
|
|
28
|
+
&:disabled:not(.loading) {
|
|
29
29
|
border-color: var(--e-c-mono-500);
|
|
30
30
|
background-color: transparent;
|
|
31
31
|
color: var(--e-c-mono-500);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement } from 'vue'
|
|
2
|
-
import Button from './button.vue'
|
|
2
|
+
import Button from './u-button.vue'
|
|
3
3
|
import customElementBaseStyle from '../../base/custom-element-base.scss?inline'
|
|
4
4
|
import styles from './button.scss?inline'
|
|
5
5
|
|
|
@@ -7,6 +7,6 @@ Button.styles = [customElementBaseStyle, styles]
|
|
|
7
7
|
|
|
8
8
|
export const ButtonElement = {
|
|
9
9
|
register: () => {
|
|
10
|
-
customElements.define('
|
|
10
|
+
customElements.define('u-button', defineCustomElement(Button))
|
|
11
11
|
},
|
|
12
12
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import UIcon from '../icon/u-icon.vue'
|
|
3
|
+
import ULoader from '../loader/u-loader.vue'
|
|
4
|
+
|
|
5
|
+
// TODO: use enums for variant prop.
|
|
6
|
+
interface ButtonProps {
|
|
7
|
+
label?: string
|
|
8
|
+
loading?: boolean
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
icon?: string
|
|
11
|
+
href?: string
|
|
12
|
+
target?: string
|
|
13
|
+
variant?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
defineProps<ButtonProps>()
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<template v-if="href">
|
|
21
|
+
<a :class="['button', variant]" :href :target>
|
|
22
|
+
<UIcon v-if="icon" :name="icon"></UIcon>
|
|
23
|
+
<slot>{{ label }}</slot>
|
|
24
|
+
</a>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<template v-else>
|
|
28
|
+
<button :class="['button', variant, { loading: loading }]" :disabled="disabled || null">
|
|
29
|
+
<UIcon v-if="icon" :name="icon" />
|
|
30
|
+
<slot>{{ label }}</slot>
|
|
31
|
+
|
|
32
|
+
<span v-if="loading" class="button__loader">
|
|
33
|
+
<ULoader />
|
|
34
|
+
</span>
|
|
35
|
+
</button>
|
|
36
|
+
</template>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<style lang="scss" scoped>
|
|
40
|
+
@use './button.scss';
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
@mixin button-chip-normal {
|
|
4
|
+
color: var(--e-c-primary-01-900);
|
|
5
|
+
background-color: var(--e-c-primary-01-100);
|
|
6
|
+
|
|
7
|
+
&:hover {
|
|
8
|
+
color: var(--e-c-secondary-01-950);
|
|
9
|
+
background-color: var(--e-c-primary-01-200);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:active {
|
|
13
|
+
color: var(--e-c-primary-01-900);
|
|
14
|
+
background-color: var(--e-c-primary-01-100);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:disabled {
|
|
18
|
+
color: var(--e-c-mono-700);
|
|
19
|
+
background-color: var(--e-c-mono-200);
|
|
20
|
+
cursor: not-allowed;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin button-chip-inverted {
|
|
25
|
+
color: var(--e-c-mono-00);
|
|
26
|
+
background-color: var(--e-c-secondary-01-950);
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
background-color: var(--e-c-secondary-01-1000);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:disabled {
|
|
33
|
+
color: var(--e-c-mono-700);
|
|
34
|
+
background-color: var(--e-c-mono-200);
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@mixin button-chip-minified {
|
|
40
|
+
&:not(.inverted) {
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
padding: a.rem(6);
|
|
45
|
+
|
|
46
|
+
.icon {
|
|
47
|
+
margin-left: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.button-chip__label {
|
|
51
|
+
@include a.visually-hidden;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.button-chip {
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
padding: a.rem(6) a.rem(16);
|
|
59
|
+
column-gap: a.rem(4);
|
|
60
|
+
border-radius: 18px;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
transition:
|
|
63
|
+
background-color a.$trs-default,
|
|
64
|
+
color a.$trs-default;
|
|
65
|
+
|
|
66
|
+
.icon {
|
|
67
|
+
margin-left: a.rem(-10);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include a.bp(m) {
|
|
71
|
+
@include button-chip-minified;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@include button-chip-normal;
|
|
75
|
+
|
|
76
|
+
&.inverted {
|
|
77
|
+
@include button-chip-inverted;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.button-chip__label {
|
|
82
|
+
@include a.type(200, strong);
|
|
83
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import UIcon from '../icon/u-icon.vue'
|
|
3
|
+
|
|
4
|
+
enum ButtonChipVariant {
|
|
5
|
+
normal = 'normal',
|
|
6
|
+
inverted = 'inverted',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
variant?: ButtonChipVariant
|
|
11
|
+
label?: string
|
|
12
|
+
icon?: string
|
|
13
|
+
disabled?: boolean
|
|
14
|
+
href?: string
|
|
15
|
+
target?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { variant = ButtonChipVariant.normal } = defineProps<Props>()
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<template v-if="href">
|
|
23
|
+
<a :class="['button-chip', variant]" :href :target>
|
|
24
|
+
<UIcon v-if="icon" :name="icon"></UIcon>
|
|
25
|
+
|
|
26
|
+
<span class="button-chip__label"
|
|
27
|
+
><slot>{{ label }}</slot></span
|
|
28
|
+
>
|
|
29
|
+
</a>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<template v-else>
|
|
33
|
+
<button :class="['button-chip', variant]" :disabled>
|
|
34
|
+
<UIcon v-if="icon" :name="icon"></UIcon>
|
|
35
|
+
|
|
36
|
+
<span class="button-chip__label"
|
|
37
|
+
><slot>{{ label }}</slot></span
|
|
38
|
+
>
|
|
39
|
+
</button>
|
|
40
|
+
</template>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<style lang="scss" scoped>
|
|
44
|
+
@use './button-chip.scss';
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// All `elements` Custom Elements. Needs some refactoring.
|
|
2
|
+
|
|
3
|
+
import { ButtonElement as Button } from './button/button.js'
|
|
4
|
+
import { IconButtonElement as IconButton } from './icon-button/icon-button.js'
|
|
5
|
+
import { IconElement as Icon } from './icon/icon.js'
|
|
6
|
+
import { LoaderElement as Loader } from './loader/loader.js'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* These exports allow best tree-shaking behaviour.
|
|
10
|
+
* Obviously you'll have to import 'manually' all the elements you need.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { IconButton } from '@energie360/ui-library'
|
|
14
|
+
* IconButton.register()
|
|
15
|
+
*/
|
|
16
|
+
export { Button, IconButton, Icon, Loader }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* With this export you get all the elements. Meaning all the elements will be inlcuded in your bundle, even if you register only one element.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* import { Elements } from '@energie360/ui-library'
|
|
23
|
+
* Elements.Button.register()
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {{IconButton: {register: function(): void}, Button: {register: function(): void}, Loader: {register: function(): void}, Icon: {register: function(): void}}}
|
|
29
|
+
*/
|
|
30
|
+
export const Elements = {
|
|
31
|
+
Button,
|
|
32
|
+
IconButton,
|
|
33
|
+
Icon,
|
|
34
|
+
Loader,
|
|
35
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
@mixin form-field-base($el: input) {
|
|
4
|
+
.wrapper {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.label {
|
|
9
|
+
@include a.type(200);
|
|
10
|
+
|
|
11
|
+
z-index: 1;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 50%;
|
|
14
|
+
left: var(--e-space-3);
|
|
15
|
+
padding: 0 var(--e-space-1);
|
|
16
|
+
color: var(--e-c-mono-700);
|
|
17
|
+
transform: translateY(-50%);
|
|
18
|
+
background-color: var(--e-c-mono-00);
|
|
19
|
+
border-radius: var(--e-brd-radius-1);
|
|
20
|
+
transition:
|
|
21
|
+
top a.$trs-default,
|
|
22
|
+
left a.$trs-default,
|
|
23
|
+
font-size a.$trs-default,
|
|
24
|
+
color a.$trs-default,
|
|
25
|
+
line-height a.$trs-default;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.control {
|
|
29
|
+
position: relative;
|
|
30
|
+
|
|
31
|
+
#{$el} {
|
|
32
|
+
padding: var(--e-space-3) var(--e-space-4);
|
|
33
|
+
transition: box-shadow a.$trs-default;
|
|
34
|
+
width: 100%;
|
|
35
|
+
|
|
36
|
+
// This gives the focus-outline also a rounded border.
|
|
37
|
+
border-radius: var(--e-brd-radius-2);
|
|
38
|
+
|
|
39
|
+
@if $el == 'input' {
|
|
40
|
+
// For some reason `<input type="date">` adds more height.
|
|
41
|
+
// So we fix the height here.
|
|
42
|
+
height: a.rem(48);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@if $el == 'textarea' {
|
|
46
|
+
display: block;
|
|
47
|
+
min-height: a.rem(100);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.control-border {
|
|
53
|
+
z-index: -1;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
border-radius: var(--e-brd-radius-2);
|
|
61
|
+
border: 1px solid var(--e-c-mono-900);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.error-messages-container,
|
|
65
|
+
.help-text {
|
|
66
|
+
margin-top: var(--e-space-1);
|
|
67
|
+
padding-left: var(--e-space-4);
|
|
68
|
+
color: var(--e-c-mono-700);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.error-messages-container {
|
|
72
|
+
display: none;
|
|
73
|
+
color: var(--e-c-signal-03-700);
|
|
74
|
+
|
|
75
|
+
@include a.type(50, strong);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.help-text {
|
|
79
|
+
display: none;
|
|
80
|
+
|
|
81
|
+
@include a.type(50);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// STATES (Same for all input types)
|
|
85
|
+
&.float-label {
|
|
86
|
+
.label {
|
|
87
|
+
@include a.type(50);
|
|
88
|
+
|
|
89
|
+
top: a.rem(1);
|
|
90
|
+
color: var(--e-c-mono-900);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.control {
|
|
94
|
+
#{$el} {
|
|
95
|
+
color: var(--e-c-mono-900);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.show-help-text {
|
|
101
|
+
.help-text {
|
|
102
|
+
display: block;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.hover,
|
|
107
|
+
&.focus {
|
|
108
|
+
.control-border {
|
|
109
|
+
border: 2px solid var(--e-c-primary-01-900);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.focus.float-label {
|
|
114
|
+
.label {
|
|
115
|
+
color: var(--e-c-primary-01-900);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Layout Modifiers
|
|
120
|
+
&.layout-compact {
|
|
121
|
+
.label {
|
|
122
|
+
left: var(--e-space-2);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.error-messages-container,
|
|
126
|
+
.help-text {
|
|
127
|
+
padding-left: var(--e-space-3);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.control-border {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.control {
|
|
135
|
+
#{$el} {
|
|
136
|
+
height: a.rem(40);
|
|
137
|
+
padding: var(--e-space-2) var(--e-space-3) var(--e-space-2) var(--e-space-3);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@mixin form-field-error {
|
|
2
|
+
&.has-error,
|
|
3
|
+
&.has-error.float-label {
|
|
4
|
+
.label {
|
|
5
|
+
color: var(--e-c-signal-03-700);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.control-border {
|
|
9
|
+
border: 2px solid var(--e-c-signal-03-700);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.help-text {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.error-messages-container {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@use '../../base/abstracts' as a;
|
|
2
|
+
|
|
3
|
+
@mixin form-field-prefix-icon {
|
|
4
|
+
.prefix-icon {
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 50%;
|
|
7
|
+
left: var(--e-space-4);
|
|
8
|
+
transform: translateY(-50%);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&:has(.prefix-icon) {
|
|
12
|
+
.label {
|
|
13
|
+
left: var(--e-space-12);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.float-label {
|
|
17
|
+
.label {
|
|
18
|
+
left: var(--e-space-3);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.control input {
|
|
23
|
+
padding-left: var(--e-space-12);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// LAYOUT: compact
|
|
28
|
+
&.layout-compact {
|
|
29
|
+
.prefix-icon {
|
|
30
|
+
left: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:has(.prefix-icon) {
|
|
34
|
+
.control input {
|
|
35
|
+
padding-left: var(--e-space-8);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin form-field-suffix-icon {
|
|
42
|
+
.suffix-action,
|
|
43
|
+
.suffix-text,
|
|
44
|
+
.suffix-icon {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 50%;
|
|
47
|
+
right: var(--e-space-4);
|
|
48
|
+
transform: translateY(-50%);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.suffix-text {
|
|
52
|
+
@include a.type(200);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.suffix-icon {
|
|
56
|
+
color: var(--e-c-primary-01-700);
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.focus,
|
|
61
|
+
&.hover {
|
|
62
|
+
.suffix-icon {
|
|
63
|
+
color: var(--e-c-primary-01-900);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.has-error {
|
|
68
|
+
.suffix-icon {
|
|
69
|
+
color: var(--e-c-signal-03-700);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:has(.suffix-text),
|
|
74
|
+
&:has(.suffix-icon) {
|
|
75
|
+
// A suffix only makes sense for an <input>. That's why we select only input here.
|
|
76
|
+
.control input {
|
|
77
|
+
padding-right: var(--e-space-12);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@mixin form-field-required {
|
|
2
|
+
&.required {
|
|
3
|
+
.optional-text {
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@mixin form-field-disabled($el: input) {
|
|
10
|
+
&.disabled {
|
|
11
|
+
.control-border {
|
|
12
|
+
border-color: var(--e-c-mono-500);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.label {
|
|
16
|
+
color: var(--e-c-mono-500);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.control {
|
|
20
|
+
#{$el} {
|
|
21
|
+
color: var(--e-c-mono-500);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.error-messages-container,
|
|
26
|
+
.help-text {
|
|
27
|
+
color: var(--e-c-mono-500);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin form-field-readonly($el: input) {
|
|
33
|
+
&.readonly {
|
|
34
|
+
.control-border {
|
|
35
|
+
border-color: var(--e-c-mono-200);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.label {
|
|
39
|
+
color: var(--e-c-mono-700);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.control {
|
|
43
|
+
#{$el} {
|
|
44
|
+
color: var(--e-c-mono-700);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.error-messages-container,
|
|
49
|
+
.help-text {
|
|
50
|
+
color: var(--e-c-mono-700);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@mixin form-field-states-all($el: input) {
|
|
56
|
+
@include form-field-disabled($el);
|
|
57
|
+
@include form-field-readonly($el);
|
|
58
|
+
@include form-field-required;
|
|
59
|
+
}
|
package/elements/icon/icon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement } from 'vue'
|
|
2
|
-
import Icon from './icon.vue'
|
|
2
|
+
import Icon from './u-icon.vue'
|
|
3
3
|
import customElementBaseStyle from '../../base/custom-element-base.scss?inline'
|
|
4
4
|
import ceStyles from './icon.ce.scss?inline'
|
|
5
5
|
import styles from './icon.scss?inline'
|
|
@@ -8,6 +8,6 @@ Icon.styles = [customElementBaseStyle, ceStyles, styles]
|
|
|
8
8
|
|
|
9
9
|
export const IconElement = {
|
|
10
10
|
register: () => {
|
|
11
|
-
customElements.define('
|
|
11
|
+
customElements.define('u-icon', defineCustomElement(Icon))
|
|
12
12
|
},
|
|
13
13
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { ref } from 'vue'
|
|
3
3
|
import { assetsPath } from '../../globals.js'
|
|
4
4
|
|
|
5
|
+
interface Props {
|
|
6
|
+
name: string
|
|
7
|
+
inline?: boolean
|
|
8
|
+
width?: number
|
|
9
|
+
height?: number
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
/**
|
|
6
13
|
* Path prefix for icons.
|
|
7
14
|
*/
|
|
@@ -19,18 +26,12 @@ const svgPlaceholder = `
|
|
|
19
26
|
<svg width="24" height="24"></svg>
|
|
20
27
|
`
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
* @typedef { import('vue').Ref } Ref
|
|
24
|
-
*/
|
|
25
|
-
let svgContent = ref(svgPlaceholder)
|
|
29
|
+
const svgContent = ref(svgPlaceholder)
|
|
26
30
|
|
|
27
31
|
/**
|
|
28
32
|
* Fetches an icon from the assets folder. Or if already fecthed gets it from `iconMap`.
|
|
29
|
-
*
|
|
30
|
-
* @param {string} name - Icon name (without extension)
|
|
31
|
-
* @returns {Ref}
|
|
32
33
|
*/
|
|
33
|
-
const getIcon = (name) => {
|
|
34
|
+
const getIcon = (name: string): string => {
|
|
34
35
|
// Check if icon has already been fetched.
|
|
35
36
|
if (iconMap.has(name)) {
|
|
36
37
|
svgContent.value = iconMap.get(name)
|
|
@@ -57,20 +58,13 @@ const getIcon = (name) => {
|
|
|
57
58
|
return svgContent.value
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
defineProps(
|
|
61
|
-
name: String,
|
|
62
|
-
inline: Boolean,
|
|
63
|
-
width: Number,
|
|
64
|
-
height: Number,
|
|
65
|
-
})
|
|
61
|
+
defineProps<Props>()
|
|
66
62
|
</script>
|
|
67
63
|
|
|
68
64
|
<template>
|
|
69
65
|
<svg
|
|
70
66
|
aria-hidden="true"
|
|
71
|
-
:style="
|
|
72
|
-
width && height ? { width: width + 'px', height: height + 'px' } : false
|
|
73
|
-
"
|
|
67
|
+
:style="width && height ? { width: width + 'px', height: height + 'px' } : false"
|
|
74
68
|
:class="['icon', { 'icon-inline': inline }]"
|
|
75
69
|
v-html="getIcon(name)"
|
|
76
70
|
></svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineCustomElement } from 'vue'
|
|
2
|
-
import IconButton from './icon-button.vue'
|
|
2
|
+
import IconButton from './u-icon-button.vue'
|
|
3
3
|
import customElementBaseStyle from '../../base/custom-element-base.scss?inline'
|
|
4
4
|
import styles from './icon-button.scss?inline'
|
|
5
5
|
|
|
@@ -7,6 +7,6 @@ IconButton.styles = [customElementBaseStyle, styles]
|
|
|
7
7
|
|
|
8
8
|
export const IconButtonElement = {
|
|
9
9
|
register: () => {
|
|
10
|
-
customElements.define('
|
|
10
|
+
customElements.define('u-icon-button', defineCustomElement(IconButton))
|
|
11
11
|
},
|
|
12
12
|
}
|