@fluid-topics/ftds-reorderable-list 2.1.0

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.
@@ -0,0 +1,20 @@
1
+ import { FtdsIcons, FtdsIconVariants } from "@fluid-topics/ftds-icon";
2
+ export interface FtdsReorderableListProperties {
3
+ items: FtdsReorderableListItem[];
4
+ editable: boolean;
5
+ removable: boolean;
6
+ }
7
+ export interface FtdsReorderableListItem {
8
+ id: string;
9
+ label: string;
10
+ warningMessage: string;
11
+ actions: FtdsReorderableListItemAction[];
12
+ }
13
+ export interface FtdsReorderableListItemAction {
14
+ label: string;
15
+ text?: string;
16
+ icon: FtdsIcons;
17
+ iconVariant: FtdsIconVariants;
18
+ disabled?: boolean;
19
+ run?: (event: MouseEvent | KeyboardEvent) => void;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const FtdsReorderableListItemCssVariables: {
2
+ padding: import("@fluid-topics/design-system-variables").FtCssVariable;
3
+ };
4
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,70 @@
1
+ import { css } from "lit";
2
+ import { FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
3
+ import { reorderableList } from "@fluid-topics/design-system-variables";
4
+ export const FtdsReorderableListItemCssVariables = {
5
+ padding: FtCssVariableFactory.create("--ftds-reorderable-list-item--padding", "", "SIZE", "8px"),
6
+ };
7
+ // language=CSS
8
+ export const styles = css `
9
+ .ftds-reorderable-list--container {
10
+ display: flex;
11
+ flex-direction: column;
12
+ background-color: ${reorderableList.backgroundColor};
13
+ border: ${reorderableList.borderWidth} solid ${reorderableList.borderColor};
14
+ border-radius: ${reorderableList.borderRadius};
15
+ padding: ${reorderableList.verticalPadding};
16
+ list-style-type: none;
17
+ gap: ${reorderableList.reorderableItemsGap};
18
+ }
19
+
20
+ ol[role=listbox] {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: ${reorderableList.reorderableItemsGap};
24
+ list-style-type: none;
25
+ margin: 0;
26
+ padding: 0;
27
+ }
28
+
29
+ ol li {
30
+ display: flex;
31
+ background-color: ${reorderableList.reorderableItemBackgroundColor};
32
+ border-radius: ${reorderableList.borderRadius};
33
+ box-shadow: ${reorderableList.boxShadow};
34
+ padding: ${FtdsReorderableListItemCssVariables.padding};
35
+ gap: ${reorderableList.reorderableItemsGap};
36
+ min-height: 40px;
37
+ }
38
+
39
+ ol li:hover {
40
+ cursor: grab
41
+ }
42
+
43
+ .ftds-reorderable-list-item--left {
44
+ display: flex;
45
+ flex-grow: 1;
46
+ align-items: center;
47
+ gap: ${reorderableList.gap};
48
+ }
49
+
50
+ .ftds-reorderable-list-item--left-actions {
51
+ display: flex;
52
+ gap: ${reorderableList.gap};
53
+ }
54
+
55
+ .ftds-reorderable-list-item--right {
56
+ display: flex;
57
+ justify-content: end;
58
+ }
59
+
60
+ .ftds-reorderable-list-item--drag-grip {
61
+ opacity: ${reorderableList.reorderableItemGripOpacity};
62
+ }
63
+
64
+ .ftds-reorderable-list-item--drag-grip:focus {
65
+ outline: 2px solid #0e98b4;
66
+ outline-offset: 2px;
67
+ border-radius: 999px;
68
+ }
69
+
70
+ `;
@@ -0,0 +1,4 @@
1
+ export * from "./ftds-reorderable-list.styles";
2
+ export * from "./ftds-reorderable-list.properties";
3
+ export * from "./ftds-reorderable-list";
4
+ import "./define";
package/build/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./ftds-reorderable-list.styles";
2
+ export * from "./ftds-reorderable-list.properties";
3
+ export * from "./ftds-reorderable-list";
4
+ import "./define";
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@fluid-topics/ftds-reorderable-list",
3
+ "version": "2.1.0",
4
+ "description": "The design system reorderable list component",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/index.js",
11
+ "web": "build/ftds-reorderable-list.min.js",
12
+ "typings": "build/index",
13
+ "files": [
14
+ "build/**/*.js",
15
+ "build/**/*.ts"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-wc-utils": "2.1.0",
23
+ "@fluid-topics/ftds-button": "2.1.0",
24
+ "@fluid-topics/ftds-icon": "2.1.0",
25
+ "@fluid-topics/ftds-notice": "2.1.0",
26
+ "@fluid-topics/ftds-typography": "2.1.0",
27
+ "lit": "3.1.0"
28
+ },
29
+ "devDependencies": {
30
+ "@fluid-topics/ft-wc-test-utils": "2.1.0"
31
+ },
32
+ "gitHead": "4727cf19d04236ad1d2b2cb43ce1c46298834c7e"
33
+ }