@appdirect/ds-enforce 0.0.0-stage → 0.0.2

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/README.md CHANGED
@@ -1,3 +1,20 @@
1
- # Temporary Holding Version
1
+ # @appdirect/ds-enforce
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ ESLint plugin, Stylelint config, and Mantine type overrides for the AppDirect design system.
4
+
5
+ ```js
6
+ const enforce = require('@appdirect/ds-enforce/eslint');
7
+ ```
8
+
9
+ ```css
10
+ @import '@appdirect/ds-enforce/stylelint';
11
+ ```
12
+
13
+ TypeScript picks up `@appdirect/ds-enforce/mantine`.
14
+
15
+ Component contracts:
16
+
17
+ ```js
18
+ import contracts from '@appdirect/ds-enforce/contracts';
19
+ import button from '@appdirect/ds-enforce/contracts/Button.json';
20
+ ```
@@ -0,0 +1,79 @@
1
+ {
2
+ "id": "Alert",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Inline status message. Use pending, not warning.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Alert",
10
+ "anatomy": [
11
+ "root",
12
+ "icon",
13
+ "title",
14
+ "children",
15
+ "closeButton"
16
+ ],
17
+ "api": {
18
+ "props": {
19
+ "color": {
20
+ "enum": [
21
+ "info",
22
+ "success",
23
+ "danger",
24
+ "pending",
25
+ "default"
26
+ ],
27
+ "default": "default",
28
+ "notes": "No warning. Use pending for caution/in-progress."
29
+ },
30
+ "type": {
31
+ "enum": [
32
+ "info",
33
+ "success",
34
+ "danger",
35
+ "pending",
36
+ "default"
37
+ ],
38
+ "deprecated": true,
39
+ "replacement": "color"
40
+ },
41
+ "variant": {
42
+ "fixed": "light",
43
+ "consumerOverride": false
44
+ },
45
+ "radius": {
46
+ "fixed": "sm",
47
+ "consumerOverride": false
48
+ },
49
+ "title": {
50
+ "type": "string"
51
+ },
52
+ "withCloseButton": {
53
+ "type": "boolean",
54
+ "default": false
55
+ },
56
+ "icon": {
57
+ "type": "ReactNode",
58
+ "notes": "Overrides the semantic default icon"
59
+ }
60
+ }
61
+ },
62
+ "deprecatedPatterns": [
63
+ "import { Alert } from '@mantine/core'",
64
+ "color=\"warning\"",
65
+ "type=\"warning\""
66
+ ],
67
+ "enforcement": {
68
+ "deterministic": [
69
+ "importFrom",
70
+ "api.props.color.enum",
71
+ "api.props.type.deprecated",
72
+ "api.props.variant.fixed",
73
+ "api.props.radius.fixed"
74
+ ],
75
+ "semantic": [
76
+ "purpose"
77
+ ]
78
+ }
79
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "id": "Badge",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Compact status or category label. Not a button.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Badge",
10
+ "anatomy": [
11
+ "root",
12
+ "children"
13
+ ],
14
+ "api": {
15
+ "props": {
16
+ "variant": {
17
+ "enum": [
18
+ "filled",
19
+ "outline",
20
+ "info",
21
+ "success",
22
+ "danger",
23
+ "pending",
24
+ "default",
25
+ "warning"
26
+ ],
27
+ "default": "filled",
28
+ "notes": "Semantic names (info/success/danger/pending/warning/default) also act as color shortcuts when color is default. Only filled and outline map to Mantine variants."
29
+ },
30
+ "color": {
31
+ "enum": [
32
+ "info",
33
+ "success",
34
+ "danger",
35
+ "pending",
36
+ "default",
37
+ "warning",
38
+ "blue",
39
+ "green",
40
+ "red",
41
+ "yellow",
42
+ "gray"
43
+ ],
44
+ "default": "default"
45
+ },
46
+ "size": {
47
+ "enum": [
48
+ "xs",
49
+ "sm",
50
+ "md",
51
+ "lg",
52
+ "xl"
53
+ ],
54
+ "default": "md"
55
+ },
56
+ "radius": {
57
+ "fixed": "sm",
58
+ "consumerOverride": false
59
+ }
60
+ }
61
+ },
62
+ "deprecatedPatterns": [
63
+ "import { Badge } from '@mantine/core'"
64
+ ],
65
+ "enforcement": {
66
+ "deterministic": [
67
+ "importFrom",
68
+ "api.props.variant.enum",
69
+ "api.props.color.enum",
70
+ "api.props.size.enum",
71
+ "api.props.radius.fixed"
72
+ ],
73
+ "semantic": [
74
+ "purpose"
75
+ ]
76
+ }
77
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "id": "Box",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Flexible container primitive for spacing and color tokens when Stack/Inline/Grid do not apply.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Box",
10
+ "api": {
11
+ "props": {
12
+ "p": {
13
+ "enum": [
14
+ "none",
15
+ "xxs",
16
+ "xs",
17
+ "sm",
18
+ "md",
19
+ "lg",
20
+ "xl",
21
+ "xxl"
22
+ ],
23
+ "notes": "Also accepts string | number passthrough."
24
+ },
25
+ "m": {
26
+ "enum": [
27
+ "none",
28
+ "xxs",
29
+ "xs",
30
+ "sm",
31
+ "md",
32
+ "lg",
33
+ "xl",
34
+ "xxl"
35
+ ]
36
+ }
37
+ }
38
+ },
39
+ "deprecatedPatterns": [
40
+ "import { Box } from '@mantine/core'"
41
+ ],
42
+ "enforcement": {
43
+ "deterministic": [
44
+ "importFrom",
45
+ "api.props.p.enum"
46
+ ],
47
+ "semantic": [
48
+ "purpose"
49
+ ]
50
+ }
51
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "id": "Button",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Submit or trigger an action. Not for navigation or icon-only controls.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Button",
10
+ "anatomy": [
11
+ "root",
12
+ "children",
13
+ "leftSection",
14
+ "rightSection"
15
+ ],
16
+ "api": {
17
+ "props": {
18
+ "variant": {
19
+ "enum": [
20
+ "primary",
21
+ "secondary",
22
+ "default",
23
+ "disabled",
24
+ "link",
25
+ "secret",
26
+ "outline",
27
+ "danger"
28
+ ],
29
+ "default": "default",
30
+ "notes": "disabled is a state alias: maps to Mantine default + disabled={true}"
31
+ },
32
+ "size": {
33
+ "enum": [
34
+ "xs",
35
+ "sm",
36
+ "md",
37
+ "lg",
38
+ "xl"
39
+ ],
40
+ "default": "sm"
41
+ },
42
+ "radius": {
43
+ "fixed": "sm",
44
+ "consumerOverride": false
45
+ },
46
+ "color": {
47
+ "deprecated": true,
48
+ "ignored": true
49
+ },
50
+ "loading": {
51
+ "type": "boolean"
52
+ },
53
+ "disabled": {
54
+ "type": "boolean"
55
+ },
56
+ "fullWidth": {
57
+ "type": "boolean"
58
+ },
59
+ "leftSection": {
60
+ "type": "ReactNode"
61
+ },
62
+ "rightSection": {
63
+ "type": "ReactNode"
64
+ },
65
+ "children": {
66
+ "required": true,
67
+ "type": "ReactNode"
68
+ }
69
+ }
70
+ },
71
+ "states": [
72
+ "enabled",
73
+ "hover",
74
+ "active",
75
+ "disabled",
76
+ "loading"
77
+ ],
78
+ "composition": {
79
+ "preferInstead": {
80
+ "iconOnly": "ActionIcon",
81
+ "navigation": "NavLink or Anchor/Text link variant"
82
+ }
83
+ },
84
+ "content": {
85
+ "maxPrimaryPerView": 1
86
+ },
87
+ "deprecatedPatterns": [
88
+ "import { Button } from '@mantine/core'",
89
+ "variant=\"disabled\"",
90
+ "color=\"blue\"",
91
+ "radius=\"xl\""
92
+ ],
93
+ "exceptions": {
94
+ "producerCssModule": "components/DesignSystem/Buttons/Button.module.css is allowed in the kit, not in prototypes"
95
+ },
96
+ "enforcement": {
97
+ "deterministic": [
98
+ "importFrom",
99
+ "api.props.variant.enum",
100
+ "api.props.size.enum",
101
+ "api.props.radius.fixed",
102
+ "api.props.color.deprecated"
103
+ ],
104
+ "semantic": [
105
+ "purpose",
106
+ "composition",
107
+ "content.maxPrimaryPerView"
108
+ ]
109
+ }
110
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "id": "DataTable",
3
+ "kind": "complex",
4
+ "version": "0.2.6",
5
+ "purpose": "Sortable, filterable, paginated record table. AppDirect composition over mantine-react-table-open, not a Mantine Table wrapper.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": null,
10
+ "anatomy": [
11
+ "paper",
12
+ "toolbar",
13
+ "table",
14
+ "pagination"
15
+ ],
16
+ "api": {
17
+ "props": {
18
+ "data": {
19
+ "type": "array",
20
+ "required": true
21
+ },
22
+ "columns": {
23
+ "type": "array",
24
+ "required": true
25
+ },
26
+ "totalCount": {
27
+ "type": "number"
28
+ },
29
+ "isLoading": {
30
+ "type": "boolean"
31
+ },
32
+ "isError": {
33
+ "type": "boolean"
34
+ },
35
+ "showFilters": {
36
+ "type": "boolean"
37
+ },
38
+ "showSearch": {
39
+ "type": "boolean"
40
+ }
41
+ }
42
+ },
43
+ "composition": {
44
+ "mustUseFor": [
45
+ "sortable/filterable/paginated record lists"
46
+ ],
47
+ "preferInstead": {
48
+ "staticMarkup": "Table",
49
+ "handmadeRecordList": "DataTable or Table, not stacked Card/Inline rows of records"
50
+ },
51
+ "notes": "Static dummy lists may use Table, not DataTable."
52
+ },
53
+ "enforcement": {
54
+ "deterministic": [
55
+ "importFrom",
56
+ "kind",
57
+ "mantineCounterpart",
58
+ "api.props.data.required",
59
+ "api.props.columns.required"
60
+ ],
61
+ "semantic": [
62
+ "purpose",
63
+ "composition.mustUseFor",
64
+ "composition.preferInstead.staticMarkup"
65
+ ]
66
+ }
67
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "id": "Grid",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Responsive 12-column grid. Use Grid.Col for explicit spans.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Grid",
10
+ "anatomy": [
11
+ "root",
12
+ "Col"
13
+ ],
14
+ "api": {
15
+ "props": {
16
+ "columns": {
17
+ "type": "number",
18
+ "notes": "Mantine 12-column grid"
19
+ }
20
+ }
21
+ },
22
+ "deprecatedPatterns": [
23
+ "import { Grid } from '@mantine/core'",
24
+ "import { SimpleGrid } from '@mantine/core'"
25
+ ],
26
+ "enforcement": {
27
+ "deterministic": [
28
+ "importFrom"
29
+ ],
30
+ "semantic": [
31
+ "purpose"
32
+ ]
33
+ }
34
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "id": "Group",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Mantine-named alias of Inline. Prefer Inline for new Figma-mapped and prototype code.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Group",
10
+ "aliasOf": "Inline",
11
+ "api": {
12
+ "props": {
13
+ "gap": {
14
+ "enum": [
15
+ "none",
16
+ "xxs",
17
+ "xs",
18
+ "sm",
19
+ "md",
20
+ "lg",
21
+ "xl",
22
+ "xxl"
23
+ ],
24
+ "default": "md"
25
+ }
26
+ }
27
+ },
28
+ "composition": {
29
+ "preferInstead": {
30
+ "newCode": "Inline"
31
+ }
32
+ },
33
+ "enforcement": {
34
+ "deterministic": [
35
+ "importFrom",
36
+ "api.props.gap.enum",
37
+ "aliasOf"
38
+ ],
39
+ "semantic": [
40
+ "composition.preferInstead.newCode"
41
+ ]
42
+ }
43
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "id": "Inline",
3
+ "kind": "wrapper",
4
+ "version": "0.2.6",
5
+ "purpose": "Horizontal layout primitive for new Figma-mapped and prototype code (flex-direction: row).",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": "Group",
10
+ "aliasedBy": [
11
+ "Group"
12
+ ],
13
+ "api": {
14
+ "props": {
15
+ "gap": {
16
+ "enum": [
17
+ "none",
18
+ "xxs",
19
+ "xs",
20
+ "sm",
21
+ "md",
22
+ "lg",
23
+ "xl",
24
+ "xxl"
25
+ ],
26
+ "default": "md"
27
+ },
28
+ "align": {
29
+ "enum": [
30
+ "flex-start",
31
+ "flex-end",
32
+ "center",
33
+ "baseline",
34
+ "stretch"
35
+ ],
36
+ "default": "center"
37
+ },
38
+ "justify": {
39
+ "enum": [
40
+ "flex-start",
41
+ "flex-end",
42
+ "center",
43
+ "space-between",
44
+ "space-around",
45
+ "space-evenly"
46
+ ],
47
+ "default": "flex-start"
48
+ },
49
+ "wrap": {
50
+ "enum": [
51
+ "nowrap",
52
+ "wrap",
53
+ "wrap-reverse"
54
+ ],
55
+ "default": "wrap"
56
+ }
57
+ }
58
+ },
59
+ "deprecatedPatterns": [
60
+ "import { Group } from '@mantine/core'",
61
+ "import { Group } from '@appdirect/design-system' in new code (use Inline)"
62
+ ],
63
+ "enforcement": {
64
+ "deterministic": [
65
+ "importFrom",
66
+ "api.props.gap.enum"
67
+ ],
68
+ "semantic": [
69
+ "purpose"
70
+ ]
71
+ }
72
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "id": "PageContentHeader",
3
+ "kind": "complex",
4
+ "version": "0.2.6",
5
+ "purpose": "Required page header for prototype pages. AppDirect composition; Mantine has no page-content-header.",
6
+ "importFrom": [
7
+ "@appdirect/design-system"
8
+ ],
9
+ "mantineCounterpart": null,
10
+ "anatomy": [
11
+ "card",
12
+ "title",
13
+ "subhead",
14
+ "badge",
15
+ "icon",
16
+ "actions",
17
+ "contentSection"
18
+ ],
19
+ "api": {
20
+ "props": {
21
+ "title": {
22
+ "type": "string",
23
+ "required": true
24
+ },
25
+ "subhead": {
26
+ "type": "string"
27
+ },
28
+ "badge": {
29
+ "type": "string"
30
+ },
31
+ "icon": {
32
+ "type": "ReactNode"
33
+ },
34
+ "actions": {
35
+ "type": "array",
36
+ "item": {
37
+ "label": "string",
38
+ "onClick": "function",
39
+ "variant": {
40
+ "enum": [
41
+ "primary",
42
+ "secondary",
43
+ "default",
44
+ "disabled",
45
+ "link",
46
+ "secret",
47
+ "outline",
48
+ "danger"
49
+ ]
50
+ }
51
+ },
52
+ "notes": "Actions use DS Button variants, not a Mantine variant map."
53
+ },
54
+ "contentSection": {
55
+ "enum": [
56
+ "insights",
57
+ "description",
58
+ "descriptionBlock",
59
+ "nameValuePairs",
60
+ "drawer"
61
+ ],
62
+ "required": true,
63
+ "exclusive": true,
64
+ "notes": "Mutually exclusive content slots. Do not pass more than one section's data as if they compose."
65
+ }
66
+ }
67
+ },
68
+ "composition": {
69
+ "mustUseFor": [
70
+ "prototype page headers"
71
+ ],
72
+ "mustNotRebuildFrom": [
73
+ "Card + Title"
74
+ ],
75
+ "internalPrimitives": [
76
+ "Card",
77
+ "Title",
78
+ "Button",
79
+ "Badge",
80
+ "ThemeIcon",
81
+ "KeyInsight",
82
+ "NameValue",
83
+ "DescriptionBlock",
84
+ "Inline",
85
+ "Stack"
86
+ ],
87
+ "mantineUtilitiesOnly": [
88
+ "Collapse",
89
+ "rem"
90
+ ]
91
+ },
92
+ "enforcement": {
93
+ "deterministic": [
94
+ "importFrom",
95
+ "kind",
96
+ "mantineCounterpart",
97
+ "api.props.title.required",
98
+ "api.props.contentSection.enum"
99
+ ],
100
+ "semantic": [
101
+ "purpose",
102
+ "composition.mustUseFor",
103
+ "composition.mustNotRebuildFrom"
104
+ ]
105
+ }
106
+ }