@servicetitan/anvil2 1.49.6 → 1.50.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/CHANGELOG.md +32 -0
- package/dist/{Alert-aGBkujwE.js → Alert-DNhUyWVm.js} +3 -2
- package/dist/{Alert-aGBkujwE.js.map → Alert-DNhUyWVm.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-BPwFNhYe.js → Announcement-BBq8zIQ3.js} +3 -2
- package/dist/{Announcement-BPwFNhYe.js.map → Announcement-BBq8zIQ3.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/{Breadcrumbs-Y6IaMoi5.js → Breadcrumbs-CfJJlIIa.js} +2 -2
- package/dist/{Breadcrumbs-Y6IaMoi5.js.map → Breadcrumbs-CfJJlIIa.js.map} +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Calendar-Ce08LvdP.js → Calendar-C9oxHTGG.js} +2 -2
- package/dist/{Calendar-Ce08LvdP.js.map → Calendar-C9oxHTGG.js.map} +1 -1
- package/dist/{Calendar-B5Ednjem.js → Calendar-CAYitkfM.js} +2 -2
- package/dist/{Calendar-B5Ednjem.js.map → Calendar-CAYitkfM.js.map} +1 -1
- package/dist/Calendar.js +2 -2
- package/dist/{Checkbox-nE-_tWmc.js → Checkbox-DbBeuNdW.js} +2 -2
- package/dist/{Checkbox-nE-_tWmc.js.map → Checkbox-DbBeuNdW.js.map} +1 -1
- package/dist/{Checkbox-ByaZv8wu.js → Checkbox-zAKOGEBl.js} +2 -2
- package/dist/{Checkbox-ByaZv8wu.js.map → Checkbox-zAKOGEBl.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/{Combobox-Dy4IZDg1.js → Combobox-hxGMMb8x.js} +4 -4
- package/dist/{Combobox-Dy4IZDg1.js.map → Combobox-hxGMMb8x.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-D6MmOQF2.js → DataTable-DSySFGWC.js} +6 -6
- package/dist/{DataTable-D6MmOQF2.js.map → DataTable-DSySFGWC.js.map} +1 -1
- package/dist/{DateField-BxS9LZG7.js → DateField-BT9jJRp5.js} +5 -5
- package/dist/{DateField-BxS9LZG7.js.map → DateField-BT9jJRp5.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-BdDiHUfv.js → DateFieldRange-ZAic_9mt.js} +5 -5
- package/dist/{DateFieldRange-BdDiHUfv.js.map → DateFieldRange-ZAic_9mt.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-CuQO3LH9.js → DateFieldSingle-DAtR8ImE.js} +5 -5
- package/dist/{DateFieldSingle-CuQO3LH9.js.map → DateFieldSingle-DAtR8ImE.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-2YhZmNYg.js → DateFieldYearless-DXO_MPwA.js} +3 -3
- package/dist/{DateFieldYearless-2YhZmNYg.js.map → DateFieldYearless-DXO_MPwA.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-CgCmvHLs.js → DateFieldYearlessRange-Cg6bbPIi.js} +3 -3
- package/dist/{DateFieldYearlessRange-CgCmvHLs.js.map → DateFieldYearlessRange-Cg6bbPIi.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{DaysOfTheWeek-DlIka9b_.js → DaysOfTheWeek-9B9d7-hF.js} +2 -2
- package/dist/{DaysOfTheWeek-DlIka9b_.js.map → DaysOfTheWeek-9B9d7-hF.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Dialog-DSwvbfdW.js → Dialog-BwabBKoZ.js} +20 -14
- package/dist/Dialog-BwabBKoZ.js.map +1 -0
- package/dist/Dialog.css +35 -32
- package/dist/Dialog.js +1 -1
- package/dist/{Drawer-CGYcEj6d.js → Drawer-GXeoK-r9.js} +21 -13
- package/dist/Drawer-GXeoK-r9.js.map +1 -0
- package/dist/Drawer.css +37 -31
- package/dist/Drawer.js +1 -1
- package/dist/{FieldMessage-DWONT3dr.js → FieldMessage-DdCUxZz-.js} +3 -3
- package/dist/FieldMessage-DdCUxZz-.js.map +1 -0
- package/dist/FieldMessage.js +1 -1
- package/dist/{Helper-DjWotFtO.js → Helper-DzVUQgUJ.js} +2 -2
- package/dist/{Helper-DjWotFtO.js.map → Helper-DzVUQgUJ.js.map} +1 -1
- package/dist/{InputMask-DaN_Adz6.js → InputMask-CJC9xZHG.js} +2 -2
- package/dist/{InputMask-DaN_Adz6.js.map → InputMask-CJC9xZHG.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{Link-DqZxs0kQ.js → Link-CGXEFA9w.js} +2 -2
- package/dist/{Link-DqZxs0kQ.js.map → Link-CGXEFA9w.js.map} +1 -1
- package/dist/Link.css +30 -24
- package/dist/Link.js +1 -1
- package/dist/Link.module-ByPQQ0zy.js +14 -0
- package/dist/Link.module-ByPQQ0zy.js.map +1 -0
- package/dist/{LinkButton-jb2Gc3hC.js → LinkButton-BBCO-4em.js} +2 -2
- package/dist/{LinkButton-jb2Gc3hC.js.map → LinkButton-BBCO-4em.js.map} +1 -1
- package/dist/LinkButton.js +1 -1
- package/dist/{ListView-B1I7Ii3g.js → ListView-D8mfK8Lu.js} +2 -2
- package/dist/{ListView-B1I7Ii3g.js.map → ListView-D8mfK8Lu.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{NumberField-BdK4U9mW.js → NumberField-CjWLnD9X.js} +2 -2
- package/dist/{NumberField-BdK4U9mW.js.map → NumberField-CjWLnD9X.js.map} +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/{Page-C-yMjgoO.js → Page-DEbpjQw0.js} +4 -4
- package/dist/{Page-C-yMjgoO.js.map → Page-DEbpjQw0.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-CnF6yBr5.js → Pagination-BR8MiRaA.js} +17 -25
- package/dist/Pagination-BR8MiRaA.js.map +1 -0
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-CcMDyKTj.js → Popover-CCXrzBul.js} +27 -6
- package/dist/Popover-CCXrzBul.js.map +1 -0
- package/dist/Popover.css +40 -9
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-CufkbVu5.js → ProgressBar-BpKEr6cO.js} +4 -3
- package/dist/{ProgressBar-CufkbVu5.js.map → ProgressBar-BpKEr6cO.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-BeBG7Ksw.js → Radio-jj0-1dOg.js} +2 -2
- package/dist/{Radio-BeBG7Ksw.js.map → Radio-jj0-1dOg.js.map} +1 -1
- package/dist/Radio.js +2 -2
- package/dist/{RadioGroup-BAjpkCjp.js → RadioGroup-Bxy415eu.js} +2 -2
- package/dist/{RadioGroup-BAjpkCjp.js.map → RadioGroup-Bxy415eu.js.map} +1 -1
- package/dist/{SearchField-D6bICv4b.js → SearchField-CJAo8dE0.js} +10 -7
- package/dist/{SearchField-D6bICv4b.js.map → SearchField-CJAo8dE0.js.map} +1 -1
- package/dist/SearchField.css +14 -8
- package/dist/SearchField.js +1 -1
- package/dist/{SelectCard-DDN7qqHv.js → SelectCard-CjbsPKZ4.js} +3 -3
- package/dist/{SelectCard-DDN7qqHv.js.map → SelectCard-CjbsPKZ4.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-DQm3_D0v.js → SelectFieldSync-BOzavAtv.js} +2 -2
- package/dist/{SelectFieldSync-DQm3_D0v.js.map → SelectFieldSync-BOzavAtv.js.map} +1 -1
- package/dist/{SelectTrigger-CNEhRluU.js → SelectTrigger-DfVnPiNf.js} +2 -2
- package/dist/{SelectTrigger-CNEhRluU.js.map → SelectTrigger-DfVnPiNf.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-Cv6hGsrC.js → SelectTriggerBase-D8scKtBr.js} +2 -2
- package/dist/{SelectTriggerBase-Cv6hGsrC.js.map → SelectTriggerBase-D8scKtBr.js.map} +1 -1
- package/dist/{Switch-BXDPs2mD.js → Switch-CGpg2ake.js} +2 -2
- package/dist/{Switch-BXDPs2mD.js.map → Switch-CGpg2ake.js.map} +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{TextField-aMwSN1iP.js → TextField-DNuEXKyN.js} +2 -2
- package/dist/{TextField-aMwSN1iP.js.map → TextField-DNuEXKyN.js.map} +1 -1
- package/dist/{TextField--y8q4R2H.js → TextField-Qv6OqiKQ.js} +2 -2
- package/dist/{TextField--y8q4R2H.js.map → TextField-Qv6OqiKQ.js.map} +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-D1zwX2h6.js → Textarea-DdLD4imO.js} +2 -2
- package/dist/{Textarea-D1zwX2h6.js.map → Textarea-DdLD4imO.js.map} +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/{TimeField-BHxXbOfe.js → TimeField-C39hYluo.js} +3 -3
- package/dist/{TimeField-BHxXbOfe.js.map → TimeField-C39hYluo.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-CRp3nf4U.js → Toaster-DJ4tNy-0.js} +2 -2
- package/dist/{Toaster-CRp3nf4U.js.map → Toaster-DJ4tNy-0.js.map} +1 -1
- package/dist/{Toaster-qPt6zb6F.js → Toaster-DyDVYq4x.js} +148 -53
- package/dist/Toaster-DyDVYq4x.js.map +1 -0
- package/dist/Toaster.css +95 -71
- package/dist/{Toolbar-XJrmS4v4.js → Toolbar-DEwvVf35.js} +11 -11
- package/dist/{Toolbar-XJrmS4v4.js.map → Toolbar-DEwvVf35.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{YearlessDateInputWithPicker-LiMI-Oer.js → YearlessDateInputWithPicker-DMGx3gE2.js} +2 -2
- package/dist/{YearlessDateInputWithPicker-LiMI-Oer.js.map → YearlessDateInputWithPicker-DMGx3gE2.js.map} +1 -1
- package/dist/beta.js +5 -5
- package/dist/check_circle-CM0ukqXv.js +6 -0
- package/dist/check_circle-CM0ukqXv.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +3 -3
- package/dist/components/Drawer/Drawer.d.ts +2 -2
- package/dist/components/Pagination/internal/Pagination.d.ts +3 -4
- package/dist/components/Pagination/internal/PaginationList.d.ts +1 -0
- package/dist/components/Pagination/internal/PaginationTotalCount.d.ts +2 -4
- package/dist/components/Popover/internal/PopoverContext.d.ts +1 -0
- package/dist/components/Popover/internal/usePopoverContext.d.ts +1 -0
- package/dist/components/Toast/internal/constants.d.ts +16 -0
- package/dist/error-DR_wWdYY.js +6 -0
- package/dist/error-DR_wWdYY.js.map +1 -0
- package/dist/index.js +37 -37
- package/dist/{utils-C-hkPwMi.js → utils-Bkbn9cyk.js} +2 -2
- package/dist/{utils-C-hkPwMi.js.map → utils-Bkbn9cyk.js.map} +1 -1
- package/package.json +7 -7
- package/dist/Dialog-DSwvbfdW.js.map +0 -1
- package/dist/Drawer-CGYcEj6d.js.map +0 -1
- package/dist/FieldMessage-DWONT3dr.js.map +0 -1
- package/dist/Link.module-CjeOl2NH.js +0 -14
- package/dist/Link.module-CjeOl2NH.js.map +0 -1
- package/dist/Pagination-CnF6yBr5.js.map +0 -1
- package/dist/Popover-CcMDyKTj.js.map +0 -1
- package/dist/Toaster-qPt6zb6F.js.map +0 -1
- package/dist/check_circle-Dja-C2lM.js +0 -8
- package/dist/check_circle-Dja-C2lM.js.map +0 -1
package/dist/Drawer.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
@layer starter, reset, base, state, application;
|
|
2
2
|
@layer base {
|
|
3
|
-
.
|
|
3
|
+
._drawer_ce1vf_2 {
|
|
4
4
|
border: none;
|
|
5
5
|
background: transparent;
|
|
6
6
|
padding-block: 0;
|
|
7
7
|
padding-inline: 0;
|
|
8
8
|
outline: none;
|
|
9
|
-
animation: _close-
|
|
9
|
+
animation: _close-drawer_ce1vf_1 2s forwards;
|
|
10
10
|
transition: width 200ms;
|
|
11
11
|
width: 35rem;
|
|
12
12
|
height: 100%;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
--xpos: 10rem;
|
|
22
22
|
--drawer-padding: 1.5rem;
|
|
23
23
|
}
|
|
24
|
-
.
|
|
25
|
-
animation: _open-
|
|
24
|
+
._drawer_ce1vf_2[open] {
|
|
25
|
+
animation: _open-drawer_ce1vf_1 300ms forwards;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
28
|
-
animation: _open-
|
|
27
|
+
._drawer_ce1vf_2[open]::backdrop {
|
|
28
|
+
animation: _open-backdrop_ce1vf_1 200ms forwards;
|
|
29
29
|
}
|
|
30
|
-
.
|
|
30
|
+
._drawer_ce1vf_2 ._container_ce1vf_29 {
|
|
31
31
|
font-family: var(--font-family-base, "Nunito Sans", sans-serif);
|
|
32
32
|
font-size: 100%;
|
|
33
33
|
color: var(--foreground-color, #141414);
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
overflow: auto;
|
|
40
40
|
overscroll-behavior: contain;
|
|
41
41
|
}
|
|
42
|
-
.
|
|
42
|
+
._drawer_ce1vf_2 ._container_ce1vf_29 ._content_ce1vf_41 {
|
|
43
43
|
flex-grow: 1;
|
|
44
44
|
font-size: 1rem;
|
|
45
45
|
padding: var(--drawer-padding);
|
|
46
46
|
isolation: isolate;
|
|
47
47
|
}
|
|
48
|
-
.
|
|
48
|
+
._header_ce1vf_47 {
|
|
49
49
|
position: sticky;
|
|
50
50
|
inset-block-start: 0;
|
|
51
51
|
display: flex;
|
|
@@ -55,20 +55,20 @@
|
|
|
55
55
|
padding-inline: var(--drawer-padding);
|
|
56
56
|
background-color: inherit;
|
|
57
57
|
font-size: 1rem;
|
|
58
|
-
z-index:
|
|
58
|
+
z-index: 3;
|
|
59
59
|
}
|
|
60
|
-
.
|
|
60
|
+
._header_ce1vf_47 h1 {
|
|
61
61
|
margin-block: 0;
|
|
62
62
|
margin-inline: 0;
|
|
63
63
|
}
|
|
64
|
-
.
|
|
64
|
+
._header_ce1vf_47 ._close-container_ce1vf_63 {
|
|
65
65
|
display: flex;
|
|
66
66
|
justify-content: center;
|
|
67
67
|
align-items: center;
|
|
68
68
|
width: 1.5625rem;
|
|
69
69
|
height: 1.5625rem;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
71
|
+
._footer_ce1vf_70 {
|
|
72
72
|
display: flex;
|
|
73
73
|
gap: 0.75rem;
|
|
74
74
|
justify-content: flex-end;
|
|
@@ -81,39 +81,45 @@
|
|
|
81
81
|
}
|
|
82
82
|
@layer state {
|
|
83
83
|
@media (prefers-reduced-motion: reduce) {
|
|
84
|
-
.
|
|
84
|
+
._drawer_ce1vf_2 {
|
|
85
85
|
--xpos: 0;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
.
|
|
89
|
-
animation: _close-
|
|
88
|
+
._drawer_ce1vf_2._remove_ce1vf_87[open] {
|
|
89
|
+
animation: _close-drawer_ce1vf_1 300ms forwards;
|
|
90
90
|
}
|
|
91
|
-
.
|
|
92
|
-
animation: _close-
|
|
91
|
+
._drawer_ce1vf_2._remove_ce1vf_87[open]::backdrop {
|
|
92
|
+
animation: _close-backdrop_ce1vf_1 200ms forwards;
|
|
93
93
|
}
|
|
94
|
-
.
|
|
94
|
+
._drawer_ce1vf_2::backdrop {
|
|
95
95
|
background: #040404;
|
|
96
96
|
}
|
|
97
|
-
.
|
|
97
|
+
._drawer_ce1vf_2._small_ce1vf_96 {
|
|
98
|
+
width: 22.5rem;
|
|
99
|
+
}
|
|
100
|
+
._drawer_ce1vf_2._large_ce1vf_99 {
|
|
98
101
|
width: 48rem;
|
|
99
102
|
}
|
|
100
|
-
.
|
|
103
|
+
._drawer_ce1vf_2._xlarge_ce1vf_102 {
|
|
104
|
+
width: 70rem;
|
|
105
|
+
}
|
|
106
|
+
._drawer_ce1vf_2 ._content_ce1vf_41._sticky_ce1vf_105 {
|
|
101
107
|
position: sticky;
|
|
102
108
|
flex-grow: 0;
|
|
103
|
-
z-index:
|
|
109
|
+
z-index: 3;
|
|
104
110
|
background-color: var(--background-color, #ffffff);
|
|
105
111
|
padding-block-end: 0.25rem;
|
|
106
112
|
}
|
|
107
|
-
.
|
|
113
|
+
._drawer_ce1vf_2 ._content_ce1vf_41._sticky_ce1vf_105 + ._content_ce1vf_41 {
|
|
108
114
|
padding-block-start: 0.25rem;
|
|
109
115
|
}
|
|
110
|
-
.
|
|
116
|
+
._drawer_ce1vf_2 ._footer_ce1vf_70._sticky_ce1vf_105 {
|
|
111
117
|
position: sticky;
|
|
112
118
|
inset-block-end: 0;
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
@layer application {
|
|
116
|
-
.
|
|
122
|
+
._drawer_ce1vf_2 ._header_ce1vf_47 ._close-button_ce1vf_121 {
|
|
117
123
|
color: var(--foreground-color, #141414);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
@@ -121,7 +127,7 @@
|
|
|
121
127
|
overflow: hidden;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
|
-
@keyframes _open-
|
|
130
|
+
@keyframes _open-drawer_ce1vf_1 {
|
|
125
131
|
from {
|
|
126
132
|
opacity: 0;
|
|
127
133
|
transform: translateX(var(--xpos));
|
|
@@ -131,7 +137,7 @@
|
|
|
131
137
|
transform: translateX(0%);
|
|
132
138
|
}
|
|
133
139
|
}
|
|
134
|
-
@keyframes _close-
|
|
140
|
+
@keyframes _close-drawer_ce1vf_1 {
|
|
135
141
|
from {
|
|
136
142
|
opacity: 1;
|
|
137
143
|
transform: translateX(0%);
|
|
@@ -141,7 +147,7 @@
|
|
|
141
147
|
transform: translateX(var(--xpos));
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
|
-
@keyframes _open-
|
|
150
|
+
@keyframes _open-backdrop_ce1vf_1 {
|
|
145
151
|
from {
|
|
146
152
|
opacity: 0;
|
|
147
153
|
}
|
|
@@ -149,7 +155,7 @@
|
|
|
149
155
|
opacity: 0.6;
|
|
150
156
|
}
|
|
151
157
|
}
|
|
152
|
-
@keyframes _close-
|
|
158
|
+
@keyframes _close-backdrop_ce1vf_1 {
|
|
153
159
|
from {
|
|
154
160
|
opacity: 0.6;
|
|
155
161
|
}
|
|
@@ -160,9 +166,9 @@
|
|
|
160
166
|
body:has(
|
|
161
167
|
dialog[data-anv="drawer"][open]:not([data-anv-scroll-chaining="true"])
|
|
162
168
|
) {
|
|
163
|
-
overflow: hidden;
|
|
169
|
+
overflow: hidden !important;
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
body:has([data-anv-dialogs-open="true"]) {
|
|
167
|
-
overflow: hidden;
|
|
173
|
+
overflow: hidden !important;
|
|
168
174
|
}
|
package/dist/Drawer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader, D as default } from './Drawer-
|
|
1
|
+
export { D as Drawer, a as DrawerCancelButton, d as DrawerContent, b as DrawerFooter, c as DrawerHeader, D as default } from './Drawer-GXeoK-r9.js';
|
|
2
2
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { c as cx } from './index-tZvMCc77.js';
|
|
4
4
|
import { I as Icon } from './Icon-BSuTVNaa.js';
|
|
5
|
-
import { S as
|
|
5
|
+
import { S as SvgError } from './error-DR_wWdYY.js';
|
|
6
6
|
|
|
7
7
|
import './FieldMessage.css';const messages = "_messages_1hr9l_1";
|
|
8
8
|
const styles = {
|
|
@@ -37,7 +37,7 @@ const FieldMessage = forwardRef(
|
|
|
37
37
|
inherit: true,
|
|
38
38
|
className: styles["error-icon"],
|
|
39
39
|
"aria-hidden": true,
|
|
40
|
-
svg:
|
|
40
|
+
svg: SvgError
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
43
|
/* @__PURE__ */ jsx("span", { className: styles["error-message"], "aria-live": errorAriaLive, children: errorMessage })
|
|
@@ -51,4 +51,4 @@ const FieldMessage = forwardRef(
|
|
|
51
51
|
FieldMessage.displayName = "FieldMessage";
|
|
52
52
|
|
|
53
53
|
export { FieldMessage as F };
|
|
54
|
-
//# sourceMappingURL=FieldMessage-
|
|
54
|
+
//# sourceMappingURL=FieldMessage-DdCUxZz-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldMessage-DdCUxZz-.js","sources":["../src/components/FieldMessage/FieldMessage.tsx"],"sourcesContent":["import {\n forwardRef,\n type AriaAttributes,\n type ReactElement,\n type ComponentPropsWithoutRef,\n} from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./FieldMessage.module.scss\";\nimport { Icon } from \"../Icon\";\nimport Error from \"@servicetitan/hammer-icon/mdi/round/error.svg\";\n\n/**\n * Props for the FieldMessage component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type FieldMessageProps = ComponentPropsWithoutRef<\"div\"> & {\n /**\n * Unique identifier for the field message container.\n */\n id?: string;\n /**\n * Hint text or element to display when there's no error.\n */\n hint?: ReactElement | string;\n /**\n * Description text or element to display below the main message.\n */\n description?: ReactElement | string;\n /**\n * Error message or element to display when there's an error.\n */\n errorMessage?: ReactElement | string;\n /**\n * aria-live attribute value for the error message.\n * @default assertive\n * @remarks Controls how screen readers announce error messages. \"assertive\" interrupts current speech, \"polite\" waits for current speech to finish.\n * @link https://www.w3.org/WAI/tutorials/forms/notifications/\n */\n errorAriaLive?: AriaAttributes[\"aria-live\"];\n};\n\n/**\n * FieldMessage component for displaying hints, descriptions, and error messages for form fields.\n *\n * Features:\n * - Displays hint text when no error is present\n * - Shows error messages with warning icon when errors occur\n * - Supports both string and React element content\n * - Configurable aria-live behavior for screen readers\n * - Optional description text for additional context\n * - Accessible with proper ARIA attributes\n * - Visual error indicators with warning icons\n * - Conditional rendering based on error state\n * - Supports layout utilities for positioning and spacing\n *\n * @example\n * <FieldMessage\n * hint=\"Enter your email address\"\n * description=\"We'll use this to send you updates\"\n * errorMessage=\"Please enter a valid email address\"\n * />\n */\nexport const FieldMessage = forwardRef<HTMLDivElement, FieldMessageProps>(\n (props, ref) => {\n const {\n id,\n hint,\n description,\n errorAriaLive = \"assertive\",\n errorMessage,\n className,\n ...rest\n } = props;\n\n return (\n <div\n {...rest}\n className={cx(styles[\"messages\"], className)}\n ref={ref}\n id={id}\n >\n {errorMessage ? (\n <div className={styles[\"error-container\"]}>\n <Icon\n inherit\n className={styles[\"error-icon\"]}\n aria-hidden\n svg={Error}\n />\n <span className={styles[\"error-message\"]} aria-live={errorAriaLive}>\n {errorMessage}\n </span>\n </div>\n ) : (\n (hint ?? null)\n )}\n {description ? (\n <div className={styles[\"description-container\"]}>\n {description ? <span>{description}</span> : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nFieldMessage.displayName = \"FieldMessage\";\n"],"names":["Error"],"mappings":";;;;;;;;;;;;;AA8DO,MAAM,YAAA,GAAe,UAAA;AAAA,EAC1B,CAAC,OAAO,GAAA,KAAQ;AACd,IAAA,MAAM;AAAA,MACJ,EAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA,GAAgB,WAAA;AAAA,MAChB,YAAA;AAAA,MACA,SAAA;AAAA,MACA,GAAG;AAAA,KACL,GAAI,KAAA;AAEJ,IAAA,uBACE,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACE,GAAG,IAAA;AAAA,QACJ,SAAA,EAAW,EAAA,CAAG,MAAA,CAAO,UAAU,GAAG,SAAS,CAAA;AAAA,QAC3C,GAAA;AAAA,QACA,EAAA;AAAA,QAEC,QAAA,EAAA;AAAA,UAAA,YAAA,mBACC,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,iBAAiB,CAAA,EACtC,QAAA,EAAA;AAAA,4BAAA,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAO,IAAA;AAAA,gBACP,SAAA,EAAW,OAAO,YAAY,CAAA;AAAA,gBAC9B,aAAA,EAAW,IAAA;AAAA,gBACX,GAAA,EAAKA;AAAA;AAAA,aACP;AAAA,4BACA,GAAA,CAAC,UAAK,SAAA,EAAW,MAAA,CAAO,eAAe,CAAA,EAAG,WAAA,EAAW,eAClD,QAAA,EAAA,YAAA,EACH;AAAA,WAAA,EACF,IAEC,IAAA,IAAQ,IAAA;AAAA,UAEV,WAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,uBAAuB,CAAA,EAC3C,QAAA,EAAA,WAAA,mBAAc,GAAA,CAAC,MAAA,EAAA,EAAM,QAAA,EAAA,WAAA,EAAY,CAAA,GAAU,MAC9C,CAAA,GACE;AAAA;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,YAAA,CAAa,WAAA,GAAc,cAAA;;;;"}
|
package/dist/FieldMessage.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { F as FieldMessage, F as default } from './FieldMessage-
|
|
1
|
+
export { F as FieldMessage, F as default } from './FieldMessage-DdCUxZz-.js';
|
|
2
2
|
//# sourceMappingURL=FieldMessage.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { F as FieldMessage } from './FieldMessage-
|
|
3
|
+
import { F as FieldMessage } from './FieldMessage-DdCUxZz-.js';
|
|
4
4
|
import { S as SrOnly } from './SrOnly-CTsYSuby.js';
|
|
5
5
|
|
|
6
6
|
import './Helper.css';const helper = "_helper_157uk_1";
|
|
@@ -43,4 +43,4 @@ const Helper = forwardRef((props, ref) => {
|
|
|
43
43
|
Helper.displayName = "Helper";
|
|
44
44
|
|
|
45
45
|
export { Helper as H };
|
|
46
|
-
//# sourceMappingURL=Helper-
|
|
46
|
+
//# sourceMappingURL=Helper-DzVUQgUJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Helper-
|
|
1
|
+
{"version":3,"file":"Helper-DzVUQgUJ.js","sources":["../src/internal/components/Helper/Helper.tsx"],"sourcesContent":["import { forwardRef, AriaAttributes, ReactElement } from \"react\";\nimport styles from \"./Helper.module.scss\";\nimport { FieldMessage } from \"../../../components/FieldMessage\";\nimport { SrOnly } from \"../../../components/SrOnly\";\n\nexport type HelperProps = {\n id?: string;\n // required?: boolean;\n hint?: ReactElement | string;\n description?: ReactElement | string;\n errorMessage?: ReactElement | string;\n /**\n * aria-live for the error message\n * @default assertive\n * @link https://www.w3.org/WAI/tutorials/forms/notifications/\n */\n errorAriaLive?: AriaAttributes[\"aria-live\"];\n maxLength?: number;\n inputLength?: number;\n isTyping?: boolean;\n showCounter?: boolean;\n};\n\nexport const Helper = forwardRef<HTMLDivElement, HelperProps>((props, ref) => {\n const {\n id,\n hint,\n description,\n errorAriaLive = \"assertive\",\n errorMessage,\n maxLength,\n isTyping,\n inputLength = 0,\n showCounter,\n } = props;\n\n return (\n <div className={styles[\"helper\"]} ref={ref} id={id}>\n <FieldMessage\n className={styles[\"messages\"]}\n hint={hint}\n description={description}\n errorAriaLive={errorAriaLive}\n errorMessage={errorMessage}\n />\n\n {showCounter ? (\n <div className={styles[\"counter\"]}>\n <span aria-hidden=\"true\">\n {inputLength}/{maxLength}\n </span>\n </div>\n ) : null}\n {isTyping && !!maxLength ? (\n maxLength - inputLength >= 1 ? (\n <SrOnly>\n {/* TODO: potential localization */}\n <span aria-live=\"polite\" aria-atomic=\"true\">{`${\n maxLength - inputLength\n } character${maxLength - inputLength !== 1 ? \"s\" : \"\"} left`}</span>\n </SrOnly>\n ) : (\n <SrOnly>\n {/* TODO: potential localization */}\n <span role=\"alert\">Maximum characters count reached</span>\n </SrOnly>\n )\n ) : null}\n </div>\n );\n});\n\nHelper.displayName = \"Helper\";\n"],"names":[],"mappings":";;;;;;;;;;;AAuBO,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AAA,EAAgC,GACrD,CAAA,GAEA;AAAA,GAAA,EACN,CAAA;AAEJ,CAAC;AAED,MAAA,CAAO,WAAA,GAAc,QAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useRef, useMemo, isValidElement, cloneElement } from 'react';
|
|
3
3
|
import { u as useMergeRefs } from './DrawerContext-Cs3k160L.js';
|
|
4
|
-
import { T as TextField } from './TextField-
|
|
4
|
+
import { T as TextField } from './TextField-DNuEXKyN.js';
|
|
5
5
|
import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
|
|
6
6
|
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
|
|
7
7
|
import { useTrackingId } from './useTrackingId.js';
|
|
@@ -261,4 +261,4 @@ const InputMask = forwardRef(
|
|
|
261
261
|
InputMask.displayName = "InputMask";
|
|
262
262
|
|
|
263
263
|
export { InputMask as I };
|
|
264
|
-
//# sourceMappingURL=InputMask-
|
|
264
|
+
//# sourceMappingURL=InputMask-CJC9xZHG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputMask-DaN_Adz6.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n ChangeEvent,\n ChangeEventHandler,\n FocusEvent,\n KeyboardEvent,\n InputHTMLAttributes,\n ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport { TextField, TextFieldProps } from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\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ACvD,CAAA,EAAG,CAAC,CAAA,EAAG,oBAAA,EAAsB,IAAI,CAAC,CAAA;AAElC,IAAA,MAAM,IAAA,GAAO;AAAA,MACX,OACE,OAAA,IAAW,gBAAA,GACP,gBAAA,CAAiB,gBAAA,CAAiB,KAAK,CAAA,GACvC,IAAA;AAAA,MACN,UAAA,EACE,YAAA,IAAgB,gBAAA,GAAmB,gBAAA,CAAiB,UAAA,GAAa,IAAA;AAAA,MACnE,MAAA,EAAQ,gBAAA,CAAiB,gBAAA,CAAiB,MAAM,CAAA;AAAA,MAChD,MACE,MAAA,IAAU,gBAAA,GACN,gBAAA,CAAiB,gBAAA,CAAiB,IAAI,CAAA,GACtC,IAAA;AAAA,MACN,aACE,aAAA,IAAiB,gBAAA,GACb,gBAAA,CAAiB,gBAAA,CAAiB,WAAW,CAAA,GAC7C,IAAA;AAAA,MACN,MAAM,gBAAA,CAAiB,IAAA;AAAA,MACvB,MAAM,gBAAA,CAAiB;AAAA,KACzB;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,WAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC;AAAA,KAChB,CAAA;AAED,IAAA,OAAO,QAAA,IAAY,eAAe,QAAQ,CAAA,IAAK,SAAS,IAAA,KAAS,OAAA,GAC/D,aAAa,QAAA,EAAU;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,KAGrB,CAAA,mBAED,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"InputMask-CJC9xZHG.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n ChangeEvent,\n ChangeEventHandler,\n FocusEvent,\n KeyboardEvent,\n InputHTMLAttributes,\n ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport { TextField, TextFieldProps } from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\n />\n );\n },\n);\n\nInputMask.displayName = \"InputMask\";\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,UAAA,GAAa,CAAC,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;;ACcjC,SAAS,SAAA,CACd,KAAA,EACA,IAAA,EACA,oBAAA,EACA;AACA,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,IAAI,UAAA,GAAa,CAAA;AACjB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,MAAM,QAAA,GAAW,KAAK,CAAC,CAAA;AACvB,IAAA,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ,CAAA,EAAG;AAEjC,MAAA,OACE,UAAA,GAAa,MAAM,MAAA,IACnB,CAAC,iBAAiB,KAAA,CAAM,UAAU,CAAA,EAAG,QAAQ,CAAA,EAC7C;AACA,QAAA,UAAA,EAAA;AAAA,MACF;AACA,MAAA,IAAI,UAAA,GAAa,MAAM,MAAA,EAAQ;AAC7B,QAAA,WAAA,IAAe,MAAM,UAAU,CAAA;AAC/B,QAAA,UAAA,EAAA;AAAA,MACF,CAAA,MAAO;AACL,QAAA,WAAA,IAAe,oBAAA;AAAA,MACjB;AAAA,IACF,CAAA,MA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S,OAAA,GAC/D,aAAa,QAAA,EAAU;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,KAGrB,CAAA,mBAED,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
|
package/dist/InputMask.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { I as InputMask, I as default } from './InputMask-
|
|
1
|
+
export { I as InputMask, I as default } from './InputMask-CJC9xZHG.js';
|
|
2
2
|
//# sourceMappingURL=InputMask.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { l as linkStyles } from './Link.module-
|
|
4
|
+
import { l as linkStyles } from './Link.module-ByPQQ0zy.js';
|
|
5
5
|
import { I as Icon } from './Icon-BSuTVNaa.js';
|
|
6
6
|
import { c as cx } from './index-tZvMCc77.js';
|
|
7
7
|
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-BlIWftBb.js';
|
|
@@ -109,4 +109,4 @@ const Link = forwardRef(
|
|
|
109
109
|
Link.displayName = Link$1.displayName;
|
|
110
110
|
|
|
111
111
|
export { Link as L, useLinkStyles as u };
|
|
112
|
-
//# sourceMappingURL=Link-
|
|
112
|
+
//# sourceMappingURL=Link-CGXEFA9w.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link-DqZxs0kQ.js","sources":["../../hammer-icon/mdi/round/open_in_new.svg","../src/components/Link/internal/LinkHeadless.tsx","../src/components/Link/useLinkStyles.ts","../src/components/Link/internal/Link.tsx","../src/components/Link/Link.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgOpenInNew = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"1em\", height: \"1em\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1zM14 4c0 .55.45 1 1 1h2.59l-9.13 9.13a.996.996 0 1 0 1.41 1.41L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1z\" }));\nexport default SvgOpenInNew;\n","import { forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nimport styles from \"./Link.module.scss\";\nimport { Icon } from \"../../Icon\";\nimport OpenInNew from \"@servicetitan/hammer-icon/mdi/round/open_in_new.svg\";\n\n/**\n * Props for the LinkHeadless component.\n * @extends ComponentPropsWithoutRef<\"a\">\n */\nexport type LinkHeadlessProps = ComponentPropsWithoutRef<\"a\">;\n\n/**\n * Headless link component for creating accessible hyperlinks.\n *\n * Features:\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n *\n * @example\n * <LinkHeadless href=\"/dashboard\">\n * Go to Dashboard\n * </LinkHeadless>\n *\n * @example\n * <LinkHeadless href=\"https://example.com\" target=\"_blank\">\n * External Documentation\n * </LinkHeadless>\n *\n */\nexport const LinkHeadless = forwardRef<HTMLAnchorElement, LinkHeadlessProps>(\n ({ children, ...props }, ref) => {\n return (\n <a\n rel=\"noopener noreferrer\"\n data-anv=\"link-headless\"\n ref={ref}\n {...props}\n >\n {children}\n {props.target === \"_blank\" && (\n <Icon className={styles[\"open-in-new\"]} inherit svg={OpenInNew} />\n )}\n </a>\n );\n },\n);\n\nLinkHeadless.displayName = \"LinkHeadless\";\n","import cx from \"classnames\";\n\nimport { LayoutUtilProps } from \"../../types\";\nimport { LinkProps } from \"./Link\";\nimport { useLayoutPropsUtil } from \"../../internal/hooks\";\n\nimport styles from \"./internal/Link.module.scss\";\n\n/**\n * Props for the useLinkStyles hook.\n * @extends LayoutUtilProps\n */\nexport type UseLinkStylesProps = LayoutUtilProps &\n Pick<LinkProps, \"className\" | \"appearance\" | \"quiet\" | \"ghost\" | \"style\">;\n\n/**\n * Hook for generating link styles and class names.\n *\n * @param props - The link style properties\n * @returns Object containing linkClassNames and styleCombined\n */\nexport const useLinkStyles = (props: UseLinkStylesProps) => {\n const { layoutStyles, componentProps } = useLayoutPropsUtil(props);\n const {\n className,\n appearance = \"primary\",\n quiet,\n ghost,\n style,\n } = componentProps;\n\n const linkClassNames = cx([styles[\"link\"]], className, {\n [styles[\"quiet\"]]: quiet,\n [styles[\"ghost\"]]: ghost,\n [styles[\"secondary\"]]: appearance === \"secondary\",\n });\n\n const styleCombined = Object.assign({}, style, layoutStyles);\n\n return { linkClassNames, styleCombined };\n};\n","import { forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nimport { LayoutUtilProps } from \"../../../types\";\n\nimport { LinkHeadless } from \"./LinkHeadless\";\n\nimport { useLinkStyles } from \"../useLinkStyles\";\n\n/**\n * Props for the Link component.\n * @extends ComponentPropsWithoutRef<\"a\">\n * @extends LayoutUtilProps\n */\nexport type LinkProps = ComponentPropsWithoutRef<\"a\"> &\n LayoutUtilProps &\n (\n | {\n /**\n * The visual appearance of the link.\n * @default \"primary\"\n */\n appearance?: \"primary\";\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @deprecated to be removed on next major - use ghost instead\n */\n quiet?: boolean;\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @remarks Only available when appearance is \"primary\".\n */\n ghost?: boolean;\n }\n | {\n /**\n * The visual appearance of the LinkButton. Secondary appearance cannot be quiet.\n */\n appearance: \"secondary\";\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @deprecated to be removed on next major - use ghost instead\n */\n quiet?: false;\n /**\n * Whether the LinkButton should have a quieter, less prominent appearance.\n * @remarks Must be false when appearance is \"secondary\".\n */\n ghost?: false;\n }\n );\n\n/**\n * Link component for creating accessible, styled hyperlinks.\n *\n * Features:\n * - Two visual appearances: primary (default) and secondary\n * - Quiet mode for less prominent styling\n * - Automatic external link icon for target=\"_blank\" links\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n * - Full accessibility support with proper focus management\n * - Supports layout utilities for positioning and spacing\n * - Flexible content support for text and other elements\n * - Responsive design with consistent typography\n * - Hover and focus states with proper visual feedback\n * - Screen reader support for external link announcements\n *\n * @example\n * <Link href=\"/dashboard\" appearance=\"primary\">\n * Go to Dashboard\n * </Link>\n *\n * @example\n * <Link href=\"https://example.com\" target=\"_blank\" quiet>\n * External Documentation\n * </Link>\n *\n * @example\n * <Link href=\"/settings\" appearance=\"secondary\">\n * Settings\n * </Link>\n *\n * @example\n * <Link href=\"/profile\" gap=\"2\" alignItems=\"center\">\n * <Avatar name=\"John Doe\" size=\"small\" />\n * View Profile\n * </Link>\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { appearance, className, quiet, ghost, style, children, ...rest } =\n props;\n const { linkClassNames, styleCombined } = useLinkStyles({\n appearance,\n className,\n quiet,\n ghost,\n style,\n });\n\n return (\n <LinkHeadless\n className={linkClassNames}\n data-anv=\"link\"\n ref={ref}\n style={styleCombined}\n {...rest}\n >\n {children}\n </LinkHeadless>\n );\n});\n\nLink.displayName = \"Link\";\n","import { Ref, forwardRef } from \"react\";\n\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId, DistributiveOmit } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\nimport { LinkProps as BaseLinkProps, Link as BaseLink } from \"./internal/Link\";\n\n/**\n * Props for the Link component.\n * @extends Omit<BaseLinkProps, \"href\">\n * @extends DataTrackingId\n */\nexport type LinkProps = DistributiveOmit<BaseLinkProps, \"href\"> &\n DataTrackingId &\n (\n | {\n pathname?: never;\n search?: never;\n href?: BaseLinkProps[\"href\"];\n }\n | {\n pathname: string;\n search?: string;\n href?: never;\n }\n | {\n pathname?: never;\n search?: never;\n href?: never;\n }\n );\n\n/**\n * Link component for creating accessible, styled hyperlinks with tracking support.\n *\n * Features:\n * - Two visual appearances: primary (default) and secondary\n * - Quiet mode for less prominent styling\n * - Automatic external link icon for target=\"_blank\" links\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n * - Full accessibility support with proper focus management\n * - Supports layout utilities for positioning and spacing\n * - Flexible content support for text and other elements\n * - Responsive design with consistent typography\n * - Hover and focus states with proper visual feedback\n * - Screen reader support for external link announcements\n * - Automatic tracking ID generation for analytics\n * - Client-side navigation support with pathname and search params\n * - History API integration for single-page application navigation\n *\n * @example\n * <Link href=\"/dashboard\" appearance=\"primary\">\n * Go to Dashboard\n * </Link>\n *\n * @example\n * <Link pathname=\"/settings\" search=\"?tab=profile\">\n * Profile Settings\n * </Link>\n *\n * @example\n * <Link href=\"https://example.com\" target=\"_blank\" quiet>\n * External Documentation\n * </Link>\n *\n * @example\n * <Link href=\"/profile\" gap=\"2\" alignItems=\"center\">\n * <Avatar name=\"John Doe\" size=\"small\" />\n * View Profile\n * </Link>\n */\nexport const Link = forwardRef(\n (props: LinkProps, ref: Ref<HTMLAnchorElement>) => {\n const { onClick, pathname, children, search, ...rest } = props;\n const data = {\n appearance: props.appearance,\n quiet: props.quiet,\n ghost: props.ghost,\n children: childrenToString(children),\n };\n\n const handleClick = (\n ...args: Parameters<NonNullable<LinkProps[\"onClick\"]>>\n ) => {\n if (pathname) {\n const to = pathname + (search ?? \"\");\n args[0].preventDefault();\n history.pushState(null, \"\", to);\n onClick?.(...args);\n } else {\n onClick?.(...args);\n }\n };\n\n const trackingId = useTrackingId({\n name: \"Link\",\n data,\n hasOverride: !!rest[\"data-tracking-id\"],\n });\n\n return (\n <BaseLink\n onClick={handleClick}\n ref={ref}\n data-tracking-id={trackingId}\n {...rest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ClB,OAAO,KAAA,CAAM,KAAA;AAAA,MACb,OAAO,KAAA,CAAM,KAAA;AAAA,MACb,QAAA,EAAU,iBAAiB,QAAQ;AAAA,KACrC;AAEA,IAAA,MAAM,WAAA,GAAc,IACf,IAAA,KACA;AACH,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,MAAM,EAAA,GAAK,YAAY,MAAA,IAAU,EAAA,CAAA;AACjC,QAAA,IAAA,CAAK,CAAC,EAAE,cAAA,EAAe;AACvB,QAAA,OAAA,CAAQ,SAAA,CAAU,IAAA,EAAM,EAAA,EAAI,EAAE,CAAA;AAC9B,QAAA,OAAA,GAAU,GAAG,IAAI,CAAA;AAAA,MACnB,CAAA,MAAO;AACL,QAAA,OAAA,GAAU,GAAG,IAAI,CAAA;AAAA,MACnB;AAAA,IACF,CAAA;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,MAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC,IAAA,CAAK,kBAAkB;AAAA,KACvC,CAAA;AAED,IAAA,uBACE,GAAA;AAAA,MAACC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,WAAA;AAAA,QACT,GAAA;AAAA,QACA,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,IAAA,CAAK,cAAcA,MAAA,CAAS,WAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"Link-CGXEFA9w.js","sources":["../../hammer-icon/mdi/round/open_in_new.svg","../src/components/Link/internal/LinkHeadless.tsx","../src/components/Link/useLinkStyles.ts","../src/components/Link/internal/Link.tsx","../src/components/Link/Link.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgOpenInNew = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"1em\", height: \"1em\", viewBox: \"0 0 24 24\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h5c.55 0 1-.45 1-1s-.45-1-1-1H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1v5c0 .55-.45 1-1 1zM14 4c0 .55.45 1 1 1h2.59l-9.13 9.13a.996.996 0 1 0 1.41 1.41L19 6.41V9c0 .55.45 1 1 1s1-.45 1-1V4c0-.55-.45-1-1-1h-5c-.55 0-1 .45-1 1z\" }));\nexport default SvgOpenInNew;\n","import { forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nimport styles from \"./Link.module.scss\";\nimport { Icon } from \"../../Icon\";\nimport OpenInNew from \"@servicetitan/hammer-icon/mdi/round/open_in_new.svg\";\n\n/**\n * Props for the LinkHeadless component.\n * @extends ComponentPropsWithoutRef<\"a\">\n */\nexport type LinkHeadlessProps = ComponentPropsWithoutRef<\"a\">;\n\n/**\n * Headless link component for creating accessible hyperlinks.\n *\n * Features:\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n *\n * @example\n * <LinkHeadless href=\"/dashboard\">\n * Go to Dashboard\n * </LinkHeadless>\n *\n * @example\n * <LinkHeadless href=\"https://example.com\" target=\"_blank\">\n * External Documentation\n * </LinkHeadless>\n *\n */\nexport const LinkHeadless = forwardRef<HTMLAnchorElement, LinkHeadlessProps>(\n ({ children, ...props }, ref) => {\n return (\n <a\n rel=\"noopener noreferrer\"\n data-anv=\"link-headless\"\n ref={ref}\n {...props}\n >\n {children}\n {props.target === \"_blank\" && (\n <Icon className={styles[\"open-in-new\"]} inherit svg={OpenInNew} />\n )}\n </a>\n );\n },\n);\n\nLinkHeadless.displayName = \"LinkHeadless\";\n","import cx from \"classnames\";\n\nimport { LayoutUtilProps } from \"../../types\";\nimport { LinkProps } from \"./Link\";\nimport { useLayoutPropsUtil } from \"../../internal/hooks\";\n\nimport styles from \"./internal/Link.module.scss\";\n\n/**\n * Props for the useLinkStyles hook.\n * @extends LayoutUtilProps\n */\nexport type UseLinkStylesProps = LayoutUtilProps &\n Pick<LinkProps, \"className\" | \"appearance\" | \"quiet\" | \"ghost\" | \"style\">;\n\n/**\n * Hook for generating link styles and class names.\n *\n * @param props - The link style properties\n * @returns Object containing linkClassNames and styleCombined\n */\nexport const useLinkStyles = (props: UseLinkStylesProps) => {\n const { layoutStyles, componentProps } = useLayoutPropsUtil(props);\n const {\n className,\n appearance = \"primary\",\n quiet,\n ghost,\n style,\n } = componentProps;\n\n const linkClassNames = cx([styles[\"link\"]], className, {\n [styles[\"quiet\"]]: quiet,\n [styles[\"ghost\"]]: ghost,\n [styles[\"secondary\"]]: appearance === \"secondary\",\n });\n\n const styleCombined = Object.assign({}, style, layoutStyles);\n\n return { linkClassNames, styleCombined };\n};\n","import { forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nimport { LayoutUtilProps } from \"../../../types\";\n\nimport { LinkHeadless } from \"./LinkHeadless\";\n\nimport { useLinkStyles } from \"../useLinkStyles\";\n\n/**\n * Props for the Link component.\n * @extends ComponentPropsWithoutRef<\"a\">\n * @extends LayoutUtilProps\n */\nexport type LinkProps = ComponentPropsWithoutRef<\"a\"> &\n LayoutUtilProps &\n (\n | {\n /**\n * The visual appearance of the link.\n * @default \"primary\"\n */\n appearance?: \"primary\";\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @deprecated to be removed on next major - use ghost instead\n */\n quiet?: boolean;\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @remarks Only available when appearance is \"primary\".\n */\n ghost?: boolean;\n }\n | {\n /**\n * The visual appearance of the LinkButton. Secondary appearance cannot be quiet.\n */\n appearance: \"secondary\";\n /**\n * Whether the link should have a quieter, less prominent appearance\n * @deprecated to be removed on next major - use ghost instead\n */\n quiet?: false;\n /**\n * Whether the LinkButton should have a quieter, less prominent appearance.\n * @remarks Must be false when appearance is \"secondary\".\n */\n ghost?: false;\n }\n );\n\n/**\n * Link component for creating accessible, styled hyperlinks.\n *\n * Features:\n * - Two visual appearances: primary (default) and secondary\n * - Quiet mode for less prominent styling\n * - Automatic external link icon for target=\"_blank\" links\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n * - Full accessibility support with proper focus management\n * - Supports layout utilities for positioning and spacing\n * - Flexible content support for text and other elements\n * - Responsive design with consistent typography\n * - Hover and focus states with proper visual feedback\n * - Screen reader support for external link announcements\n *\n * @example\n * <Link href=\"/dashboard\" appearance=\"primary\">\n * Go to Dashboard\n * </Link>\n *\n * @example\n * <Link href=\"https://example.com\" target=\"_blank\" quiet>\n * External Documentation\n * </Link>\n *\n * @example\n * <Link href=\"/settings\" appearance=\"secondary\">\n * Settings\n * </Link>\n *\n * @example\n * <Link href=\"/profile\" gap=\"2\" alignItems=\"center\">\n * <Avatar name=\"John Doe\" size=\"small\" />\n * View Profile\n * </Link>\n */\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {\n const { appearance, className, quiet, ghost, style, children, ...rest } =\n props;\n const { linkClassNames, styleCombined } = useLinkStyles({\n appearance,\n className,\n quiet,\n ghost,\n style,\n });\n\n return (\n <LinkHeadless\n className={linkClassNames}\n data-anv=\"link\"\n ref={ref}\n style={styleCombined}\n {...rest}\n >\n {children}\n </LinkHeadless>\n );\n});\n\nLink.displayName = \"Link\";\n","import { Ref, forwardRef } from \"react\";\n\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId, DistributiveOmit } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\nimport { LinkProps as BaseLinkProps, Link as BaseLink } from \"./internal/Link\";\n\n/**\n * Props for the Link component.\n * @extends Omit<BaseLinkProps, \"href\">\n * @extends DataTrackingId\n */\nexport type LinkProps = DistributiveOmit<BaseLinkProps, \"href\"> &\n DataTrackingId &\n (\n | {\n pathname?: never;\n search?: never;\n href?: BaseLinkProps[\"href\"];\n }\n | {\n pathname: string;\n search?: string;\n href?: never;\n }\n | {\n pathname?: never;\n search?: never;\n href?: never;\n }\n );\n\n/**\n * Link component for creating accessible, styled hyperlinks with tracking support.\n *\n * Features:\n * - Two visual appearances: primary (default) and secondary\n * - Quiet mode for less prominent styling\n * - Automatic external link icon for target=\"_blank\" links\n * - Security attributes (rel=\"noopener noreferrer\") for external links\n * - Full accessibility support with proper focus management\n * - Supports layout utilities for positioning and spacing\n * - Flexible content support for text and other elements\n * - Responsive design with consistent typography\n * - Hover and focus states with proper visual feedback\n * - Screen reader support for external link announcements\n * - Automatic tracking ID generation for analytics\n * - Client-side navigation support with pathname and search params\n * - History API integration for single-page application navigation\n *\n * @example\n * <Link href=\"/dashboard\" appearance=\"primary\">\n * Go to Dashboard\n * </Link>\n *\n * @example\n * <Link pathname=\"/settings\" search=\"?tab=profile\">\n * Profile Settings\n * </Link>\n *\n * @example\n * <Link href=\"https://example.com\" target=\"_blank\" quiet>\n * External Documentation\n * </Link>\n *\n * @example\n * <Link href=\"/profile\" gap=\"2\" alignItems=\"center\">\n * <Avatar name=\"John Doe\" size=\"small\" />\n * View Profile\n * </Link>\n */\nexport const Link = forwardRef(\n (props: LinkProps, ref: Ref<HTMLAnchorElement>) => {\n const { onClick, pathname, children, search, ...rest } = props;\n const data = {\n appearance: props.appearance,\n quiet: props.quiet,\n ghost: props.ghost,\n children: childrenToString(children),\n };\n\n const handleClick = (\n ...args: Parameters<NonNullable<LinkProps[\"onClick\"]>>\n ) => {\n if (pathname) {\n const to = pathname + (search ?? \"\");\n args[0].preventDefault();\n history.pushState(null, \"\", to);\n onClick?.(...args);\n } else {\n onClick?.(...args);\n }\n };\n\n const trackingId = useTrackingId({\n name: \"Link\",\n data,\n hasOverride: !!rest[\"data-tracking-id\"],\n });\n\n return (\n <BaseLink\n onClick={handleClick}\n ref={ref}\n data-tracking-id={trackingId}\n {...rest}\n >\n {children}\n </BaseLink>\n );\n },\n);\n\nLink.displayName = BaseLink.displayName;\n"],"names":["styles","OpenInNew","Link","BaseLink"],"mappings":";;;;;;;;;;AACA,MAAM,YAA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,MAAM,WAAA,GAAc,IACf,IAAA,KACA;AACH,MAAA,IAAI,QAAA,EAAU;AACZ,QAAA,MAAM,EAAA,GAAK,YAAY,MAAA,IAAU,EAAA,CAAA;AACjC,QAAA,IAAA,CAAK,CAAC,EAAE,cAAA,EAAe;AACvB,QAAA,OAAA,CAAQ,SAAA,CAAU,IAAA,EAAM,EAAA,EAAI,EAAE,CAAA;AAC9B,QAAA,OAAA,GAAU,GAAG,IAAI,CAAA;AAAA,MACnB,CAAA,MAAO;AACL,QAAA,OAAA,GAAU,GAAG,IAAI,CAAA;AAAA,MACnB;AAAA,IACF,CAAA;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,MAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC,IAAA,CAAK,kBAAkB;AAAA,KACvC,CAAA;AAED,IAAA,uBACE,GAAA;AAAA,MAACC,MAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,WAAA;AAAA,QACT,GAAA;AAAA,QACA,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAG,IAAA;AAAA,QAEH;AAAA;AAAA,KACH;AAAA,EAEJ;AACF;AAEA,IAAA,CAAK,cAAcA,MAAA,CAAS,WAAA;;;;"}
|
package/dist/Link.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer starter, reset, base, state, application;
|
|
2
2
|
@layer reset {
|
|
3
|
-
.
|
|
3
|
+
._link_p1bke_2 {
|
|
4
4
|
all: unset;
|
|
5
5
|
font-family: var(--font-family-base, "Nunito Sans", sans-serif);
|
|
6
6
|
font-size: 100%;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
@layer base {
|
|
18
|
-
a.
|
|
19
|
-
.
|
|
18
|
+
a._link_p1bke_2,
|
|
19
|
+
._link_p1bke_2 {
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
align-items: center;
|
|
22
22
|
border-radius: 0.1875rem;
|
|
@@ -25,45 +25,51 @@
|
|
|
25
25
|
outline-offset: 0.125rem;
|
|
26
26
|
font-size: inherit;
|
|
27
27
|
}
|
|
28
|
-
._open-in-
|
|
28
|
+
._open-in-new_p1bke_27 {
|
|
29
29
|
padding-inline-start: 0.25rem;
|
|
30
|
-
vertical-align:
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
}
|
|
32
|
+
._open-in-new_p1bke_27 > svg {
|
|
33
|
+
font-size: max(0.5625rem, 0.75em) !important;
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
@layer state {
|
|
34
|
-
a.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
37
|
+
a._link_p1bke_2[data-interactive=focus-visible], a._link_p1bke_2:focus-visible,
|
|
38
|
+
._link_p1bke_2[data-interactive=focus-visible],
|
|
39
|
+
._link_p1bke_2:focus-visible {
|
|
37
40
|
outline-width: 0.125rem;
|
|
38
41
|
}
|
|
39
|
-
a.
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
+
a._link_p1bke_2[data-interactive=hover], a._link_p1bke_2:hover,
|
|
43
|
+
._link_p1bke_2[data-interactive=hover],
|
|
44
|
+
._link_p1bke_2:hover {
|
|
42
45
|
color: var(--foreground-color-hover-primary, #004491);
|
|
43
46
|
}
|
|
44
|
-
a.
|
|
45
|
-
.
|
|
47
|
+
a._link_p1bke_2._secondary_p1bke_46,
|
|
48
|
+
._link_p1bke_2._secondary_p1bke_46 {
|
|
46
49
|
color: var(--foreground-color, #141414);
|
|
47
50
|
}
|
|
48
|
-
a.
|
|
49
|
-
.
|
|
50
|
-
.
|
|
51
|
+
a._link_p1bke_2._secondary_p1bke_46[data-interactive=hover], a._link_p1bke_2._secondary_p1bke_46:hover,
|
|
52
|
+
._link_p1bke_2._secondary_p1bke_46[data-interactive=hover],
|
|
53
|
+
._link_p1bke_2._secondary_p1bke_46:hover {
|
|
51
54
|
opacity: 0.8;
|
|
52
55
|
}
|
|
53
|
-
a.
|
|
54
|
-
.
|
|
56
|
+
a._link_p1bke_2._quiet_p1bke_55,
|
|
57
|
+
._link_p1bke_2._quiet_p1bke_55 {
|
|
55
58
|
text-decoration: none;
|
|
56
59
|
}
|
|
57
|
-
a.
|
|
58
|
-
.
|
|
60
|
+
a._link_p1bke_2._quiet_p1bke_55:hover,
|
|
61
|
+
._link_p1bke_2._quiet_p1bke_55:hover {
|
|
59
62
|
text-decoration: underline;
|
|
60
63
|
}
|
|
61
|
-
a.
|
|
62
|
-
.
|
|
64
|
+
a._link_p1bke_2._ghost_p1bke_63,
|
|
65
|
+
._link_p1bke_2._ghost_p1bke_63 {
|
|
63
66
|
text-decoration: none;
|
|
64
67
|
}
|
|
65
|
-
a.
|
|
66
|
-
.
|
|
68
|
+
a._link_p1bke_2._ghost_p1bke_63:hover,
|
|
69
|
+
._link_p1bke_2._ghost_p1bke_63:hover {
|
|
67
70
|
text-decoration: underline;
|
|
68
71
|
}
|
|
72
|
+
}
|
|
73
|
+
a[data-anv=link]._link_p1bke_2 {
|
|
74
|
+
font-size: inherit;
|
|
69
75
|
}
|
package/dist/Link.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as Link, L as default, u as useLinkStyles } from './Link-
|
|
1
|
+
export { L as Link, L as default, u as useLinkStyles } from './Link-CGXEFA9w.js';
|
|
2
2
|
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './Link.css';const link = "_link_p1bke_2";
|
|
2
|
+
const secondary = "_secondary_p1bke_46";
|
|
3
|
+
const quiet = "_quiet_p1bke_55";
|
|
4
|
+
const ghost = "_ghost_p1bke_63";
|
|
5
|
+
const linkStyles = {
|
|
6
|
+
link: link,
|
|
7
|
+
"open-in-new": "_open-in-new_p1bke_27",
|
|
8
|
+
secondary: secondary,
|
|
9
|
+
quiet: quiet,
|
|
10
|
+
ghost: ghost
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { linkStyles as l };
|
|
14
|
+
//# sourceMappingURL=Link.module-ByPQQ0zy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.module-ByPQQ0zy.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { l as linkStyles } from './Link.module-
|
|
3
|
+
import { l as linkStyles } from './Link.module-ByPQQ0zy.js';
|
|
4
4
|
import { useTrackingId } from './useTrackingId.js';
|
|
5
5
|
import { c as cx } from './index-tZvMCc77.js';
|
|
6
6
|
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
|
|
@@ -64,4 +64,4 @@ const LinkButton = forwardRef(
|
|
|
64
64
|
LinkButton.displayName = "LinkButton";
|
|
65
65
|
|
|
66
66
|
export { LinkButton as L };
|
|
67
|
-
//# sourceMappingURL=LinkButton-
|
|
67
|
+
//# sourceMappingURL=LinkButton-BBCO-4em.js.map
|