@design-system-rte/angular 0.2.0 → 0.2.1

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 (77) hide show
  1. package/ng-package.json +10 -0
  2. package/package.json +4 -17
  3. package/src/lib/components/button/button.component.html +10 -0
  4. package/src/lib/components/button/button.component.scss +156 -0
  5. package/src/lib/components/button/button.component.spec.ts +22 -0
  6. package/src/lib/components/button/button.component.stories.ts +99 -0
  7. package/src/lib/components/button/button.component.ts +27 -0
  8. package/src/lib/components/checkbox/checkbox.component.html +31 -0
  9. package/src/lib/components/checkbox/checkbox.component.scss +170 -0
  10. package/src/lib/components/checkbox/checkbox.component.stories.ts +126 -0
  11. package/src/lib/components/checkbox/checkbox.component.ts +34 -0
  12. package/src/lib/components/checkbox-group/checkbox-group.component.html +46 -0
  13. package/src/lib/components/checkbox-group/checkbox-group.component.scss +82 -0
  14. package/src/lib/components/checkbox-group/checkbox-group.component.stories.ts +121 -0
  15. package/src/lib/components/checkbox-group/checkbox-group.component.ts +28 -0
  16. package/src/lib/components/grid/col/col.directive.ts +35 -0
  17. package/src/lib/components/grid/grid.directive.stories.ts +150 -0
  18. package/src/lib/components/grid/grid.directive.ts +22 -0
  19. package/src/lib/components/icon/icon-map.ts +301 -0
  20. package/src/lib/components/icon/icon.component.html +1 -0
  21. package/src/lib/components/icon/icon.component.scss +3 -0
  22. package/src/lib/components/icon/icon.component.ts +58 -0
  23. package/src/lib/components/icon/icon.service.ts +33 -0
  24. package/src/lib/components/icon/icon.stories.ts +84 -0
  25. package/src/lib/components/link/link.component.html +6 -0
  26. package/src/lib/components/link/link.component.scss +108 -0
  27. package/src/lib/components/link/link.component.stories.ts +61 -0
  28. package/src/lib/components/link/link.component.ts +18 -0
  29. package/src/lib/components/radio-button/radio-button.component.html +24 -0
  30. package/src/lib/components/radio-button/radio-button.component.scss +135 -0
  31. package/src/lib/components/radio-button/radio-button.component.stories.ts +76 -0
  32. package/src/lib/components/radio-button/radio-button.component.ts +22 -0
  33. package/src/lib/components/radio-button-group/radio-button-group.component.html +45 -0
  34. package/src/lib/components/radio-button-group/radio-button-group.component.scss +82 -0
  35. package/src/lib/components/radio-button-group/radio-button-group.component.stories.ts +121 -0
  36. package/src/lib/components/radio-button-group/radio-button-group.component.ts +28 -0
  37. package/src/lib/components/tooltip/tooltip.component.html +7 -0
  38. package/src/lib/components/tooltip/tooltip.component.scss +118 -0
  39. package/src/lib/components/tooltip/tooltip.component.ts +16 -0
  40. package/src/lib/components/tooltip/tooltip.directive.stories.ts +218 -0
  41. package/src/lib/components/tooltip/tooltip.directive.ts +187 -0
  42. package/src/public-api.ts +9 -0
  43. package/tsconfig.lib.json +22 -0
  44. package/tsconfig.lib.prod.json +10 -0
  45. package/tsconfig.spec.json +14 -0
  46. package/design-system-rte-angular.d.ts.map +0 -1
  47. package/esm2022/design-system-rte-angular.mjs +0 -5
  48. package/esm2022/lib/components/button/button.component.mjs +0 -22
  49. package/esm2022/lib/components/checkbox/checkbox.component.mjs +0 -34
  50. package/esm2022/lib/components/checkbox-group/checkbox-group.component.mjs +0 -29
  51. package/esm2022/lib/components/grid/col/col.directive.mjs +0 -41
  52. package/esm2022/lib/components/grid/grid.directive.mjs +0 -30
  53. package/esm2022/lib/components/link/link.component.mjs +0 -19
  54. package/esm2022/lib/components/radio-button/radio-button.component.mjs +0 -24
  55. package/esm2022/lib/components/radio-button-group/radio-button-group.component.mjs +0 -29
  56. package/esm2022/public-api.mjs +0 -12
  57. package/fesm2022/design-system-rte-angular.mjs +0 -215
  58. package/fesm2022/design-system-rte-angular.mjs.map +0 -1
  59. package/index.d.ts +0 -6
  60. package/lib/components/button/button.component.d.ts +0 -13
  61. package/lib/components/button/button.component.d.ts.map +0 -1
  62. package/lib/components/checkbox/checkbox.component.d.ts +0 -19
  63. package/lib/components/checkbox/checkbox.component.d.ts.map +0 -1
  64. package/lib/components/checkbox-group/checkbox-group.component.d.ts +0 -19
  65. package/lib/components/checkbox-group/checkbox-group.component.d.ts.map +0 -1
  66. package/lib/components/grid/col/col.directive.d.ts +0 -15
  67. package/lib/components/grid/col/col.directive.d.ts.map +0 -1
  68. package/lib/components/grid/grid.directive.d.ts +0 -11
  69. package/lib/components/grid/grid.directive.d.ts.map +0 -1
  70. package/lib/components/link/link.component.d.ts +0 -10
  71. package/lib/components/link/link.component.d.ts.map +0 -1
  72. package/lib/components/radio-button/radio-button.component.d.ts +0 -14
  73. package/lib/components/radio-button/radio-button.component.d.ts.map +0 -1
  74. package/lib/components/radio-button-group/radio-button-group.component.d.ts +0 -19
  75. package/lib/components/radio-button-group/radio-button-group.component.d.ts.map +0 -1
  76. package/public-api.d.ts +0 -9
  77. package/public-api.d.ts.map +0 -1
@@ -0,0 +1,301 @@
1
+ export const togglableIcons = {
2
+ "add-circle": ["add_circle_outlined", "add_circle_filled"],
3
+ "admin-panel-settings": ["admin_panel_settings_outlined", "admin_panel_settings_filled"],
4
+ analytics: ["analytics_outlined", "analytics_filled"],
5
+ archive: ["archive_outlined", "archive_filled"],
6
+ "arrow-circle-chevron-down": ["arrow_circle_chevron_down_outlined", "arrow_circle_chevron_down_filled"],
7
+ "arrow-circle-chevron-left": ["arrow_circle_chevron_left_outlined", "arrow_circle_chevron_left_filled"],
8
+ "arrow-circle-chevron-right": ["arrow_circle_chevron_right_outlined", "arrow_circle_chevron_right_filled"],
9
+ "arrow-circle-chevron-up": ["arrow_circle_chevron_up_outlined", "arrow_circle_chevron_up_filled"],
10
+ "arrow-circle-down": ["arrow_circle_down_outlined", "arrow_circle_down_filled"],
11
+ "arrow-circle-left": ["arrow_circle_left_outlined", "arrow_circle_left_filled"],
12
+ "arrow-circle-right": ["arrow_circle_right_outlined", "arrow_circle_right_filled"],
13
+ "arrow-circle-up": ["arrow_circle_up_outlined", "arrow_circle_up_filled"],
14
+ article: ["article_outlined", "article_filled"],
15
+ "assignment-complete": ["assignment_complete_outlined", "assignment_complete_filled"],
16
+ assignment: ["assignment_outlined", "assignment_filled"],
17
+ "battery-alert": ["battery_alert_outlined", "battery_alert_filled"],
18
+ "battery-charging-full": ["battery_charging_full_outlined", "battery_charging_full_filled"],
19
+ "bolt-alt-circle": ["bolt_alt_circle_outlined", "bolt_alt_circle_filled"],
20
+ "bolt-alt": ["bolt_alt_outlined", "bolt_alt_filled"],
21
+ "bolt-circle": ["bolt_circle_outlined", "bolt_circle_filled"],
22
+ bolt: ["bolt_outlined", "bolt_filled"],
23
+ bookmark: ["bookmark_outlined", "bookmark_filled"],
24
+ bookmarks: ["bookmarks_outlined", "bookmarks_filled"],
25
+ build: ["build_outlined", "build_filled"],
26
+ "calendar-available": ["calendar_available_outlined", "calendar_available_filled"],
27
+ "calendar-busy": ["calendar_busy_outlined", "calendar_busy_filled"],
28
+ "calendar-month": ["calendar_month_outlined", "calendar_month_filled"],
29
+ "calendar-today": ["calendar_today_outlined", "calendar_today_filled"],
30
+ call: ["call_outlined", "call_filled"],
31
+ category: ["category_outlined", "category_filled"],
32
+ "chart-add": ["chart_add_outlined", "chart_add_filled"],
33
+ "chart-area": ["chart_area_outlined", "chart_area_filled"],
34
+ "chart-pie": ["chart_pie_outlined", "chart_pie_filled"],
35
+ "chart-table": ["chart_table_outlined", "chart_table_filled"],
36
+ "chat-alt": ["chat_alt_outlined", "chat_alt_filled"],
37
+ "chat-alt-unread": ["chat_alt_unread_outlined", "chat_alt_unread_filled"],
38
+ chat: ["chat_outlined", "chat_filled"],
39
+ "chat-unread": ["chat_unread_outlined", "chat_unread_filled"],
40
+ "check-circle": ["check_circle_outlined", "check_circle_filled"],
41
+ checkbox: ["checkbox_outlined", "checkbox_filled"],
42
+ "checkbox-indeterminate": ["checkbox_indeterminate_outlined", "checkbox_indeterminate_filled"],
43
+ clock: ["clock_outlined", "clock_filled"],
44
+ "cloud-download": ["cloud_download_outlined", "cloud_download_filled"],
45
+ cloud: ["cloud_outlined", "cloud_filled"],
46
+ "cloud-off": ["cloud_off_outlined", "cloud_off_filled"],
47
+ "cloud-upload": ["cloud_upload_outlined", "cloud_upload_filled"],
48
+ "comment-add": ["comment_add_outlined", "comment_add_filled"],
49
+ comment: ["comment_outlined", "comment_filled"],
50
+ copy: ["copy_outlined", "copy_filled"],
51
+ dangerous: ["dangerous_outlined", "dangerous_filled"],
52
+ dashboard: ["dashboard_outlined", "dashboard_filled"],
53
+ database: ["database_outlined", "database_filled"],
54
+ delete: ["delete_outlined", "delete_filled"],
55
+ desktop: ["desktop_outlined", "desktop_filled"],
56
+ devices: ["devices_outlined", "devices_filled"],
57
+ draft: ["draft_outlined", "draft_filled"],
58
+ eco: ["eco_outlined", "eco_filled"],
59
+ edit: ["edit_outlined", "edit_filled"],
60
+ "electric-meter": ["electric_meter_outlined", "electric_meter_filled"],
61
+ error: ["error_outlined", "error_filled"],
62
+ explore: ["explore_outlined", "explore_filled"],
63
+ "explore-off": ["explore_off_outlined", "explore_off_filled"],
64
+ "fast-forward": ["fast_forward_outlined", "fast_forward_filled"],
65
+ "fast-rewind": ["fast_rewind_outlined", "fast_rewind_filled"],
66
+ feedback: ["feedback_outlined", "feedback_filled"],
67
+ "file-copy": ["file_copy_outlined", "file_copy_filled"],
68
+ "file-download": ["file_download_outlined", "file_download_filled"],
69
+ "file-upload": ["file_upload_outlined", "file_upload_filled"],
70
+ "filter-alt": ["filter_alt_outlined", "filter_alt_filled"],
71
+ "filter-alt-off": ["filter_alt_off_outlined", "filter_alt_off_filled"],
72
+ fire: ["fire_outlined", "fire_filled"],
73
+ "fit-screen": ["fit_screen_outlined", "fit_screen_filled"],
74
+ flag: ["flag_outlined", "flag_filled"],
75
+ flash: ["flash_outlined", "flash_filled"],
76
+ "flash-off": ["flash_off_outlined", "flash_off_filled"],
77
+ "folder-add": ["folder_add_outlined", "folder_add_filled"],
78
+ folder: ["folder_outlined", "folder_filled"],
79
+ "folder-move": ["folder_move_outlined", "folder_move_filled"],
80
+ "folder-open": ["folder_open_outlined", "folder_open_filled"],
81
+ "folder-shared": ["folder_shared_outlined", "folder_shared_filled"],
82
+ forum: ["forum_outlined", "forum_filled"],
83
+ "group-add": ["group_add_outlined", "group_add_filled"],
84
+ group: ["group_outlined", "group_filled"],
85
+ groups: ["groups_outlined", "groups_filled"],
86
+ headphones: ["headphones_outlined", "headphones_filled"],
87
+ heart: ["heart_outlined", "heart_filled"],
88
+ help: ["help_outlined", "help_filled"],
89
+ home: ["home_outlined", "home_filled"],
90
+ hourglass: ["hourglass_outlined", "hourglass_filled"],
91
+ "image-broken": ["image_broken_outlined", "image_broken_filled"],
92
+ image: ["image_outlined", "image_filled"],
93
+ "image-gallery": ["image_gallery_outlined", "image_gallery_filled"],
94
+ inbox: ["inbox_outlined", "inbox_filled"],
95
+ info: ["info_outlined", "info_filled"],
96
+ keep: ["keep_outlined", "keep_filled"],
97
+ "keep-off": ["keep_off_outlined", "keep_off_filled"],
98
+ label: ["label_outlined", "label_filled"],
99
+ laptop: ["laptop_outlined", "laptop_filled"],
100
+ "left-panel-open": ["left_panel_open_outlined", "left_panel_open_filled"],
101
+ "left-panel-close": ["left_panel_close_outlined", "left_panel_close_filled"],
102
+ "light-off": ["light_off_outlined", "light_off_filled"],
103
+ "lightbulb-alt": ["lightbulb_alt_outlined", "lightbulb_alt_filled"],
104
+ "lightbulb-circle": ["lightbulb_circle_outlined", "lightbulb_circle_filled"],
105
+ lightbulb: ["lightbulb_outlined", "lightbulb_filled"],
106
+ "list-alt": ["list_alt_outlined", "list_alt_filled"],
107
+ "location-me": ["location_me_outlined", "location_me_filled"],
108
+ "location-off": ["location_off_outlined", "location_off_filled"],
109
+ "location-on": ["location_on_outlined", "location_on_filled"],
110
+ lock: ["lock_outlined", "lock_filled"],
111
+ "lock-open": ["lock_open_outlined", "lock_open_filled"],
112
+ "lock-open-right": ["lock_open_right_outlined", "lock_open_right_filled"],
113
+ mail: ["mail_outlined", "mail_filled"],
114
+ "mail-unread": ["mail_unread_outlined", "mail_unread_filled"],
115
+ map: ["map_outlined", "map_filled"],
116
+ mic: ["mic_outlined", "mic_filled"],
117
+ "mic-off": ["mic_off_outlined", "mic_off_filled"],
118
+ "mode-dark": ["mode_dark_outlined", "mode_dark_filled"],
119
+ "mode-light": ["mode_light_outlined", "mode_light_filled"],
120
+ notification: ["notification_outlined", "notification_filled"],
121
+ "notification-important": ["notification_important_outlined", "notification_important_filled"],
122
+ "notification-off": ["notification_off_outlined", "notification_off_filled"],
123
+ "notification-unread": ["notification_unread_outlined", "notification_unread_filled"],
124
+ palette: ["palette_outlined", "palette_filled"],
125
+ "pause-circle": ["pause_circle_outlined", "pause_circle_filled"],
126
+ pause: ["pause_outlined", "pause_filled"],
127
+ "photo-camera": ["photo_camera_outlined", "photo_camera_filled"],
128
+ "play-circle": ["play_circle_outlined", "play_circle_filled"],
129
+ play: ["play_outlined", "play_filled"],
130
+ power: ["power_outlined", "power_filled"],
131
+ "power-off": ["power_off_outlined", "power_off_filled"],
132
+ "power-plug-connect": ["power_plug_connect_outlined", "power_plug_connect_filled"],
133
+ "power-settings-circle": ["power_settings_circle_outlined", "power_settings_circle_filled"],
134
+ "power-solar": ["power_solar_outlined", "power_solar_filled"],
135
+ "power-switch": ["power_switch_outlined", "power_switch_filled"],
136
+ "power-wind": ["power_wind_outlined", "power_wind_filled"],
137
+ print: ["print_outlined", "print_filled"],
138
+ "right-panel-close": ["right_panel_close_outlined", "right_panel_close_filled"],
139
+ "right-panel-open": ["right_panel_open_outlined", "right_panel_open_filled"],
140
+ save: ["save_outlined", "save_filled"],
141
+ send: ["send_outlined", "send_filled"],
142
+ settings: ["settings_outlined", "settings_filled"],
143
+ share: ["share_outlined", "share_filled"],
144
+ "skip-next": ["skip_next_outlined", "skip_next_filled"],
145
+ "skip-previous": ["skip_previous_outlined", "skip_previous_filled"],
146
+ smartphone: ["smartphone_outlined", "smartphone_filled"],
147
+ star: ["star_outlined", "star_filled"],
148
+ "sticky-note": ["sticky_note_outlined", "sticky_note_filled"],
149
+ "stop-circle": ["stop_circle_outlined", "stop_circle_filled"],
150
+ stop: ["stop_outlined", "stop_filled"],
151
+ subtitles: ["subtitles_outlined", "subtitles_filled"],
152
+ "text-snippet": ["text_snippet_outlined", "text_snippet_filled"],
153
+ "trash-restore": ["trash_restore_outlined", "trash_restore_filled"],
154
+ unarchive: ["unarchive_outlined", "unarchive_filled"],
155
+ "user-add": ["user_add_outlined", "user_add_filled"],
156
+ "user-circle": ["user_circle_outlined", "user_circle_filled"],
157
+ user: ["user_outlined", "user_filled"],
158
+ "user-settings": ["user_settings_outlined", "user_settings_filled"],
159
+ verified: ["verified_outlined", "verified_filled"],
160
+ "video-camera": ["video_camera_outlined", "video_camera_filled"],
161
+ "video-camera-off": ["video_camera_off_outlined", "video_camera_off_filled"],
162
+ "video-gallery": ["video_gallery_outlined", "video_gallery_filled"],
163
+ "view-agenda": ["view_agenda_outlined", "view_agenda_filled"],
164
+ "view-column": ["view_column_outlined", "view_column_filled"],
165
+ "view-grid": ["view_grid_outlined", "view_grid_filled"],
166
+ "view-kanban": ["view_kanban_outlined", "view_kanban_filled"],
167
+ "view-module": ["view_module_outlined", "view_module_filled"],
168
+ "view-timeline": ["view_timeline_outlined", "view_timeline_filled"],
169
+ "visibility-hide": ["visibility_hide_outlined", "visibility_hide_filled"],
170
+ "visibility-show": ["visibility_show_outlined", "visibility_show_filled"],
171
+ "volume-down": ["volume_down_outlined", "volume_down_filled"],
172
+ "volume-mute": ["volume_mute_outlined", "volume_mute_filled"],
173
+ "volume-off": ["volume_off_outlined", "volume_off_filled"],
174
+ "volume-up": ["volume_up_outlined", "volume_up_filled"],
175
+ warning: ["warning_outlined", "warning_filled"],
176
+ waterdrop: ["waterdrop_outlined", "waterdrop_filled"],
177
+ };
178
+
179
+ export const regularIcons = {
180
+ add: "add",
181
+ "alt-route": "alt_route",
182
+ apps: "apps",
183
+ "arrow-alt-down": "arrow_alt_down",
184
+ "arrow-alt-down-left": "arrow_alt_down_left",
185
+ "arrow-alt-down-right": "arrow_alt_down_right",
186
+ "arrow-alt-left": "arrow_alt_left",
187
+ "arrow-alt-right": "arrow_alt_right",
188
+ "arrow-alt-up": "arrow_alt_up",
189
+ "arrow-alt-up-left": "arrow_alt_up_left",
190
+ "arrow-alt-up-right": "arrow_alt_up_right",
191
+ "arrow-angle-down-left": "arrow_angle_down_left",
192
+ "arrow-angle-down-right": "arrow_angle_down_right",
193
+ "arrow-angle-up-left": "arrow_angle_up_left",
194
+ "arrow-angle-up-right": "arrow_angle_up_right",
195
+ "arrow-chevron-down": "arrow_chevron_down",
196
+ "arrow-chevron-left": "arrow_chevron_left",
197
+ "arrow-chevron-right": "arrow_chevron_right",
198
+ "arrow-chevron-up": "arrow_chevron_up",
199
+ "arrow-double-down": "arrow_double_down",
200
+ "arrow-double-left": "arrow_double_left",
201
+ "arrow-double-right": "arrow_double_right",
202
+ "arrow-double-up": "arrow_double_up",
203
+ "arrow-down": "arrow_down",
204
+ "arrow-down-left": "arrow_down_left",
205
+ "arrow-down-right": "arrow_down_right",
206
+ "arrow-drop-down": "arrow_drop_down",
207
+ "arrow-drop-up": "arrow_drop_up",
208
+ "arrow-left": "arrow_left",
209
+ "arrow-right": "arrow_right",
210
+ "arrow-up": "arrow_up",
211
+ "arrow-up-left": "arrow_up_left",
212
+ "arrow-up-right": "arrow_up_right",
213
+ asterisk: "asterisk",
214
+ "attach-file": "attach_file",
215
+ "battery-alt-empty": "battery_alt_empty",
216
+ "battery-alt-full": "battery_alt_full",
217
+ "battery-charging": "battery_charging",
218
+ "battery-empty": "battery_empty",
219
+ "battery-full": "battery_full",
220
+ bluetooth: "bluetooth",
221
+ "bluetooth-off": "bluetooth_off",
222
+ "chart-bar": "chart_bar",
223
+ "chart-bar-stacked": "chart_bar_stacked",
224
+ check: "check",
225
+ "check-indeterminate": "check_indeterminate",
226
+ "check-small": "check_small",
227
+ "checkbox-empty": "checkbox_empty",
228
+ close: "close",
229
+ compare: "compare",
230
+ "copy-all": "copy_all",
231
+ "crisis-alert": "crisis_alert",
232
+ cut: "cut",
233
+ download: "download",
234
+ "download-done": "download_done",
235
+ "drag-handle": "drag_handle",
236
+ "drag-indicator": "drag_indicator",
237
+ exclamation: "exclamation",
238
+ "explore-travel": "explore_travel",
239
+ "external-link": "external_link",
240
+ filter: "filter",
241
+ "filter-off": "filter_off",
242
+ "first-page": "first_page",
243
+ forward: "forward",
244
+ fullscreen: "fullscreen",
245
+ "fullscreen-exit": "fullscreen_exit",
246
+ history: "history",
247
+ "hourglass-empty": "hourglass_empty",
248
+ "info-i": "info_i",
249
+ language: "language",
250
+ "last-page": "last_page",
251
+ link: "link",
252
+ "link-off": "link_off",
253
+ list: "list",
254
+ "location-disabled": "location_disabled",
255
+ login: "login",
256
+ logout: "logout",
257
+ menu: "menu",
258
+ "menu-open": "menu_open",
259
+ monitoring: "monitoring",
260
+ "more-down": "more_down",
261
+ "more-horiz": "more_horiz",
262
+ "more-up": "more_up",
263
+ "more-vert": "more_vert",
264
+ ohm: "ohm",
265
+ "open-in-full": "open_in_full",
266
+ paste: "paste",
267
+ "play-pause": "play_pause",
268
+ "power-input": "power_input",
269
+ "power-plug": "power_plug",
270
+ "power-settings": "power_settings",
271
+ "priority-high": "priority_high",
272
+ public: "public",
273
+ publish: "publish",
274
+ "question-mark": "question_mark",
275
+ radar: "radar",
276
+ "radio-button-empty": "radio_button_empty",
277
+ redo: "redo",
278
+ reload: "reload",
279
+ remove: "remove",
280
+ reply: "reply",
281
+ "reply-all": "reply_all",
282
+ route: "route",
283
+ search: "search",
284
+ "side-navigation": "side_navigation",
285
+ sort: "sort",
286
+ "support-agent": "support_agent",
287
+ timeline: "timeline",
288
+ "trending-down": "trending_down",
289
+ "trending-flat": "trending_flat",
290
+ "trending-up": "trending_up",
291
+ tune: "tune",
292
+ undo: "undo",
293
+ upload: "upload",
294
+ water: "water",
295
+ "water-alt": "water_alt",
296
+ wifi: "wifi",
297
+ "wifi-off": "wifi_off",
298
+ windmill: "windmill",
299
+ "zoom-out": "zoom_out",
300
+ "zoom-in": "zoom_in",
301
+ };
@@ -0,0 +1 @@
1
+ <div class="rte-icon-container" [innerHTML]="svgContent" [style.height]="(size())+'px'" [style.width]="(size())+'px'"></div>
@@ -0,0 +1,3 @@
1
+ .rte-icon-container {
2
+ display: flex
3
+ }
@@ -0,0 +1,58 @@
1
+ import { CommonModule } from "@angular/common";
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ ChangeDetectorRef,
5
+ Component,
6
+ DestroyRef,
7
+ effect,
8
+ inject,
9
+ input,
10
+ } from "@angular/core";
11
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
12
+ import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
13
+ import { Observable } from "rxjs";
14
+
15
+ import { IconService, RegularIconIdKey, TogglableIconIdKey } from "./icon.service";
16
+
17
+ @Component({
18
+ selector: "rte-icon",
19
+ imports: [CommonModule],
20
+ standalone: true,
21
+ templateUrl: "./icon.component.html",
22
+ styleUrl: "./icon.component.scss",
23
+ changeDetection: ChangeDetectionStrategy.OnPush,
24
+ providers: [IconService],
25
+ })
26
+ export class IconComponent {
27
+ readonly name = input.required<RegularIconIdKey | TogglableIconIdKey>();
28
+ readonly size = input(20);
29
+ readonly color = input("currentColor");
30
+ readonly classes = input("");
31
+ readonly appearance = input<"outlined" | "filled">();
32
+ destroyRef = inject(DestroyRef);
33
+
34
+ svgContent: SafeHtml | null = null;
35
+ svg!: Observable<string>;
36
+
37
+ private sanitizer = inject(DomSanitizer);
38
+ private iconService = inject(IconService);
39
+ private cdr = inject(ChangeDetectorRef);
40
+
41
+ constructor() {
42
+ effect(() => {
43
+ this.setSvgContent(this.name());
44
+ });
45
+ }
46
+
47
+ private setSvgContent(svgName: RegularIconIdKey | TogglableIconIdKey) {
48
+ const svgFile = this.iconService.getSvg(svgName, this.appearance() || "outlined");
49
+
50
+ svgFile.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((res) => {
51
+ const size = this.size();
52
+ const svgWithSize = res.replace(/<svg([^>]*)>/, `<svg$1 width="${size}" height="${size}">`);
53
+
54
+ this.svgContent = this.sanitizer.bypassSecurityTrustHtml(svgWithSize);
55
+ this.cdr.markForCheck();
56
+ });
57
+ }
58
+ }
@@ -0,0 +1,33 @@
1
+ import { HttpClient } from "@angular/common/http";
2
+ import { inject, Injectable } from "@angular/core";
3
+ import { Observable } from "rxjs";
4
+
5
+ import { regularIcons, togglableIcons } from "./icon-map";
6
+
7
+ export type RegularIconIdKey = keyof typeof regularIcons;
8
+ export type TogglableIconIdKey = keyof typeof togglableIcons;
9
+
10
+ @Injectable()
11
+ export class IconService {
12
+ private http = inject(HttpClient);
13
+
14
+ getSvg(name: RegularIconIdKey | TogglableIconIdKey, appearance: "outlined" | "filled"): Observable<string> {
15
+ if (!this.http) {
16
+ throw new Error("HttpClient is not available");
17
+ }
18
+ const toggableIcon = togglableIcons[name as TogglableIconIdKey];
19
+
20
+ if (toggableIcon) {
21
+ const [outlinedIconName, filledIconName] = toggableIcon;
22
+
23
+ const iconName = appearance === "filled" ? filledIconName : outlinedIconName;
24
+ return this.http.get(`assets/icons/${iconName}.svg`, { responseType: "text" });
25
+ } else {
26
+ const iconName = regularIcons[name as RegularIconIdKey];
27
+ if (!iconName) {
28
+ throw new Error(`Icon ${name} not found`);
29
+ }
30
+ return this.http.get(`assets/icons/${iconName}.svg`, { responseType: "text" });
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,84 @@
1
+ import type { Meta, StoryObj } from "@storybook/angular";
2
+
3
+ import { regularIcons as RegularIconsList, togglableIcons as TogglableIconsList } from "./icon-map";
4
+ import { IconComponent } from "./icon.component";
5
+
6
+ const RegularIconIds = Object.keys(RegularIconsList);
7
+ const TogglableIconIds = Object.keys(TogglableIconsList);
8
+
9
+ const meta = {
10
+ title: "Icon",
11
+ component: IconComponent,
12
+ tags: ["autodocs"],
13
+ argTypes: {
14
+ name: {
15
+ control: "select",
16
+ options: [...RegularIconIds, ...TogglableIconIds].sort(),
17
+ description: "Nom de l’icône à afficher",
18
+ defaultValue: "check",
19
+ },
20
+ appearance: {
21
+ control: "select",
22
+ options: ["outlined", "filled"],
23
+ description: "Apparence de l’icône (pour les icônes togglables)",
24
+ defaultValue: "outlined",
25
+ },
26
+ size: {
27
+ control: { type: "number", min: 20, step: 1 },
28
+ description: "Taille de l’icône en pixels",
29
+ defaultValue: 20,
30
+ },
31
+ color: {
32
+ control: "color",
33
+ description: "Couleur de l’icône",
34
+ defaultValue: "#000000",
35
+ },
36
+ },
37
+ } satisfies Meta<IconComponent>;
38
+
39
+ export default meta;
40
+
41
+ type Story = StoryObj<IconComponent>;
42
+
43
+ export const Default: Story = {
44
+ args: {
45
+ name: "add",
46
+ size: 20,
47
+ color: "#000000",
48
+ appearance: "outlined",
49
+ },
50
+ };
51
+
52
+ export const RegularIcons: Story = {
53
+ render: (args) => ({
54
+ props: { ...args, iconNames: RegularIconIds },
55
+ template: `
56
+ <div style="display: flex; flex-direction: column; flex-wrap: wrap; gap: 10px; height: 700px">
57
+ <div *ngFor="let iconName of iconNames" style="display: flex; align-items: center; gap: 5px; border: 1px solid #ccc; padding: 5px">
58
+ <rte-icon
59
+ [name]="iconName"
60
+ />
61
+ <span>{{iconName}}</span>
62
+ </div>
63
+ </div>`,
64
+ }),
65
+ };
66
+
67
+ export const TogglableIcons: Story = {
68
+ render: (args) => ({
69
+ props: { ...args, iconNames: TogglableIconIds },
70
+ template: `
71
+ <div style="display: flex; flex-direction: column; flex-wrap: wrap; gap: 10px; height: 700px">
72
+ <div *ngFor="let iconName of iconNames" style="display: flex; align-items: center; gap: 5px; border: 1px solid #ccc; padding: 5px">
73
+ <rte-icon
74
+ [name]="iconName"
75
+ />
76
+ <rte-icon
77
+ [name]="iconName"
78
+ appearance="filled"
79
+ />
80
+ <span>{{iconName}}</span>
81
+ </div>
82
+ </div>`,
83
+ }),
84
+ };
@@ -0,0 +1,6 @@
1
+ <a href="{{ href() }}" class="rte-link" role="link" [ngClass]="{'subtle': subtle()}">
2
+ <span class="rte-link-label">
3
+ {{ label() }}
4
+ </span>
5
+ <rte-icon *ngIf="externalLink()" name="external-link" [size]="12"></rte-icon>
6
+ </a>
@@ -0,0 +1,108 @@
1
+ @use '@design-system-rte/core/tokens/main.scss' as *;
2
+
3
+ .rte-link {
4
+
5
+ @include typography-link-m;
6
+ align-items: center;
7
+ cursor: pointer;
8
+ display: inline-flex;
9
+ justify-content: center;
10
+
11
+ &:visited {
12
+
13
+ color: var(--content-link-visited);
14
+ text-decoration: underline;
15
+
16
+ &:hover {
17
+ color: var(--content-link-visited-hover);
18
+ text-decoration: none;
19
+ }
20
+
21
+ &:active {
22
+ color: var(--content-link-visited-press);
23
+ text-decoration: underline;
24
+ }
25
+
26
+ &:focus-visible {
27
+ color: var(--content-link-visited);
28
+ text-decoration: underline;
29
+ outline: 1px solid var(--border-brand-focused);
30
+ outline-offset: $radius-s;
31
+ border-radius: $radius-s;
32
+ }
33
+ }
34
+
35
+ &:not(:visited) {
36
+
37
+ color: var(--content-link-default);
38
+
39
+ &:hover {
40
+ color: var(--content-link-hover);
41
+ text-decoration: none;
42
+ }
43
+
44
+ &:active {
45
+ color: var(--content-link-press);
46
+ text-decoration: underline;
47
+ }
48
+
49
+ &:focus-visible {
50
+ color: var(--content-link-default);
51
+ text-decoration: underline;
52
+ outline: 1px solid var(--border-brand-focused);
53
+ outline-offset: $radius-s;
54
+ border-radius: $radius-s;
55
+ }
56
+ }
57
+
58
+ &.subtle{
59
+
60
+ &:visited {
61
+
62
+ color: var(--content-primary);
63
+ text-decoration: none;
64
+
65
+ &:hover {
66
+ color: var(--content-link-secondary);
67
+ text-decoration: underline;
68
+ }
69
+
70
+ &:active {
71
+ color: var(--content-link-primary);
72
+ text-decoration: none;
73
+ }
74
+
75
+ &:focus-visible {
76
+ color: var(--content-link-primary);
77
+ text-decoration: none;
78
+ outline: 1px solid var(--border-brand-focused);
79
+ outline-offset: $radius-s;
80
+ border-radius: $radius-s;
81
+ }
82
+ }
83
+
84
+ &:not(:visited) {
85
+
86
+ color: var(--content-primary);
87
+ text-decoration: none;
88
+
89
+ &:hover {
90
+ color: var(--content-secondary);
91
+ text-decoration: underline;
92
+ }
93
+
94
+ &:active {
95
+ color: var(--content-primary);
96
+ text-decoration: none;
97
+ }
98
+
99
+ &:focus-visible {
100
+ color: var(--content-primary);
101
+ text-decoration: none;
102
+ outline: 1px solid var(--border-brand-focused);
103
+ outline-offset: $radius-s;
104
+ border-radius: $radius-s;
105
+ }
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,61 @@
1
+ import { Meta, StoryObj } from "@storybook/angular";
2
+ import { userEvent, within, expect } from "@storybook/test";
3
+
4
+ import { LinkComponent } from "./link.component";
5
+
6
+ const meta: Meta<LinkComponent> = {
7
+ title: "Link",
8
+ component: LinkComponent,
9
+ tags: ["autodocs"],
10
+ argTypes: {
11
+ subtle: {
12
+ control: "boolean",
13
+ },
14
+ externalLink: {
15
+ control: "boolean",
16
+ },
17
+ },
18
+ };
19
+ export default meta;
20
+ type Story = StoryObj<LinkComponent>;
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ label: "Link",
25
+ href: "#",
26
+ },
27
+ };
28
+
29
+ export const SubtleLink: Story = {
30
+ args: {
31
+ ...Default.args,
32
+ subtle: true,
33
+ },
34
+ };
35
+
36
+ export const SubtleLinkExternal: Story = {
37
+ args: {
38
+ ...SubtleLink.args,
39
+ externalLink: true,
40
+ },
41
+ };
42
+
43
+ export const ExternalLink: Story = {
44
+ args: {
45
+ ...Default.args,
46
+ externalLink: true,
47
+ },
48
+ };
49
+
50
+ export const KeyboardInteraction: Story = {
51
+ args: {
52
+ ...Default.args,
53
+ href: "#",
54
+ },
55
+ play: async ({ canvasElement }) => {
56
+ const canvas = within(canvasElement);
57
+ const link = canvas.getByRole("link");
58
+ await userEvent.tab();
59
+ expect(link).toHaveFocus();
60
+ },
61
+ };