@nexxtmove/ui 0.1.30 → 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 (56) hide show
  1. package/dist/index.d.ts +113 -17
  2. package/dist/index.js +146 -111
  3. package/dist/nuxt.js +26 -25
  4. package/package.json +1 -1
  5. package/src/components/Avatar/Avatar.vue +49 -0
  6. package/src/components/Calendar/_CalendarDayView.vue +1 -1
  7. package/src/components/Chip/Chip.vue +9 -4
  8. package/src/components/Table/Table.vue +2 -2
  9. package/src/components.json +1 -0
  10. package/src/index.ts +1 -0
  11. package/src/components/AnimatedNumber/AnimatedNumber.stories.ts +0 -15
  12. package/src/components/AnimatedNumber/AnimatedNumber.test.ts +0 -56
  13. package/src/components/Button/Button.stories.ts +0 -212
  14. package/src/components/Button/Button.test.ts +0 -318
  15. package/src/components/Calendar/Calendar.stories.ts +0 -91
  16. package/src/components/Calendar/Calendar.test.ts +0 -279
  17. package/src/components/Calendar/_CalendarDayView.test.ts +0 -104
  18. package/src/components/Calendar/_CalendarHeader.test.ts +0 -86
  19. package/src/components/Calendar/_CalendarMonthView.test.ts +0 -52
  20. package/src/components/Calendar/_CalendarYearView.test.ts +0 -56
  21. package/src/components/Checkbox/Checkbox.stories.ts +0 -35
  22. package/src/components/Checkbox/Checkbox.test.ts +0 -55
  23. package/src/components/Chip/Chip.stories.ts +0 -42
  24. package/src/components/Chip/Chip.test.ts +0 -51
  25. package/src/components/CustomerJourneyTile/CustomerJourneyTile.stories.ts +0 -86
  26. package/src/components/CustomerJourneyTile/CustomerJourneyTile.test.ts +0 -178
  27. package/src/components/DatePicker/DatePicker.stories.ts +0 -149
  28. package/src/components/DatePicker/DatePicker.test.ts +0 -191
  29. package/src/components/DropdownButton/DropdownButton.stories.ts +0 -68
  30. package/src/components/DropdownButton/DropdownButton.test.ts +0 -124
  31. package/src/components/Header/Header.stories.ts +0 -54
  32. package/src/components/Header/Header.test.ts +0 -183
  33. package/src/components/Icon/Icon.stories.ts +0 -50
  34. package/src/components/Icon/Icon.test.ts +0 -73
  35. package/src/components/InfoBlock/InfoBlock.stories.ts +0 -90
  36. package/src/components/InfoBlock/InfoBlock.test.ts +0 -101
  37. package/src/components/ProgressBar/ProgressBar.stories.ts +0 -30
  38. package/src/components/ProgressBar/ProgressBar.test.ts +0 -314
  39. package/src/components/SocialIcons/SocialIcons.stories.ts +0 -34
  40. package/src/components/SocialIcons/SocialIcons.test.ts +0 -58
  41. package/src/components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.stories.ts +0 -11
  42. package/src/components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.test.ts +0 -131
  43. package/src/components/SocialMediaTemplate/SocialMediaTemplate.stories.ts +0 -71
  44. package/src/components/SocialMediaTemplate/SocialMediaTemplate.test.ts +0 -466
  45. package/src/components/SocialMediaType/SocialMediaType.stories.ts +0 -43
  46. package/src/components/SocialMediaType/SocialMediaType.test.ts +0 -126
  47. package/src/components/StepperHeader/StepperHeader.stories.ts +0 -47
  48. package/src/components/StepperHeader/StepperHeader.test.ts +0 -244
  49. package/src/components/Table/Table.stories.ts +0 -283
  50. package/src/components/Table/Table.test.ts +0 -220
  51. package/src/components/TimelineEvent/TimelineEvent.stories.ts +0 -291
  52. package/src/components/TimelineEvent/TimelineEvent.test.ts +0 -166
  53. package/src/components/TimelinePhaseblock/TimelinePhaseblock.stories.ts +0 -198
  54. package/src/components/TimelinePhaseblock/TimelinePhaseblock.test.ts +0 -283
  55. package/src/components/Tooltip/Tooltip.stories.ts +0 -146
  56. package/src/components/Tooltip/Tooltip.test.ts +0 -122
package/dist/nuxt.js CHANGED
@@ -1,26 +1,27 @@
1
- import { defineNuxtModule as c, addComponent as s, addTemplate as i } from "@nuxt/kit";
2
- const a = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Button/Button.vue", x = "components/Calendar/Calendar.vue", u = "components/Checkbox/Checkbox.vue", p = "components/Chip/Chip.vue", l = "components/CustomerJourneyTile/CustomerJourneyTile.vue", r = "components/DatePicker/DatePicker.vue", d = "components/DropdownButton/DropdownButton.vue", v = "components/Header/Header.vue", N = "components/Icon/Icon.vue", T = "components/InfoBlock/InfoBlock.vue", C = "components/ProgressBar/ProgressBar.vue", S = "components/SocialIcons/SocialIcons.vue", b = "components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.vue", f = "components/SocialMediaTemplate/SocialMediaTemplate.vue", h = "components/SocialMediaType/SocialMediaType.vue", k = "components/StepperHeader/StepperHeader.vue", B = "components/Table/Table.vue", M = "components/TimelineEvent/TimelineEvent.vue", P = "components/TimelinePhaseblock/TimelinePhaseblock.vue", I = "components/Tooltip/Tooltip.vue", y = {
3
- NexxtAnimatedNumber: a,
4
- NexxtButton: m,
5
- NexxtCalendar: x,
6
- NexxtCheckbox: u,
7
- NexxtChip: p,
8
- NexxtCustomerJourneyTile: l,
9
- NexxtDatePicker: r,
10
- NexxtDropdownButton: d,
11
- NexxtHeader: v,
12
- NexxtIcon: N,
13
- NexxtInfoBlock: T,
14
- NexxtProgressBar: C,
15
- NexxtSocialIcons: S,
16
- NexxtSocialMediaCustomTemplate: b,
17
- NexxtSocialMediaTemplate: f,
18
- NexxtSocialMediaType: h,
19
- NexxtStepperHeader: k,
20
- NexxtTable: B,
21
- NexxtTimelineEvent: M,
22
- NexxtTimelinePhaseblock: P,
23
- NexxtTooltip: I
1
+ import { defineNuxtModule as c, addComponent as s, addTemplate as a } from "@nuxt/kit";
2
+ const i = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Avatar/Avatar.vue", x = "components/Button/Button.vue", u = "components/Calendar/Calendar.vue", p = "components/Checkbox/Checkbox.vue", l = "components/Chip/Chip.vue", r = "components/CustomerJourneyTile/CustomerJourneyTile.vue", d = "components/DatePicker/DatePicker.vue", v = "components/DropdownButton/DropdownButton.vue", N = "components/Header/Header.vue", T = "components/Icon/Icon.vue", C = "components/InfoBlock/InfoBlock.vue", S = "components/ProgressBar/ProgressBar.vue", b = "components/SocialIcons/SocialIcons.vue", f = "components/SocialMediaCustomTemplate/SocialMediaCustomTemplate.vue", h = "components/SocialMediaTemplate/SocialMediaTemplate.vue", k = "components/SocialMediaType/SocialMediaType.vue", B = "components/StepperHeader/StepperHeader.vue", M = "components/Table/Table.vue", P = "components/TimelineEvent/TimelineEvent.vue", I = "components/TimelinePhaseblock/TimelinePhaseblock.vue", y = "components/Tooltip/Tooltip.vue", A = {
3
+ NexxtAnimatedNumber: i,
4
+ NexxtAvatar: m,
5
+ NexxtButton: x,
6
+ NexxtCalendar: u,
7
+ NexxtCheckbox: p,
8
+ NexxtChip: l,
9
+ NexxtCustomerJourneyTile: r,
10
+ NexxtDatePicker: d,
11
+ NexxtDropdownButton: v,
12
+ NexxtHeader: N,
13
+ NexxtIcon: T,
14
+ NexxtInfoBlock: C,
15
+ NexxtProgressBar: S,
16
+ NexxtSocialIcons: b,
17
+ NexxtSocialMediaCustomTemplate: f,
18
+ NexxtSocialMediaTemplate: h,
19
+ NexxtSocialMediaType: k,
20
+ NexxtStepperHeader: B,
21
+ NexxtTable: M,
22
+ NexxtTimelineEvent: P,
23
+ NexxtTimelinePhaseblock: I,
24
+ NexxtTooltip: y
24
25
  }, H = c({
25
26
  meta: {
26
27
  name: "@nexxtmove/ui",
@@ -33,13 +34,13 @@ const a = "components/AnimatedNumber/AnimatedNumber.vue", m = "components/Button
33
34
  addCSS: !0
34
35
  },
35
36
  setup(e, o) {
36
- for (const [t, n] of Object.entries(y))
37
+ for (const [t, n] of Object.entries(A))
37
38
  s({
38
39
  name: t,
39
40
  export: "default",
40
41
  filePath: `@nexxtmove/ui/${n}`
41
42
  });
42
- e.addCSS && (i({
43
+ e.addCSS && (a({
43
44
  filename: "nexxtmove-ui.css",
44
45
  getContents: () => `
45
46
  @import "tailwindcss";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+
4
+ interface NexxtAvatarProps {
5
+ name: string
6
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
7
+ }
8
+
9
+ defineOptions({
10
+ name: 'NexxtAvatar',
11
+ })
12
+
13
+ const props = withDefaults(defineProps<NexxtAvatarProps>(), {
14
+ size: 'sm',
15
+ })
16
+
17
+ const computedInitials = computed(() => {
18
+ if (!props.name?.trim()) return ''
19
+
20
+ const parts = props.name.trim().split(/\s+/)
21
+ if (parts.length >= 2) {
22
+ const firstInitial = parts[0][0]
23
+ const lastInitial = parts[parts.length - 1][0]
24
+
25
+ return (firstInitial + lastInitial).toUpperCase()
26
+ }
27
+
28
+ return parts[0].substring(0, 2).toUpperCase()
29
+ })
30
+
31
+ const sizeClasses = {
32
+ xs: 'h-6 w-6 text-[10px]',
33
+ sm: 'h-8 w-8 text-sm',
34
+ md: 'h-10 w-10 text-base',
35
+ lg: 'h-12 w-12 text-lg',
36
+ xl: 'h-16 w-16 text-xl',
37
+ }
38
+ </script>
39
+
40
+ <template>
41
+ <div
42
+ :class="[
43
+ 'relative flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-cornflower-blue-50 font-semibold text-cornflower-blue-500',
44
+ sizeClasses[size],
45
+ ]"
46
+ >
47
+ {{ computedInitials }}
48
+ </div>
49
+ </template>
@@ -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,5 +1,6 @@
1
1
  {
2
2
  "NexxtAnimatedNumber": "components/AnimatedNumber/AnimatedNumber.vue",
3
+ "NexxtAvatar": "components/Avatar/Avatar.vue",
3
4
  "NexxtButton": "components/Button/Button.vue",
4
5
  "NexxtCalendar": "components/Calendar/Calendar.vue",
5
6
  "NexxtCheckbox": "components/Checkbox/Checkbox.vue",
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // This file is auto-generated by scripts/generate-index.ts
2
2
  export { default as NexxtAnimatedNumber } from './components/AnimatedNumber/AnimatedNumber.vue'
3
+ export { default as NexxtAvatar } from './components/Avatar/Avatar.vue'
3
4
  export { default as NexxtButton } from './components/Button/Button.vue'
4
5
  export { default as NexxtCalendar } from './components/Calendar/Calendar.vue'
5
6
  export { default as NexxtCheckbox } from './components/Checkbox/Checkbox.vue'
@@ -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,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
- }