@uncinc/uncinc-react-kitchen-sink 2.22.0 → 2.23.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.
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// https://marella.me/material-design-icons/demo/svg/
|
|
6
6
|
|
|
7
7
|
$custom-icon-path: '' !default;
|
|
8
|
+
$custom-icon-names: () !default;
|
|
8
9
|
|
|
9
10
|
$material-icon-names: (
|
|
10
11
|
arrow_forward,
|
|
@@ -32,7 +33,10 @@ $material-icon-styles: (
|
|
|
32
33
|
background-color: none;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
@mixin generateMaterialIconClasses(
|
|
36
|
+
@mixin generateMaterialIconClasses(
|
|
37
|
+
$material-icon-names: $material-icon-names,
|
|
38
|
+
$material-icon-styles: $material-icon-styles,
|
|
39
|
+
) {
|
|
36
40
|
@for $styleIndex from 1 through length($material-icon-styles) {
|
|
37
41
|
$style: list.nth($material-icon-styles, $styleIndex);
|
|
38
42
|
|
|
@@ -55,7 +59,10 @@ $material-icon-styles: (
|
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
@mixin generateCustomIconClasses(
|
|
62
|
+
@mixin generateCustomIconClasses(
|
|
63
|
+
$custom-icon-names: $custom-icon-names,
|
|
64
|
+
$custom-icon-path: $custom-icon-path,
|
|
65
|
+
) {
|
|
59
66
|
@for $nameIndex from 1 through length($custom-icon-names) {
|
|
60
67
|
$name: list.nth($custom-icon-names, $nameIndex);
|
|
61
68
|
|
|
@@ -94,6 +101,9 @@ $material-icon-styles: (
|
|
|
94
101
|
/// @param {Boolean} $custom - Are we overwwriting with a
|
|
95
102
|
/// custom icon?
|
|
96
103
|
///
|
|
104
|
+
/// @param {String} $custom-path - Needed when using @import
|
|
105
|
+
/// instead of @use, because $custom-icon-path isn't available globally.
|
|
106
|
+
///
|
|
97
107
|
/// @example scss
|
|
98
108
|
/// .icon-arrow {
|
|
99
109
|
/// @include gridIconToMaterialIcon('download');
|
|
@@ -108,14 +118,17 @@ $material-icon-styles: (
|
|
|
108
118
|
$icon-name: null,
|
|
109
119
|
$style: 'outlined',
|
|
110
120
|
$custom: false,
|
|
121
|
+
$custom-path: null,
|
|
111
122
|
$color: #000000,
|
|
112
123
|
) {
|
|
113
124
|
@if not $icon-name {
|
|
114
|
-
@error 'an icon name is required'
|
|
125
|
+
@error 'an icon name is required';
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
@if not $custom {
|
|
118
129
|
mask-image: url('~@material-design-icons/svg/#{$style}/#{$icon-name}.svg');
|
|
130
|
+
} @else if $custom-path {
|
|
131
|
+
mask-image: url('#{$custom-path}/#{$icon-name}.svg');
|
|
119
132
|
} @else {
|
|
120
133
|
mask-image: url('#{$custom-icon-path}/#{$icon-name}.svg');
|
|
121
134
|
}
|
|
@@ -137,12 +150,14 @@ $material-icon-styles: (
|
|
|
137
150
|
$icon-name: null,
|
|
138
151
|
$style: 'outlined',
|
|
139
152
|
$custom: false,
|
|
153
|
+
$custom-path: null,
|
|
140
154
|
$color: #000000,
|
|
141
155
|
) {
|
|
142
156
|
@include gridIconToMaterialIcon(
|
|
143
157
|
$icon-name,
|
|
144
158
|
$style,
|
|
145
159
|
$custom,
|
|
160
|
+
$custom-path,
|
|
146
161
|
$color,
|
|
147
|
-
)
|
|
162
|
+
);
|
|
148
163
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LottieProps } from '../types';
|
|
3
3
|
import './style.scss';
|
|
4
|
+
/**
|
|
5
|
+
* LottieAnimation renders an interactive or static Lottie animation.
|
|
6
|
+
*
|
|
7
|
+
* Accessibility note:
|
|
8
|
+
* - The ariaLabel prop will only be effective if the animation is interactive
|
|
9
|
+
* (pauseOnClick or activateOnHover is true) because it adds role="button" and tabIndex=0.
|
|
10
|
+
* - On non-interactive divs, aria-label is ignored by screen readers.
|
|
11
|
+
*/
|
|
4
12
|
declare const LottieAnimation: React.ForwardRefExoticComponent<Omit<LottieProps, "delay"> & React.RefAttributes<import("lottie-web").AnimationItem>>;
|
|
5
13
|
export default LottieAnimation;
|
|
@@ -11,6 +11,16 @@ import lottie from 'lottie-web';
|
|
|
11
11
|
import './style.scss';
|
|
12
12
|
var DIRECTION_FORWARD = 1;
|
|
13
13
|
var DIRECTION_BACKWARDS = -1;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* LottieAnimation renders an interactive or static Lottie animation.
|
|
17
|
+
*
|
|
18
|
+
* Accessibility note:
|
|
19
|
+
* - The ariaLabel prop will only be effective if the animation is interactive
|
|
20
|
+
* (pauseOnClick or activateOnHover is true) because it adds role="button" and tabIndex=0.
|
|
21
|
+
* - On non-interactive divs, aria-label is ignored by screen readers.
|
|
22
|
+
*/
|
|
23
|
+
|
|
14
24
|
var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
25
|
var id = props.id,
|
|
16
26
|
className = props.className,
|
|
@@ -177,7 +187,6 @@ var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
177
187
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
178
188
|
className: lottieClasses,
|
|
179
189
|
id: "lottie--".concat(lottieId),
|
|
180
|
-
"aria-label": ariaLabel,
|
|
181
190
|
"aria-hidden": ariaHidden
|
|
182
191
|
// Only make the Lottie interactable if we provide the necessary props,
|
|
183
192
|
// otherwise it's just a plain div.
|
|
@@ -186,10 +195,9 @@ var LottieAnimation = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
186
195
|
tabIndex: 0,
|
|
187
196
|
onMouseEnter: onMouseEnter,
|
|
188
197
|
onMouseLeave: onMouseLeave,
|
|
198
|
+
ariaLabel: ariaLabel,
|
|
189
199
|
onClick: onClick,
|
|
190
200
|
onKeyDown: onKeyDown
|
|
191
|
-
} : {
|
|
192
|
-
role: 'img'
|
|
193
|
-
}));
|
|
201
|
+
} : {}));
|
|
194
202
|
});
|
|
195
203
|
export default LottieAnimation;
|