@frontify/fondue 13.7.2 → 13.7.3
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/dist/components/Flyout/helpers/getVerticalPositioning.es.js.map +1 -1
- package/dist/components/InputLabel/InputLabel.es.js.map +1 -1
- package/dist/components/Tree/Tree.es.js.map +1 -1
- package/dist/components/Tree/TreeContext.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/DragHandle.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/ExpandButton.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/TreeItem.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/TreeItemMultiselect.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/TreeItemOverlay.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/useMultiselectTreeItem.es.js.map +1 -1
- package/dist/components/Tree/TreeItem/useTreeItem.es.js.map +1 -1
- package/dist/components/Tree/helpers/constants.es.js.map +1 -1
- package/dist/components/Tree/helpers/getMovementAnnouncements.es.js.map +1 -1
- package/dist/components/Tree/helpers/multiselect.es.js.map +1 -1
- package/dist/components/Tree/helpers/multiselectTreeItemstyling.es.js.map +1 -1
- package/dist/components/Tree/helpers/nodes.es.js.map +1 -1
- package/dist/components/Tree/helpers/projection.es.js.map +1 -1
- package/dist/components/Tree/helpers/reducer.es.js.map +1 -1
- package/dist/components/Tree/helpers/sensorsActivationConstraint.es.js.map +1 -1
- package/dist/components/Tree/helpers/treeHandleKeyDown.es.js.map +1 -1
- package/dist/components/Tree/types.es.js.map +1 -1
- package/dist/components/Tree/utils/keyboardCoordinates.es.js.map +1 -1
- package/dist/components/Tree/utils/removeFragmentsAndEnrichChildren.es.js.map +1 -1
- package/dist/components/Tree/utils/useDeepCompareEffect.es.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +261 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/components/style.css +1 -1
- package/dist/packages/rte/style.css +1 -1
- package/dist/tools/codemod/index.js +87 -1
- package/dist/tools/internal/index.js +30 -36
- package/package.json +6 -7
- package/dist/tools/sdk-cli/adapters/claude-skill/skill/SKILL.md +0 -207
- package/dist/tools/sdk-cli/adapters/claude-skill/skill/reference.md +0 -235
- package/dist/tools/sdk-cli/index.js +0 -224
|
@@ -589,13 +589,20 @@ const deprecated = [
|
|
|
589
589
|
"Breadcrumb",
|
|
590
590
|
"Breadcrumbs",
|
|
591
591
|
"CollapsibleWrap",
|
|
592
|
+
"CollisionPosition",
|
|
592
593
|
"Color",
|
|
593
594
|
"DatePicker",
|
|
594
595
|
"DatePickerProps",
|
|
595
596
|
"DatePickerTrigger",
|
|
597
|
+
"DragHandle",
|
|
598
|
+
"DragHandleProps",
|
|
599
|
+
"DragHandlerPosition",
|
|
600
|
+
"EXPAND_ONHOVER_DELAY",
|
|
596
601
|
"EditableMode",
|
|
597
602
|
"EditableText",
|
|
598
603
|
"EditableTextProps",
|
|
604
|
+
"ExpandButton",
|
|
605
|
+
"ExpandButtonProps",
|
|
599
606
|
"FOCUS_VISIBLE_STYLE",
|
|
600
607
|
"FOCUS_VISIBLE_STYLE_INSET",
|
|
601
608
|
"FOCUS_WITHIN_STYLE",
|
|
@@ -610,7 +617,11 @@ const deprecated = [
|
|
|
610
617
|
"FormControlStyle",
|
|
611
618
|
"FrontifyPattern",
|
|
612
619
|
"HelperPosition",
|
|
620
|
+
"INDENTATION_WIDTH",
|
|
613
621
|
"ImageAsset",
|
|
622
|
+
"InputLabelProps",
|
|
623
|
+
"InternalTreeItemMultiSelectProps",
|
|
624
|
+
"InternalTreeItemProps",
|
|
614
625
|
"Item",
|
|
615
626
|
"LegacyTextarea",
|
|
616
627
|
"LegacyTextareaProps",
|
|
@@ -625,6 +636,11 @@ const deprecated = [
|
|
|
625
636
|
"MultiSelectProps",
|
|
626
637
|
"MultiSelectSize",
|
|
627
638
|
"MultiSelectType",
|
|
639
|
+
"OnExpandCallback",
|
|
640
|
+
"OnSelectCallback",
|
|
641
|
+
"OnSelectInternalCallback",
|
|
642
|
+
"OnShrinkCallback",
|
|
643
|
+
"OnTreeDropCallback",
|
|
628
644
|
"OrderableList",
|
|
629
645
|
"OrderableListItem",
|
|
630
646
|
"OrderableListItemStyle",
|
|
@@ -632,19 +648,89 @@ const deprecated = [
|
|
|
632
648
|
"Palette",
|
|
633
649
|
"PatternDesign",
|
|
634
650
|
"PatternScale",
|
|
651
|
+
"PatternScaleOrigin",
|
|
635
652
|
"PatternTheme",
|
|
653
|
+
"Projection",
|
|
654
|
+
"ProjectionArgs",
|
|
655
|
+
"ROOT_ID",
|
|
636
656
|
"ReactDatePickerRef",
|
|
657
|
+
"RegisterNodeChildrenPayload",
|
|
637
658
|
"RenderListItem",
|
|
659
|
+
"SensorContext",
|
|
660
|
+
"SortableProps",
|
|
661
|
+
"SortableTreeItemProps",
|
|
638
662
|
"TABBABLE_ELEMENTS",
|
|
639
663
|
"Toast",
|
|
640
664
|
"ToastAnimationDirection",
|
|
641
665
|
"ToastStyle",
|
|
666
|
+
"Tree",
|
|
667
|
+
"TreeActive",
|
|
668
|
+
"TreeAnnouncements",
|
|
669
|
+
"TreeDragCancelEvent",
|
|
670
|
+
"TreeDragEndEvent",
|
|
671
|
+
"TreeDragMoveEvent",
|
|
672
|
+
"TreeDragOverEvent",
|
|
673
|
+
"TreeDragStartEvent",
|
|
674
|
+
"TreeItem",
|
|
675
|
+
"TreeItemBorderClassMap",
|
|
676
|
+
"TreeItemBorderRadiusClassMap",
|
|
677
|
+
"TreeItemBorderStyleClassMap",
|
|
678
|
+
"TreeItemColors",
|
|
679
|
+
"TreeItemColorsClassMap",
|
|
680
|
+
"TreeItemMultiselect",
|
|
681
|
+
"TreeItemMultiselectProps",
|
|
682
|
+
"TreeItemMultiselectWithNodes",
|
|
683
|
+
"TreeItemOverlay",
|
|
684
|
+
"TreeItemProps",
|
|
685
|
+
"TreeItemPropsSizing",
|
|
686
|
+
"TreeItemShadowClassMap",
|
|
687
|
+
"TreeItemSpacingClassMap",
|
|
688
|
+
"TreeItemState",
|
|
689
|
+
"TreeItemStyling",
|
|
690
|
+
"TreeItemWithContentComponentProps",
|
|
691
|
+
"TreeItemWithLabelProps",
|
|
692
|
+
"TreeNodeWithoutElements",
|
|
693
|
+
"TreeOver",
|
|
694
|
+
"TreeProps",
|
|
695
|
+
"TreeState",
|
|
696
|
+
"TreeStateAction",
|
|
642
697
|
"UploadSource",
|
|
643
698
|
"Validation",
|
|
699
|
+
"addSelectedIds",
|
|
700
|
+
"addSelectedItemsFromSelection",
|
|
701
|
+
"cleanOrphanSelectedIds",
|
|
702
|
+
"convertToPartialSelectedId",
|
|
703
|
+
"currentNodesChanged",
|
|
704
|
+
"extractNodeFromElement",
|
|
705
|
+
"findIndexById",
|
|
706
|
+
"fixParentSelectionState",
|
|
707
|
+
"getAnnouncements",
|
|
708
|
+
"getCurrentChildrenForNewNodesIfExpanded",
|
|
709
|
+
"getExtendedId",
|
|
710
|
+
"getMultiselectCheckBoxState",
|
|
711
|
+
"getNewSelectedItems",
|
|
712
|
+
"getNodeChildrenIds",
|
|
713
|
+
"getNodesToRender",
|
|
714
|
+
"getParentSelectedTreeItem",
|
|
715
|
+
"getProjection",
|
|
716
|
+
"getReactNodeIdsInFlatArray",
|
|
717
|
+
"getReactNodesInFlatArray",
|
|
718
|
+
"getSelectedChildrenItems",
|
|
719
|
+
"getSelectedTreeItem",
|
|
720
|
+
"getTreeNodesWithoutElements",
|
|
721
|
+
"getVerticalPositioning",
|
|
722
|
+
"handleKeyDownEvent",
|
|
723
|
+
"removePartialFlagSelectedId",
|
|
724
|
+
"removeReactNodesFromFlatArray",
|
|
725
|
+
"removeSelectedIds",
|
|
726
|
+
"sensorsActivationConstraint",
|
|
727
|
+
"shouldUpdateTreeState",
|
|
728
|
+
"updateNodeWithNewChildren",
|
|
644
729
|
"useCopy",
|
|
645
730
|
"useForwardedRef",
|
|
646
731
|
"useMemoizedId",
|
|
647
|
-
"useMobileDetection"
|
|
732
|
+
"useMobileDetection",
|
|
733
|
+
"useTreeItem"
|
|
648
734
|
];
|
|
649
735
|
const detectedExports = {
|
|
650
736
|
deprecated
|
|
@@ -27,13 +27,20 @@ const deprecated = [
|
|
|
27
27
|
"Breadcrumb",
|
|
28
28
|
"Breadcrumbs",
|
|
29
29
|
"CollapsibleWrap",
|
|
30
|
+
"CollisionPosition",
|
|
30
31
|
"Color",
|
|
31
32
|
"DatePicker",
|
|
32
33
|
"DatePickerProps",
|
|
33
34
|
"DatePickerTrigger",
|
|
35
|
+
"DragHandle",
|
|
36
|
+
"DragHandleProps",
|
|
37
|
+
"DragHandlerPosition",
|
|
38
|
+
"EXPAND_ONHOVER_DELAY",
|
|
34
39
|
"EditableMode",
|
|
35
40
|
"EditableText",
|
|
36
41
|
"EditableTextProps",
|
|
42
|
+
"ExpandButton",
|
|
43
|
+
"ExpandButtonProps",
|
|
37
44
|
"FOCUS_VISIBLE_STYLE",
|
|
38
45
|
"FOCUS_VISIBLE_STYLE_INSET",
|
|
39
46
|
"FOCUS_WITHIN_STYLE",
|
|
@@ -48,7 +55,11 @@ const deprecated = [
|
|
|
48
55
|
"FormControlStyle",
|
|
49
56
|
"FrontifyPattern",
|
|
50
57
|
"HelperPosition",
|
|
58
|
+
"INDENTATION_WIDTH",
|
|
51
59
|
"ImageAsset",
|
|
60
|
+
"InputLabelProps",
|
|
61
|
+
"InternalTreeItemMultiSelectProps",
|
|
62
|
+
"InternalTreeItemProps",
|
|
52
63
|
"Item",
|
|
53
64
|
"LegacyTextarea",
|
|
54
65
|
"LegacyTextareaProps",
|
|
@@ -63,6 +74,11 @@ const deprecated = [
|
|
|
63
74
|
"MultiSelectProps",
|
|
64
75
|
"MultiSelectSize",
|
|
65
76
|
"MultiSelectType",
|
|
77
|
+
"OnExpandCallback",
|
|
78
|
+
"OnSelectCallback",
|
|
79
|
+
"OnSelectInternalCallback",
|
|
80
|
+
"OnShrinkCallback",
|
|
81
|
+
"OnTreeDropCallback",
|
|
66
82
|
"OrderableList",
|
|
67
83
|
"OrderableListItem",
|
|
68
84
|
"OrderableListItemStyle",
|
|
@@ -70,50 +86,21 @@ const deprecated = [
|
|
|
70
86
|
"Palette",
|
|
71
87
|
"PatternDesign",
|
|
72
88
|
"PatternScale",
|
|
73
|
-
"PatternTheme",
|
|
74
|
-
"ReactDatePickerRef",
|
|
75
|
-
"RenderListItem",
|
|
76
|
-
"TABBABLE_ELEMENTS",
|
|
77
|
-
"Toast",
|
|
78
|
-
"ToastAnimationDirection",
|
|
79
|
-
"ToastStyle",
|
|
80
|
-
"UploadSource",
|
|
81
|
-
"Validation",
|
|
82
|
-
"useCopy",
|
|
83
|
-
"useForwardedRef",
|
|
84
|
-
"useMemoizedId",
|
|
85
|
-
"useMobileDetection"
|
|
86
|
-
];
|
|
87
|
-
const active = [
|
|
88
|
-
"CollapsibleWrap",
|
|
89
|
-
"CollisionPosition",
|
|
90
|
-
"DragHandle",
|
|
91
|
-
"DragHandleProps",
|
|
92
|
-
"DragHandlerPosition",
|
|
93
|
-
"EXPAND_ONHOVER_DELAY",
|
|
94
|
-
"ExpandButton",
|
|
95
|
-
"ExpandButtonProps",
|
|
96
|
-
"FilterableMultiSelect",
|
|
97
|
-
"INDENTATION_WIDTH",
|
|
98
|
-
"InputLabelProps",
|
|
99
|
-
"InternalTreeItemMultiSelectProps",
|
|
100
|
-
"InternalTreeItemProps",
|
|
101
|
-
"LegacyTextarea",
|
|
102
|
-
"MultiSelect",
|
|
103
|
-
"OnExpandCallback",
|
|
104
|
-
"OnSelectCallback",
|
|
105
|
-
"OnSelectInternalCallback",
|
|
106
|
-
"OnShrinkCallback",
|
|
107
|
-
"OnTreeDropCallback",
|
|
108
|
-
"OrderableList",
|
|
109
89
|
"PatternScaleOrigin",
|
|
90
|
+
"PatternTheme",
|
|
110
91
|
"Projection",
|
|
111
92
|
"ProjectionArgs",
|
|
112
93
|
"ROOT_ID",
|
|
94
|
+
"ReactDatePickerRef",
|
|
113
95
|
"RegisterNodeChildrenPayload",
|
|
96
|
+
"RenderListItem",
|
|
114
97
|
"SensorContext",
|
|
115
98
|
"SortableProps",
|
|
116
99
|
"SortableTreeItemProps",
|
|
100
|
+
"TABBABLE_ELEMENTS",
|
|
101
|
+
"Toast",
|
|
102
|
+
"ToastAnimationDirection",
|
|
103
|
+
"ToastStyle",
|
|
117
104
|
"Tree",
|
|
118
105
|
"TreeActive",
|
|
119
106
|
"TreeAnnouncements",
|
|
@@ -145,6 +132,8 @@ const active = [
|
|
|
145
132
|
"TreeProps",
|
|
146
133
|
"TreeState",
|
|
147
134
|
"TreeStateAction",
|
|
135
|
+
"UploadSource",
|
|
136
|
+
"Validation",
|
|
148
137
|
"addSelectedIds",
|
|
149
138
|
"addSelectedItemsFromSelection",
|
|
150
139
|
"cleanOrphanSelectedIds",
|
|
@@ -175,8 +164,13 @@ const active = [
|
|
|
175
164
|
"sensorsActivationConstraint",
|
|
176
165
|
"shouldUpdateTreeState",
|
|
177
166
|
"updateNodeWithNewChildren",
|
|
167
|
+
"useCopy",
|
|
168
|
+
"useForwardedRef",
|
|
169
|
+
"useMemoizedId",
|
|
170
|
+
"useMobileDetection",
|
|
178
171
|
"useTreeItem"
|
|
179
172
|
];
|
|
173
|
+
const active = [];
|
|
180
174
|
const detectedExports = {
|
|
181
175
|
deprecated,
|
|
182
176
|
active
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/fondue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.7.
|
|
4
|
+
"version": "13.7.3",
|
|
5
5
|
"description": "Design system of Frontify",
|
|
6
6
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
7
7
|
"homepage": "https://github.com/Frontify/fondue",
|
|
@@ -97,8 +97,7 @@
|
|
|
97
97
|
"types": "dist/index.d.ts",
|
|
98
98
|
"bin": {
|
|
99
99
|
"codemod": "./dist/tools/codemod/index.js",
|
|
100
|
-
"internal": "./dist/tools/internal/index.js"
|
|
101
|
-
"fondue": "./dist/tools/sdk-cli/index.js"
|
|
100
|
+
"internal": "./dist/tools/internal/index.js"
|
|
102
101
|
},
|
|
103
102
|
"files": [
|
|
104
103
|
"dist",
|
|
@@ -157,10 +156,10 @@
|
|
|
157
156
|
"react-popper": "^2.3.0",
|
|
158
157
|
"react-textarea-autosize": "^8.5.9",
|
|
159
158
|
"@frontify/fondue-charts": "^8.0.0",
|
|
160
|
-
"@frontify/fondue-rte": "^0.1.7",
|
|
161
|
-
"@frontify/fondue-sdk": "^0.1.3",
|
|
162
159
|
"@frontify/fondue-icons": "^0.27.0",
|
|
163
|
-
"@frontify/fondue-
|
|
160
|
+
"@frontify/fondue-rte": "^0.1.7",
|
|
161
|
+
"@frontify/fondue-sdk": "^0.2.0",
|
|
162
|
+
"@frontify/fondue-components": "^31.0.1",
|
|
164
163
|
"@frontify/fondue-tokens": "^5.1.0"
|
|
165
164
|
},
|
|
166
165
|
"devDependencies": {
|
|
@@ -221,7 +220,7 @@
|
|
|
221
220
|
"build:package:tokens": "vite build -c tokens.vite.config.ts",
|
|
222
221
|
"build:package:rte": "vite build -c rte.vite.config.ts",
|
|
223
222
|
"build:package:sdk": "vite build -c sdk.vite.config.ts",
|
|
224
|
-
"build:tools": "tsx scripts/detectDeprecatedExports/detectDeprecatedExports.ts tools/constants/fondueExports.json && vite build -c codemod.vite.config.ts && vite build -c internal-tools.vite.config.ts
|
|
223
|
+
"build:tools": "tsx scripts/detectDeprecatedExports/detectDeprecatedExports.ts tools/constants/fondueExports.json && vite build -c codemod.vite.config.ts && vite build -c internal-tools.vite.config.ts",
|
|
225
224
|
"dev": "cross-env NODE_ENV=development pnpm dev:library",
|
|
226
225
|
"dev:library": "vite build --emptyOutDir false --watch",
|
|
227
226
|
"clean": "rimraf dist",
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fondue
|
|
3
|
-
description: Queries the locally installed `@frontify/fondue/sdk` to surface accurate Fondue component metadata. ALWAYS use when picking a Fondue component (button, dialog, dropdown, tabs, …), finding a design token or utility class, or setting up the `@frontify/fondue` package.
|
|
4
|
-
allowed-tools: Bash(node *)
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Fondue
|
|
8
|
-
|
|
9
|
-
Use `@frontify/fondue/sdk` as the source of truth for every Fondue question. Never invent component names, props, token ids, or imports from memory — query the SDK.
|
|
10
|
-
|
|
11
|
-
**Runs against the project's locally installed Fondue.** Invoke `node` from the project root (or a subdirectory) so `@frontify/fondue` resolves from `node_modules` — results reflect the exact version this project depends on, not the version the skill was authored against.
|
|
12
|
-
|
|
13
|
-
## Verify the SDK is available
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
node -e "import('@frontify/fondue/sdk').then((m) => console.log(JSON.stringify({ components: m.components.size, tokens: m.tokens.size, guides: m.guides.size })))"
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
If that errors with `Cannot find package`, the project hasn't installed Fondue yet:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pnpm add @frontify/fondue # or npm i / yarn add
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## How to query
|
|
26
|
-
|
|
27
|
-
The SDK is a synchronous, zero-I/O ES module that resolves from the user's project. Three singletons share the same query surface:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import { components, tokens, guides } from '@frontify/fondue/sdk';
|
|
31
|
-
|
|
32
|
-
// Same shape on each domain:
|
|
33
|
-
components.list();
|
|
34
|
-
components.get('Button'); // ComponentNode | undefined (never throws)
|
|
35
|
-
components.has('Button'); // boolean
|
|
36
|
-
components.where({ text: 'dropdown' });
|
|
37
|
-
components.size; // number
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
`where(filter)` clauses AND-combine; array-valued clauses OR within the clause. `get` and `where` never throw; missing ids return `undefined` / `[]`.
|
|
41
|
-
|
|
42
|
-
Nodes have **scalar fields** (read as properties) and **graph edges** (call as methods):
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
const button = components.get('Button');
|
|
46
|
-
button?.importStatement; // scalar
|
|
47
|
-
button?.props; // scalar (array)
|
|
48
|
-
button?.category(); // edge → ComponentFacetNode { name, list, where, … }
|
|
49
|
-
button?.related(); // edge → ComponentNode[]
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Running queries from Claude
|
|
53
|
-
|
|
54
|
-
For one-liners, use `node -e`:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
node -e "import('@frontify/fondue/sdk').then(({components}) => console.log(JSON.stringify(components.where({text:'dropdown'}).map((c)=>({name:c.name,import:c.importStatement,canonical:c.examples.find((e)=>e.isCanonical)?.code})))))"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
For anything multi-line, pipe a module via stdin to avoid quoting hell:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
node --input-type=module <<'EOF'
|
|
64
|
-
import { components } from '@frontify/fondue/sdk';
|
|
65
|
-
const candidates = components.where({ text: 'dropdown', status: 'released' }).slice(0, 5);
|
|
66
|
-
console.log(JSON.stringify(candidates.map((c) => ({
|
|
67
|
-
name: c.name,
|
|
68
|
-
category: c.category().name,
|
|
69
|
-
tags: c.tags().map((t) => t.name),
|
|
70
|
-
import: c.importStatement,
|
|
71
|
-
canonical: c.examples.find((e) => e.isCanonical)?.code ?? c.examples[0]?.code ?? null,
|
|
72
|
-
})), null, 2));
|
|
73
|
-
EOF
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Always emit `JSON.stringify(...)` so the response is parseable. Never `console.log(node)` directly — facet methods serialize as `[Function]`.
|
|
77
|
-
|
|
78
|
-
For the formal contract (every filter clause, node shape, facet method), see [`reference.md`](./reference.md).
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Workflow 1 — Setting up Fondue
|
|
83
|
-
|
|
84
|
-
Read the canonical setup prose from the SDK rather than paraphrasing — the steps change between releases (font URLs, package layout, theme provider API).
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
node -e "import('@frontify/fondue/sdk').then(({guides}) => console.log(guides.get('getting-started')?.content))"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
For upgrades:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
node -e "import('@frontify/fondue/sdk').then(({guides}) => console.log(guides.get('upgrading')?.content))"
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
To discover other bundled guides:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
node -e "import('@frontify/fondue/sdk').then(({guides}) => console.log(JSON.stringify(guides.list().map((g)=>({id:g.id,title:g.title})))))"
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
The output is the same markdown the Storybook docs render. Use it as the source for token imports, component-style imports, font face definitions, the Tailwind preset, `ThemeProvider`.
|
|
103
|
-
|
|
104
|
-
## Workflow 2 — Finding a component
|
|
105
|
-
|
|
106
|
-
Start with intent-based search:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
node --input-type=module <<'EOF'
|
|
110
|
-
import { components } from '@frontify/fondue/sdk';
|
|
111
|
-
console.log(JSON.stringify(components.where({ text: 'dropdown' }).map((c) => ({
|
|
112
|
-
name: c.name,
|
|
113
|
-
category: c.category().name,
|
|
114
|
-
status: c.status,
|
|
115
|
-
description: c.description,
|
|
116
|
-
})), null, 2));
|
|
117
|
-
EOF
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Narrow by category or tag when the use case maps cleanly:
|
|
121
|
-
|
|
122
|
-
```ts
|
|
123
|
-
components.where({ category: 'overlay', status: 'released' });
|
|
124
|
-
components.where({ tag: 'cta' });
|
|
125
|
-
components.where({ category: 'input', tag: 'cta' });
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Once you have a candidate, pull the recommendation shape:
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
node --input-type=module <<'EOF'
|
|
132
|
-
import { components } from '@frontify/fondue/sdk';
|
|
133
|
-
const c = components.get('Button');
|
|
134
|
-
console.log(JSON.stringify({
|
|
135
|
-
name: c.name,
|
|
136
|
-
description: c.description,
|
|
137
|
-
importStatement: c.importStatement,
|
|
138
|
-
canonical: c.examples.find((e) => e.isCanonical)?.code ?? c.examples[0]?.code,
|
|
139
|
-
requiredProps: c.props.filter((p) => p.required).map((p) => p.name),
|
|
140
|
-
subComponents: c.subComponents.map((sc) => sc.name),
|
|
141
|
-
related: c.related().map((r) => r.name),
|
|
142
|
-
instructions: c.instructions,
|
|
143
|
-
}, null, 2));
|
|
144
|
-
EOF
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
**Recommendation shape** — when you suggest a component, output: the name, what it's for, the import statement, and the canonical example. If the use case isn't a clean match, list 2–3 candidates with their categories and let the user pick.
|
|
148
|
-
|
|
149
|
-
**Icons** live in the components graph under `category: 'icon'`. They have empty `status`, empty `props`, empty `related()` — don't probe those fields. Find them with:
|
|
150
|
-
|
|
151
|
-
```ts
|
|
152
|
-
components.where({ category: 'icon', tag: 'arrow' });
|
|
153
|
-
components.get('IconAdobeCreativeCloud')?.importStatement;
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
When nothing matches:
|
|
157
|
-
- Try a related tag — `components.tags().map((t) => t.name)` lists every tag.
|
|
158
|
-
- Look at the closest hit's `related()`.
|
|
159
|
-
- If there truly is no component for the use case, say so. Don't recommend hand-rolling something Fondue already provides, but don't invent a component name either.
|
|
160
|
-
|
|
161
|
-
## Workflow 3 — Picking tokens for a custom component
|
|
162
|
-
|
|
163
|
-
Two layers exist:
|
|
164
|
-
|
|
165
|
-
- `tokens` — atomic design tokens (colors, sizes, shadows, strings). Each has a CSS variable and a Tailwind class.
|
|
166
|
-
- `tokens.utilities` — composed Tailwind utilities (typography classes like `tw-body-large-strong`) bundling multiple token references.
|
|
167
|
-
|
|
168
|
-
```ts
|
|
169
|
-
tokens.where({ text: 'primary' });
|
|
170
|
-
tokens.where({ category: 'colors', themeable: true });
|
|
171
|
-
tokens.where({ keyPathStartsWith: 'colors.text' });
|
|
172
|
-
tokens.type('color')?.where({ themeable: true });
|
|
173
|
-
|
|
174
|
-
const t = tokens.get('color-text-weak');
|
|
175
|
-
t?.value; // 'var(--color-text-weak)'
|
|
176
|
-
t?.cssVariable; // '--color-text-weak'
|
|
177
|
-
t?.tailwindClass; // 'tw-text-weak'
|
|
178
|
-
t?.themeable; // true
|
|
179
|
-
|
|
180
|
-
// Typography: always use the utility class, not raw font tokens
|
|
181
|
-
tokens.utilities.where({ keyPathStartsWith: 'utilities.text' });
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Rules:
|
|
185
|
-
- Prefer `themeable: true` tokens for any user-facing surface so dark mode and theming work out of the box.
|
|
186
|
-
- Prefer the Tailwind class when the project uses `@frontify/fondue/tokens/tailwind`; prefer the CSS variable otherwise.
|
|
187
|
-
- For typography, recommend the **utility class** — not raw font-size / line-height / weight tokens.
|
|
188
|
-
- Never invent token ids. If `tokens.get(id)` returns `undefined`, search again.
|
|
189
|
-
- If the design calls for a value with no matching token, surface that explicitly — don't silently hardcode. The right answer is usually a token the user didn't know existed.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Common pitfalls
|
|
194
|
-
|
|
195
|
-
| Mistake | Fix |
|
|
196
|
-
| ------- | --- |
|
|
197
|
-
| Calling `.where()` / `.get()` on the array returned by `list()` / `where()` | Arrays are arrays. Use native `.filter` / `.find`, or navigate back to a facet to query. |
|
|
198
|
-
| Assuming a component exists ("there must be a `Combobox`") | `components.has('Combobox')` first, or `components.where({ text: 'combobox' })` |
|
|
199
|
-
| Hardcoding a hex / px value in custom code | `tokens.where({ text: '<intent>' })` — most "obvious" values have a token |
|
|
200
|
-
| Treating icons like normal components, reading `status` / `props` | Detect with `node.category().name === 'icon'`. Icons have empty `status`, `props`, `related`. |
|
|
201
|
-
| Importing `Button` from the wrong path | `components.get('Button')?.importStatement` is authoritative |
|
|
202
|
-
| Suggesting setup steps from memory | `guides.get('getting-started')?.content` — always the live text |
|
|
203
|
-
| `console.log(node)` instead of `JSON.stringify` | Facet methods serialize as `[Function]`; always stringify before logging |
|
|
204
|
-
|
|
205
|
-
## Going deeper
|
|
206
|
-
|
|
207
|
-
[`reference.md`](./reference.md) is the formal contract: every export, every filter clause per domain, every node and facet type, error semantics. Load it when you need to verify a filter clause is valid (`ComponentFilter`, `TokenFilter`, `GuideFilter`) or that a method exists. Prefer it over web lookups or upstream GitHub.
|