@flyanra/vue-core 1.3.3 → 1.3.5

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,5 +1,8 @@
1
1
  import { type Component } from 'vue';
2
+ export declare const FLY_ICON_V2_NAMED_SIZES: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
3
+ export type T_FlyIconV2NamedSize = (typeof FLY_ICON_V2_NAMED_SIZES)[number];
4
+ export type T_FlyIconV2Size = T_FlyIconV2NamedSize | (string & {});
2
5
  export type T_FlyIconV2Props = {
3
6
  icon: Component;
4
- size?: string | number;
7
+ size?: T_FlyIconV2Size;
5
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flyanra/vue-core",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "private": false,
5
5
  "description": "Source-distributed Vue component library for Vite and Nuxt consumers.",
6
6
  "sideEffects": false,
@@ -83,6 +83,7 @@
83
83
  "postinstall:husky": "husky",
84
84
  "prepare": "husky",
85
85
  "preview": "vite preview",
86
+ "release": "bash scripts/release.sh",
86
87
  "storybook": "storybook dev -p 6006 --no-open",
87
88
  "test-storybook": "vitest --project=storybook",
88
89
  "typecheck": "vue-tsc --noEmit -p tsconfig.lib.json"
@@ -41,7 +41,7 @@ defineProps({
41
41
 
42
42
  <style lang="scss" scoped>
43
43
  .fly-info-tooltip {
44
- :deep(.app-icon) {
44
+ :deep(.fly-icon) {
45
45
  svg {
46
46
  display: inline;
47
47
  }
@@ -1,6 +1,11 @@
1
1
  import { type Component } from 'vue'
2
2
 
3
+ export const FLY_ICON_V2_NAMED_SIZES = ['xs', 'sm', 'md', 'lg', 'xl', '2xl'] as const
4
+
5
+ export type T_FlyIconV2NamedSize = (typeof FLY_ICON_V2_NAMED_SIZES)[number]
6
+ export type T_FlyIconV2Size = T_FlyIconV2NamedSize | (string & {})
7
+
3
8
  export type T_FlyIconV2Props = {
4
9
  icon: Component
5
- size?: string | number
10
+ size?: T_FlyIconV2Size
6
11
  }
@@ -2,16 +2,39 @@
2
2
  <component
3
3
  :is="icon"
4
4
  class="fly-icon"
5
- :style="{
6
- fontSize: typeof size === 'number' ? `${size}px` : size
7
- }"
5
+ :class="namedSizes.has(size!) ? `fly-icon--${size}` : undefined"
6
+ :style="size && !namedSizes.has(size) ? { fontSize: size } : undefined"
8
7
  />
9
8
  </template>
10
9
 
11
10
  <script setup lang="ts">
11
+ import { FLY_ICON_V2_NAMED_SIZES } from './FlyIconV2.types'
12
12
  import type { T_FlyIconV2Props } from './FlyIconV2.types'
13
13
 
14
14
  defineProps<T_FlyIconV2Props>()
15
+
16
+ const namedSizes: Set<string> = new Set(FLY_ICON_V2_NAMED_SIZES)
15
17
  </script>
16
18
 
17
- <style lang="scss" scoped></style>
19
+ <style lang="scss" scoped>
20
+ .fly-icon {
21
+ &--xs {
22
+ font-size: 0.75em;
23
+ }
24
+ &--sm {
25
+ font-size: 1em;
26
+ }
27
+ &--md {
28
+ font-size: 1.25em;
29
+ }
30
+ &--lg {
31
+ font-size: 1.5em;
32
+ }
33
+ &--xl {
34
+ font-size: 2em;
35
+ }
36
+ &--2xl {
37
+ font-size: 3em;
38
+ }
39
+ }
40
+ </style>