@lux-design-system/web-components-react 1.0.0-alpha.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.md +288 -0
- package/README.md +31 -0
- package/dist/components.d.ts +15 -0
- package/dist/components.js +19 -0
- package/dist/components.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/react-component-lib/createComponent.d.ts +10 -0
- package/dist/react-component-lib/createComponent.js +75 -0
- package/dist/react-component-lib/createComponent.js.map +1 -0
- package/dist/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/react-component-lib/createOverlayComponent.js +109 -0
- package/dist/react-component-lib/createOverlayComponent.js.map +1 -0
- package/dist/react-component-lib/index.d.ts +2 -0
- package/dist/react-component-lib/index.js +3 -0
- package/dist/react-component-lib/index.js.map +1 -0
- package/dist/react-component-lib/interfaces.d.ts +29 -0
- package/dist/react-component-lib/interfaces.js +2 -0
- package/dist/react-component-lib/interfaces.js.map +1 -0
- package/dist/react-component-lib/utils/attachProps.d.ts +16 -0
- package/dist/react-component-lib/utils/attachProps.js +108 -0
- package/dist/react-component-lib/utils/attachProps.js.map +1 -0
- package/dist/react-component-lib/utils/case.d.ts +2 -0
- package/dist/react-component-lib/utils/case.js +7 -0
- package/dist/react-component-lib/utils/case.js.map +1 -0
- package/dist/react-component-lib/utils/dev.d.ts +2 -0
- package/dist/react-component-lib/utils/dev.js +13 -0
- package/dist/react-component-lib/utils/dev.js.map +1 -0
- package/dist/react-component-lib/utils/index.d.ts +10 -0
- package/dist/react-component-lib/utils/index.js +32 -0
- package/dist/react-component-lib/utils/index.js.map +1 -0
- package/package.json +45 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# EUROPEAN UNION PUBLIC LICENCE v. 1.2
|
|
2
|
+
|
|
3
|
+
EUPL © the European Union 2007, 2016
|
|
4
|
+
|
|
5
|
+
This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
|
|
6
|
+
below) which is provided under the terms of this Licence. Any use of the Work,
|
|
7
|
+
other than as authorised under this Licence is prohibited (to the extent such
|
|
8
|
+
use is covered by a right of the copyright holder of the Work).
|
|
9
|
+
|
|
10
|
+
The Work is provided under the terms of this Licence when the Licensor (as
|
|
11
|
+
defined below) has placed the following notice immediately following the
|
|
12
|
+
copyright notice for the Work:
|
|
13
|
+
|
|
14
|
+
Licensed under the EUPL
|
|
15
|
+
|
|
16
|
+
or has expressed by any other means his willingness to license under the EUPL.
|
|
17
|
+
|
|
18
|
+
## 1. Definitions
|
|
19
|
+
|
|
20
|
+
In this Licence, the following terms have the following meaning:
|
|
21
|
+
|
|
22
|
+
- ‘The Licence’: this Licence.
|
|
23
|
+
|
|
24
|
+
- ‘The Original Work’: the work or software distributed or communicated by the
|
|
25
|
+
Licensor under this Licence, available as Source Code and also as Executable
|
|
26
|
+
Code as the case may be.
|
|
27
|
+
|
|
28
|
+
- ‘Derivative Works’: the works or software that could be created by the
|
|
29
|
+
Licensee, based upon the Original Work or modifications thereof. This Licence
|
|
30
|
+
does not define the extent of modification or dependence on the Original Work
|
|
31
|
+
required in order to classify a work as a Derivative Work; this extent is
|
|
32
|
+
determined by copyright law applicable in the country mentioned in Article 15.
|
|
33
|
+
|
|
34
|
+
- ‘The Work’: the Original Work or its Derivative Works.
|
|
35
|
+
|
|
36
|
+
- ‘The Source Code’: the human-readable form of the Work which is the most
|
|
37
|
+
convenient for people to study and modify.
|
|
38
|
+
|
|
39
|
+
- ‘The Executable Code’: any code which has generally been compiled and which is
|
|
40
|
+
meant to be interpreted by a computer as a program.
|
|
41
|
+
|
|
42
|
+
- ‘The Licensor’: the natural or legal person that distributes or communicates
|
|
43
|
+
the Work under the Licence.
|
|
44
|
+
|
|
45
|
+
- ‘Contributor(s)’: any natural or legal person who modifies the Work under the
|
|
46
|
+
Licence, or otherwise contributes to the creation of a Derivative Work.
|
|
47
|
+
|
|
48
|
+
- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
|
|
49
|
+
the Work under the terms of the Licence.
|
|
50
|
+
|
|
51
|
+
- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
|
|
52
|
+
renting, distributing, communicating, transmitting, or otherwise making
|
|
53
|
+
available, online or offline, copies of the Work or providing access to its
|
|
54
|
+
essential functionalities at the disposal of any other natural or legal
|
|
55
|
+
person.
|
|
56
|
+
|
|
57
|
+
## 2. Scope of the rights granted by the Licence
|
|
58
|
+
|
|
59
|
+
The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
|
60
|
+
sublicensable licence to do the following, for the duration of copyright vested
|
|
61
|
+
in the Original Work:
|
|
62
|
+
|
|
63
|
+
- use the Work in any circumstance and for all usage,
|
|
64
|
+
- reproduce the Work,
|
|
65
|
+
- modify the Work, and make Derivative Works based upon the Work,
|
|
66
|
+
- communicate to the public, including the right to make available or display
|
|
67
|
+
the Work or copies thereof to the public and perform publicly, as the case may
|
|
68
|
+
be, the Work,
|
|
69
|
+
- distribute the Work or copies thereof,
|
|
70
|
+
- lend and rent the Work or copies thereof,
|
|
71
|
+
- sublicense rights in the Work or copies thereof.
|
|
72
|
+
|
|
73
|
+
Those rights can be exercised on any media, supports and formats, whether now
|
|
74
|
+
known or later invented, as far as the applicable law permits so.
|
|
75
|
+
|
|
76
|
+
In the countries where moral rights apply, the Licensor waives his right to
|
|
77
|
+
exercise his moral right to the extent allowed by law in order to make effective
|
|
78
|
+
the licence of the economic rights here above listed.
|
|
79
|
+
|
|
80
|
+
The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
|
|
81
|
+
any patents held by the Licensor, to the extent necessary to make use of the
|
|
82
|
+
rights granted on the Work under this Licence.
|
|
83
|
+
|
|
84
|
+
## 3. Communication of the Source Code
|
|
85
|
+
|
|
86
|
+
The Licensor may provide the Work either in its Source Code form, or as
|
|
87
|
+
Executable Code. If the Work is provided as Executable Code, the Licensor
|
|
88
|
+
provides in addition a machine-readable copy of the Source Code of the Work
|
|
89
|
+
along with each copy of the Work that the Licensor distributes or indicates, in
|
|
90
|
+
a notice following the copyright notice attached to the Work, a repository where
|
|
91
|
+
the Source Code is easily and freely accessible for as long as the Licensor
|
|
92
|
+
continues to distribute or communicate the Work.
|
|
93
|
+
|
|
94
|
+
## 4. Limitations on copyright
|
|
95
|
+
|
|
96
|
+
Nothing in this Licence is intended to deprive the Licensee of the benefits from
|
|
97
|
+
any exception or limitation to the exclusive rights of the rights owners in the
|
|
98
|
+
Work, of the exhaustion of those rights or of other applicable limitations
|
|
99
|
+
thereto.
|
|
100
|
+
|
|
101
|
+
## 5. Obligations of the Licensee
|
|
102
|
+
|
|
103
|
+
The grant of the rights mentioned above is subject to some restrictions and
|
|
104
|
+
obligations imposed on the Licensee. Those obligations are the following:
|
|
105
|
+
|
|
106
|
+
Attribution right: The Licensee shall keep intact all copyright, patent or
|
|
107
|
+
trademarks notices and all notices that refer to the Licence and to the
|
|
108
|
+
disclaimer of warranties. The Licensee must include a copy of such notices and a
|
|
109
|
+
copy of the Licence with every copy of the Work he/she distributes or
|
|
110
|
+
communicates. The Licensee must cause any Derivative Work to carry prominent
|
|
111
|
+
notices stating that the Work has been modified and the date of modification.
|
|
112
|
+
|
|
113
|
+
Copyleft clause: If the Licensee distributes or communicates copies of the
|
|
114
|
+
Original Works or Derivative Works, this Distribution or Communication will be
|
|
115
|
+
done under the terms of this Licence or of a later version of this Licence
|
|
116
|
+
unless the Original Work is expressly distributed only under this version of the
|
|
117
|
+
Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
|
|
118
|
+
(becoming Licensor) cannot offer or impose any additional terms or conditions on
|
|
119
|
+
the Work or Derivative Work that alter or restrict the terms of the Licence.
|
|
120
|
+
|
|
121
|
+
Compatibility clause: If the Licensee Distributes or Communicates Derivative
|
|
122
|
+
Works or copies thereof based upon both the Work and another work licensed under
|
|
123
|
+
a Compatible Licence, this Distribution or Communication can be done under the
|
|
124
|
+
terms of this Compatible Licence. For the sake of this clause, ‘Compatible
|
|
125
|
+
Licence’ refers to the licences listed in the appendix attached to this Licence.
|
|
126
|
+
Should the Licensee's obligations under the Compatible Licence conflict with
|
|
127
|
+
his/her obligations under this Licence, the obligations of the Compatible
|
|
128
|
+
Licence shall prevail.
|
|
129
|
+
|
|
130
|
+
Provision of Source Code: When distributing or communicating copies of the Work,
|
|
131
|
+
the Licensee will provide a machine-readable copy of the Source Code or indicate
|
|
132
|
+
a repository where this Source will be easily and freely available for as long
|
|
133
|
+
as the Licensee continues to distribute or communicate the Work.
|
|
134
|
+
|
|
135
|
+
Legal Protection: This Licence does not grant permission to use the trade names,
|
|
136
|
+
trademarks, service marks, or names of the Licensor, except as required for
|
|
137
|
+
reasonable and customary use in describing the origin of the Work and
|
|
138
|
+
reproducing the content of the copyright notice.
|
|
139
|
+
|
|
140
|
+
## 6. Chain of Authorship
|
|
141
|
+
|
|
142
|
+
The original Licensor warrants that the copyright in the Original Work granted
|
|
143
|
+
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
|
144
|
+
power and authority to grant the Licence.
|
|
145
|
+
|
|
146
|
+
Each Contributor warrants that the copyright in the modifications he/she brings
|
|
147
|
+
to the Work are owned by him/her or licensed to him/her and that he/she has the
|
|
148
|
+
power and authority to grant the Licence.
|
|
149
|
+
|
|
150
|
+
Each time You accept the Licence, the original Licensor and subsequent
|
|
151
|
+
Contributors grant You a licence to their contributions to the Work, under the
|
|
152
|
+
terms of this Licence.
|
|
153
|
+
|
|
154
|
+
## 7. Disclaimer of Warranty
|
|
155
|
+
|
|
156
|
+
The Work is a work in progress, which is continuously improved by numerous
|
|
157
|
+
Contributors. It is not a finished work and may therefore contain defects or
|
|
158
|
+
‘bugs’ inherent to this type of development.
|
|
159
|
+
|
|
160
|
+
For the above reason, the Work is provided under the Licence on an ‘as is’ basis
|
|
161
|
+
and without warranties of any kind concerning the Work, including without
|
|
162
|
+
limitation merchantability, fitness for a particular purpose, absence of defects
|
|
163
|
+
or errors, accuracy, non-infringement of intellectual property rights other than
|
|
164
|
+
copyright as stated in Article 6 of this Licence.
|
|
165
|
+
|
|
166
|
+
This disclaimer of warranty is an essential part of the Licence and a condition
|
|
167
|
+
for the grant of any rights to the Work.
|
|
168
|
+
|
|
169
|
+
## 8. Disclaimer of Liability
|
|
170
|
+
|
|
171
|
+
Except in the cases of wilful misconduct or damages directly caused to natural
|
|
172
|
+
persons, the Licensor will in no event be liable for any direct or indirect,
|
|
173
|
+
material or moral, damages of any kind, arising out of the Licence or of the use
|
|
174
|
+
of the Work, including without limitation, damages for loss of goodwill, work
|
|
175
|
+
stoppage, computer failure or malfunction, loss of data or any commercial
|
|
176
|
+
damage, even if the Licensor has been advised of the possibility of such damage.
|
|
177
|
+
However, the Licensor will be liable under statutory product liability laws as
|
|
178
|
+
far such laws apply to the Work.
|
|
179
|
+
|
|
180
|
+
## 9. Additional agreements
|
|
181
|
+
|
|
182
|
+
While distributing the Work, You may choose to conclude an additional agreement,
|
|
183
|
+
defining obligations or services consistent with this Licence. However, if
|
|
184
|
+
accepting obligations, You may act only on your own behalf and on your sole
|
|
185
|
+
responsibility, not on behalf of the original Licensor or any other Contributor,
|
|
186
|
+
and only if You agree to indemnify, defend, and hold each Contributor harmless
|
|
187
|
+
for any liability incurred by, or claims asserted against such Contributor by
|
|
188
|
+
the fact You have accepted any warranty or additional liability.
|
|
189
|
+
|
|
190
|
+
## 10. Acceptance of the Licence
|
|
191
|
+
|
|
192
|
+
The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
|
|
193
|
+
placed under the bottom of a window displaying the text of this Licence or by
|
|
194
|
+
affirming consent in any other similar way, in accordance with the rules of
|
|
195
|
+
applicable law. Clicking on that icon indicates your clear and irrevocable
|
|
196
|
+
acceptance of this Licence and all of its terms and conditions.
|
|
197
|
+
|
|
198
|
+
Similarly, you irrevocably accept this Licence and all of its terms and
|
|
199
|
+
conditions by exercising any rights granted to You by Article 2 of this Licence,
|
|
200
|
+
such as the use of the Work, the creation by You of a Derivative Work or the
|
|
201
|
+
Distribution or Communication by You of the Work or copies thereof.
|
|
202
|
+
|
|
203
|
+
## 11. Information to the public
|
|
204
|
+
|
|
205
|
+
In case of any Distribution or Communication of the Work by means of electronic
|
|
206
|
+
communication by You (for example, by offering to download the Work from a
|
|
207
|
+
remote location) the distribution channel or media (for example, a website) must
|
|
208
|
+
at least provide to the public the information requested by the applicable law
|
|
209
|
+
regarding the Licensor, the Licence and the way it may be accessible, concluded,
|
|
210
|
+
stored and reproduced by the Licensee.
|
|
211
|
+
|
|
212
|
+
## 12. Termination of the Licence
|
|
213
|
+
|
|
214
|
+
The Licence and the rights granted hereunder will terminate automatically upon
|
|
215
|
+
any breach by the Licensee of the terms of the Licence.
|
|
216
|
+
|
|
217
|
+
Such a termination will not terminate the licences of any person who has
|
|
218
|
+
received the Work from the Licensee under the Licence, provided such persons
|
|
219
|
+
remain in full compliance with the Licence.
|
|
220
|
+
|
|
221
|
+
## 13. Miscellaneous
|
|
222
|
+
|
|
223
|
+
Without prejudice of Article 9 above, the Licence represents the complete
|
|
224
|
+
agreement between the Parties as to the Work.
|
|
225
|
+
|
|
226
|
+
If any provision of the Licence is invalid or unenforceable under applicable
|
|
227
|
+
law, this will not affect the validity or enforceability of the Licence as a
|
|
228
|
+
whole. Such provision will be construed or reformed so as necessary to make it
|
|
229
|
+
valid and enforceable.
|
|
230
|
+
|
|
231
|
+
The European Commission may publish other linguistic versions or new versions of
|
|
232
|
+
this Licence or updated versions of the Appendix, so far this is required and
|
|
233
|
+
reasonable, without reducing the scope of the rights granted by the Licence. New
|
|
234
|
+
versions of the Licence will be published with a unique version number.
|
|
235
|
+
|
|
236
|
+
All linguistic versions of this Licence, approved by the European Commission,
|
|
237
|
+
have identical value. Parties can take advantage of the linguistic version of
|
|
238
|
+
their choice.
|
|
239
|
+
|
|
240
|
+
## 14. Jurisdiction
|
|
241
|
+
|
|
242
|
+
Without prejudice to specific agreement between parties,
|
|
243
|
+
|
|
244
|
+
- any litigation resulting from the interpretation of this License, arising
|
|
245
|
+
between the European Union institutions, bodies, offices or agencies, as a
|
|
246
|
+
Licensor, and any Licensee, will be subject to the jurisdiction of the Court
|
|
247
|
+
of Justice of the European Union, as laid down in article 272 of the Treaty on
|
|
248
|
+
the Functioning of the European Union,
|
|
249
|
+
|
|
250
|
+
- any litigation arising between other parties and resulting from the
|
|
251
|
+
interpretation of this License, will be subject to the exclusive jurisdiction
|
|
252
|
+
of the competent court where the Licensor resides or conducts its primary
|
|
253
|
+
business.
|
|
254
|
+
|
|
255
|
+
## 15. Applicable Law
|
|
256
|
+
|
|
257
|
+
Without prejudice to specific agreement between parties,
|
|
258
|
+
|
|
259
|
+
- this Licence shall be governed by the law of the European Union Member State
|
|
260
|
+
where the Licensor has his seat, resides or has his registered office,
|
|
261
|
+
|
|
262
|
+
- this licence shall be governed by Belgian law if the Licensor has no seat,
|
|
263
|
+
residence or registered office inside a European Union Member State.
|
|
264
|
+
|
|
265
|
+
## Appendix
|
|
266
|
+
|
|
267
|
+
‘Compatible Licences’ according to Article 5 EUPL are:
|
|
268
|
+
|
|
269
|
+
- GNU General Public License (GPL) v. 2, v. 3
|
|
270
|
+
- GNU Affero General Public License (AGPL) v. 3
|
|
271
|
+
- Open Software License (OSL) v. 2.1, v. 3.0
|
|
272
|
+
- Eclipse Public License (EPL) v. 1.0
|
|
273
|
+
- CeCILL v. 2.0, v. 2.1
|
|
274
|
+
- Mozilla Public Licence (MPL) v. 2
|
|
275
|
+
- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
|
276
|
+
- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
|
|
277
|
+
works other than software
|
|
278
|
+
- European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
|
279
|
+
- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
|
|
280
|
+
Reciprocity (LiLiQ-R+).
|
|
281
|
+
|
|
282
|
+
The European Commission may update this Appendix to later versions of the above
|
|
283
|
+
licences without producing a new version of the EUPL, as long as they provide
|
|
284
|
+
the rights granted in Article 2 of this Licence and protect the covered Source
|
|
285
|
+
Code from exclusive appropriation.
|
|
286
|
+
|
|
287
|
+
All other changes or additions to this Appendix require the production of a new
|
|
288
|
+
EUPL version.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Web Components in React
|
|
2
|
+
|
|
3
|
+
Deze package bevat de React wrapper voor de Web components van het LUX Design System.
|
|
4
|
+
|
|
5
|
+
## Installeren
|
|
6
|
+
|
|
7
|
+
Installeer beide packages om de React web components in je project te gebruiken:
|
|
8
|
+
|
|
9
|
+
### NPM
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install --save-dev --save-exact \
|
|
13
|
+
@lux-design-system/web-component-library-react \
|
|
14
|
+
@lux-design-system/web-component-library-stencil
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Yarn
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
yarn add install --dev --exact \
|
|
21
|
+
@lux-design-system/web-component-library-react \
|
|
22
|
+
@lux-design-system/web-component-library-stencil
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### PNPM
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pnpm add --save-dev --save-exact \
|
|
29
|
+
@lux-design-system/web-component-library-react \
|
|
30
|
+
@lux-design-system/web-component-library-stencil
|
|
31
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from '@lux-design-system/web-components-stencil';
|
|
2
|
+
export declare const LuxAlert: import("react").ForwardRefExoticComponent<JSX.LuxAlert & Omit<import("react").HTMLAttributes<HTMLLuxAlertElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxAlertElement>>;
|
|
3
|
+
export declare const LuxButton: import("react").ForwardRefExoticComponent<JSX.LuxButton & Omit<import("react").HTMLAttributes<HTMLLuxButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxButtonElement>>;
|
|
4
|
+
export declare const LuxIconChevronLeft: import("react").ForwardRefExoticComponent<JSX.LuxIconChevronLeft & Omit<import("react").HTMLAttributes<HTMLLuxIconChevronLeftElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconChevronLeftElement>>;
|
|
5
|
+
export declare const LuxIconChevronRight: import("react").ForwardRefExoticComponent<JSX.LuxIconChevronRight & Omit<import("react").HTMLAttributes<HTMLLuxIconChevronRightElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconChevronRightElement>>;
|
|
6
|
+
export declare const LuxIconError: import("react").ForwardRefExoticComponent<JSX.LuxIconError & Omit<import("react").HTMLAttributes<HTMLLuxIconErrorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconErrorElement>>;
|
|
7
|
+
export declare const LuxIconInfo: import("react").ForwardRefExoticComponent<JSX.LuxIconInfo & Omit<import("react").HTMLAttributes<HTMLLuxIconInfoElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconInfoElement>>;
|
|
8
|
+
export declare const LuxIconLogoDigid: import("react").ForwardRefExoticComponent<JSX.LuxIconLogoDigid & Omit<import("react").HTMLAttributes<HTMLLuxIconLogoDigidElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconLogoDigidElement>>;
|
|
9
|
+
export declare const LuxIconLogoEherkenning: import("react").ForwardRefExoticComponent<JSX.LuxIconLogoEherkenning & Omit<import("react").HTMLAttributes<HTMLLuxIconLogoEherkenningElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconLogoEherkenningElement>>;
|
|
10
|
+
export declare const LuxIconLogoEidas: import("react").ForwardRefExoticComponent<JSX.LuxIconLogoEidas & Omit<import("react").HTMLAttributes<HTMLLuxIconLogoEidasElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconLogoEidasElement>>;
|
|
11
|
+
export declare const LuxIconMail: import("react").ForwardRefExoticComponent<JSX.LuxIconMail & Omit<import("react").HTMLAttributes<HTMLLuxIconMailElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconMailElement>>;
|
|
12
|
+
export declare const LuxIconSuccess: import("react").ForwardRefExoticComponent<JSX.LuxIconSuccess & Omit<import("react").HTMLAttributes<HTMLLuxIconSuccessElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconSuccessElement>>;
|
|
13
|
+
export declare const LuxIconWarning: import("react").ForwardRefExoticComponent<JSX.LuxIconWarning & Omit<import("react").HTMLAttributes<HTMLLuxIconWarningElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxIconWarningElement>>;
|
|
14
|
+
export declare const LuxLoginLink: import("react").ForwardRefExoticComponent<JSX.LuxLoginLink & Omit<import("react").HTMLAttributes<HTMLLuxLoginLinkElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxLoginLinkElement>>;
|
|
15
|
+
export declare const LuxParagraph: import("react").ForwardRefExoticComponent<JSX.LuxParagraph & Omit<import("react").HTMLAttributes<HTMLLuxParagraphElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLLuxParagraphElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* auto-generated react proxies */
|
|
4
|
+
import { createReactComponent } from './react-component-lib';
|
|
5
|
+
export const LuxAlert = /*@__PURE__*/ createReactComponent('lux-alert');
|
|
6
|
+
export const LuxButton = /*@__PURE__*/ createReactComponent('lux-button');
|
|
7
|
+
export const LuxIconChevronLeft = /*@__PURE__*/ createReactComponent('lux-icon-chevron-left');
|
|
8
|
+
export const LuxIconChevronRight = /*@__PURE__*/ createReactComponent('lux-icon-chevron-right');
|
|
9
|
+
export const LuxIconError = /*@__PURE__*/ createReactComponent('lux-icon-error');
|
|
10
|
+
export const LuxIconInfo = /*@__PURE__*/ createReactComponent('lux-icon-info');
|
|
11
|
+
export const LuxIconLogoDigid = /*@__PURE__*/ createReactComponent('lux-icon-logo-digid');
|
|
12
|
+
export const LuxIconLogoEherkenning = /*@__PURE__*/ createReactComponent('lux-icon-logo-eherkenning');
|
|
13
|
+
export const LuxIconLogoEidas = /*@__PURE__*/ createReactComponent('lux-icon-logo-eidas');
|
|
14
|
+
export const LuxIconMail = /*@__PURE__*/ createReactComponent('lux-icon-mail');
|
|
15
|
+
export const LuxIconSuccess = /*@__PURE__*/ createReactComponent('lux-icon-success');
|
|
16
|
+
export const LuxIconWarning = /*@__PURE__*/ createReactComponent('lux-icon-warning');
|
|
17
|
+
export const LuxLoginLink = /*@__PURE__*/ createReactComponent('lux-login-link');
|
|
18
|
+
export const LuxParagraph = /*@__PURE__*/ createReactComponent('lux-paragraph');
|
|
19
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB,kCAAkC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAM7D,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAA,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAA,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAA,oBAAoB,CAAwD,uBAAuB,CAAC,CAAC;AACpJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAA,oBAAoB,CAA0D,wBAAwB,CAAC,CAAC;AACxJ,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA,oBAAoB,CAA0C,eAAe,CAAC,CAAC;AACvH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAA,oBAAoB,CAAoD,qBAAqB,CAAC,CAAC;AAC5I,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAA,oBAAoB,CAAgE,2BAA2B,CAAC,CAAC;AACpK,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAA,oBAAoB,CAAoD,qBAAqB,CAAC,CAAC;AAC5I,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA,oBAAoB,CAA0C,eAAe,CAAC,CAAC;AACvH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAA,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAA,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,gBAAgB,CAAC,CAAC;AAC3H,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAA,oBAAoB,CAA4C,eAAe,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HTMLStencilElement extends HTMLElement {
|
|
3
|
+
componentOnReady(): Promise<this>;
|
|
4
|
+
}
|
|
5
|
+
interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
|
|
6
|
+
forwardedRef: React.RefObject<ElementType>;
|
|
7
|
+
ref?: React.Ref<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { createElement } from 'react';
|
|
13
|
+
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
14
|
+
export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
15
|
+
if (defineCustomElement !== undefined) {
|
|
16
|
+
defineCustomElement();
|
|
17
|
+
}
|
|
18
|
+
const displayName = dashToPascalCase(tagName);
|
|
19
|
+
const ReactComponent = class extends React.Component {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.setComponentElRef = (element) => {
|
|
23
|
+
this.componentEl = element;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
componentDidMount() {
|
|
27
|
+
this.componentDidUpdate(this.props);
|
|
28
|
+
}
|
|
29
|
+
componentDidUpdate(prevProps) {
|
|
30
|
+
attachProps(this.componentEl, this.props, prevProps);
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
34
|
+
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
35
|
+
const value = cProps[name];
|
|
36
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
37
|
+
const eventName = name.substring(2).toLowerCase();
|
|
38
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
39
|
+
acc[name] = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// we should only render strings, booleans, and numbers as attrs in html.
|
|
44
|
+
// objects, functions, arrays etc get synced via properties on mount.
|
|
45
|
+
const type = typeof value;
|
|
46
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
47
|
+
acc[camelToDashCase(name)] = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return acc;
|
|
51
|
+
}, {});
|
|
52
|
+
if (manipulatePropsFunction) {
|
|
53
|
+
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
54
|
+
}
|
|
55
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
56
|
+
/**
|
|
57
|
+
* We use createElement here instead of
|
|
58
|
+
* React.createElement to work around a
|
|
59
|
+
* bug in Vite (https://github.com/vitejs/vite/issues/6104).
|
|
60
|
+
* React.createElement causes all elements to be rendered
|
|
61
|
+
* as <tagname> instead of the actual Web Component.
|
|
62
|
+
*/
|
|
63
|
+
return createElement(tagName, newProps, children);
|
|
64
|
+
}
|
|
65
|
+
static get displayName() {
|
|
66
|
+
return displayName;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
70
|
+
if (ReactComponentContext) {
|
|
71
|
+
ReactComponent.contextType = ReactComponentContext;
|
|
72
|
+
}
|
|
73
|
+
return createForwardRef(ReactComponent, displayName);
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=createComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../src/react-component-lib/createComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAMlC,OAAe,EACf,qBAAuD,EACvD,uBAGuB,EACvB,mBAAgC,EAChC,EAAE;IACF,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACtC,mBAAmB,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,KAAM,SAAQ,KAAK,CAAC,SAAiD;QAO1F,YAAY,KAA6C;YACvD,KAAK,CAAC,KAAK,CAAC,CAAC;YALf,sBAAiB,GAAG,CAAC,OAAoB,EAAE,EAAE;gBAC3C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC7B,CAAC,CAAC;QAIF,CAAC;QAED,iBAAiB;YACf,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;QAED,kBAAkB,CAAC,SAAiD;YAClE,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,E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AM,QAAQ,mCACT,WAAW,KACd,GAAG,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,EACpD,KAAK,GACN,CAAC;YAEF;;;;;;eAMG;YACH,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,WAAW;YACpB,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,iGAAiG;IACjG,IAAI,qBAAqB,EAAE,CAAC;QAC1B,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverlayEventDetail } from './interfaces';
|
|
3
|
+
import { StencilReactForwardedRef } from './utils';
|
|
4
|
+
interface OverlayElement extends HTMLElement {
|
|
5
|
+
present: () => Promise<void>;
|
|
6
|
+
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export interface ReactOverlayProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
12
|
+
onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
13
|
+
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
14
|
+
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
|
|
17
|
+
create: (options: any) => Promise<OverlayType>;
|
|
18
|
+
}, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
19
|
+
forwardedRef?: StencilReactForwardedRef<OverlayType>;
|
|
20
|
+
}> & React.RefAttributes<OverlayType>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
11
|
+
var t = {};
|
|
12
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
+
t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
+
t[p[i]] = s[p[i]];
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
};
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import ReactDOM from 'react-dom';
|
|
23
|
+
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
24
|
+
export const createOverlayComponent = (tagName, controller, customElement) => {
|
|
25
|
+
defineCustomElement(tagName, customElement);
|
|
26
|
+
const displayName = dashToPascalCase(tagName);
|
|
27
|
+
const didDismissEventName = `on${displayName}DidDismiss`;
|
|
28
|
+
const didPresentEventName = `on${displayName}DidPresent`;
|
|
29
|
+
const willDismissEventName = `on${displayName}WillDismiss`;
|
|
30
|
+
const willPresentEventName = `on${displayName}WillPresent`;
|
|
31
|
+
let isDismissing = false;
|
|
32
|
+
class Overlay extends React.Component {
|
|
33
|
+
constructor(props) {
|
|
34
|
+
super(props);
|
|
35
|
+
if (typeof document !== 'undefined') {
|
|
36
|
+
this.el = document.createElement('div');
|
|
37
|
+
}
|
|
38
|
+
this.handleDismiss = this.handleDismiss.bind(this);
|
|
39
|
+
}
|
|
40
|
+
static get displayName() {
|
|
41
|
+
return displayName;
|
|
42
|
+
}
|
|
43
|
+
componentDidMount() {
|
|
44
|
+
if (this.props.isOpen) {
|
|
45
|
+
this.present();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
componentWillUnmount() {
|
|
49
|
+
if (this.overlay) {
|
|
50
|
+
this.overlay.dismiss();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
handleDismiss(event) {
|
|
54
|
+
if (this.props.onDidDismiss) {
|
|
55
|
+
this.props.onDidDismiss(event);
|
|
56
|
+
}
|
|
57
|
+
setRef(this.props.forwardedRef, null);
|
|
58
|
+
}
|
|
59
|
+
shouldComponentUpdate(nextProps) {
|
|
60
|
+
// Check if the overlay component is about to dismiss
|
|
61
|
+
if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
|
|
62
|
+
isDismissing = true;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
componentDidUpdate(prevProps) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (this.overlay) {
|
|
69
|
+
attachProps(this.overlay, this.props, prevProps);
|
|
70
|
+
}
|
|
71
|
+
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
|
|
72
|
+
this.present(prevProps);
|
|
73
|
+
}
|
|
74
|
+
if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
|
|
75
|
+
yield this.overlay.dismiss();
|
|
76
|
+
isDismissing = false;
|
|
77
|
+
/**
|
|
78
|
+
* Now that the overlay is dismissed
|
|
79
|
+
* we need to render again so that any
|
|
80
|
+
* inner components will be unmounted
|
|
81
|
+
*/
|
|
82
|
+
this.forceUpdate();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
present(prevProps) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
|
|
89
|
+
const elementProps = Object.assign(Object.assign({}, cProps), { ref: this.props.forwardedRef, [didDismissEventName]: this.handleDismiss, [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e), [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e), [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e) });
|
|
90
|
+
this.overlay = yield controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
|
|
91
|
+
setRef(this.props.forwardedRef, this.overlay);
|
|
92
|
+
attachProps(this.overlay, elementProps, prevProps);
|
|
93
|
+
yield this.overlay.present();
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
/**
|
|
98
|
+
* Continue to render the component even when
|
|
99
|
+
* overlay is dismissing otherwise component
|
|
100
|
+
* will be hidden before animation is done.
|
|
101
|
+
*/
|
|
102
|
+
return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return React.forwardRef((props, ref) => {
|
|
106
|
+
return React.createElement(Overlay, Object.assign({}, props, { forwardedRef: ref }));
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=createOverlayComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOver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IG;YACH,OAAO,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;KACF;IAED,OAAO,KAAK,CAAC,UAAU,CAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACzD,OAAO,oBAAC,OAAO,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface EventEmitter<T = any> {
|
|
2
|
+
emit: (data?: T) => CustomEvent<T>;
|
|
3
|
+
}
|
|
4
|
+
export interface StyleReactProps {
|
|
5
|
+
class?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface OverlayEventDetail<T = any> {
|
|
12
|
+
data?: T;
|
|
13
|
+
role?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface OverlayInterface {
|
|
16
|
+
el: HTMLElement;
|
|
17
|
+
animated: boolean;
|
|
18
|
+
keyboardClose: boolean;
|
|
19
|
+
overlayIndex: number;
|
|
20
|
+
presented: boolean;
|
|
21
|
+
enterAnimation?: any;
|
|
22
|
+
leaveAnimation?: any;
|
|
23
|
+
didPresent: EventEmitter<void>;
|
|
24
|
+
willPresent: EventEmitter<void>;
|
|
25
|
+
willDismiss: EventEmitter<OverlayEventDetail>;
|
|
26
|
+
didDismiss: EventEmitter<OverlayEventDetail>;
|
|
27
|
+
present(): Promise<void>;
|
|
28
|
+
dismiss(data?: any, role?: string): Promise<boolean>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/react-component-lib/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
|
+
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Transforms a React event name to a browser event name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformReactEventName: (eventNameSuffix: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if an event is supported in the current execution environment.
|
|
9
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
10
|
+
*/
|
|
11
|
+
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
12
|
+
export declare const syncEvent: (node: Element & {
|
|
13
|
+
__events?: {
|
|
14
|
+
[key: string]: ((e: Event) => any) | undefined;
|
|
15
|
+
};
|
|
16
|
+
}, eventName: string, newEventHandler?: (e: Event) => any) => void;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { camelToDashCase } from './case';
|
|
2
|
+
export const attachProps = (node, newProps, oldProps = {}) => {
|
|
3
|
+
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
4
|
+
if (node instanceof Element) {
|
|
5
|
+
// add any classes in className to the class list
|
|
6
|
+
const className = getClassName(node.classList, newProps, oldProps);
|
|
7
|
+
if (className !== '') {
|
|
8
|
+
node.className = className;
|
|
9
|
+
}
|
|
10
|
+
Object.keys(newProps).forEach((name) => {
|
|
11
|
+
if (name === 'children' ||
|
|
12
|
+
name === 'style' ||
|
|
13
|
+
name === 'ref' ||
|
|
14
|
+
name === 'class' ||
|
|
15
|
+
name === 'className' ||
|
|
16
|
+
name === 'forwardedRef') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
20
|
+
const eventName = name.substring(2);
|
|
21
|
+
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
22
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
23
|
+
syncEvent(node, eventNameLc, newProps[name]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
node[name] = newProps[name];
|
|
28
|
+
const propType = typeof newProps[name];
|
|
29
|
+
if (propType === 'string') {
|
|
30
|
+
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export const getClassName = (classList, newProps, oldProps) => {
|
|
37
|
+
const newClassProp = newProps.className || newProps.class;
|
|
38
|
+
const oldClassProp = oldProps.className || oldProps.class;
|
|
39
|
+
// map the classes to Maps for performance
|
|
40
|
+
const currentClasses = arrayToMap(classList);
|
|
41
|
+
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
42
|
+
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
43
|
+
const finalClassNames = [];
|
|
44
|
+
// loop through each of the current classes on the component
|
|
45
|
+
// to see if it should be a part of the classNames added
|
|
46
|
+
currentClasses.forEach((currentClass) => {
|
|
47
|
+
if (incomingPropClasses.has(currentClass)) {
|
|
48
|
+
// add it as its already included in classnames coming in from newProps
|
|
49
|
+
finalClassNames.push(currentClass);
|
|
50
|
+
incomingPropClasses.delete(currentClass);
|
|
51
|
+
}
|
|
52
|
+
else if (!oldPropClasses.has(currentClass)) {
|
|
53
|
+
// add it as it has NOT been removed by user
|
|
54
|
+
finalClassNames.push(currentClass);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
58
|
+
return finalClassNames.join(' ');
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Transforms a React event name to a browser event name.
|
|
62
|
+
*/
|
|
63
|
+
export const transformReactEventName = (eventNameSuffix) => {
|
|
64
|
+
switch (eventNameSuffix) {
|
|
65
|
+
case 'doubleclick':
|
|
66
|
+
return 'dblclick';
|
|
67
|
+
}
|
|
68
|
+
return eventNameSuffix;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Checks if an event is supported in the current execution environment.
|
|
72
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
73
|
+
*/
|
|
74
|
+
export const isCoveredByReact = (eventNameSuffix) => {
|
|
75
|
+
if (typeof document === 'undefined') {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const eventName = 'on' + transformReactEventName(eventNameSuffix);
|
|
80
|
+
let isSupported = eventName in document;
|
|
81
|
+
if (!isSupported) {
|
|
82
|
+
const element = document.createElement('div');
|
|
83
|
+
element.setAttribute(eventName, 'return;');
|
|
84
|
+
isSupported = typeof element[eventName] === 'function';
|
|
85
|
+
}
|
|
86
|
+
return isSupported;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export const syncEvent = (node, eventName, newEventHandler) => {
|
|
90
|
+
const eventStore = node.__events || (node.__events = {});
|
|
91
|
+
const oldEventHandler = eventStore[eventName];
|
|
92
|
+
// Remove old listener so they don't double up.
|
|
93
|
+
if (oldEventHandler) {
|
|
94
|
+
node.removeEventListener(eventName, oldEventHandler);
|
|
95
|
+
}
|
|
96
|
+
// Bind new listener.
|
|
97
|
+
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
98
|
+
if (newEventHandler) {
|
|
99
|
+
newEventHandler.call(this, e);
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
};
|
|
103
|
+
const arrayToMap = (arr) => {
|
|
104
|
+
const map = new Map();
|
|
105
|
+
arr.forEach((s) => map.set(s, s));
|
|
106
|
+
return map;
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=attachProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;IAClF,6GAA6G;IAC7G,IAAI,IAAI,YAAY,OAAO,EAAE,CAAC;QAC5B,iDAAiD;QACjD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrC,IACE,IAAI,KAAK,UAAU;gBACnB,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,KAAK;gBACd,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,WAAW;gBACpB,IAAI,KAAK,cAAc,EACvB,CAAC;gBACD,OAAO;YACT,CAAC;YACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBAClE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACpC,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,SAAS,C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AAQ,OAAe,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC;QAClE,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAiF,EACjF,SAAiB,EACjB,eAAmC,EACnC,EAAE;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAE9C,+CAA+C;IAC/C,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACvD,CAAC;IAED,qBAAqB;IACrB,IAAI,CAAC,gBAAgB,CACnB,SAAS,EACT,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,OAAO,CAAC,CAAQ;QAChD,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,GAA4B,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACrC,GAAgB,CAAC,OAAO,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const dashToPascalCase = (str) => str
|
|
2
|
+
.toLowerCase()
|
|
3
|
+
.split('-')
|
|
4
|
+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
5
|
+
.join('');
|
|
6
|
+
export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
|
|
7
|
+
//# sourceMappingURL=case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const isDevMode = () => {
|
|
2
|
+
return process && process.env && process.env.NODE_ENV === 'development';
|
|
3
|
+
};
|
|
4
|
+
const warnings = {};
|
|
5
|
+
export const deprecationWarning = (key, message) => {
|
|
6
|
+
if (isDevMode()) {
|
|
7
|
+
if (!warnings[key]) {
|
|
8
|
+
console.warn(message);
|
|
9
|
+
warnings[key] = true;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleReactProps } from '../interfaces';
|
|
3
|
+
export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
|
|
4
|
+
export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
|
|
5
|
+
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
|
6
|
+
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
|
7
|
+
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
8
|
+
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
|
9
|
+
export * from './attachProps';
|
|
10
|
+
export * from './case';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const setRef = (ref, value) => {
|
|
3
|
+
if (typeof ref === 'function') {
|
|
4
|
+
ref(value);
|
|
5
|
+
}
|
|
6
|
+
else if (ref != null) {
|
|
7
|
+
// Cast as a MutableRef so we can assign current
|
|
8
|
+
ref.current = value;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export const mergeRefs = (...refs) => {
|
|
12
|
+
return (value) => {
|
|
13
|
+
refs.forEach((ref) => {
|
|
14
|
+
setRef(ref, value);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const createForwardRef = (ReactComponent, displayName) => {
|
|
19
|
+
const forwardRef = (props, ref) => {
|
|
20
|
+
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
21
|
+
};
|
|
22
|
+
forwardRef.displayName = displayName;
|
|
23
|
+
return React.forwardRef(forwardRef);
|
|
24
|
+
};
|
|
25
|
+
export const defineCustomElement = (tagName, customElement) => {
|
|
26
|
+
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
27
|
+
customElements.define(tagName, customElement);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export * from './attachProps';
|
|
31
|
+
export * from './case';
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA+D,EAAE,KAAU,EAAE,EAAE;IACpG,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;IACb,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,gDAAgD;QAC/C,GAAmC,CAAC,OAAO,GAAG,KAAK,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAAG,IAAoE,EAC/C,EAAE;IAC1B,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAwB,cAAmB,EAAE,WAAmB,EAAE,EAAE;IAClG,MAAM,UAAU,GAAG,CACjB,KAAuD,EACvD,GAA0C,EAC1C,EAAE;QACF,OAAO,oBAAC,cAAc,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC1D,CAAC,CAAC;IACF,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;IAErC,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,aAAkB,EAAE,EAAE;IACzE,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACzG,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0-alpha.0",
|
|
3
|
+
"author": "Community for NL Design System",
|
|
4
|
+
"description": "React web components bundle from LUX, the Design System for Logius, based on the NL Design System architecture",
|
|
5
|
+
"license": "EUPL-1.2",
|
|
6
|
+
"name": "@lux-design-system/web-components-react",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"nl-design-system",
|
|
9
|
+
"lux-design-system"
|
|
10
|
+
],
|
|
11
|
+
"private": false,
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git+ssh",
|
|
17
|
+
"url": "git@github.com:nl-design-system/lux.git",
|
|
18
|
+
"directory": "packages/web-components-react"
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/"
|
|
26
|
+
],
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": "^17.0.2",
|
|
29
|
+
"react-dom": "^17.0.2"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "22.1.0",
|
|
33
|
+
"@types/react": "18.3.3",
|
|
34
|
+
"@types/react-dom": "18.3.0",
|
|
35
|
+
"react": "18.3.1",
|
|
36
|
+
"react-dom": "18.3.1",
|
|
37
|
+
"rimraf": "6.0.1",
|
|
38
|
+
"typescript": "5.5.4",
|
|
39
|
+
"@lux-design-system/web-components-stencil": "1.0.0-alpha.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p .",
|
|
43
|
+
"clean": "rimraf dist/ src/components.ts src/react-component-lib/"
|
|
44
|
+
}
|
|
45
|
+
}
|