fluency-v8-components 1.5.7 → 1.5.9

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.
@@ -1,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-Bubjp5rY.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-Bhs-DoPS.mjs";
2
2
  var fn = {}, cn = {}, cr, vn;
3
3
  function Q() {
4
4
  if (vn) return cr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluency-v8-components",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "main": "dist/fluency-v8-components.umd.js",
5
5
  "module": "dist/fluency-v8-components.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -71,6 +71,14 @@ export default {
71
71
  },
72
72
  deep: true,
73
73
  },
74
+ theme: {
75
+ handler() {
76
+ if (this.svg) {
77
+ this.updateTheme();
78
+ }
79
+ },
80
+ immediate: false,
81
+ },
74
82
  },
75
83
  mounted() {
76
84
  this.initializeChart();
@@ -305,6 +313,27 @@ export default {
305
313
  exit.call((g) => g.style("opacity", 0).remove());
306
314
  }
307
315
  },
316
+ updateTheme() {
317
+ if (!this.svg) return;
318
+
319
+ // Update gradient definition
320
+ const color = this.data.color
321
+ ? this.data.color
322
+ : colors[this.theme][this.change];
323
+ const gradientFill = this.svg.select("#gradientFill" + this.id);
324
+ if (gradientFill.node()) {
325
+ // Select all stop elements
326
+ const stops = gradientFill.selectAll("stop");
327
+
328
+ // Update first stop (index 0, offset="0%") - canvas color
329
+ d3.select(stops.nodes()[0])
330
+ .style("stop-color", colors[this.theme]["canvas"]);
331
+
332
+ // Update second stop (index 1, offset="100%") - main color
333
+ d3.select(stops.nodes()[1])
334
+ .style("stop-color", color);
335
+ }
336
+ },
308
337
  },
309
338
  };
310
339
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="col md:flex-row md:justify-between gap-x-5 my-4">
3
- <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]">
3
+ <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]" @click="emits('panel', 1)">
4
4
  <div class="col items-center mt-2">
5
5
  <div class="row">
6
6
  <slot name="firstPanelIcon" />
@@ -9,7 +9,7 @@
9
9
  <div class="font-light">{{ firstPanelName }}</div>
10
10
  </div>
11
11
  </GreyForm>
12
- <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]">
12
+ <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]" @click="emits('panel', 2)">
13
13
  <div class="col items-center mt-2">
14
14
  <div class="row">
15
15
  <slot name="secondPanelIcon" />
@@ -18,7 +18,7 @@
18
18
  <div class="font-light">{{ secondPanelName }}</div>
19
19
  </div>
20
20
  </GreyForm>
21
- <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]">
21
+ <GreyForm :class="['md:w-1/3', { 'dark:bg-black': shadow }]" @click="emits('panel', 3)">
22
22
  <div class="col items-center mt-2">
23
23
  <div class="row">
24
24
  <slot name="thirdPanelIcon" />
@@ -45,4 +45,5 @@ const props = defineProps({
45
45
  default: false,
46
46
  },
47
47
  });
48
+ const emits = defineEmits(["panel"])
48
49
  </script>