@vev/silke 1.1.6 → 1.1.7
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 +8 -0
- package/dist/index.js +35 -35
- package/dist/index.js.LEGAL.txt +12 -12
- package/dist/styles.css +4416 -4020
- package/dist/types/components/index.d.ts +3 -2
- package/dist/types/components/silke-button/silke-dropdown-button.d.ts +8 -13
- package/dist/types/components/silke-card/silke-card-grid.d.ts +33 -1
- package/dist/types/components/silke-command-text-field/image-utils.d.ts +20 -0
- package/dist/types/components/silke-command-text-field/index.d.ts +4 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.d.ts +3 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.spec.d.ts +1 -0
- package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +46 -0
- package/dist/types/components/silke-command-text-field/utils.d.ts +61 -0
- package/dist/types/components/silke-command-text-field/utils.spec.d.ts +1 -0
- package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +1 -0
- package/dist/types/components/silke-image/silke-image.d.ts +2 -1
- package/dist/types/components/silke-list/index.d.ts +1 -0
- package/dist/types/components/silke-list/silke-list-item.d.ts +24 -6
- package/dist/types/components/silke-list/silke-list.d.ts +9 -9
- package/dist/types/components/silke-list/types.d.ts +19 -0
- package/dist/types/components/silke-list/utils.d.ts +3 -0
- package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +1 -0
- package/dist/types/components/silke-overflow-menu/silke-overflow-menu.d.ts +6 -1
- package/dist/types/components/silke-popover-native/silke-popover-native.d.ts +3 -1
- package/dist/types/components/silke-shortcut-button/index.d.ts +1 -0
- package/dist/types/components/silke-shortcut-button/silke-shortcut-button.d.ts +15 -0
- package/dist/types/components/silke-tag/silke-tag.d.ts +1 -1
- package/dist/types/icons.d.ts +30 -0
- package/jest.config.js +2 -3
- package/package.json +7 -2
- package/src/_variables.scss +125 -129
- package/src/components/index.ts +3 -2
- package/src/components/silke-action-box/silke-action-box.scss +2 -3
- package/src/components/silke-alert-banner/silke-alert-banner.scss +9 -10
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +2 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -12
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +3 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +63 -44
- package/src/components/silke-box/silke-box.mdx +321 -21
- package/src/components/silke-box/silke-box.scss +5 -5
- package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +147 -9
- package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
- package/src/components/silke-button/silke-big-button.scss +1 -1
- package/src/components/silke-button/silke-button.scss +24 -15
- package/src/components/silke-button/silke-dropdown-button.mdx +67 -0
- package/src/components/silke-button/silke-dropdown-button.tsx +40 -122
- package/src/components/silke-card/silke-card-grid.tsx +5 -3
- package/src/components/silke-card/silke-card.scss +8 -7
- package/src/components/silke-card/silke-card.tsx +7 -1
- package/src/components/silke-checkbox/silke-checkbox.mdx +139 -14
- package/src/components/silke-checkbox/silke-checkbox.scss +11 -11
- package/src/components/silke-color-picker/color-picker.scss +8 -8
- package/src/components/silke-color-swatches/silke-color-swatches.mdx +130 -0
- package/src/components/silke-command-text-field/image-utils.ts +71 -0
- package/src/components/silke-command-text-field/index.ts +12 -0
- package/src/components/silke-command-text-field/silke-command-parser.spec.ts +89 -0
- package/src/components/silke-command-text-field/silke-command-parser.ts +47 -0
- package/src/components/silke-command-text-field/silke-command-text-field.mdx +301 -0
- package/src/components/silke-command-text-field/silke-command-text-field.module.scss +119 -0
- package/src/components/silke-command-text-field/silke-command-text-field.tsx +665 -0
- package/src/components/silke-command-text-field/utils.spec.ts +366 -0
- package/src/components/silke-command-text-field/utils.ts +287 -0
- package/src/components/silke-conditions-input/silke-conditions-input.scss +4 -4
- package/src/components/silke-content-column/silke-content-column.scss +1 -1
- package/src/components/silke-context-menu/silke-context-menu.scss +3 -4
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
- package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -12
- package/src/components/silke-divider/silke-divider.mdx +154 -32
- package/src/components/silke-divider/silke-divider.scss +3 -2
- package/src/components/silke-drawer/silke-drawer.scss +6 -2
- package/src/components/silke-form/silke-form.mdx +254 -27
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -0
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +1 -0
- package/src/components/silke-form-schema/fields/styles.scss +34 -35
- package/src/components/silke-form-schema/silke-schema-fields.tsx +4 -3
- package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +2 -2
- package/src/components/silke-icon/silke-icon.mdx +212 -8
- package/src/components/silke-icon/silke-icon.scss +10 -2
- package/src/components/silke-icon/silke-icon.tsx +1 -0
- package/src/components/silke-icon/silke-stacked-icon.scss +42 -45
- package/src/components/silke-icon-browser/silke-icon-browser.mdx +143 -0
- package/src/components/silke-image/silke-image-color-backdrop.scss +6 -6
- package/src/components/silke-image/silke-image.mdx +189 -41
- package/src/components/silke-image/silke-image.scss +3 -3
- package/src/components/silke-image/silke-image.tsx +14 -1
- package/src/components/silke-link/silke-link.scss +3 -5
- package/src/components/silke-list/index.ts +1 -0
- package/src/components/silke-list/silke-list-item.mdx +83 -0
- package/src/components/silke-list/silke-list-item.scss +119 -0
- package/src/components/silke-list/silke-list-item.tsx +137 -12
- package/src/components/silke-list/silke-list.mdx +108 -13
- package/src/components/silke-list/silke-list.scss +8 -15
- package/src/components/silke-list/silke-list.tsx +63 -9
- package/src/components/silke-list/types.ts +22 -0
- package/src/components/silke-list/utils.ts +24 -0
- package/src/components/silke-loader/silke-loader.mdx +139 -5
- package/src/components/silke-loader/silke-loader.scss +1 -1
- package/src/components/silke-modal/silke-modal.scss +9 -9
- package/src/components/silke-navigation-link/silke-navigation-link.mdx +27 -2
- package/src/components/silke-navigation-link/silke-navigation-link.scss +34 -40
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +7 -6
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +228 -31
- package/src/components/silke-overflow-menu/silke-overflow-menu.scss +8 -8
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +14 -8
- package/src/components/silke-popover/silke-popover.scss +5 -5
- package/src/components/silke-popover-native/silke-popover-native.scss +93 -78
- package/src/components/silke-popover-native/silke-popover-native.tsx +4 -0
- package/src/components/silke-popover-native/use-popover-positioning.ts +1 -3
- package/src/components/silke-progress-indicator/silke-progress-indicator.scss +1 -1
- package/src/components/silke-radio-button/silke-radio-button.scss +18 -11
- package/src/components/silke-search-field/silke-search-field.mdx +161 -7
- package/src/components/silke-shortcut-button/index.ts +1 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.mdx +89 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.scss +145 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.tsx +55 -0
- package/src/components/silke-skeleton/silke-skeleton.mdx +109 -0
- package/src/components/silke-skeleton/silke-skeleton.scss +1 -1
- package/src/components/silke-slider/silke-slider.module.scss +19 -19
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +3 -3
- package/src/components/silke-sortable-list/silke-sortable-list.scss +4 -5
- package/src/components/silke-table/silke-table.scss +1 -1
- package/src/components/silke-tabs/silke-tabs.scss +3 -3
- package/src/components/silke-tag/silke-tag.mdx +179 -43
- package/src/components/silke-tag/silke-tag.scss +49 -12
- package/src/components/silke-tag/silke-tag.tsx +17 -7
- package/src/components/silke-text/silke-text.scss +6 -4
- package/src/components/silke-text/silke-title.scss +7 -14
- package/src/components/silke-text-field/silke-text-field.scss +9 -9
- package/src/components/silke-text-field/silke-text-field.tsx +1 -1
- package/src/components/silke-tile/silke-tile.scss +7 -3
- package/src/components/silke-toast-notification/silke-toast-notification.scss +4 -5
- package/src/components/silke-toggle/silke-toggle.mdx +163 -33
- package/src/components/silke-toggle/silke-toggle.scss +4 -4
- package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
- package/src/components/silke-tooltip/silke-shortcuts.tsx +3 -3
- package/src/components/silke-tooltip/silke-tooltip.scss +11 -16
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +9 -7
- package/src/components/silke-virtual/silke-virtual.mdx +161 -0
- package/src/components/silke-virtual/silke-virtual.scss +8 -8
- package/src/icons.tsx +43 -1
- package/src/styles/core.scss +42 -45
- package/src/styles/math.scss +66 -66
- package/tsconfig.build.json +2 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +3 -14
- package/dist/types/components/silke-action-list/index.d.ts +0 -1
- package/dist/types/components/silke-action-list/silke-action-list.d.ts +0 -11
- package/dist/types/components/silke-list-card/index.d.ts +0 -1
- package/dist/types/components/silke-list-card/silke-list-card.d.ts +0 -14
- package/src/components/silke-action-list/index.ts +0 -1
- package/src/components/silke-action-list/silke-action-list.mdx +0 -48
- package/src/components/silke-action-list/silke-action-list.scss +0 -21
- package/src/components/silke-action-list/silke-action-list.tsx +0 -85
- package/src/components/silke-list-card/index.ts +0 -1
- package/src/components/silke-list-card/silke-list-card.mdx +0 -46
- package/src/components/silke-list-card/silke-list-card.scss +0 -57
- package/src/components/silke-list-card/silke-list-card.tsx +0 -63
package/tsconfig.json
CHANGED
|
@@ -7,11 +7,7 @@
|
|
|
7
7
|
"module": "es2022",
|
|
8
8
|
"moduleResolution": "Node",
|
|
9
9
|
"target": "ES2022",
|
|
10
|
-
"lib": [
|
|
11
|
-
"esnext",
|
|
12
|
-
"dom",
|
|
13
|
-
"DOM.Iterable"
|
|
14
|
-
],
|
|
10
|
+
"lib": ["esnext", "dom", "DOM.Iterable"],
|
|
15
11
|
"paths": {
|
|
16
12
|
"@vev/react": ["../../react-pkg/src"],
|
|
17
13
|
"@vev/utils": ["../../utils/src"],
|
|
@@ -19,13 +15,6 @@
|
|
|
19
15
|
},
|
|
20
16
|
"composite": true
|
|
21
17
|
},
|
|
22
|
-
"include": [
|
|
23
|
-
|
|
24
|
-
"./jest-setup.ts"
|
|
25
|
-
],
|
|
26
|
-
"exclude": [
|
|
27
|
-
"node_modules",
|
|
28
|
-
"**/*/dist",
|
|
29
|
-
"__mocks__"
|
|
30
|
-
]
|
|
18
|
+
"include": ["src/**/*", "./jest-setup.ts"],
|
|
19
|
+
"exclude": ["node_modules", "**/*/dist", "__mocks__"]
|
|
31
20
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './silke-action-list';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SilkeIcons } from '../silke-icon';
|
|
2
|
-
export declare const SilkeActionListItem: ({ label, icon, items, ...rest }: SilkeActionListItemData) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export type SilkeActionListItemData = {
|
|
4
|
-
label: string;
|
|
5
|
-
icon?: SilkeIcons;
|
|
6
|
-
items?: SilkeActionListItemData[];
|
|
7
|
-
};
|
|
8
|
-
export type SilkeActionListProps = {
|
|
9
|
-
items: SilkeActionListItemData[];
|
|
10
|
-
};
|
|
11
|
-
export declare function SilkeActionList({ items, ...rest }: SilkeActionListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './silke-list-card';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SilkeTagProps } from '../silke-tag';
|
|
3
|
-
import { SilkeOverflowMenuItem } from '../silke-overflow-menu';
|
|
4
|
-
export type SilkeListItemsProps = {
|
|
5
|
-
title: string;
|
|
6
|
-
subtitle?: string;
|
|
7
|
-
image?: string;
|
|
8
|
-
tag?: Omit<SilkeTagProps, 'size'>;
|
|
9
|
-
menu?: MenuItems;
|
|
10
|
-
state?: 'hover' | 'focus' | 'disabled' | 'selected' | '';
|
|
11
|
-
};
|
|
12
|
-
type MenuItems = (SilkeOverflowMenuItem | React.ReactElement | 'divider')[] | (() => (SilkeOverflowMenuItem | React.ReactElement | 'divider')[]);
|
|
13
|
-
export declare function SilkeListCard({ title, subtitle, image, tag, menu, state, }: SilkeListItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './silke-action-list';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Action list
|
|
2
|
-
|
|
3
|
-
Action list is a list of actions that can be used to perform actions on a resource.
|
|
4
|
-
|
|
5
|
-
## Basic usage
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
const items = [{ label: 'Action 1' }, { label: 'Action 2' }];
|
|
9
|
-
<SilkeActionList items={items} />;
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
## Nested list
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
const items = [
|
|
16
|
-
{ label: 'Action 1', icon: 'square' },
|
|
17
|
-
{ label: 'Action 2', icon: 'square' },
|
|
18
|
-
{
|
|
19
|
-
label: 'Action 3',
|
|
20
|
-
icon: 'square',
|
|
21
|
-
items: [
|
|
22
|
-
{ label: 'Action 3.1', icon: 'square' },
|
|
23
|
-
{
|
|
24
|
-
label: 'Action 3.2',
|
|
25
|
-
icon: 'square',
|
|
26
|
-
items: [
|
|
27
|
-
{ label: 'Action 3.2.1', icon: 'square' },
|
|
28
|
-
{ label: 'Action 3.2.2', icon: 'square' },
|
|
29
|
-
{ label: 'Action 3.2.3', icon: 'square' },
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
{ label: 'Action 3.3', icon: 'square' },
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
{ label: 'Action 4', icon: 'square' },
|
|
36
|
-
{ label: 'Action 5', icon: 'square' },
|
|
37
|
-
{
|
|
38
|
-
label: 'Action 6',
|
|
39
|
-
icon: 'square',
|
|
40
|
-
items: [
|
|
41
|
-
{ label: 'Action 6.1', icon: 'square' },
|
|
42
|
-
{ label: 'Action 6.2', icon: 'square' },
|
|
43
|
-
{ label: 'Action 6.3', icon: 'square' },
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
|
-
<SilkeActionList items={items} />;
|
|
48
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@use "../../variables" as *;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
.wrapper {
|
|
5
|
-
border: 1px solid var(--color-surface-3);
|
|
6
|
-
background-color: var(--color-surface-1);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.list {
|
|
10
|
-
list-style: none;
|
|
11
|
-
margin: 0;
|
|
12
|
-
padding: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.subItems {
|
|
16
|
-
display: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.item:hover + .subItems {
|
|
20
|
-
display: block;
|
|
21
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import { SilkeBox } from '../silke-box';
|
|
3
|
-
import { SilkeIcon, SilkeIcons } from '../silke-icon';
|
|
4
|
-
|
|
5
|
-
import styles from './silke-action-list.scss';
|
|
6
|
-
import { SilkePopoverNative } from '../silke-popover-native';
|
|
7
|
-
|
|
8
|
-
export const SilkeActionListItem = ({ label, icon, items, ...rest }: SilkeActionListItemData) => {
|
|
9
|
-
const boxRef = useRef<HTMLButtonElement>(null);
|
|
10
|
-
const hasChildren = items && items.length > 0;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<>
|
|
14
|
-
<SilkeBox
|
|
15
|
-
ref={boxRef}
|
|
16
|
-
tag="button"
|
|
17
|
-
rounded="small"
|
|
18
|
-
gap="s"
|
|
19
|
-
bg="neutral-20"
|
|
20
|
-
bgHover="neutral-30"
|
|
21
|
-
className={styles.item}
|
|
22
|
-
{...rest}
|
|
23
|
-
>
|
|
24
|
-
{icon && (
|
|
25
|
-
<span className={styles.icon}>
|
|
26
|
-
<SilkeIcon icon={icon} />
|
|
27
|
-
</span>
|
|
28
|
-
)}
|
|
29
|
-
{label}
|
|
30
|
-
{hasChildren && (
|
|
31
|
-
<span className={styles.icon}>
|
|
32
|
-
<SilkeIcon icon="right" />
|
|
33
|
-
</span>
|
|
34
|
-
)}
|
|
35
|
-
</SilkeBox>
|
|
36
|
-
|
|
37
|
-
{hasChildren && (
|
|
38
|
-
<SilkePopoverNative hint anchor={boxRef} placement="right-start" hideBackdrop>
|
|
39
|
-
<SilkeActionList items={items} />
|
|
40
|
-
</SilkePopoverNative>
|
|
41
|
-
)}
|
|
42
|
-
</>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type SilkeActionListItemData = {
|
|
47
|
-
label: string;
|
|
48
|
-
icon?: SilkeIcons;
|
|
49
|
-
items?: SilkeActionListItemData[];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type SilkeActionListProps = {
|
|
53
|
-
items: SilkeActionListItemData[];
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export function SilkeActionList({ items, ...rest }: SilkeActionListProps) {
|
|
57
|
-
const cl: string[] = [styles.wrapper];
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<SilkeBox
|
|
61
|
-
tag="ul"
|
|
62
|
-
tabIndex={-1}
|
|
63
|
-
column
|
|
64
|
-
pad="xs"
|
|
65
|
-
bg="neutral-20"
|
|
66
|
-
className={cl.join(' ')}
|
|
67
|
-
{...rest}
|
|
68
|
-
>
|
|
69
|
-
<SilkeBox tag="li" column>
|
|
70
|
-
{items.map((item, index) => {
|
|
71
|
-
const { label, icon, items: subItems, ...itemRest } = item;
|
|
72
|
-
return (
|
|
73
|
-
<SilkeActionListItem
|
|
74
|
-
key={index}
|
|
75
|
-
label={label}
|
|
76
|
-
icon={icon}
|
|
77
|
-
items={subItems}
|
|
78
|
-
{...itemRest}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
})}
|
|
82
|
-
</SilkeBox>
|
|
83
|
-
</SilkeBox>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './silke-list-card';
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
## List Item
|
|
2
|
-
|
|
3
|
-
## Variants
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
const list = [1, 2, 3].map((i) => ({ label: 'Item 1' }));
|
|
7
|
-
|
|
8
|
-
<SilkeBox column gap="m">
|
|
9
|
-
<SilkeListCard title="Title placeholder" />
|
|
10
|
-
<SilkeListCard title="Title placeholder" image={ipsum.image()} />
|
|
11
|
-
<SilkeListCard title="Title placeholder" subtitle="Subtitle placeholder" image={ipsum.image()} />
|
|
12
|
-
<SilkeListCard
|
|
13
|
-
title="Title placeholder"
|
|
14
|
-
subtitle="Subtitle placeholder"
|
|
15
|
-
image={ipsum.image()}
|
|
16
|
-
tag={{
|
|
17
|
-
label: 'Tag',
|
|
18
|
-
kind: 'green',
|
|
19
|
-
}}
|
|
20
|
-
/>
|
|
21
|
-
<SilkeListCard
|
|
22
|
-
title="Title placeholder"
|
|
23
|
-
subtitle="Subtitle placeholder"
|
|
24
|
-
image={ipsum.image()}
|
|
25
|
-
tag={{
|
|
26
|
-
label: 'Tag',
|
|
27
|
-
kind: 'green',
|
|
28
|
-
}}
|
|
29
|
-
menu={list}
|
|
30
|
-
/>
|
|
31
|
-
</SilkeBox>;
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## States
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
const list = [1, 2, 3].map((i) => ({ label: 'Item 1' }));
|
|
38
|
-
|
|
39
|
-
<SilkeBox gap="m" column>
|
|
40
|
-
<SilkeListCard title="Default" image={ipsum.image()} />
|
|
41
|
-
<SilkeListCard title="Hover" image={ipsum.image()} state="hover" />
|
|
42
|
-
<SilkeListCard title="Focus" image={ipsum.image()} state="focus" />
|
|
43
|
-
<SilkeListCard title="Disabled" image={ipsum.image()} state="disabled" />
|
|
44
|
-
<SilkeListCard title="Selected" image={ipsum.image()} state="selected" />
|
|
45
|
-
</SilkeBox>;
|
|
46
|
-
```
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.card {
|
|
3
|
-
border-radius: var(--border-radius-small);
|
|
4
|
-
line-height: 1.25;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
}
|
|
7
|
-
.image {
|
|
8
|
-
border-radius: var(--border-radius-tiny);
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
width: 32px;
|
|
11
|
-
height: 32px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// States
|
|
15
|
-
|
|
16
|
-
.hover,
|
|
17
|
-
.card:hover {
|
|
18
|
-
background-color: var(--color-surface-2);
|
|
19
|
-
transition: 200ms;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.card:active {
|
|
24
|
-
outline: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.selected {
|
|
28
|
-
outline: 1px solid var(--color-accent-30);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.disabled {
|
|
32
|
-
span {
|
|
33
|
-
color: var(--color-neutral-60);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
img {
|
|
37
|
-
opacity: 40%;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.card:focus {
|
|
43
|
-
outline: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.focus,
|
|
47
|
-
.card:focus-visible::before {
|
|
48
|
-
border: 1px solid var(--color-neutral-70);
|
|
49
|
-
position: absolute;
|
|
50
|
-
border-radius: var(--border-radius-small);
|
|
51
|
-
top: -4px;
|
|
52
|
-
left: -4px;
|
|
53
|
-
right: -4px;
|
|
54
|
-
bottom: -4px;
|
|
55
|
-
content: "";
|
|
56
|
-
z-index: 1;
|
|
57
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SilkeBox } from '../silke-box';
|
|
3
|
-
import { SilkeTag, SilkeTagProps } from '../silke-tag';
|
|
4
|
-
import { SilkeOverflowMenu, SilkeOverflowMenuItem } from '../silke-overflow-menu';
|
|
5
|
-
import { SilkeText, SilkeTextSmall } from '../silke-text';
|
|
6
|
-
import { SilkeImage } from '../silke-image';
|
|
7
|
-
|
|
8
|
-
import styles from './silke-list-card.scss';
|
|
9
|
-
|
|
10
|
-
export type SilkeListItemsProps = {
|
|
11
|
-
title: string;
|
|
12
|
-
subtitle?: string;
|
|
13
|
-
image?: string;
|
|
14
|
-
tag?: Omit<SilkeTagProps, 'size'>;
|
|
15
|
-
menu?: MenuItems;
|
|
16
|
-
state?: 'hover' | 'focus' | 'disabled' | 'selected' | '';
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type MenuItems =
|
|
20
|
-
| (SilkeOverflowMenuItem | React.ReactElement | 'divider')[]
|
|
21
|
-
| (() => (SilkeOverflowMenuItem | React.ReactElement | 'divider')[]);
|
|
22
|
-
|
|
23
|
-
export function SilkeListCard({
|
|
24
|
-
title,
|
|
25
|
-
subtitle,
|
|
26
|
-
image,
|
|
27
|
-
tag,
|
|
28
|
-
menu,
|
|
29
|
-
state = '',
|
|
30
|
-
}: SilkeListItemsProps) {
|
|
31
|
-
const tagProps = { ...tag, size: 'tiny' } as SilkeTagProps;
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<SilkeBox
|
|
35
|
-
pad="m"
|
|
36
|
-
bg="surface-1"
|
|
37
|
-
className={[styles.card, styles[state]].join(' ')}
|
|
38
|
-
tabIndex={0}
|
|
39
|
-
>
|
|
40
|
-
<SilkeBox gap="m">
|
|
41
|
-
{image && (
|
|
42
|
-
<SilkeBox>
|
|
43
|
-
<SilkeImage src={image} aspectRatio="1:1" className={styles.image} />
|
|
44
|
-
</SilkeBox>
|
|
45
|
-
)}
|
|
46
|
-
<SilkeBox column gap="none" style={{ justifyContent: 'center' }}>
|
|
47
|
-
<SilkeText color="neutral-100" size="base">
|
|
48
|
-
{title}
|
|
49
|
-
</SilkeText>
|
|
50
|
-
{subtitle && <SilkeTextSmall color="neutral-70">{subtitle}</SilkeTextSmall>}
|
|
51
|
-
</SilkeBox>
|
|
52
|
-
</SilkeBox>
|
|
53
|
-
<SilkeBox align="center" gap="m">
|
|
54
|
-
{tag?.label && (
|
|
55
|
-
<SilkeBox align="center">
|
|
56
|
-
<SilkeTag {...tagProps} />{' '}
|
|
57
|
-
</SilkeBox>
|
|
58
|
-
)}
|
|
59
|
-
{menu && <SilkeOverflowMenu items={menu} size="s" />}
|
|
60
|
-
</SilkeBox>
|
|
61
|
-
</SilkeBox>
|
|
62
|
-
);
|
|
63
|
-
}
|