@hh.ru/magritte-ui-action 4.4.19 → 4.4.20
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/Action.js +1 -1
- package/Skeleton-C7woRF7o.js +25 -0
- package/{Skeleton-aXf97fwN.js.map → Skeleton-C7woRF7o.js.map} +1 -1
- package/Skeleton.js +1 -1
- package/index.css +812 -812
- package/index.js +1 -1
- package/package.json +7 -7
- package/Skeleton-aXf97fwN.js +0 -25
package/Action.js
CHANGED
|
@@ -4,7 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import '@hh.ru/magritte-common-focus-visible';
|
|
6
6
|
import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
|
|
7
|
-
import { s as styles, A as ActionSkeleton } from './Skeleton-
|
|
7
|
+
import { s as styles, A as ActionSkeleton } from './Skeleton-C7woRF7o.js';
|
|
8
8
|
import { ComponentWithBadge } from '@hh.ru/magritte-ui-badge';
|
|
9
9
|
import { enrichWithSkeleton } from '@hh.ru/magritte-ui-skeleton';
|
|
10
10
|
import '@hh.ru/magritte-common-use-loading-state';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { useLoadingState } from '@hh.ru/magritte-common-use-loading-state';
|
|
5
|
+
import { Skeleton } from '@hh.ru/magritte-ui-skeleton';
|
|
6
|
+
|
|
7
|
+
var styles = {"action":"magritte-action___JtMQB_4-4-20","action-show-background":"magritte-action-show-background___Qg0JU_4-4-20","actionShowBackground":"magritte-action-show-background___Qg0JU_4-4-20","action-style-contrast":"magritte-action-style-contrast___5WfIK_4-4-20","actionStyleContrast":"magritte-action-style-contrast___5WfIK_4-4-20","action-hover-style-contrast":"magritte-action-hover-style-contrast___nPdPk_4-4-20","actionHoverStyleContrast":"magritte-action-hover-style-contrast___nPdPk_4-4-20","action-pressed-style-contrast":"magritte-action-pressed-style-contrast___N04Fw_4-4-20","actionPressedStyleContrast":"magritte-action-pressed-style-contrast___N04Fw_4-4-20","action-disable-padding":"magritte-action-disable-padding___F-AR7_4-4-20","actionDisablePadding":"magritte-action-disable-padding___F-AR7_4-4-20","action-style-neutral":"magritte-action-style-neutral___zv0k4_4-4-20","actionStyleNeutral":"magritte-action-style-neutral___zv0k4_4-4-20","action-mode-primary":"magritte-action-mode-primary___AzhY5_4-4-20","actionModePrimary":"magritte-action-mode-primary___AzhY5_4-4-20","action-mode-secondary":"magritte-action-mode-secondary___jvHEK_4-4-20","actionModeSecondary":"magritte-action-mode-secondary___jvHEK_4-4-20","action-hover-style-neutral":"magritte-action-hover-style-neutral___qiLyU_4-4-20","actionHoverStyleNeutral":"magritte-action-hover-style-neutral___qiLyU_4-4-20","action-pressed-style-neutral":"magritte-action-pressed-style-neutral___gMAMl_4-4-20","actionPressedStyleNeutral":"magritte-action-pressed-style-neutral___gMAMl_4-4-20","action-style-accent":"magritte-action-style-accent___5YSMF_4-4-20","actionStyleAccent":"magritte-action-style-accent___5YSMF_4-4-20","action-hover-style-accent":"magritte-action-hover-style-accent___C-bMb_4-4-20","actionHoverStyleAccent":"magritte-action-hover-style-accent___C-bMb_4-4-20","action-pressed-style-accent":"magritte-action-pressed-style-accent___Dc4hr_4-4-20","actionPressedStyleAccent":"magritte-action-pressed-style-accent___Dc4hr_4-4-20","action-style-negative":"magritte-action-style-negative___CrXqj_4-4-20","actionStyleNegative":"magritte-action-style-negative___CrXqj_4-4-20","action-hover-style-negative":"magritte-action-hover-style-negative___rVlDZ_4-4-20","actionHoverStyleNegative":"magritte-action-hover-style-negative___rVlDZ_4-4-20","action-pressed-style-negative":"magritte-action-pressed-style-negative___7ckSN_4-4-20","actionPressedStyleNegative":"magritte-action-pressed-style-negative___7ckSN_4-4-20","action-style-warning":"magritte-action-style-warning___ikeHT_4-4-20","actionStyleWarning":"magritte-action-style-warning___ikeHT_4-4-20","action-hover-style-warning":"magritte-action-hover-style-warning___4jUpU_4-4-20","actionHoverStyleWarning":"magritte-action-hover-style-warning___4jUpU_4-4-20","action-pressed-style-warning":"magritte-action-pressed-style-warning___b2e3N_4-4-20","actionPressedStyleWarning":"magritte-action-pressed-style-warning___b2e3N_4-4-20","action-style-special":"magritte-action-style-special___cav2H_4-4-20","actionStyleSpecial":"magritte-action-style-special___cav2H_4-4-20","action-hover-style-special":"magritte-action-hover-style-special___2HDP-_4-4-20","actionHoverStyleSpecial":"magritte-action-hover-style-special___2HDP-_4-4-20","action-pressed-style-special":"magritte-action-pressed-style-special___B7JXW_4-4-20","actionPressedStyleSpecial":"magritte-action-pressed-style-special___B7JXW_4-4-20","action-skeleton-container":"magritte-action-skeleton-container___5i2G3_4-4-20","actionSkeletonContainer":"magritte-action-skeleton-container___5i2G3_4-4-20","action-skeleton-disable-padding":"magritte-action-skeleton-disable-padding___pofiL_4-4-20","actionSkeletonDisablePadding":"magritte-action-skeleton-disable-padding___pofiL_4-4-20","action-skeleton":"magritte-action-skeleton___zIUA6_4-4-20","actionSkeleton":"magritte-action-skeleton___zIUA6_4-4-20","action-skeleton-show-background":"magritte-action-skeleton-show-background___4xgHf_4-4-20","actionSkeletonShowBackground":"magritte-action-skeleton-show-background___4xgHf_4-4-20"};
|
|
8
|
+
|
|
9
|
+
const ActionSkeleton = ({ Component: Action,
|
|
10
|
+
// skeleton props
|
|
11
|
+
width, height, borderRadius, inline, additionalClass, loading, ...actionProps }) => {
|
|
12
|
+
const isLoading = useLoadingState() || loading;
|
|
13
|
+
if (isLoading) {
|
|
14
|
+
return (jsx("div", { className: classnames(styles.actionSkeletonContainer, {
|
|
15
|
+
[styles.actionSkeletonDisablePadding]: actionProps.disablePadding,
|
|
16
|
+
}), children: jsx(Skeleton, { additionalClass: classnames(styles.actionSkeleton, {
|
|
17
|
+
[styles.actionSkeletonShowBackground]: actionProps.showBackground && !actionProps.disablePadding,
|
|
18
|
+
}) }) }));
|
|
19
|
+
}
|
|
20
|
+
return jsx(Action, { ...actionProps });
|
|
21
|
+
};
|
|
22
|
+
ActionSkeleton.isAction = true;
|
|
23
|
+
|
|
24
|
+
export { ActionSkeleton as A, styles as s };
|
|
25
|
+
//# sourceMappingURL=Skeleton-C7woRF7o.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton-
|
|
1
|
+
{"version":3,"file":"Skeleton-C7woRF7o.js","sources":["../src/Skeleton.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { useLoadingState } from '@hh.ru/magritte-common-use-loading-state';\nimport { ActionProps } from '@hh.ru/magritte-ui-action/types';\nimport { IncompleteSkeletonComponent, Skeleton } from '@hh.ru/magritte-ui-skeleton';\n\nimport styles from './action.less';\n\nexport const ActionSkeleton: IncompleteSkeletonComponent<ActionProps> & { isAction: true } = ({\n Component: Action,\n\n // skeleton props\n width,\n height,\n borderRadius,\n inline,\n additionalClass,\n loading,\n\n ...actionProps\n}) => {\n const isLoading = useLoadingState() || loading;\n\n if (isLoading) {\n return (\n <div\n className={classnames(styles.actionSkeletonContainer, {\n [styles.actionSkeletonDisablePadding]: actionProps.disablePadding,\n })}\n >\n <Skeleton\n additionalClass={classnames(styles.actionSkeleton, {\n [styles.actionSkeletonShowBackground]:\n actionProps.showBackground && !actionProps.disablePadding,\n })}\n />\n </div>\n );\n }\n\n return <Action {...actionProps} />;\n};\n\nActionSkeleton.isAction = true;\n"],"names":["_jsx"],"mappings":";;;;;;;MAQa,cAAc,GAAkE,CAAC,EAC1F,SAAS,EAAE,MAAM;AAEjB;AACA,KAAK,EACL,MAAM,EACN,YAAY,EACZ,MAAM,EACN,eAAe,EACf,OAAO,EAEP,GAAG,WAAW,EACjB,KAAI;AACD,IAAA,MAAM,SAAS,GAAG,eAAe,EAAE,IAAI,OAAO,CAAC;IAE/C,IAAI,SAAS,EAAE;QACX,QACIA,aACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,uBAAuB,EAAE;AAClD,gBAAA,CAAC,MAAM,CAAC,4BAA4B,GAAG,WAAW,CAAC,cAAc;aACpE,CAAC,EAAA,QAAA,EAEFA,GAAC,CAAA,QAAQ,EACL,EAAA,eAAe,EAAE,UAAU,CAAC,MAAM,CAAC,cAAc,EAAE;AAC/C,oBAAA,CAAC,MAAM,CAAC,4BAA4B,GAChC,WAAW,CAAC,cAAc,IAAI,CAAC,WAAW,CAAC,cAAc;iBAChE,CAAC,EAAA,CACJ,EACA,CAAA,EACR;KACL;AAED,IAAA,OAAOA,GAAC,CAAA,MAAM,EAAK,EAAA,GAAA,WAAW,GAAI,CAAC;AACvC,EAAE;AAEF,cAAc,CAAC,QAAQ,GAAG,IAAI;;;;"}
|
package/Skeleton.js
CHANGED
|
@@ -3,5 +3,5 @@ import 'react/jsx-runtime';
|
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import '@hh.ru/magritte-common-use-loading-state';
|
|
5
5
|
import '@hh.ru/magritte-ui-skeleton';
|
|
6
|
-
export { A as ActionSkeleton } from './Skeleton-
|
|
6
|
+
export { A as ActionSkeleton } from './Skeleton-C7woRF7o.js';
|
|
7
7
|
//# sourceMappingURL=Skeleton.js.map
|