@rotki/ui-library 0.2.4 → 0.3.0

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.
@@ -48,7 +48,7 @@ const u = Object.fromEntries(
48
48
  }
49
49
  }
50
50
  ])
51
- ), y = {
51
+ ), n = {
52
52
  text: {
53
53
  DEFAULT: "var(--rui-text-primary)",
54
54
  secondary: "var(--rui-text-secondary)",
@@ -100,7 +100,7 @@ const u = Object.fromEntries(
100
100
  "line-height": "2rem"
101
101
  },
102
102
  ".text-h6": {
103
- "@apply text-xl": {},
103
+ "@apply text-xl font-medium": {},
104
104
  "line-height": "2rem"
105
105
  }
106
106
  }), p(
@@ -131,7 +131,7 @@ const u = Object.fromEntries(
131
131
  ...x.dark
132
132
  },
133
133
  ...v,
134
- ...y
134
+ ...n
135
135
  }
136
136
  },
137
137
  boxShadow: {
@@ -0,0 +1,24 @@
1
+ interface CurrencyOptions {
2
+ currency?: string;
3
+ locale?: string;
4
+ style?: string;
5
+ fractionDigits?: number;
6
+ }
7
+ /**
8
+ * Format number value to specified currency format
9
+ * @param {number} amount
10
+ * @param {CurrencyOptions} options
11
+ */
12
+ export declare const formatCurrency: (amount: number | string, { currency, style, fractionDigits, locale, }: CurrencyOptions) => string;
13
+ /**
14
+ * Format number value
15
+ * @param {number} amount
16
+ * @param {CurrencyOptions} options
17
+ */
18
+ export declare const formatNumber: (amount: number | string, { fractionDigits }: CurrencyOptions) => string;
19
+ /**
20
+ * Format number value without fraction
21
+ * @param {number} amount
22
+ */
23
+ export declare const formatInteger: (amount: number | string) => string;
24
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rotki/ui-library",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "packageManager": "pnpm@8.6.9",
5
5
  "description": "A vue design system and component library for rotki",
6
6
  "type": "module",
@@ -73,54 +73,55 @@
73
73
  "@babel/types": "7.22.5",
74
74
  "@commitlint/cli": "17.6.7",
75
75
  "@commitlint/config-conventional": "17.6.7",
76
- "@fontsource/roboto": "5.0.5",
77
- "@headlessui/vue": "1.7.14",
78
- "@rotki/eslint-config": "1.1.0",
79
- "@storybook/addon-essentials": "7.1.0",
80
- "@storybook/addon-interactions": "7.1.0",
81
- "@storybook/addon-links": "7.1.0",
82
- "@storybook/addon-styling": "1.3.4",
83
- "@storybook/addons": "7.1.0",
84
- "@storybook/blocks": "7.1.0",
76
+ "@fontsource/roboto": "5.0.7",
77
+ "@headlessui/vue": "1.7.15",
78
+ "@popperjs/core": "2.11.8",
79
+ "@rotki/eslint-config": "1.1.1",
80
+ "@storybook/addon-essentials": "7.2.1",
81
+ "@storybook/addon-interactions": "7.2.1",
82
+ "@storybook/addon-links": "7.2.1",
83
+ "@storybook/addon-styling": "1.3.5",
84
+ "@storybook/addons": "7.2.1",
85
+ "@storybook/blocks": "7.2.1",
85
86
  "@storybook/testing-library": "0.2.0",
86
- "@storybook/vue3": "7.1.0",
87
- "@storybook/vue3-vite": "7.1.0",
87
+ "@storybook/vue3": "7.2.1",
88
+ "@storybook/vue3-vite": "7.2.1",
88
89
  "@types/node": "20.2.4",
89
90
  "@vitejs/plugin-vue": "4.2.3",
90
- "@vitest/coverage-v8": "0.33.0",
91
- "@vitest/ui": "0.33.0",
92
- "@vue/test-utils": "2.4.0",
91
+ "@vitest/coverage-v8": "0.34.1",
92
+ "@vitest/ui": "0.34.1",
93
+ "@vue/test-utils": "2.4.1",
93
94
  "@vue/tsconfig": "0.4.0",
94
- "@vueuse/core": "10.2.1",
95
- "@vueuse/shared": "10.2.1",
95
+ "@vueuse/core": "10.3.0",
96
+ "@vueuse/shared": "10.3.0",
96
97
  "argparse": "2.0.1",
97
98
  "autoprefixer": "10.4.14",
98
99
  "babel-loader": "8.3.0",
99
100
  "bumpp": "9.1.1",
100
101
  "css-loader": "6.8.1",
101
- "eslint": "8.45.0",
102
+ "eslint": "8.46.0",
102
103
  "fast-glob": "3.3.1",
103
- "fast-xml-parser": "4.2.6",
104
+ "fast-xml-parser": "4.2.7",
104
105
  "fs-extra": "11.1.1",
105
106
  "husky": "8.0.3",
106
107
  "jsdom": "22.1.0",
107
108
  "lint-staged": "13.2.3",
108
- "postcss": "8.4.26",
109
+ "postcss": "8.4.27",
109
110
  "react": "18.2.0",
110
111
  "react-dom": "18.2.0",
111
- "remixicon": "3.4.0",
112
- "sass": "1.63.6",
112
+ "remixicon": "3.5.0",
113
+ "sass": "1.64.2",
113
114
  "scule": "1.0.0",
114
- "storybook": "7.1.0",
115
+ "storybook": "7.2.1",
115
116
  "tailwindcss": "3.3.3",
116
117
  "tsc-alias": "1.8.7",
117
118
  "typescript": "5.1.6",
118
119
  "unplugin-auto-import": "0.16.6",
119
- "vite": "4.4.4",
120
- "vitest": "0.33.0",
120
+ "vite": "4.4.8",
121
+ "vitest": "0.34.1",
121
122
  "vue": "3.3.4",
122
123
  "vue-loader": "17.2.2",
123
- "vue-tsc": "1.8.5"
124
+ "vue-tsc": "1.8.8"
124
125
  },
125
126
  "engines": {
126
127
  "pnpm": ">=8 <9"
@@ -1,110 +0,0 @@
1
- import { RiAlertFill as y, RiAlertLine as E, RiArrowDropDownFill as T, RiArrowLeftSLine as w, RiArrowRightSLine as A, RiCheckLine as I, RiCheckboxBlankCircleFill as v, RiCheckboxBlankCircleLine as D, RiCheckboxBlankLine as B, RiCheckboxCircleFill as S, RiCheckboxCircleLine as M, RiCheckboxFill as O, RiCheckboxIndeterminateFill as j, RiCloseCircleLine as U, RiCloseFill as V, RiCloseLine as W, RiErrorWarningFill as q, RiErrorWarningLine as G, RiEyeLine as P, RiEyeOffLine as z, RiInformationFill as H, RiInformationLine as J, RiRadioButtonLine as K } from "./all-icons.es.js";
2
- import { createGlobalState as N, useColorMode as Q } from "@vueuse/core";
3
- import { ref as L, computed as m, watch as X } from "vue";
4
- import { set as g, get as e } from "@vueuse/shared";
5
- import { c as Y } from "./colors-01d79c7b.js";
6
- const oe = N(() => {
7
- const t = [
8
- y,
9
- E,
10
- T,
11
- w,
12
- A,
13
- I,
14
- v,
15
- D,
16
- B,
17
- S,
18
- M,
19
- O,
20
- j,
21
- U,
22
- V,
23
- W,
24
- q,
25
- G,
26
- P,
27
- z,
28
- H,
29
- J,
30
- K
31
- ], i = L({});
32
- return { registeredIcons: i, registerIcons: (a) => {
33
- g(i, {
34
- ...e(i),
35
- ...Object.fromEntries(
36
- [...t, ...a].map(({ name: s, path: d }) => [s, d])
37
- )
38
- });
39
- } };
40
- }), r = {
41
- auto: "auto",
42
- light: "light",
43
- dark: "dark"
44
- }, C = (t) => Object.fromEntries(
45
- Y.map((i) => [
46
- i,
47
- {
48
- DEFAULT: `var(--rui-${t}-${i}-main)`,
49
- lighter: `var(--rui-${t}-${i}-lighter)`,
50
- darker: `var(--rui-${t}-${i}-darker)`
51
- }
52
- ])
53
- ), b = {
54
- light: C("light"),
55
- dark: C("dark")
56
- }, u = L({ ...b }), ne = () => {
57
- const { store: t, state: i, system: h } = Q(), a = m(
58
- () => e(t) === r.auto
59
- ), s = m(
60
- () => e(a) && e(h) === r.light || e(i) === r.light
61
- ), d = m(
62
- () => e(a) && e(h) === r.dark || e(i) === r.dark
63
- ), k = m(() => e(s) ? e(u).light : e(u).dark), c = (l) => {
64
- g(t, l || r.auto);
65
- }, p = () => {
66
- e(a) ? c(r.light) : e(s) ? c(r.dark) : e(d) && c(r.auto);
67
- }, R = (l) => {
68
- g(u, l);
69
- };
70
- return {
71
- isAutoControlled: a,
72
- isLight: s,
73
- isDark: d,
74
- config: u,
75
- theme: k,
76
- store: t,
77
- state: i,
78
- init: (l) => {
79
- c(l.mode ?? r.auto), R(l.config ?? { ...b }), typeof window < "u" && X(
80
- s,
81
- (x) => {
82
- const $ = Object.entries(e(k)).map(([o, n]) => ({
83
- [`--rui-${o}-main`]: n.DEFAULT,
84
- [`--rui-${o}-lighter`]: n.lighter,
85
- [`--rui-${o}-darker`]: n.darker
86
- })).reduce((o, n) => ({ ...o, ...n }), {}), f = x ? r.light : r.dark, F = {
87
- "--rui-text-primary": `var(--rui-${f}-text-primary)`,
88
- "--rui-text-secondary": `var(--rui-${f}-text-secondary)`,
89
- "--rui-text-disabled": `var(--rui-${f}-text-disabled)`
90
- };
91
- Object.entries({
92
- ...$,
93
- ...F
94
- }).forEach(([o, n]) => {
95
- document.documentElement.style.setProperty(o, n);
96
- });
97
- },
98
- { immediate: !0 }
99
- );
100
- },
101
- setThemeConfig: R,
102
- toggleThemeMode: p,
103
- switchThemeScheme: c
104
- };
105
- };
106
- export {
107
- r as T,
108
- ne as a,
109
- oe as u
110
- };