@laser-ui/components 0.1.6 → 0.2.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/CHANGELOG.md +13 -0
- package/card/Card.d.ts +2 -0
- package/card/Card.js +6 -12
- package/card/CardActions.d.ts +3 -0
- package/card/CardActions.js +15 -0
- package/card/index.d.ts +1 -1
- package/card/types.d.ts +3 -2
- package/context/props.d.ts +2 -1
- package/dropdown/Dropdown.js +4 -1
- package/fab/types.d.ts +1 -1
- package/internal/popup/Popup.js +1 -1
- package/package.json +4 -4
- package/slides/Slides.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.2.1](https://github.com/laser-ui/laser-ui/compare/v0.2.0...v0.2.1) (2023-10-31)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- use the same values used for the call to addEventListener() when calling removeEventListener() ([deaffc3](https://github.com/laser-ui/laser-ui/commit/deaffc31f60a956ef38085c135ded6ad7b7db2e6))
|
|
10
|
+
|
|
11
|
+
# [0.2.0](https://github.com/laser-ui/laser-ui/compare/v0.1.6...v0.2.0) (2023-10-31)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **components:** `list` is optional in `Fab` ([8ee4ae2](https://github.com/laser-ui/laser-ui/commit/8ee4ae2dd032e4ad8ecd0a1e955489c52a335231))
|
|
16
|
+
- **components:** remove Slides's radio value ([f8b07ea](https://github.com/laser-ui/laser-ui/commit/f8b07ea58131e125cd7bdaaa6221be82d32971b7))
|
|
17
|
+
|
|
5
18
|
## [0.1.6](https://github.com/laser-ui/laser-ui/compare/v0.1.5...v0.1.6) (2023-10-13)
|
|
6
19
|
|
|
7
20
|
**Note:** Version bump only for package @laser-ui/components
|
package/card/Card.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { CardProps } from './types';
|
|
3
3
|
import { CardAction } from './CardAction';
|
|
4
|
+
import { CardActions } from './CardActions';
|
|
4
5
|
import { CardContent } from './CardContent';
|
|
5
6
|
import { CardHeader } from './CardHeader';
|
|
6
7
|
export declare const Card: {
|
|
7
8
|
(props: CardProps): JSX.Element | null;
|
|
8
9
|
Header: typeof CardHeader;
|
|
9
10
|
Content: typeof CardContent;
|
|
11
|
+
Actions: typeof CardActions;
|
|
10
12
|
Action: typeof CardAction;
|
|
11
13
|
};
|
package/card/Card.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import { isString } from 'lodash';
|
|
4
|
-
import { Children } from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
3
|
import { CardAction } from './CardAction';
|
|
4
|
+
import { CardActions } from './CardActions';
|
|
6
5
|
import { CardContent } from './CardContent';
|
|
7
6
|
import { CardHeader } from './CardHeader';
|
|
8
7
|
import { CLASSES } from './vars';
|
|
9
8
|
import { useComponentProps, useStyled } from '../hooks';
|
|
10
|
-
import { Separator } from '../separator';
|
|
11
9
|
import { mergeCS } from '../utils';
|
|
12
10
|
export const Card = (props) => {
|
|
13
|
-
const _a = useComponentProps('Card', props), { children, styleOverrides, styleProvider, shadow = false
|
|
11
|
+
const _a = useComponentProps('Card', props), { children, styleOverrides, styleProvider, shadow = false } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "shadow"]);
|
|
14
12
|
const styled = useStyled(CLASSES, { card: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.card }, styleOverrides);
|
|
15
|
-
|
|
16
|
-
if (headerProp) {
|
|
17
|
-
return isString(headerProp) ? _jsx(CardHeader, { children: headerProp }) : headerProp;
|
|
18
|
-
}
|
|
19
|
-
})();
|
|
20
|
-
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('card', {
|
|
13
|
+
return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('card', {
|
|
21
14
|
'card--shadow': shadow === true,
|
|
22
15
|
'card--shadow-hover': shadow === 'hover',
|
|
23
16
|
}), {
|
|
24
17
|
className: restProps.className,
|
|
25
18
|
style: restProps.style,
|
|
26
|
-
}), { children:
|
|
19
|
+
}), { children: children })));
|
|
27
20
|
};
|
|
28
21
|
Card.Header = CardHeader;
|
|
29
22
|
Card.Content = CardContent;
|
|
23
|
+
Card.Actions = CardActions;
|
|
30
24
|
Card.Action = CardAction;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Children } from 'react';
|
|
4
|
+
import { CLASSES } from './vars';
|
|
5
|
+
import { useComponentProps, useStyled } from '../hooks';
|
|
6
|
+
import { Separator } from '../separator';
|
|
7
|
+
import { mergeCS } from '../utils';
|
|
8
|
+
export function CardActions(props) {
|
|
9
|
+
const _a = useComponentProps('CardActions', props), { styleOverrides, styleProvider, actions } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "actions"]);
|
|
10
|
+
const styled = useStyled(CLASSES, { card: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.card }, styleOverrides);
|
|
11
|
+
return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('card__actions'), {
|
|
12
|
+
className: restProps.className,
|
|
13
|
+
style: restProps.style,
|
|
14
|
+
}), { children: Children.map(actions, (action, index) => (_jsxs(_Fragment, { children: [action, index !== actions.length - 1 && _jsx(Separator, { style: { margin: 8 }, vertical: true })] }))) })));
|
|
15
|
+
}
|
package/card/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { CardProps, CardHeaderProps, CardContentProps, CardActionProps } from './types';
|
|
1
|
+
export type { CardProps, CardHeaderProps, CardContentProps, CardActionsProps, CardActionProps } from './types';
|
|
2
2
|
export { Card } from './Card';
|
package/card/types.d.ts
CHANGED
|
@@ -4,14 +4,15 @@ import type { BaseProps } from '../types';
|
|
|
4
4
|
export {};
|
|
5
5
|
export interface CardProps extends BaseProps<'card', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
shadow?: boolean | 'hover';
|
|
7
|
-
header?: React.ReactElement | string;
|
|
8
|
-
actions?: React.ReactNode[];
|
|
9
7
|
}
|
|
10
8
|
export interface CardHeaderProps extends BaseProps<'card', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
11
9
|
action?: React.ReactNode;
|
|
12
10
|
}
|
|
13
11
|
export interface CardContentProps extends BaseProps<'card', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
14
12
|
}
|
|
13
|
+
export interface CardActionsProps extends BaseProps<'card', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
14
|
+
actions: React.ReactNode[];
|
|
15
|
+
}
|
|
15
16
|
export interface CardActionProps extends BaseProps<'card', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
}
|
package/context/props.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { AvatarProps } from '../avatar';
|
|
|
6
6
|
import type { BadgeProps, BadgeTextProps } from '../badge';
|
|
7
7
|
import type { BreadcrumbProps } from '../breadcrumb';
|
|
8
8
|
import type { ButtonProps } from '../button';
|
|
9
|
-
import type { CardActionProps, CardContentProps, CardHeaderProps, CardProps } from '../card';
|
|
9
|
+
import type { CardActionProps, CardActionsProps, CardContentProps, CardHeaderProps, CardProps } from '../card';
|
|
10
10
|
import type { CascaderProps } from '../cascader';
|
|
11
11
|
import type { CheckboxGroupProps, CheckboxProps } from '../checkbox';
|
|
12
12
|
import type { ComposeItemProps, ComposeProps } from '../compose';
|
|
@@ -61,6 +61,7 @@ export interface ComponentProps {
|
|
|
61
61
|
Card: CardProps;
|
|
62
62
|
CardHeader: CardHeaderProps;
|
|
63
63
|
CardContent: CardContentProps;
|
|
64
|
+
CardActions: CardActionsProps;
|
|
64
65
|
CardAction: CardActionProps;
|
|
65
66
|
Cascader: CascaderProps<any, any>;
|
|
66
67
|
Checkbox: CheckboxProps;
|
package/dropdown/Dropdown.js
CHANGED
|
@@ -267,7 +267,10 @@ function DropdownFC(props, ref) {
|
|
|
267
267
|
triggerRef,
|
|
268
268
|
popupRef,
|
|
269
269
|
containerRefs: [],
|
|
270
|
-
}, onVisibleChange:
|
|
270
|
+
}, onVisibleChange: (visible) => {
|
|
271
|
+
console.log(visible);
|
|
272
|
+
changeVisible(visible);
|
|
273
|
+
}, children: ({ renderTrigger, renderPopup }) => {
|
|
271
274
|
const render = (el) => {
|
|
272
275
|
var _a, _b;
|
|
273
276
|
triggerId = (_a = el.props.id) !== null && _a !== void 0 ? _a : `${namespace}-dropdown-trigger-${uniqueId}`;
|
package/fab/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface FabProps extends BaseProps<'fab', typeof CLASSES>, Omit<React.H
|
|
|
7
7
|
children: React.ReactElement;
|
|
8
8
|
expand?: boolean;
|
|
9
9
|
defaultExpand?: boolean;
|
|
10
|
-
list
|
|
10
|
+
list?: {
|
|
11
11
|
placement: 'top' | 'right' | 'bottom' | 'left';
|
|
12
12
|
actions: React.ReactElement[];
|
|
13
13
|
}[];
|
package/internal/popup/Popup.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laser-ui/components",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "React components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"module": "./index.js",
|
|
27
27
|
"types": "./index.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@laser-ui/hooks": "0.1
|
|
30
|
-
"@laser-ui/utils": "0.1
|
|
29
|
+
"@laser-ui/hooks": "0.2.1",
|
|
30
|
+
"@laser-ui/utils": "0.2.1",
|
|
31
31
|
"@material-design-icons/svg": "^0.14.12",
|
|
32
32
|
"jss": "^10.10.0",
|
|
33
33
|
"jss-preset-default": "^10.10.0",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"directory": "../../dist/libs/components"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c35ed7268d14adc58d9f0df122d424526655cd97"
|
|
49
49
|
}
|
package/slides/Slides.js
CHANGED
|
@@ -270,7 +270,7 @@ export function Slides(props) {
|
|
|
270
270
|
'slides__pagination-radio--next-2': pagination.dynamic && index - activeIndex === 2,
|
|
271
271
|
}), {
|
|
272
272
|
style: { [vertical ? 'top' : 'left']: pagination.dynamic ? 40 - 8 - 16 * activeIndex : undefined },
|
|
273
|
-
}), { key: slide.id, type: "radio",
|
|
273
|
+
}), { key: slide.id, type: "radio", checked: checked, name: uniqueId, title: slide.tooltip, "aria-checked": checked, "aria-controls": viewId, onChange: () => {
|
|
274
274
|
changeActive(slide.id);
|
|
275
275
|
} })));
|
|
276
276
|
}) })))] })));
|