@entur/button 2.10.9 → 2.10.11
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 +0 -71
- package/dist/BaseSquareButton.d.ts +3 -3
- package/dist/Button.d.ts +3 -3
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/FloatingButton.d.ts +1 -1
- package/dist/IconButton.d.ts +3 -3
- package/dist/NegativeButton.d.ts +3 -3
- package/dist/PrimaryButton.d.ts +3 -3
- package/dist/SecondaryButton.d.ts +3 -3
- package/dist/SecondarySquareButton.d.ts +3 -3
- package/dist/SuccessButton.d.ts +3 -3
- package/dist/SuccessSquareButton.d.ts +3 -3
- package/dist/TertiaryButton.d.ts +3 -3
- package/dist/TertiarySquareButton.d.ts +3 -3
- package/dist/button.cjs.development.js +51 -66
- package/dist/button.cjs.development.js.map +1 -1
- package/dist/button.cjs.production.min.js +1 -1
- package/dist/button.cjs.production.min.js.map +1 -1
- package/dist/button.esm.js +51 -66
- package/dist/button.esm.js.map +1 -1
- package/dist/styles.css +8 -9
- package/package.json +6 -6
- package/CHANGELOG.md +0 -465
package/LICENSE.md
CHANGED
|
@@ -208,74 +208,3 @@ The European Commission may update this Appendix to later versions of the above
|
|
|
208
208
|
a new version of the EUPL, as long as they provide the rights granted in Article 2 of this Licence and protect the
|
|
209
209
|
covered Source Code from exclusive appropriation.
|
|
210
210
|
All other changes or additions to this Appendix require the production of a new EUPL version.
|
|
211
|
-
|
|
212
|
-
# Standard Nucleo License
|
|
213
|
-
|
|
214
|
-
- Last updated: July 2, 2018
|
|
215
|
-
- [Github repo](https://github.com/NucleoApp/license-standard)
|
|
216
|
-
|
|
217
|
-
By purchasing the Nucleo icons, you have the right to:
|
|
218
|
-
|
|
219
|
-
- Use the Nucleo icons in unlimited personal and commercial projects, for yourself or a client, with no limitation to the number of impressions for your end product.
|
|
220
|
-
- Use the Nucleo icons in applications, software, UI/UX design, print, and logo design.
|
|
221
|
-
- Modify the Nucleo icons to create your icon variations.
|
|
222
|
-
|
|
223
|
-
You don't have the right to:
|
|
224
|
-
|
|
225
|
-
- Sublicense, resell, share, transfer, or otherwise redistribute the Nucleo icons (even for free or within a more complex downloadable file).
|
|
226
|
-
- Use the Nucleo icons in a product that is directly competitive with Nucleo.
|
|
227
|
-
|
|
228
|
-
## Limitations & Extended license
|
|
229
|
-
|
|
230
|
-
- **For each project, you can use a maximum of 250 Nucleo icons** (intended per unique style: for example, if you're using the same icon in both the outline and glyph styles, or in 2 different sizes, you're using 2 icons). You can lift this limit by purchasing an Extended License.
|
|
231
|
-
- If you're using Nucleo icons in templates, themes or plugins offered for sale, you can use a maximum of 100 Nucleo icons. You can lift this limit by purchasing an Extended License.
|
|
232
|
-
- If you're using the Nucleo icons in open source projects, you can use a maximum of 100 Nucleo icons.
|
|
233
|
-
- If you're interested in using the Nucleo icons in items offered for sale (or for free) where the Nucleo icons contribute to the core value of the product being sold/shared, you will need an Extended License (e.g., a CMS where users can browse the Nucleo icons and pick the ones to include in their design).
|
|
234
|
-
|
|
235
|
-
[Learn more about the Extended License](https://nucleoapp.com/extended-license)
|
|
236
|
-
|
|
237
|
-
## Freelance Projects & Contracted work
|
|
238
|
-
|
|
239
|
-
If you're working on a project for a client, you can share with your client a maximum of 250 Nucleo icons per project. You can't share the Nucleo source files unless the client purchases a license.
|
|
240
|
-
|
|
241
|
-
If the Nucleo icons contribute to the core value of the product being sold/shared, or if you (or your client) wish to include more than 250 icons in the project, the [Extended License](https://nucleoapp.com/extended-license) is required.
|
|
242
|
-
|
|
243
|
-
## Templates, Themes, UI Kits & Plugins
|
|
244
|
-
|
|
245
|
-
If you're using Nucleo icons in templates, themes or plugins offered for sale (e.g., UI kits, Wordpress Themes, HTML/CSS Templates), **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
|
|
246
|
-
|
|
247
|
-
The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
|
|
248
|
-
|
|
249
|
-
If the Nucleo icons contribute to the core value of the template, theme or plugin sold (e.g., a theme builder where users can browse Nucleo icons and pick the ones to include in their design), or if you wish to use more than 100 Nucleo icons, you will need an [Extended License](https://nucleoapp.com/extended-license).
|
|
250
|
-
|
|
251
|
-
It's not possible to purchase an Extended License if the template, theme or plugin is distributed for free.
|
|
252
|
-
|
|
253
|
-
If you're offering a free and pro version of your product, the free version cannot include more than 100 icons even if you purchased an Extended License to lift the limit. The Extended License applies only to the pro version of your product.
|
|
254
|
-
|
|
255
|
-
## Open source projects
|
|
256
|
-
|
|
257
|
-
If you're using the Nucleo icons in open source projects, **you can include up to 100 icons in the downloadable source files**. This limitation applies to the icon fonts as well.
|
|
258
|
-
|
|
259
|
-
The downloadable source file has to include the [Nucleo Copyright Notice](https://nucleoapp.com/copyright-notice).
|
|
260
|
-
|
|
261
|
-
It's not possible to purchase an Extended License for open source projects.
|
|
262
|
-
|
|
263
|
-
## Sharing Nucleo icons with team members
|
|
264
|
-
|
|
265
|
-
If you're the sole owner of a Nucleo license, you can share with your team members only the icons used in your work, with a maximum of 250 icons (e.g., if you're a designer, you can share with the developers of your team only the Nucleo icons used in your design files).
|
|
266
|
-
|
|
267
|
-
Your team members cannot reuse the Nucleo icons in other projects unless they purchase a license.
|
|
268
|
-
|
|
269
|
-
If more than one team member needs access to the Nucleo icons, you can consider purchasing a [team license](https://nucleoapp.com/pricing).
|
|
270
|
-
|
|
271
|
-
## Design systems
|
|
272
|
-
|
|
273
|
-
If you wish to include the Nucleo icons in a design system available on a public server, you can use a maximum of 250 Nucleo icons, even if your team purchased a Nucleo team license.
|
|
274
|
-
|
|
275
|
-
If the design system is accessible only by the members of your organization (e.g., is hosted on a password protected server), but you're the sole owner of a Nucleo license, you can share with your colleagues a maximum of 250 Nucleo icons.
|
|
276
|
-
|
|
277
|
-
If the design system is on a public server, you can lift the 250 icons limit by buying an [Extended License](https://nucleoapp.com/extended-license). However, please keep in mind you can't provide a link/button to download all the icons.
|
|
278
|
-
|
|
279
|
-
If your team purchased a Nucleo team license that covers all the users with access to the design system, and the design system is not public (e.g., is hosted on a password protected server), then there's no limitation to the number of icons that can be included.
|
|
280
|
-
|
|
281
|
-
If you're still unclear about what is or isn't allowed under this license, please contact us at info@nucleoapp.com.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
3
|
import './BaseSquareButton.scss';
|
|
4
|
-
export
|
|
4
|
+
export type BaseSquareButtonBaseProps = {
|
|
5
5
|
/** Tekst og ikon */
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/** Ekstra klassenavn */
|
|
@@ -17,8 +17,8 @@ export declare type BaseSquareButtonBaseProps = {
|
|
|
17
17
|
*/
|
|
18
18
|
loading?: boolean;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export type BaseSquareButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, BaseSquareButtonBaseProps>;
|
|
21
|
+
export type BaseSquareButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: BaseSquareButtonProps<T>) => React.ReactElement | null;
|
|
22
22
|
declare const defaultElement = "button";
|
|
23
23
|
export declare const BaseSquareButton: BaseSquareButtonComponent;
|
|
24
24
|
export {};
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
3
|
import './Button.scss';
|
|
4
|
-
|
|
4
|
+
type ButtonBaseProps = {
|
|
5
5
|
/** Farge og uttrykk på knappen */
|
|
6
6
|
variant: 'primary' | 'secondary' | 'success' | 'negative' | 'tertiary';
|
|
7
7
|
/** Størrelsen på knappen
|
|
@@ -30,7 +30,7 @@ declare type ButtonBaseProps = {
|
|
|
30
30
|
'aria-label'?: string;
|
|
31
31
|
};
|
|
32
32
|
declare const defaultElement = "button";
|
|
33
|
-
export
|
|
34
|
-
export
|
|
33
|
+
export type ButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, ButtonBaseProps>;
|
|
34
|
+
export type ButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: ButtonProps<T>) => React.ReactElement | null;
|
|
35
35
|
export declare const Button: ButtonComponent;
|
|
36
36
|
export {};
|
package/dist/ButtonGroup.d.ts
CHANGED
package/dist/FloatingButton.d.ts
CHANGED
package/dist/IconButton.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
3
|
import './IconButton.scss';
|
|
4
|
-
export
|
|
4
|
+
export type IconButtonBaseProps = {
|
|
5
5
|
/** Ikonet som du vil ha inne i knappen */
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/** Tekst som forklarer knappens handling. MÅ være satt hvis du ikke har en forklarende tooltip på knappen */
|
|
@@ -26,7 +26,7 @@ export declare type IconButtonBaseProps = {
|
|
|
26
26
|
loading?: boolean;
|
|
27
27
|
};
|
|
28
28
|
declare const defaultElement = "button";
|
|
29
|
-
export
|
|
30
|
-
export
|
|
29
|
+
export type IconButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, IconButtonBaseProps>;
|
|
30
|
+
export type IconButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: IconButtonProps<T>) => React.ReactElement | null;
|
|
31
31
|
export declare const IconButton: IconButtonComponent;
|
|
32
32
|
export {};
|
package/dist/NegativeButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
export
|
|
3
|
+
export type NegativeButtonBaseProps = {
|
|
4
4
|
/** Størrelsen på knappen
|
|
5
5
|
* @default 'medium'
|
|
6
6
|
*/
|
|
@@ -22,8 +22,8 @@ export declare type NegativeButtonBaseProps = {
|
|
|
22
22
|
/** Innholdet i knappen */
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type NegativeButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, NegativeButtonBaseProps>;
|
|
26
|
+
export type NegativeButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: NegativeButtonProps<T>) => React.ReactElement | null;
|
|
27
27
|
declare const defaultElement = "button";
|
|
28
28
|
export declare const NegativeButton: NegativeButtonComponent;
|
|
29
29
|
export {};
|
package/dist/PrimaryButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
export
|
|
3
|
+
export type PrimaryButtonBaseProps = {
|
|
4
4
|
/** Størrelsen på knappen
|
|
5
5
|
* @default 'medium'
|
|
6
6
|
*/
|
|
@@ -22,8 +22,8 @@ export declare type PrimaryButtonBaseProps = {
|
|
|
22
22
|
/** Innholdet i knappen */
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type PrimaryButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, PrimaryButtonBaseProps>;
|
|
26
|
+
export type PrimaryButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: PrimaryButtonProps<T>) => React.ReactElement | null;
|
|
27
27
|
declare const defaultElement = "button";
|
|
28
28
|
export declare const PrimaryButton: PrimaryButtonComponent;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
export
|
|
3
|
+
export type SecondaryButtonBaseProps = {
|
|
4
4
|
/** Størrelsen på knappen
|
|
5
5
|
* @default 'medium'
|
|
6
6
|
*/
|
|
@@ -22,8 +22,8 @@ export declare type SecondaryButtonBaseProps = {
|
|
|
22
22
|
/** Innholdet i knappen */
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type SecondaryButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, SecondaryButtonBaseProps>;
|
|
26
|
+
export type SecondaryButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: SecondaryButtonProps<T>) => React.ReactElement | null;
|
|
27
27
|
declare const defaultElement = "button";
|
|
28
28
|
export declare const SecondaryButton: SecondaryButtonComponent;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
|
|
3
|
+
type SecondarySquareButtonBaseProps = {
|
|
4
4
|
/** Tekst og ikon, ikon og tekst, eller bare ikon */
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Ekstra klassenavn */
|
|
@@ -14,8 +14,8 @@ declare type SecondarySquareButtonBaseProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type SecondarySquareButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, SecondarySquareButtonBaseProps>;
|
|
18
|
+
export type SecondarySquareButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: SecondarySquareButtonProps<T>) => React.ReactElement | null;
|
|
19
19
|
declare const defaultElement = "button";
|
|
20
20
|
export declare const SecondarySquareButton: SecondarySquareButtonComponent;
|
|
21
21
|
export {};
|
package/dist/SuccessButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
export
|
|
3
|
+
export type SuccessButtonBaseProps = {
|
|
4
4
|
/** Størrelsen på knappen
|
|
5
5
|
* @default 'medium'
|
|
6
6
|
*/
|
|
@@ -22,8 +22,8 @@ export declare type SuccessButtonBaseProps = {
|
|
|
22
22
|
/** Innholdet i knappen */
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type SuccessButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, SuccessButtonBaseProps>;
|
|
26
|
+
export type SuccessButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: SuccessButtonProps<T>) => React.ReactElement | null;
|
|
27
27
|
declare const defaultElement = "button";
|
|
28
28
|
export declare const SuccessButton: SuccessButtonComponent;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
|
|
3
|
+
type SuccessSquareButtonBaseProps = {
|
|
4
4
|
/** Tekst og ikon, ikon og tekst, eller bare ikon */
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Ekstra klassenavn */
|
|
@@ -14,8 +14,8 @@ declare type SuccessSquareButtonBaseProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type SuccessSquareButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, SuccessSquareButtonBaseProps>;
|
|
18
|
+
export type SuccessSquareButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: SuccessSquareButtonProps<T>) => React.ReactElement | null;
|
|
19
19
|
declare const defaultElement = "button";
|
|
20
20
|
export declare const SuccessSquareButton: SuccessSquareButtonComponent;
|
|
21
21
|
export {};
|
package/dist/TertiaryButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
export
|
|
3
|
+
export type TertiaryButtonBaseProps = {
|
|
4
4
|
/** Størrelsen på knappen
|
|
5
5
|
* @default 'medium'
|
|
6
6
|
*/
|
|
@@ -22,8 +22,8 @@ export declare type TertiaryButtonBaseProps = {
|
|
|
22
22
|
/** Innholdet i knappen */
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type TertiaryButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, TertiaryButtonBaseProps>;
|
|
26
|
+
export type TertiaryButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: TertiaryButtonProps<T>) => React.ReactElement | null;
|
|
27
27
|
declare const defaultElement = "button";
|
|
28
28
|
export declare const TertiaryButton: TertiaryButtonComponent;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PolymorphicComponentPropsWithRef } from '@entur/utils';
|
|
3
|
-
|
|
3
|
+
type TertiarySquareButtonBaseProps = {
|
|
4
4
|
/** Tekst og ikon, ikon og tekst, eller bare ikon */
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Ekstra klassenavn */
|
|
@@ -14,8 +14,8 @@ declare type TertiarySquareButtonBaseProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type TertiarySquareButtonProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, TertiarySquareButtonBaseProps>;
|
|
18
|
+
export type TertiarySquareButtonComponent = <T extends React.ElementType = typeof defaultElement>(props: TertiarySquareButtonProps<T>) => React.ReactElement | null;
|
|
19
19
|
declare const defaultElement = "button";
|
|
20
20
|
export declare const TertiarySquareButton: TertiarySquareButtonComponent;
|
|
21
21
|
export {};
|
|
@@ -32,35 +32,29 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
32
32
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
33
33
|
|
|
34
34
|
function _extends() {
|
|
35
|
-
_extends = Object.assign
|
|
35
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
36
36
|
for (var i = 1; i < arguments.length; i++) {
|
|
37
37
|
var source = arguments[i];
|
|
38
|
-
|
|
39
38
|
for (var key in source) {
|
|
40
39
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
41
40
|
target[key] = source[key];
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
|
|
46
44
|
return target;
|
|
47
45
|
};
|
|
48
|
-
|
|
49
46
|
return _extends.apply(this, arguments);
|
|
50
47
|
}
|
|
51
|
-
|
|
52
48
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
53
49
|
if (source == null) return {};
|
|
54
50
|
var target = {};
|
|
55
51
|
var sourceKeys = Object.keys(source);
|
|
56
52
|
var key, i;
|
|
57
|
-
|
|
58
53
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
59
54
|
key = sourceKeys[i];
|
|
60
55
|
if (excluded.indexOf(key) >= 0) continue;
|
|
61
56
|
target[key] = source[key];
|
|
62
57
|
}
|
|
63
|
-
|
|
64
58
|
return target;
|
|
65
59
|
}
|
|
66
60
|
|
|
@@ -68,21 +62,19 @@ var _excluded$4 = ["as", "children", "variant", "size", "loading", "className",
|
|
|
68
62
|
var defaultElement$a = 'button';
|
|
69
63
|
var Button = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
70
64
|
var _cx;
|
|
71
|
-
|
|
72
65
|
var as = _ref.as,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
66
|
+
children = _ref.children,
|
|
67
|
+
variant = _ref.variant,
|
|
68
|
+
_ref$size = _ref.size,
|
|
69
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
70
|
+
loading = _ref.loading,
|
|
71
|
+
className = _ref.className,
|
|
72
|
+
_ref$disabled = _ref.disabled,
|
|
73
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
74
|
+
_ref$width = _ref.width,
|
|
75
|
+
width = _ref$width === void 0 ? 'auto' : _ref$width,
|
|
76
|
+
ariaLabel = _ref['aria-label'],
|
|
77
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
86
78
|
var Element = as || defaultElement$a;
|
|
87
79
|
var childrenArray = React__namespace.Children.toArray(children);
|
|
88
80
|
var hasLeadingIcon = childrenArray.length > 1 && typeof childrenArray[0] !== 'string';
|
|
@@ -90,13 +82,11 @@ var Button = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
|
90
82
|
var ariaLabelWhenLoading = childrenArray.filter(function (child) {
|
|
91
83
|
return typeof child === 'string';
|
|
92
84
|
}).join(' ');
|
|
93
|
-
|
|
94
85
|
var ariaLabelValue = function ariaLabelValue() {
|
|
95
86
|
if (ariaLabel) return ariaLabel;
|
|
96
87
|
if (loading) return ariaLabelWhenLoading;
|
|
97
88
|
return undefined;
|
|
98
89
|
};
|
|
99
|
-
|
|
100
90
|
return React__namespace.createElement(Element, _extends({
|
|
101
91
|
className: classNames__default["default"]('eds-button', (_cx = {}, _cx["eds-button--variant-" + variant] = variant, _cx["eds-button--size-" + size] = size, _cx['eds-button--width-fluid'] = width === 'fluid', _cx['eds-button--loading'] = loading, _cx['eds-button--leading-icon'] = hasLeadingIcon, _cx['eds-button--trailing-icon'] = hasTrailingIcon, _cx), className),
|
|
102
92
|
ref: ref,
|
|
@@ -111,8 +101,8 @@ var Button = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
|
111
101
|
|
|
112
102
|
var defaultElement$9 = 'button';
|
|
113
103
|
var PrimaryButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
114
|
-
var Element = props.as || defaultElement$9;
|
|
115
|
-
|
|
104
|
+
var Element = props.as || defaultElement$9;
|
|
105
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
116
106
|
return React__default["default"].createElement(Button, _extends({
|
|
117
107
|
as: Element
|
|
118
108
|
}, props, {
|
|
@@ -123,8 +113,8 @@ var PrimaryButton = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
|
123
113
|
|
|
124
114
|
var defaultElement$8 = 'button';
|
|
125
115
|
var SecondaryButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
126
|
-
var Element = props.as || defaultElement$8;
|
|
127
|
-
|
|
116
|
+
var Element = props.as || defaultElement$8;
|
|
117
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
128
118
|
return React__default["default"].createElement(Button, _extends({
|
|
129
119
|
as: Element
|
|
130
120
|
}, props, {
|
|
@@ -135,8 +125,8 @@ var SecondaryButton = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
135
125
|
|
|
136
126
|
var defaultElement$7 = 'button';
|
|
137
127
|
var SuccessButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
138
|
-
var Element = props.as || defaultElement$7;
|
|
139
|
-
|
|
128
|
+
var Element = props.as || defaultElement$7;
|
|
129
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
140
130
|
return React__default["default"].createElement(Button, _extends({
|
|
141
131
|
as: Element
|
|
142
132
|
}, props, {
|
|
@@ -147,8 +137,8 @@ var SuccessButton = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
|
147
137
|
|
|
148
138
|
var defaultElement$6 = 'button';
|
|
149
139
|
var NegativeButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
150
|
-
var Element = props.as || defaultElement$6;
|
|
151
|
-
|
|
140
|
+
var Element = props.as || defaultElement$6;
|
|
141
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
152
142
|
return React__default["default"].createElement(Button, _extends({
|
|
153
143
|
as: Element
|
|
154
144
|
}, props, {
|
|
@@ -159,8 +149,8 @@ var NegativeButton = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
159
149
|
|
|
160
150
|
var defaultElement$5 = 'button';
|
|
161
151
|
var TertiaryButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
162
|
-
var Element = props.as || defaultElement$5;
|
|
163
|
-
|
|
152
|
+
var Element = props.as || defaultElement$5;
|
|
153
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
164
154
|
return React__default["default"].createElement(Button, _extends({
|
|
165
155
|
as: Element
|
|
166
156
|
}, props, {
|
|
@@ -172,10 +162,9 @@ var TertiaryButton = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
172
162
|
var _excluded$3 = ["as", "className"];
|
|
173
163
|
var ButtonGroup = function ButtonGroup(_ref) {
|
|
174
164
|
var _ref$as = _ref.as,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
165
|
+
Element = _ref$as === void 0 ? 'div' : _ref$as,
|
|
166
|
+
className = _ref.className,
|
|
167
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
179
168
|
return React__default["default"].createElement(Element, _extends({
|
|
180
169
|
className: classNames__default["default"]('eds-button-group', className)
|
|
181
170
|
}, rest));
|
|
@@ -184,11 +173,10 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
184
173
|
var _excluded$2 = ["className", "children", "size"];
|
|
185
174
|
var FloatingButton = function FloatingButton(_ref) {
|
|
186
175
|
var className = _ref.className,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
176
|
+
children = _ref.children,
|
|
177
|
+
_ref$size = _ref.size,
|
|
178
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
179
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
192
180
|
return React__default["default"].createElement("button", _extends({
|
|
193
181
|
className: classNames__default["default"]('eds-floating-button', {
|
|
194
182
|
'eds-floating-button--extended': React__default["default"].Children.count(children) > 1
|
|
@@ -198,7 +186,6 @@ var FloatingButton = function FloatingButton(_ref) {
|
|
|
198
186
|
type: "button"
|
|
199
187
|
}, rest), wrapStringsInSpans(children));
|
|
200
188
|
};
|
|
201
|
-
|
|
202
189
|
var wrapStringsInSpans = function wrapStringsInSpans(children) {
|
|
203
190
|
return React__default["default"].Children.map(children, function (child) {
|
|
204
191
|
return typeof child === 'string' ? React__default["default"].createElement("span", null, child) : child;
|
|
@@ -209,15 +196,14 @@ var _excluded$1 = ["children", "className", "variant", "disabled", "loading", "a
|
|
|
209
196
|
var defaultElement$4 = 'button';
|
|
210
197
|
var BaseSquareButton = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
211
198
|
var children = _ref.children,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
199
|
+
className = _ref.className,
|
|
200
|
+
variant = _ref.variant,
|
|
201
|
+
_ref$disabled = _ref.disabled,
|
|
202
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
203
|
+
_ref$loading = _ref.loading,
|
|
204
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
205
|
+
as = _ref.as,
|
|
206
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
221
207
|
var Element = as || defaultElement$4;
|
|
222
208
|
return React__namespace.createElement(Element, _extends({
|
|
223
209
|
className: classNames__default["default"]('eds-square-button', {
|
|
@@ -239,7 +225,6 @@ var BaseSquareButton = /*#__PURE__*/React__namespace.forwardRef(function (_ref,
|
|
|
239
225
|
className: "eds-square-button__label"
|
|
240
226
|
}, child);
|
|
241
227
|
}
|
|
242
|
-
|
|
243
228
|
return React__namespace.createElement("span", {
|
|
244
229
|
className: "eds-square-button__icon"
|
|
245
230
|
}, loading ? React__namespace.createElement(loader.LoadingDots, {
|
|
@@ -251,7 +236,8 @@ var BaseSquareButton = /*#__PURE__*/React__namespace.forwardRef(function (_ref,
|
|
|
251
236
|
var defaultElement$3 = 'button';
|
|
252
237
|
var SecondarySquareButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
253
238
|
var Element = props.as || defaultElement$3;
|
|
254
|
-
return (
|
|
239
|
+
return (
|
|
240
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
255
241
|
React__default["default"].createElement(BaseSquareButton, _extends({
|
|
256
242
|
as: Element,
|
|
257
243
|
ref: ref
|
|
@@ -264,7 +250,8 @@ var SecondarySquareButton = /*#__PURE__*/React__default["default"].forwardRef(fu
|
|
|
264
250
|
var defaultElement$2 = 'button';
|
|
265
251
|
var SuccessSquareButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
266
252
|
var Element = props.as || defaultElement$2;
|
|
267
|
-
return (
|
|
253
|
+
return (
|
|
254
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
268
255
|
React__default["default"].createElement(BaseSquareButton, _extends({
|
|
269
256
|
as: Element,
|
|
270
257
|
ref: ref
|
|
@@ -277,7 +264,8 @@ var SuccessSquareButton = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
|
277
264
|
var defaultElement$1 = 'button';
|
|
278
265
|
var TertiarySquareButton = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
|
|
279
266
|
var Element = props.as || defaultElement$1;
|
|
280
|
-
return (
|
|
267
|
+
return (
|
|
268
|
+
// @ts-expect-error type error due to props not being BaseButtonProps
|
|
281
269
|
React__default["default"].createElement(BaseSquareButton, _extends({
|
|
282
270
|
as: Element,
|
|
283
271
|
ref: ref
|
|
@@ -291,14 +279,13 @@ var _excluded = ["children", "className", "disabled", "size", "as", "loading"];
|
|
|
291
279
|
var defaultElement = 'button';
|
|
292
280
|
var IconButton = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
|
293
281
|
var children = _ref.children,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
282
|
+
className = _ref.className,
|
|
283
|
+
_ref$disabled = _ref.disabled,
|
|
284
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
285
|
+
size = _ref.size,
|
|
286
|
+
as = _ref.as,
|
|
287
|
+
loading = _ref.loading,
|
|
288
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
302
289
|
var Element = as || defaultElement;
|
|
303
290
|
var iconButtonElement = React__default["default"].createElement(Element, _extends({
|
|
304
291
|
className: classNames__default["default"]('eds-icon-button', className, {
|
|
@@ -309,13 +296,11 @@ var IconButton = /*#__PURE__*/React__default["default"].forwardRef(function (_re
|
|
|
309
296
|
"aria-busy": loading,
|
|
310
297
|
ref: ref
|
|
311
298
|
}, rest), loading ? React__default["default"].createElement(loader.LoadingDots, null) : children);
|
|
312
|
-
|
|
313
299
|
if (disabled) {
|
|
314
300
|
return React__default["default"].createElement("div", {
|
|
315
301
|
className: "eds-icon-button--disabled__wrapper"
|
|
316
302
|
}, iconButtonElement);
|
|
317
303
|
}
|
|
318
|
-
|
|
319
304
|
return React__default["default"].createElement(React__default["default"].Fragment, null, iconButtonElement);
|
|
320
305
|
});
|
|
321
306
|
|