@flux-ui/visuals 0.0.0 → 3.2.0-beta.11

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@flux-ui/visuals",
3
3
  "description": "Visual effect components for the Flux UI library.",
4
- "version": "0.0.0",
4
+ "version": "3.2.0-beta.11",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public",
41
- "provenance": false
41
+ "provenance": true
42
42
  },
43
43
  "files": [
44
44
  "dist",
@@ -49,9 +49,10 @@
49
49
  "types": "./dist/index.d.ts",
50
50
  "sideEffects": false,
51
51
  "dependencies": {
52
- "@basmilius/common": "^3.45.0",
53
- "@basmilius/utils": "^3.45.0",
54
- "@flux-ui/internals": "workspace:*",
52
+ "@basmilius/common": "^3.50.0",
53
+ "@basmilius/utils": "^3.50.0",
54
+ "@flux-ui/internals": "3.2.0-beta.11",
55
+ "@flux-ui/types": "3.2.0-beta.11",
55
56
  "clsx": "^2.1.1",
56
57
  "rough-notation": "^0.5.1"
57
58
  },
@@ -59,13 +60,13 @@
59
60
  "vue": "^3.6.0-beta.17"
60
61
  },
61
62
  "devDependencies": {
62
- "@basmilius/vite-preset": "^3.45.0",
63
- "@types/node": "^26.0.1",
63
+ "@basmilius/vite-preset": "^3.50.0",
64
+ "@types/node": "^26.1.0",
64
65
  "@vitejs/plugin-vue": "^6.0.7",
65
66
  "@vue/tsconfig": "^0.9.1",
66
67
  "sass-embedded": "^1.100.0",
67
68
  "typescript": "^6.0.3",
68
- "vite": "^8.1.0",
69
- "vue-tsc": "^3.3.5"
69
+ "vite": "^8.1.3",
70
+ "vue-tsc": "^3.3.6"
70
71
  }
71
72
  }
@@ -24,9 +24,10 @@
24
24
  lang="ts"
25
25
  setup>
26
26
  import { useInView } from '@flux-ui/internals';
27
+ import type { BorderBeamVariant } from '@flux-ui/types';
27
28
  import { clsx } from 'clsx';
28
29
  import { computed, ref, unref, useTemplateRef, watch } from 'vue';
29
- import { useBorderBeamPulse, type BorderBeamVariant } from '~flux/visuals/composable/private';
30
+ import { useBorderBeamPulse } from '~flux/visuals/composable/private';
30
31
  import $style from '~flux/visuals/css/component/BorderBeam.module.scss';
31
32
 
32
33
  const emit = defineEmits<{
@@ -10,9 +10,10 @@
10
10
  lang="ts"
11
11
  setup>
12
12
  import { prefersReducedMotion, useInView } from '@flux-ui/internals';
13
+ import type { HighlighterVariant } from '@flux-ui/types';
13
14
  import { annotate } from 'rough-notation';
14
15
  import { computed, onBeforeUnmount, onMounted, shallowRef, useTemplateRef, watch } from 'vue';
15
- import { useHighlighterGroupInjection, type HighlighterGroupEntry, type HighlighterVariant } from '~flux/visuals/composable/private';
16
+ import { useHighlighterGroupInjection, type HighlighterGroupEntry } from '~flux/visuals/composable/private';
16
17
  import $style from '~flux/visuals/css/component/Highlighter.module.scss';
17
18
 
18
19
  const emit = defineEmits<{
@@ -7,7 +7,8 @@
7
7
  <script
8
8
  lang="ts"
9
9
  setup>
10
- import { useHighlighterGroup, type HighlighterGroupProps } from '~flux/visuals/composable/private';
10
+ import type { HighlighterGroupProps } from '@flux-ui/types';
11
+ import { useHighlighterGroup } from '~flux/visuals/composable/private';
11
12
  import $style from '~flux/visuals/css/component/Highlighter.module.scss';
12
13
 
13
14
  const props = defineProps<HighlighterGroupProps>();
@@ -0,0 +1,69 @@
1
+ <template>
2
+ <div
3
+ data-flux-pane-illustration
4
+ :class="isMasked ? $style.paneIllustrationMasked : $style.paneIllustration"
5
+ :style="{
6
+ aspectRatio
7
+ }">
8
+ <div
9
+ :class="$style.paneIllustrationMagic"
10
+ :style="{
11
+ border: `1px solid ${borderColor}`
12
+ }">
13
+ <FluxVisualGridPattern :stroke-dasharray="3"/>
14
+
15
+ <FluxVisualAnimatedColors
16
+ :colors="animatedColors"
17
+ :opacity="animatedOpacity"
18
+ :seed="animatedSeed"/>
19
+ </div>
20
+
21
+ <div
22
+ v-if="slots.controlled"
23
+ :class="$style.paneIllustrationContentControlled">
24
+ <slot name="controlled"/>
25
+ </div>
26
+
27
+ <div
28
+ v-if="slots.default"
29
+ :class="$style.paneIllustrationContent">
30
+ <slot/>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <script
36
+ lang="ts"
37
+ setup>
38
+ import { hexToRGB } from '@basmilius/utils';
39
+ import { computed, type VNode } from 'vue';
40
+ import FluxVisualAnimatedColors from './FluxVisualAnimatedColors.vue';
41
+ import FluxVisualGridPattern from './FluxVisualGridPattern.vue';
42
+ import $style from '~flux/visuals/css/component/PaneIllustration.module.scss';
43
+
44
+ const {
45
+ animatedColors,
46
+ aspectRatio = 16 / 9
47
+ } = defineProps<{
48
+ readonly animatedColors: string[];
49
+ readonly animatedOpacity?: number;
50
+ readonly animatedSeed?: number;
51
+ readonly aspectRatio?: number;
52
+ readonly isMasked?: boolean;
53
+ }>();
54
+
55
+ const slots = defineSlots<{
56
+ default?(): VNode[];
57
+ controlled?(): VNode[];
58
+ }>();
59
+
60
+ const borderColor = computed(() => {
61
+ if (!animatedColors || animatedColors.length === 0) {
62
+ return 'transparent';
63
+ }
64
+
65
+ const [r, g, b] = hexToRGB(animatedColors[0]);
66
+
67
+ return `rgb(${r} ${g} ${b} / .15)`;
68
+ });
69
+ </script>
@@ -9,6 +9,7 @@ export { default as FluxVisualHighlighter } from './FluxVisualHighlighter.vue';
9
9
  export { default as FluxVisualHighlighterGroup } from './FluxVisualHighlighterGroup.vue';
10
10
  export { default as FluxVisualNoise } from './FluxVisualNoise.vue';
11
11
  export { default as FluxVisualNumberFlow } from './FluxVisualNumberFlow.vue';
12
+ export { default as FluxVisualPaneIllustration } from './FluxVisualPaneIllustration.vue';
12
13
  export { default as FluxVisualPing } from './FluxVisualPing.vue';
13
14
  export { default as FluxVisualSlotText } from './FluxVisualSlotText.vue';
14
15
  export { default as FluxVisualTextScramble } from './FluxVisualTextScramble.vue';
@@ -1,2 +1,2 @@
1
- export { default as useBorderBeamPulse, type BorderBeamVariant } from './useBorderBeamPulse';
2
- export { default as useHighlighterGroup, useHighlighterGroupInjection, type HighlighterGroupContext, type HighlighterGroupEntry, type HighlighterGroupProps, type HighlighterVariant } from './useHighlighterGroup';
1
+ export { default as useBorderBeamPulse } from './useBorderBeamPulse';
2
+ export { default as useHighlighterGroup, useHighlighterGroupInjection, type HighlighterGroupContext, type HighlighterGroupEntry } from './useHighlighterGroup';
@@ -1,8 +1,7 @@
1
1
  import { prefersReducedMotion } from '@flux-ui/internals';
2
+ import type { BorderBeamVariant } from '@flux-ui/types';
2
3
  import { unref, watchEffect, type Ref } from 'vue';
3
4
 
4
- export type BorderBeamVariant = 'sm' | 'md' | 'line' | 'pulse-inner' | 'pulse-outside';
5
-
6
5
  type PulseOscillator = {
7
6
  readonly prop: string;
8
7
  readonly a: number;
@@ -1,21 +1,9 @@
1
+ import type { HighlighterGroupProps } from '@flux-ui/types';
1
2
  import { annotationGroup } from 'rough-notation';
2
3
  import { inject, onScopeDispose, provide, type InjectionKey } from 'vue';
3
4
 
4
5
  type Annotation = Parameters<typeof annotationGroup>[0][number];
5
6
 
6
- export type HighlighterVariant = 'highlight' | 'box' | 'circle' | 'underline' | 'strike-through' | 'crossed-off' | 'bracket';
7
-
8
- export type HighlighterGroupProps = {
9
- readonly variant?: HighlighterVariant;
10
- readonly color?: string;
11
- readonly strokeWidth?: number;
12
- readonly animationDuration?: number;
13
- readonly iterations?: number;
14
- readonly padding?: number;
15
- readonly multiline?: boolean;
16
- readonly whenInView?: boolean;
17
- };
18
-
19
7
  export type HighlighterGroupEntry = {
20
8
  readonly element: HTMLElement;
21
9
  getAnnotation(): Annotation | null;
@@ -0,0 +1,49 @@
1
+ .paneIllustration {
2
+ --mask: linear-gradient(to bottom, black, transparent);
3
+ --mask-content: linear-gradient(to bottom, black, rgb(0 0 0 / .75), transparent);
4
+
5
+ position: relative;
6
+ border-radius: calc(var(--radius) - 1px);
7
+
8
+ &:not(:first-child) {
9
+ border-top-left-radius: 0;
10
+ border-top-right-radius: 0;
11
+ }
12
+
13
+ &:not(:last-child) {
14
+ border-bottom-left-radius: 0;
15
+ border-bottom-right-radius: 0;
16
+ }
17
+ }
18
+
19
+ .paneIllustrationContent {
20
+ position: relative;
21
+ display: flex;
22
+ height: 100%;
23
+ align-items: center;
24
+ justify-content: center;
25
+ }
26
+
27
+ .paneIllustrationContentControlled {
28
+ composes: paneIllustrationContent;
29
+
30
+ overflow: hidden;
31
+
32
+ -webkit-mask-image: var(--mask-content);
33
+ mask-image: var(--mask-content);
34
+ }
35
+
36
+ .paneIllustrationMagic {
37
+ position: absolute;
38
+ inset: -1px;
39
+ border-radius: inherit;
40
+ }
41
+
42
+ .paneIllustrationMasked {
43
+ composes: paneIllustration;
44
+
45
+ .paneIllustrationMagic {
46
+ -webkit-mask-image: var(--mask);
47
+ mask-image: var(--mask);
48
+ }
49
+ }