@corefoundry-labs/forge-ui 1.0.2 → 1.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/LICENSE +202 -0
- package/README.md +78 -0
- package/dist/components/layout/ThemeScope/ThemeScope.d.ts +11 -0
- package/dist/components/layout/ThemeScope/ThemeScope.d.ts.map +1 -0
- package/dist/components/layout/ThemeScope/ThemeScope.js +13 -0
- package/dist/components/layout/ThemeScope/index.d.ts +3 -0
- package/dist/components/layout/ThemeScope/index.d.ts.map +1 -0
- package/dist/components/layout/ThemeScope/index.js +1 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.d.ts +21 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.d.ts.map +1 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.js +17 -0
- package/dist/componentsV2/actions/ButtonV2/ButtonV2.module.css +158 -0
- package/dist/componentsV2/actions/ButtonV2/index.d.ts +3 -0
- package/dist/componentsV2/actions/ButtonV2/index.d.ts.map +1 -0
- package/dist/componentsV2/actions/ButtonV2/index.js +1 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.d.ts +36 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.d.ts.map +1 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.js +23 -0
- package/dist/componentsV2/data-display/AvatarV2/AvatarV2.module.css +156 -0
- package/dist/componentsV2/data-display/AvatarV2/index.d.ts +3 -0
- package/dist/componentsV2/data-display/AvatarV2/index.d.ts.map +1 -0
- package/dist/componentsV2/data-display/AvatarV2/index.js +1 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.d.ts +25 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.js +16 -0
- package/dist/componentsV2/feedback/AlertV2/AlertV2.module.css +144 -0
- package/dist/componentsV2/feedback/AlertV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/AlertV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/AlertV2/index.js +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.d.ts +13 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.js +18 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/FeedbackStateV2.module.css +102 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/FeedbackStateV2/index.js +1 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.d.ts +35 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.js +15 -0
- package/dist/componentsV2/feedback/ProgressV2/ProgressV2.module.css +161 -0
- package/dist/componentsV2/feedback/ProgressV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/ProgressV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/ProgressV2/index.js +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.d.ts +20 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.js +8 -0
- package/dist/componentsV2/feedback/SkeletonV2/SkeletonV2.module.css +92 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SkeletonV2/index.js +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.d.ts +35 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.js +90 -0
- package/dist/componentsV2/feedback/SnackbarV2/SnackbarV2.module.css +162 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.d.ts +3 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.d.ts.map +1 -0
- package/dist/componentsV2/feedback/SnackbarV2/index.js +1 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.d.ts +10 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.js +18 -0
- package/dist/componentsV2/forms/CheckboxV2/CheckboxV2.module.css +137 -0
- package/dist/componentsV2/forms/CheckboxV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/CheckboxV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/CheckboxV2/index.js +1 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.d.ts +10 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.js +7 -0
- package/dist/componentsV2/forms/SelectV2/SelectV2.module.css +90 -0
- package/dist/componentsV2/forms/SelectV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/SelectV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/SelectV2/index.js +1 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.d.ts +8 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.js +8 -0
- package/dist/componentsV2/forms/SwitchV2/SwitchV2.module.css +129 -0
- package/dist/componentsV2/forms/SwitchV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/SwitchV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/SwitchV2/index.js +1 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.d.ts +10 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.d.ts.map +1 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.js +7 -0
- package/dist/componentsV2/forms/TextInputV2/TextInputV2.module.css +64 -0
- package/dist/componentsV2/forms/TextInputV2/index.d.ts +3 -0
- package/dist/componentsV2/forms/TextInputV2/index.d.ts.map +1 -0
- package/dist/componentsV2/forms/TextInputV2/index.js +1 -0
- package/dist/componentsV2/forms/selectionControl.d.ts +14 -0
- package/dist/componentsV2/forms/selectionControl.d.ts.map +1 -0
- package/dist/componentsV2/forms/selectionControl.js +1 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.d.ts +30 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.d.ts.map +1 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.js +54 -0
- package/dist/componentsV2/navigation/TabsV2/TabsV2.module.css +128 -0
- package/dist/componentsV2/navigation/TabsV2/index.d.ts +3 -0
- package/dist/componentsV2/navigation/TabsV2/index.d.ts.map +1 -0
- package/dist/componentsV2/navigation/TabsV2/index.js +1 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.d.ts +22 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.js +77 -0
- package/dist/componentsV2/overlays/DialogV2/DialogV2.module.css +91 -0
- package/dist/componentsV2/overlays/DialogV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/DialogV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DialogV2/index.js +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.d.ts +40 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.js +115 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/DropdownMenuV2.module.css +122 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/DropdownMenuV2/index.js +1 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.d.ts +46 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.js +41 -0
- package/dist/componentsV2/overlays/PopoverV2/PopoverV2.module.css +63 -0
- package/dist/componentsV2/overlays/PopoverV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/PopoverV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/PopoverV2/index.js +1 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.d.ts +18 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.d.ts.map +1 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.js +66 -0
- package/dist/componentsV2/overlays/TooltipV2/TooltipV2.module.css +69 -0
- package/dist/componentsV2/overlays/TooltipV2/index.d.ts +3 -0
- package/dist/componentsV2/overlays/TooltipV2/index.d.ts.map +1 -0
- package/dist/componentsV2/overlays/TooltipV2/index.js +1 -0
- package/dist/componentsV2/overlays/layer.d.ts +29 -0
- package/dist/componentsV2/overlays/layer.d.ts.map +1 -0
- package/dist/componentsV2/overlays/layer.js +224 -0
- package/dist/componentsV2/overlays/position.d.ts +32 -0
- package/dist/componentsV2/overlays/position.d.ts.map +1 -0
- package/dist/componentsV2/overlays/position.js +42 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.d.ts +18 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.d.ts.map +1 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.js +7 -0
- package/dist/componentsV2/status/BadgeV2/BadgeV2.module.css +94 -0
- package/dist/componentsV2/status/BadgeV2/index.d.ts +3 -0
- package/dist/componentsV2/status/BadgeV2/index.d.ts.map +1 -0
- package/dist/componentsV2/status/BadgeV2/index.js +1 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.d.ts +28 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.d.ts.map +1 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.js +16 -0
- package/dist/componentsV2/surfaces/CardV2/CardV2.module.css +84 -0
- package/dist/componentsV2/surfaces/CardV2/index.d.ts +3 -0
- package/dist/componentsV2/surfaces/CardV2/index.d.ts.map +1 -0
- package/dist/componentsV2/surfaces/CardV2/index.js +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -0
- package/package.json +16 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -11,6 +11,84 @@ import { Button, FormField, Input } from '@corefoundry-labs/forge-ui';
|
|
|
11
11
|
<Button>Save</Button>;
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
`FeedbackStateV2` brings loading, empty, error, and read-only presentations under one additive API. The existing `EmptyState`, `ErrorState`, `LoadingState`, and `StatePanel` exports remain available with their current contracts.
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { FeedbackStateV2, Button } from '@corefoundry-labs/forge-ui';
|
|
18
|
+
|
|
19
|
+
<FeedbackStateV2
|
|
20
|
+
state="error"
|
|
21
|
+
title="Could not load projects"
|
|
22
|
+
description="Check your connection and retry."
|
|
23
|
+
actions={<Button onClick={retry}>Retry</Button>}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`FeedbackStateV2` reads the `--cf-v2-*` semantic roles when a dynamic theme is applied to an ancestor. Without a theme of your own, it uses the default Forge theme from `@corefoundry-labs/forge-tokens/theme-v2/tokens.css`. Apply a theme with `createTheme` and `applyTheme` from `@corefoundry-labs/forge-tokens/theme-v2`, or use CSS generated by `generateThemeCss`.
|
|
28
|
+
|
|
29
|
+
`ButtonV2` is the V2 action. It lives apart from V1 in `src/componentsV2` and uses only `--cf-v2-*` tokens, so it follows `ThemeScope` and `applyTheme` in light, dark, and high contrast. An icon-only button requires `aria-label`.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { ButtonV2 } from '@corefoundry-labs/forge-ui';
|
|
33
|
+
import { Plus, Search } from '@corefoundry-labs/forge-icons';
|
|
34
|
+
|
|
35
|
+
<ButtonV2 iconStart={<Plus />}>Add item</ButtonV2>;
|
|
36
|
+
<ButtonV2 variant="danger" size="sm" loading={saving} onClick={save}>Delete</ButtonV2>;
|
|
37
|
+
<ButtonV2 variant="ghost" aria-label="Search" iconStart={<Search />} />;
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`TextInputV2`, `SelectV2`, `CheckboxV2`, and `SwitchV2` are the V2 form controls. Each one wraps a native element. `CheckboxV2` and `SwitchV2` take their label as children and require an accessible name without it.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { CheckboxV2, SelectV2, SwitchV2, TextInputV2 } from '@corefoundry-labs/forge-ui';
|
|
44
|
+
|
|
45
|
+
<TextInputV2 aria-label="Project name" size="md" value={name} onChange={rename} />;
|
|
46
|
+
<SelectV2 aria-label="Plan" value={plan} onChange={choose}>
|
|
47
|
+
<option value="">Choose an option</option>
|
|
48
|
+
<option value="team">Team</option>
|
|
49
|
+
</SelectV2>;
|
|
50
|
+
<CheckboxV2 checked={accepted} onChange={accept}>Accept terms</CheckboxV2>;
|
|
51
|
+
<SwitchV2 checked={enabled} onChange={toggle}>Notifications</SwitchV2>;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`CardV2`, `BadgeV2`, `TabsV2`, and `AlertV2` are the V2 display components. Only an interactive `CardV2` is an action, and `TabsV2` requires an accessible name.
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { AlertV2, BadgeV2, CardV2, TabsV2 } from '@corefoundry-labs/forge-ui';
|
|
58
|
+
|
|
59
|
+
<CardV2 variant="outlined" header="Atlas" footer="Updated today">A home for your next idea.</CardV2>;
|
|
60
|
+
<CardV2 variant="interactive" header="Open Atlas" onClick={open} />;
|
|
61
|
+
<BadgeV2 tone="success" variant="subtle" size="md">Completed</BadgeV2>;
|
|
62
|
+
<TabsV2 aria-label="Project views" items={items} value={view} onValueChange={setView} />;
|
|
63
|
+
<AlertV2 tone="error" title="Could not save" description="Try again." onDismiss={close} />;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`DialogV2`, `TooltipV2`, `PopoverV2`, and `DropdownMenuV2` are the V2 overlays. They render in place and rise into the browser top layer, so they inherit their `ThemeScope` and no ancestor can clip them. They need the Popover API: Chrome and Edge 114, Safari 17, or Firefox 125.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { ButtonV2, DialogV2, DropdownMenuV2, PopoverV2, TooltipV2 } from '@corefoundry-labs/forge-ui';
|
|
70
|
+
|
|
71
|
+
<DialogV2 open={open} onOpenChange={setOpen} title="Confirm action" footer={<ButtonV2 onClick={confirm}>Continue</ButtonV2>} />;
|
|
72
|
+
<TooltipV2 content="Copy the link"><ButtonV2 aria-label="Copy" iconStart={<Copy />} /></TooltipV2>;
|
|
73
|
+
<PopoverV2 trigger={<ButtonV2>More options</ButtonV2>} title="Preferences">{content}</PopoverV2>;
|
|
74
|
+
<DropdownMenuV2 trigger={<ButtonV2>More actions</ButtonV2>} items={[{ id: 'edit', label: 'Edit', onSelect: edit }]} />;
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`ProgressV2`, `SkeletonV2`, `SnackbarV2`, and `AvatarV2` cover loading, transient feedback, and identity. A snackbar never takes focus, and the parent owns the list.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { AvatarV2, ProgressV2, SkeletonV2, SnackbarStackV2, SnackbarV2 } from '@corefoundry-labs/forge-ui';
|
|
81
|
+
|
|
82
|
+
<ProgressV2 label="Uploading" value={68} />;
|
|
83
|
+
<SkeletonV2 shape="rectangle" size="md" animation="pulse" />;
|
|
84
|
+
<SnackbarStackV2>
|
|
85
|
+
{items.map((item) => <SnackbarV2 key={item.id} tone="success" title={item.title} onDismiss={() => remove(item.id)} />)}
|
|
86
|
+
</SnackbarStackV2>;
|
|
87
|
+
<AvatarV2 alt="Ada Lovelace" src={photo} initials="AL" size="lg" />;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Preview the V2 components, the V1 components, and `FeedbackStateV2` locally with `npm run playground:ui` from the repository root. The host lets you change the preset, mode, and primary seed within the preview. The preview documents package rendering; it is not a human Figma certification.
|
|
91
|
+
|
|
14
92
|
Build and test this package independently from the repository root with `npm run build --workspace=@corefoundry-labs/forge-ui` and `npm test --workspace=@corefoundry-labs/forge-ui`.
|
|
15
93
|
|
|
16
94
|
Consumers can import the safe aggregate stylesheet from `@corefoundry-labs/forge-ui/styles.css`. It contains
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
/** Structural adapter for themes produced by forge-tokens/theme-v2. */
|
|
3
|
+
export interface ThemeScopeTheme {
|
|
4
|
+
readonly roles: Readonly<Record<string, string>>;
|
|
5
|
+
readonly mode?: 'light' | 'dark' | 'high-contrast';
|
|
6
|
+
}
|
|
7
|
+
export interface ThemeScopeProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
theme: ThemeScopeTheme;
|
|
9
|
+
}
|
|
10
|
+
export declare const ThemeScope: import("react").ForwardRefExoticComponent<ThemeScopeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
//# sourceMappingURL=ThemeScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeScope.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeScope/ThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5E,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,eAAe,CAAC;CACpD;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,KAAK,EAAE,eAAe,CAAC;CACxB;AAID,eAAO,MAAM,UAAU,4GAiBrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
export const ThemeScope = forwardRef(function ThemeScope({ theme, style, children, ...props }, ref) {
|
|
4
|
+
const scopedStyle = { ...style };
|
|
5
|
+
for (const [role, value] of Object.entries(theme.roles)) {
|
|
6
|
+
// This adapter serializes semantic roles; palette generation stays in forge-tokens.
|
|
7
|
+
const property = `--cf-v2-${role.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
8
|
+
scopedStyle[property] = value;
|
|
9
|
+
}
|
|
10
|
+
if (theme.mode)
|
|
11
|
+
scopedStyle.colorScheme = theme.mode === 'light' ? 'light' : 'dark';
|
|
12
|
+
return (_jsx("div", { ...props, ref: ref, style: scopedStyle, "data-cf-theme-mode": theme.mode, children: children }));
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/ThemeScope/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ThemeScope } from './ThemeScope';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
2
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
3
|
+
export type ButtonV2Variant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
4
|
+
export type ButtonV2Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
type ButtonV2Base = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
6
|
+
variant?: ButtonV2Variant;
|
|
7
|
+
size?: ButtonV2Size;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
loadingLabel?: string;
|
|
10
|
+
iconStart?: ReactNode;
|
|
11
|
+
iconEnd?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export type ButtonV2Props = ButtonV2Base & ({
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
} | {
|
|
16
|
+
children?: undefined;
|
|
17
|
+
'aria-label': string;
|
|
18
|
+
});
|
|
19
|
+
export declare const ButtonV2: import("react").ForwardRefExoticComponent<ButtonV2Props & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=ButtonV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonV2.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/actions/ButtonV2/ButtonV2.tsx"],"names":[],"mappings":"AAAA,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAAc,KAAK,oBAAoB,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/F,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,KAAK,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9E,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,YAAY,GACtC,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7E,eAAO,MAAM,QAAQ,6GAwDnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import styles from './ButtonV2.module.css';
|
|
5
|
+
export const ButtonV2 = forwardRef(function ButtonV2({ variant = 'primary', size = 'md', loading = false, loadingLabel = 'Saving…', iconStart, iconEnd, className, children, onClick, type = 'button', ...props }, ref) {
|
|
6
|
+
const iconOnly = children == null;
|
|
7
|
+
const handleClick = (event) => {
|
|
8
|
+
if (loading) {
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
onClick?.(event);
|
|
13
|
+
};
|
|
14
|
+
return (_jsxs("button", { ...props, ref: ref, type: type, "aria-busy": loading || props['aria-busy'], "aria-disabled": loading || props['aria-disabled'], "data-variant": variant, "data-size": size, onClick: handleClick, className: [styles.button, styles[variant], styles[size], iconOnly && styles.iconOnly, className]
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.join(' '), children: [loading ? (_jsx("span", { className: styles.spinner, "data-button-spinner": true, "aria-hidden": "true" })) : (iconStart != null && (_jsx("span", { className: styles.icon, "aria-hidden": "true", children: iconStart }))), !iconOnly && _jsx("span", { className: styles.label, children: loading ? loadingLabel : children }), !loading && iconEnd != null && (_jsx("span", { className: styles.icon, "aria-hidden": "true", children: iconEnd }))] }));
|
|
17
|
+
});
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: var(--cf-v2-button-gap);
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
margin: 0;
|
|
9
|
+
border: var(--cf-v2-button-border-width) solid transparent;
|
|
10
|
+
border-radius: var(--cf-v2-button-radius);
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
font-weight: var(--cf-v2-button-font-weight);
|
|
13
|
+
line-height: normal;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition:
|
|
17
|
+
background-color var(--cf-v2-button-transition-duration) ease,
|
|
18
|
+
border-color var(--cf-v2-button-transition-duration) ease;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.sm {
|
|
22
|
+
height: var(--cf-v2-button-height-sm);
|
|
23
|
+
padding-inline: var(--cf-v2-button-padding-sm);
|
|
24
|
+
font-size: var(--cf-v2-button-font-size-sm);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.md {
|
|
28
|
+
height: var(--cf-v2-button-height-md);
|
|
29
|
+
padding-inline: var(--cf-v2-button-padding-md);
|
|
30
|
+
font-size: var(--cf-v2-button-font-size-md);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.lg {
|
|
34
|
+
height: var(--cf-v2-button-height-lg);
|
|
35
|
+
padding-inline: var(--cf-v2-button-padding-lg);
|
|
36
|
+
font-size: var(--cf-v2-button-font-size-lg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.iconOnly {
|
|
40
|
+
padding-inline: 0;
|
|
41
|
+
aspect-ratio: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.label {
|
|
45
|
+
min-width: 0;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
flex: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.icon svg {
|
|
56
|
+
width: var(--cf-v2-button-icon-size);
|
|
57
|
+
height: var(--cf-v2-button-icon-size);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.spinner {
|
|
61
|
+
flex: none;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
width: var(--cf-v2-button-icon-size);
|
|
64
|
+
height: var(--cf-v2-button-icon-size);
|
|
65
|
+
border: var(--cf-v2-button-spinner-width) solid currentColor;
|
|
66
|
+
border-inline-end-color: transparent;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
animation: spin var(--cf-v2-button-spinner-duration) linear infinite;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.primary {
|
|
72
|
+
background: var(--cf-v2-action-primary);
|
|
73
|
+
color: var(--cf-v2-on-action-primary);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.primary:hover:not(:disabled, [aria-busy='true']) {
|
|
77
|
+
background: var(--cf-v2-action-primary-hover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.primary:active:not(:disabled, [aria-busy='true']) {
|
|
81
|
+
background: var(--cf-v2-action-primary-pressed);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.secondary {
|
|
85
|
+
border-color: var(--cf-v2-outline);
|
|
86
|
+
background: var(--cf-v2-surface-container);
|
|
87
|
+
color: var(--cf-v2-on-surface);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.secondary:hover:not(:disabled, [aria-busy='true']) {
|
|
91
|
+
background: var(--cf-v2-surface-container-hover);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.secondary:active:not(:disabled, [aria-busy='true']) {
|
|
95
|
+
background: var(--cf-v2-surface-container-pressed);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ghost {
|
|
99
|
+
background: transparent;
|
|
100
|
+
color: var(--cf-v2-on-surface);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ghost:hover:not(:disabled, [aria-busy='true']) {
|
|
104
|
+
background: var(--cf-v2-surface-container-hover);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ghost:active:not(:disabled, [aria-busy='true']) {
|
|
108
|
+
background: var(--cf-v2-surface-container-pressed);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.danger {
|
|
112
|
+
background: var(--cf-v2-error);
|
|
113
|
+
color: var(--cf-v2-on-error);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.danger:hover:not(:disabled, [aria-busy='true']) {
|
|
117
|
+
background: var(--cf-v2-error-hover);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.danger:active:not(:disabled, [aria-busy='true']) {
|
|
121
|
+
background: var(--cf-v2-error-pressed);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.button:focus-visible {
|
|
125
|
+
outline: var(--cf-v2-button-focus-width) solid var(--cf-v2-focus-ring);
|
|
126
|
+
outline-offset: var(--cf-v2-button-focus-offset);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.button[aria-busy='true'] {
|
|
130
|
+
cursor: progress;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.button:disabled {
|
|
134
|
+
background: var(--cf-v2-disabled);
|
|
135
|
+
opacity: var(--cf-v2-button-disabled-opacity);
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.button:disabled .label,
|
|
140
|
+
.button:disabled .icon {
|
|
141
|
+
opacity: var(--cf-v2-button-disabled-content-opacity);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@keyframes spin {
|
|
145
|
+
to {
|
|
146
|
+
transform: rotate(360deg);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media (prefers-reduced-motion: reduce) {
|
|
151
|
+
.button {
|
|
152
|
+
transition: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.spinner {
|
|
156
|
+
animation: none;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/actions/ButtonV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonV2 } from './ButtonV2';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
2
|
+
import { type HTMLAttributes, type ImgHTMLAttributes, type ReactNode } from 'react';
|
|
3
|
+
export type AvatarV2Size = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type AvatarV2Shape = 'circle' | 'rounded';
|
|
5
|
+
export type AvatarV2StatusTone = 'neutral' | 'success' | 'warning' | 'error';
|
|
6
|
+
type AvatarV2Base = Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'role' | 'aria-label' | 'aria-hidden'> & {
|
|
7
|
+
alt: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
initials?: string;
|
|
10
|
+
size?: AvatarV2Size;
|
|
11
|
+
shape?: AvatarV2Shape;
|
|
12
|
+
loading?: ImgHTMLAttributes<HTMLImageElement>['loading'];
|
|
13
|
+
};
|
|
14
|
+
export type AvatarV2Props = AvatarV2Base & ({
|
|
15
|
+
statusTone?: undefined;
|
|
16
|
+
statusLabel?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
statusTone: AvatarV2StatusTone;
|
|
19
|
+
statusLabel: string;
|
|
20
|
+
});
|
|
21
|
+
export type AvatarGroupV2Props = Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-label' | 'aria-labelledby'> & {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
size?: AvatarV2Size;
|
|
24
|
+
max?: number;
|
|
25
|
+
moreLabel?: (count: number) => string;
|
|
26
|
+
} & ({
|
|
27
|
+
'aria-label': string;
|
|
28
|
+
'aria-labelledby'?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
'aria-label'?: undefined;
|
|
31
|
+
'aria-labelledby': string;
|
|
32
|
+
});
|
|
33
|
+
export declare const AvatarV2: import("react").ForwardRefExoticComponent<AvatarV2Props & import("react").RefAttributes<HTMLSpanElement>>;
|
|
34
|
+
export declare const AvatarGroupV2: import("react").ForwardRefExoticComponent<AvatarGroupV2Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=AvatarV2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarV2.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/data-display/AvatarV2/AvatarV2.tsx"],"names":[],"mappings":"AAAA,OAAO,oDAAoD,CAAC;AAE5D,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AACjD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7E,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,GAAG;IAC9G,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,YAAY,GACtC,CAAC;IAAE,UAAU,CAAC,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,kBAAkB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB,CAAC,GAAG;IACjH,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACvC,GAAG,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,YAAY,CAAC,EAAE,SAAS,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAExH,eAAO,MAAM,QAAQ,2GA2CnB,CAAC;AAEH,eAAO,MAAM,aAAa,+GAwBxB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import '@corefoundry-labs/forge-tokens/theme-v2/tokens.css';
|
|
3
|
+
import { User } from '@corefoundry-labs/forge-icons';
|
|
4
|
+
import { Children, cloneElement, forwardRef, isValidElement, useState, } from 'react';
|
|
5
|
+
import styles from './AvatarV2.module.css';
|
|
6
|
+
export const AvatarV2 = forwardRef(function AvatarV2({ alt, src, initials, size = 'sm', shape = 'circle', loading, statusTone, statusLabel, className, ...props }, ref) {
|
|
7
|
+
const [loaded, setLoaded] = useState(null);
|
|
8
|
+
const [failed, setFailed] = useState(null);
|
|
9
|
+
const usable = src ? src !== failed : false;
|
|
10
|
+
const visible = usable && src === loaded;
|
|
11
|
+
const name = [alt, statusLabel].filter(Boolean).join(', ');
|
|
12
|
+
const content = visible ? 'image' : initials ? 'initials' : 'fallback';
|
|
13
|
+
return (_jsxs("span", { ...props, ref: ref, role: name ? 'img' : undefined, "aria-label": name || undefined, "aria-hidden": name ? undefined : true, "data-size": size, "data-shape": shape, "data-content": content, className: [styles.avatar, styles[size], styles[shape], className].filter(Boolean).join(' '), children: [_jsxs("span", { className: styles.surface, children: [content === 'initials' && _jsx("span", { className: styles.initials, children: initials }), content === 'fallback' && _jsx(User, { className: styles.glyph, "aria-hidden": "true" }), usable && (_jsx("img", { ref: (node) => {
|
|
14
|
+
if (node?.complete && node.naturalWidth > 0)
|
|
15
|
+
setLoaded(src);
|
|
16
|
+
}, className: [styles.image, visible && styles.visible].filter(Boolean).join(' '), src: src, alt: "", loading: loading, onLoad: () => setLoaded(src), onError: () => setFailed(src) }))] }), statusTone && _jsx("span", { className: [styles.status, styles[statusTone]].join(' '), "data-status": statusTone })] }));
|
|
17
|
+
});
|
|
18
|
+
export const AvatarGroupV2 = forwardRef(function AvatarGroupV2({ children, size = 'sm', max, moreLabel = (count) => `${count} more`, className, ...props }, ref) {
|
|
19
|
+
const items = Children.toArray(children).filter((child) => isValidElement(child));
|
|
20
|
+
const shown = max !== undefined && max >= 0 ? items.slice(0, max) : items;
|
|
21
|
+
const hidden = items.length - shown.length;
|
|
22
|
+
return (_jsxs("div", { ...props, ref: ref, role: "group", "data-size": size, className: [styles.group, styles[`group-${size}`], className].filter(Boolean).join(' '), children: [shown.map((item) => cloneElement(item, { size })), hidden > 0 && (_jsxs("span", { role: "img", "aria-label": moreLabel(hidden), className: [styles.avatar, styles[size], styles.count].join(' '), children: ["+", hidden] }))] }));
|
|
23
|
+
});
|