@cityway/basic-ui 1.0.2-beta007 → 1.0.2-beta009

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 (31) hide show
  1. package/cityway-basic-ui-1.0.2-beta009.tgz +0 -0
  2. package/fesm2022/cityway-basic-ui.mjs +81 -7
  3. package/fesm2022/cityway-basic-ui.mjs.map +1 -1
  4. package/index.d.ts +51 -4
  5. package/lib/assets/i18n/common.fr.json +1 -1
  6. package/lib/assets/icons/sprite.preview.html +1 -1
  7. package/lib/assets/styles/scss/cw-ds/_reboot.scss +1 -54
  8. package/lib/assets/styles/scss/cw-ds/_root-fo.scss +4 -0
  9. package/lib/assets/styles/scss/cw-ds/components/_alert.scss +2 -0
  10. package/lib/assets/styles/scss/cw-ds/components/_dropdown.scss +21 -0
  11. package/lib/assets/styles/scss/cw-ds/components/_tooltip.scss +35 -0
  12. package/lib/assets/styles/scss/cw-ds/components/button/_button.scss +5 -0
  13. package/lib/assets/styles/scss/cw-ds/components/form-field/_field-check.scss +130 -0
  14. package/lib/assets/styles/scss/cw-ds/components/form-field/_form-field.scss +146 -0
  15. package/lib/assets/styles/scss/cw-ds/components/form-field/_ng-select.scss +84 -0
  16. package/lib/assets/styles/scss/cw-ds/components/form-field/_slider-range.scss +68 -0
  17. package/lib/assets/styles/scss/cw-ds/mixins/_popover-tooltip.scss +144 -0
  18. package/lib/assets/styles/scss/cw-ds/utilities/_flex.scss +20 -0
  19. package/lib/assets/styles/scss/cw-ds/utilities/_grid.scss +6 -3
  20. package/lib/assets/styles/scss/cw-ds/utilities/_position.scss +24 -0
  21. package/lib/assets/styles/scss/cw-ds/utilities/type/_type-bo.scss +28 -20
  22. package/lib/assets/styles/scss/cw-ds/utilities/type/_type-fo.scss +131 -0
  23. package/lib/assets/styles/scss/cw-ds/utilities/type/_type.scss +9 -7
  24. package/lib/assets/styles/scss/styles-bo.scss +8 -83
  25. package/lib/assets/styles/scss/styles-fo.scss +8 -83
  26. package/package.json +1 -1
  27. package/styles/styles-bo.min.css +1 -1
  28. package/styles/styles-bo.min.css.map +1 -1
  29. package/styles/styles-fo.min.css +1 -1
  30. package/styles/styles-fo.min.css.map +1 -1
  31. package/cityway-basic-ui-1.0.2-beta007.tgz +0 -0
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { EventEmitter, OnInit, AfterViewInit, ElementRef, WritableSignal, ChangeDetectorRef, AfterContentInit, QueryList, TemplateRef, OnDestroy } from '@angular/core';
3
3
  import { BehaviorSubject } from 'rxjs';
4
4
  import { Options } from '@angular-slider/ngx-slider';
5
+ export { Options } from '@angular-slider/ngx-slider';
5
6
  import { AbstractControl, FormGroup, FormControl, ValidationErrors } from '@angular/forms';
6
7
  import { Router, ActivatedRoute } from '@angular/router';
7
8
  import { TranslateService } from '@ngx-translate/core';
@@ -584,6 +585,7 @@ declare class AccordionComponent implements AfterContentInit {
584
585
  }
585
586
 
586
587
  declare enum AlertTypeEnum {
588
+ primary = "primary",
587
589
  info = "info",
588
590
  success = "success",
589
591
  warning = "warning",
@@ -677,6 +679,7 @@ declare class ToastComponent {
677
679
  }
678
680
 
679
681
  declare enum BadgeTypeEnum {
682
+ lightPrimary = "light-primary",
680
683
  lightInfo = "light-info",
681
684
  lightSuccess = "light-success",
682
685
  lightWarning = "light-warning",
@@ -715,7 +718,8 @@ declare class BadgeComponent {
715
718
  declare enum FoButtonTypeEnum {
716
719
  primary = "primary",
717
720
  secondary = "secondary",
718
- link = "link"
721
+ link = "link",
722
+ ghost = "ghost"
719
723
  }
720
724
  declare enum BoButtonTypeEnum {
721
725
  primary = "primary",
@@ -726,7 +730,8 @@ declare enum BoButtonTypeEnum {
726
730
  success = "success",
727
731
  danger = "danger",
728
732
  dangerOutline = "danger-outline",
729
- light = "light"
733
+ light = "light",
734
+ ghost = "ghost"
730
735
  }
731
736
  declare enum ButtonIconSizeEnum {
732
737
  default = "default",
@@ -794,6 +799,7 @@ declare class ButtonComponent implements OnInit {
794
799
  readonly iconType: typeof IconTypeEnum;
795
800
  readonly iconUiType: typeof IconUiTypeEnum;
796
801
  readonly buttonIconSizeEnum: typeof ButtonIconSizeEnum;
802
+ readonly spriteIcon: typeof SpriteIconEnum;
797
803
  placementCss: string;
798
804
  isOpen: boolean;
799
805
  tooltipRandomId: number;
@@ -920,6 +926,8 @@ declare class FormFieldComponent implements OnInit {
920
926
  labelTemplate?: TemplateRef<any>;
921
927
  typeField: typeof FormFieldTypeEnum;
922
928
  readonly spriteIcon: typeof SpriteIconEnum;
929
+ readonly buttonType: typeof BoButtonTypeEnum;
930
+ readonly buttonIconSize: typeof ButtonIconSizeEnum;
923
931
  get hostClasses(): string;
924
932
  constructor();
925
933
  get isRange(): boolean;
@@ -1066,6 +1074,7 @@ declare class ModalsComponent implements OnInit, AfterViewInit {
1066
1074
  danger: BoButtonTypeEnum.danger;
1067
1075
  dangerOutline: BoButtonTypeEnum.dangerOutline;
1068
1076
  light: BoButtonTypeEnum.light;
1077
+ ghost: BoButtonTypeEnum.ghost;
1069
1078
  };
1070
1079
  readonly spriteIcon: typeof SpriteIconEnum;
1071
1080
  readonly iconType: typeof IconTypeEnum;
@@ -1230,6 +1239,44 @@ declare class ImageComponent {
1230
1239
  static ɵcmp: i0.ɵɵComponentDeclaration<ImageComponent, "cw-image", never, { "source": { "alias": "source"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "isAriaHidden": { "alias": "isAriaHidden"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never, true, never>;
1231
1240
  }
1232
1241
 
1242
+ declare enum TitleTagEnum {
1243
+ h1 = "h1",
1244
+ h2 = "h2",
1245
+ h3 = "h3",
1246
+ h4 = "h4"
1247
+ }
1248
+ declare enum TitleContextEnum {
1249
+ editorial = "editorial",
1250
+ home = "home",
1251
+ mobility = "mobility",
1252
+ standard = "standard"
1253
+ }
1254
+
1255
+ declare class TitleComponent {
1256
+ tag: i0.InputSignal<TitleTagEnum>;
1257
+ context: i0.InputSignal<TitleContextEnum>;
1258
+ classes: i0.Signal<string>;
1259
+ static ɵfac: i0.ɵɵFactoryDeclaration<TitleComponent, never>;
1260
+ static ɵcmp: i0.ɵɵComponentDeclaration<TitleComponent, "cw-title", never, { "tag": { "alias": "tag"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
1261
+ }
1262
+
1263
+ interface SkipLink {
1264
+ id: string;
1265
+ label: string;
1266
+ }
1267
+
1268
+ declare class SkipLinksComponent {
1269
+ links: i0.InputSignal<SkipLink[]>;
1270
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkipLinksComponent, never>;
1271
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkipLinksComponent, "cw-skiplinks", never, { "links": { "alias": "links"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1272
+ }
1273
+
1274
+ declare class RequiredInfoComponent {
1275
+ allFieldsRequired: i0.InputSignal<boolean>;
1276
+ static ɵfac: i0.ɵɵFactoryDeclaration<RequiredInfoComponent, never>;
1277
+ static ɵcmp: i0.ɵɵComponentDeclaration<RequiredInfoComponent, "cw-required-info", never, { "allFieldsRequired": { "alias": "allFieldsRequired"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1278
+ }
1279
+
1233
1280
  declare class ClickOutsideDirective {
1234
1281
  private elementRef;
1235
1282
  clickOutside: EventEmitter<void>;
@@ -1294,5 +1341,5 @@ interface DataCustomListGroup {
1294
1341
  fields: DataCustomList[];
1295
1342
  }
1296
1343
 
1297
- export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, ResponsiveService, StepperComponent, TabComponent, TabContentComponent, ToastComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
1298
- export type { Attachment, DataCustomList, DataCustomListGroup, DataLegend, FormFieldOption, FormFieldRangeOption, Legend, ModalRef, ShowToastOptions, Toast, ToastAction };
1344
+ export { AccordionComponent, AlertComponent, AlertTypeEnum, BadgeComponent, BadgePositionEnum, BadgeTypeEnum, BoButtonTypeEnum, BoTabTypeEnum, ButtonComponent, ButtonIconSizeEnum, ButtonPositionEnum, CardComponent, CardTitleRankEnum, CardTypeEnum, ClickOutsideDirective, CollapseDirective, DropdownComponent, DropdownItemDirective, FileToDownloadComponent, FoButtonTypeEnum, FoTabTypeEnum, FocusTrackerService, FormFieldComponent, FormFieldTypeEnum, IconComponent, IconNotifSizeEnum, IconNotifTypeEnum, IconNotificationComponent, IconSizeEnum, IconTypeEnum, IconUiTypeEnum, ImageComponent, LegendComponent, LegendTypeEnum, LoaderComponent, ModalsComponent, ModalsService, ModalsSize, ModalsType, NumericalRangeComponent, NumericalRangeLabelPositionEnum, NumericalRangeTypeEnum, PlacementEnum, RequiredInfoComponent, ResponsiveService, SkipLinksComponent, SpriteIconEnum, StepperComponent, TabComponent, TabContentComponent, TitleComponent, TitleContextEnum, TitleTagEnum, ToastComponent, ToastService, TriggerTooltipEnum, TypeTooltipEnum, WizardStepComponent, WizardStepperComponent, rangeValidator };
1345
+ export type { Attachment, DataCustomList, DataCustomListGroup, DataLegend, FormFieldOption, FormFieldRangeOption, Legend, ModalRef, ShowToastOptions, SkipLink, Toast, ToastAction };
@@ -112,7 +112,7 @@
112
112
  "_FORM": {
113
113
  "BACK": "Retour",
114
114
  "ERROR_INVALID_EMAIL": "Format d'e-mail invalide. Exemple : contact@mail.com",
115
- "ERROR_IS_MANDATORY": "Le champs <b>{{label}}</b> est obligatoire.",
115
+ "ERROR_IS_MANDATORY": "Le champ <b>{{label}}</b> est obligatoire.",
116
116
  "ERROR_IS_ONLY_NUMERIC": " ne doit être composé que de chiffres.",
117
117
  "ERROR_REQUIRED_EMAIL": "L'e-mail est requis.",
118
118
  "ERROR_REQUIRED_LANG": "La langue est requise.",
@@ -4963,4 +4963,4 @@
4963
4963
  }
4964
4964
  </script>
4965
4965
  </body>
4966
- </html>
4966
+ </html>
@@ -284,46 +284,6 @@ button {
284
284
  }
285
285
  }
286
286
 
287
- // Input
288
- input[type="text"],
289
- input[type="email"],
290
- input[type="url"],
291
- input[type="password"],
292
- input[type="number"],
293
- input[type="date"],
294
- input[type="datetime-local"],
295
- input[type="month"],
296
- input[type="search"],
297
- input[type="tel"],
298
- input[type="time"],
299
- input[type="week"],
300
- select,
301
- textarea {
302
- width: 100%;
303
- padding: 0.375rem 0.75rem;
304
- font-size: 1rem;
305
- font-weight: 400;
306
- line-height: 1.5;
307
- color: var(--input-color, #212529);
308
- background-color: var(--input-bg, #fff);
309
- background-clip: padding-box;
310
- border: 1px solid var(--input-border-color, #dee2e6);
311
- appearance: none;
312
- border-radius: 0.375rem;
313
- transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
314
- }
315
-
316
- // Textarea
317
- textarea {
318
- resize: vertical;
319
- min-height: 6rem;
320
- }
321
-
322
- // Placeholder
323
- ::placeholder {
324
- color: var(--placeholder-color, #6c757d);
325
- opacity: 1;
326
- }
327
287
 
328
288
  // Désactiver le spinner pour les inputs number
329
289
  input[type="number"]::-webkit-inner-spin-button,
@@ -355,13 +315,8 @@ fieldset {
355
315
  }
356
316
 
357
317
  legend {
358
- float: left;
359
- width: 100%;
360
318
  padding: 0;
361
- margin-bottom: 0.5rem;
362
- font-size: 1.5rem;
363
- font-weight: 600;
364
- line-height: inherit;
319
+ margin-bottom: 0;
365
320
 
366
321
  + * {
367
322
  clear: left;
@@ -371,7 +326,6 @@ legend {
371
326
  // Label
372
327
  label {
373
328
  display: inline-block;
374
- margin-bottom: 0.5rem;
375
329
  }
376
330
 
377
331
  // ============================================
@@ -389,13 +343,6 @@ progress {
389
343
  vertical-align: baseline;
390
344
  }
391
345
 
392
- // Disabled
393
- [disabled],
394
- [aria-disabled="true"] {
395
- cursor: not-allowed;
396
- opacity: 0.6;
397
- }
398
-
399
346
  // Hidden
400
347
  [hidden] {
401
348
  display: none !important;
@@ -7,4 +7,8 @@
7
7
  @include tm.generate-grid-vars(p.$grid);
8
8
  @include tm.generate-theme-colors(tm.$theme-fo-colors);
9
9
  @include tm.generate-theme-props(tm.$theme-fo-props);
10
+
11
+ .alert {
12
+ --#{p.$prefix}-alert-border: 0;
13
+ }
10
14
  }
@@ -5,6 +5,7 @@
5
5
  .alert {
6
6
  --#{p.$prefix}-alert-color: #{color(base, "black")};
7
7
  --#{p.$prefix}-alert-bg-color: #{color(base, "white")};
8
+ --#{p.$prefix}-alert-border: 1px solid #{color(base, "white")};
8
9
 
9
10
  display: flex;
10
11
  align-items: center;
@@ -13,6 +14,7 @@
13
14
  font-size: font(fs, xs);
14
15
  line-height: font(lh, xs);
15
16
  color: var(--#{p.$prefix}-alert-color);
17
+ border: var(--#{p.$prefix}-alert-border);
16
18
  border-radius: var(--#{p.$prefix}-border-radius);
17
19
  background-color: var(--#{p.$prefix}-alert-bg-color);
18
20
 
@@ -0,0 +1,21 @@
1
+ @use "sass:map";
2
+ @use "@cityway/design-tokens/primitives" as p;
3
+ @use "@cityway/design-tokens/functions" as *;
4
+
5
+ .dropdown-menu {
6
+ display: none;
7
+
8
+ &.show {
9
+ display: block;
10
+ }
11
+ }
12
+
13
+ .dropdown-icon {
14
+ transition: rotate 200ms ease-in-out;
15
+ }
16
+
17
+ .btn[aria-expanded="true"] {
18
+ .dropdown-icon {
19
+ rotate: 180deg;
20
+ }
21
+ }
@@ -0,0 +1,35 @@
1
+ @use "sass:map";
2
+ @use "@cityway/design-tokens/primitives" as p;
3
+ @use "@cityway/design-tokens/functions" as *;
4
+ @use "../mixins/popover-tooltip" as m;
5
+
6
+
7
+ @include m.popover-base(
8
+ $name: "popover",
9
+ $width: 12.5rem,
10
+ $br: border(br, md),
11
+ $bg: var(--#{p.$prefix}-base-white),
12
+ $header-bg: #{color("grey", 100)},
13
+ $fs: font(fs, xs),
14
+ $lh: font(lh, xs),
15
+ $shadow: var(--#{p.$prefix}-shadow-default),
16
+ $arrow-size: 1rem,
17
+ $arrow-offset: 1.5rem,
18
+ $arrow-border-size: 0
19
+ );
20
+
21
+ @include m.popover-base(
22
+ $name: "tooltip",
23
+ $width: 10rem,
24
+ $br: border(br, sm),
25
+ $bg: var(--#{p.$prefix}-base-black),
26
+ $header-bg: transparent,
27
+ $fs: font(fs, xs),
28
+ $lh: font(lh, xs),
29
+ $shadow: var(--#{p.$prefix}-shadow-default),
30
+ $arrow-size: 0.625rem,
31
+ $arrow-offset: 1.125rem,
32
+ $arrow-border-size: 0
33
+ ) {
34
+ color: var(--#{p.$prefix}-base-white);
35
+ };
@@ -83,6 +83,11 @@
83
83
  }
84
84
  }
85
85
 
86
+ .btn-ghost {
87
+ padding: 0;
88
+ justify-content: start;
89
+ }
90
+
86
91
 
87
92
  // MIXIN - Variantes
88
93
  // ---------------------------------
@@ -0,0 +1,130 @@
1
+ @use "sass:map";
2
+ @use "@cityway/design-tokens/primitives" as p;
3
+ @use "@cityway/design-tokens/functions" as *;
4
+
5
+ // --- CONFIGURATION COMMUNE ---
6
+ %field-check-base {
7
+ flex-shrink: 0;
8
+ appearance: none;
9
+ background-color: var(--#{p.$prefix}-field-check-bg);
10
+ background-image: var(--#{p.$prefix}-field-check-bg-image);
11
+ background-repeat: no-repeat;
12
+ background-position: center;
13
+ background-size: contain;
14
+ border: var(--#{p.$prefix}-field-check-border);
15
+ border-radius: var(--#{p.$prefix}-field-check-br);
16
+ print-color-adjust: exact;
17
+ transition: background-position 0.15s ease-in-out, background-color 0.15s, border-color 0.15s;
18
+
19
+ &:disabled,
20
+ &[disabled] {
21
+ pointer-events: none;
22
+ filter: none;
23
+
24
+ ~.field-check-label {
25
+ cursor: default;
26
+ color: #{color("grey", 600)};
27
+ }
28
+ }
29
+ }
30
+
31
+ .field-check {
32
+ display: flex;
33
+ gap: size(2xs);
34
+
35
+ &-input {
36
+ @extend %field-check-base;
37
+
38
+ // Valeurs par défaut (Checkbox / Radio)
39
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid #{color("grey", 600)};
40
+ --#{p.$prefix}-field-check-br: #{border(br, xs)};
41
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-base-white);
42
+ --#{p.$prefix}-field-check-bg-image: none;
43
+
44
+ width: 1rem;
45
+ height: 1rem;
46
+ margin-top: calc(((font(fs, md-rwd) * font(lh, md-rwd)) - 1rem) / 2);
47
+
48
+ // États Partagés
49
+ &:checked {
50
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-primary);
51
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-primary);
52
+ }
53
+
54
+ &[aria-invalid="true"] {
55
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-danger);
56
+
57
+ ~.field-check-label {
58
+ color: var(--#{p.$prefix}-danger);
59
+ }
60
+ }
61
+
62
+ &:disabled,
63
+ &[disabled] {
64
+ --#{p.$prefix}-field-check-bg: #{color("grey", 600)};
65
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid #{color("grey", 600)};
66
+ }
67
+
68
+ // Spécificités Radio / Checkbox
69
+ &[type="checkbox"]:checked {
70
+ --#{p.$prefix}-field-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
71
+ }
72
+
73
+ &[type="radio"] {
74
+ --#{p.$prefix}-field-check-br: #{border(br, round)};
75
+
76
+ &:checked {
77
+ --#{p.$prefix}-field-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
78
+ }
79
+ }
80
+ }
81
+
82
+ &-label {
83
+ font-size: font(fs, md-rwd);
84
+ line-height: font(lh, md-rwd);
85
+ }
86
+ }
87
+
88
+ // --- VARIANTE SWITCH ---
89
+ .field-switch {
90
+ .field-check-input {
91
+ --#{p.$prefix}-field-check-br: #{border(br, round)};
92
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-base-disabled);
93
+ --#{p.$prefix}-field-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
94
+
95
+ width: 2.625rem;
96
+ height: 1.625rem;
97
+ margin-top: calc(((font(fs, md-rwd) * font(lh, md-rwd)) - 1.625rem) / 2);
98
+ background-position: left center;
99
+
100
+ &:checked {
101
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-primary);
102
+ --#{p.$prefix}-field-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
103
+
104
+ background-position: right center;
105
+ }
106
+
107
+ &[aria-invalid="true"] {
108
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-danger);
109
+ }
110
+
111
+ &:disabled,
112
+ &[disabled] {
113
+ --#{p.$prefix}-field-check-bg: var(--#{p.$prefix}-base-white);
114
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid #{color("grey", 600)};
115
+ }
116
+ }
117
+ }
118
+
119
+ .field-switch.field-switch-small {
120
+ .field-check-input {
121
+ width: 1.625rem;
122
+ height: 1rem;
123
+ margin-top: calc(((font(fs, md-rwd) * font(lh, md-rwd)) - 1rem) / 2);
124
+ }
125
+ }
126
+
127
+ // --- GLOBAL ---
128
+ fieldset[aria-invalid="true"] .field-check-input {
129
+ --#{p.$prefix}-field-check-border: #{border(bw, xs)} solid var(--#{p.$prefix}-danger);
130
+ }
@@ -0,0 +1,146 @@
1
+ @use "sass:map";
2
+ @use "@cityway/design-tokens/primitives" as p;
3
+ @use "@cityway/design-tokens/functions" as *;
4
+ @use "../button/button" as mixin;
5
+
6
+ @use "field-check";
7
+ @use "ng-select";
8
+ @use "slider-range";
9
+
10
+ .field {
11
+ &-required {
12
+ font-size: font(fs, xs);
13
+ line-height: font(lh, xs);
14
+ }
15
+
16
+ &-label {
17
+ font-size: font(fs, md-rwd);
18
+ font-weight: font(fw, regular);
19
+ line-height: font(lh, md-rwd);
20
+ }
21
+
22
+ &-text {
23
+ font-size: font(fs, xs);
24
+ line-height: font(lh, xs);
25
+ color: var(--#{p.$prefix}-base-disabled);
26
+ }
27
+
28
+ &-invalid {
29
+ font-size: font(fs, xs);
30
+ line-height: font(lh, xs);
31
+ color: var(--#{p.$prefix}-danger);
32
+ }
33
+
34
+ &-group {
35
+ --#{p.$prefix}-field-control-height: #{size(3xl)};
36
+ --#{p.$prefix}-field-control-padding-y: #{size(md)};
37
+ --#{p.$prefix}-field-control-border: #{border(bw, xs)} solid #{color("grey", 600)};
38
+ --#{p.$prefix}-field-control-bg: var(--#{p.$prefix}-base-white);
39
+ --#{p.$prefix}-field-control-br: var(--#{p.$prefix}-border-radius-input);
40
+ --#{p.$prefix}-field-control-bs: none;
41
+
42
+ display: flex;
43
+ align-items: stretch;
44
+ gap: 0;
45
+
46
+ &-text {
47
+ display: flex;
48
+ align-items: center;
49
+ padding-inline: var(--#{p.$prefix}-field-control-padding-y);
50
+ border: var(--#{p.$prefix}-field-control-border);
51
+ }
52
+
53
+ &-text:first-child {
54
+ border-radius: var(--#{p.$prefix}-border-radius-input) 0 0 var(--#{p.$prefix}-border-radius-input);
55
+ }
56
+
57
+ &-text:last-child {
58
+ border-radius: 0 var(--#{p.$prefix}-border-radius-input) var(--#{p.$prefix}-border-radius-input) 0;
59
+ }
60
+ }
61
+
62
+ &-control {
63
+ width: 100%;
64
+ min-height: var(--#{p.$prefix}-field-control-height);
65
+ padding-inline: var(--#{p.$prefix}-field-control-padding-y);
66
+
67
+ font-size: font(fs, md-rwd);
68
+ line-height: font(lh, md-rwd);
69
+ color: var(--#{p.$prefix}-body-color);
70
+
71
+ border: 0;
72
+ border-top: var(--#{p.$prefix}-field-control-border);
73
+ border-bottom: var(--#{p.$prefix}-field-control-border);
74
+ border-radius: 0;
75
+ background-color: var(--#{p.$prefix}-field-control-bg);
76
+ box-shadow: var(--#{p.$prefix}-field-control-bs);
77
+
78
+ &:first-child {
79
+ border: var(--#{p.$prefix}-field-control-border);
80
+ border-right-width: 0;
81
+ border-radius: var(--#{p.$prefix}-border-radius-input) 0 0 var(--#{p.$prefix}-border-radius-input);
82
+ }
83
+
84
+ &:last-child {
85
+ border: var(--#{p.$prefix}-field-control-border);
86
+ border-left-width: 0;
87
+ border-radius: 0 var(--#{p.$prefix}-border-radius-input) var(--#{p.$prefix}-border-radius-input) 0;
88
+ }
89
+
90
+ &:only-child {
91
+ border: var(--#{p.$prefix}-field-control-border);
92
+ border-radius: var(--#{p.$prefix}-field-control-br);
93
+ }
94
+ }
95
+ }
96
+
97
+ .btn-clear-field {
98
+ padding: 0;
99
+ padding-inline: var(--#{p.$prefix}-field-control-padding-y);
100
+ border: 0;
101
+ border-top: var(--#{p.$prefix}-field-control-border);
102
+ border-bottom: var(--#{p.$prefix}-field-control-border);
103
+ border-radius: 0;
104
+
105
+ &:last-child {
106
+ border: var(--#{p.$prefix}-field-control-border);
107
+ border-left-width: 0;
108
+ border-radius: 0 var(--#{p.$prefix}-border-radius-input) var(--#{p.$prefix}-border-radius-input) 0;
109
+ }
110
+ }
111
+
112
+ // Placeholder
113
+ // ::placeholder {
114
+ // color: var(--placeholder-color, #6c757d);
115
+ // opacity: 1;
116
+ // }
117
+
118
+ // Variables
119
+ // ---------------------------------
120
+ $buttons: (
121
+ field-group: (surface: var(--#{p.$prefix}-primary-contrasted),
122
+ text: var(--#{p.$prefix}-body-color),
123
+ border: var(--#{p.$prefix}-primary),
124
+ surface-hover: var(--#{p.$prefix}-primary-contrasted),
125
+ text-hover: var(--#{p.$prefix}-primary-hover),
126
+ border-hover: var(--#{p.$prefix}-primary-hover),
127
+ surface-disabled: var(--#{p.$prefix}-disabled-contrasted),
128
+ text-disabled: var(--#{p.$prefix}-disabled),
129
+ border-disabled: var(--#{p.$prefix}-disabled)),
130
+ );
131
+
132
+ // Générer toutes les variantes
133
+ // ---------------------------------
134
+ @include mixin.button-variants($buttons);
135
+
136
+ .btn-field-group {
137
+ border-radius: 0;
138
+
139
+ &:first-of-type {
140
+ border-radius: var(--#{p.$prefix}-border-radius-input) 0 0 var(--#{p.$prefix}-border-radius-input);
141
+ }
142
+
143
+ &:last-of-type {
144
+ border-radius: 0 var(--#{p.$prefix}-border-radius-input) var(--#{p.$prefix}-border-radius-input) 0;
145
+ }
146
+ }
@@ -0,0 +1,84 @@
1
+ @use "sass:map";
2
+ @use "@cityway/design-tokens/primitives" as p;
3
+ @use "@cityway/design-tokens/functions" as *;
4
+
5
+ .ng-select {
6
+ display: flex;
7
+ width: 100%;
8
+
9
+ &.ng-select-multiple,
10
+ &.ng-select-single {
11
+ .ng-select-container {
12
+ width: 100%;
13
+ min-height: var(--#{p.$prefix}-field-control-height);
14
+ border: 0;
15
+ border-top: var(--#{p.$prefix}-field-control-border);
16
+ border-bottom: var(--#{p.$prefix}-field-control-border);
17
+ border-radius: 0;
18
+
19
+
20
+ .ng-value-container {
21
+ display: flex;
22
+ gap: size(2xs);
23
+ height: 100%;
24
+ padding-top: 0;
25
+ padding-inline: var(--#{p.$prefix}-field-control-padding-y);
26
+
27
+ .ng-value {
28
+ margin: 0;
29
+ padding-right: size(2xs);
30
+ }
31
+
32
+ .ng-placeholder {
33
+ top: inherit;
34
+ padding-left: 0;
35
+ padding-bottom: 0;
36
+ // color: $input-placeholder-color;
37
+ // font-weight: $font-weight-base;
38
+ }
39
+
40
+ .ng-input {
41
+ left: inherit;
42
+ top: 0.5rem;
43
+ padding-left: 0;
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+
50
+ &:first-child {
51
+
52
+ &.ng-select-multiple,
53
+ &.ng-select-single {
54
+ .ng-select-container {
55
+ border: var(--#{p.$prefix}-field-control-border);
56
+ border-right: 0;
57
+ border-radius: var(--#{p.$prefix}-border-radius-input) 0 0 var(--#{p.$prefix}-border-radius-input);
58
+ }
59
+ }
60
+ }
61
+
62
+ &:last-child {
63
+
64
+ &.ng-select-multiple,
65
+ &.ng-select-single {
66
+ .ng-select-container {
67
+ border: var(--#{p.$prefix}-field-control-border);
68
+ border-left: 0;
69
+ border-radius: 0 var(--#{p.$prefix}-border-radius-input) var(--#{p.$prefix}-border-radius-input) 0;
70
+ }
71
+ }
72
+ }
73
+
74
+ &:only-child {
75
+
76
+ &.ng-select-multiple,
77
+ &.ng-select-single {
78
+ .ng-select-container {
79
+ border: var(--#{p.$prefix}-field-control-border);
80
+ border-radius: var(--#{p.$prefix}-border-radius-input);
81
+ }
82
+ }
83
+ }
84
+ }