@nexxtmove/ui 0.1.31 → 0.1.32

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 (54) hide show
  1. package/dist/index.d.ts +104 -17
  2. package/dist/index.js +132 -128
  3. package/package.json +1 -1
  4. package/src/components/Calendar/_CalendarDayView.vue +1 -1
  5. package/src/components/Chip/Chip.vue +9 -4
  6. package/src/components/Table/Table.vue +2 -2
  7. package/src/components/AnimatedNumber/AnimatedNumber.stories.ts +0 -15
  8. package/src/components/AnimatedNumber/AnimatedNumber.test.ts +0 -56
  9. package/src/components/Avatar/Avatar.stories.ts +0 -28
  10. package/src/components/Avatar/Avatar.test.ts +0 -55
  11. package/src/components/Button/Button.stories.ts +0 -212
  12. package/src/components/Button/Button.test.ts +0 -318
  13. package/src/components/Calendar/Calendar.stories.ts +0 -91
  14. package/src/components/Calendar/Calendar.test.ts +0 -279
  15. package/src/components/Calendar/_CalendarDayView.test.ts +0 -104
  16. package/src/components/Calendar/_CalendarHeader.test.ts +0 -86
  17. package/src/components/Calendar/_CalendarMonthView.test.ts +0 -52
  18. package/src/components/Calendar/_CalendarYearView.test.ts +0 -56
  19. package/src/components/Checkbox/Checkbox.stories.ts +0 -35
  20. package/src/components/Checkbox/Checkbox.test.ts +0 -55
  21. package/src/components/Chip/Chip.stories.ts +0 -42
  22. package/src/components/Chip/Chip.test.ts +0 -51
  23. package/src/components/CustomerJourneyTile/CustomerJourneyTile.stories.ts +0 -86
  24. package/src/components/CustomerJourneyTile/CustomerJourneyTile.test.ts +0 -178
  25. package/src/components/DatePicker/DatePicker.stories.ts +0 -149
  26. package/src/components/DatePicker/DatePicker.test.ts +0 -191
  27. package/src/components/DropdownButton/DropdownButton.stories.ts +0 -68
  28. package/src/components/DropdownButton/DropdownButton.test.ts +0 -124
  29. package/src/components/Header/Header.stories.ts +0 -54
  30. package/src/components/Header/Header.test.ts +0 -183
  31. package/src/components/Icon/Icon.stories.ts +0 -50
  32. package/src/components/Icon/Icon.test.ts +0 -73
  33. package/src/components/InfoBlock/InfoBlock.stories.ts +0 -90
  34. package/src/components/InfoBlock/InfoBlock.test.ts +0 -101
  35. package/src/components/ProgressBar/ProgressBar.stories.ts +0 -30
  36. package/src/components/ProgressBar/ProgressBar.test.ts +0 -314
  37. package/src/components/SocialIcons/SocialIcons.stories.ts +0 -34
  38. package/src/components/SocialIcons/SocialIcons.test.ts +0 -58
  39. package/src/components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.stories.ts +0 -11
  40. package/src/components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.test.ts +0 -131
  41. package/src/components/SocialMediaTemplate/SocialMediaTemplate.stories.ts +0 -71
  42. package/src/components/SocialMediaTemplate/SocialMediaTemplate.test.ts +0 -466
  43. package/src/components/SocialMediaType/SocialMediaType.stories.ts +0 -43
  44. package/src/components/SocialMediaType/SocialMediaType.test.ts +0 -126
  45. package/src/components/StepperHeader/StepperHeader.stories.ts +0 -47
  46. package/src/components/StepperHeader/StepperHeader.test.ts +0 -244
  47. package/src/components/Table/Table.stories.ts +0 -283
  48. package/src/components/Table/Table.test.ts +0 -220
  49. package/src/components/TimelineEvent/TimelineEvent.stories.ts +0 -291
  50. package/src/components/TimelineEvent/TimelineEvent.test.ts +0 -166
  51. package/src/components/TimelinePhaseblock/TimelinePhaseblock.stories.ts +0 -198
  52. package/src/components/TimelinePhaseblock/TimelinePhaseblock.test.ts +0 -283
  53. package/src/components/Tooltip/Tooltip.stories.ts +0 -146
  54. package/src/components/Tooltip/Tooltip.test.ts +0 -122
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "0.1.31",
4
+ "version": "0.1.32",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -4,7 +4,7 @@ import { isSameDay, isSameMonth, format } from 'date-fns'
4
4
  import { toZonedTime } from 'date-fns-tz'
5
5
  import type { Locale } from 'date-fns'
6
6
 
7
- interface CalendarDayViewProps {
7
+ export interface CalendarDayViewProps {
8
8
  viewDate: Date
9
9
  calendarDays: Date[]
10
10
  modelValue: Date | null
@@ -1,8 +1,8 @@
1
- <script lang="ts" setup>
1
+ <script setup lang="ts">
2
2
  import { computed } from 'vue'
3
3
 
4
4
  interface NexxtChipProps {
5
- variant?: 'default' | 'warning' | 'success' | 'danger'
5
+ variant?: 'default' | 'warning' | 'success' | 'danger' | 'ghost'
6
6
  }
7
7
 
8
8
  defineOptions({
@@ -19,6 +19,8 @@ const backgroundColor = computed(() => {
19
19
  return 'bg-green-500'
20
20
  case 'danger':
21
21
  return 'bg-brick-500'
22
+ case 'ghost':
23
+ return 'bg-cornflower-blue-50'
22
24
  default:
23
25
  return 'bg-cornflower-blue-600'
24
26
  }
@@ -28,9 +30,12 @@ const backgroundColor = computed(() => {
28
30
  <template>
29
31
  <span
30
32
  class="inline-flex h-5 flex-col items-center justify-center gap-2.5 rounded-[200px] px-4"
31
- :class="backgroundColor"
33
+ :class="[backgroundColor, variant === 'ghost' ? 'border border-cornflower-blue-500' : '']"
32
34
  >
33
- <span class="justify-start text-center extra-small-semibold text-white">
35
+ <span
36
+ class="justify-start text-center extra-small-semibold"
37
+ :class="variant === 'ghost' ? 'text-cornflower-blue-500' : 'text-white'"
38
+ >
34
39
  <slot>Chip</slot>
35
40
  </span>
36
41
  </span>
@@ -10,7 +10,7 @@ export interface TableColumn<K extends string = string> {
10
10
  width?: string
11
11
  }
12
12
 
13
- interface NexxtTableProps {
13
+ export interface NexxtTableProps<TKey extends string = string> {
14
14
  columns: TableColumn<TKey>[]
15
15
  rows: Record<TKey, unknown>[]
16
16
  sortKey?: TKey
@@ -23,7 +23,7 @@ const INTERACTIVE = ['a', 'button', 'input', 'select', 'textarea', 'label']
23
23
 
24
24
  defineOptions({ name: 'NexxtTable' })
25
25
 
26
- const props = withDefaults(defineProps<NexxtTableProps>(), {
26
+ const props = withDefaults(defineProps<NexxtTableProps<TKey>>(), {
27
27
  sortDirection: 'asc',
28
28
  })
29
29
  const emit = defineEmits<{
@@ -1,15 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3-vite'
2
- import AnimatedNumber from './AnimatedNumber.vue'
3
-
4
- export default {
5
- title: 'Components/Atoms/Animated Number',
6
- component: AnimatedNumber,
7
- } satisfies Meta<typeof AnimatedNumber>
8
-
9
- type Story = StoryObj<typeof AnimatedNumber>
10
-
11
- export const Default: Story = {
12
- args: {
13
- value: 4,
14
- },
15
- }
@@ -1,56 +0,0 @@
1
- import { describe, it, expect } from 'vitest'
2
- import { mount } from '@vue/test-utils'
3
- import AnimatedNumber from './AnimatedNumber.vue'
4
-
5
- describe('AnimatedNumber', () => {
6
- it('renders the number correctly', () => {
7
- const wrapper = mount(AnimatedNumber, {
8
- props: {
9
- value: 123,
10
- },
11
- })
12
-
13
- expect(wrapper.text()).toBe('123')
14
- expect(wrapper.attributes('aria-label')).toBe('123')
15
- })
16
-
17
- it('splits the number into digits', () => {
18
- const wrapper = mount(AnimatedNumber, {
19
- props: {
20
- value: 45,
21
- },
22
- })
23
-
24
- const digitWrappers = wrapper.findAll('.relative.inline-flex.h-\\[1\\.5em\\]')
25
- expect(digitWrappers).toHaveLength(2)
26
- expect(digitWrappers.at(0)?.text()).toBe('4')
27
- expect(digitWrappers.at(1)?.text()).toBe('5')
28
- })
29
-
30
- it('handles single digit values', () => {
31
- const wrapper = mount(AnimatedNumber, {
32
- props: {
33
- value: 7,
34
- },
35
- })
36
-
37
- const digitWrappers = wrapper.findAll('.relative.inline-flex.h-\\[1\\.5em\\]')
38
- expect(digitWrappers).toHaveLength(1)
39
- expect(digitWrappers.at(0)?.text()).toBe('7')
40
- })
41
-
42
- it('updates digits when value changes', async () => {
43
- const wrapper = mount(AnimatedNumber, {
44
- props: {
45
- value: 9,
46
- },
47
- })
48
-
49
- expect(wrapper.text()).toBe('9')
50
-
51
- await wrapper.setProps({ value: 10 })
52
-
53
- expect(wrapper.text()).toBe('10')
54
- expect(wrapper.findAll('.relative.inline-flex.h-\\[1\\.5em\\]')).toHaveLength(2)
55
- })
56
- })
@@ -1,28 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3-vite'
2
- import Avatar from './Avatar.vue'
3
-
4
- export default {
5
- title: 'Components/Atoms/Avatar',
6
- component: Avatar,
7
- parameters: {
8
- design: {
9
- type: 'figma',
10
- url: 'https://www.figma.com/design/CdbFJ7qUga6mtjagcPDvYK/Design-System',
11
- },
12
- },
13
- argTypes: {
14
- size: {
15
- control: 'select',
16
- options: ['xs', 'sm', 'md', 'lg', 'xl'],
17
- },
18
- },
19
- } satisfies Meta<typeof Avatar>
20
-
21
- type Story = StoryObj<typeof Avatar>
22
-
23
- export const Default: Story = {
24
- args: {
25
- name: 'Peter van der Sloot',
26
- size: 'sm',
27
- },
28
- }
@@ -1,55 +0,0 @@
1
- import { describe, it, expect } from 'vitest'
2
- import { mount } from '@vue/test-utils'
3
- import Avatar from './Avatar.vue'
4
-
5
- describe('Avatar', () => {
6
- it('generates 2 character initials from name with multiple words', () => {
7
- const wrapper = mount(Avatar, {
8
- props: {
9
- name: 'Peter Vink',
10
- },
11
- })
12
-
13
- expect(wrapper.text()).toContain('PV')
14
- })
15
-
16
- it('generates 2 character initials from name with single word', () => {
17
- const wrapper = mount(Avatar, {
18
- props: {
19
- name: 'Peter',
20
- },
21
- })
22
-
23
- expect(wrapper.text()).toContain('PE')
24
- })
25
-
26
- it('generates 2 character initials picking first and last words for names with tussenvoegsels', () => {
27
- const wrapper = mount(Avatar, {
28
- props: {
29
- name: 'Peter van der Sloot',
30
- },
31
- })
32
-
33
- expect(wrapper.text()).toContain('PS')
34
- })
35
-
36
- it('handles empty strings gracefully by returning no text', () => {
37
- const wrapper = mount(Avatar, {
38
- props: {
39
- name: '',
40
- },
41
- })
42
-
43
- expect(wrapper.text()).toBe('')
44
- })
45
-
46
- it('handles whitespace-only strings gracefully by returning no text', () => {
47
- const wrapper = mount(Avatar, {
48
- props: {
49
- name: ' ',
50
- },
51
- })
52
-
53
- expect(wrapper.text()).toBe('')
54
- })
55
- })
@@ -1,212 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/vue3-vite'
2
- import Button from './Button.vue'
3
-
4
- export default {
5
- title: 'Components/Atoms/Button',
6
- component: Button,
7
- parameters: {
8
- design: {
9
- type: 'figma',
10
- url: 'https://www.figma.com/design/CdbFJ7qUga6mtjagcPDvYK/Design-System?node-id=167-357&t=CbHvOQfEMIr7M5mO-4',
11
- },
12
- },
13
- } satisfies Meta<typeof Button>
14
-
15
- type Story = StoryObj<typeof Button>
16
-
17
- export const Primary: Story = {
18
- args: {
19
- default: 'Button',
20
- variant: 'primary',
21
- iconRight: false,
22
- disabled: false,
23
- loading: false,
24
- },
25
- }
26
-
27
- export const Secondary: Story = {
28
- args: {
29
- variant: 'secondary',
30
- default: 'Secondary Button',
31
- },
32
- }
33
-
34
- export const Success: Story = {
35
- args: {
36
- variant: 'success',
37
- default: 'Success Button',
38
- },
39
- }
40
-
41
- export const Danger: Story = {
42
- args: {
43
- variant: 'danger',
44
- default: 'Danger Button',
45
- },
46
- }
47
-
48
- export const Link: Story = {
49
- args: {
50
- variant: 'link',
51
- default: 'Link Button',
52
- },
53
- }
54
-
55
- export const WithIcon: Story = {
56
- args: {
57
- icon: 'star',
58
- default: 'With Icon',
59
- },
60
- }
61
-
62
- export const WithIconRight: Story = {
63
- args: {
64
- icon: 'arrow-right',
65
- iconRight: true,
66
- default: 'Next Step',
67
- },
68
- }
69
-
70
- export const WithIconSecondary: Story = {
71
- args: {
72
- variant: 'secondary',
73
- icon: 'download',
74
- default: 'Download',
75
- },
76
- }
77
-
78
- export const WithIconSuccess: Story = {
79
- args: {
80
- variant: 'success',
81
- icon: 'check',
82
- default: 'Success Button',
83
- },
84
- }
85
-
86
- export const WithIconDanger: Story = {
87
- args: {
88
- variant: 'danger',
89
- icon: 'trash',
90
- default: 'Danger Button',
91
- },
92
- }
93
-
94
- export const WithIconLink: Story = {
95
- args: {
96
- variant: 'link',
97
- icon: 'download',
98
- default: 'Download',
99
- },
100
- }
101
-
102
- export const IconOnly: Story = {
103
- args: {
104
- icon: 'plus',
105
- },
106
- }
107
-
108
- export const IconOnlySecondary: Story = {
109
- args: {
110
- variant: 'secondary',
111
- icon: 'plus',
112
- },
113
- }
114
-
115
- export const IconOnlySuccess: Story = {
116
- args: {
117
- variant: 'success',
118
- icon: 'check',
119
- },
120
- }
121
-
122
- export const IconOnlyDanger: Story = {
123
- args: {
124
- variant: 'danger',
125
- icon: 'trash',
126
- },
127
- }
128
-
129
- export const IconOnlyLink: Story = {
130
- args: {
131
- variant: 'link',
132
- icon: 'plus',
133
- },
134
- }
135
-
136
- export const Disabled: Story = {
137
- args: {
138
- default: 'Disabled',
139
- disabled: true,
140
- },
141
- }
142
-
143
- export const DisabledSecondary: Story = {
144
- args: {
145
- variant: 'secondary',
146
- default: 'Secondary Disabled',
147
- disabled: true,
148
- },
149
- }
150
-
151
- export const DisabledSuccess: Story = {
152
- args: {
153
- variant: 'success',
154
- default: 'Success Disabled',
155
- disabled: true,
156
- },
157
- }
158
-
159
- export const DisabledDanger: Story = {
160
- args: {
161
- variant: 'danger',
162
- default: 'Danger Disabled',
163
- disabled: true,
164
- },
165
- }
166
-
167
- export const DisabledLink: Story = {
168
- args: {
169
- variant: 'link',
170
- default: 'Link Disabled',
171
- disabled: true,
172
- },
173
- }
174
-
175
- export const Loading: Story = {
176
- args: {
177
- default: 'Loading',
178
- loading: true,
179
- },
180
- }
181
-
182
- export const LoadingSecondary: Story = {
183
- args: {
184
- variant: 'secondary',
185
- default: 'Loading',
186
- loading: true,
187
- },
188
- }
189
-
190
- export const LoadingSuccess: Story = {
191
- args: {
192
- variant: 'success',
193
- default: 'Loading',
194
- loading: true,
195
- },
196
- }
197
-
198
- export const LoadingDanger: Story = {
199
- args: {
200
- variant: 'danger',
201
- default: 'Loading',
202
- loading: true,
203
- },
204
- }
205
-
206
- export const LoadingLink: Story = {
207
- args: {
208
- variant: 'link',
209
- default: 'Link Button',
210
- loading: true,
211
- },
212
- }