@cloud-ru/ds-uikit-product-widget 1.0.0 → 1.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-ru/ds-uikit-product-widget",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Карточка продуктового виджета с кликабельным заголовком, SegmentControl, действиями и состояниями loading/error.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,17 +41,17 @@
41
41
  "dependencies": {
42
42
  "classnames": "^2.5.1",
43
43
  "@cloud-ru/ds-button": "^1.0.0",
44
- "@cloud-ru/ds-icons": "^1.0.0",
45
- "@cloud-ru/ds-locale": "^1.0.0",
46
- "@cloud-ru/ds-list": "^1.0.0",
47
- "@cloud-ru/ds-materials": "^1.0.0",
48
44
  "@cloud-ru/ds-adaptive": "^1.0.0",
45
+ "@cloud-ru/ds-list": "^1.1.0",
46
+ "@cloud-ru/ds-locale": "^1.0.0",
49
47
  "@cloud-ru/ds-info-block": "^1.0.0",
48
+ "@cloud-ru/ds-materials": "^1.0.0",
50
49
  "@cloud-ru/ds-segment-control": "^1.0.0",
50
+ "@cloud-ru/ds-icons": "^1.0.0",
51
51
  "@cloud-ru/ds-skeleton": "^1.0.0",
52
- "@cloud-ru/ds-utils": "^1.0.0",
53
52
  "@cloud-ru/ds-tooltip": "^1.0.0",
54
- "@cloud-ru/ds-uikit-product-title-clickable": "^1.0.0"
53
+ "@cloud-ru/ds-uikit-product-title-clickable": "^1.0.0",
54
+ "@cloud-ru/ds-utils": "^1.0.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
@@ -1,9 +0,0 @@
1
- import { WidgetActionListEntry } from '../../types';
2
- type ActionListProps = {
3
- items: WidgetActionListEntry[];
4
- className?: string;
5
- closeOnItemClick?: boolean;
6
- onItemClick?: () => void;
7
- };
8
- export declare const ActionList: import("react").NamedExoticComponent<ActionListProps>;
9
- export {};
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionList = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const button_1 = require("@cloud-ru/ds-button");
9
- const classnames_1 = __importDefault(require("classnames"));
10
- const react_1 = require("react");
11
- const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
- function isGroup(item) {
13
- return 'type' in item && item.type === 'group';
14
- }
15
- function renderItem(item, index, close) {
16
- if (isGroup(item)) {
17
- const visibleItems = item.items.filter(groupItem => !groupItem.hidden);
18
- if (!visibleItems.length) {
19
- return null;
20
- }
21
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.group, "data-divider": item.divider || undefined, children: [item.label && (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.groupLabel, children: item.label }), visibleItems.map((groupItem, groupIndex) => renderItem(groupItem, groupIndex, close))] }, index));
22
- }
23
- if (item.hidden) {
24
- return null;
25
- }
26
- return ((0, jsx_runtime_1.jsx)(button_1.Button, { className: styles_module_scss_1.default.item, view: button_1.VIEW.Simple, appearance: 'neutral', size: 's', icon: item.beforeContent, label: item.content.label, disabled: item.disabled, fullWidth: true, onClick: (event) => {
27
- close();
28
- item.onClick?.(event);
29
- } }, index));
30
- }
31
- function ActionListComponent({ items, className, closeOnItemClick = true, onItemClick }) {
32
- const close = () => {
33
- if (closeOnItemClick) {
34
- onItemClick?.();
35
- }
36
- };
37
- return (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.list, className), children: items.map((item, index) => renderItem(item, index, close)) });
38
- }
39
- exports.ActionList = (0, react_1.memo)(ActionListComponent);
@@ -1,9 +0,0 @@
1
- import { WidgetActionListEntry } from '../../types.js';
2
- type ActionListProps = {
3
- items: WidgetActionListEntry[];
4
- className?: string;
5
- closeOnItemClick?: boolean;
6
- onItemClick?: () => void;
7
- };
8
- export declare const ActionList: import("react").NamedExoticComponent<ActionListProps>;
9
- export {};
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, VIEW } from '@cloud-ru/ds-button';
3
- import cn from 'classnames';
4
- import { memo } from 'react';
5
- import styles from './styles.module.css';
6
- function isGroup(item) {
7
- return 'type' in item && item.type === 'group';
8
- }
9
- function renderItem(item, index, close) {
10
- if (isGroup(item)) {
11
- const visibleItems = item.items.filter(groupItem => !groupItem.hidden);
12
- if (!visibleItems.length) {
13
- return null;
14
- }
15
- return (_jsxs("div", { className: styles.group, "data-divider": item.divider || undefined, children: [item.label && _jsx("div", { className: styles.groupLabel, children: item.label }), visibleItems.map((groupItem, groupIndex) => renderItem(groupItem, groupIndex, close))] }, index));
16
- }
17
- if (item.hidden) {
18
- return null;
19
- }
20
- return (_jsx(Button, { className: styles.item, view: VIEW.Simple, appearance: 'neutral', size: 's', icon: item.beforeContent, label: item.content.label, disabled: item.disabled, fullWidth: true, onClick: (event) => {
21
- close();
22
- item.onClick?.(event);
23
- } }, index));
24
- }
25
- function ActionListComponent({ items, className, closeOnItemClick = true, onItemClick }) {
26
- const close = () => {
27
- if (closeOnItemClick) {
28
- onItemClick?.();
29
- }
30
- };
31
- return _jsx("div", { className: cn(styles.list, className), children: items.map((item, index) => renderItem(item, index, close)) });
32
- }
33
- export const ActionList = memo(ActionListComponent);