@cnamts/synapse 0.0.11-alpha → 0.0.12-alpha

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 (108) hide show
  1. package/dist/design-system-v3.js +3878 -3189
  2. package/dist/design-system-v3.umd.cjs +1 -1
  3. package/dist/src/components/Amelipro/types/languages.d.ts +6 -0
  4. package/dist/src/components/Amelipro/types/types.d.ts +65 -0
  5. package/dist/src/components/CookieBanner/CookieBanner.d.ts +1 -1
  6. package/dist/src/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -0
  7. package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +29 -23
  8. package/dist/src/components/Customs/SyTextField/types.d.ts +1 -0
  9. package/dist/src/components/DatePicker/DatePicker.d.ts +70 -59
  10. package/dist/src/components/DatePicker/DateTextInput.d.ts +67 -56
  11. package/dist/src/components/ErrorPage/ErrorPage.d.ts +1 -1
  12. package/dist/src/components/FileList/FileList.d.ts +1 -0
  13. package/dist/src/components/FileList/UploadItem/UploadItem.d.ts +1 -1
  14. package/dist/src/components/FilterSideBar/FilterSideBar.d.ts +31 -0
  15. package/dist/src/components/FilterSideBar/locales.d.ts +7 -0
  16. package/dist/src/components/FilterSideBar/tests/FilterSideBar.spec.d.ts +1 -0
  17. package/dist/src/components/LangBtn/LangBtn.d.ts +2 -2
  18. package/dist/src/components/NirField/NirField.d.ts +940 -0
  19. package/dist/src/components/NotificationBar/NotificationBar.d.ts +1 -1
  20. package/dist/src/components/PasswordField/PasswordField.d.ts +40 -8
  21. package/dist/src/components/PeriodField/PeriodField.d.ts +142 -120
  22. package/dist/src/components/PhoneField/PhoneField.d.ts +11 -2
  23. package/dist/src/components/RatingPicker/EmotionPicker/EmotionPicker.d.ts +1 -1
  24. package/dist/src/components/RatingPicker/NumberPicker/NumberPicker.d.ts +1 -1
  25. package/dist/src/components/RatingPicker/StarsPicker/StarsPicker.d.ts +1 -1
  26. package/dist/src/components/UploadWorkflow/config.d.ts +29 -0
  27. package/dist/src/components/UploadWorkflow/locales.d.ts +7 -0
  28. package/dist/src/components/UploadWorkflow/tests/UploadWorkflow.spec.d.ts +1 -0
  29. package/dist/src/components/UploadWorkflow/types.d.ts +19 -0
  30. package/dist/src/components/UploadWorkflow/useFileList.d.ts +10 -0
  31. package/dist/src/components/UploadWorkflow/useFileUploadJourney.d.ts +9 -0
  32. package/dist/src/components/index.d.ts +2 -0
  33. package/dist/src/composables/rules/useFieldValidation.d.ts +1 -0
  34. package/dist/src/composables/validation/tests/useValidation.spec.d.ts +1 -0
  35. package/dist/src/composables/validation/useValidation.d.ts +39 -0
  36. package/dist/src/designTokens/index.d.ts +3 -1
  37. package/dist/src/vuetifyConfig.d.ts +81 -0
  38. package/dist/style.css +1 -1
  39. package/package.json +1 -1
  40. package/src/assets/_elevations.scss +89 -0
  41. package/src/assets/_fonts.scss +6 -0
  42. package/src/assets/_radius.scss +86 -0
  43. package/src/assets/_spacers.scss +149 -0
  44. package/src/assets/settings.scss +7 -3
  45. package/src/assets/tokens.scss +32 -29
  46. package/src/components/Amelipro/types/languages.d.ts +6 -0
  47. package/src/components/Amelipro/types/types.d.ts +65 -0
  48. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +65 -0
  49. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +13 -3
  50. package/src/components/Customs/SySelect/SySelect.stories.ts +88 -5
  51. package/src/components/Customs/SySelect/SySelect.vue +36 -10
  52. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +135 -2
  53. package/src/components/Customs/SyTextField/SyTextField.stories.ts +576 -85
  54. package/src/components/Customs/SyTextField/SyTextField.vue +132 -104
  55. package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +190 -38
  56. package/src/components/Customs/SyTextField/types.d.ts +1 -0
  57. package/src/components/DatePicker/DatePicker.vue +405 -137
  58. package/src/components/DatePicker/DateTextInput.vue +15 -0
  59. package/src/components/DatePicker/tests/DatePicker.spec.ts +8 -15
  60. package/src/components/FileList/FileList.vue +2 -1
  61. package/src/components/FileList/UploadItem/UploadItem.vue +10 -0
  62. package/src/components/FileUpload/FileUpload.stories.ts +84 -0
  63. package/src/components/FileUpload/FileUpload.vue +1 -0
  64. package/src/components/FileUpload/tests/FileUpload.spec.ts +4 -4
  65. package/src/components/FilterInline/FilterInline.mdx +180 -34
  66. package/src/components/FilterInline/FilterInline.stories.ts +363 -6
  67. package/src/components/FilterSideBar/FilterSideBar.mdx +237 -0
  68. package/src/components/FilterSideBar/FilterSideBar.stories.ts +798 -0
  69. package/src/components/FilterSideBar/FilterSideBar.vue +193 -0
  70. package/src/components/FilterSideBar/locales.ts +8 -0
  71. package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +305 -0
  72. package/src/components/FilterSideBar/tests/__snapshots__/FilterSideBar.spec.ts.snap +39 -0
  73. package/src/components/HeaderBar/Usages.mdx +1 -1
  74. package/src/components/NirField/NirField.stories.ts +573 -29
  75. package/src/components/NirField/NirField.vue +397 -359
  76. package/src/components/NirField/tests/NirField.spec.ts +88 -52
  77. package/src/components/NirField/tests//342/200/257dataset/342/200/257.md +12 -0
  78. package/src/components/NotificationBar/Accessibilite.stories.ts +4 -0
  79. package/src/components/NotificationBar/NotificationBar.stories.ts +18 -13
  80. package/src/components/PasswordField/PasswordField.mdx +129 -47
  81. package/src/components/PasswordField/PasswordField.stories.ts +924 -120
  82. package/src/components/PasswordField/PasswordField.vue +209 -99
  83. package/src/components/PasswordField/tests/PasswordField.spec.ts +138 -9
  84. package/src/components/PeriodField/PeriodField.vue +55 -54
  85. package/src/components/PhoneField/PhoneField.stories.ts +69 -0
  86. package/src/components/PhoneField/PhoneField.vue +3 -0
  87. package/src/components/PhoneField/indicatifs.ts +1 -1
  88. package/src/components/UploadWorkflow/UploadWorkflow.mdx +75 -0
  89. package/src/components/UploadWorkflow/UploadWorkflow.stories.ts +943 -0
  90. package/src/components/UploadWorkflow/UploadWorkflow.vue +230 -0
  91. package/src/components/UploadWorkflow/config.ts +29 -0
  92. package/src/components/UploadWorkflow/locales.ts +8 -0
  93. package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +257 -0
  94. package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +54 -0
  95. package/src/components/UploadWorkflow/types.ts +21 -0
  96. package/src/components/UploadWorkflow/useFileList.ts +84 -0
  97. package/src/components/UploadWorkflow/useFileUploadJourney.ts +18 -0
  98. package/src/components/index.ts +2 -0
  99. package/src/composables/rules/useFieldValidation.ts +5 -2
  100. package/src/composables/validation/tests/useValidation.spec.ts +154 -0
  101. package/src/composables/validation/useValidation.ts +165 -0
  102. package/src/designTokens/index.ts +4 -0
  103. package/src/stories/Demarrer/Accueil.mdx +1 -1
  104. package/src/stories/DesignTokens/ThemePA.mdx +4 -30
  105. package/src/stories/GuideDuDev/UtiliserLesRules.mdx +319 -76
  106. package/src/stories/GuideDuDev/moduleDeNotification.mdx +1 -1
  107. package/src/vuetifyConfig.ts +61 -0
  108. package/src/composables/useFilterable/__snapshots__/useFilterable.spec.ts.snap +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnamts/synapse",
3
- "version": "0.0.11-alpha",
3
+ "version": "0.0.12-alpha",
4
4
  "private": false,
5
5
  "description": "CNAM DS v3",
6
6
  "type": "module",
@@ -0,0 +1,89 @@
1
+ // Define theme elevation adjustments
2
+ $elevation-cnam: 2px;
3
+ $elevation-pa: 2px;
4
+
5
+ // Modify elevations to include $elevation-cnam and $elevation-pa dynamically
6
+ $cnam-elevation: (
7
+ 0: none,
8
+ 1: 0 1px calc(3px + #{$elevation-cnam}) rgb(0 0 0 / 12%),
9
+ 2: 0 1px calc(5px + #{$elevation-cnam}) rgb(0 0 0 / 16%),
10
+ 3: 0 1px calc(8px + #{$elevation-cnam}) rgb(0 0 0 / 24%),
11
+ 4: 0 2px calc(4px + #{$elevation-cnam}) rgb(0 0 0 / 24%),
12
+ 5: 0 2px calc(6px + #{$elevation-cnam}) rgb(0 0 0 / 28%),
13
+ 6: 0 3px calc(6px + #{$elevation-cnam}) rgb(0 0 0 / 32%),
14
+ 7: 0 3px calc(8px + #{$elevation-cnam}) rgb(0 0 0 / 36%),
15
+ 8: 0 4px calc(8px + #{$elevation-cnam}) rgb(0 0 0 / 40%),
16
+ 9: 0 4px calc(10px + #{$elevation-cnam}) rgb(0 0 0 / 44%),
17
+ 10: 0 5px calc(10px + #{$elevation-cnam}) rgb(0 0 0 / 48%),
18
+ 12: 0 6px calc(12px + #{$elevation-cnam}) rgb(0 0 0 / 52%),
19
+ 14: 0 7px calc(14px + #{$elevation-cnam}) rgb(0 0 0 / 56%),
20
+ 16: 0 8px calc(16px + #{$elevation-cnam}) rgb(0 0 0 / 60%),
21
+ 18: 0 9px calc(18px + #{$elevation-cnam}) rgb(0 0 0 / 64%),
22
+ 20: 0 10px calc(20px + #{$elevation-cnam}) rgb(0 0 0 / 68%),
23
+ 24: 0 12px calc(24px + #{$elevation-cnam}) rgb(0 0 0 / 72%),
24
+ 28: 0 14px calc(28px + #{$elevation-cnam}) rgb(0 0 0 / 76%),
25
+ 32: 0 16px calc(32px + #{$elevation-cnam}) rgb(0 0 0 / 80%)
26
+ );
27
+ $pa-elevation: (
28
+ 0: none,
29
+ 1: 0 1px calc(3px + #{$elevation-pa}) rgb(0 0 0 / 10%),
30
+ 2: 0 1px calc(5px + #{$elevation-pa}) rgb(0 0 0 / 14%),
31
+ 3: 0 1px calc(8px + #{$elevation-pa}) rgb(0 0 0 / 20%),
32
+ 4: 0 2px calc(4px + #{$elevation-pa}) rgb(0 0 0 / 20%),
33
+ 5: 0 2px calc(6px + #{$elevation-pa}) rgb(0 0 0 / 24%),
34
+ 6: 0 3px calc(6px + #{$elevation-pa}) rgb(0 0 0 / 28%),
35
+ 7: 0 3px calc(8px + #{$elevation-pa}) rgb(0 0 0 / 32%),
36
+ 8: 0 4px calc(8px + #{$elevation-pa}) rgb(0 0 0 / 36%),
37
+ 9: 0 4px calc(10px + #{$elevation-pa}) rgb(0 0 0 / 40%),
38
+ 10: 0 5px calc(10px + #{$elevation-pa}) rgb(0 0 0 / 44%),
39
+ 12: 0 6px calc(12px + #{$elevation-pa}) rgb(0 0 0 / 48%),
40
+ 14: 0 7px calc(14px + #{$elevation-pa}) rgb(0 0 0 / 52%),
41
+ 16: 0 8px calc(16px + #{$elevation-pa}) rgb(0 0 0 / 56%),
42
+ 18: 0 9px calc(18px + #{$elevation-pa}) rgb(0 0 0 / 60%),
43
+ 20: 0 10px calc(20px + #{$elevation-pa}) rgb(0 0 0 / 64%),
44
+ 24: 0 12px calc(24px + #{$elevation-pa}) rgb(0 0 0 / 68%),
45
+ 28: 0 14px calc(28px + #{$elevation-pa}) rgb(0 0 0 / 72%),
46
+ 32: 0 16px calc(32px + #{$elevation-pa}) rgb(0 0 0 / 76%)
47
+ );
48
+
49
+ // Define CSS variables globally
50
+ :root {
51
+ --elevation-cnam: #{$elevation-cnam};
52
+ --elevation-pa: #{$elevation-pa};
53
+
54
+ @each $key, $value in $cnam-elevation {
55
+ --elevation-#{$key}: #{$value};
56
+ }
57
+ }
58
+
59
+ // Apply theme-based CNAM
60
+ .theme-cnam {
61
+ @each $key, $value in $cnam-elevation {
62
+ --elevation-#{$key}: #{$value};
63
+ }
64
+ }
65
+
66
+ // Apply theme-based PA
67
+ .theme-pa {
68
+ @each $key, $value in $pa-elevation {
69
+ --elevation-#{$key}: #{$value};
70
+ }
71
+ }
72
+
73
+ // Mixin to generate elevation classes dynamically
74
+ @mixin generate-elevation-classes($prefix) {
75
+ @each $key, $value in $cnam-elevation {
76
+ .#{$prefix}-#{$key} {
77
+ box-shadow: var(--elevation-#{$key}) !important;
78
+ }
79
+ }
80
+ }
81
+
82
+ // Generate elevation classes
83
+ @include generate-elevation-classes('elevation');
84
+
85
+ // Ex of additional classes for specific shadow
86
+
87
+ /* .v-btn {
88
+ box-shadow: var(--elevation-2) !important;
89
+ } */
@@ -0,0 +1,6 @@
1
+ @use 'vuetify/settings' with (
2
+ $body-font-family: Arial
3
+ );
4
+
5
+ // Forward Vuetify settings
6
+ @forward 'vuetify/settings';
@@ -0,0 +1,86 @@
1
+ // Define theme radius separately
2
+ $border-radius-cnam: 4px;
3
+ $border-radius-pa: 4px;
4
+ $cnam-radius: (
5
+ 0: 0px,
6
+ 'sm': calc($border-radius-cnam / 2),
7
+ 'md': $border-radius-cnam,
8
+ 'lg': calc($border-radius-cnam * 2),
9
+ 'xl': calc($border-radius-cnam * 4),
10
+ 'pill': 9999px,
11
+ 'circle': 50%
12
+ );
13
+ $pa-radius: (
14
+ 0: 0px,
15
+ 'sm': calc($border-radius-pa / 2),
16
+ 'md': $border-radius-pa,
17
+ 'lg': calc($border-radius-pa * 2),
18
+ 'xl': calc($border-radius-pa * 4),
19
+ 'pill': 9999px,
20
+ 'circle': 50%
21
+ );
22
+
23
+ // Define all possible radius keys to ensure consistent class generation
24
+ $radius-keys: (0, 'sm', 'md', 'lg', 'xl', 'pill', 'circle');
25
+
26
+ // ✅ Define CSS variables globally
27
+ :root {
28
+ @each $key, $value in $cnam-radius {
29
+ --radius-#{$key}: #{$value};
30
+ }
31
+ }
32
+
33
+ // ✅ Apply theme-based cnam
34
+ .theme-cnam {
35
+ @each $key, $value in $cnam-radius {
36
+ --radius-#{$key}: #{$value};
37
+ }
38
+ }
39
+
40
+ // ✅ Apply theme-based pa
41
+ .theme-pa {
42
+ @each $key, $value in $pa-radius {
43
+ --radius-#{$key}: #{$value};
44
+ }
45
+ }
46
+
47
+ // ✅ Mixin to generate border-radius classes
48
+ @mixin generate-radius-classes($prefix) {
49
+ @each $key in $radius-keys {
50
+ .#{$prefix}-#{$key} {
51
+ border-radius: var(--radius-#{$key}) !important;
52
+ }
53
+ }
54
+ }
55
+
56
+ // ✅ Generate radius classes once, using CSS variables
57
+ @include generate-radius-classes('rounded');
58
+
59
+ // Additional classes for specific radius
60
+ .v-btn {
61
+ border-radius: var(--radius-md) !important;
62
+ }
63
+
64
+ .v-btn--rounded-md {
65
+ border-radius: var(--radius-md) !important;
66
+ }
67
+
68
+ .v-btn--rounded-sm {
69
+ border-radius: var(--radius-sm) !important;
70
+ }
71
+
72
+ .v-btn--rounded-lg {
73
+ border-radius: var(--radius-lg) !important;
74
+ }
75
+
76
+ .v-btn--rounded-xl {
77
+ border-radius: var(--radius-xl) !important;
78
+ }
79
+
80
+ .v-btn--rounded-pill {
81
+ border-radius: var(--radius-pill) !important;
82
+ }
83
+
84
+ .v-btn--rounded-circle {
85
+ border-radius: var(--radius-circle) !important;
86
+ }
@@ -0,0 +1,149 @@
1
+ // Define base spacer values
2
+ $base-spacer-cnam: 4px;
3
+ $base-spacer-pa: 4px;
4
+
5
+ // Define theme spacers using base values
6
+ $cnam-spacers: (
7
+ 0: 0px,
8
+ 1: $base-spacer-cnam,
9
+ 2: $base-spacer-cnam * 2,
10
+ 3: $base-spacer-cnam * 3,
11
+ 4: $base-spacer-cnam * 4,
12
+ 5: $base-spacer-cnam * 5,
13
+ 6: $base-spacer-cnam * 6,
14
+ 7: $base-spacer-cnam * 7,
15
+ 8: $base-spacer-cnam * 8,
16
+ 9: $base-spacer-cnam * 9,
17
+ 10: $base-spacer-cnam * 10,
18
+ 11: $base-spacer-cnam * 11,
19
+ 12: $base-spacer-cnam * 12,
20
+ 13: $base-spacer-cnam * 13,
21
+ 14: $base-spacer-cnam * 14,
22
+ 15: $base-spacer-cnam * 15,
23
+ 16: $base-spacer-cnam * 16,
24
+ 17: $base-spacer-cnam * 17,
25
+ 18: $base-spacer-cnam * 18,
26
+ 19: $base-spacer-cnam * 19,
27
+ 20: $base-spacer-cnam * 20,
28
+ 24: $base-spacer-cnam * 24,
29
+ 28: $base-spacer-cnam * 28,
30
+ 32: $base-spacer-cnam * 32,
31
+ 36: $base-spacer-cnam * 36,
32
+ 40: $base-spacer-cnam * 40,
33
+ 44: $base-spacer-cnam * 44,
34
+ 48: $base-spacer-cnam * 48,
35
+ 52: $base-spacer-cnam * 52,
36
+ 56: $base-spacer-cnam * 56,
37
+ 60: $base-spacer-cnam * 60,
38
+ 64: $base-spacer-cnam * 64,
39
+ );
40
+ $pa-spacers: (
41
+ 0: 0px,
42
+ 1: $base-spacer-pa,
43
+ 2: $base-spacer-pa * 2,
44
+ 3: $base-spacer-pa * 3,
45
+ 4: $base-spacer-pa * 4,
46
+ 5: $base-spacer-pa * 5,
47
+ 6: $base-spacer-pa * 6,
48
+ 7: $base-spacer-pa * 7,
49
+ 8: $base-spacer-pa * 8,
50
+ 9: $base-spacer-pa * 9,
51
+ 10: $base-spacer-pa * 10,
52
+ 11: $base-spacer-pa * 11,
53
+ 12: $base-spacer-pa * 12,
54
+ 13: $base-spacer-pa * 13,
55
+ 14: $base-spacer-pa * 14,
56
+ 15: $base-spacer-pa * 15,
57
+ 16: $base-spacer-pa * 16,
58
+ 17: $base-spacer-pa * 17,
59
+ 18: $base-spacer-pa * 18,
60
+ 19: $base-spacer-pa * 19,
61
+ 20: $base-spacer-pa * 20,
62
+ 24: $base-spacer-pa * 24,
63
+ 28: $base-spacer-pa * 28,
64
+ 32: $base-spacer-pa * 32,
65
+ 36: $base-spacer-pa * 36,
66
+ 40: $base-spacer-pa * 40,
67
+ 44: $base-spacer-pa * 44,
68
+ 48: $base-spacer-pa * 48,
69
+ 52: $base-spacer-pa * 52,
70
+ 56: $base-spacer-pa * 56,
71
+ 60: $base-spacer-pa * 60,
72
+ 64: $base-spacer-pa * 64,
73
+ );
74
+
75
+ // Define CSS variables for spacers dynamically
76
+ :root {
77
+ @each $key, $value in $cnam-spacers {
78
+ --spacing-#{$key}: #{$value};
79
+ }
80
+ }
81
+
82
+ // Apply theme-based spacing
83
+ .theme-cnam {
84
+ @each $key, $value in $cnam-spacers {
85
+ --spacing-#{$key}: #{$value};
86
+ }
87
+ }
88
+
89
+ .theme-pa {
90
+ @each $key, $value in $pa-spacers {
91
+ --spacing-#{$key}: #{$value};
92
+ }
93
+ }
94
+
95
+ // Mixin to generate padding and margin classes
96
+ @mixin generate-spacing-classes($property, $prefix) {
97
+ @for $i from 0 through 64 {
98
+ .#{$prefix}-#{$i} {
99
+ #{$property}: var(--spacing-#{$i}) !important;
100
+ }
101
+ }
102
+ }
103
+
104
+ // Apply spacing classes dynamically
105
+ @include generate-spacing-classes(padding, pa);
106
+ @include generate-spacing-classes(margin, ma);
107
+
108
+ // Mixin for X (left & right) and Y (top & bottom) spacing
109
+ @mixin generate-axis-spacing-classes($property, $prefix, $side1, $side2) {
110
+ @for $i from 0 through 64 {
111
+ .#{$prefix}-#{$i} {
112
+ #{$property}-#{$side1}: var(--spacing-#{$i}) !important;
113
+ #{$property}-#{$side2}: var(--spacing-#{$i}) !important;
114
+ }
115
+ }
116
+ }
117
+
118
+ // Generate px, py, mx, my spacing classes
119
+ @include generate-axis-spacing-classes(padding, px, left, right);
120
+ @include generate-axis-spacing-classes(padding, py, top, bottom);
121
+ @include generate-axis-spacing-classes(margin, mx, left, right);
122
+ @include generate-axis-spacing-classes(margin, my, top, bottom);
123
+
124
+ // Mixin for individual side spacing classes
125
+ @mixin generate-side-spacing-classes($property, $prefix, $side) {
126
+ @for $i from 0 through 64 {
127
+ .#{$prefix}-#{$i} {
128
+ #{$property}-#{$side}: var(--spacing-#{$i}) !important;
129
+ }
130
+ }
131
+ }
132
+
133
+ // Generate individual side padding classes
134
+ @include generate-side-spacing-classes(padding, pt, top);
135
+ @include generate-side-spacing-classes(padding, pr, right);
136
+ @include generate-side-spacing-classes(padding, pb, bottom);
137
+ @include generate-side-spacing-classes(padding, pl, left);
138
+
139
+ // Generate individual side margin classes
140
+ @include generate-side-spacing-classes(margin, mt, top);
141
+ @include generate-side-spacing-classes(margin, mr, right);
142
+ @include generate-side-spacing-classes(margin, mb, bottom);
143
+ @include generate-side-spacing-classes(margin, ml, left);
144
+
145
+ // Additional classes for specific spacing
146
+
147
+ .v-btn {
148
+ padding: 0 var(--spacing-4) !important;
149
+ }
@@ -1,6 +1,6 @@
1
- @use 'vuetify/settings' with (
2
- $body-font-family: Arial,
3
- );
1
+ @use 'fonts';
2
+ @use 'spacers';
3
+ @use 'radius';
4
4
 
5
5
  .v-btn {
6
6
  text-transform: inherit !important;
@@ -12,3 +12,7 @@
12
12
  .v-btn.v-tab {
13
13
  text-transform: uppercase !important;
14
14
  }
15
+
16
+ .v-tooltip .v-overlay__content {
17
+ background-color: rgb(0 0 0 / 70%) !important;
18
+ }
@@ -419,35 +419,38 @@ $spacing-horizontal-xx-large: 56px;
419
419
  $spacing-horizontal-xxx-large: 64px;
420
420
  $spacing-horizontal-huge: 80px;
421
421
 
422
- // Surcharger toutes les élévations pour utiliser uniquement l'élévation 02
423
- .elevation-1,
424
- .elevation-2,
425
- .elevation-3,
426
- .elevation-4,
427
- .elevation-5,
428
- .elevation-6,
429
- .elevation-7,
430
- .elevation-8,
431
- .elevation-9,
432
- .elevation-10,
433
- .elevation-11,
434
- .elevation-12,
435
- .elevation-13,
436
- .elevation-14,
437
- .elevation-15,
438
- .elevation-16,
439
- .elevation-17,
440
- .elevation-18,
441
- .elevation-19,
442
- .elevation-20,
443
- .elevation-21,
444
- .elevation-22,
445
- .elevation-23,
446
- .elevation-24 {
447
- box-shadow:
448
- 0 3px 1px -2px rgb(0 0 0 / 20%),
449
- 0 2px 2px 0 rgb(0 0 0 / 14%),
450
- 0 1px 5px 0 rgb(0 0 0 / 12%) !important;
422
+ .theme-cnam,
423
+ .theme-pa {
424
+ // Surcharger toutes les élévations pour utiliser uniquement l'élévation 02
425
+ .elevation-1,
426
+ .elevation-2,
427
+ .elevation-3,
428
+ .elevation-4,
429
+ .elevation-5,
430
+ .elevation-6,
431
+ .elevation-7,
432
+ .elevation-8,
433
+ .elevation-9,
434
+ .elevation-10,
435
+ .elevation-11,
436
+ .elevation-12,
437
+ .elevation-13,
438
+ .elevation-14,
439
+ .elevation-15,
440
+ .elevation-16,
441
+ .elevation-17,
442
+ .elevation-18,
443
+ .elevation-19,
444
+ .elevation-20,
445
+ .elevation-21,
446
+ .elevation-22,
447
+ .elevation-23,
448
+ .elevation-24 {
449
+ box-shadow:
450
+ 0 3px 1px -2px rgb(0 0 0 / 20%),
451
+ 0 2px 2px 0 rgb(0 0 0 / 14%),
452
+ 0 1px 5px 0 rgb(0 0 0 / 12%) !important;
453
+ }
451
454
  }
452
455
 
453
456
  // global.scss
@@ -0,0 +1,6 @@
1
+ declare module 'languages' {
2
+ import type { Language } from './types.d.ts'
3
+
4
+ export function getLanguageInfo(langCode: string): Language
5
+ export function getAllLanguageCode(): string[]
6
+ };
@@ -0,0 +1,65 @@
1
+ export interface Link {
2
+ id: number
3
+ url: string
4
+ name: string
5
+ }
6
+
7
+ export interface IndexedObject<T = string> {
8
+ [key: string]: T
9
+ }
10
+
11
+ export type Refs<T extends Record<string, unknown>> = Vue['$refs'] & T
12
+
13
+ export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'smAndDown' | 'smAndUp' | 'mdAndDown' | 'mdAndUp' | 'lgAndDown' | 'lgAndUp' | 'xlAndDown'
14
+
15
+ export interface IDataListItem {
16
+ id: number
17
+ [key: string]: string | number | undefined
18
+ accordionTitle?: string
19
+ }
20
+
21
+ export interface Theme {
22
+ primary: string
23
+ secondary: string
24
+ info: string
25
+ warning: string
26
+ error: string
27
+ success: string
28
+ }
29
+
30
+ export interface VuetifyTheme extends Theme {
31
+ [key: string]: string
32
+ }
33
+
34
+ export interface Color {
35
+ darken1?: string
36
+ darken2?: string
37
+ darken3?: string
38
+ darken4?: string
39
+ darken5?: string
40
+ darken6?: string
41
+ base: string
42
+ lighten1?: string
43
+ lighten2?: string
44
+ lighten3?: string
45
+ lighten4?: string
46
+ lighten5?: string
47
+ lighten6?: string
48
+ }
49
+
50
+ export interface Palette {
51
+ apBlue: Color
52
+ apGrey: Color
53
+ apWhite: Color
54
+ apBlack: Color
55
+ apYellow: Color
56
+ apGreen: Color
57
+ apRed: Color
58
+ apTurquoise: Color
59
+ apParme: Color
60
+ apPink: Color
61
+ }
62
+
63
+ export type Colors = Theme & Palette
64
+
65
+ export type ValidateOn = 'lazy' | ('input' | 'blur' | 'submit') | 'input lazy' | 'blur lazy' | 'submit lazy' | 'lazy input' | 'lazy blur' | 'lazy submit' | undefined
@@ -20,6 +20,7 @@ const meta = {
20
20
  textKey: { control: 'text' },
21
21
  valueKey: { control: 'text' },
22
22
  vuetifyOptions: { control: 'object' },
23
+ displayAsterisk: { control: 'boolean' },
23
24
  },
24
25
  } as Meta<typeof SyInputSelect>
25
26
 
@@ -149,6 +150,70 @@ export const Required: Story = {
149
150
  },
150
151
  }
151
152
 
153
+ export const RequiredWithAsterisk: Story = {
154
+ parameters: {
155
+ docs: {
156
+ description: {
157
+ story: 'Version du champ de sélection requis avec un astérisque visuel.',
158
+ },
159
+ },
160
+ sourceCode: [
161
+ {
162
+ name: 'Template',
163
+ code: `
164
+ <template>
165
+ <SyInputSelect
166
+ v-model="value"
167
+ :items="items"
168
+ label="Sélectionnez une option"
169
+ required
170
+ display-asterisk
171
+ />
172
+ </template>
173
+ `,
174
+ },
175
+ {
176
+ name: 'Script',
177
+ code: `
178
+ <script setup lang="ts">
179
+ import { ref } from 'vue'
180
+ import SyInputSelect from '@cnamts/synapse'
181
+
182
+ const value = ref('')
183
+ const items = [
184
+ { text: 'Option 1', value: '1' },
185
+ { text: 'Option 2', value: '2' },
186
+ ]
187
+ </script>
188
+ `,
189
+ },
190
+ ],
191
+ },
192
+ args: {
193
+ ...Default.args,
194
+ label: 'Sélectionnez une option',
195
+ required: true,
196
+ displayAsterisk: true,
197
+ },
198
+ render: (args) => {
199
+ return {
200
+ components: { SyInputSelect },
201
+ setup() {
202
+ return { args }
203
+ },
204
+ template: `
205
+ <div class="pa-4">
206
+ <SyInputSelect
207
+ v-bind="args"
208
+ :required="args.required"
209
+ :display-asterisk="args.displayAsterisk"
210
+ />
211
+ </div>
212
+ `,
213
+ }
214
+ },
215
+ }
216
+
152
217
  export const withCustomError: Story = {
153
218
  parameters: {
154
219
  sourceCode: [
@@ -14,6 +14,7 @@
14
14
  required?: boolean
15
15
  errorMessages?: string | string[]
16
16
  isHeaderToolbar?: boolean
17
+ displayAsterisk?: boolean
17
18
  }>(), {
18
19
  modelValue: null,
19
20
  items: () => [],
@@ -24,6 +25,7 @@
24
25
  required: false,
25
26
  errorMessages: () => [],
26
27
  isHeaderToolbar: false,
28
+ displayAsterisk: false,
27
29
  })
28
30
 
29
31
  const options = useCustomizableOptions(defaultOptions, props)
@@ -65,7 +67,15 @@
65
67
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
66
68
  return (selectedItem.value as Record<string, any>)[props.textKey]
67
69
  }
68
- return props.label
70
+ return labelWithAsterisk.value
71
+ })
72
+
73
+ const isShouldDisplayAsterisk = computed(() => {
74
+ return props.displayAsterisk && props.required
75
+ })
76
+
77
+ const labelWithAsterisk = computed(() => {
78
+ return isShouldDisplayAsterisk.value ? `${props.label} *` : props.label
69
79
  })
70
80
 
71
81
  watch(() => props.modelValue, (newValue) => {
@@ -144,8 +154,8 @@
144
154
  :id="inputId"
145
155
  v-model="selectedItem"
146
156
  :error-messages="localErrorMessages"
147
- :label="props.label"
148
- :title="props.label"
157
+ :label="labelWithAsterisk"
158
+ :title="labelWithAsterisk"
149
159
  role="menu"
150
160
  @click="checkForErrors"
151
161
  >