@adyen/lume-vue3 0.6.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/dist/plugin.js ADDED
@@ -0,0 +1,43 @@
1
+ import { LumeAlluvialDiagram as i, LumeAlluvialGroup as o, LumeAxis as n, LumeBar as l, LumeBarChart as L, LumeBarGroup as p, LumeChart as s, LumeChartContainer as c, LumeChartLegend as f, LumeGroupedBarChart as _, LumeLine as h, LumeLineChart as C, LumeLineGroup as d, LumeOverlayGroup as B, LumePoint as g, LumeSingleBarChart as S, LumeSparklineChart as y, LumeStackedBarChart as G, LumeTooltip as $, LumeTooltipItem as b, LumeTooltipSummary as v, LumeTooltipTitle as O } from "./index.js";
2
+ import "vue";
3
+ import "d3";
4
+ import "@popperjs/core";
5
+ import "d3-sankey";
6
+ const r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7
+ __proto__: null,
8
+ LumeAlluvialDiagram: i,
9
+ LumeAlluvialGroup: o,
10
+ LumeAxis: n,
11
+ LumeBar: l,
12
+ LumeBarChart: L,
13
+ LumeBarGroup: p,
14
+ LumeChart: s,
15
+ LumeChartContainer: c,
16
+ LumeChartLegend: f,
17
+ LumeGroupedBarChart: _,
18
+ LumeLine: h,
19
+ LumeLineChart: C,
20
+ LumeLineGroup: d,
21
+ LumeOverlayGroup: B,
22
+ LumePoint: g,
23
+ LumeSingleBarChart: S,
24
+ LumeSparklineChart: y,
25
+ LumeStackedBarChart: G,
26
+ LumeTooltip: $,
27
+ LumeTooltipItem: b,
28
+ LumeTooltipSummary: v,
29
+ LumeTooltipTitle: O
30
+ }, Symbol.toStringTag, { value: "Module" })), u = (m) => {
31
+ if (!u.installed) {
32
+ u.installed = !0;
33
+ for (const a in r)
34
+ if (Object.prototype.hasOwnProperty.call(r, a)) {
35
+ const t = r[a];
36
+ m.component(a, t);
37
+ }
38
+ }
39
+ }, T = { install: u };
40
+ let e = null;
41
+ typeof window < "u" ? e = window.Vue : typeof global < "u" && (e = global.Vue);
42
+ e && e.use(T);
43
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["../../lib/src/plugin.ts"],"sourcesContent":["import { PluginFunction, PluginObject } from 'vue';\n\nimport * as components from './components';\n\ninterface LumePluginFunction extends PluginFunction<null> {\n installed?: boolean;\n}\n\nconst install: LumePluginFunction = (Vue) => {\n if (install.installed) return;\n install.installed = true;\n\n // Register components\n for (const prop in components) {\n if (Object.prototype.hasOwnProperty.call(components, prop)) {\n const component = components[prop];\n Vue.component(prop, component);\n }\n }\n};\n\nconst plugin: PluginObject<null> = { install };\n\n// Auto-install when vue is found (eg. in browser via <script> tag)\nlet GlobalVue = null;\nif (typeof window !== 'undefined') {\n GlobalVue = window.Vue;\n} else if (typeof global !== 'undefined') {\n GlobalVue = global.Vue;\n}\nif (GlobalVue) {\n GlobalVue.use(plugin);\n}\n\nexport default plugin;\n"],"names":["install","Vue","prop","components","component","plugin","GlobalVue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAQMA,IAA8B,CAACC,MAAQ;AAC3C,MAAI,CAAAD,EAAQ,WACZ;AAAA,IAAAA,EAAQ,YAAY;AAGpB,eAAWE,KAAQC;AACjB,UAAI,OAAO,UAAU,eAAe,KAAKA,GAAYD,CAAI,GAAG;AACpD,cAAAE,IAAYD,EAAWD,CAAI;AAC7B,QAAAD,EAAA,UAAUC,GAAME,CAAS;AAAA;AAAA;AAGnC,GAEMC,IAA6B,EAAE,SAAAL;AAGrC,IAAIM,IAAY;AACZ,OAAO,SAAW,MACpBA,IAAY,OAAO,MACV,OAAO,SAAW,QAC3BA,IAAY,OAAO;AAEjBA,KACFA,EAAU,IAAID,CAAM;"}
@@ -0,0 +1,14 @@
1
+ @use 'variables' as *;
2
+
3
+ $lume-chart-title-color: $lume-color-grey-100 !default;
4
+ $lume-axis-title-color: $lume-color-grey-80 !default;
5
+
6
+ .lume-chart-title {
7
+ color: $lume-chart-title-color;
8
+ margin: 0 0 1rem;
9
+ }
10
+
11
+ .lume-axis-title {
12
+ color: $lume-axis-title-color;
13
+ margin: 0;
14
+ }
@@ -0,0 +1,29 @@
1
+ @use 'variables/typography' as *;
2
+
3
+ .lume-typography--display {
4
+ font-family: $lume-font-family;
5
+ font-size: $lume-font-size-lg;
6
+ font-weight: $lume-font-weight-medium;
7
+ line-height: $lume-line-height-lg;
8
+ }
9
+
10
+ .lume-typography--body {
11
+ font-family: $lume-font-family;
12
+ font-size: $lume-font-size-md;
13
+ font-weight: $lume-font-weight-regular;
14
+ line-height: $lume-line-height-md;
15
+ }
16
+
17
+ .lume-typography--caption {
18
+ font-family: $lume-font-family;
19
+ font-size: $lume-font-size-sm;
20
+ font-weight: $lume-font-weight-regular;
21
+ line-height: $lume-line-height-sm;
22
+ }
23
+
24
+ .lume-typography--axis {
25
+ font-family: $lume-font-family;
26
+ font-size: $lume-font-size-xs;
27
+ font-weight: $lume-font-weight-medium;
28
+ line-height: $lume-line-height-xs;
29
+ }
@@ -0,0 +1,124 @@
1
+ @use 'sass:color';
2
+ @use 'sass:list';
3
+
4
+ @use 'variables' as *;
5
+ @use 'functions/colors' as *;
6
+
7
+ // Colors
8
+
9
+ //
10
+ //// Generates util classes for all color values (regular colors, color pairs):
11
+ //// .lume-background-color--{color}-{value}
12
+ //// .lume-fill--{color}-{value}
13
+ //// .lume-stroke--{color}-{value}
14
+ //
15
+ @each $property in (background-color, fill, stroke) {
16
+ // categorical colors
17
+ @include generate-color-classes($property, $lume-categorical-colors);
18
+
19
+ // sequential colors
20
+ @each $map in $lume-sequential-colors {
21
+ @include generate-color-classes($property, $map);
22
+ }
23
+
24
+ // divergent pairs
25
+ @each $map in $lume-divergent-colors {
26
+ @include generate-color-classes($property, $map);
27
+ }
28
+
29
+ // other colors
30
+ @include generate-color-classes($property, $lume-other-colors);
31
+ }
32
+
33
+ //
34
+ //// Covers primary colors & legacy colors
35
+ //// (e.g. .lume-background-color--skyblue, .lume-background-color--02)
36
+ //
37
+ .lume-background-color {
38
+ @each $name, $map in $lume-categorical-colors {
39
+ &--#{$name} {
40
+ background-color: nth($map, 1);
41
+ }
42
+ }
43
+
44
+ @each $color, $map in $lume-legacy-colors {
45
+ &--#{$color} {
46
+ background-color: nth($map, 1);
47
+ }
48
+ }
49
+ }
50
+
51
+ //
52
+ //// Covers primary colors & legacy colors
53
+ //// (e.g. .lume-stroke--skyblue, .lume-stroke--02)
54
+ //
55
+ .lume-stroke {
56
+ &--transparent {
57
+ stroke: $lume-color-grey-transparent;
58
+ opacity: 0;
59
+ }
60
+
61
+ @each $color, $map in $lume-legacy-colors {
62
+ &--#{$color} {
63
+ stroke: nth($map, 1);
64
+ }
65
+ }
66
+ }
67
+
68
+ //
69
+ //// Covers primary colors, variants & legacy colors
70
+ //// (e.g. .lume-fill--skyblue, .lume-fill--02)
71
+ //
72
+ .lume-fill {
73
+ $b: &;
74
+
75
+ &--overlay {
76
+ fill: $lume-color-grey-transparent;
77
+ }
78
+
79
+ &--negative {
80
+ fill: $lume-color-grey-10;
81
+ pointer-events: none;
82
+ }
83
+
84
+ &--none {
85
+ fill: none;
86
+ }
87
+
88
+ &--transparent {
89
+ fill: $lume-color-grey-transparent;
90
+ opacity: 0;
91
+ }
92
+
93
+ @each $name, $map in $lume-categorical-colors {
94
+ &--#{$name} {
95
+ fill: nth($map, 1);
96
+ }
97
+ }
98
+
99
+ @each $color, $map in $lume-legacy-colors {
100
+ &--#{$color} {
101
+ fill: nth($map, 1);
102
+
103
+ &#{$b}--faded {
104
+ fill: fade-color(nth($map, 1));
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ // Display
111
+
112
+ .u-display-flex {
113
+ display: flex !important;
114
+ }
115
+
116
+ // Size
117
+
118
+ .u-width-full {
119
+ width: 100% !important;
120
+ }
121
+
122
+ .u-height-full {
123
+ height: 100% !important;
124
+ }
@@ -0,0 +1,28 @@
1
+ @forward 'variables/colors';
2
+ @forward 'variables/spacing';
3
+ @forward 'variables/typography';
4
+
5
+ @use 'variables/colors' as *;
6
+ @use 'variables/spacing' as *;
7
+ @use 'variables/typography' as *;
8
+
9
+ // Border
10
+
11
+ $lume-border-width: 1px !default;
12
+ $lume-border-style: solid !default;
13
+ $lume-border-color: $lume-color-grey-20 !default;
14
+ $lume-border-radius-4: 4px !default;
15
+ $lume-border-radius-8: 8px !default;
16
+ $lume-border: $lume-border-width $lume-border-style $lume-border-color !default;
17
+
18
+ // Box-shadow
19
+
20
+ $lume-box-shadow: 0 $lume-spacing-8 $lume-spacing-16
21
+ rgba($lume-color-black, 0.1) !default;
22
+
23
+ // Transition
24
+
25
+ $lume-transition-time-short: 0.1s !default;
26
+ $lume-transition-time-medium: 0.2s !default;
27
+ $lume-transition-time-long: 0.3s !default;
28
+ $lume-transition-time-full: 1s !default;
@@ -0,0 +1,88 @@
1
+ @use '../variables' as *;
2
+
3
+ $lume-alluvial-text-color: $lume-color-grey-80;
4
+
5
+ $lume-alluvial-link-opacity: 0.5 !default;
6
+ $lume-alluvial-link-opacity-faded: 0.2 !default;
7
+
8
+ .lume-alluvial-group {
9
+ &__node {
10
+ opacity: 1;
11
+ transition: opacity $lume-transition-time-long;
12
+
13
+ &--faded {
14
+ opacity: 0.5;
15
+ }
16
+ }
17
+
18
+ &__node-block {
19
+ @each $color, $map in $lume-categorical-colors {
20
+ &--#{$color} {
21
+ $fill: nth($map, 1);
22
+ fill: $fill;
23
+ }
24
+ }
25
+
26
+ @each $color, $map in $lume-other-colors {
27
+ &--#{$color} {
28
+ $fill: nth($map, 1);
29
+ fill: $fill;
30
+ }
31
+ }
32
+
33
+ @each $color, $map in $lume-legacy-colors {
34
+ &--#{$color} {
35
+ $fill: nth($map, 1);
36
+ fill: $fill;
37
+ }
38
+ }
39
+ }
40
+
41
+ &__node-text {
42
+ cursor: default;
43
+ fill: $lume-alluvial-text-color;
44
+
45
+ &--right {
46
+ text-anchor: end;
47
+ }
48
+ }
49
+
50
+ &__node-value {
51
+ font-weight: $lume-font-weight-medium;
52
+ }
53
+
54
+ .lume-alluvial-link-group {
55
+ fill: none;
56
+ mix-blend-mode: multiply;
57
+ }
58
+
59
+ &__link {
60
+ stroke-opacity: $lume-alluvial-link-opacity;
61
+ transition: stroke-opacity $lume-transition-time-long;
62
+
63
+ animation: strokeReset $lume-transition-time-full linear forwards;
64
+
65
+ &--faded {
66
+ stroke-opacity: $lume-alluvial-link-opacity-faded;
67
+ }
68
+
69
+ &--ghost {
70
+ stroke-opacity: 0;
71
+ animation: unset;
72
+ transition: unset;
73
+ }
74
+ }
75
+
76
+ &__node-header {
77
+ font-weight: $lume-font-weight-medium;
78
+ text-anchor: middle;
79
+ text-align: center;
80
+ cursor: default;
81
+ }
82
+ }
83
+
84
+ @keyframes strokeReset {
85
+ to {
86
+ stroke-dashoffset: 0;
87
+ }
88
+ }
@@ -0,0 +1,28 @@
1
+ @use '../variables' as *;
2
+
3
+ .lume-bar {
4
+ $b: &;
5
+ pointer-events: visible;
6
+
7
+ &--transition-width {
8
+ transition: width $lume-transition-time-medium ease,
9
+ fill $lume-transition-time-medium ease;
10
+ -moz-transition: width $lume-transition-time-medium ease,
11
+ fill $lume-transition-time-medium ease;
12
+
13
+ &#{$b}--negative {
14
+ transform: rotate(180deg);
15
+ }
16
+ }
17
+
18
+ &--transition-height {
19
+ transition: height $lume-transition-time-medium ease,
20
+ fill $lume-transition-time-medium ease;
21
+ -moz-transition: height $lume-transition-time-medium ease,
22
+ fill $lume-transition-time-medium ease;
23
+
24
+ &:not(#{$b}--negative) {
25
+ transform: rotate(180deg);
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,35 @@
1
+ @use '../variables' as *;
2
+
3
+ $container-min-width: 320px;
4
+ $container-min-height: 224px;
5
+
6
+ .lume-chart-container {
7
+ display: flex;
8
+ flex-direction: column;
9
+
10
+ width: 100%;
11
+ height: 100%;
12
+
13
+ &--minimum {
14
+ min-width: $container-min-width;
15
+ min-height: $container-min-height;
16
+ }
17
+
18
+ &__svg {
19
+ overflow: visible;
20
+ background-color: $lume-chart-background-color;
21
+ width: 100%;
22
+ min-height: 0;
23
+ flex: 1;
24
+
25
+ &--transparent {
26
+ background-color: transparent;
27
+ }
28
+ }
29
+
30
+ &__group {
31
+ transition-property: transform;
32
+ transition-timing-function: ease-in-out;
33
+ transition-duration: $lume-transition-time-long;
34
+ }
35
+ }
@@ -0,0 +1,28 @@
1
+ @use '../variables' as *;
2
+
3
+ $legend-symbol-size: $lume-spacing-10 !default;
4
+
5
+ .lume-chart-legend {
6
+ display: flex;
7
+ justify-items: end;
8
+
9
+ &__item {
10
+ display: flex;
11
+ align-items: center;
12
+
13
+ padding: 0.25rem 0.5rem;
14
+ gap: 0.25rem;
15
+
16
+ color: $lume-color-grey-80;
17
+
18
+ cursor: default;
19
+ }
20
+
21
+ &__symbol {
22
+ display: inline-block;
23
+ width: $legend-symbol-size;
24
+ height: $legend-symbol-size;
25
+
26
+ border-radius: 50%;
27
+ }
28
+ }
@@ -0,0 +1,38 @@
1
+ @use '../variables' as *;
2
+
3
+ .lume-chart {
4
+ &__header {
5
+ &-section {
6
+ display: flex;
7
+ align-items: center;
8
+ grid-template-columns: auto auto;
9
+ grid-template-areas: 'left right';
10
+ }
11
+ }
12
+
13
+ &__title {
14
+ grid-area: left;
15
+ }
16
+
17
+ &__controls {
18
+ grid-area: right;
19
+ }
20
+
21
+ &__axis-title {
22
+ grid-area: left;
23
+
24
+ &--centered {
25
+ text-align: center;
26
+ }
27
+ }
28
+
29
+ &__legend {
30
+ grid-area: right;
31
+ margin-left: auto;
32
+
33
+ &--bottom {
34
+ margin-left: unset;
35
+ margin-right: auto;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,11 @@
1
+ @use '../variables' as *;
2
+
3
+ .lume-line-group {
4
+ &__overlay-line {
5
+ stroke: $lume-color-grey-30;
6
+ stroke-width: 1px;
7
+ stroke-dasharray: 2 2;
8
+
9
+ transition: all $lume-transition-time-long ease-out;
10
+ }
11
+ }
@@ -0,0 +1,28 @@
1
+ @use '../variables' as *;
2
+
3
+ .lume-line {
4
+ stroke-linejoin: round;
5
+ stroke-linecap: round;
6
+ fill: none;
7
+
8
+ pointer-events: visibleStroke;
9
+
10
+ &--dashed {
11
+ stroke-dasharray: 2%;
12
+ }
13
+
14
+ &--transition {
15
+ transition: all $lume-transition-time-long ease;
16
+ clip-path: polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%);
17
+ animation: clipPathTransition ease-out forwards;
18
+ }
19
+ }
20
+
21
+ @keyframes clipPathTransition {
22
+ 99% {
23
+ clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
24
+ }
25
+ 100% {
26
+ clip-path: unset; /* Required for not having chipped lines */
27
+ }
28
+ }
@@ -0,0 +1,8 @@
1
+ @use '../variables' as *;
2
+
3
+ .lume-point {
4
+ fill: $lume-color-white;
5
+
6
+ transition: all $lume-transition-time-long ease;
7
+ pointer-events: visible;
8
+ }
@@ -0,0 +1,11 @@
1
+ @use '../variables' as *;
2
+
3
+ $lume-sparkline-area-opacity: 0.3333 !default;
4
+
5
+ .sparkline-chart {
6
+ &__area {
7
+ pointer-events: none;
8
+ opacity: $lume-sparkline-area-opacity;
9
+ transition: all $lume-transition-time-long ease;
10
+ }
11
+ }
@@ -0,0 +1,37 @@
1
+ @use '../variables' as *;
2
+
3
+ $axis-label-color: $lume-color-grey-50;
4
+ $axis-label-hover-color: $lume-color-grey-70;
5
+
6
+ $axis-line-color: $lume-color-grey-20;
7
+
8
+ .axis {
9
+ &__grid-line {
10
+ fill: none;
11
+ stroke: $axis-line-color;
12
+ shape-rendering: crispEdges;
13
+ pointer-events: none;
14
+ }
15
+
16
+ &__label {
17
+ fill: $axis-label-color;
18
+ cursor: default;
19
+ transition: all $lume-transition-time-short ease-in-out;
20
+ }
21
+
22
+ &__tick {
23
+ transition: opacity $lume-transition-time-short ease-in-out;
24
+
25
+ &--hidden {
26
+ opacity: 0;
27
+ }
28
+
29
+ &--hovered {
30
+ opacity: 1;
31
+
32
+ .axis__label {
33
+ fill: $axis-label-hover-color;
34
+ }
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,90 @@
1
+ @use 'sass:math';
2
+
3
+ @use '../variables' as *;
4
+
5
+ // Tooltip box -----------------------------------------------------------------
6
+ $lume-tooltip-background-color: $lume-color-white !default;
7
+ $lume-tooltip-border-radius: $lume-border-radius-8 !default;
8
+ $lume-tooltip-box-shadow: $lume-box-shadow !default;
9
+ $lume-tooltip-max-width: 288px !default;
10
+
11
+ $lume-tooltip-content-padding: $lume-spacing-10 !default;
12
+ $lume-tooltip-z-index: 500 !default;
13
+
14
+ $lume-tooltip-title-color: $lume-color-grey-100 !default;
15
+
16
+ $lume-tooltip-item-color: $lume-color-grey-90 !default;
17
+ $lume-tooltip-value-color: $lume-color-grey-100 !default;
18
+
19
+ $lume-tooltip-item-line-height: $lume-line-height-sm !default;
20
+ $lume-tooltip-item-min-width: 112px !default;
21
+ $lume-tooltip-symbol-size: $lume-spacing-10 !default;
22
+
23
+ .lume-tooltip {
24
+ position: absolute;
25
+ max-width: $lume-tooltip-max-width;
26
+ padding: $lume-tooltip-content-padding;
27
+
28
+ background: $lume-tooltip-background-color;
29
+ border: $lume-border;
30
+ border-radius: $lume-tooltip-border-radius;
31
+ box-shadow: $lume-tooltip-box-shadow;
32
+ z-index: $lume-tooltip-z-index;
33
+ pointer-events: none; /* prevent jitter when tooltip gets in the way of the cursor during transitions */
34
+
35
+ &--animated {
36
+ transition: transform $lume-transition-time-long ease-out;
37
+ }
38
+
39
+ &__break {
40
+ hr {
41
+ margin-top: $lume-spacing-4;
42
+ margin-bottom: $lume-spacing-4;
43
+ border: 0;
44
+ border-top: 1px solid $lume-color-grey-30;
45
+ }
46
+ }
47
+
48
+ &__title {
49
+ margin-bottom: $lume-spacing-4;
50
+ font-weight: $lume-font-weight-medium;
51
+ color: $lume-tooltip-title-color;
52
+ }
53
+
54
+ &__items {
55
+ list-style: none;
56
+ margin: 0;
57
+ padding: 0;
58
+ }
59
+
60
+ &__item {
61
+ display: flex;
62
+ min-width: $lume-tooltip-item-min-width;
63
+ margin-bottom: $lume-spacing-4;
64
+ color: $lume-tooltip-item-color;
65
+
66
+ &:last-child {
67
+ margin-bottom: 0;
68
+ }
69
+ }
70
+
71
+ &__symbol {
72
+ margin-top: math.div(
73
+ $lume-tooltip-item-line-height - $lume-tooltip-symbol-size,
74
+ 2
75
+ ); // default: 3px
76
+ margin-right: $lume-spacing-8;
77
+ width: $lume-tooltip-symbol-size;
78
+ height: $lume-tooltip-symbol-size;
79
+ flex-shrink: 0;
80
+ border-radius: 50%;
81
+ }
82
+
83
+ &__value {
84
+ flex-shrink: 0;
85
+ font-weight: $lume-font-weight-medium;
86
+ margin-left: auto;
87
+ padding-left: $lume-spacing-8;
88
+ color: $lume-tooltip-value-color;
89
+ }
90
+ }