-
- consoleLog(arg)"
- :class="isVisible ? 'block' : 'translate-x-[100vw] ease-in-out duration-500'"
- >
- Lorem ipsum consectetur. Lorem ipsum consectetur.
-
- Non
- Oui
-
-
-
-
- YO
-
-
-
-
+
diff --git a/src/components.d.ts b/src/components.d.ts
index 4bdc54c..3d823a7 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -15,6 +15,8 @@ declare module 'vue' {
'Button.story': typeof import('./components/CTA/Button/Button.story.vue')['default']
CheckBox: typeof import('./components/CTA/CheckBox/CheckBox.vue')['default']
'CheckBox.story': typeof import('./components/CTA/CheckBox/CheckBox.story.vue')['default']
+ ChipContainer: typeof import('./components/Containment/ChipContainer/ChipContainer.vue')['default']
+ 'ChipContainer.story': typeof import('./components/Containment/ChipContainer/ChipContainer.story.vue')['default']
ControlDescription: typeof import('./../histoire/components/internals/ControlDescription.vue')['default']
IconsBase: typeof import('./components/Media/IconsBase/IconsBase.vue')['default']
'IconsBase.story': typeof import('./components/Media/IconsBase/IconsBase.story.vue')['default']
diff --git a/src/components/Containment/ChipContainer/ChipContainer.model.ts b/src/components/Containment/ChipContainer/ChipContainer.model.ts
new file mode 100644
index 0000000..be5f466
--- /dev/null
+++ b/src/components/Containment/ChipContainer/ChipContainer.model.ts
@@ -0,0 +1,43 @@
+/*
+ Avaible colors:
+
+ basic:
+ black: '#1B1B1E',
+ darkgrey: '#787878',
+ grey: '#CDCDCD',
+ lightgrey: '#ECECEC',
+ verylightgrey: '#F6F6F6',
+ white: '#FAFAFA'
+ primary:
+ DEFAULT: '#000000',
+ light: '#00F2A5',
+ charcoal: '#373F51',
+ moonstone: '#58A4B0',
+ powder: '#A9BCD0',
+ platinum: '#D8DBE2'
+ transparent: 'transparent',
+ current: 'currentColor',
+ inherit: 'inherit',
+ error: '#FF5656',
+ warning: '#FFC85C',
+ success: '#7BC079',
+ info: '#333333'
+ */
+
+export const CHIP_CONTAINER_ICON_POSITION = {
+ leading: 'leading',
+ trailing: 'trailing'
+} as const
+
+export const CHIP_CONTAINER_ICON_POSITIONS = Object.values(CHIP_CONTAINER_ICON_POSITION)
+export type ChipContainerIconPosition = (typeof CHIP_CONTAINER_ICON_POSITIONS)[number]
+export const CHIP_CONTAINER_ICON_POSITION_DEFAULT = CHIP_CONTAINER_ICON_POSITION.trailing
+
+export const CHIP_CONTAINER_HAS_ICON = {
+ true: true,
+ false: false
+} as const
+
+export const CHIP_CONTAINER_HAS_ICONS = Object.values(CHIP_CONTAINER_HAS_ICON)
+export type ChipContainerHasIcon = (typeof CHIP_CONTAINER_HAS_ICONS)[number]
+export const CHIP_CONTAINER_HAS_ICON_DEFAULT = CHIP_CONTAINER_HAS_ICON.false
diff --git a/src/components/Containment/ChipContainer/ChipContainer.spec.ts b/src/components/Containment/ChipContainer/ChipContainer.spec.ts
new file mode 100644
index 0000000..fccce8f
--- /dev/null
+++ b/src/components/Containment/ChipContainer/ChipContainer.spec.ts
@@ -0,0 +1,54 @@
+import { mount } from '@vue/test-utils'
+import { it, describe, expect } from 'vitest'
+import ChipContainer from './ChipContainer.vue'
+import {
+ CHIP_CONTAINER_ICON_POSITION_DEFAULT,
+ CHIP_CONTAINER_ICON_POSITION,
+ CHIP_CONTAINER_HAS_ICON_DEFAULT
+} from './ChipContainer.model'
+
+describe('ChipContainer', () => {
+ it('renders the label correctly', () => {
+ const wrapper = mount(ChipContainer, {
+ props: {
+ label: 'Test label',
+ iconPosition: CHIP_CONTAINER_ICON_POSITION_DEFAULT,
+ hasIcon: CHIP_CONTAINER_HAS_ICON_DEFAULT
+ }
+ })
+ expect(wrapper.text()).toContain('Test label')
+ })
+
+ it('renders the icon when hasIcon is true', () => {
+ const wrapper = mount(ChipContainer, {
+ props: {
+ label: 'Test label',
+ iconPosition: CHIP_CONTAINER_ICON_POSITION_DEFAULT,
+ hasIcon: true
+ }
+ })
+ expect(wrapper.findComponent({ name: 'IconsBase' }).exists()).toBe(true)
+ })
+
+ it('does not render the icon when hasIcon is false', () => {
+ const wrapper = mount(ChipContainer, {
+ props: {
+ label: 'Test label',
+ iconPosition: CHIP_CONTAINER_ICON_POSITION_DEFAULT,
+ hasIcon: false
+ }
+ })
+ expect(wrapper.findComponent({ name: 'IconsBase' }).exists()).toBe(false)
+ })
+
+ it('sets the correct icon position', () => {
+ const wrapper = mount(ChipContainer, {
+ props: {
+ label: 'Test label',
+ iconPosition: 'leading',
+ hasIcon: true
+ }
+ }) as any
+ expect(wrapper.classes()).toContain('flex-row-reverse')
+ })
+})
diff --git a/src/components/Containment/ChipContainer/ChipContainer.story.vue b/src/components/Containment/ChipContainer/ChipContainer.story.vue
new file mode 100644
index 0000000..b72eaad
--- /dev/null
+++ b/src/components/Containment/ChipContainer/ChipContainer.story.vue
@@ -0,0 +1,62 @@
+