@itcase/ui 1.9.40 → 1.9.42
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/dist/{Avatar_cjs_Ctz9kEoE.js → Avatar_cjs_B_hjRkuy.js} +2 -2
- package/dist/{Avatar_es_2Na9ZgVL.js → Avatar_es_BgYYfuzU.js} +2 -2
- package/dist/{Button_cjs_Ivarkwy6.js → Button_cjs_BSfL-20W.js} +9 -4
- package/dist/{Button_es_ul2sDicM.js → Button_es_C2vKuxE7.js} +9 -4
- package/dist/{ChipsGroup_cjs_CIIf1Cyn.js → ChipsGroup_cjs_DVfNiTvV.js} +1 -1
- package/dist/{ChipsGroup_es_wecRqt6G.js → ChipsGroup_es_BvKmBPXK.js} +1 -1
- package/dist/{DatePicker_cjs_BzAzvsdV.js → DatePicker_cjs_avA-OHmZ.js} +3 -3
- package/dist/{DatePicker_es_CCZmi-lN.js → DatePicker_es_D7k0K2pL.js} +3 -3
- package/dist/{DropdownItem_cjs_nZbgMgqg.js → DropdownItem_cjs_pJblsTmA.js} +1 -1
- package/dist/{DropdownItem_es__mygSEH6.js → DropdownItem_es_QniQAKA2.js} +1 -1
- package/dist/{Icon_cjs_D20B2YBo.js → Icon_cjs_CuqEv1jm.js} +1 -1
- package/dist/{Icon_es_DNVHNKFK.js → Icon_es_DoAtUvPe.js} +1 -1
- package/dist/{Image_cjs_JfkEyfgx.js → Image_cjs_BxZFowhi.js} +6 -2
- package/dist/{Image_es_DbD3JzLa.js → Image_es_Bx7l_UwQ.js} +6 -2
- package/dist/{Label_cjs_DlbcXQX4.js → Label_cjs_DsuCRIyo.js} +24 -24
- package/dist/{Label_es_CbXFs_ts.js → Label_es_BHlo5f-u.js} +24 -24
- package/dist/{Link_cjs_DXBqPjwm.js → Link_cjs_Dn7UhCYe.js} +2 -2
- package/dist/{Link_es_BwLH5S8y.js → Link_es_DPZHTF38.js} +2 -2
- package/dist/{SelectContainer_cjs_Bd9llsQa.js → SelectContainer_cjs_DshFNYWN.js} +1 -1
- package/dist/{SelectContainer_es_Bqek7tN5.js → SelectContainer_es_Cr3Zset9.js} +1 -1
- package/dist/cjs/components/Accordion.js +2 -2
- package/dist/cjs/components/Avatar.js +4 -4
- package/dist/cjs/components/AvatarStack.js +4 -4
- package/dist/cjs/components/Badge.js +2 -2
- package/dist/cjs/components/Breadcrumbs.js +2 -2
- package/dist/cjs/components/Button.js +4 -3
- package/dist/cjs/components/Cell.js +3 -3
- package/dist/cjs/components/Chips.js +3 -3
- package/dist/cjs/components/Choice.js +2 -2
- package/dist/cjs/components/CookiesWarning.js +4 -3
- package/dist/cjs/components/DatePeriod.js +8 -7
- package/dist/cjs/components/DatePicker.js +6 -5
- package/dist/cjs/components/Drawer.js +2 -2
- package/dist/cjs/components/Dropdown.js +3 -3
- package/dist/cjs/components/HeroTitle.js +2 -2
- package/dist/cjs/components/Icon.js +2 -2
- package/dist/cjs/components/Image.js +1 -1
- package/dist/cjs/components/InputNumber.js +4 -3
- package/dist/cjs/components/InputPassword.js +2 -2
- package/dist/cjs/components/Label.js +3 -3
- package/dist/cjs/components/Link.js +1 -1
- package/dist/cjs/components/List.js +1 -1
- package/dist/cjs/components/Logo.js +1 -1
- package/dist/cjs/components/MenuItem.js +2 -2
- package/dist/cjs/components/Modal.js +2 -2
- package/dist/cjs/components/ModalSheetBottom.js +2 -2
- package/dist/cjs/components/Notification.js +4 -3
- package/dist/cjs/components/Pagination.js +48 -11
- package/dist/cjs/components/Response.js +6 -5
- package/dist/cjs/components/Search.js +2 -2
- package/dist/cjs/components/Segmented.js +2 -2
- package/dist/cjs/components/Select.js +3 -3
- package/dist/cjs/components/Swiper.js +2 -2
- package/dist/cjs/components/Tab.js +2 -2
- package/dist/cjs/components/Tile.js +5 -5
- package/dist/cjs/components/Title.js +2 -2
- package/dist/cjs/components/Tooltip.js +2 -2
- package/dist/cjs/components/Warning.js +2 -2
- package/dist/cjs/hooks/useHoldProgress.js +61 -0
- package/dist/components/Accordion.js +2 -2
- package/dist/components/Avatar.js +4 -4
- package/dist/components/AvatarStack.js +4 -4
- package/dist/components/Badge.js +2 -2
- package/dist/components/Breadcrumbs.js +2 -2
- package/dist/components/Button.js +4 -3
- package/dist/components/Cell.js +3 -3
- package/dist/components/Chips.js +3 -3
- package/dist/components/Choice.js +2 -2
- package/dist/components/CookiesWarning.js +4 -3
- package/dist/components/DatePeriod.js +8 -7
- package/dist/components/DatePicker.js +6 -5
- package/dist/components/Drawer.js +2 -2
- package/dist/components/Dropdown.js +3 -3
- package/dist/components/HeroTitle.js +2 -2
- package/dist/components/Icon.js +2 -2
- package/dist/components/Image.js +1 -1
- package/dist/components/InputNumber.js +4 -3
- package/dist/components/InputPassword.js +2 -2
- package/dist/components/Label.js +3 -3
- package/dist/components/Link.js +1 -1
- package/dist/components/List.js +1 -1
- package/dist/components/Logo.js +1 -1
- package/dist/components/MenuItem.js +2 -2
- package/dist/components/Modal.js +2 -2
- package/dist/components/ModalSheetBottom.js +2 -2
- package/dist/components/Notification.js +4 -3
- package/dist/components/Pagination.js +49 -12
- package/dist/components/Response.js +6 -5
- package/dist/components/Search.js +2 -2
- package/dist/components/Segmented.js +2 -2
- package/dist/components/Select.js +3 -3
- package/dist/components/Swiper.js +2 -2
- package/dist/components/Tab.js +2 -2
- package/dist/components/Tile.js +5 -5
- package/dist/components/Title.js +2 -2
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/Warning.js +2 -2
- package/dist/css/mixins/mixin_typography.css +1 -1
- package/dist/css/styles/bundles.css +29 -2
- package/dist/hooks/useHoldProgress.js +59 -0
- package/dist/types/components/Button/Button.d.ts +2 -1
- package/dist/types/components/Button/Button.interface.d.ts +3 -1
- package/dist/types/components/Button/stories/ButtonDefault.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonDemo.stories.d.ts +9 -1
- package/dist/types/components/Button/stories/ButtonIcon.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonLabel.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonLoading.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonMuted.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonMutedIcon.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonShape.stories.d.ts +2 -1
- package/dist/types/components/Button/stories/ButtonSize.stories.d.ts +2 -1
- package/dist/types/components/Image/Image.d.ts +2 -3
- package/dist/types/components/Image/Image.interface.d.ts +3 -3
- package/dist/types/components/Image/stories/Image.stories.d.ts +5 -4
- package/dist/types/components/Label/Label.interface.d.ts +2 -2
- package/dist/types/components/Link/Link.interface.d.ts +8 -0
- package/dist/types/components/Pagination/Pagination.interface.d.ts +9 -3
- package/dist/types/components/Select/Select.interface.d.ts +2 -6
- package/dist/types/components/Select/SelectMultiValue.d.ts +1 -1
- package/dist/types/components/Tile/Tile.interface.d.ts +1 -0
- package/dist/types/hooks/useHoldProgress.d.ts +16 -0
- package/package.json +12 -14
package/dist/components/Label.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as Label, a as labelAppearance, l as labelConfig } from '../
|
|
1
|
+
export { L as Label, a as labelAppearance, l as labelConfig } from '../Label_es_BHlo5f-u.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -18,9 +18,9 @@ import '../hooks.js';
|
|
|
18
18
|
import '../hooks/useStyles/styleAttributes.js';
|
|
19
19
|
import '../hooks/useStyles/useStyles.js';
|
|
20
20
|
import 'lodash/maxBy';
|
|
21
|
-
import '../
|
|
21
|
+
import '../Icon_es_DoAtUvPe.js';
|
|
22
22
|
import 'react-inlinesvg';
|
|
23
23
|
import '../hoc/urlWithAssetPrefix.js';
|
|
24
24
|
import '../context/UrlAssetPrefix.js';
|
|
25
|
-
import '../
|
|
25
|
+
import '../Link_es_DPZHTF38.js';
|
|
26
26
|
import '../Text_es_B85LGfjW.js';
|
package/dist/components/Link.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as Link, a as LinkWrapper, b as linkAppearance, l as linkConfig } from '../
|
|
1
|
+
export { L as Link, a as LinkWrapper, b as linkAppearance, l as linkConfig } from '../Link_es_DPZHTF38.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
package/dist/components/List.js
CHANGED
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import { L as Link } from '../
|
|
6
|
+
import { L as Link } from '../Link_es_DPZHTF38.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'lodash/camelCase';
|
|
9
9
|
import 'lodash/castArray';
|
package/dist/components/Logo.js
CHANGED
|
@@ -5,7 +5,7 @@ import { urlWithAssetPrefix } from '../hoc/urlWithAssetPrefix.js';
|
|
|
5
5
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
6
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
|
-
import { a as LinkWrapper } from '../
|
|
8
|
+
import { a as LinkWrapper } from '../Link_es_DPZHTF38.js';
|
|
9
9
|
import '@itcase/common';
|
|
10
10
|
import '../context/UrlAssetPrefix.js';
|
|
11
11
|
import 'lodash/camelCase';
|
|
@@ -4,8 +4,8 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
6
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
7
|
-
import { I as Icon, T as Tooltip } from '../
|
|
8
|
-
import { L as Link } from '../
|
|
7
|
+
import { I as Icon, T as Tooltip } from '../Icon_es_DoAtUvPe.js';
|
|
8
|
+
import { L as Link } from '../Link_es_DPZHTF38.js';
|
|
9
9
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
10
10
|
import 'lodash/camelCase';
|
|
11
11
|
import 'lodash/castArray';
|
package/dist/components/Modal.js
CHANGED
|
@@ -7,7 +7,7 @@ import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
|
|
|
7
7
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
8
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
9
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
10
|
-
import { b as Title, I as Icon } from '../
|
|
10
|
+
import { b as Title, I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
11
11
|
import { O as Overlay } from '../Overlay_es_Dx6UIr2X.js';
|
|
12
12
|
import { L as Loader } from '../Loader_es_DFSNJsLL.js';
|
|
13
13
|
import 'lodash/camelCase';
|
|
@@ -26,7 +26,7 @@ import 'lodash/maxBy';
|
|
|
26
26
|
import 'react-inlinesvg';
|
|
27
27
|
import '../hoc/urlWithAssetPrefix.js';
|
|
28
28
|
import '../context/UrlAssetPrefix.js';
|
|
29
|
-
import '../
|
|
29
|
+
import '../Link_es_DPZHTF38.js';
|
|
30
30
|
import '../Text_es_B85LGfjW.js';
|
|
31
31
|
|
|
32
32
|
const modalAppearanceShape = {
|
|
@@ -5,7 +5,7 @@ import { Sheet } from 'react-modal-sheet';
|
|
|
5
5
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
6
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
|
-
import { b as Title } from '../
|
|
8
|
+
import { b as Title } from '../Icon_es_DoAtUvPe.js';
|
|
9
9
|
import 'lodash/camelCase';
|
|
10
10
|
import 'lodash/castArray';
|
|
11
11
|
import 'lodash/upperFirst';
|
|
@@ -22,7 +22,7 @@ import 'lodash/maxBy';
|
|
|
22
22
|
import 'react-inlinesvg';
|
|
23
23
|
import '../hoc/urlWithAssetPrefix.js';
|
|
24
24
|
import '../context/UrlAssetPrefix.js';
|
|
25
|
-
import '../
|
|
25
|
+
import '../Link_es_DPZHTF38.js';
|
|
26
26
|
import '../Text_es_B85LGfjW.js';
|
|
27
27
|
|
|
28
28
|
const modalSheetBottomAppearanceSize = {
|
|
@@ -4,8 +4,8 @@ import { mergeAppearanceKeys } from '../utils/mergeAppearanceKeys.js';
|
|
|
4
4
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
6
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
7
|
-
import { B as Button } from '../
|
|
8
|
-
import { I as Icon } from '../
|
|
7
|
+
import { B as Button } from '../Button_es_C2vKuxE7.js';
|
|
8
|
+
import { I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
9
9
|
import { L as Loader } from '../Loader_es_DFSNJsLL.js';
|
|
10
10
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
11
11
|
import { icons24 } from '@itcase/icons/default';
|
|
@@ -23,7 +23,8 @@ import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
|
23
23
|
import 'react-responsive';
|
|
24
24
|
import '../utils/setViewportProperty.js';
|
|
25
25
|
import 'lodash/maxBy';
|
|
26
|
-
import '../
|
|
26
|
+
import '../hooks/useHoldProgress.js';
|
|
27
|
+
import '../Link_es_DPZHTF38.js';
|
|
27
28
|
import 'react-inlinesvg';
|
|
28
29
|
import '../hoc/urlWithAssetPrefix.js';
|
|
29
30
|
import '../context/UrlAssetPrefix.js';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo, useState, useCallback } from 'react';
|
|
2
|
+
import { useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import ceil from 'lodash/ceil';
|
|
5
4
|
import ReactPaginate from 'react-paginate';
|
|
6
5
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { D as Dropdown, a as DropdownItem } from '../
|
|
10
|
-
import { I as Icon } from '../
|
|
8
|
+
import { D as Dropdown, a as DropdownItem } from '../DropdownItem_es_QniQAKA2.js';
|
|
9
|
+
import { I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
11
10
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
12
11
|
import { icons14, icons16, icons24 } from '@itcase/icons/default';
|
|
13
12
|
import 'lodash/camelCase';
|
|
@@ -27,7 +26,7 @@ import '../Divider_es_BR7ZO8w0.js';
|
|
|
27
26
|
import 'react-inlinesvg';
|
|
28
27
|
import '../hoc/urlWithAssetPrefix.js';
|
|
29
28
|
import '../context/UrlAssetPrefix.js';
|
|
30
|
-
import '../
|
|
29
|
+
import '../Link_es_DPZHTF38.js';
|
|
31
30
|
|
|
32
31
|
const paginationAppearanceAccent = {
|
|
33
32
|
accentPrimary: {
|
|
@@ -236,11 +235,13 @@ function Pagination(props) {
|
|
|
236
235
|
return onChangePage;
|
|
237
236
|
}, [onChangePage, onPageChange]);
|
|
238
237
|
const _onChangePerPageCount = useMemo(() => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
return (perPageCount) => {
|
|
239
|
+
if (onPerPageCountChange) {
|
|
240
|
+
console.warn('@itcase/ui Pagination warning: "onPerPageCountChange" is deprecated, use "onChangePerPageCount" instead.');
|
|
241
|
+
return onPerPageCountChange(perPageCount);
|
|
242
|
+
}
|
|
243
|
+
return onChangePerPageCount(perPageCount);
|
|
244
|
+
};
|
|
244
245
|
}, [onChangePerPageCount, onPerPageCountChange]);
|
|
245
246
|
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
|
|
246
247
|
const [activeDropdownItem, setActiveDropdownItem] = useState(perPageCount);
|
|
@@ -254,13 +255,13 @@ function Pagination(props) {
|
|
|
254
255
|
}, []);
|
|
255
256
|
const handleDropdownItemClick = useCallback((event, item) => {
|
|
256
257
|
event.stopPropagation();
|
|
257
|
-
_onChangePerPageCount
|
|
258
|
+
_onChangePerPageCount(item);
|
|
258
259
|
setActiveDropdownItem(item);
|
|
259
260
|
setIsOpenDropdown(false);
|
|
260
261
|
}, [_onChangePerPageCount]);
|
|
261
262
|
const paginationPagesCount = useMemo(() => {
|
|
262
263
|
if (allItemsCount && allItemsCount > 0) {
|
|
263
|
-
return ceil(allItemsCount / perPageCount);
|
|
264
|
+
return Math.ceil(allItemsCount / perPageCount);
|
|
264
265
|
}
|
|
265
266
|
return 0;
|
|
266
267
|
}, [allItemsCount, perPageCount]);
|
|
@@ -271,6 +272,42 @@ function Pagination(props) {
|
|
|
271
272
|
}
|
|
272
273
|
return 0;
|
|
273
274
|
}, [pageNumber]);
|
|
275
|
+
// Keep track of previous perPageCount value
|
|
276
|
+
const prevPageCountRef = useRef(perPageCount);
|
|
277
|
+
// When perPageCount changes and current pageNumber is invalid (even if in range).
|
|
278
|
+
useEffect(() => {
|
|
279
|
+
// If page number is 5 and perPageCount is 10 and there is 200 items in total,
|
|
280
|
+
// then user is seeing items from 41 to 50.
|
|
281
|
+
// Without this effect, when perPageCount changes to 20, pageNumber remains 5,
|
|
282
|
+
// which mean user will see items from 81 to 100, which is not expected.
|
|
283
|
+
// So we recalculate pageNumber to make sure user sees items from 41 to 60.
|
|
284
|
+
// pageNumber 1, perPageCount 10 -> items 1-10
|
|
285
|
+
// pageNumber 2, perPageCount 10 -> items 11-20
|
|
286
|
+
// pageNumber 3, perPageCount 10 -> items 21-30
|
|
287
|
+
// pageNumber 4, perPageCount 10 -> items 31-40
|
|
288
|
+
// pageNumber 5, perPageCount 10 -> items 41-50
|
|
289
|
+
// pageNumber 1, perPageCount 20 -> items 1-20
|
|
290
|
+
// pageNumber 2, perPageCount 20 -> items 21-40
|
|
291
|
+
// pageNumber 3, perPageCount 20 -> items 41-60
|
|
292
|
+
// pageNumber 4, perPageCount 20 -> items 61-80
|
|
293
|
+
// pageNumber 5, perPageCount 20 -> items 81-100
|
|
294
|
+
const prevPageCount = prevPageCountRef.current;
|
|
295
|
+
// Update previous perPageCount value
|
|
296
|
+
prevPageCountRef.current = perPageCount;
|
|
297
|
+
const firstItemIndex = (pageNumber - 1) * prevPageCount + 1;
|
|
298
|
+
const newPageNumber = Math.ceil(firstItemIndex / perPageCount);
|
|
299
|
+
if (newPageNumber !== pageNumber) {
|
|
300
|
+
_onChangePage({ selected: newPageNumber - 1 });
|
|
301
|
+
}
|
|
302
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
303
|
+
}, [perPageCount]);
|
|
304
|
+
// When allItemsCount changes and current pageNumber is out of range
|
|
305
|
+
useEffect(() => {
|
|
306
|
+
if (pageNumber > paginationPagesCount && paginationPagesCount > 0) {
|
|
307
|
+
_onChangePage({ selected: paginationPagesCount - 1 });
|
|
308
|
+
}
|
|
309
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
310
|
+
}, [allItemsCount]);
|
|
274
311
|
const appearanceConfig = useAppearanceConfig(appearance, paginationConfig, isDisabled);
|
|
275
312
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
276
313
|
const { justifyContentClass, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, fillInputClass, fillInputHoverClass, fillInputShapeClass, fillInputShapeStrengthClass, textColorActiveClass, textColorActiveHoverClass, textColorClass, textColorHoverClass, textSizeClass, builderIcon, builderIconFill, builderIconFillIcon, builderIconFillSize, builderIconSize, marginPagesDisplayed, nextIcon, nextIconFill, nextIconFillIcon, nextIconFillSize, nextIconSize, pageCountDescTextColor, pageCountDescTextSize, pageCountDropdownAlignment, pageCountDropdownElevation, pageCountDropdownFill, pageCountDropdownFillHover, pageCountDropdownItemDividerFill, pageCountDropdownItemDividerSize, pageCountDropdownItemFill, pageCountDropdownItemFillActive, pageCountDropdownItemFillActiveHover, pageCountDropdownItemFillHover, pageCountDropdownItemLabelAlign, pageCountDropdownItemLabelColor, pageCountDropdownItemLabelColorActive, pageCountDropdownItemLabelColorActiveHover, pageCountDropdownItemLabelColorHover, pageCountDropdownItemLabelSize, pageCountDropdownItemLabelWrap, pageCountDropdownItemShowDivider, pageCountDropdownItemSize, pageCountDropdownItemWidth, pageCountDropdownShape, pageCountDropdownShapeStrength, pageCountInputIcon, pageCountInputIconColor, pageCountInputIconFillSize, pageCountInputIconSrc, pageCountInputTextColor, pageCountInputTextSize, pageRangeDisplayed, previousIcon, previousIconFill, previousIconFillIcon, previousIconFillSize, previousIconSize, sizeClass, } = propsGenerator;
|
|
@@ -6,7 +6,7 @@ import { urlWithAssetPrefix } from '../hoc/urlWithAssetPrefix.js';
|
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { B as Button } from '../
|
|
9
|
+
import { B as Button } from '../Button_es_C2vKuxE7.js';
|
|
10
10
|
import { G as Group } from '../Group_es_BVpRj4LR.js';
|
|
11
11
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
12
12
|
import '@itcase/common';
|
|
@@ -24,9 +24,10 @@ import '../hooks.js';
|
|
|
24
24
|
import '../hooks/useStyles/styleAttributes.js';
|
|
25
25
|
import 'lodash/maxBy';
|
|
26
26
|
import '../utils/mergeAppearanceKeys.js';
|
|
27
|
-
import '../
|
|
27
|
+
import '../hooks/useHoldProgress.js';
|
|
28
|
+
import '../Icon_es_DoAtUvPe.js';
|
|
28
29
|
import 'react-inlinesvg';
|
|
29
|
-
import '../
|
|
30
|
+
import '../Link_es_DPZHTF38.js';
|
|
30
31
|
import '../Loader_es_DFSNJsLL.js';
|
|
31
32
|
|
|
32
33
|
const responseAppearanceConfirm = {
|
|
@@ -53,7 +54,7 @@ const responseAppearanceDanger = {
|
|
|
53
54
|
primaryButtonAppearance: 'dangerPrimary sizeXXL solid',
|
|
54
55
|
secondaryButtonAppearance: 'surfaceSecondary sizeXXL solid',
|
|
55
56
|
svgFill: 'dangerPrimary',
|
|
56
|
-
svgPathFill: '
|
|
57
|
+
svgPathFill: 'dangerPrimary',
|
|
57
58
|
},
|
|
58
59
|
};
|
|
59
60
|
|
|
@@ -67,7 +68,7 @@ const responseAppearanceEmpty = {
|
|
|
67
68
|
primaryButtonAppearance: 'accentPrimary sizeXXL solid',
|
|
68
69
|
secondaryButtonAppearance: 'surfaceSecondary sizeXXL solid',
|
|
69
70
|
svgFill: 'surfaceTertiary',
|
|
70
|
-
svgPathFill: '
|
|
71
|
+
svgPathFill: 'surfaceQuaternary',
|
|
71
72
|
},
|
|
72
73
|
};
|
|
73
74
|
|
|
@@ -5,7 +5,7 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
6
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
8
|
-
import { I as Icon } from '../
|
|
8
|
+
import { I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
9
9
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
10
10
|
import { S as Scrollbar } from '../Scrollbar_es_CKTh3pew.js';
|
|
11
11
|
import 'lodash/camelCase';
|
|
@@ -24,7 +24,7 @@ import 'lodash/maxBy';
|
|
|
24
24
|
import 'react-inlinesvg';
|
|
25
25
|
import '../hoc/urlWithAssetPrefix.js';
|
|
26
26
|
import '../context/UrlAssetPrefix.js';
|
|
27
|
-
import '../
|
|
27
|
+
import '../Link_es_DPZHTF38.js';
|
|
28
28
|
import 'react-scrollbars-custom';
|
|
29
29
|
|
|
30
30
|
const searchAppearanceDefault = {
|
|
@@ -3,7 +3,7 @@ import { useRef, useMemo, createRef, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
-
import { I as Icon } from '../
|
|
6
|
+
import { I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
7
7
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
8
8
|
import 'lodash/camelCase';
|
|
9
9
|
import 'lodash/castArray';
|
|
@@ -22,7 +22,7 @@ import '../hoc/urlWithAssetPrefix.js';
|
|
|
22
22
|
import '../context/UrlAssetPrefix.js';
|
|
23
23
|
import '../hooks/useStyles/useStyles.js';
|
|
24
24
|
import 'lodash/maxBy';
|
|
25
|
-
import '../
|
|
25
|
+
import '../Link_es_DPZHTF38.js';
|
|
26
26
|
|
|
27
27
|
const segmentedAppearanceDefault = {
|
|
28
28
|
defaultPrimary: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../
|
|
1
|
+
export { S as Select, a as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../SelectContainer_es_Cr3Zset9.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -23,11 +23,11 @@ import '../hooks/useStyles/useStyles.js';
|
|
|
23
23
|
import 'lodash/maxBy';
|
|
24
24
|
import '../Text_es_B85LGfjW.js';
|
|
25
25
|
import '@itcase/icons/default';
|
|
26
|
-
import '../
|
|
26
|
+
import '../Icon_es_DoAtUvPe.js';
|
|
27
27
|
import 'react-inlinesvg';
|
|
28
28
|
import '../hoc/urlWithAssetPrefix.js';
|
|
29
29
|
import '../context/UrlAssetPrefix.js';
|
|
30
|
-
import '../
|
|
30
|
+
import '../Link_es_DPZHTF38.js';
|
|
31
31
|
import '../Loader_es_DFSNJsLL.js';
|
|
32
32
|
import '../utils/mergeAppearanceKeys.js';
|
|
33
33
|
import '../Divider_es_BR7ZO8w0.js';
|
|
@@ -6,7 +6,7 @@ import { G as Group } from '../Group_es_BVpRj4LR.js';
|
|
|
6
6
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { b as Title } from '../
|
|
9
|
+
import { b as Title } from '../Icon_es_DoAtUvPe.js';
|
|
10
10
|
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
11
11
|
import 'lodash/camelCase';
|
|
12
12
|
import 'lodash/castArray';
|
|
@@ -24,7 +24,7 @@ import 'lodash/maxBy';
|
|
|
24
24
|
import 'react-inlinesvg';
|
|
25
25
|
import '../hoc/urlWithAssetPrefix.js';
|
|
26
26
|
import '../context/UrlAssetPrefix.js';
|
|
27
|
-
import '../
|
|
27
|
+
import '../Link_es_DPZHTF38.js';
|
|
28
28
|
|
|
29
29
|
function Swiper(props) {
|
|
30
30
|
const { id, className, dataTestId, dataTour, direction, minZoom = 1, maxZoom = 5, title, titleAfter, titleSize, titleTextColor, titleWeight, activeSlideIndex = 0, allowTouchMove, autoHeight, breakpoints, forwardedRef, freeMode, items, keyboard, loop, modules, mousewheel, nextButton, normalizeSlideIndex, pagination, prevButton, preventClicks, preventClicksPropagation, simulateTouch, slidesPerView, spaceBetween, speed, swiperClass, swiperSlideClass, isChangeOnClickSlide, isInit, isNavigation = false, isScrollbar, isShowOriginalLink = false, isZoomEnabled = false, setNextBtnDisabled, setPrevBtnDisabled, onSlideNextTransitionEnd, onSlidePrevTransitionEnd, onSwiper, onUpdate, children, } = props;
|
package/dist/components/Tab.js
CHANGED
|
@@ -6,9 +6,9 @@ import { useActiveClasses } from '../hooks/useActiveClasses/useActiveClasses.js'
|
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { B as Badge, I as Icon } from '../
|
|
9
|
+
import { B as Badge, I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
10
10
|
import { D as Divider } from '../Divider_es_BR7ZO8w0.js';
|
|
11
|
-
import { L as Link } from '../
|
|
11
|
+
import { L as Link } from '../Link_es_DPZHTF38.js';
|
|
12
12
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
13
13
|
import '../hooks/useActiveClasses/useActiveClasses.helpers.js';
|
|
14
14
|
import 'lodash/camelCase';
|
package/dist/components/Tile.js
CHANGED
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import { b as Title, B as Badge, I as Icon } from '../
|
|
6
|
+
import { b as Title, B as Badge, I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
7
7
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import 'lodash/camelCase';
|
|
@@ -22,7 +22,7 @@ import 'lodash/maxBy';
|
|
|
22
22
|
import 'react-inlinesvg';
|
|
23
23
|
import '../hoc/urlWithAssetPrefix.js';
|
|
24
24
|
import '../context/UrlAssetPrefix.js';
|
|
25
|
-
import '../
|
|
25
|
+
import '../Link_es_DPZHTF38.js';
|
|
26
26
|
|
|
27
27
|
const tileAppearanceShape = {
|
|
28
28
|
circular: {
|
|
@@ -56,7 +56,7 @@ const tileAppearanceSize = {
|
|
|
56
56
|
descTextSize: 'l',
|
|
57
57
|
badgeAppearanceSize: 'sizeM',
|
|
58
58
|
iconFillSize: '32',
|
|
59
|
-
iconSize: '
|
|
59
|
+
iconSize: '24',
|
|
60
60
|
},
|
|
61
61
|
sizeL: {
|
|
62
62
|
size: 'l',
|
|
@@ -163,12 +163,12 @@ const tileConfig = {
|
|
|
163
163
|
},
|
|
164
164
|
};
|
|
165
165
|
function Tile(props) {
|
|
166
|
-
const { appearance, className, dataTestId, dataTour, type, title, desc, badgeValue, before, after, isSkeleton, onClick, children, } = props;
|
|
166
|
+
const { appearance, className, dataTestId, dataTour, type, title, desc, badgeValue, iconClick, before, after, isSkeleton, onClick, children, } = props;
|
|
167
167
|
const appearanceConfig = useAppearanceConfig(appearance, tileConfig);
|
|
168
168
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
169
169
|
const { directionClass, alignClass, alignDirectionClass, fillClass, titleTextAlign, titleTextColor, titleTextSize, titleTextWeight, titleTextWrap, descTextColor, descTextSize, descTextWrap, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, icon, iconAppearance, iconFill, iconFillIcon, iconFillSize, iconShape, iconSize, iconSrc, shapeClass, shapeStrengthClass, sizeClass, widthClass, } = propsGenerator;
|
|
170
170
|
const { styles: tileStyles } = useStyles(props);
|
|
171
|
-
return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance: `${badgeAppearance} ${badgeAppearanceSize}`, className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsx(Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon }))] })] }), children, after] }) }));
|
|
171
|
+
return (jsx("div", { className: clsx('tile', className, fillClass && `fill_${fillClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignClass && `align_${alignClass}`, directionClass && `direction_${directionClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tile_size_${sizeClass}`, type && `tile_type_${type}`, badgeValue && `tile_state_badge`, widthClass && `width_${widthClass}`, isSkeleton && `tile_skeleton`), "data-testid": dataTestId, "data-tour": dataTour, style: tileStyles, onClick: onClick, children: jsxs("div", { className: clsx('tile__wrapper', alignClass, alignDirectionClass), children: [before, jsxs("div", { className: "tile__header", children: [jsxs("div", { className: "tile__header-inner", children: [title && (jsx(Title, { className: "tile__title", size: titleTextSize, textAlign: titleTextAlign, textColor: titleTextColor, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), desc && (jsx(Text, { className: "tile__text", size: descTextSize, textColor: descTextColor, textWrap: descTextWrap, children: desc }))] }), jsxs("div", { className: "tile__header-actions", children: [badgeValue && (jsx(Badge, { appearance: `${badgeAppearance} ${badgeAppearanceSize}`, className: "tile__badge", size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), (icon || iconSrc) && (jsx(Icon, { appearance: iconAppearance, className: "tile__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon, onClick: iconClick }))] })] }), children, after] }) }));
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export { Tile, tileAppearance, tileConfig };
|
package/dist/components/Title.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as Title, d as titleAppearance, c as titleConfig } from '../
|
|
1
|
+
export { b as Title, d as titleAppearance, c as titleConfig } from '../Icon_es_DoAtUvPe.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -21,5 +21,5 @@ import '../hooks.js';
|
|
|
21
21
|
import '../hooks/useStyles/styleAttributes.js';
|
|
22
22
|
import '../hooks/useStyles/useStyles.js';
|
|
23
23
|
import 'lodash/maxBy';
|
|
24
|
-
import '../
|
|
24
|
+
import '../Link_es_DPZHTF38.js';
|
|
25
25
|
import '../Text_es_B85LGfjW.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as Tooltip, a as tooltipAppearance, t as tooltipConfig } from '../
|
|
1
|
+
export { T as Tooltip, a as tooltipAppearance, t as tooltipConfig } from '../Icon_es_DoAtUvPe.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -21,5 +21,5 @@ import '../hooks.js';
|
|
|
21
21
|
import '../hooks/useStyles/styleAttributes.js';
|
|
22
22
|
import '../hooks/useStyles/useStyles.js';
|
|
23
23
|
import 'lodash/maxBy';
|
|
24
|
-
import '../
|
|
24
|
+
import '../Link_es_DPZHTF38.js';
|
|
25
25
|
import '../Text_es_B85LGfjW.js';
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
6
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
7
|
-
import { I as Icon } from '../
|
|
7
|
+
import { I as Icon } from '../Icon_es_DoAtUvPe.js';
|
|
8
8
|
import { T as Text } from '../Text_es_B85LGfjW.js';
|
|
9
9
|
import { icons16 } from '@itcase/icons/default';
|
|
10
10
|
import 'lodash/camelCase';
|
|
@@ -23,7 +23,7 @@ import 'lodash/maxBy';
|
|
|
23
23
|
import 'react-inlinesvg';
|
|
24
24
|
import '../hoc/urlWithAssetPrefix.js';
|
|
25
25
|
import '../context/UrlAssetPrefix.js';
|
|
26
|
-
import '../
|
|
26
|
+
import '../Link_es_DPZHTF38.js';
|
|
27
27
|
|
|
28
28
|
const warningAppearanceAccent = {
|
|
29
29
|
accentMutedPrimary: {
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
|
|
218
218
|
@define-mixin email-text-xs $weight: normal {
|
|
219
219
|
@mixin font-fixed $weight, var(--typography-email-text-xs),
|
|
220
|
-
var(--
|
|
220
|
+
var(--typographyemail-text-xs-line-height), var(--font-email);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
@define-mixin email-text-xxs $weight: normal {
|
|
@@ -47362,10 +47362,38 @@ div.avatar-stack {
|
|
|
47362
47362
|
top: 0;
|
|
47363
47363
|
z-index: 1;
|
|
47364
47364
|
}
|
|
47365
|
+
&_state {
|
|
47366
|
+
&_holding {
|
|
47367
|
+
& .button__indication {
|
|
47368
|
+
&-item {
|
|
47369
|
+
transform: translate(0%, 0) !important;
|
|
47370
|
+
}
|
|
47371
|
+
}
|
|
47372
|
+
}
|
|
47373
|
+
}
|
|
47365
47374
|
&__wrapper {
|
|
47366
47375
|
display: flex;
|
|
47367
47376
|
justify-content: center;
|
|
47368
47377
|
align-items: center;
|
|
47378
|
+
position: relative;
|
|
47379
|
+
^&__indication {
|
|
47380
|
+
position: absolute;
|
|
47381
|
+
left: 0;
|
|
47382
|
+
top: 0;
|
|
47383
|
+
bottom: 0;
|
|
47384
|
+
right: 0;
|
|
47385
|
+
overflow: hidden;
|
|
47386
|
+
&-item {
|
|
47387
|
+
transition: 0.5s ease-out;
|
|
47388
|
+
position: absolute;
|
|
47389
|
+
width: 100%;
|
|
47390
|
+
height: 100%;
|
|
47391
|
+
opacity: 50%;
|
|
47392
|
+
background: #000;
|
|
47393
|
+
opacity: 10%;
|
|
47394
|
+
transform: translate(-100%, 0);
|
|
47395
|
+
}
|
|
47396
|
+
}
|
|
47369
47397
|
^&__label {
|
|
47370
47398
|
text-decoration: none;
|
|
47371
47399
|
text-align: center;
|
|
@@ -80357,15 +80385,14 @@ div.label {
|
|
|
80357
80385
|
width: auto;
|
|
80358
80386
|
height: auto;
|
|
80359
80387
|
position: absolute;
|
|
80388
|
+
display: flex;
|
|
80360
80389
|
left: 50%;
|
|
80361
80390
|
top: 50%;
|
|
80362
|
-
display: flex;
|
|
80363
80391
|
transform: translate(-50%, -50%);
|
|
80364
80392
|
}
|
|
80365
80393
|
^^&__item {
|
|
80366
80394
|
border-radius: 100%;
|
|
80367
80395
|
display: inline-block;
|
|
80368
|
-
border-radius: 50%;
|
|
80369
80396
|
animation: loaderSimple 1.4s infinite ease-in-out both;
|
|
80370
80397
|
&:first-child {
|
|
80371
80398
|
animation-delay: -0.32s;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const FRAME_DURATION = 16; // Approximate duration of a frame in milliseconds
|
|
4
|
+
const HOLD_STATE = {
|
|
5
|
+
HOLDING: 'holding',
|
|
6
|
+
IDLE: 'idle',
|
|
7
|
+
};
|
|
8
|
+
function useHoldProgress(options) {
|
|
9
|
+
const { holdDurationMs = 500, onHoldComplete } = options;
|
|
10
|
+
const animationFrameIdRef = useRef(null);
|
|
11
|
+
const onHoldCompleteRef = useRef(onHoldComplete);
|
|
12
|
+
const [holdState, setState] = useState(HOLD_STATE.IDLE);
|
|
13
|
+
// const [holdProgress, setProgress] = useState(0) // Progress from 0 to 1
|
|
14
|
+
const holdProgressRef = useRef(0);
|
|
15
|
+
// onHoldCompleteRef is not used in render, so it's safe to ignore lint rule here
|
|
16
|
+
// eslint-disable-next-line react-hooks/refs
|
|
17
|
+
onHoldCompleteRef.current = onHoldComplete;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
function updateProgress() {
|
|
20
|
+
if (holdState === HOLD_STATE.HOLDING && holdProgressRef.current === 1) {
|
|
21
|
+
onHoldCompleteRef.current && onHoldCompleteRef.current();
|
|
22
|
+
}
|
|
23
|
+
if (holdState === HOLD_STATE.HOLDING && holdProgressRef.current < 1) {
|
|
24
|
+
const prevProgress = holdProgressRef.current;
|
|
25
|
+
const newProgress = Math.min(prevProgress + FRAME_DURATION / holdDurationMs, 1);
|
|
26
|
+
holdProgressRef.current = newProgress;
|
|
27
|
+
animationFrameIdRef.current = requestAnimationFrame(updateProgress);
|
|
28
|
+
}
|
|
29
|
+
if (holdState === HOLD_STATE.IDLE && holdProgressRef.current > 0) {
|
|
30
|
+
const prevProgress = holdProgressRef.current;
|
|
31
|
+
const newProgress = Math.max(prevProgress - FRAME_DURATION / holdDurationMs, 0);
|
|
32
|
+
holdProgressRef.current = newProgress;
|
|
33
|
+
animationFrameIdRef.current = requestAnimationFrame(updateProgress);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
animationFrameIdRef.current = requestAnimationFrame(updateProgress);
|
|
37
|
+
return () => {
|
|
38
|
+
if (animationFrameIdRef.current) {
|
|
39
|
+
cancelAnimationFrame(animationFrameIdRef.current);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, [holdState, holdDurationMs]);
|
|
43
|
+
const onHoldStart = useCallback((event) => {
|
|
44
|
+
// Only proceed if it's a touch event or left mouse button (button 0)
|
|
45
|
+
if (event.pointerType === 'touch' || event.button === 0) {
|
|
46
|
+
setState(HOLD_STATE.HOLDING);
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
const onHoldEnd = useCallback((_event) => {
|
|
50
|
+
setState(HOLD_STATE.IDLE);
|
|
51
|
+
}, []);
|
|
52
|
+
return {
|
|
53
|
+
holdState,
|
|
54
|
+
onHoldEnd,
|
|
55
|
+
onHoldStart,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { useHoldProgress };
|
|
@@ -54,7 +54,7 @@ declare const Button: React.ForwardRefExoticComponent<{
|
|
|
54
54
|
wrap?: import("@itcase/types").WrapProps;
|
|
55
55
|
zeroGap?: boolean;
|
|
56
56
|
zeroPadding?: boolean;
|
|
57
|
-
} & import("../../hooks/useStyles/styleAttributes.interface").StyleAttributes & {
|
|
57
|
+
} & Pick<import("../../hooks/useHoldProgress").UseHoldProgressOptions, "onHoldComplete"> & import("../../hooks/useStyles/styleAttributes.interface").StyleAttributes & {
|
|
58
58
|
after?: string;
|
|
59
59
|
appearance?: import("@itcase/types").CompositeAppearanceKey;
|
|
60
60
|
Badge?: React.ReactNode;
|
|
@@ -67,6 +67,7 @@ declare const Button: React.ForwardRefExoticComponent<{
|
|
|
67
67
|
href?: import("../Link/Link.interface").LinkWrapperProps["href"];
|
|
68
68
|
htmlType?: import("../Link/Link.interface").LinkWrapperProps["type"];
|
|
69
69
|
isDisabled?: import("../Link/Link.interface").LinkWrapperProps["disabled"];
|
|
70
|
+
isHolding?: boolean;
|
|
70
71
|
isLoading?: boolean;
|
|
71
72
|
isSkeleton?: boolean;
|
|
72
73
|
label?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { AlignProps, AppearanceIconSizeKey, AppearanceKeysDefault, AppearanceShapeKey, AppearanceSizeKey, AppearanceStyleKey, BorderColorProps, BorderTypeProps, BorderWidthProps, CompositeAppearanceKey, ElevationProps, FillHoverProps, FillProps, ShapeProps, ShapeStrengthProps, SizeProps, WrapProps } from '@itcase/types';
|
|
3
|
+
import { UseHoldProgressOptions } from '../../hooks/useHoldProgress';
|
|
3
4
|
import { StyleAttributes } from '../../hooks/useStyles/styleAttributes.interface';
|
|
4
5
|
import { IconProps } from '../Icon/Icon.interface';
|
|
5
6
|
import { LinkWrapperProps } from '../Link/Link.interface';
|
|
@@ -59,7 +60,7 @@ type ButtonAppearanceProps = {
|
|
|
59
60
|
zeroGap?: boolean;
|
|
60
61
|
zeroPadding?: boolean;
|
|
61
62
|
};
|
|
62
|
-
type ButtonProps = ButtonAppearanceProps & StyleAttributes & {
|
|
63
|
+
type ButtonProps = ButtonAppearanceProps & Pick<UseHoldProgressOptions, 'onHoldComplete'> & StyleAttributes & {
|
|
63
64
|
after?: string;
|
|
64
65
|
appearance?: CompositeAppearanceKey;
|
|
65
66
|
Badge?: ReactNode;
|
|
@@ -72,6 +73,7 @@ type ButtonProps = ButtonAppearanceProps & StyleAttributes & {
|
|
|
72
73
|
href?: LinkWrapperProps['href'];
|
|
73
74
|
htmlType?: LinkWrapperProps['type'];
|
|
74
75
|
isDisabled?: LinkWrapperProps['disabled'];
|
|
76
|
+
isHolding?: boolean;
|
|
75
77
|
isLoading?: boolean;
|
|
76
78
|
isSkeleton?: boolean;
|
|
77
79
|
label?: string;
|
|
@@ -54,7 +54,7 @@ declare const meta: {
|
|
|
54
54
|
wrap?: import("@itcase/types").WrapProps;
|
|
55
55
|
zeroGap?: boolean;
|
|
56
56
|
zeroPadding?: boolean;
|
|
57
|
-
} & import("../../../hooks/useStyles/styleAttributes.interface").StyleAttributes & {
|
|
57
|
+
} & Pick<import("../../../hooks/useHoldProgress").UseHoldProgressOptions, "onHoldComplete"> & import("../../../hooks/useStyles/styleAttributes.interface").StyleAttributes & {
|
|
58
58
|
after?: string;
|
|
59
59
|
appearance?: import("@itcase/types").CompositeAppearanceKey;
|
|
60
60
|
Badge?: import("react").ReactNode;
|
|
@@ -67,6 +67,7 @@ declare const meta: {
|
|
|
67
67
|
href?: import("../../Link/Link.interface").LinkWrapperProps["href"];
|
|
68
68
|
htmlType?: import("../../Link/Link.interface").LinkWrapperProps["type"];
|
|
69
69
|
isDisabled?: import("../../Link/Link.interface").LinkWrapperProps["disabled"];
|
|
70
|
+
isHolding?: boolean;
|
|
70
71
|
isLoading?: boolean;
|
|
71
72
|
isSkeleton?: boolean;
|
|
72
73
|
label?: string;
|