@rotki/ui-library 2.17.1 → 2.18.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.
@@ -7,9 +7,11 @@ export declare const ButtonVariant: {
7
7
  };
8
8
  export type ButtonVariant = (typeof ButtonVariant)[keyof typeof ButtonVariant];
9
9
  export declare const ButtonSize: {
10
+ readonly xs: "xs";
10
11
  readonly sm: "sm";
11
12
  readonly lg: "lg";
12
13
  readonly xl: "xl";
14
+ readonly '2xl': "2xl";
13
15
  };
14
16
  export type ButtonSize = (typeof ButtonSize)[keyof typeof ButtonSize];
15
17
  export declare const FAB_DEFAULT_ELEVATION = 6;
@@ -7,9 +7,11 @@ var ButtonVariant = {
7
7
  list: "list"
8
8
  };
9
9
  var SPINNER_SIZES = {
10
- sm: 18,
11
- lg: 26,
12
- xl: 28
10
+ "xs": 12,
11
+ "sm": 18,
12
+ "lg": 26,
13
+ "xl": 26,
14
+ "2xl": 28
13
15
  };
14
16
  var DEFAULT_SPINNER_SIZE = 22;
15
17
  function getButtonSpinnerSize(size) {
@@ -1 +1 @@
1
- {"version":3,"file":"button-props.js","names":[],"sources":["../../../../src/components/buttons/button/button-props.ts"],"sourcesContent":["export const ButtonVariant = {\n default: 'default',\n outlined: 'outlined',\n text: 'text',\n fab: 'fab',\n list: 'list',\n} as const;\n\nexport type ButtonVariant = (typeof ButtonVariant)[keyof typeof ButtonVariant];\n\nexport const ButtonSize = {\n sm: 'sm',\n lg: 'lg',\n xl: 'xl',\n} as const;\n\nexport type ButtonSize = (typeof ButtonSize)[keyof typeof ButtonSize];\n\nconst SPINNER_SIZES: Record<string, number> = { sm: 18, lg: 26, xl: 28 };\nconst DEFAULT_SPINNER_SIZE = 22;\n\nexport const FAB_DEFAULT_ELEVATION = 6;\n\nexport const NO_ELEVATION = 0;\n\nexport function getButtonSpinnerSize(size?: ButtonSize): number {\n return (size && SPINNER_SIZES[size]) || DEFAULT_SPINNER_SIZE;\n}\n"],"mappings":";AAAA,IAAa,gBAAgB;CAC3B,SAAS;CACT,UAAU;CACV,MAAM;CACN,KAAK;CACL,MAAM;CACP;AAYD,IAAM,gBAAwC;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;CAAI;AACxE,IAAM,uBAAuB;AAM7B,SAAgB,qBAAqB,MAA2B;AAC9D,QAAQ,QAAQ,cAAc,SAAU"}
1
+ {"version":3,"file":"button-props.js","names":[],"sources":["../../../../src/components/buttons/button/button-props.ts"],"sourcesContent":["export const ButtonVariant = {\n default: 'default',\n outlined: 'outlined',\n text: 'text',\n fab: 'fab',\n list: 'list',\n} as const;\n\nexport type ButtonVariant = (typeof ButtonVariant)[keyof typeof ButtonVariant];\n\nexport const ButtonSize = {\n 'xs': 'xs',\n 'sm': 'sm',\n 'lg': 'lg',\n 'xl': 'xl',\n '2xl': '2xl',\n} as const;\n\nexport type ButtonSize = (typeof ButtonSize)[keyof typeof ButtonSize];\n\nconst SPINNER_SIZES: Record<string, number> = { 'xs': 12, 'sm': 18, 'lg': 26, 'xl': 26, '2xl': 28 };\nconst DEFAULT_SPINNER_SIZE = 22;\n\nexport const FAB_DEFAULT_ELEVATION = 6;\n\nexport const NO_ELEVATION = 0;\n\nexport function getButtonSpinnerSize(size?: ButtonSize): number {\n return (size && SPINNER_SIZES[size]) || DEFAULT_SPINNER_SIZE;\n}\n"],"mappings":";AAAA,IAAa,gBAAgB;CAC3B,SAAS;CACT,UAAU;CACV,MAAM;CACN,KAAK;CACL,MAAM;CACP;AAcD,IAAM,gBAAwC;CAAE,MAAM;CAAI,MAAM;CAAI,MAAM;CAAI,MAAM;CAAI,OAAO;CAAI;AACnG,IAAM,uBAAuB;AAM7B,SAAgB,qBAAqB,MAA2B;AAC9D,QAAQ,QAAQ,cAAc,SAAU"}
@@ -14,6 +14,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
14
14
  };
15
15
  };
16
16
  size: {
17
+ xs: {
18
+ root: string;
19
+ };
17
20
  sm: {
18
21
  root: string;
19
22
  };
@@ -23,6 +26,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
23
26
  xl: {
24
27
  root: string;
25
28
  };
29
+ '2xl': {
30
+ root: string;
31
+ };
26
32
  };
27
33
  color: {
28
34
  grey: {
@@ -92,6 +98,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
92
98
  };
93
99
  };
94
100
  size: {
101
+ xs: {
102
+ root: string;
103
+ };
95
104
  sm: {
96
105
  root: string;
97
106
  };
@@ -101,6 +110,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
101
110
  xl: {
102
111
  root: string;
103
112
  };
113
+ '2xl': {
114
+ root: string;
115
+ };
104
116
  };
105
117
  color: {
106
118
  grey: {
@@ -170,6 +182,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
170
182
  };
171
183
  };
172
184
  size: {
185
+ xs: {
186
+ root: string;
187
+ };
173
188
  sm: {
174
189
  root: string;
175
190
  };
@@ -179,6 +194,9 @@ export declare const buttonStyles: import("tailwind-variants").TVReturnType<{
179
194
  xl: {
180
195
  root: string;
181
196
  };
197
+ '2xl': {
198
+ root: string;
199
+ };
182
200
  };
183
201
  color: {
184
202
  grey: {
@@ -6,7 +6,7 @@ var buttonStyles = tv({
6
6
  "text-sm leading-5 font-medium outline outline-1 outline-transparent outline-offset-[-1px]",
7
7
  "flex items-center justify-center gap-x-2",
8
8
  "px-4 py-1.5 rounded transition-all",
9
- "[&_.rui-icon]:w-[1.125rem] [&_.rui-icon]:h-[1.125rem]",
9
+ "[--rui-icon-size:1.125rem]",
10
10
  "disabled:cursor-not-allowed",
11
11
  "focus-visible:!ring-2"
12
12
  ].join(" "),
@@ -25,9 +25,11 @@ var buttonStyles = tv({
25
25
  }
26
26
  },
27
27
  size: {
28
- sm: { root: "px-2.5 py-1 text-[.8125rem] leading-5 [&_.rui-icon]:!w-4 [&_.rui-icon]:!h-4" },
29
- lg: { root: "px-6 py-2 text-[1rem] leading-5 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5" },
30
- xl: { root: "px-6 py-2.5 text-[1rem] leading-6 [&_.rui-icon]:!w-[1.375rem] [&_.rui-icon]:!h-[1.375rem]" }
28
+ "xs": { root: "px-2 py-[0.125rem] text-[.75rem] leading-4 ![--rui-icon-size:0.75rem]" },
29
+ "sm": { root: "px-2.5 py-1 text-[.8125rem] leading-5 ![--rui-icon-size:1rem]" },
30
+ "lg": { root: "px-6 py-2 text-[1rem] leading-5 ![--rui-icon-size:1.25rem]" },
31
+ "xl": { root: "px-6 py-2 text-[1rem] leading-6 ![--rui-icon-size:1.375rem]" },
32
+ "2xl": { root: "px-6 py-2.5 text-[1rem] leading-6 ![--rui-icon-size:1.375rem]" }
31
33
  },
32
34
  color: {
33
35
  grey: { root: "bg-rui-grey-200 hover:bg-rui-grey-100 active:bg-rui-grey-50 text-rui-text ring-rui-grey-400 dark:bg-rui-grey-300 dark:text-rui-light-text dark:ring-rui-grey-600" },
@@ -278,6 +280,11 @@ var buttonStyles = tv({
278
280
  variant: "outlined",
279
281
  class: { root: "outline-rui-success/[0.5]" }
280
282
  },
283
+ {
284
+ variant: "text",
285
+ size: "xs",
286
+ class: { root: "px-1" }
287
+ },
281
288
  {
282
289
  variant: "text",
283
290
  size: "sm",
@@ -288,6 +295,21 @@ var buttonStyles = tv({
288
295
  size: "lg",
289
296
  class: { root: "px-2.5" }
290
297
  },
298
+ {
299
+ variant: "text",
300
+ size: "xl",
301
+ class: { root: "px-2.5" }
302
+ },
303
+ {
304
+ variant: "text",
305
+ size: "2xl",
306
+ class: { root: "px-2.5" }
307
+ },
308
+ {
309
+ variant: "fab",
310
+ size: "xs",
311
+ class: { root: "py-1 px-1" }
312
+ },
291
313
  {
292
314
  variant: "fab",
293
315
  size: "sm",
@@ -298,6 +320,11 @@ var buttonStyles = tv({
298
320
  size: "lg",
299
321
  class: { root: "py-3" }
300
322
  },
323
+ {
324
+ variant: "list",
325
+ size: "xs",
326
+ class: { root: "px-3 py-0.5" }
327
+ },
301
328
  {
302
329
  variant: "list",
303
330
  size: "sm",
@@ -305,22 +332,32 @@ var buttonStyles = tv({
305
332
  },
306
333
  {
307
334
  icon: true,
308
- class: { root: "p-1.5 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5" }
335
+ class: { root: "p-1.5 ![--rui-icon-size:1.25rem]" }
336
+ },
337
+ {
338
+ icon: true,
339
+ size: "xs",
340
+ class: { root: "p-[0.1875rem] ![--rui-icon-size:0.875rem]" }
309
341
  },
310
342
  {
311
343
  icon: true,
312
344
  size: "sm",
313
- class: { root: "p-1 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5" }
345
+ class: { root: "p-1 ![--rui-icon-size:1.25rem]" }
314
346
  },
315
347
  {
316
348
  icon: true,
317
349
  size: "lg",
318
- class: { root: "p-1.5 [&_.rui-icon]:!w-6 [&_.rui-icon]:!h-6" }
350
+ class: { root: "p-1.5 ![--rui-icon-size:1.5rem]" }
319
351
  },
320
352
  {
321
353
  icon: true,
322
354
  size: "xl",
323
- class: { root: "p-2 [&_.rui-icon]:!w-7 [&_.rui-icon]:!h-7" }
355
+ class: { root: "p-2 ![--rui-icon-size:1.5rem]" }
356
+ },
357
+ {
358
+ icon: true,
359
+ size: "2xl",
360
+ class: { root: "p-2 ![--rui-icon-size:1.75rem]" }
324
361
  },
325
362
  {
326
363
  variant: "fab",
@@ -1 +1 @@
1
- {"version":3,"file":"button-styles.js","names":[],"sources":["../../../../src/components/buttons/button/button-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const buttonStyles = tv({\n slots: {\n root: [\n 'text-sm leading-5 font-medium outline outline-1 outline-transparent outline-offset-[-1px]',\n // `position: relative` is only needed as a positioning context for the\n // absolute-positioned loading spinner; applied via the `loading` variant\n // below. Putting it here would collide with consumers that need to pin\n // the button with `fixed`/`absolute` (cascade order picks the later\n // utility — usually `relative` — and the consumer's `right-*`/`bottom-*`\n // end up as relative offsets, which misplaces FABs).\n 'flex items-center justify-center gap-x-2',\n 'px-4 py-1.5 rounded transition-all',\n // Default (md) icon sizing for RuiIcons in button slots (prepend/append\n // /default). Size variants below override this via `!` so the rule\n // specificity wins regardless of CSS source order.\n '[&_.rui-icon]:w-[1.125rem] [&_.rui-icon]:h-[1.125rem]',\n // `disabled` on the element covers two states: actually disabled and\n // loading (RuiButton sets `disabled = disabled || loading`). The\n // color/bg/text overrides for the \"grey disabled\" look live in the\n // `loading: false` compounds below so they skip firing on loading\n // buttons — where we want the variant color to stay visible behind\n // the spinner. Cursor stays here since both states are non-clickable.\n 'disabled:cursor-not-allowed',\n 'focus-visible:!ring-2',\n ].join(' '),\n label: 'inline-block text-nowrap',\n spinner: 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n },\n variants: {\n variant: {\n default: {},\n outlined: {},\n text: { root: 'px-2' },\n fab: { root: 'rounded-full py-2' },\n list: { root: 'p-3 px-3 rounded-none w-full justify-start text-left', label: 'w-full' },\n },\n size: {\n // Each size variant sets a matching descendant rule so RuiIcons in\n // button slots (prepend/append/default) inherit a size proportional to\n // the button's height. The `.rui-icon` class sits on the icon's <svg>\n // and its `w-6 h-6` default (set by RuiIcon when no size prop is\n // passed) is overridden here because the descendant selector is more\n // specific. `!` guarantees size variants beat the md default baked\n // into the base root regardless of CSS source order. Consumers can\n // still force a specific icon size by passing the `size` prop on\n // RuiIcon — that path stamps inline width/height which beats classes.\n sm: { root: 'px-2.5 py-1 text-[.8125rem] leading-5 [&_.rui-icon]:!w-4 [&_.rui-icon]:!h-4' },\n lg: { root: 'px-6 py-2 text-[1rem] leading-5 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5' },\n xl: { root: 'px-6 py-2.5 text-[1rem] leading-6 [&_.rui-icon]:!w-[1.375rem] [&_.rui-icon]:!h-[1.375rem]' },\n },\n color: {\n grey: { root: 'bg-rui-grey-200 hover:bg-rui-grey-100 active:bg-rui-grey-50 text-rui-text ring-rui-grey-400 dark:bg-rui-grey-300 dark:text-rui-light-text dark:ring-rui-grey-600' },\n primary: { root: 'bg-rui-primary hover:bg-rui-primary-darker active:bg-rui-primary-darker/90 text-rui-dark-text ring-rui-primary/40 dark:text-rui-text dark:ring-rui-primary/60' },\n secondary: { root: 'bg-rui-secondary hover:bg-rui-secondary-darker active:bg-rui-secondary-darker/90 text-rui-dark-text ring-rui-secondary/40 dark:text-rui-text dark:ring-rui-secondary/60' },\n error: { root: 'bg-rui-error hover:bg-rui-error-darker active:bg-rui-error-darker/90 text-rui-dark-text ring-rui-error/40 dark:text-rui-text dark:ring-rui-error/60' },\n warning: { root: 'bg-rui-warning hover:bg-rui-warning-darker active:bg-rui-warning-darker/90 text-rui-dark-text ring-rui-warning/40 dark:text-rui-text dark:ring-rui-warning/60' },\n info: { root: 'bg-rui-info hover:bg-rui-info-darker active:bg-rui-info-darker/90 text-rui-dark-text ring-rui-info/40 dark:text-rui-text dark:ring-rui-info/60' },\n success: { root: 'bg-rui-success hover:bg-rui-success-darker active:bg-rui-success-darker/90 text-rui-dark-text ring-rui-success/40 dark:text-rui-text dark:ring-rui-success/60' },\n },\n rounded: {\n true: { root: 'rounded-full' },\n },\n icon: {\n // Padding and icon sizing live in the `icon + size` compound variants\n // below so every size resolves to a height matching its text-button\n // counterpart; this base only contributes the round shape.\n true: { root: 'rounded-full' },\n },\n active: {\n true: {},\n false: {},\n },\n loading: {\n true: { root: 'relative !cursor-progress space-x-0 [&>*:not([data-spinner])]:opacity-0 [&>*:not([data-spinner])]:invisible' },\n false: {},\n },\n hideFocusIndicator: {\n true: { root: 'focus-visible:!ring-0' },\n },\n },\n compoundVariants: [\n // === Disabled (not loading) appearance ===\n // Applied only when `loading: false` so that loading buttons keep their\n // variant color/outline visible behind the spinner; pure disabled buttons\n // fade to the Material disabled palette.\n { loading: false, class: { root: 'disabled:!bg-black/[.12] dark:disabled:!bg-white/[.12] disabled:!text-rui-text-disabled disabled:active:!text-rui-text-disabled' } },\n { loading: false, variant: 'outlined', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent disabled:outline-rui-text-disabled' } },\n { loading: false, variant: 'text', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent' } },\n { loading: false, variant: 'list', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent' } },\n\n // === Grey color variants ===\n { color: 'grey', active: true, class: { root: 'bg-rui-grey-50' } },\n { color: 'grey', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-black/[.04] active:bg-black/10 dark:bg-transparent dark:active:bg-white/10 dark:hover:bg-white/[.04] dark:text-rui-text' } },\n { color: 'grey', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-black/10 dark:bg-white/30' } },\n { color: 'grey', variant: 'outlined', class: { root: 'outline-rui-text' } },\n { color: 'grey', variant: 'text', class: { root: 'text-rui-text-secondary' } },\n\n // === Context colors — outlined/text variants ===\n // `dark:text-rui-<color>` is required to beat `dark:text-rui-text` set by\n // the base color variant (meant for filled buttons where text sits on a\n // colored bg). Without the override, outlined/text/list buttons in dark\n // mode render white text against a themed outline/underline.\n { color: 'primary', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-primary-lighter/[.04] active:bg-rui-primary-lighter/10 text-rui-primary dark:text-rui-primary' } },\n { color: 'secondary', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-secondary-lighter/[.04] active:bg-rui-secondary-lighter/10 text-rui-secondary dark:text-rui-secondary' } },\n { color: 'error', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-error-lighter/[.04] active:bg-rui-error-lighter/10 text-rui-error dark:text-rui-error' } },\n { color: 'warning', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-warning-lighter/[.04] active:bg-rui-warning-lighter/10 text-rui-warning dark:text-rui-warning' } },\n { color: 'info', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-info-lighter/[.04] active:bg-rui-info-lighter/10 text-rui-info dark:text-rui-info' } },\n { color: 'success', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-success-lighter/[.04] active:bg-rui-success-lighter/10 text-rui-success dark:text-rui-success' } },\n\n // === Context colors — active default ===\n { color: 'primary', active: true, class: { root: 'bg-rui-primary-darker' } },\n { color: 'secondary', active: true, class: { root: 'bg-rui-secondary-darker' } },\n { color: 'error', active: true, class: { root: 'bg-rui-error-darker' } },\n { color: 'warning', active: true, class: { root: 'bg-rui-warning-darker' } },\n { color: 'info', active: true, class: { root: 'bg-rui-info-darker' } },\n { color: 'success', active: true, class: { root: 'bg-rui-success-darker' } },\n\n // === Context colors — active outlined/text ===\n { color: 'primary', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-primary-lighter/30' } },\n { color: 'secondary', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-secondary-lighter/30' } },\n { color: 'error', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-error-lighter/30' } },\n { color: 'warning', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-warning-lighter/30' } },\n { color: 'info', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-info-lighter/30' } },\n { color: 'success', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-success-lighter/30' } },\n\n // === Context colors — outlined border ===\n { color: 'primary', variant: 'outlined', class: { root: 'outline-rui-primary/[0.5]' } },\n { color: 'secondary', variant: 'outlined', class: { root: 'outline-rui-secondary/[0.5]' } },\n { color: 'error', variant: 'outlined', class: { root: 'outline-rui-error/[0.5]' } },\n { color: 'warning', variant: 'outlined', class: { root: 'outline-rui-warning/[0.5]' } },\n { color: 'info', variant: 'outlined', class: { root: 'outline-rui-info/[0.5]' } },\n { color: 'success', variant: 'outlined', class: { root: 'outline-rui-success/[0.5]' } },\n\n // === Size overrides per variant ===\n { variant: 'text', size: 'sm', class: { root: 'px-1.5' } },\n { variant: 'text', size: 'lg', class: { root: 'px-2.5' } },\n { variant: 'fab', size: 'sm', class: { root: 'py-1.5 px-2' } },\n { variant: 'fab', size: 'lg', class: { root: 'py-3' } },\n { variant: 'list', size: 'sm', class: { root: 'px-3 py-1' } },\n // Icon-only button sizing — every size lands at the same height as the\n // text button of the matching size, with a ~60–70% icon ratio (Material-3\n // style). The `size` rule sizes icons to 16/20/22px for text-button\n // prepend/append slots; here icon-only buttons get a larger glyph so they\n // don't look lost in the square. All values use standard Tailwind tokens\n // (rem-based): p-1 = 0.25rem, p-1.5 = 0.375rem, p-2 = 0.5rem; w-5/6/7 =\n // 1.25/1.5/1.75rem. Prior `px-3 py-3` on icon base + `px-4 py-4` on lg\n // compound produced 42px (md) and 52px (lg) squares that dwarfed\n // neighboring text buttons in toolbars.\n //\n // md (default): p-1.5 + w-5 icon = 0.75 + 1.25 = 2rem (32px)\n // sm: p-1 + w-5 icon = 0.5 + 1.25 = 1.75rem (28px)\n // lg: p-1.5 + w-6 icon = 0.75 + 1.5 = 2.25rem (36px)\n // xl: p-2 + w-7 icon = 1 + 1.75 = 2.75rem (44px)\n { icon: true, class: { root: 'p-1.5 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5' } },\n { icon: true, size: 'sm', class: { root: 'p-1 [&_.rui-icon]:!w-5 [&_.rui-icon]:!h-5' } },\n { icon: true, size: 'lg', class: { root: 'p-1.5 [&_.rui-icon]:!w-6 [&_.rui-icon]:!h-6' } },\n { icon: true, size: 'xl', class: { root: 'p-2 [&_.rui-icon]:!w-7 [&_.rui-icon]:!h-7' } },\n { variant: 'fab', icon: true, size: 'sm', class: { root: 'px-2 py-2' } },\n ],\n compoundSlots: [\n // Dark mode default variant text override for warning/success/info\n { slots: ['root'], color: ['warning', 'success', 'info'], variant: 'default', class: 'dark:text-rui-light-text' },\n // Dark mode active outlined/text override for primary/secondary\n { slots: ['root'], color: 'primary', variant: ['outlined', 'text', 'list'], active: true, class: 'dark:bg-rui-primary-darker/60 dark:text-rui-primary-lighter' },\n { slots: ['root'], color: 'secondary', variant: ['outlined', 'text', 'list'], active: true, class: 'dark:bg-rui-secondary-darker/60 dark:text-rui-secondary-lighter' },\n ],\n defaultVariants: {\n variant: 'default',\n color: 'grey',\n active: false,\n },\n});\n"],"mappings":";;AAEA,IAAa,eAAe,GAAG;CAC7B,OAAO;EACL,MAAM;GACJ;GAOA;GACA;GAIA;GAOA;GACA;GACD,CAAC,KAAK,IAAI;EACX,OAAO;EACP,SAAS;EACV;CACD,UAAU;EACR,SAAS;GACP,SAAS,EAAE;GACX,UAAU,EAAE;GACZ,MAAM,EAAE,MAAM,QAAQ;GACtB,KAAK,EAAE,MAAM,qBAAqB;GAClC,MAAM;IAAE,MAAM;IAAwD,OAAO;IAAU;GACxF;EACD,MAAM;GAUJ,IAAI,EAAE,MAAM,+EAA+E;GAC3F,IAAI,EAAE,MAAM,yEAAyE;GACrF,IAAI,EAAE,MAAM,6FAA6F;GAC1G;EACD,OAAO;GACL,MAAM,EAAE,MAAM,oKAAoK;GAClL,SAAS,EAAE,MAAM,iKAAiK;GAClL,WAAW,EAAE,MAAM,2KAA2K;GAC9L,OAAO,EAAE,MAAM,uJAAuJ;GACtK,SAAS,EAAE,MAAM,iKAAiK;GAClL,MAAM,EAAE,MAAM,kJAAkJ;GAChK,SAAS,EAAE,MAAM,iKAAiK;GACnL;EACD,SAAS,EACP,MAAM,EAAE,MAAM,gBAAgB,EAC/B;EACD,MAAM,EAIJ,MAAM,EAAE,MAAM,gBAAgB,EAC/B;EACD,QAAQ;GACN,MAAM,EAAE;GACR,OAAO,EAAE;GACV;EACD,SAAS;GACP,MAAM,EAAE,MAAM,+GAA+G;GAC7H,OAAO,EAAE;GACV;EACD,oBAAoB,EAClB,MAAM,EAAE,MAAM,yBAAyB,EACxC;EACF;CACD,kBAAkB;EAKhB;GAAE,SAAS;GAAO,OAAO,EAAE,MAAM,mIAAmI;GAAE;EACtK;GAAE,SAAS;GAAO,SAAS;GAAY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AAS;EACT,OAAO;EACP,QAAQ;EACT;CACF,CAAC"}
1
+ {"version":3,"file":"button-styles.js","names":[],"sources":["../../../../src/components/buttons/button/button-styles.ts"],"sourcesContent":["import { tv } from '@/utils/tv';\n\nexport const buttonStyles = tv({\n slots: {\n root: [\n 'text-sm leading-5 font-medium outline outline-1 outline-transparent outline-offset-[-1px]',\n // `position: relative` is only needed as a positioning context for the\n // absolute-positioned loading spinner; applied via the `loading` variant\n // below. Putting it here would collide with consumers that need to pin\n // the button with `fixed`/`absolute` (cascade order picks the later\n // utility — usually `relative` — and the consumer's `right-*`/`bottom-*`\n // end up as relative offsets, which misplaces FABs).\n 'flex items-center justify-center gap-x-2',\n 'px-4 py-1.5 rounded transition-all',\n // Default (md) icon sizing is driven by a CSS custom property so that\n // RuiIcon's `size` prop (stamped as inline `style=\"--rui-icon-size\"` on\n // the svg) can override it cleanly. Size variants below redefine the\n // property with `!` so they beat this baseline on the same element;\n // inline style on the svg then beats the inherited value when a\n // consumer supplies their own size. See rotki/ui-library#512.\n '[--rui-icon-size:1.125rem]',\n // `disabled` on the element covers two states: actually disabled and\n // loading (RuiButton sets `disabled = disabled || loading`). The\n // color/bg/text overrides for the \"grey disabled\" look live in the\n // `loading: false` compounds below so they skip firing on loading\n // buttons — where we want the variant color to stay visible behind\n // the spinner. Cursor stays here since both states are non-clickable.\n 'disabled:cursor-not-allowed',\n 'focus-visible:!ring-2',\n ].join(' '),\n label: 'inline-block text-nowrap',\n spinner: 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n },\n variants: {\n variant: {\n default: {},\n outlined: {},\n text: { root: 'px-2' },\n fab: { root: 'rounded-full py-2' },\n list: { root: 'p-3 px-3 rounded-none w-full justify-start text-left', label: 'w-full' },\n },\n size: {\n // Each size variant redefines `--rui-icon-size` on the button so the\n // value inherits into RuiIcons in button slots (prepend/append/default)\n // and drives their `width: var(--rui-icon-size, 1.5rem)` class. `!` on\n // the arbitrary property makes the variant beat the md baseline in the\n // base root regardless of CSS source order. A consumer passing `size`\n // on RuiIcon still wins: that path stamps an inline style on the svg\n // element itself, which beats the inherited value from the button.\n 'xs': { root: 'px-2 py-[0.125rem] text-[.75rem] leading-4 ![--rui-icon-size:0.75rem]' },\n 'sm': { root: 'px-2.5 py-1 text-[.8125rem] leading-5 ![--rui-icon-size:1rem]' },\n 'lg': { root: 'px-6 py-2 text-[1rem] leading-5 ![--rui-icon-size:1.25rem]' },\n // `xl` targets the 40px input height — the common toolbar case where a\n // RuiButton needs to line up with RuiTextField / RuiMenuSelect. For a\n // 44px jumbo-CTA button (auth screens, empty-state primaries), reach for\n // `2xl` instead.\n 'xl': { root: 'px-6 py-2 text-[1rem] leading-6 ![--rui-icon-size:1.375rem]' },\n '2xl': { root: 'px-6 py-2.5 text-[1rem] leading-6 ![--rui-icon-size:1.375rem]' },\n },\n color: {\n grey: { root: 'bg-rui-grey-200 hover:bg-rui-grey-100 active:bg-rui-grey-50 text-rui-text ring-rui-grey-400 dark:bg-rui-grey-300 dark:text-rui-light-text dark:ring-rui-grey-600' },\n primary: { root: 'bg-rui-primary hover:bg-rui-primary-darker active:bg-rui-primary-darker/90 text-rui-dark-text ring-rui-primary/40 dark:text-rui-text dark:ring-rui-primary/60' },\n secondary: { root: 'bg-rui-secondary hover:bg-rui-secondary-darker active:bg-rui-secondary-darker/90 text-rui-dark-text ring-rui-secondary/40 dark:text-rui-text dark:ring-rui-secondary/60' },\n error: { root: 'bg-rui-error hover:bg-rui-error-darker active:bg-rui-error-darker/90 text-rui-dark-text ring-rui-error/40 dark:text-rui-text dark:ring-rui-error/60' },\n warning: { root: 'bg-rui-warning hover:bg-rui-warning-darker active:bg-rui-warning-darker/90 text-rui-dark-text ring-rui-warning/40 dark:text-rui-text dark:ring-rui-warning/60' },\n info: { root: 'bg-rui-info hover:bg-rui-info-darker active:bg-rui-info-darker/90 text-rui-dark-text ring-rui-info/40 dark:text-rui-text dark:ring-rui-info/60' },\n success: { root: 'bg-rui-success hover:bg-rui-success-darker active:bg-rui-success-darker/90 text-rui-dark-text ring-rui-success/40 dark:text-rui-text dark:ring-rui-success/60' },\n },\n rounded: {\n true: { root: 'rounded-full' },\n },\n icon: {\n // Padding and icon sizing live in the `icon + size` compound variants\n // below so every size resolves to a height matching its text-button\n // counterpart; this base only contributes the round shape.\n true: { root: 'rounded-full' },\n },\n active: {\n true: {},\n false: {},\n },\n loading: {\n true: { root: 'relative !cursor-progress space-x-0 [&>*:not([data-spinner])]:opacity-0 [&>*:not([data-spinner])]:invisible' },\n false: {},\n },\n hideFocusIndicator: {\n true: { root: 'focus-visible:!ring-0' },\n },\n },\n compoundVariants: [\n // === Disabled (not loading) appearance ===\n // Applied only when `loading: false` so that loading buttons keep their\n // variant color/outline visible behind the spinner; pure disabled buttons\n // fade to the Material disabled palette.\n { loading: false, class: { root: 'disabled:!bg-black/[.12] dark:disabled:!bg-white/[.12] disabled:!text-rui-text-disabled disabled:active:!text-rui-text-disabled' } },\n { loading: false, variant: 'outlined', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent disabled:outline-rui-text-disabled' } },\n { loading: false, variant: 'text', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent' } },\n { loading: false, variant: 'list', class: { root: 'disabled:!bg-transparent dark:disabled:!bg-transparent disabled:active:!bg-transparent' } },\n\n // === Grey color variants ===\n { color: 'grey', active: true, class: { root: 'bg-rui-grey-50' } },\n { color: 'grey', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-black/[.04] active:bg-black/10 dark:bg-transparent dark:active:bg-white/10 dark:hover:bg-white/[.04] dark:text-rui-text' } },\n { color: 'grey', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-black/10 dark:bg-white/30' } },\n { color: 'grey', variant: 'outlined', class: { root: 'outline-rui-text' } },\n { color: 'grey', variant: 'text', class: { root: 'text-rui-text-secondary' } },\n\n // === Context colors — outlined/text variants ===\n // `dark:text-rui-<color>` is required to beat `dark:text-rui-text` set by\n // the base color variant (meant for filled buttons where text sits on a\n // colored bg). Without the override, outlined/text/list buttons in dark\n // mode render white text against a themed outline/underline.\n { color: 'primary', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-primary-lighter/[.04] active:bg-rui-primary-lighter/10 text-rui-primary dark:text-rui-primary' } },\n { color: 'secondary', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-secondary-lighter/[.04] active:bg-rui-secondary-lighter/10 text-rui-secondary dark:text-rui-secondary' } },\n { color: 'error', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-error-lighter/[.04] active:bg-rui-error-lighter/10 text-rui-error dark:text-rui-error' } },\n { color: 'warning', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-warning-lighter/[.04] active:bg-rui-warning-lighter/10 text-rui-warning dark:text-rui-warning' } },\n { color: 'info', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-info-lighter/[.04] active:bg-rui-info-lighter/10 text-rui-info dark:text-rui-info' } },\n { color: 'success', variant: ['outlined', 'text', 'list'], class: { root: 'bg-transparent hover:bg-rui-success-lighter/[.04] active:bg-rui-success-lighter/10 text-rui-success dark:text-rui-success' } },\n\n // === Context colors — active default ===\n { color: 'primary', active: true, class: { root: 'bg-rui-primary-darker' } },\n { color: 'secondary', active: true, class: { root: 'bg-rui-secondary-darker' } },\n { color: 'error', active: true, class: { root: 'bg-rui-error-darker' } },\n { color: 'warning', active: true, class: { root: 'bg-rui-warning-darker' } },\n { color: 'info', active: true, class: { root: 'bg-rui-info-darker' } },\n { color: 'success', active: true, class: { root: 'bg-rui-success-darker' } },\n\n // === Context colors — active outlined/text ===\n { color: 'primary', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-primary-lighter/30' } },\n { color: 'secondary', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-secondary-lighter/30' } },\n { color: 'error', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-error-lighter/30' } },\n { color: 'warning', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-warning-lighter/30' } },\n { color: 'info', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-info-lighter/30' } },\n { color: 'success', variant: ['outlined', 'text', 'list'], active: true, class: { root: 'bg-rui-success-lighter/30' } },\n\n // === Context colors — outlined border ===\n { color: 'primary', variant: 'outlined', class: { root: 'outline-rui-primary/[0.5]' } },\n { color: 'secondary', variant: 'outlined', class: { root: 'outline-rui-secondary/[0.5]' } },\n { color: 'error', variant: 'outlined', class: { root: 'outline-rui-error/[0.5]' } },\n { color: 'warning', variant: 'outlined', class: { root: 'outline-rui-warning/[0.5]' } },\n { color: 'info', variant: 'outlined', class: { root: 'outline-rui-info/[0.5]' } },\n { color: 'success', variant: 'outlined', class: { root: 'outline-rui-success/[0.5]' } },\n\n // === Size overrides per variant ===\n { variant: 'text', size: 'xs', class: { root: 'px-1' } },\n { variant: 'text', size: 'sm', class: { root: 'px-1.5' } },\n { variant: 'text', size: 'lg', class: { root: 'px-2.5' } },\n { variant: 'text', size: 'xl', class: { root: 'px-2.5' } },\n { variant: 'text', size: '2xl', class: { root: 'px-2.5' } },\n { variant: 'fab', size: 'xs', class: { root: 'py-1 px-1' } },\n { variant: 'fab', size: 'sm', class: { root: 'py-1.5 px-2' } },\n { variant: 'fab', size: 'lg', class: { root: 'py-3' } },\n { variant: 'list', size: 'xs', class: { root: 'px-3 py-0.5' } },\n { variant: 'list', size: 'sm', class: { root: 'px-3 py-1' } },\n // Icon-only button sizing — every size lands at the same height as the\n // text button of the matching size, with a ~60–70% icon ratio (Material-3\n // style). The `size` rule sizes icons to 12/16/20/22px for text-button\n // prepend/append slots; here icon-only buttons get a larger glyph so they\n // don't look lost in the square. Values are rem-based throughout: p-1 =\n // 0.25rem, p-1.5 = 0.375rem, p-2 = 0.5rem; glyph sizes use rem literals.\n // xs uses an arbitrary 0.1875rem (3px) padding — no Tailwind token hits\n // it cleanly — to keep the 70% icon ratio with a 14px glyph.\n //\n // xs: p-[0.1875rem] + 0.875rem icon = 0.375 + 0.875 = 1.25rem (20px) — 70%\n // sm: p-1 + 1.25rem icon = 0.5 + 1.25 = 1.75rem (28px) — 71%\n // md (default): p-1.5 + 1.25rem icon = 0.75 + 1.25 = 2rem (32px) — 63%\n // lg: p-1.5 + 1.5rem icon = 0.75 + 1.5 = 2.25rem (36px) — 67%\n // xl: p-2 + 1.5rem icon = 1 + 1.5 = 2.5rem (40px) — 60%\n // 2xl: p-2 + 1.75rem icon = 1 + 1.75 = 2.75rem (44px) — 64%\n { icon: true, class: { root: 'p-1.5 ![--rui-icon-size:1.25rem]' } },\n { icon: true, size: 'xs', class: { root: 'p-[0.1875rem] ![--rui-icon-size:0.875rem]' } },\n { icon: true, size: 'sm', class: { root: 'p-1 ![--rui-icon-size:1.25rem]' } },\n { icon: true, size: 'lg', class: { root: 'p-1.5 ![--rui-icon-size:1.5rem]' } },\n { icon: true, size: 'xl', class: { root: 'p-2 ![--rui-icon-size:1.5rem]' } },\n { icon: true, size: '2xl', class: { root: 'p-2 ![--rui-icon-size:1.75rem]' } },\n { variant: 'fab', icon: true, size: 'sm', class: { root: 'px-2 py-2' } },\n ],\n compoundSlots: [\n // Dark mode default variant text override for warning/success/info\n { slots: ['root'], color: ['warning', 'success', 'info'], variant: 'default', class: 'dark:text-rui-light-text' },\n // Dark mode active outlined/text override for primary/secondary\n { slots: ['root'], color: 'primary', variant: ['outlined', 'text', 'list'], active: true, class: 'dark:bg-rui-primary-darker/60 dark:text-rui-primary-lighter' },\n { slots: ['root'], color: 'secondary', variant: ['outlined', 'text', 'list'], active: true, class: 'dark:bg-rui-secondary-darker/60 dark:text-rui-secondary-lighter' },\n ],\n defaultVariants: {\n variant: 'default',\n color: 'grey',\n active: false,\n },\n});\n"],"mappings":";;AAEA,IAAa,eAAe,GAAG;CAC7B,OAAO;EACL,MAAM;G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OAAO;IAAC;IAAW;IAAW;IAAO;GAAE,SAAS;GAAW,OAAO;GAA4B;EAEjH;GAAE,OAAO,CAAC,OAAO;GAAE,OAAO;GAAW,SAAS;IAAC;IAAY;IAAQ;IAAO;GAAE,QAAQ;GAAM,OAAO;GAA+D;EAChK;GAAE,OAAO,CAAC,OAAO;GAAE,OAAO;GAAa,SAAS;IAAC;IAAY;IAAQ;IAAO;GAAE,QAAQ;GAAM,OAAO;GAAmE;EACvK;CACD,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,QAAQ;EACT;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RuiIcon.js","names":[],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { useIcons } from '@/composables/icons';\nimport { isRuiIcon, type RuiIcons } from '@/icons';\nimport { tv } from '@/utils/tv';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst iconStyles = tv({\n variants: {\n color: {\n primary: 'text-rui-primary',\n secondary: 'text-rui-secondary',\n error: 'text-rui-error',\n warning: 'text-rui-warning',\n info: 'text-rui-info',\n success: 'text-rui-success',\n },\n sized: {\n // When no explicit size prop is set, fall back to Tailwind classes so a\n // parent (e.g. RuiButton) can override the icon size via CSS without\n // competing with inline width/height attributes.\n false: 'w-6 h-6',\n true: '',\n },\n },\n});\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\nconst ui = computed<string>(() => iconStyles({ color, sized: get(hasExplicitSize) }));\n\nconst isFill = computed<boolean>(() => name.endsWith('-fill'));\n\nconst components = computed<SvgComponent[] | undefined>(() => {\n if (!isRuiIcon(name)) {\n console.warn(`icon ${name} must be a valid RuiIcon`);\n }\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui\"\n :height=\"hasExplicitSize ? size : undefined\"\n :width=\"hasExplicitSize ? size : undefined\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n :fill=\"!isFill ? 'none' : 'currentColor'\"\n :stroke=\"!isFill ? 'currentColor' : 'none'\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RuiIcon.js","names":[],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { useIcons } from '@/composables/icons';\nimport { isRuiIcon, type RuiIcons } from '@/icons';\nimport { tv } from '@/utils/tv';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst iconStyles = tv({\n base: 'w-[var(--rui-icon-size,1.5rem)] h-[var(--rui-icon-size,1.5rem)]',\n variants: {\n color: {\n primary: 'text-rui-primary',\n secondary: 'text-rui-secondary',\n error: 'text-rui-error',\n warning: 'text-rui-warning',\n info: 'text-rui-info',\n success: 'text-rui-success',\n },\n },\n});\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\nconst ui = computed<string>(() => iconStyles({ color }));\n\n// Render the `size` prop as an inline CSS custom property on the svg. Because\n// inline style wins against any inherited value for the same property on this\n// element, the consumer-supplied size beats the button's `--rui-icon-size`\n// assignment without needing !important. A bare number (or numeric string —\n// `:size=\"16\"` resolves to a string in the template binding) is coerced to px;\n// values that already include a unit (`1rem`, `18px`, `calc(...)`) pass\n// through unchanged. The previous SVG-attr path accepted bare numbers because\n// `width`/`height` presentation attrs treat them as px; CSS does not.\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\nconst isFill = computed<boolean>(() => name.endsWith('-fill'));\n\nconst components = computed<SvgComponent[] | undefined>(() => {\n if (!isRuiIcon(name)) {\n console.warn(`icon ${name} must be a valid RuiIcon`);\n }\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n :fill=\"!isFill ? 'none' : 'currentColor'\"\n :stroke=\"!isFill ? 'currentColor' : 'none'\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n</template>\n"],"mappings":""}
@@ -1,10 +1,9 @@
1
1
  import { isRuiIcon } from "../../icons/index.js";
2
2
  import { useIcons } from "../../composables/icons.js";
3
3
  import { tv } from "../../utils/tv.js";
4
- import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, normalizeClass, openBlock, renderList, resolveDynamicComponent, unref } from "vue";
4
+ import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, renderList, resolveDynamicComponent, unref } from "vue";
5
5
  import { get } from "@vueuse/shared";
6
6
  //#region src/components/icons/RuiIcon.vue?vue&type=script&setup=true&lang.ts
7
- var _hoisted_1 = ["height", "width"];
8
7
  var RuiIcon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
9
8
  name: "RuiIcon",
10
9
  __name: "RuiIcon",
@@ -15,25 +14,24 @@ var RuiIcon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
15
14
  },
16
15
  setup(__props) {
17
16
  const { registeredIcons } = useIcons();
18
- const iconStyles = tv({ variants: {
19
- color: {
17
+ const iconStyles = tv({
18
+ base: "w-[var(--rui-icon-size,1.5rem)] h-[var(--rui-icon-size,1.5rem)]",
19
+ variants: { color: {
20
20
  primary: "text-rui-primary",
21
21
  secondary: "text-rui-secondary",
22
22
  error: "text-rui-error",
23
23
  warning: "text-rui-warning",
24
24
  info: "text-rui-info",
25
25
  success: "text-rui-success"
26
- },
27
- sized: {
28
- false: "w-6 h-6",
29
- true: ""
30
- }
31
- } });
26
+ } }
27
+ });
32
28
  const hasExplicitSize = computed(() => __props.size !== void 0);
33
- const ui = computed(() => iconStyles({
34
- color: __props.color,
35
- sized: get(hasExplicitSize)
36
- }));
29
+ const ui = computed(() => iconStyles({ color: __props.color }));
30
+ const sizeStyle = computed(() => {
31
+ if (!get(hasExplicitSize)) return void 0;
32
+ const raw = String(__props.size);
33
+ return { "--rui-icon-size": /^\d+(?:\.\d+)?$/.test(raw) ? `${raw}px` : raw };
34
+ });
37
35
  const isFill = computed(() => __props.name.endsWith("-fill"));
38
36
  const components = computed(() => {
39
37
  if (!isRuiIcon(__props.name)) console.warn(`icon ${__props.name} must be a valid RuiIcon`);
@@ -45,8 +43,7 @@ var RuiIcon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
45
43
  return openBlock(), createElementBlock("svg", {
46
44
  "aria-hidden": "true",
47
45
  class: normalizeClass(["rui-icon", unref(ui)]),
48
- height: unref(hasExplicitSize) ? __props.size : void 0,
49
- width: unref(hasExplicitSize) ? __props.size : void 0,
46
+ style: normalizeStyle(unref(sizeStyle)),
50
47
  viewBox: "0 0 24 24",
51
48
  xmlns: "http://www.w3.org/2000/svg"
52
49
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(components), (component, index) => {
@@ -59,7 +56,7 @@ var RuiIcon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
59
56
  "fill-rule": "evenodd",
60
57
  "clip-rule": "evenodd"
61
58
  }), null, 16, ["fill", "stroke"]);
62
- }), 128))], 10, _hoisted_1);
59
+ }), 128))], 6);
63
60
  };
64
61
  }
65
62
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RuiIcon.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { useIcons } from '@/composables/icons';\nimport { isRuiIcon, type RuiIcons } from '@/icons';\nimport { tv } from '@/utils/tv';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst iconStyles = tv({\n variants: {\n color: {\n primary: 'text-rui-primary',\n secondary: 'text-rui-secondary',\n error: 'text-rui-error',\n warning: 'text-rui-warning',\n info: 'text-rui-info',\n success: 'text-rui-success',\n },\n sized: {\n // When no explicit size prop is set, fall back to Tailwind classes so a\n // parent (e.g. RuiButton) can override the icon size via CSS without\n // competing with inline width/height attributes.\n false: 'w-6 h-6',\n true: '',\n },\n },\n});\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\nconst ui = computed<string>(() => iconStyles({ color, sized: get(hasExplicitSize) }));\n\nconst isFill = computed<boolean>(() => name.endsWith('-fill'));\n\nconst components = computed<SvgComponent[] | undefined>(() => {\n if (!isRuiIcon(name)) {\n console.warn(`icon ${name} must be a valid RuiIcon`);\n }\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui\"\n :height=\"hasExplicitSize ? size : undefined\"\n :width=\"hasExplicitSize ? size : undefined\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n :fill=\"!isFill ? 'none' : 'currentColor'\"\n :stroke=\"!isFill ? 'currentColor' : 'none'\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAkBA,MAAM,EAAE,oBAAoB,UAAU;EAItC,MAAM,aAAa,GAAG,EACpB,UAAU;GACR,OAAO;IACL,SAAS;IACT,WAAW;IACX,OAAO;IACP,SAAS;IACT,MAAM;IACN,SAAS;IACV;GACD,OAAO;IAIL,OAAO;IACP,MAAM;;GAET,EACF,CAAC;EAEF,MAAM,kBAAkB,eAAwB,QAAA,SAAS,KAAA,EAAU;EACnE,MAAM,KAAK,eAAuB,WAAW;GAAE,OAAI,QAAA;GAAG,OAAO,IAAI,gBAAA;GAAkB,CAAC,CAAC;EAErF,MAAM,SAAS,eAAwB,QAAA,KAAK,SAAS,QAAQ,CAAC;EAE9D,MAAM,aAAa,eAA2C;AAC5D,OAAI,CAAC,UAAU,QAAA,KAAK,CAClB,SAAQ,KAAK,QAAQ,QAAA,KAAK,0BAA0B;GAEtD,MAAM,QAAQ,gBAAgB,QAAA;AAE9B,OAAI,CAAC,MACH,SAAQ,MACN,UAAU,QAAA,KAAK,sFAChB;AAEH,UAAO;IACP;;uBAIA,mBAsBM,OAAA;IArBJ,eAAY;IACZ,OAAK,eAAA,CAAC,YACE,MAAA,GAAE,CAAA,CAAA;IACT,QAAQ,MAAA,gBAAe,GAAG,QAAA,OAAO,KAAA;IACjC,OAAO,MAAA,gBAAe,GAAG,QAAA,OAAO,KAAA;IACjC,SAAQ;IACR,OAAM;yBAEN,mBAYE,UAAA,MAAA,WAV6B,MAAA,WAAU,GAA/B,WAAW,UAAK;wBAF1B,YAYE,wBAXK,UAAS,GAAA,EADhB,WAYE,EATC,KAAK,OAAK,EAAA,EAAA,SAAA,MAAA,EACH,UAAS,IAAA;KAChB,MAAI,CAAG,MAAA,OAAM,GAAA,SAAA;KACb,QAAM,CAAG,MAAA,OAAM,GAAA,iBAAA;KAChB,gBAAa;KACb,kBAAe;KACf,mBAAgB;KAChB,aAAU;KACV,aAAU"}
1
+ {"version":3,"file":"RuiIcon.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/icons/RuiIcon.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ContextColorsType } from '@/consts/colors';\nimport { useIcons } from '@/composables/icons';\nimport { isRuiIcon, type RuiIcons } from '@/icons';\nimport { tv } from '@/utils/tv';\n\nexport interface Props {\n name: RuiIcons;\n size?: number | string;\n color?: ContextColorsType;\n}\n\ndefineOptions({\n name: 'RuiIcon',\n});\n\nconst { name, size, color } = defineProps<Props>();\n\nconst { registeredIcons } = useIcons();\n\ntype SvgComponent = [tag: string, attrs: Record<string, string>];\n\nconst iconStyles = tv({\n base: 'w-[var(--rui-icon-size,1.5rem)] h-[var(--rui-icon-size,1.5rem)]',\n variants: {\n color: {\n primary: 'text-rui-primary',\n secondary: 'text-rui-secondary',\n error: 'text-rui-error',\n warning: 'text-rui-warning',\n info: 'text-rui-info',\n success: 'text-rui-success',\n },\n },\n});\n\nconst hasExplicitSize = computed<boolean>(() => size !== undefined);\nconst ui = computed<string>(() => iconStyles({ color }));\n\n// Render the `size` prop as an inline CSS custom property on the svg. Because\n// inline style wins against any inherited value for the same property on this\n// element, the consumer-supplied size beats the button's `--rui-icon-size`\n// assignment without needing !important. A bare number (or numeric string —\n// `:size=\"16\"` resolves to a string in the template binding) is coerced to px;\n// values that already include a unit (`1rem`, `18px`, `calc(...)`) pass\n// through unchanged. The previous SVG-attr path accepted bare numbers because\n// `width`/`height` presentation attrs treat them as px; CSS does not.\nconst sizeStyle = computed<Record<string, string> | undefined>(() => {\n if (!get(hasExplicitSize))\n return undefined;\n const raw = String(size);\n const value = /^\\d+(?:\\.\\d+)?$/.test(raw) ? `${raw}px` : raw;\n return { '--rui-icon-size': value };\n});\n\nconst isFill = computed<boolean>(() => name.endsWith('-fill'));\n\nconst components = computed<SvgComponent[] | undefined>(() => {\n if (!isRuiIcon(name)) {\n console.warn(`icon ${name} must be a valid RuiIcon`);\n }\n const found = registeredIcons[name];\n\n if (!found) {\n console.error(\n `Icons \"${name}\" not found. Make sure that you have register the icon when installing the RuiPlugin`,\n );\n }\n return found;\n});\n</script>\n\n<template>\n <svg\n aria-hidden=\"true\"\n class=\"rui-icon\"\n :class=\"ui\"\n :style=\"sizeStyle\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <component\n :is=\"component[0]\"\n v-for=\"(component, index) in components\"\n :key=\"index\"\n v-bind=\"component[1]\"\n :fill=\"!isFill ? 'none' : 'currentColor'\"\n :stroke=\"!isFill ? 'currentColor' : 'none'\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n />\n </svg>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAkBA,MAAM,EAAE,oBAAoB,UAAU;EAItC,MAAM,aAAa,GAAG;GACpB,MAAM;GACN,UAAU,EACR,OAAO;IACL,SAAS;IACT,WAAW;IACX,OAAO;I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\(--rui-icon-size\2c 1\.5rem\)\] {
1386
+ height: var(--rui-icon-size,1.5rem);
1387
+ }
1388
+
1385
1389
  .h-auto {
1386
1390
  height: auto;
1387
1391
  }
@@ -1527,10 +1531,6 @@ html[data-theme="dark"], html.dark {
1527
1531
  width: 16rem;
1528
1532
  }
1529
1533
 
1530
- .w-7 {
1531
- width: 1.75rem;
1532
- }
1533
-
1534
1534
  .w-8 {
1535
1535
  width: 2rem;
1536
1536
  }
@@ -1567,6 +1567,10 @@ html[data-theme="dark"], html.dark {
1567
1567
  width: 3.625rem;
1568
1568
  }
1569
1569
 
1570
+ .w-\[var\(--rui-icon-size\2c 1\.5rem\)\] {
1571
+ width: var(--rui-icon-size,1.5rem);
1572
+ }
1573
+
1570
1574
  .w-auto {
1571
1575
  width: auto;
1572
1576
  }
@@ -2951,6 +2955,10 @@ html[data-theme="dark"], html.dark {
2951
2955
  padding: 0.13rem;
2952
2956
  }
2953
2957
 
2958
+ .p-\[0\.1875rem\] {
2959
+ padding: 0.1875rem;
2960
+ }
2961
+
2954
2962
  .p-\[0\.5625rem\] {
2955
2963
  padding: 0.5625rem;
2956
2964
  }
@@ -2970,6 +2978,11 @@ html[data-theme="dark"], html.dark {
2970
2978
  padding-right: 0px;
2971
2979
  }
2972
2980
 
2981
+ .px-1 {
2982
+ padding-left: 0.25rem;
2983
+ padding-right: 0.25rem;
2984
+ }
2985
+
2973
2986
  .px-1\.5 {
2974
2987
  padding-left: 0.375rem;
2975
2988
  padding-right: 0.375rem;
@@ -3000,6 +3013,11 @@ html[data-theme="dark"], html.dark {
3000
3013
  padding-right: 1.5rem;
3001
3014
  }
3002
3015
 
3016
+ .py-0\.5 {
3017
+ padding-top: 0.125rem;
3018
+ padding-bottom: 0.125rem;
3019
+ }
3020
+
3003
3021
  .py-1 {
3004
3022
  padding-top: 0.25rem;
3005
3023
  padding-bottom: 0.25rem;
@@ -3040,6 +3058,11 @@ html[data-theme="dark"], html.dark {
3040
3058
  padding-bottom: 2rem;
3041
3059
  }
3042
3060
 
3061
+ .py-\[0\.125rem\] {
3062
+ padding-top: 0.125rem;
3063
+ padding-bottom: 0.125rem;
3064
+ }
3065
+
3043
3066
  .py-\[0\.19rem\] {
3044
3067
  padding-top: 0.19rem;
3045
3068
  padding-bottom: 0.19rem;
@@ -3189,6 +3212,10 @@ html[data-theme="dark"], html.dark {
3189
3212
  line-height: 1;
3190
3213
  }
3191
3214
 
3215
+ .text-\[\.75rem\] {
3216
+ font-size: .75rem;
3217
+ }
3218
+
3192
3219
  .text-\[\.8125rem\] {
3193
3220
  font-size: .8125rem;
3194
3221
  }
@@ -3917,6 +3944,38 @@ html[data-theme="dark"], html.dark {
3917
3944
  scrollbar-width: none; /* Firefox */
3918
3945
  }
3919
3946
 
3947
+ .\!\[--rui-icon-size\:0\.75rem\] {
3948
+ --rui-icon-size: 0.75rem !important;
3949
+ }
3950
+
3951
+ .\!\[--rui-icon-size\:0\.875rem\] {
3952
+ --rui-icon-size: 0.875rem !important;
3953
+ }
3954
+
3955
+ .\[--rui-icon-size\:1\.125rem\] {
3956
+ --rui-icon-size: 1.125rem;
3957
+ }
3958
+
3959
+ .\!\[--rui-icon-size\:1\.25rem\] {
3960
+ --rui-icon-size: 1.25rem !important;
3961
+ }
3962
+
3963
+ .\!\[--rui-icon-size\:1\.375rem\] {
3964
+ --rui-icon-size: 1.375rem !important;
3965
+ }
3966
+
3967
+ .\!\[--rui-icon-size\:1\.5rem\] {
3968
+ --rui-icon-size: 1.5rem !important;
3969
+ }
3970
+
3971
+ .\!\[--rui-icon-size\:1\.75rem\] {
3972
+ --rui-icon-size: 1.75rem !important;
3973
+ }
3974
+
3975
+ .\!\[--rui-icon-size\:1rem\] {
3976
+ --rui-icon-size: 1rem !important;
3977
+ }
3978
+
3920
3979
  .\[--x-padding\:1rem\] {
3921
3980
  --x-padding: 1rem;
3922
3981
  }
@@ -5494,54 +5553,6 @@ body {
5494
5553
  background-color: rgba(var(--rui-grey-900), var(--tw-bg-opacity, 1));
5495
5554
  }
5496
5555
 
5497
- .\[\&_\.rui-icon\]\:\!h-4 .rui-icon {
5498
- height: 1rem !important;
5499
- }
5500
-
5501
- .\[\&_\.rui-icon\]\:\!h-5 .rui-icon {
5502
- height: 1.25rem !important;
5503
- }
5504
-
5505
- .\[\&_\.rui-icon\]\:\!h-6 .rui-icon {
5506
- height: 1.5rem !important;
5507
- }
5508
-
5509
- .\[\&_\.rui-icon\]\:\!h-7 .rui-icon {
5510
- height: 1.75rem !important;
5511
- }
5512
-
5513
- .\[\&_\.rui-icon\]\:\!h-\[1\.375rem\] .rui-icon {
5514
- height: 1.375rem !important;
5515
- }
5516
-
5517
- .\[\&_\.rui-icon\]\:h-\[1\.125rem\] .rui-icon {
5518
- height: 1.125rem;
5519
- }
5520
-
5521
- .\[\&_\.rui-icon\]\:\!w-4 .rui-icon {
5522
- width: 1rem !important;
5523
- }
5524
-
5525
- .\[\&_\.rui-icon\]\:\!w-5 .rui-icon {
5526
- width: 1.25rem !important;
5527
- }
5528
-
5529
- .\[\&_\.rui-icon\]\:\!w-6 .rui-icon {
5530
- width: 1.5rem !important;
5531
- }
5532
-
5533
- .\[\&_\.rui-icon\]\:\!w-7 .rui-icon {
5534
- width: 1.75rem !important;
5535
- }
5536
-
5537
- .\[\&_\.rui-icon\]\:\!w-\[1\.375rem\] .rui-icon {
5538
- width: 1.375rem !important;
5539
- }
5540
-
5541
- .\[\&_\.rui-icon\]\:w-\[1\.125rem\] .rui-icon {
5542
- width: 1.125rem;
5543
- }
5544
-
5545
5556
  .\[\&_input\]\:\!pr-0 input {
5546
5557
  padding-right: 0px !important;
5547
5558
  }
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@rotki/ui-library",
5
- "version": "2.17.1",
5
+ "version": "2.18.0",
6
6
  "js-types-syntax": "typescript",
7
7
  "description-markup": "markdown",
8
8
  "contributions": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rotki/ui-library",
3
- "version": "2.17.1",
3
+ "version": "2.18.0",
4
4
  "description": "A vue design system and component library for rotki",
5
5
  "type": "module",
6
6
  "keywords": [