diff --git a/.playground/pages/composant/select/select.vue b/.playground/pages/composant/select/select.vue index 8b4cc0c..af406fb 100644 --- a/.playground/pages/composant/select/select.vue +++ b/.playground/pages/composant/select/select.vue @@ -82,6 +82,16 @@ /> +
+

Peu d'elements (2)

+ +
+

Liste longue

(null) const successValue = ref('be') const disabledValue = ref('ca') const emptyValue = ref(null) +const shortListValue = ref(null) const longListValue = ref(null) const bottomValue = ref(null) diff --git a/COMPONENTS.md b/COMPONENTS.md index 5cc0e72..ca45738 100644 --- a/COMPONENTS.md +++ b/COMPONENTS.md @@ -163,8 +163,17 @@ Liste déroulante. | `options` | `{ value: string \| number, text: string }[]` | `[]` | Options disponibles | | `emptyOptionLabel` | `string` | `''` | Placeholder option vide | | `label` | `string` | `''` | Label | -| `disabled` | `boolean` | `false` | Désactivé | +| `hint` | `string` | `''` | Message d'aide | | `error` | `string` | `''` | Message d'erreur | +| `success` | `string` | `''` | Message de succès | +| `disabled` | `boolean` | `false` | Désactivé | +| `groupClass` | `string` | `''` | Classes CSS conteneur (twMerge) | +| `minWidth` | `string` | `'w-96'` | Classe largeur minimum | +| `maxWidth` | `string` | `''` | Classe largeur maximum | +| `rounded` | `string` | `'rounded-md'` | Classe border-radius | +| `textField` | `string` | `'text-lg'` | Classe taille texte bouton | +| `textValue` | `string` | `'text-lg'` | Classe taille texte valeur | +| `textLabel` | `string` | `'text-sm'` | Classe taille texte label | **Events :** `update:modelValue(value: string | number | null)` **Slots :** `icon` (icône dropdown custom) @@ -172,6 +181,7 @@ Liste déroulante. ```vue + ``` --- diff --git a/app/components/malio/checkbox/Checkbox.test.ts b/app/components/malio/checkbox/Checkbox.test.ts index 9915c01..6fccf55 100644 --- a/app/components/malio/checkbox/Checkbox.test.ts +++ b/app/components/malio/checkbox/Checkbox.test.ts @@ -114,7 +114,7 @@ describe('MalioCheckbox', () => { }) expect(wrapper.get('input').attributes('aria-invalid')).toBe('true') - expect(wrapper.get('label').classes()).toContain('text-m-danger') + expect(wrapper.get('label').classes()).toContain('text-m-error') expect(wrapper.get('p').text()).toBe('You must accept') }) @@ -125,7 +125,7 @@ describe('MalioCheckbox', () => { }) expect(wrapper.get('p').text()).toBe('Invalid') - expect(wrapper.get('p').classes()).toContain('text-m-danger') + expect(wrapper.get('p').classes()).toContain('text-m-error') }) it('shows success styles and message when there is no error', () => { diff --git a/app/components/malio/checkbox/Checkbox.vue b/app/components/malio/checkbox/Checkbox.vue index f4a3a43..dac4e76 100644 --- a/app/components/malio/checkbox/Checkbox.vue +++ b/app/components/malio/checkbox/Checkbox.vue @@ -110,7 +110,7 @@ const mergedLabelClass = computed(() => twMerge( 'cbx text-black', disabled.value ? 'cursor-not-allowed text-black/60' : '', - hasError.value ? 'text-m-danger' : '', + hasError.value ? 'text-m-error' : '', hasSuccess.value ? 'text-m-success' : '', props.labelClass, ), @@ -120,7 +120,7 @@ const mergedMessageClass = computed(() => twMerge( 'text-xs', hasError.value - ? 'text-m-danger' + ? 'text-m-error' : hasSuccess.value ? 'text-m-success' : 'text-m-muted', @@ -200,14 +200,14 @@ const onChange = (event: Event) => { stroke-dashoffset: 0; } -.inp-cbx + .cbx.text-m-danger span:first-child { - border-color: rgb(var(--m-danger) / 1); +.inp-cbx + .cbx.text-m-error span:first-child { + border-color: rgb(var(--m-error) / 1); } -.cbx.text-m-danger span:first-child svg { - stroke: rgb(var(--m-danger) / 1); +.cbx.text-m-error span:first-child svg { + stroke: rgb(var(--m-error) / 1); } -.inp-cbx:checked + .cbx.text-m-danger span:first-child { - border-color: rgb(var(--m-danger) / 1); +.inp-cbx:checked + .cbx.text-m-error span:first-child { + border-color: rgb(var(--m-error) / 1); } .inp-cbx + .cbx.text-m-success span:first-child { diff --git a/app/components/malio/drawer/Drawer.vue b/app/components/malio/drawer/Drawer.vue index 3ad8eb7..41eec7d 100644 --- a/app/components/malio/drawer/Drawer.vue +++ b/app/components/malio/drawer/Drawer.vue @@ -1,25 +1,25 @@ diff --git a/app/components/malio/input/InputAmount.vue b/app/components/malio/input/InputAmount.vue index 4012ea0..ef58742 100644 --- a/app/components/malio/input/InputAmount.vue +++ b/app/components/malio/input/InputAmount.vue @@ -1,67 +1,69 @@