@tekkare/romulus 0.1.87 → 0.1.88

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
- "version": "0.1.86",
7
+ "version": "0.1.87",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -12,6 +12,12 @@
12
12
  et `ph-file-csv` ne se confondent pas en noir et blanc. Elle vient des tokens
13
13
  du theme et non d'un hexadecimal en dur, pour suivre le mode nuit.
14
14
 
15
+ Elle passe par la prop `color` de RmIcon et non par une classe : le style
16
+ scope de ce fichier n'atteint pas le `<svg>` que RmIcon monte derriere son
17
+ `<ClientOnly>`, et l'icone retombait sur la couleur du texte. Les classes
18
+ posees sur RmIcon ne servent donc qu'a la mise en place, jamais a la
19
+ couleur.
20
+
15
21
  Le composant ne navigue pas et n'ouvre rien lui-meme : il emet `select`, la
16
22
  page decide (un apercu dans un tiroir, un onglet, un telechargement).
17
23
  -->
@@ -46,18 +52,18 @@ const emit = defineEmits<{ select: [] }>()
46
52
  * neutre dit « document » sans se tromper, ce qu'une icone approchante ne
47
53
  * ferait pas.
48
54
  */
49
- const FORMATS: { match: string[]; icon: string; tone: string }[] = [
50
- { match: ['pdf'], icon: 'FilePdf', tone: 'pdf' },
51
- { match: ['csv'], icon: 'FileCsv', tone: 'csv' },
52
- { match: ['sheet', 'excel', 'xls'], icon: 'FileXls', tone: 'sheet' },
53
- { match: ['word', 'doc'], icon: 'FileDoc', tone: 'doc' },
55
+ const FORMATS: { match: string[]; icon: string; color: string }[] = [
56
+ { match: ['pdf'], icon: 'FilePdf', color: 'var(--color-danger)' },
57
+ { match: ['csv'], icon: 'FileCsv', color: 'var(--color-info)' },
58
+ { match: ['sheet', 'excel', 'xls'], icon: 'FileXls', color: 'var(--color-success)' },
59
+ { match: ['word', 'doc'], icon: 'FileDoc', color: 'var(--color-primary)' },
54
60
  ]
55
61
 
56
62
  const format = computed(() => {
57
63
  const value = props.format.toLowerCase()
58
64
  return (
59
65
  FORMATS.find(entry => entry.match.some(word => value.includes(word)))
60
- ?? { icon: 'FileText', tone: 'plain' }
66
+ ?? { icon: 'FileText', color: 'var(--text-muted)' }
61
67
  )
62
68
  })
63
69
 
@@ -70,23 +76,17 @@ const ACTION_ICONS: Record<string, string> = {
70
76
 
71
77
  <template>
72
78
  <button type="button" class="rm-file-row" @click="emit('select')">
73
- <RmIcon
74
- class="rm-file-row__icon"
75
- :class="`rm-file-row__icon--${format.tone}`"
76
- :name="format.icon"
77
- :size="16"
78
- />
79
+ <span class="rm-file-row__icon">
80
+ <RmIcon :name="format.icon" :size="16" :color="format.color" />
81
+ </span>
79
82
  <span class="rm-file-row__name">{{ name }}</span>
80
83
  <span v-if="size" class="rm-file-row__size">{{ size }}</span>
81
- <RmIcon
82
- v-if="action !== 'none'"
83
- class="rm-file-row__action"
84
- :name="ACTION_ICONS[action]"
85
- :size="14"
86
- />
84
+ <span v-if="action !== 'none'" class="rm-file-row__action">
85
+ <RmIcon :name="ACTION_ICONS[action]" :size="14" color="var(--text-muted)" />
86
+ </span>
87
87
  </button>
88
88
  </template>
89
89
 
90
90
  <style scoped>
91
- .rm-file-row{align-items:center;background:transparent;border:none;border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;display:flex;font-family:var(--font-sans);font-size:var(--font-13);gap:8px;line-height:1.4;padding:8px;text-align:left;transition:background-color var(--duration-fast) linear;width:100%}.rm-file-row:hover{background:var(--bg-surface-2)}.rm-file-row__icon{color:var(--text-muted);flex:none}.rm-file-row__icon--pdf{color:var(--color-danger)}.rm-file-row__icon--csv{color:var(--color-info)}.rm-file-row__icon--sheet{color:var(--color-success)}.rm-file-row__icon--doc{color:var(--color-primary)}.rm-file-row__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rm-file-row__size{font-size:var(--font-12)}.rm-file-row__action,.rm-file-row__size{color:var(--text-muted);flex:none}
91
+ .rm-file-row{align-items:center;background:transparent;border:none;border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;display:flex;font-family:var(--font-sans);font-size:var(--font-13);gap:8px;line-height:1.4;padding:8px;text-align:left;transition:background-color var(--duration-fast) linear;width:100%}.rm-file-row:hover{background:var(--bg-surface-2)}.rm-file-row__action,.rm-file-row__icon{display:inline-flex;flex:none}.rm-file-row__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rm-file-row__size{color:var(--text-muted);flex:none;font-size:var(--font-12)}
92
92
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/romulus",
3
- "version": "0.1.87",
3
+ "version": "0.1.88",
4
4
  "description": "Romulus Design System - Nuxt module by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",