@rotki/ui-library 0.2.4 → 0.4.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.
Files changed (32) hide show
  1. package/dist/all-icons.d.ts +44 -0
  2. package/dist/all-icons.es.js +4829 -4657
  3. package/dist/components/alerts/Alert.vue.d.ts +18 -9
  4. package/dist/components/buttons/button/Button.vue.d.ts +10 -0
  5. package/dist/components/cards/Card.vue.d.ts +60 -0
  6. package/dist/components/cards/CardHeader.vue.d.ts +26 -0
  7. package/dist/components/chips/Chip.vue.d.ts +1 -0
  8. package/dist/components/forms/select/SimpleSelect.vue.d.ts +59 -0
  9. package/dist/components/forms/text-field/TextField.vue.d.ts +24 -13
  10. package/dist/components/icons/Icon.vue.d.ts +4 -3
  11. package/dist/components/index.d.ts +13 -4
  12. package/dist/components/index.es.js +24 -14
  13. package/dist/components/logos/Logo.vue.d.ts +10 -0
  14. package/dist/components/overlays/dialog/Dialog.vue.d.ts +60 -0
  15. package/dist/components/overlays/tooltip/Tooltip.vue.d.ts +88 -0
  16. package/dist/components/tables/DataTable.vue.d.ts +281 -0
  17. package/dist/components/tables/TablePagination.vue.d.ts +46 -0
  18. package/dist/components/tabs/tab/Tab.vue.d.ts +136 -0
  19. package/dist/components/tabs/tab-item/TabItem.vue.d.ts +53 -0
  20. package/dist/components/tabs/tab-items/TabItems.vue.d.ts +17 -0
  21. package/dist/components/tabs/tabs/Tabs.vue.d.ts +72 -0
  22. package/dist/composables/index.es.js +1 -1
  23. package/dist/composables/popper.d.ts +251 -0
  24. package/dist/index-393a0e94.js +117 -0
  25. package/dist/index-65c6da26.js +5422 -0
  26. package/dist/index.es.js +2569 -2516
  27. package/dist/style.css +1 -1
  28. package/dist/theme/index.es.js +3 -3
  29. package/dist/utils/helpers.d.ts +24 -0
  30. package/package.json +31 -26
  31. package/dist/index-1f5d0d16.js +0 -110
  32. package/dist/index-b6044b77.js +0 -2336
@@ -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.4.0",
4
4
  "packageManager": "pnpm@8.6.9",
5
5
  "description": "A vue design system and component library for rotki",
6
6
  "type": "module",
@@ -68,59 +68,64 @@
68
68
  "@vueuse/shared": ">10.0.0",
69
69
  "vue": ">=3.3.4"
70
70
  },
71
+ "optionalDependencies": {
72
+ "vue-router": ">=3.6.5"
73
+ },
71
74
  "devDependencies": {
72
75
  "@babel/core": "7.22.9",
73
76
  "@babel/types": "7.22.5",
74
77
  "@commitlint/cli": "17.6.7",
75
78
  "@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",
79
+ "@fontsource/roboto": "5.0.7",
80
+ "@headlessui/vue": "1.7.15",
81
+ "@popperjs/core": "2.11.8",
82
+ "@rotki/eslint-config": "1.1.1",
83
+ "@storybook/addon-essentials": "7.2.1",
84
+ "@storybook/addon-interactions": "7.2.1",
85
+ "@storybook/addon-links": "7.2.1",
86
+ "@storybook/addon-styling": "1.3.5",
87
+ "@storybook/addons": "7.2.1",
88
+ "@storybook/blocks": "7.2.1",
85
89
  "@storybook/testing-library": "0.2.0",
86
- "@storybook/vue3": "7.1.0",
87
- "@storybook/vue3-vite": "7.1.0",
90
+ "@storybook/vue3": "7.2.1",
91
+ "@storybook/vue3-vite": "7.2.1",
88
92
  "@types/node": "20.2.4",
89
93
  "@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",
94
+ "@vitest/coverage-v8": "0.34.1",
95
+ "@vitest/ui": "0.34.1",
96
+ "@vue/test-utils": "2.4.1",
93
97
  "@vue/tsconfig": "0.4.0",
94
- "@vueuse/core": "10.2.1",
95
- "@vueuse/shared": "10.2.1",
98
+ "@vueuse/core": "10.3.0",
99
+ "@vueuse/shared": "10.3.0",
96
100
  "argparse": "2.0.1",
97
101
  "autoprefixer": "10.4.14",
98
102
  "babel-loader": "8.3.0",
99
103
  "bumpp": "9.1.1",
100
104
  "css-loader": "6.8.1",
101
- "eslint": "8.45.0",
105
+ "eslint": "8.46.0",
102
106
  "fast-glob": "3.3.1",
103
- "fast-xml-parser": "4.2.6",
107
+ "fast-xml-parser": "4.2.7",
104
108
  "fs-extra": "11.1.1",
105
109
  "husky": "8.0.3",
106
110
  "jsdom": "22.1.0",
107
111
  "lint-staged": "13.2.3",
108
- "postcss": "8.4.26",
112
+ "postcss": "8.4.27",
109
113
  "react": "18.2.0",
110
114
  "react-dom": "18.2.0",
111
- "remixicon": "3.4.0",
112
- "sass": "1.63.6",
115
+ "remixicon": "3.5.0",
116
+ "sass": "1.64.2",
113
117
  "scule": "1.0.0",
114
- "storybook": "7.1.0",
118
+ "storybook": "7.2.1",
115
119
  "tailwindcss": "3.3.3",
116
120
  "tsc-alias": "1.8.7",
117
121
  "typescript": "5.1.6",
118
122
  "unplugin-auto-import": "0.16.6",
119
- "vite": "4.4.4",
120
- "vitest": "0.33.0",
123
+ "vite": "4.4.8",
124
+ "vitest": "0.34.1",
121
125
  "vue": "3.3.4",
122
126
  "vue-loader": "17.2.2",
123
- "vue-tsc": "1.8.5"
127
+ "vue-router": "4.2.4",
128
+ "vue-tsc": "1.8.8"
124
129
  },
125
130
  "engines": {
126
131
  "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
- };