pdm-ui-kit 0.1.0
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.
- package/FIGMA_COMPONENT_AUDIT.md +154 -0
- package/README.md +72 -0
- package/ng-package.json +7 -0
- package/package.json +29 -0
- package/src/lib/components/accordion/accordion.component.html +34 -0
- package/src/lib/components/accordion/accordion.component.ts +38 -0
- package/src/lib/components/alert/alert.component.html +52 -0
- package/src/lib/components/alert/alert.component.ts +25 -0
- package/src/lib/components/alert-dialog/alert-dialog.component.html +41 -0
- package/src/lib/components/alert-dialog/alert-dialog.component.ts +45 -0
- package/src/lib/components/aspect-ratio/aspect-ratio.component.html +11 -0
- package/src/lib/components/aspect-ratio/aspect-ratio.component.ts +18 -0
- package/src/lib/components/avatar/avatar.component.html +21 -0
- package/src/lib/components/avatar/avatar.component.ts +32 -0
- package/src/lib/components/badge/badge.component.html +28 -0
- package/src/lib/components/badge/badge.component.ts +23 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.html +39 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +26 -0
- package/src/lib/components/button/button.component.html +15 -0
- package/src/lib/components/button/button.component.ts +84 -0
- package/src/lib/components/button-group/button-group.component.html +39 -0
- package/src/lib/components/button-group/button-group.component.ts +15 -0
- package/src/lib/components/calendar/calendar.component.html +73 -0
- package/src/lib/components/calendar/calendar.component.ts +78 -0
- package/src/lib/components/card/card.component.html +77 -0
- package/src/lib/components/card/card.component.ts +39 -0
- package/src/lib/components/carousel/carousel.component.html +86 -0
- package/src/lib/components/carousel/carousel.component.ts +100 -0
- package/src/lib/components/chart/chart.component.html +143 -0
- package/src/lib/components/chart/chart.component.ts +147 -0
- package/src/lib/components/checkbox/checkbox.component.html +38 -0
- package/src/lib/components/checkbox/checkbox.component.ts +32 -0
- package/src/lib/components/collapsible/collapsible.component.html +26 -0
- package/src/lib/components/collapsible/collapsible.component.ts +29 -0
- package/src/lib/components/combobox/combobox.component.html +42 -0
- package/src/lib/components/combobox/combobox.component.ts +32 -0
- package/src/lib/components/command/command.component.html +55 -0
- package/src/lib/components/command/command.component.ts +67 -0
- package/src/lib/components/context-menu/context-menu.component.html +47 -0
- package/src/lib/components/context-menu/context-menu.component.ts +67 -0
- package/src/lib/components/data-table/data-table.component.html +63 -0
- package/src/lib/components/data-table/data-table.component.ts +78 -0
- package/src/lib/components/date-picker/date-picker.component.html +38 -0
- package/src/lib/components/date-picker/date-picker.component.ts +34 -0
- package/src/lib/components/dialog/dialog.component.html +78 -0
- package/src/lib/components/dialog/dialog.component.ts +55 -0
- package/src/lib/components/drawer/drawer.component.html +56 -0
- package/src/lib/components/drawer/drawer.component.ts +43 -0
- package/src/lib/components/dropdown-menu/dropdown-menu.component.html +56 -0
- package/src/lib/components/dropdown-menu/dropdown-menu.component.ts +126 -0
- package/src/lib/components/empty/empty.component.html +29 -0
- package/src/lib/components/empty/empty.component.ts +35 -0
- package/src/lib/components/field/field.component.html +22 -0
- package/src/lib/components/field/field.component.ts +28 -0
- package/src/lib/components/hover-card/hover-card.component.html +24 -0
- package/src/lib/components/hover-card/hover-card.component.ts +36 -0
- package/src/lib/components/icon/icon.component.html +286 -0
- package/src/lib/components/icon/icon.component.ts +133 -0
- package/src/lib/components/input/input.component.html +22 -0
- package/src/lib/components/input/input.component.ts +33 -0
- package/src/lib/components/input-group/input-group.component.html +31 -0
- package/src/lib/components/input-group/input-group.component.ts +26 -0
- package/src/lib/components/input-otp/input-otp.component.html +25 -0
- package/src/lib/components/input-otp/input-otp.component.ts +146 -0
- package/src/lib/components/input-password/input-password.component.html +64 -0
- package/src/lib/components/input-password/input-password.component.ts +46 -0
- package/src/lib/components/item/item.component.html +10 -0
- package/src/lib/components/item/item.component.ts +12 -0
- package/src/lib/components/kbd/kbd.component.html +3 -0
- package/src/lib/components/kbd/kbd.component.ts +10 -0
- package/src/lib/components/label/label.component.html +7 -0
- package/src/lib/components/label/label.component.ts +12 -0
- package/src/lib/components/menubar/menubar.component.html +16 -0
- package/src/lib/components/menubar/menubar.component.ts +29 -0
- package/src/lib/components/native-select/native-select.component.html +17 -0
- package/src/lib/components/native-select/native-select.component.ts +28 -0
- package/src/lib/components/navigation-menu/navigation-menu.component.html +15 -0
- package/src/lib/components/navigation-menu/navigation-menu.component.ts +17 -0
- package/src/lib/components/pagination/pagination.component.html +30 -0
- package/src/lib/components/pagination/pagination.component.ts +37 -0
- package/src/lib/components/popover/popover.component.html +6 -0
- package/src/lib/components/popover/popover.component.ts +40 -0
- package/src/lib/components/progress/progress.component.html +9 -0
- package/src/lib/components/progress/progress.component.ts +20 -0
- package/src/lib/components/radio-group/radio-group.component.html +25 -0
- package/src/lib/components/radio-group/radio-group.component.ts +30 -0
- package/src/lib/components/scroll-area/scroll-area.component.html +5 -0
- package/src/lib/components/scroll-area/scroll-area.component.ts +11 -0
- package/src/lib/components/select/select.component.html +14 -0
- package/src/lib/components/select/select.component.ts +27 -0
- package/src/lib/components/separator/separator.component.html +5 -0
- package/src/lib/components/separator/separator.component.ts +16 -0
- package/src/lib/components/sheet/sheet.component.html +10 -0
- package/src/lib/components/sheet/sheet.component.ts +28 -0
- package/src/lib/components/sidebar/sidebar.component.html +3 -0
- package/src/lib/components/sidebar/sidebar.component.ts +11 -0
- package/src/lib/components/skeleton/skeleton.component.html +1 -0
- package/src/lib/components/skeleton/skeleton.component.ts +10 -0
- package/src/lib/components/slider/slider.component.html +15 -0
- package/src/lib/components/slider/slider.component.ts +31 -0
- package/src/lib/components/sonner/sonner.component.html +10 -0
- package/src/lib/components/sonner/sonner.component.ts +25 -0
- package/src/lib/components/spinner/spinner.component.html +6 -0
- package/src/lib/components/spinner/spinner.component.ts +11 -0
- package/src/lib/components/switch/switch.component.html +14 -0
- package/src/lib/components/switch/switch.component.ts +20 -0
- package/src/lib/components/table/table.component.html +5 -0
- package/src/lib/components/table/table.component.ts +10 -0
- package/src/lib/components/tabs/tabs.component.html +21 -0
- package/src/lib/components/tabs/tabs.component.ts +26 -0
- package/src/lib/components/textarea/textarea.component.html +21 -0
- package/src/lib/components/textarea/textarea.component.ts +28 -0
- package/src/lib/components/toggle/toggle.component.html +16 -0
- package/src/lib/components/toggle/toggle.component.ts +29 -0
- package/src/lib/components/toggle-group/toggle-group.component.html +17 -0
- package/src/lib/components/toggle-group/toggle-group.component.ts +26 -0
- package/src/lib/components/tooltip/tooltip.component.html +6 -0
- package/src/lib/components/tooltip/tooltip.component.ts +20 -0
- package/src/lib/pdm-ui-kit.module.ts +126 -0
- package/src/public-api.ts +58 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +9 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
<ng-container *ngIf="assetUrl; else inlineIcon">
|
|
2
|
+
<img
|
|
3
|
+
[src]="assetUrl"
|
|
4
|
+
[style.width.px]="size"
|
|
5
|
+
[style.height.px]="size"
|
|
6
|
+
[ngClass]="className"
|
|
7
|
+
[attr.role]="decorative ? null : 'img'"
|
|
8
|
+
[attr.aria-hidden]="decorative ? 'true' : null"
|
|
9
|
+
[attr.aria-label]="!decorative ? ariaLabel || name : null"
|
|
10
|
+
alt=""
|
|
11
|
+
/>
|
|
12
|
+
</ng-container>
|
|
13
|
+
|
|
14
|
+
<ng-template #inlineIcon>
|
|
15
|
+
<svg
|
|
16
|
+
[attr.width]="size"
|
|
17
|
+
[attr.height]="size"
|
|
18
|
+
[ngClass]="className"
|
|
19
|
+
[attr.role]="decorative ? null : 'img'"
|
|
20
|
+
[attr.aria-hidden]="decorative ? 'true' : null"
|
|
21
|
+
[attr.aria-label]="!decorative ? ariaLabel || name : null"
|
|
22
|
+
viewBox="0 0 24 24"
|
|
23
|
+
fill="none"
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
>
|
|
26
|
+
<ng-container [ngSwitch]="iconKey">
|
|
27
|
+
<g *ngSwitchCase="'command'">
|
|
28
|
+
<path d="M9 9V15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
29
|
+
<path d="M15 9V15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
30
|
+
<path d="M9 9H15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
31
|
+
<path d="M9 15H15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
32
|
+
<path d="M9 9H7.5C6.12 9 5 7.88 5 6.5C5 5.12 6.12 4 7.5 4C8.88 4 10 5.12 10 6.5V8" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
33
|
+
<path d="M15 9H16.5C17.88 9 19 7.88 19 6.5C19 5.12 17.88 4 16.5 4C15.12 4 14 5.12 14 6.5V8" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
34
|
+
<path d="M9 15H7.5C6.12 15 5 16.12 5 17.5C5 18.88 6.12 20 7.5 20C8.88 20 10 18.88 10 17.5V16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
35
|
+
<path d="M15 15H16.5C17.88 15 19 16.12 19 17.5C19 18.88 17.88 20 16.5 20C15.12 20 14 18.88 14 17.5V16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
36
|
+
</g>
|
|
37
|
+
|
|
38
|
+
<g *ngSwitchCase="'check'">
|
|
39
|
+
<path d="M5 12.5L9.2 16.7L19 7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
40
|
+
</g>
|
|
41
|
+
|
|
42
|
+
<g *ngSwitchCase="'check-circle'">
|
|
43
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
44
|
+
<path d="M8.5 12.2L11 14.7L15.8 9.9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
45
|
+
</g>
|
|
46
|
+
|
|
47
|
+
<g *ngSwitchCase="'circle'">
|
|
48
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
49
|
+
</g>
|
|
50
|
+
|
|
51
|
+
<g *ngSwitchCase="'dot'">
|
|
52
|
+
<circle cx="12" cy="12" r="2.5" fill="currentColor"></circle>
|
|
53
|
+
</g>
|
|
54
|
+
|
|
55
|
+
<g *ngSwitchCase="'x'">
|
|
56
|
+
<path d="M6 6L18 18M18 6L6 18" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
57
|
+
</g>
|
|
58
|
+
|
|
59
|
+
<g *ngSwitchCase="'alert-circle'">
|
|
60
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
61
|
+
<path d="M12 8V12" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
62
|
+
<circle cx="12" cy="16" r="1" fill="currentColor"></circle>
|
|
63
|
+
</g>
|
|
64
|
+
|
|
65
|
+
<g *ngSwitchCase="'info'">
|
|
66
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
67
|
+
<path d="M12 11V16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
68
|
+
<circle cx="12" cy="8" r="1" fill="currentColor"></circle>
|
|
69
|
+
</g>
|
|
70
|
+
|
|
71
|
+
<g *ngSwitchCase="'loader-2'">
|
|
72
|
+
<path d="M12 3A9 9 0 1 0 21 12" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
73
|
+
</g>
|
|
74
|
+
|
|
75
|
+
<g *ngSwitchCase="'menu'">
|
|
76
|
+
<path d="M4 7H20M4 12H20M4 17H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
77
|
+
</g>
|
|
78
|
+
|
|
79
|
+
<g *ngSwitchCase="'search'">
|
|
80
|
+
<circle cx="11" cy="11" r="7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
81
|
+
<path d="M20 20L16.6 16.6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
82
|
+
</g>
|
|
83
|
+
|
|
84
|
+
<g *ngSwitchCase="'calendar'">
|
|
85
|
+
<path d="M8 3V6M16 3V6M4 10H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
86
|
+
<rect x="4" y="6" width="16" height="14" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
87
|
+
</g>
|
|
88
|
+
|
|
89
|
+
<g *ngSwitchCase="'panel-left'">
|
|
90
|
+
<rect x="3" y="4" width="18" height="16" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
91
|
+
<path d="M9 4V20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></path>
|
|
92
|
+
</g>
|
|
93
|
+
|
|
94
|
+
<g *ngSwitchCase="'monitor'">
|
|
95
|
+
<rect x="3" y="4" width="18" height="13" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
96
|
+
<path d="M8 20H16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
97
|
+
<path d="M12 17V20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
98
|
+
</g>
|
|
99
|
+
|
|
100
|
+
<g *ngSwitchCase="'laptop'">
|
|
101
|
+
<rect x="5" y="5" width="14" height="10" rx="1.5" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
102
|
+
<path d="M3 18H21" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
103
|
+
</g>
|
|
104
|
+
|
|
105
|
+
<g *ngSwitchCase="'sun'">
|
|
106
|
+
<circle cx="12" cy="12" r="4" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
107
|
+
<path d="M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M19.07 19.07L17.66 17.66M6.34 6.34L4.93 4.93" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
108
|
+
</g>
|
|
109
|
+
|
|
110
|
+
<g *ngSwitchCase="'moon'">
|
|
111
|
+
<path d="M20 14.5C19.1 17.9 16 20.5 12.3 20.5C7.9 20.5 4.3 16.9 4.3 12.5C4.3 8.8 6.8 5.8 10.2 4.8C9.6 5.8 9.3 7 9.3 8.2C9.3 11.8 12.2 14.7 15.8 14.7C17 14.7 18.1 14.4 19.1 13.8C19.4 13.6 20.1 14 20 14.5Z" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
112
|
+
</g>
|
|
113
|
+
|
|
114
|
+
<g *ngSwitchCase="'chevron-down'">
|
|
115
|
+
<path d="M7 10L12 15L17 10" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
116
|
+
</g>
|
|
117
|
+
|
|
118
|
+
<g *ngSwitchCase="'chevron-up'">
|
|
119
|
+
<path d="M17 14L12 9L7 14" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
120
|
+
</g>
|
|
121
|
+
|
|
122
|
+
<g *ngSwitchCase="'chevron-left'">
|
|
123
|
+
<path d="M15 18L9 12L15 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
124
|
+
</g>
|
|
125
|
+
|
|
126
|
+
<g *ngSwitchCase="'chevron-right'">
|
|
127
|
+
<path d="M9 18L15 12L9 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
128
|
+
</g>
|
|
129
|
+
|
|
130
|
+
<g *ngSwitchCase="'chevrons-left'">
|
|
131
|
+
<path d="M14 18L8 12L14 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
132
|
+
<path d="M20 18L14 12L20 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
133
|
+
</g>
|
|
134
|
+
|
|
135
|
+
<g *ngSwitchCase="'chevrons-right'">
|
|
136
|
+
<path d="M10 18L16 12L10 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
137
|
+
<path d="M4 18L10 12L4 6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
138
|
+
</g>
|
|
139
|
+
|
|
140
|
+
<g *ngSwitchCase="'chevrons-up-down'">
|
|
141
|
+
<path d="M7 15L12 20L17 15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
142
|
+
<path d="M17 9L12 4L7 9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
143
|
+
</g>
|
|
144
|
+
|
|
145
|
+
<g *ngSwitchCase="'arrow-up-down'">
|
|
146
|
+
<path d="M12 4V20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
147
|
+
<path d="M8 8L12 4L16 8" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
148
|
+
<path d="M8 16L12 20L16 16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
149
|
+
</g>
|
|
150
|
+
|
|
151
|
+
<g *ngSwitchCase="'ellipsis'">
|
|
152
|
+
<circle cx="6" cy="12" r="1.5" fill="currentColor"></circle>
|
|
153
|
+
<circle cx="12" cy="12" r="1.5" fill="currentColor"></circle>
|
|
154
|
+
<circle cx="18" cy="12" r="1.5" fill="currentColor"></circle>
|
|
155
|
+
</g>
|
|
156
|
+
|
|
157
|
+
<g *ngSwitchCase="'filter'">
|
|
158
|
+
<path d="M4 6H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
159
|
+
<path d="M7 12H17" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
160
|
+
<path d="M10 18H14" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
161
|
+
</g>
|
|
162
|
+
|
|
163
|
+
<g *ngSwitchCase="'sort-asc'">
|
|
164
|
+
<path d="M7 18V6" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
165
|
+
<path d="M4 9L7 6L10 9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
166
|
+
<path d="M14 8H20M14 12H18M14 16H16" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
167
|
+
</g>
|
|
168
|
+
|
|
169
|
+
<g *ngSwitchCase="'sort-desc'">
|
|
170
|
+
<path d="M7 6V18" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
171
|
+
<path d="M4 15L7 18L10 15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
172
|
+
<path d="M14 8H16M14 12H18M14 16H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
173
|
+
</g>
|
|
174
|
+
|
|
175
|
+
<g *ngSwitchCase="'plus'">
|
|
176
|
+
<path d="M12 5V19M5 12H19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
177
|
+
</g>
|
|
178
|
+
|
|
179
|
+
<g *ngSwitchCase="'minus'">
|
|
180
|
+
<path d="M5 12H19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
181
|
+
</g>
|
|
182
|
+
|
|
183
|
+
<g *ngSwitchCase="'copy'">
|
|
184
|
+
<rect x="9" y="9" width="11" height="11" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
185
|
+
<rect x="4" y="4" width="11" height="11" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
186
|
+
</g>
|
|
187
|
+
|
|
188
|
+
<g *ngSwitchCase="'pencil'">
|
|
189
|
+
<path d="M12 20H21" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
190
|
+
<path d="M16.5 4.5C17.1 3.9 18 3.9 18.6 4.5L19.5 5.4C20.1 6 20.1 6.9 19.5 7.5L9 18L4 19L5 14L16.5 4.5Z" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linejoin="round"></path>
|
|
191
|
+
</g>
|
|
192
|
+
|
|
193
|
+
<g *ngSwitchCase="'trash-2'">
|
|
194
|
+
<path d="M4 7H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
195
|
+
<path d="M9 7V5C9 4.4 9.4 4 10 4H14C14.6 4 15 4.4 15 5V7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
196
|
+
<path d="M7 7L8 19C8 19.6 8.4 20 9 20H15C15.6 20 16 19.6 16 19L17 7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
197
|
+
<path d="M10 11V17M14 11V17" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
198
|
+
</g>
|
|
199
|
+
|
|
200
|
+
<g *ngSwitchCase="'download'">
|
|
201
|
+
<path d="M12 4V14" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
202
|
+
<path d="M8 10L12 14L16 10" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
203
|
+
<path d="M5 19H19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
204
|
+
</g>
|
|
205
|
+
|
|
206
|
+
<g *ngSwitchCase="'upload'">
|
|
207
|
+
<path d="M12 20V10" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
208
|
+
<path d="M8 14L12 10L16 14" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
209
|
+
<path d="M5 5H19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
210
|
+
</g>
|
|
211
|
+
|
|
212
|
+
<g *ngSwitchCase="'home'">
|
|
213
|
+
<path d="M4 10.5L12 4L20 10.5" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
214
|
+
<path d="M6 9.5V20H18V9.5" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
215
|
+
</g>
|
|
216
|
+
|
|
217
|
+
<g *ngSwitchCase="'mail'">
|
|
218
|
+
<rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
219
|
+
<path d="M4 7L12 13L20 7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
220
|
+
</g>
|
|
221
|
+
|
|
222
|
+
<g *ngSwitchCase="'phone'">
|
|
223
|
+
<path d="M8.8 4.6C9.2 3.8 10.2 3.5 11 4L13.3 5.2C14.1 5.6 14.4 6.6 14 7.4L13 9.2C12.8 9.6 12.9 10.1 13.2 10.4L14.9 12.1C15.2 12.4 15.7 12.5 16.1 12.3L17.9 11.3C18.7 10.9 19.7 11.2 20.1 12L21.3 14.3C21.8 15.1 21.5 16.1 20.7 16.5L18.8 17.5C16.9 18.5 14.5 18.1 12.9 16.5L7.5 11.1C5.9 9.5 5.5 7.1 6.5 5.2L8.8 4.6Z" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linejoin="round"></path>
|
|
224
|
+
</g>
|
|
225
|
+
|
|
226
|
+
<g *ngSwitchCase="'log-in'">
|
|
227
|
+
<path d="M15 3H18C19.1 3 20 3.9 20 5V19C20 20.1 19.1 21 18 21H15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
228
|
+
<path d="M10 17L14 13L10 9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
229
|
+
<path d="M14 13H4" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
230
|
+
</g>
|
|
231
|
+
|
|
232
|
+
<g *ngSwitchCase="'log-out'">
|
|
233
|
+
<path d="M9 3H6C4.9 3 4 3.9 4 5V19C4 20.1 4.9 21 6 21H9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
234
|
+
<path d="M14 17L10 13L14 9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
235
|
+
<path d="M10 13H20" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
236
|
+
</g>
|
|
237
|
+
|
|
238
|
+
<g *ngSwitchCase="'user'">
|
|
239
|
+
<circle cx="12" cy="8" r="3" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
240
|
+
<path d="M6 19C6.8 16.7 8.9 15.5 12 15.5C15.1 15.5 17.2 16.7 18 19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
241
|
+
</g>
|
|
242
|
+
|
|
243
|
+
<g *ngSwitchCase="'settings'">
|
|
244
|
+
<circle cx="12" cy="12" r="3" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
245
|
+
<path d="M19 12A7 7 0 1 0 12 19" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
246
|
+
</g>
|
|
247
|
+
|
|
248
|
+
<g *ngSwitchCase="'credit-card'">
|
|
249
|
+
<rect x="3" y="6" width="18" height="12" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
250
|
+
<path d="M3 10H21" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></path>
|
|
251
|
+
</g>
|
|
252
|
+
|
|
253
|
+
<g *ngSwitchCase="'smile'">
|
|
254
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
255
|
+
<path d="M9 15C9.7 16 10.7 16.5 12 16.5C13.3 16.5 14.3 16 15 15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
256
|
+
<circle cx="9" cy="10" r="1" fill="currentColor"></circle>
|
|
257
|
+
<circle cx="15" cy="10" r="1" fill="currentColor"></circle>
|
|
258
|
+
</g>
|
|
259
|
+
|
|
260
|
+
<g *ngSwitchCase="'calculator'">
|
|
261
|
+
<rect x="6" y="3" width="12" height="18" rx="2" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></rect>
|
|
262
|
+
<path d="M9 7H15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
263
|
+
<path d="M9 12H10M14 12H15M9 16H10M14 16H15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
264
|
+
</g>
|
|
265
|
+
|
|
266
|
+
<g *ngSwitchCase="'external-link'">
|
|
267
|
+
<path d="M14 5H19V10" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
268
|
+
<path d="M10 14L19 5" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
269
|
+
<path d="M19 14V19H5V5H10" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
270
|
+
</g>
|
|
271
|
+
|
|
272
|
+
<g *ngSwitchCase="'folder'">
|
|
273
|
+
<path d="M3 7C3 5.9 3.9 5 5 5H9L11 7H19C20.1 7 21 7.9 21 9V17C21 18.1 20.1 19 19 19H5C3.9 19 3 18.1 3 17V7Z" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linejoin="round"></path>
|
|
274
|
+
</g>
|
|
275
|
+
|
|
276
|
+
<g *ngSwitchCase="'arrow-up-right'">
|
|
277
|
+
<path d="M7 17L17 7" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round"></path>
|
|
278
|
+
<path d="M9 7H17V15" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
279
|
+
</g>
|
|
280
|
+
|
|
281
|
+
<g *ngSwitchDefault>
|
|
282
|
+
<circle cx="12" cy="12" r="9" stroke="currentColor" [attr.stroke-width]="resolvedStrokeWidth"></circle>
|
|
283
|
+
</g>
|
|
284
|
+
</ng-container>
|
|
285
|
+
</svg>
|
|
286
|
+
</ng-template>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export type PdmIconLibrary = 'lucide' | 'tabler' | 'hugeicons' | 'phosphor' | 'remix';
|
|
4
|
+
|
|
5
|
+
export type PdmIconName =
|
|
6
|
+
| 'command'
|
|
7
|
+
| 'check'
|
|
8
|
+
| 'check-circle'
|
|
9
|
+
| 'circle'
|
|
10
|
+
| 'dot'
|
|
11
|
+
| 'x'
|
|
12
|
+
| 'alert-circle'
|
|
13
|
+
| 'info'
|
|
14
|
+
| 'loader-2'
|
|
15
|
+
| 'menu'
|
|
16
|
+
| 'search'
|
|
17
|
+
| 'calendar'
|
|
18
|
+
| 'panel-left'
|
|
19
|
+
| 'monitor'
|
|
20
|
+
| 'laptop'
|
|
21
|
+
| 'sun'
|
|
22
|
+
| 'moon'
|
|
23
|
+
| 'chevron-down'
|
|
24
|
+
| 'chevron-up'
|
|
25
|
+
| 'chevron-left'
|
|
26
|
+
| 'chevron-right'
|
|
27
|
+
| 'chevrons-left'
|
|
28
|
+
| 'chevrons-right'
|
|
29
|
+
| 'chevrons-up-down'
|
|
30
|
+
| 'arrow-up-down'
|
|
31
|
+
| 'ellipsis'
|
|
32
|
+
| 'filter'
|
|
33
|
+
| 'sort-asc'
|
|
34
|
+
| 'sort-desc'
|
|
35
|
+
| 'plus'
|
|
36
|
+
| 'minus'
|
|
37
|
+
| 'copy'
|
|
38
|
+
| 'pencil'
|
|
39
|
+
| 'trash-2'
|
|
40
|
+
| 'download'
|
|
41
|
+
| 'upload'
|
|
42
|
+
| 'home'
|
|
43
|
+
| 'mail'
|
|
44
|
+
| 'phone'
|
|
45
|
+
| 'log-in'
|
|
46
|
+
| 'log-out'
|
|
47
|
+
| 'user'
|
|
48
|
+
| 'settings'
|
|
49
|
+
| 'credit-card'
|
|
50
|
+
| 'smile'
|
|
51
|
+
| 'calculator'
|
|
52
|
+
| 'external-link'
|
|
53
|
+
| 'folder'
|
|
54
|
+
| 'arrow-up-right';
|
|
55
|
+
|
|
56
|
+
@Component({
|
|
57
|
+
selector: 'pdm-icon',
|
|
58
|
+
templateUrl: './icon.component.html',
|
|
59
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
60
|
+
})
|
|
61
|
+
export class PdmIconComponent {
|
|
62
|
+
@Input() name: PdmIconName | string = 'check';
|
|
63
|
+
@Input() library: PdmIconLibrary = 'lucide';
|
|
64
|
+
@Input() assetUrl: string | null = null;
|
|
65
|
+
@Input() size = 16;
|
|
66
|
+
@Input() strokeWidth = 1.5;
|
|
67
|
+
@Input() className = '';
|
|
68
|
+
@Input() ariaLabel: string | null = null;
|
|
69
|
+
@Input() decorative = false;
|
|
70
|
+
|
|
71
|
+
get resolvedStrokeWidth(): number {
|
|
72
|
+
if (this.strokeWidth) {
|
|
73
|
+
return this.strokeWidth;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (this.library === 'phosphor') {
|
|
77
|
+
return 1.6;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (this.library === 'tabler') {
|
|
81
|
+
return 1.8;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return 1.5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get iconKey(): string {
|
|
88
|
+
const raw = `${this.name || ''}`.trim();
|
|
89
|
+
if (!raw) {
|
|
90
|
+
return 'circle';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const trimmed = raw.replace(/^(lucide|tabler|hugeicons|phosphor|remix)\//, '');
|
|
94
|
+
const aliases = this.aliasMapByLibrary[this.library] ?? {};
|
|
95
|
+
return aliases[trimmed] ?? trimmed;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private readonly aliasMapByLibrary: Record<PdmIconLibrary, Record<string, string>> = {
|
|
99
|
+
lucide: {},
|
|
100
|
+
tabler: {
|
|
101
|
+
'alert-triangle': 'alert-circle',
|
|
102
|
+
'chevron-down': 'chevron-down',
|
|
103
|
+
'chevron-right': 'chevron-right',
|
|
104
|
+
'user-circle': 'user',
|
|
105
|
+
'settings-2': 'settings',
|
|
106
|
+
'external-link': 'external-link'
|
|
107
|
+
},
|
|
108
|
+
hugeicons: {
|
|
109
|
+
'alert-02': 'alert-circle',
|
|
110
|
+
'user-circle': 'user',
|
|
111
|
+
'search-01': 'search',
|
|
112
|
+
'settings-01': 'settings',
|
|
113
|
+
'arrow-right-01': 'chevron-right',
|
|
114
|
+
'arrow-down-01': 'chevron-down'
|
|
115
|
+
},
|
|
116
|
+
phosphor: {
|
|
117
|
+
'warning-circle': 'alert-circle',
|
|
118
|
+
'caret-down': 'chevron-down',
|
|
119
|
+
'caret-right': 'chevron-right',
|
|
120
|
+
'user-circle': 'user',
|
|
121
|
+
gear: 'settings',
|
|
122
|
+
'arrow-square-out': 'external-link'
|
|
123
|
+
},
|
|
124
|
+
remix: {
|
|
125
|
+
'alert-line': 'alert-circle',
|
|
126
|
+
'arrow-right-line': 'chevron-right',
|
|
127
|
+
'arrow-down-s-line': 'chevron-down',
|
|
128
|
+
'external-link-line': 'external-link',
|
|
129
|
+
'user-line': 'user',
|
|
130
|
+
'settings-3-line': 'settings'
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div [ngClass]="['grid w-full gap-2', className]">
|
|
2
|
+
<label *ngIf="label" [attr.for]="id" class="text-sm font-medium leading-5 text-foreground">{{ label }}</label>
|
|
3
|
+
<input
|
|
4
|
+
[id]="id"
|
|
5
|
+
[type]="type"
|
|
6
|
+
[value]="value"
|
|
7
|
+
[placeholder]="placeholder"
|
|
8
|
+
[disabled]="disabled"
|
|
9
|
+
[readonly]="readonly"
|
|
10
|
+
[required]="required"
|
|
11
|
+
[attr.aria-invalid]="invalid"
|
|
12
|
+
[ngClass]="[
|
|
13
|
+
'flex h-9 w-full rounded-[8px] border bg-background px-3 py-2 text-sm leading-5 text-foreground shadow-[0_1px_2px_rgba(0,0,0,0.1)] outline-none ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:outline-none focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/30 disabled:cursor-not-allowed disabled:opacity-50',
|
|
14
|
+
invalid ? 'border-destructive' : 'border-input',
|
|
15
|
+
inputClassName
|
|
16
|
+
]"
|
|
17
|
+
(input)="onInput($event)"
|
|
18
|
+
(blur)="onBlur($event)"
|
|
19
|
+
/>
|
|
20
|
+
<p *ngIf="!invalid && helperText" class="text-sm leading-5 text-muted-foreground">{{ helperText }}</p>
|
|
21
|
+
<p *ngIf="invalid && errorText" class="text-sm leading-5 text-destructive">{{ errorText }}</p>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'pdm-input',
|
|
5
|
+
templateUrl: './input.component.html',
|
|
6
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
+
})
|
|
8
|
+
export class PdmInputComponent {
|
|
9
|
+
@Input() id = '';
|
|
10
|
+
@Input() type = 'text';
|
|
11
|
+
@Input() value = '';
|
|
12
|
+
@Input() placeholder = '';
|
|
13
|
+
@Input() disabled = false;
|
|
14
|
+
@Input() readonly = false;
|
|
15
|
+
@Input() required = false;
|
|
16
|
+
@Input() invalid = false;
|
|
17
|
+
@Input() className = '';
|
|
18
|
+
@Input() inputClassName = '';
|
|
19
|
+
@Input() label = '';
|
|
20
|
+
@Input() helperText = '';
|
|
21
|
+
@Input() errorText = '';
|
|
22
|
+
|
|
23
|
+
@Output() valueChange = new EventEmitter<string>();
|
|
24
|
+
@Output() blurred = new EventEmitter<FocusEvent>();
|
|
25
|
+
|
|
26
|
+
onInput(event: Event): void {
|
|
27
|
+
this.valueChange.emit((event.target as HTMLInputElement).value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
onBlur(event: FocusEvent): void {
|
|
31
|
+
this.blurred.emit(event);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<div
|
|
2
|
+
[ngClass]="[
|
|
3
|
+
'flex h-9 w-full items-center rounded-[8px] border bg-[hsl(var(--background))] text-sm shadow-[0_1px_2px_rgba(0,0,0,0.1)] ring-offset-[hsl(var(--background))] focus-within:ring-1 focus-within:ring-[hsl(var(--foreground))]',
|
|
4
|
+
invalid ? 'border-[hsl(var(--destructive))]' : 'border-[hsl(var(--input))]',
|
|
5
|
+
disabled ? 'opacity-50' : '',
|
|
6
|
+
className
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<div *ngIf="prefixText || prefixIcon" class="inline-flex h-full items-center gap-2 border-r border-[hsl(var(--input))] pl-3 pr-2 text-[hsl(var(--muted-foreground))]">
|
|
10
|
+
<pdm-icon *ngIf="prefixIcon" [name]="prefixIcon" [size]="16"></pdm-icon>
|
|
11
|
+
<span *ngIf="prefixText" class="text-sm leading-5">{{ prefixText }}</span>
|
|
12
|
+
<ng-content select="[pdmInputGroupPrefix]"></ng-content>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<input
|
|
16
|
+
[id]="id"
|
|
17
|
+
[type]="type"
|
|
18
|
+
[value]="value"
|
|
19
|
+
[placeholder]="placeholder"
|
|
20
|
+
[disabled]="disabled"
|
|
21
|
+
[attr.aria-invalid]="invalid"
|
|
22
|
+
class="h-full min-w-0 flex-1 border-0 bg-transparent px-2 py-2 text-sm leading-5 outline-none placeholder:text-[hsl(var(--muted-foreground))]"
|
|
23
|
+
(input)="onInput($event)"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<div *ngIf="suffixText || suffixIcon" class="inline-flex h-full items-center gap-2 border-l border-[hsl(var(--input))] pl-2 pr-3 text-[hsl(var(--muted-foreground))]">
|
|
27
|
+
<pdm-icon *ngIf="suffixIcon" [name]="suffixIcon" [size]="16"></pdm-icon>
|
|
28
|
+
<span *ngIf="suffixText" class="text-sm font-medium leading-5">{{ suffixText }}</span>
|
|
29
|
+
<ng-content select="[pdmInputGroupSuffix]"></ng-content>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'pdm-input-group',
|
|
5
|
+
templateUrl: './input-group.component.html',
|
|
6
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
7
|
+
})
|
|
8
|
+
export class PdmInputGroupComponent {
|
|
9
|
+
@Input() id = '';
|
|
10
|
+
@Input() type = 'text';
|
|
11
|
+
@Input() value = '';
|
|
12
|
+
@Input() placeholder = '';
|
|
13
|
+
@Input() disabled = false;
|
|
14
|
+
@Input() invalid = false;
|
|
15
|
+
@Input() prefixText = '';
|
|
16
|
+
@Input() suffixText = '';
|
|
17
|
+
@Input() prefixIcon = '';
|
|
18
|
+
@Input() suffixIcon = '';
|
|
19
|
+
@Input() className = '';
|
|
20
|
+
|
|
21
|
+
@Output() valueChange = new EventEmitter<string>();
|
|
22
|
+
|
|
23
|
+
onInput(event: Event): void {
|
|
24
|
+
this.valueChange.emit((event.target as HTMLInputElement).value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div [ngClass]="['inline-flex items-center justify-center', className]" (paste)="onPaste($event)">
|
|
2
|
+
<ng-container *ngFor="let value of values; let index = index; trackBy: trackByIndex">
|
|
3
|
+
<input
|
|
4
|
+
#otpInput
|
|
5
|
+
[class]="getInputClasses(index)"
|
|
6
|
+
[value]="value"
|
|
7
|
+
[disabled]="disabled"
|
|
8
|
+
inputmode="numeric"
|
|
9
|
+
maxlength="1"
|
|
10
|
+
[attr.name]="'otp-digit-' + index"
|
|
11
|
+
autocomplete="off"
|
|
12
|
+
autocapitalize="off"
|
|
13
|
+
spellcheck="false"
|
|
14
|
+
[attr.aria-invalid]="invalid"
|
|
15
|
+
[attr.aria-label]="'OTP digit ' + (index + 1)"
|
|
16
|
+
(input)="onInput(index, $event)"
|
|
17
|
+
(keydown)="onKeyDown(index, $event)"
|
|
18
|
+
/>
|
|
19
|
+
<span
|
|
20
|
+
*ngIf="shouldShowSeparator(index)"
|
|
21
|
+
class="mx-2 mt-[-1px] h-px w-6 bg-foreground opacity-80"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
></span>
|
|
24
|
+
</ng-container>
|
|
25
|
+
</div>
|