@cdx-ui/components 0.3.1 → 0.3.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/README.md +2 -2
- package/coverage.svg +1 -1
- package/docs/components/bottom-sheet/content.md +2 -2
- package/docs/components/content.md +2 -0
- package/docs/components/currency-input/content.md +94 -5
- package/docs/components/data-grid/content.md +125 -1
- package/docs/components/insight/content.md +644 -0
- package/docs/components/insight-stack/content.md +231 -0
- package/docs/foundations/styles/tokens/all-tokens/content.md +23 -3
- package/docs/llms.txt +4 -0
- package/docs/patterns/forms/content.md +255 -0
- package/docs/resources/release-notes/0.3.1/content.md +13 -0
- package/docs/resources/release-notes/0.3.2/content.md +17 -0
- package/docs/resources/release-notes/content.md +2 -0
- package/lib/commonjs/components/BottomSheet/index.js +63 -16
- package/lib/commonjs/components/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/components/CurrencyInput/index.js +35 -10
- package/lib/commonjs/components/CurrencyInput/index.js.map +1 -1
- package/lib/commonjs/components/CurrencyInput/styles.js +40 -3
- package/lib/commonjs/components/CurrencyInput/styles.js.map +1 -1
- package/lib/commonjs/components/Insight/index.js +438 -0
- package/lib/commonjs/components/Insight/index.js.map +1 -0
- package/lib/commonjs/components/Insight/insetRadius.js +35 -0
- package/lib/commonjs/components/Insight/insetRadius.js.map +1 -0
- package/lib/commonjs/components/Insight/styles.js +186 -0
- package/lib/commonjs/components/Insight/styles.js.map +1 -0
- package/lib/commonjs/components/InsightStack/index.js +93 -0
- package/lib/commonjs/components/InsightStack/index.js.map +1 -0
- package/lib/commonjs/components/InsightStack/styles.js +61 -0
- package/lib/commonjs/components/InsightStack/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +24 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js +8 -8
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/commonjs/figma/Insight.figma.js +73 -0
- package/lib/commonjs/figma/Insight.figma.js.map +1 -0
- package/lib/commonjs/figma/InsightStack.figma.js +39 -0
- package/lib/commonjs/figma/InsightStack.figma.js.map +1 -0
- package/lib/module/components/BottomSheet/index.js +64 -17
- package/lib/module/components/BottomSheet/index.js.map +1 -1
- package/lib/module/components/CurrencyInput/index.js +37 -12
- package/lib/module/components/CurrencyInput/index.js.map +1 -1
- package/lib/module/components/CurrencyInput/styles.js +38 -3
- package/lib/module/components/CurrencyInput/styles.js.map +1 -1
- package/lib/module/components/Insight/index.js +433 -0
- package/lib/module/components/Insight/index.js.map +1 -0
- package/lib/module/components/Insight/insetRadius.js +30 -0
- package/lib/module/components/Insight/insetRadius.js.map +1 -0
- package/lib/module/components/Insight/styles.js +183 -0
- package/lib/module/components/Insight/styles.js.map +1 -0
- package/lib/module/components/InsightStack/index.js +89 -0
- package/lib/module/components/InsightStack/index.js.map +1 -0
- package/lib/module/components/InsightStack/styles.js +58 -0
- package/lib/module/components/InsightStack/styles.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/CurrencyInput.figma.js +8 -8
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/module/figma/Insight.figma.js +67 -0
- package/lib/module/figma/Insight.figma.js.map +1 -0
- package/lib/module/figma/InsightStack.figma.js +33 -0
- package/lib/module/figma/InsightStack.figma.js.map +1 -0
- package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -1
- package/lib/typescript/components/CurrencyInput/index.d.ts +4 -1
- package/lib/typescript/components/CurrencyInput/index.d.ts.map +1 -1
- package/lib/typescript/components/CurrencyInput/styles.d.ts +17 -6
- package/lib/typescript/components/CurrencyInput/styles.d.ts.map +1 -1
- package/lib/typescript/components/Insight/index.d.ts +87 -0
- package/lib/typescript/components/Insight/index.d.ts.map +1 -0
- package/lib/typescript/components/Insight/insetRadius.d.ts +8 -0
- package/lib/typescript/components/Insight/insetRadius.d.ts.map +1 -0
- package/lib/typescript/components/Insight/styles.d.ts +33 -0
- package/lib/typescript/components/Insight/styles.d.ts.map +1 -0
- package/lib/typescript/components/InsightStack/index.d.ts +21 -0
- package/lib/typescript/components/InsightStack/index.d.ts.map +1 -0
- package/lib/typescript/components/InsightStack/styles.d.ts +11 -0
- package/lib/typescript/components/InsightStack/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Insight.figma.d.ts +8 -0
- package/lib/typescript/figma/Insight.figma.d.ts.map +1 -0
- package/lib/typescript/figma/InsightStack.figma.d.ts +8 -0
- package/lib/typescript/figma/InsightStack.figma.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/components/BottomSheet/index.tsx +88 -13
- package/src/components/CurrencyInput/index.tsx +36 -12
- package/src/components/CurrencyInput/styles.ts +51 -4
- package/src/components/Insight/index.tsx +531 -0
- package/src/components/Insight/insetRadius.ts +30 -0
- package/src/components/Insight/styles.ts +193 -0
- package/src/components/InsightStack/index.tsx +86 -0
- package/src/components/InsightStack/styles.ts +61 -0
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","DISABLED_CURSOR","FRAME_WIDTH","SURFACE_RADIUS","SUMMARY_BODY","PRESS_REGION_STATE","join","insightFrameVariants","variants","layout","summary","detail","color","info","warning","danger","aiGenerated","true","false","compoundVariants","className","defaultVariants","insightSurfaceVariants","split","insightPressRegionVariants","insightIconVariants","insightSummaryTextVariants","hasClose","insightTagVariants","insightTagIconVariants","insightCloseVariants","insightHeaderVariants","insightTitleVariants","insightDescriptionVariants","insightContentVariants","insightFooterVariants"],"sourceRoot":"../../../../src","sources":["components/Insight/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,eAAe;AACtD,SAASC,eAAe,QAAQ,wBAAwB;;AAExD;AACA,OAAO,MAAMC,WAAW,GAAG,CAAC;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AAO,MAAMC,kBAAkB,GAAG5B,GAAG,CAAC,CAAC,mCAAmC,CAAC,CAAC;AAE5E,OAAO,MAAM6B,sBAAsB,GAAG7B,GAAG,CAAC,EAAE,EAAE;EAC5CQ,QAAQ,EAAE;IACRI,KAAK,EAAE;MACLC,IAAI,EAAE,6BAA6B;MACnCC,OAAO,EAAE,gCAAgC;MACzCC,MAAM,EAAE;IACV;EACF,CAAC;EACDM,eAAe,EAAE;IACfT,KAAK,EAAE;EACT;AACF,CAAC,CAAC;;AAEF;;AAEA;AACA,OAAO,MAAMkB,oBAAoB,GAAG9B,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC;;AAEjE;;AAEA,OAAO,MAAM+B,qBAAqB,GAAG/B,GAAG,CAAC,CAAC,gCAAgC,CAAC,CAAC;AAE5E,OAAO,MAAMgC,oBAAoB,GAAGhC,GAAG,CAAC,CAAC,iCAAiC,CAAC,EAAE;EAC3EQ,QAAQ,EAAE;IACRmB,QAAQ,EAAE;MACRV,IAAI,EAAE,MAAM;MACZC,KAAK,EAAE;IACT;EACF,CAAC;EACDG,eAAe,EAAE;IACfM,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,OAAO,MAAMM,0BAA0B,GAAGjC,GAAG,CAAC,CAAC,8BAA8B,CAAC,CAAC;AAE/E,OAAO,MAAMkC,sBAAsB,GAAGlC,GAAG,CAAC,EAAE,CAAC;;AAE7C;AACA,OAAO,MAAMmC,qBAAqB,GAAGnC,GAAG,CAAC,CAAC,mDAAmD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cloneElement, forwardRef, isValidElement } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { Slot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn } from '@cdx-ui/utils';
|
|
7
|
+
import { insightStackFrontVariants, insightStackLayerVariants, insightStackRootVariants } from './styles';
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const layerCountFor = count => count >= 3 ? 2 : count >= 2 ? 1 : 0;
|
|
10
|
+
function InsightStackLayer({
|
|
11
|
+
depth,
|
|
12
|
+
layers
|
|
13
|
+
}) {
|
|
14
|
+
return /*#__PURE__*/_jsx(View, {
|
|
15
|
+
"aria-hidden": true,
|
|
16
|
+
accessibilityElementsHidden: true,
|
|
17
|
+
importantForAccessibility: "no-hide-descendants",
|
|
18
|
+
className: insightStackLayerVariants({
|
|
19
|
+
depth,
|
|
20
|
+
layers
|
|
21
|
+
}),
|
|
22
|
+
...dataAttributes({
|
|
23
|
+
slot: 'insight-stack-layer'
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function InsightStackBody({
|
|
28
|
+
layers,
|
|
29
|
+
children
|
|
30
|
+
}) {
|
|
31
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
+
children: [layers === 2 ? /*#__PURE__*/_jsx(InsightStackLayer, {
|
|
33
|
+
depth: 2,
|
|
34
|
+
layers: 2
|
|
35
|
+
}) : null, layers === 0 ? null : /*#__PURE__*/_jsx(InsightStackLayer, {
|
|
36
|
+
depth: 1,
|
|
37
|
+
layers: layers
|
|
38
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
39
|
+
className: insightStackFrontVariants(),
|
|
40
|
+
children: children
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Draws up to two decorative cards behind a summary Insight to show that more insights exist.
|
|
47
|
+
* The root adds no role, so the front Insight stays the only interactive element.
|
|
48
|
+
*/
|
|
49
|
+
export const InsightStack = /*#__PURE__*/forwardRef(({
|
|
50
|
+
count,
|
|
51
|
+
asChild = false,
|
|
52
|
+
className,
|
|
53
|
+
style,
|
|
54
|
+
children,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) => {
|
|
57
|
+
const layers = layerCountFor(count);
|
|
58
|
+
const rootProps = {
|
|
59
|
+
className: cn(insightStackRootVariants({
|
|
60
|
+
layers
|
|
61
|
+
}), className),
|
|
62
|
+
style,
|
|
63
|
+
...props,
|
|
64
|
+
...mergeDataAttributes(props, dataAttributes({
|
|
65
|
+
slot: 'insight-stack'
|
|
66
|
+
}))
|
|
67
|
+
};
|
|
68
|
+
if (asChild && /*#__PURE__*/isValidElement(children)) {
|
|
69
|
+
const child = children;
|
|
70
|
+
return /*#__PURE__*/_jsx(Slot, {
|
|
71
|
+
ref: ref,
|
|
72
|
+
...rootProps,
|
|
73
|
+
children: /*#__PURE__*/cloneElement(child, undefined, /*#__PURE__*/_jsx(InsightStackBody, {
|
|
74
|
+
layers: layers,
|
|
75
|
+
children: child.props.children
|
|
76
|
+
}))
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return /*#__PURE__*/_jsx(View, {
|
|
80
|
+
ref: ref,
|
|
81
|
+
...rootProps,
|
|
82
|
+
children: /*#__PURE__*/_jsx(InsightStackBody, {
|
|
83
|
+
layers: layers,
|
|
84
|
+
children: children
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
InsightStack.displayName = 'InsightStack';
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cloneElement","forwardRef","isValidElement","View","Slot","dataAttributes","mergeDataAttributes","cn","insightStackFrontVariants","insightStackLayerVariants","insightStackRootVariants","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","layerCountFor","count","InsightStackLayer","depth","layers","accessibilityElementsHidden","importantForAccessibility","className","slot","InsightStackBody","children","InsightStack","asChild","style","props","ref","rootProps","child","undefined","displayName"],"sourceRoot":"../../../../src","sources":["components/InsightStack/index.tsx"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,UAAU,EAAEC,cAAc,QAA2C,OAAO;AACnG,SA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
+
// ── Root ────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
// The bottom padding is the room the layers peek into: 6px per layer, matching Figma.
|
|
8
|
+
export const insightStackRootVariants = cva(['relative'], {
|
|
9
|
+
variants: {
|
|
10
|
+
layers: {
|
|
11
|
+
0: '',
|
|
12
|
+
1: 'pb-1.5',
|
|
13
|
+
2: 'pb-3'
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
layers: 0
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// ── Front ───────────────────────────────────────────────────
|
|
22
|
+
|
|
23
|
+
// Keeps the front Insight painted above the layers on Android.
|
|
24
|
+
export const insightStackFrontVariants = cva(['relative z-10']);
|
|
25
|
+
|
|
26
|
+
// ── Layer ───────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
// Each layer is anchored to the root's bottom, so it peeks 6px per depth below the front card
|
|
29
|
+
// whatever that card's height. Both start at `top-5`, below where any front card begins: a detail
|
|
30
|
+
// Insight's frame sits 11px down (its tag reserve), and the layer's 6px glow needs room above
|
|
31
|
+
// that, so the layer tops stay hidden behind the opaque front card (at least 60px tall). The insets
|
|
32
|
+
// are symmetric, so RTL needs no mirroring.
|
|
33
|
+
export const insightStackLayerVariants = cva(['absolute', 'bg-surface-primary', 'border-2 border-stroke-secondary', 'rounded-[var(--border-radius-default)]', 'shadow-[0_0_6px_var(--color-surface-neutral-subtle)]'], {
|
|
34
|
+
variants: {
|
|
35
|
+
depth: {
|
|
36
|
+
1: 'inset-x-1 top-5',
|
|
37
|
+
2: 'inset-x-2 top-5 bottom-0'
|
|
38
|
+
},
|
|
39
|
+
layers: {
|
|
40
|
+
1: '',
|
|
41
|
+
2: ''
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
compoundVariants: [{
|
|
45
|
+
depth: 1,
|
|
46
|
+
layers: 1,
|
|
47
|
+
className: 'bottom-0'
|
|
48
|
+
}, {
|
|
49
|
+
depth: 1,
|
|
50
|
+
layers: 2,
|
|
51
|
+
className: 'bottom-1.5'
|
|
52
|
+
}],
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
depth: 1,
|
|
55
|
+
layers: 1
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","insightStackRootVariants","variants","layers","defaultVariants","insightStackFrontVariants","insightStackLayerVariants","depth","compoundVariants","className"],"sourceRoot":"../../../../src","sources":["components/InsightStack/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,eAAe;;AAEtD;;AAEA;AACA,OAAO,MAAMC,wBAAwB,GAAGD,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE;EACxDE,QAAQ,EAAE;IACRC,MAAM,EAAE;MACN,CAAC,EAAE,EAAE;MACL,CAAC,EAAE,QAAQ;MACX,CAAC,EAAE;IACL;EACF,CAAC;EACDC,eAAe,EAAE;IACfD,MAAM,EAAE;EACV;AACF,CAAC,CAAC;;AAEF;;AAEA;AACA,OAAO,MAAME,yBAAyB,GAAGL,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;;AAE/D;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,yBAAyB,GAAGN,GAAG,CAC1C,CACE,UAAU,EACV,oBAAoB,EACpB,kCAAkC,EAClC,wCAAwC,EACxC,sDAAsD,CACvD,EACD;EACEE,QAAQ,EAAE;IACRK,KAAK,EAAE;MACL,CAAC,EAAE,iBAAiB;MACpB,CAAC,EAAE;IACL,CAAC;IACDJ,MAAM,EAAE;MACN,CAAC,EAAE,EAAE;MACL,CAAC,EAAE;IACL;EACF,CAAC;EACDK,gBAAgB,EAAE,CAChB;IAAED,KAAK,EAAE,CAAC;IAAEJ,MAAM,EAAE,CAAC;IAAEM,SAAS,EAAE;EAAW,CAAC,EAC9C;IAAEF,KAAK,EAAE,CAAC;IAAEJ,MAAM,EAAE,CAAC;IAAEM,SAAS,EAAE;EAAa,CAAC,CACjD;EACDL,eAAe,EAAE;IACfG,KAAK,EAAE,CAAC;IACRJ,MAAM,EAAE;EACV;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -36,6 +36,8 @@ export * from './Field';
|
|
|
36
36
|
export * from './Form';
|
|
37
37
|
export * from './FullScreenDialog';
|
|
38
38
|
export * from './Image';
|
|
39
|
+
export * from './Insight';
|
|
40
|
+
export * from './InsightStack';
|
|
39
41
|
export * from './InsuranceDisclosure';
|
|
40
42
|
export * from './Input';
|
|
41
43
|
export * from './OtpInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ColorSwatch","HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,SAASA,WAAW,QAA6D,eAAe;AAChG,cAAc,qBAAqB;AACnC,cAAc,iBAAiB;AAC/B,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,mBAAmB;AACjC,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,uBAAuB;AACrC,cAAc,SAAS;AAC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iB;AAC/B,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,UAAU;AACxB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,gBAAgB;AAC9B,cAAc,uBAAuB;AACrC,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,mBAAmB;AACjC,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,aAAa;AAC3B,cAAc,QAAQ;AACtB,cAAc,eAAe;AAC7B,cAAc,kBAAkB;AAChC,cAAc,YAAY;AAC1B,cAAc,qBAAqB;AACnC,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,mBAAmB;AAMjC,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,SAASC,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,qBAAqB","ignoreList":[]}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import figma from 'figma';
|
|
7
7
|
const instance = figma.selectedInstance;
|
|
8
8
|
|
|
9
|
-
// Figma names this component AmountInput.
|
|
10
|
-
//
|
|
11
|
-
// equivalent, so the snippet flags
|
|
9
|
+
// Figma names this component AmountInput. `hero` is the default `ghost` variant (large, centered
|
|
10
|
+
// amount entry) and `outlined` is the bordered `outline` variant. The trailing slot has no code
|
|
11
|
+
// equivalent, so the snippet flags it rather than substituting another component.
|
|
12
12
|
// `Viewport` only previews responsive type sizes.
|
|
13
|
-
const
|
|
14
|
-
outlined:
|
|
15
|
-
hero:
|
|
13
|
+
const variant = instance.getEnum('variant', {
|
|
14
|
+
outlined: 'outline',
|
|
15
|
+
hero: 'ghost'
|
|
16
16
|
});
|
|
17
17
|
const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
|
|
18
18
|
const isInvalid = instance.getEnum('isInvalid', {
|
|
@@ -29,6 +29,7 @@ const isDisabled = instance.getEnum('isDisabled', {
|
|
|
29
29
|
});
|
|
30
30
|
const currencySymbol = instance.getString('currencySymbol');
|
|
31
31
|
const amount = Number(instance.getString('value').replace(/[^0-9.]/g, ''));
|
|
32
|
+
const variantProp = figma.helpers.react.renderProp('variant', variant === 'outline' ? variant : undefined);
|
|
32
33
|
const valueProp = figma.helpers.react.renderProp('value', Number.isFinite(amount) ? amount : 0);
|
|
33
34
|
const currencySymbolProp = figma.helpers.react.renderProp('currencySymbol', currencySymbol === '$' ? undefined : currencySymbol);
|
|
34
35
|
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
@@ -38,10 +39,9 @@ export default {
|
|
|
38
39
|
id: 'currency-input',
|
|
39
40
|
imports: ["import { CurrencyInput } from '@cdx-ui/components'"],
|
|
40
41
|
example: figma.code`
|
|
41
|
-
${isOutlined ? figma.code`{/* Figma variant "outlined" has no code equivalent; CurrencyInput renders the "hero" style. */}` : null}
|
|
42
42
|
${showTrailingSlot ? figma.code`{/* The Figma trailing slot has no CurrencyInput equivalent. */}` : null}
|
|
43
43
|
<CurrencyInput
|
|
44
|
-
accessibilityLabel="Amount"${valueProp}${currencySymbolProp}${isInvalidProp}${isReadOnlyProp}${isDisabledProp}
|
|
44
|
+
accessibilityLabel="Amount"${variantProp}${valueProp}${currencySymbolProp}${isInvalidProp}${isReadOnlyProp}${isDisabledProp}
|
|
45
45
|
onChangeValue={setAmount}
|
|
46
46
|
/>`
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","outlined","hero","showTrailingSlot","getBoolean","isInvalid","true","false","undefined","isReadOnly","isDisabled","currencySymbol","getString","amount","Number","replace","variantProp","helpers","react","renderProp","valueProp","isFinite","currencySymbolProp","isInvalidProp","isReadOnlyProp","isDisabledProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/CurrencyInput.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,QAAQ,EAAE,SAAS;EACnBC,IAAI,EAAE;AACR,CAAC,CAAC;AACF,MAAMC,gBAAgB,GAAGN,QAAQ,CAACO,UAAU,CAAC,oBAAoB,CAAC;AAElE,MAAMC,SAAS,GAAGR,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CM,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGZ,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDM,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAME,UAAU,GAAGb,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDM,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAMG,cAAc,GAAGd,QAAQ,CAACe,SAAS,CAAC,gBAAgB,CAAC;AAC3D,MAAMC,MAAM,GAAGC,MAAM,CAACjB,QAAQ,CAACe,SAAS,CAAC,OAAO,CAAC,CAACG,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAE1E,MAAMC,WAAW,GAAGpB,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CAChD,SAAS,EACTpB,OAAO,KAAK,SAAS,GAAGA,OAAO,GAAGS,SACpC,CAAC;AACD,MAAMY,SAAS,GAAGxB,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAEL,MAAM,CAACO,QAAQ,CAACR,MAAM,CAAC,GAAGA,MAAM,GAAG,CAAC,CAAC;AAC/F,MAAMS,kBAAkB,GAAG1B,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CACvD,gBAAgB,EAChBR,cAAc,KAAK,GAAG,GAAGH,SAAS,GAAGG,cACvC,CAAC;AACD,MAAMY,aAAa,GAAG3B,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEd,SAAS,CAAC;AAC5E,MAAMmB,cAAc,GAAG5B,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEV,UAAU,CAAC;AAC/E,MAAMgB,cAAc,GAAG7B,KAAK,CAACqB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAET,UAAU,CAAC;AAE/E,eAAe;EACbgB,EAAE,EAAE,gBAAgB;EACpBC,OAAO,EAAE,CAAC,oDAAoD,CAAC;EAC/DC,OAAO,EAAEhC,KAAK,CAACiC,IAAI;AACrB,EAAE1B,gBAAgB,GAAGP,KAAK,CAACiC,IAAI,kEAAkE,GAAG,IAAI;AACxG;AACA,+BAA+Bb,WAAW,GAAGI,SAAS,GAAGE,kBAAkB,GAAGC,aAAa,GAAGC,cAAc,GAAGC,cAAc;AAC7H;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=13158-18419
|
|
4
|
+
// source=packages/components/src/components/Insight/index.tsx
|
|
5
|
+
// component=Insight
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Figma `severity` is `color` in code: Insight drives no ARIA semantics or status icon (DEVEX-6446).
|
|
10
|
+
const color = instance.getEnum('severity', {
|
|
11
|
+
info: undefined,
|
|
12
|
+
warning: 'warning',
|
|
13
|
+
danger: 'danger'
|
|
14
|
+
});
|
|
15
|
+
const colorProp = figma.helpers.react.renderProp('color', color);
|
|
16
|
+
|
|
17
|
+
// Figma `size` switches slot structure, not size; code names it `layout`.
|
|
18
|
+
const layout = instance.getEnum('size', {
|
|
19
|
+
default: undefined,
|
|
20
|
+
expanded: 'detail'
|
|
21
|
+
});
|
|
22
|
+
const isDetail = layout === 'detail';
|
|
23
|
+
|
|
24
|
+
// Figma `intelligence` is `aiGenerated` in code. VARIANT with "true"/"false" strings.
|
|
25
|
+
const aiGenerated = instance.getEnum('intelligence', {
|
|
26
|
+
true: true,
|
|
27
|
+
false: undefined
|
|
28
|
+
});
|
|
29
|
+
const aiGeneratedProp = figma.helpers.react.renderProp('aiGenerated', aiGenerated);
|
|
30
|
+
const showCloseButton = instance.getBoolean('showCloseButton');
|
|
31
|
+
const onCloseProp = showCloseButton ? figma.helpers.react.renderProp('onClose', figma.helpers.react.function('() => {}')) : '';
|
|
32
|
+
const showContent = isDetail && instance.getBoolean('showContent');
|
|
33
|
+
const showActions = isDetail && instance.getBoolean('showActions');
|
|
34
|
+
|
|
35
|
+
// Text layers are read by position inside the named slot frames, not by layer name.
|
|
36
|
+
const textsIn = slot => instance.findLayers(node => node.type === 'TEXT', {
|
|
37
|
+
path: [slot],
|
|
38
|
+
traverseInstances: true
|
|
39
|
+
}).flatMap(node => node.type === 'TEXT' ? [node.textContent] : []);
|
|
40
|
+
const tagText = isDetail ? textsIn('Insight.Indicator')[0] ?? 'Category' : '';
|
|
41
|
+
const headerTexts = isDetail ? textsIn('Insight.Header') : [];
|
|
42
|
+
const title = headerTexts[0] ?? 'Title';
|
|
43
|
+
const detailDescription = headerTexts[1] ?? 'Description';
|
|
44
|
+
const summaryDescription = isDetail ? '' : textsIn('Insight.Summary')[0] ?? 'Description';
|
|
45
|
+
const actionSnippets = showActions ? instance.findConnectedInstances(node => node.codeConnectId() === 'button', {
|
|
46
|
+
path: ['Insight.Footer']
|
|
47
|
+
}).flatMap(button => button.type === 'INSTANCE' ? button.executeTemplate().example : []) : [];
|
|
48
|
+
export default {
|
|
49
|
+
id: 'insight',
|
|
50
|
+
imports: ["import { Insight } from '@cdx-ui/components'"],
|
|
51
|
+
example: isDetail ? figma.code`
|
|
52
|
+
<Insight layout="detail"${colorProp}${aiGeneratedProp}${onCloseProp}>
|
|
53
|
+
<Insight.Tag>${tagText}</Insight.Tag>
|
|
54
|
+
<Insight.Header>
|
|
55
|
+
<Insight.Title>${title}</Insight.Title>
|
|
56
|
+
<Insight.Description>${detailDescription}</Insight.Description>
|
|
57
|
+
</Insight.Header>
|
|
58
|
+
${showContent ? figma.code`<Insight.Content>{/* content */}</Insight.Content>` : null}
|
|
59
|
+
${showActions ? figma.code`<Insight.Footer>
|
|
60
|
+
${actionSnippets}
|
|
61
|
+
</Insight.Footer>` : null}
|
|
62
|
+
</Insight>` : figma.code`
|
|
63
|
+
<Insight${colorProp}${aiGeneratedProp}${onCloseProp}>
|
|
64
|
+
<Insight.Description>${summaryDescription}</Insight.Description>
|
|
65
|
+
</Insight>`
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=Insight.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","color","getEnum","info","undefined","warning","danger","colorProp","helpers","react","renderProp","layout","default","expanded","isDetail","aiGenerated","true","false","aiGeneratedProp","showCloseButton","getBoolean","onCloseProp","function","showContent","showActions","textsIn","slot","findLayers","node","type","path","traverseInstances","flatMap","textContent","tagText","headerTexts","title","detailDescription","summaryDescription","actionSnippets","findConnectedInstances","codeConnectId","button","executeTemplate","example","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Insight.figma.ts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AAiBa,OAAO;AACxB;AACA,qBAAqBE,KAAK;AAC1B,2BAA2BC,iBAAiB;AAC5C;AACA,IAAId,WAAW,GAAGzB,KAAK,CAACiD,IAAI,oDAAoD,GAAG,IAAI;AACvF,IACIvB,WAAW,GACP1B,KAAK,CAACiD,IAAI;AAClB,MAAMR,cAAc;AACpB,oBAAoB,GACZ,IAAI;AACZ,WACW,GACLzC,KAAK,CAACiD,IAAI;AAChB,UAAUxC,SAAS,GAAGW,eAAe,GAAGG,WAAW;AACnD,yBAAyBiB,kBAAkB;AAC3C;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=13652-32306
|
|
4
|
+
// source=packages/components/src/components/InsightStack/index.tsx
|
|
5
|
+
// component=InsightStack
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Figma's `3+` bucket becomes the smallest count that draws both layers; code takes a number.
|
|
10
|
+
const count = instance.getEnum('count', {
|
|
11
|
+
'1': 1,
|
|
12
|
+
'2': 2,
|
|
13
|
+
'3+': 3
|
|
14
|
+
});
|
|
15
|
+
const countProp = figma.helpers.react.renderProp('count', count);
|
|
16
|
+
|
|
17
|
+
// Found by Code Connect id, so the front card's layer name does not matter.
|
|
18
|
+
const frontInsight = instance.findConnectedInstance('insight', {
|
|
19
|
+
traverseInstances: true
|
|
20
|
+
});
|
|
21
|
+
const frontSnippet = frontInsight?.type === 'INSTANCE' ? frontInsight.executeTemplate().example : figma.code`<Insight layout="summary">
|
|
22
|
+
<Insight.Description>Description</Insight.Description>
|
|
23
|
+
</Insight>`;
|
|
24
|
+
export default {
|
|
25
|
+
id: 'insight-stack',
|
|
26
|
+
// Separate strings so the nested Insight template's identical import is deduped.
|
|
27
|
+
imports: ["import { InsightStack } from '@cdx-ui/components'", "import { Insight } from '@cdx-ui/components'"],
|
|
28
|
+
example: figma.code`
|
|
29
|
+
<InsightStack${countProp}>
|
|
30
|
+
${frontSnippet}
|
|
31
|
+
</InsightStack>`
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=InsightStack.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","count","getEnum","countProp","helpers","react","renderProp","frontInsight","findConnectedInstance","traverseInstances","frontSnippet","type","executeTemplate","example","code","id","imports"],"sourceRoot":"../../../src","sources":["figma/InsightStack.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,KAAK,GAAGF,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtC,GAAG,EAAE,CAAC;EACN,GAAG,EAAE,CAAC;EACN,IAAI,EAAE;AACR,CAAC,CAAC;AACF,MAAMC,SAAS,GAAGL,KAAK,CAACM,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAEL,KAAK,CAAC;;AAEhE;AACA,MAAMM,YAAY,GAAGR,QAAQ,CAACS,qBAAqB,CAAC,SAAS,EAAE;EAAEC,iBAAiB,EAAE;AAAK,CAAC,CAAC;AAC3F,MAAMC,YAAY,GAChBH,YAAY,EAAEI,IAAI,KAAK,UAAU,GAC7BJ,YAAY,CAACK,eAAe,CAAC,CAAC,CAACC,OAAO,GACtCf,KAAK,CAACgB,IAAI;AAChB;AACA,aAAa;AAEb,eAAe;EACbC,EAAE,EAAE,eAAe;EACnB;EACAC,OAAO,EAAE,CACP,mDAAmD,EACnD,8CAA8C,CAC/C;EACDH,OAAO,EAAEf,KAAK,CAACgB,IAAI;AACrB,eAAeX,SAAS;AACxB,IAAIO,YAAY;AAChB;AACA,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/BottomSheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/BottomSheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAUZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,IAAI,EACJ,SAAS,EAEV,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EAMf,KAAK,qBAAqB,IAAI,2BAA2B,EAC1D,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAKL,KAAK,8BAA8B,EACpC,MAAM,UAAU,CAAC;AAgDlB,yHAAyH;AACzH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,4DAA4D;IAC5D,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,QAAA,MAAM,iBAAiB,qFA2BtB,CAAC;AAOF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,M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AAC;IAC/C,IAAI,EAAE,OAAO,qBAAqB,CAAC;CACpC;AAED,eAAO,MAAM,WAAW,EAQnB,mBAAmB,CAAC;AAIzB,wBAAgB,cAAc;;;;EAS7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,oGAGvC"}
|
|
@@ -6,7 +6,10 @@ export interface CurrencyInputProps extends IInputFieldProps, CurrencyInputVaria
|
|
|
6
6
|
value?: number;
|
|
7
7
|
/** Called with the parsed amount in major currency units, not cents, when the user edits the field. */
|
|
8
8
|
onChangeValue?: (value: number) => void;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Currency symbol shown before the amount. Defaults to `"$"`. Part of the field text in
|
|
11
|
+
* `ghost`; a separate, non-editable prefix in `outline`.
|
|
12
|
+
*/
|
|
10
13
|
currencySymbol?: string;
|
|
11
14
|
className?: string;
|
|
12
15
|
style?: ViewProps['style'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/CurrencyInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/CurrencyInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,yBAAyB,EAI/B,MAAM,UAAU,CAAC;AAqBlB,MAAM,WAAW,kBACf,SACE,gBAAgB,EAChB,yBAAyB,EACzB,IAAI,CACF,cAAc,EACd,oBAAoB,GAAG,mBAAmB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,eAAe,CAC/F;IACH,wGAAwG;IACxG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uGAAuG;IACvG,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,0GA+JzB,CAAC"}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface CurrencyInputVariantProps {
|
|
2
|
+
/**
|
|
3
|
+
* Visual style. `ghost` is the large, centered, borderless amount entry; `outline` renders
|
|
4
|
+
* the bordered `Input` shell with a leading currency-symbol prefix, for amounts that sit
|
|
5
|
+
* alongside other form fields.
|
|
6
|
+
* @default 'ghost'
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'ghost' | 'outline';
|
|
9
|
+
/**
|
|
10
|
+
* Height, padding, and text size.
|
|
11
|
+
* @default 'default'
|
|
12
|
+
*/
|
|
13
|
+
size?: 'default' | 'small';
|
|
14
|
+
}
|
|
15
|
+
export declare const currencyInputRootVariants: ({ variant, size, }?: CurrencyInputVariantProps) => string;
|
|
16
|
+
export declare const currencyInputFieldVariants: ({ variant, size, }?: CurrencyInputVariantProps) => string;
|
|
17
|
+
export declare const currencyInputPrefixVariants: (props?: ({
|
|
3
18
|
size?: "small" | "default" | null | undefined;
|
|
4
19
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
-
export declare const currencyInputFieldVariants: (props?: ({
|
|
6
|
-
size?: "small" | "default" | null | undefined;
|
|
7
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
export type CurrencyInputVariantProps = VariantProps<typeof currencyInputRootVariants>;
|
|
9
20
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/CurrencyInput/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/CurrencyInput/styles.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC5B;AA6CD,eAAO,MAAM,yBAAyB,GAAI,qBAGvC,yBAA8B,KAAG,MAGU,CAAC;AAE/C,eAAO,MAAM,0BAA0B,GAAI,qBAGxC,yBAA8B,KAAG,MAC8D,CAAC;AAGnG,eAAO,MAAM,2BAA2B;;8EAavC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { Text, View, type TextProps, type ViewProps } from 'react-native';
|
|
3
|
+
import { type IInsightDetailProps, type IInsightSummaryProps } from '@cdx-ui/primitives';
|
|
4
|
+
interface InsightStyleProps {
|
|
5
|
+
/**
|
|
6
|
+
* Tints the border, the summary medallion, and the detail tag. Visual only: any meaning it
|
|
7
|
+
* carries must also be in the text.
|
|
8
|
+
* @default 'info'
|
|
9
|
+
*/
|
|
10
|
+
color?: 'info' | 'warning' | 'danger';
|
|
11
|
+
/**
|
|
12
|
+
* Swaps the `color` border for the AI gradient border.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
aiGenerated?: boolean;
|
|
16
|
+
/** Renders a dismiss button at the top-end corner. In `summary`, it sits beside the press region, not inside it. */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Accessible name for the dismiss button.
|
|
20
|
+
* @default 'Dismiss insight'
|
|
21
|
+
*/
|
|
22
|
+
closeAccessibilityLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `className` and `style` style the outer frame (the border). `asChild` replaces the inner
|
|
26
|
+
* surface element. `onPress` exists only on `layout="summary"`.
|
|
27
|
+
*
|
|
28
|
+
* `ref` targets the element that takes focus: the press region of a summary with `onPress`
|
|
29
|
+
* (the surface, or the region beside the dismiss button when `onClose` is also set), so
|
|
30
|
+
* `ref.current?.focus()` moves focus to the card. A static Insight puts `ref` on its surface.
|
|
31
|
+
*/
|
|
32
|
+
export type InsightProps = (Omit<IInsightSummaryProps, 'accessory' | 'pressableClassName'> & InsightStyleProps) | (Omit<IInsightDetailProps, 'accessory' | 'pressableClassName'> & InsightStyleProps);
|
|
33
|
+
declare const InsightRootStyled: import("react").ForwardRefExoticComponent<InsightProps & import("react").RefAttributes<View>>;
|
|
34
|
+
export interface InsightTagProps extends ViewProps {
|
|
35
|
+
/** Merges the label props onto a single text child instead of rendering `Text`. */
|
|
36
|
+
asChild?: boolean;
|
|
37
|
+
/** Classes for the positioned tag wrapper. */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** The insight's category, read before the title. */
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The detail layout's category tag. Insight renders it as a Sparkle chip straddling the top
|
|
44
|
+
* border, ahead of the header in reading order, wherever it appears among the children.
|
|
45
|
+
*/
|
|
46
|
+
declare const InsightTag: import("react").ForwardRefExoticComponent<InsightTagProps & import("react").RefAttributes<View>>;
|
|
47
|
+
export interface InsightHeaderProps extends ViewProps {
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
declare const InsightHeader: import("react").ForwardRefExoticComponent<InsightHeaderProps & import("react").RefAttributes<View>>;
|
|
53
|
+
export interface InsightTitleProps extends TextProps {
|
|
54
|
+
asChild?: boolean;
|
|
55
|
+
className?: string;
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
declare const InsightTitle: import("react").ForwardRefExoticComponent<InsightTitleProps & import("react").RefAttributes<Text>>;
|
|
59
|
+
export interface InsightDescriptionProps extends TextProps {
|
|
60
|
+
asChild?: boolean;
|
|
61
|
+
className?: string;
|
|
62
|
+
children?: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
declare const InsightDescription: import("react").ForwardRefExoticComponent<InsightDescriptionProps & import("react").RefAttributes<Text>>;
|
|
65
|
+
export interface InsightContentProps extends ViewProps {
|
|
66
|
+
asChild?: boolean;
|
|
67
|
+
className?: string;
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
declare const InsightContent: import("react").ForwardRefExoticComponent<InsightContentProps & import("react").RefAttributes<View>>;
|
|
71
|
+
export interface InsightFooterProps extends ViewProps {
|
|
72
|
+
asChild?: boolean;
|
|
73
|
+
className?: string;
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
}
|
|
76
|
+
declare const InsightFooter: import("react").ForwardRefExoticComponent<InsightFooterProps & import("react").RefAttributes<View>>;
|
|
77
|
+
type InsightCompoundComponent = typeof InsightRootStyled & {
|
|
78
|
+
Tag: typeof InsightTag;
|
|
79
|
+
Header: typeof InsightHeader;
|
|
80
|
+
Title: typeof InsightTitle;
|
|
81
|
+
Description: typeof InsightDescription;
|
|
82
|
+
Content: typeof InsightContent;
|
|
83
|
+
Footer: typeof InsightFooter;
|
|
84
|
+
};
|
|
85
|
+
export declare const Insight: InsightCompoundComponent;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Insight/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAAY,IAAI,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQpF,OAAO,EAML,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAwD5B,UAAU,iBAAiB;IACzB;;;;OAIG;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AC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,kBAAkB,0GAgBvB,CAAC;AAQF,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,cAAc,sGAgBnB,CAAC;AAQF,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,aAAa,qGAgBlB,CAAC;AAQF,KAAK,wBAAwB,GAAG,OAAO,iBAAiB,GAAG;IACzD,GAAG,EAAE,OAAO,UAAU,CAAC;IACvB,MAAM,EAAE,OAAO,aAAa,CAAC;IAC7B,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,WAAW,EAAE,OAAO,kBAAkB,CAAC;IACvC,OAAO,EAAE,OAAO,cAAc,CAAC;IAC/B,MAAM,EAAE,OAAO,aAAa,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,OAAO,EAOd,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a resolved CSS variable (a number, or a `px`/`rem` string) to pixels. Native resolves
|
|
3
|
+
* built-in tokens to numbers, while runtime theme overrides and the web resolve to strings.
|
|
4
|
+
*/
|
|
5
|
+
export declare function cssLengthToPx(value: string | number | undefined): number | undefined;
|
|
6
|
+
/** The radius of a surface inset `inset` px inside a frame with radius `outer`, or `undefined` when `outer` is not a length. */
|
|
7
|
+
export declare function insetRadius(outer: string | number | undefined, inset: number): number | undefined;
|
|
8
|
+
//# sourceMappingURL=insetRadius.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insetRadius.d.ts","sourceRoot":"","sources":["../../../../src/components/Insight/insetRadius.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAepF;AAED,gIAAgI;AAChI,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VariantProps } from '@cdx-ui/utils';
|
|
2
|
+
/** Ring width in px; must match the frame's `p-0.5`. */
|
|
3
|
+
export declare const FRAME_WIDTH = 2;
|
|
4
|
+
export declare const insightFrameVariants: (props?: ({
|
|
5
|
+
layout?: "summary" | "detail" | null | undefined;
|
|
6
|
+
color?: "danger" | "warning" | "info" | null | undefined;
|
|
7
|
+
aiGenerated?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const insightSurfaceVariants: (props?: ({
|
|
10
|
+
layout?: "summary" | "detail" | null | undefined;
|
|
11
|
+
split?: boolean | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
export declare const insightPressRegionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
14
|
+
export declare const insightIconVariants: (props?: ({
|
|
15
|
+
color?: "danger" | "warning" | "info" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
+
export declare const insightSummaryTextVariants: (props?: ({
|
|
18
|
+
hasClose?: boolean | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
20
|
+
export declare const insightTagVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
21
|
+
export declare const insightTagIconVariants: (props?: ({
|
|
22
|
+
color?: "danger" | "warning" | "info" | null | undefined;
|
|
23
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
24
|
+
export declare const insightCloseVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
25
|
+
export declare const insightHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
26
|
+
export declare const insightTitleVariants: (props?: ({
|
|
27
|
+
hasClose?: boolean | null | undefined;
|
|
28
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
29
|
+
export declare const insightDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
30
|
+
export declare const insightContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
31
|
+
export declare const insightFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
32
|
+
export type InsightFrameVariantProps = VariantProps<typeof insightFrameVariants>;
|
|
33
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Insight/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAGvD,wDAAwD;AACxD,eAAO,MAAM,WAAW,IAAI,CAAC;AAwB7B,eAAO,MAAM,oBAAoB;;;;8EAmDhC,CAAC;AAIF,eAAO,MAAM,sBAAsB;;;8EAoBjC,CAAC;AAIH,eAAO,MAAM,0BAA0B,oFAIrC,CAAC;AAKH,eAAO,MAAM,mBAAmB;;8EAW9B,CAAC;AAMH,eAAO,MAAM,0BAA0B;;8EAUrC,CAAC;AAMH,eAAO,MAAM,kBAAkB,oFAA6C,CAAC;AAE7E,eAAO,MAAM,sBAAsB;;8EAWjC,CAAC;AAKH,eAAO,MAAM,oBAAoB,oFAAgC,CAAC;AAIlE,eAAO,MAAM,qBAAqB,oFAA0C,CAAC;AAE7E,eAAO,MAAM,oBAAoB;;8EAU/B,CAAC;AAEH,eAAO,MAAM,0BAA0B,oFAAwC,CAAC;AAEhF,eAAO,MAAM,sBAAsB,oFAAU,CAAC;AAG9C,eAAO,MAAM,qBAAqB,oFAA6D,CAAC;AAEhG,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
export interface InsightStackProps extends ViewProps {
|
|
4
|
+
/**
|
|
5
|
+
* How many insights the stack stands for. `1` or less draws no layers, `2` draws one, and `3`
|
|
6
|
+
* or more draws two. The layers are decorative, so put the count in the front Insight's
|
|
7
|
+
* accessible label or hint.
|
|
8
|
+
*/
|
|
9
|
+
count: number;
|
|
10
|
+
/** Merges the root props onto a single child element instead of rendering a `View`. */
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
/** The front card, usually a summary `Insight`. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Draws up to two decorative cards behind a summary Insight to show that more insights exist.
|
|
18
|
+
* The root adds no role, so the front Insight stays the only interactive element.
|
|
19
|
+
*/
|
|
20
|
+
export declare const InsightStack: import("react").ForwardRefExoticComponent<InsightStackProps & import("react").RefAttributes<View>>;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/InsightStack/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpG,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAapD,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAwBD;;;GAGG;AACH,eAAO,MAAM,YAAY,oGA6BxB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from '@cdx-ui/utils';
|
|
2
|
+
export declare const insightStackRootVariants: (props?: ({
|
|
3
|
+
layers?: 0 | 1 | 2 | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const insightStackFrontVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const insightStackLayerVariants: (props?: ({
|
|
7
|
+
depth?: 1 | 2 | null | undefined;
|
|
8
|
+
layers?: 1 | 2 | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export type InsightStackLayerVariantProps = VariantProps<typeof insightStackLayerVariants>;
|
|
11
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/InsightStack/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKvD,eAAO,MAAM,wBAAwB;;8EAWnC,CAAC;AAKH,eAAO,MAAM,yBAAyB,oFAAyB,CAAC;AAShE,eAAO,MAAM,yBAAyB;;;8EA4BrC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|