@cdx-ui/components 0.0.1-beta.4 → 0.0.1-beta.40
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 +18 -11
- package/lib/commonjs/components/Avatar/index.js +1 -1
- package/lib/commonjs/components/Avatar/styles.js +36 -29
- package/lib/commonjs/components/Avatar/styles.js.map +1 -1
- package/lib/commonjs/components/Button/styles.js +2 -2
- package/lib/commonjs/components/Button/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +90 -0
- package/lib/commonjs/components/Card/index.js +22 -4
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Card/styles.js +27 -5
- package/lib/commonjs/components/Card/styles.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js +5 -29
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/Checkbox/styles.js +39 -47
- package/lib/commonjs/components/Checkbox/styles.js.map +1 -1
- package/lib/commonjs/components/Chip/index.js +78 -9
- package/lib/commonjs/components/Chip/index.js.map +1 -1
- package/lib/commonjs/components/Chip/styles.js +207 -21
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Field/index.js +8 -2
- package/lib/commonjs/components/Field/index.js.map +1 -1
- package/lib/commonjs/components/Field/styles.js +4 -4
- package/lib/commonjs/components/Field/styles.js.map +1 -1
- package/lib/commonjs/components/Heading/styles.js +1 -1
- package/lib/commonjs/components/Heading/styles.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +1 -2
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/index.js +6 -1
- package/lib/commonjs/components/IconButton/index.js.map +1 -1
- package/lib/commonjs/components/IconButton/styles.js +135 -10
- package/lib/commonjs/components/IconButton/styles.js.map +1 -1
- package/lib/commonjs/components/Input/styles.js +7 -6
- package/lib/commonjs/components/Input/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js +283 -0
- package/lib/commonjs/components/ListItem/index.js.map +1 -0
- package/lib/commonjs/components/ListItem/styles.js +130 -0
- package/lib/commonjs/components/ListItem/styles.js.map +1 -0
- package/lib/commonjs/components/ProgressSegmented/index.js +22 -10
- package/lib/commonjs/components/ProgressSegmented/index.js.map +1 -1
- package/lib/commonjs/components/Radio/index.js +167 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Radio/styles.js +31 -0
- package/lib/commonjs/components/Radio/styles.js.map +1 -0
- package/lib/commonjs/components/Text/styles.js +2 -2
- package/lib/commonjs/components/Text/styles.js.map +1 -1
- package/lib/commonjs/components/Tile/index.js +251 -0
- package/lib/commonjs/components/Tile/index.js.map +1 -0
- package/lib/commonjs/components/Tile/styles.js +52 -0
- package/lib/commonjs/components/Tile/styles.js.map +1 -0
- package/lib/commonjs/components/index.js +36 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Avatar.figma.js +54 -0
- package/lib/commonjs/figma/Avatar.figma.js.map +1 -0
- package/lib/commonjs/figma/Button.figma.js +28 -11
- package/lib/commonjs/figma/Button.figma.js.map +1 -1
- package/lib/commonjs/figma/CLAUDE.md +30 -0
- package/lib/commonjs/figma/Card.Header.figma.js +28 -0
- package/lib/commonjs/figma/Card.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Card.figma.js +42 -0
- package/lib/commonjs/figma/Card.figma.js.map +1 -0
- package/lib/commonjs/figma/Checkbox.figma.js +55 -0
- package/lib/commonjs/figma/Checkbox.figma.js.map +1 -0
- package/lib/commonjs/figma/Chip.figma.js +68 -0
- package/lib/commonjs/figma/Chip.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Input.figma.js +57 -0
- package/lib/commonjs/figma/Field.Input.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Select.figma.js +57 -0
- package/lib/commonjs/figma/Field.Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Heading.figma.js +30 -0
- package/lib/commonjs/figma/Heading.figma.js.map +1 -0
- package/lib/commonjs/figma/Icon.figma.js +20 -0
- package/lib/commonjs/figma/Icon.figma.js.map +1 -0
- package/lib/commonjs/figma/IconButton.figma.js +47 -0
- package/lib/commonjs/figma/IconButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Input.figma.js +52 -0
- package/lib/commonjs/figma/Input.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js +39 -0
- package/lib/commonjs/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/commonjs/figma/Radio.figma.js +38 -0
- package/lib/commonjs/figma/Radio.figma.js.map +1 -0
- package/lib/commonjs/figma/Select.figma.js +53 -0
- package/lib/commonjs/figma/Select.figma.js.map +1 -0
- package/lib/commonjs/figma/Text.figma.js +29 -0
- package/lib/commonjs/figma/Text.figma.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.js +27 -0
- package/lib/commonjs/figma/icons.figma.batch.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.json +17705 -0
- package/lib/commonjs/styles/primitives.js +42 -5
- package/lib/commonjs/styles/primitives.js.map +1 -1
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Avatar/styles.js +36 -29
- package/lib/module/components/Avatar/styles.js.map +1 -1
- package/lib/module/components/Button/styles.js +2 -2
- package/lib/module/components/Button/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +90 -0
- package/lib/module/components/Card/index.js +23 -4
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Card/styles.js +27 -5
- package/lib/module/components/Card/styles.js.map +1 -1
- package/lib/module/components/Checkbox/index.js +6 -30
- package/lib/module/components/Checkbox/index.js.map +1 -1
- package/lib/module/components/Checkbox/styles.js +40 -48
- package/lib/module/components/Checkbox/styles.js.map +1 -1
- package/lib/module/components/Chip/index.js +82 -13
- package/lib/module/components/Chip/index.js.map +1 -1
- package/lib/module/components/Chip/styles.js +206 -20
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Field/index.js +9 -3
- package/lib/module/components/Field/index.js.map +1 -1
- package/lib/module/components/Field/styles.js +4 -4
- package/lib/module/components/Field/styles.js.map +1 -1
- package/lib/module/components/Heading/styles.js +1 -1
- package/lib/module/components/Heading/styles.js.map +1 -1
- package/lib/module/components/Icon/index.js +1 -2
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/IconButton/index.js +6 -1
- package/lib/module/components/IconButton/index.js.map +1 -1
- package/lib/module/components/IconButton/styles.js +135 -10
- package/lib/module/components/IconButton/styles.js.map +1 -1
- package/lib/module/components/Input/styles.js +7 -6
- package/lib/module/components/Input/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js +226 -0
- package/lib/module/components/ListItem/index.js.map +1 -0
- package/lib/module/components/ListItem/styles.js +127 -0
- package/lib/module/components/ListItem/styles.js.map +1 -0
- package/lib/module/components/ProgressSegmented/index.js +23 -11
- package/lib/module/components/ProgressSegmented/index.js.map +1 -1
- package/lib/module/components/Radio/index.js +164 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Radio/styles.js +27 -0
- package/lib/module/components/Radio/styles.js.map +1 -0
- package/lib/module/components/Text/styles.js +2 -2
- package/lib/module/components/Text/styles.js.map +1 -1
- package/lib/module/components/Tile/index.js +243 -0
- package/lib/module/components/Tile/index.js.map +1 -0
- package/lib/module/components/Tile/styles.js +48 -0
- package/lib/module/components/Tile/styles.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Avatar.figma.js +48 -0
- package/lib/module/figma/Avatar.figma.js.map +1 -0
- package/lib/module/figma/Button.figma.js +28 -11
- package/lib/module/figma/Button.figma.js.map +1 -1
- package/lib/module/figma/CLAUDE.md +30 -0
- package/lib/module/figma/Card.Header.figma.js +22 -0
- package/lib/module/figma/Card.Header.figma.js.map +1 -0
- package/lib/module/figma/Card.figma.js +36 -0
- package/lib/module/figma/Card.figma.js.map +1 -0
- package/lib/module/figma/Checkbox.figma.js +49 -0
- package/lib/module/figma/Checkbox.figma.js.map +1 -0
- package/lib/module/figma/Chip.figma.js +62 -0
- package/lib/module/figma/Chip.figma.js.map +1 -0
- package/lib/module/figma/Field.Input.figma.js +51 -0
- package/lib/module/figma/Field.Input.figma.js.map +1 -0
- package/lib/module/figma/Field.Select.figma.js +51 -0
- package/lib/module/figma/Field.Select.figma.js.map +1 -0
- package/lib/module/figma/Heading.figma.js +24 -0
- package/lib/module/figma/Heading.figma.js.map +1 -0
- package/lib/module/figma/Icon.figma.js +14 -0
- package/lib/module/figma/Icon.figma.js.map +1 -0
- package/lib/module/figma/IconButton.figma.js +41 -0
- package/lib/module/figma/IconButton.figma.js.map +1 -0
- package/lib/module/figma/Input.figma.js +46 -0
- package/lib/module/figma/Input.figma.js.map +1 -0
- package/lib/module/figma/ProgressSegmented.figma.js +33 -0
- package/lib/module/figma/ProgressSegmented.figma.js.map +1 -0
- package/lib/module/figma/Radio.figma.js +32 -0
- package/lib/module/figma/Radio.figma.js.map +1 -0
- package/lib/module/figma/Select.figma.js +47 -0
- package/lib/module/figma/Select.figma.js.map +1 -0
- package/lib/module/figma/Text.figma.js +23 -0
- package/lib/module/figma/Text.figma.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.js +22 -0
- package/lib/module/figma/icons.figma.batch.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.json +17705 -0
- package/lib/module/styles/primitives.js +42 -5
- package/lib/module/styles/primitives.js.map +1 -1
- package/lib/typescript/components/Avatar/styles.d.ts +4 -4
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/components/Card/index.d.ts +4 -3
- package/lib/typescript/components/Card/index.d.ts.map +1 -1
- package/lib/typescript/components/Card/styles.d.ts +13 -3
- package/lib/typescript/components/Card/styles.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/index.d.ts +1 -2
- package/lib/typescript/components/Checkbox/index.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox/styles.d.ts +4 -14
- package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -1
- package/lib/typescript/components/Chip/index.d.ts +19 -6
- package/lib/typescript/components/Chip/index.d.ts.map +1 -1
- package/lib/typescript/components/Chip/styles.d.ts +13 -4
- package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
- package/lib/typescript/components/Field/FieldLabel.web.d.ts +2 -2
- package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -1
- package/lib/typescript/components/Field/index.d.ts.map +1 -1
- package/lib/typescript/components/Field/styles.d.ts.map +1 -1
- package/lib/typescript/components/Heading/styles.d.ts +1 -1
- package/lib/typescript/components/Icon/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
- package/lib/typescript/components/IconButton/styles.d.ts +6 -2
- package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
- package/lib/typescript/components/Input/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +49 -0
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -0
- package/lib/typescript/components/ListItem/styles.d.ts +30 -0
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -0
- package/lib/typescript/components/ProgressSegmented/index.d.ts +14 -3
- package/lib/typescript/components/ProgressSegmented/index.d.ts.map +1 -1
- package/lib/typescript/components/Radio/index.d.ts +40 -0
- package/lib/typescript/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/components/Radio/styles.d.ts +8 -0
- package/lib/typescript/components/Radio/styles.d.ts.map +1 -0
- package/lib/typescript/components/Stack/styles.d.ts +2 -2
- package/lib/typescript/components/Text/styles.d.ts +1 -1
- package/lib/typescript/components/Tile/index.d.ts +70 -0
- package/lib/typescript/components/Tile/index.d.ts.map +1 -0
- package/lib/typescript/components/Tile/styles.d.ts +18 -0
- package/lib/typescript/components/Tile/styles.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Avatar.figma.d.ts +8 -0
- package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Button.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Card.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Card.figma.d.ts +8 -0
- package/lib/typescript/figma/Card.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts +8 -0
- package/lib/typescript/figma/Checkbox.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Chip.figma.d.ts +8 -0
- package/lib/typescript/figma/Chip.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Heading.figma.d.ts +8 -0
- package/lib/typescript/figma/Heading.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Icon.figma.d.ts +8 -0
- package/lib/typescript/figma/Icon.figma.d.ts.map +1 -0
- package/lib/typescript/figma/IconButton.figma.d.ts +8 -0
- package/lib/typescript/figma/IconButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Input.figma.d.ts +8 -0
- package/lib/typescript/figma/Input.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts +8 -0
- package/lib/typescript/figma/ProgressSegmented.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Radio.figma.d.ts +8 -0
- package/lib/typescript/figma/Radio.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Select.figma.d.ts +8 -0
- package/lib/typescript/figma/Select.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Text.figma.d.ts +8 -0
- package/lib/typescript/figma/Text.figma.d.ts.map +1 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts +14 -0
- package/lib/typescript/figma/icons.figma.batch.d.ts.map +1 -0
- package/lib/typescript/styles/primitives.d.ts +38 -0
- package/lib/typescript/styles/primitives.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/Avatar/index.tsx +1 -1
- package/src/components/Avatar/styles.ts +49 -34
- package/src/components/Button/styles.ts +2 -2
- package/src/components/CLAUDE.md +90 -0
- package/src/components/Card/index.tsx +41 -16
- package/src/components/Card/styles.ts +43 -23
- package/src/components/Checkbox/index.tsx +8 -19
- package/src/components/Checkbox/styles.ts +82 -86
- package/src/components/Chip/index.tsx +104 -27
- package/src/components/Chip/styles.ts +232 -18
- package/src/components/Field/FieldLabel.web.tsx +1 -1
- package/src/components/Field/index.tsx +10 -3
- package/src/components/Field/styles.ts +5 -4
- package/src/components/Heading/styles.ts +1 -1
- package/src/components/Icon/index.tsx +1 -2
- package/src/components/IconButton/index.tsx +3 -2
- package/src/components/IconButton/styles.ts +136 -10
- package/src/components/Input/styles.ts +14 -9
- package/src/components/ListItem/index.tsx +285 -0
- package/src/components/ListItem/styles.ts +153 -0
- package/src/components/ProgressSegmented/index.tsx +49 -14
- package/src/components/Radio/index.tsx +192 -0
- package/src/components/Radio/styles.ts +59 -0
- package/src/components/Text/styles.ts +2 -2
- package/src/components/Tile/index.tsx +296 -0
- package/src/components/Tile/styles.ts +82 -0
- package/src/components/index.ts +3 -0
- package/src/styles/primitives.ts +42 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","showActions","getBoolean","actionsSlot","getSlot","title","findText","textContent","actions","helpers","react","renderChildren","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Card.Header.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,WAAW,GAAGH,QAAQ,CAACI,UAAU,CAAC,eAAe,CAAC;AACxD,MAAMC,WAAW,GAAGL,QAAQ,CAACM,OAAO,CAAC,SAAS,CAAC;AAC/C,MAAMC,KAAK,GAAIP,QAAQ,CAACQ,QAAQ,CAAC,SAAS,CAAC,CAAgCC,WAAW;AAEtF,MAAMC,OAAO,GAAGP,WAAW,IAAIE,WAAW,GAAGJ,cAAK,CAACU,OAAO,CAACC,KAAK,CAACC,cAAc,CAACR,WAAW,CAAC,GAAG,IAAI;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAErF;EACbiB,EAAE,EAAE,aAAa;EACjB;EACAC,OAAO,EAAE,CAAC,oDAAoD,CAAC;EAC/DC,OAAO,EAAEjB,cAAK,CAACkB,IAAI;AACrB;AACA,uBAAuBZ,KAAK;AAC5B,IAAIG,OAAO;AACX;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=456-14
|
|
10
|
+
// source=packages/components/src/components/Card/index.tsx
|
|
11
|
+
// component=Card
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
|
|
15
|
+
// VARIANT property uses "true" / "false" strings — omit prop when not full bleed.
|
|
16
|
+
const fullBleed = instance.getEnum('fullBleed', {
|
|
17
|
+
true: true,
|
|
18
|
+
false: undefined
|
|
19
|
+
});
|
|
20
|
+
const showHeader = instance.getBoolean('Show Header?');
|
|
21
|
+
const showFooter = instance.getBoolean('Show Footer?');
|
|
22
|
+
const headerLayer = instance.findInstance('Card.Header');
|
|
23
|
+
const headerSnippet = showHeader && headerLayer?.type === 'INSTANCE' ? headerLayer.executeTemplate().example : null;
|
|
24
|
+
const contentSlot = instance.getSlot('Card.Content');
|
|
25
|
+
const footerSlot = instance.getSlot('Card.Footer');
|
|
26
|
+
const contentChildren = contentSlot ? _figma.default.helpers.react.renderChildren(contentSlot) : null;
|
|
27
|
+
const footerChildren = footerSlot ? _figma.default.helpers.react.renderChildren(footerSlot) : null;
|
|
28
|
+
|
|
29
|
+
// When the header shows: use the exact same import string as Card.Header.figma.ts (Code Connect
|
|
30
|
+
// allows only `import … from 'figma'` in template files; duplicate literals are required for dedupe).
|
|
31
|
+
const componentImport = showHeader ? "import { Card, Heading } from '@cdx-ui/components'" : `import { Card } from '@cdx-ui/components'`;
|
|
32
|
+
var _default = exports.default = {
|
|
33
|
+
id: 'card',
|
|
34
|
+
imports: [componentImport],
|
|
35
|
+
example: _figma.default.code`
|
|
36
|
+
<Card fullBleed={${fullBleed}}>
|
|
37
|
+
${headerSnippet}
|
|
38
|
+
<Card.Content>${contentChildren}</Card.Content>
|
|
39
|
+
${showFooter ? _figma.default.code`<Card.Footer>${footerChildren}</Card.Footer>` : null}
|
|
40
|
+
</Card>`
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=Card.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","fullBleed","getEnum","true","false","undefined","showHeader","getBoolean","showFooter","headerLayer","findInstance","headerSnippet","type","executeTemplate","example","contentSlot","getSlot","footerSlot","contentChildren","helpers","react","renderChildren","footerChildren","componentImport","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Card.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,O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AI;AACrB,mBAAmB3B,SAAS;AAC5B,IAAIU,aAAa;AACjB,kBAAkBO,eAAe;AACjC,IAAIV,UAAU,GAAGT,cAAK,CAAC6B,IAAI,gBAAgBN,cAAc,gBAAgB,GAAG,IAAI;AAChF;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=366-383
|
|
10
|
+
// source=packages/components/src/components/Checkbox/index.tsx
|
|
11
|
+
// component=Checkbox
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Enum-as-boolean VARIANT props use string values "true"/"false" in Figma.
|
|
17
|
+
* Props are emitted via `figma.helpers.react.renderProp` so JSX formatting matches Code Connect conventions.
|
|
18
|
+
*
|
|
19
|
+
* `isHovered` and `isFocused` are interaction-only variants (fixed "false") and are intentionally omitted.
|
|
20
|
+
*/
|
|
21
|
+
const isChecked = instance.getEnum('isChecked', {
|
|
22
|
+
true: true,
|
|
23
|
+
false: false
|
|
24
|
+
});
|
|
25
|
+
const isIndeterminate = instance.getEnum('isIndeterminate', {
|
|
26
|
+
true: true,
|
|
27
|
+
false: false
|
|
28
|
+
});
|
|
29
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
30
|
+
true: true,
|
|
31
|
+
false: false
|
|
32
|
+
});
|
|
33
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
34
|
+
true: true,
|
|
35
|
+
false: false
|
|
36
|
+
});
|
|
37
|
+
const valueProp = _figma.default.helpers.react.renderProp('value', 'terms');
|
|
38
|
+
const isCheckedProp = _figma.default.helpers.react.renderProp('isChecked', isChecked);
|
|
39
|
+
const isIndeterminateProp = _figma.default.helpers.react.renderProp('isIndeterminate', isIndeterminate);
|
|
40
|
+
const isInvalidProp = _figma.default.helpers.react.renderProp('isInvalid', isInvalid);
|
|
41
|
+
const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
|
|
42
|
+
const showLabel = instance.getEnum('Show Label?', {
|
|
43
|
+
true: true,
|
|
44
|
+
false: false
|
|
45
|
+
});
|
|
46
|
+
const labelText = instance.findText('Label').textContent;
|
|
47
|
+
var _default = exports.default = {
|
|
48
|
+
id: 'checkbox',
|
|
49
|
+
imports: ["import { Checkbox } from '@cdx-ui/components'"],
|
|
50
|
+
example: _figma.default.code`
|
|
51
|
+
<Checkbox${valueProp}${isCheckedProp}${isIndeterminateProp}${isInvalidProp}${isDisabledProp}>
|
|
52
|
+
${showLabel ? _figma.default.code`<Checkbox.Label>${labelText}</Checkbox.Label>` : null}
|
|
53
|
+
</Checkbox>`
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Checkbox.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","isChecked","getEnum","true","false","isIndeterminate","isInvalid","isDisabled","valueProp","helpers","react","renderProp","isCheckedProp","isIndeterminateProp","isInvalidProp","isDisabledProp","showLabel","labelText","findText","textContent","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Checkbox.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,C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AAO,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAE1E;EACbyB,EAAE,EAAE,UAAU;EACdC,OAAO,EAAE,CAAC,+CAA+C,CAAC;EAC1DC,OAAO,EAAEzB,cAAK,CAAC0B,IAAI;AACrB,WAAWjB,SAAS,GAAGI,aAAa,GAAGC,mBAAmB,GAAGC,aAAa,GAAGC,cAAc;AAC3F,IAAIC,SAAS,GAAGjB,cAAK,CAAC0B,IAAI,mBAAmBR,SAAS,mBAAmB,GAAG,IAAI;AAChF;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=444-13403
|
|
10
|
+
// source=packages/components/src/components/Chip/index.tsx
|
|
11
|
+
// component=Chip
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const variant = instance.getEnum('variant', {
|
|
15
|
+
tint: 'tint',
|
|
16
|
+
outline: 'outline'
|
|
17
|
+
});
|
|
18
|
+
const size = instance.getEnum('size', {
|
|
19
|
+
default: 'default',
|
|
20
|
+
small: 'small',
|
|
21
|
+
xsmall: 'xsmall'
|
|
22
|
+
});
|
|
23
|
+
const color = instance.getEnum('color', {
|
|
24
|
+
default: 'default',
|
|
25
|
+
action: 'action',
|
|
26
|
+
danger: 'danger',
|
|
27
|
+
warning: 'warning',
|
|
28
|
+
success: 'success',
|
|
29
|
+
info: 'info'
|
|
30
|
+
});
|
|
31
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
32
|
+
true: true,
|
|
33
|
+
false: undefined
|
|
34
|
+
});
|
|
35
|
+
const disabledProp = _figma.default.helpers.react.renderProp('disabled', isDisabled);
|
|
36
|
+
const showLeadingIcon = instance.getBoolean('Show Leading Icon?');
|
|
37
|
+
const showAvatar = instance.getBoolean('Show Avatar?');
|
|
38
|
+
const showTrailingIcon = instance.getBoolean('Show Trailing Icon?');
|
|
39
|
+
|
|
40
|
+
// INSTANCE_SWAP property names from Figma (Chip.LeadingIcon / Chip.TrailingIcon).
|
|
41
|
+
const leadingIconResult = showLeadingIcon && !showAvatar ? instance.getInstanceSwap('Chip.LeadingIcon')?.executeTemplate() : undefined;
|
|
42
|
+
const trailingIconResult = showTrailingIcon ? instance.getInstanceSwap('Chip.TrailingIcon')?.executeTemplate() : undefined;
|
|
43
|
+
const leadingIconName = leadingIconResult?.metadata?.props?.componentName;
|
|
44
|
+
const trailingIconName = trailingIconResult?.metadata?.props?.componentName;
|
|
45
|
+
const leadingIconSnippet = leadingIconName ?? leadingIconResult?.example;
|
|
46
|
+
const trailingIconSnippet = trailingIconName ?? trailingIconResult?.example;
|
|
47
|
+
const label = instance.findText('Chip.Label').textContent;
|
|
48
|
+
const iconImports = [];
|
|
49
|
+
if (showLeadingIcon && !showAvatar && leadingIconName) {
|
|
50
|
+
iconImports.push(`import { ${leadingIconName} } from '@cdx-ui/icons'`);
|
|
51
|
+
}
|
|
52
|
+
if (showTrailingIcon && trailingIconName) {
|
|
53
|
+
iconImports.push(`import { ${trailingIconName} } from '@cdx-ui/icons'`);
|
|
54
|
+
}
|
|
55
|
+
const avatarImport = showAvatar ? ["import { Avatar } from '@cdx-ui/components'"] : [];
|
|
56
|
+
var _default = exports.default = {
|
|
57
|
+
id: 'chip',
|
|
58
|
+
imports: ["import { Chip } from '@cdx-ui/components'", ...avatarImport, ...iconImports],
|
|
59
|
+
example: _figma.default.code`
|
|
60
|
+
<Chip variant="${variant}" size="${size}" color="${color}"${disabledProp}>
|
|
61
|
+
${showAvatar ? _figma.default.code`<Chip.Avatar>
|
|
62
|
+
<Avatar.Image source={{ uri: '...' }} />
|
|
63
|
+
</Chip.Avatar>` : showLeadingIcon ? _figma.default.code`<Chip.Icon as={${leadingIconSnippet}} slot="leading" />` : null}
|
|
64
|
+
<Chip.Label>${label}</Chip.Label>
|
|
65
|
+
${showTrailingIcon ? _figma.default.code`<Chip.Icon as={${trailingIconSnippet}} slot="trailing" />` : null}
|
|
66
|
+
</Chip>`
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=Chip.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","tint","outline","size","small","xsmall","color","action","danger","warning","success","info","isDisabled","true","false","undefined","disabledProp","helpers","react","renderProp","showLeadingIcon","getBoolean","showAvatar","showTrailingIcon","leadingIconResult","getInstanceSwap","executeTemplate","trailingIconResult","leadingIconName","metadata","props","componentName","trailingIconName","leadingIconSnippet","example","trailingIconSnippet","label","findText","textContent","iconImports","push","avatarImport","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Chip.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,OAAO,GAAGH,QAAQ,CAACI,OAAO,CAAC,SAAS,EAAE;EAC1CC,IAAI,EAAE,MAAM;EACZC,OAAO,EAAE;AACX,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGP,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACpCL,OAAO,EAAE,SAAS;EAClBS,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACV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EO,OAAO;AAE3E,MAAME,KAAK,GAAIxC,QAAQ,CAACyC,QAAQ,CAAC,YAAY,CAAC,CAAgCC,WAAW;AAEzF,MAAMC,WAAqB,GAAG,EAAE;AAChC,IAAInB,eAAe,IAAI,CAACE,UAAU,IAAIM,eAAe,EAAE;EACrDW,WAAW,CAACC,IAAI,CAAC,YAAYZ,eAAe,yBAAyB,CAAC;AACxE;AACA,IAAIL,gBAAgB,IAAIS,gBAAgB,EAAE;EACxCO,WAAW,CAACC,IAAI,CAAC,YAAYR,gBAAgB,yBAAyB,CAAC;AACzE;AACA,MAAMS,YAAY,GAAGnB,UAAU,GAAG,CAAC,6CAA6C,CAAC,GAAG,EAAE;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAhD,OAAA,GAExE;EACbiD,EAAE,EAAE,MAAM;EACVC,OAAO,EAAE,CAAC,2CAA2C,EAAE,GAAGJ,YAAY,EAAE,GAAGF,WAAW,CAAC;EACvFL,OAAO,EAAErC,cAAK,CAACiD,IAAI;AACrB,iBAAiB/C,OAAO,WAAWI,IAAI,YAAYG,KAAK,IAAIU,YAAY;AACxE,IACIM,UAAU,GACNzB,cAAK,CAACiD,IAAI;AAClB;AACA,iBAAiB,GACT1B,eAAe,GACbvB,cAAK,CAACiD,IAAI,kBAAkBb,kBAAkB,qBAAqB,GACnE,IAAI;AACd,gBACgBG,KAAK;AACrB,IAAIb,gBAAgB,GAAG1B,cAAK,CAACiD,IAAI,kBAAkBX,mBAAmB,sBAAsB,GAAG,IAAI;AACnG;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-CDS-V2--React-Native?node-id=409-3015
|
|
10
|
+
// source=packages/components/src/components/Field/index.tsx
|
|
11
|
+
// component=Field
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const showLabel = instance.getBoolean('Show Label?');
|
|
15
|
+
const showHelperText = instance.getBoolean('Show Helper Text?');
|
|
16
|
+
const showErrorText = instance.getBoolean('Show Error Text?');
|
|
17
|
+
|
|
18
|
+
// Enum-as-boolean: isInvalid / isDisabled are VARIANT properties in Figma (string values "true"/"false").
|
|
19
|
+
// Map "false" to undefined so renderProp omits them from the snippet.
|
|
20
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
21
|
+
true: true,
|
|
22
|
+
false: undefined
|
|
23
|
+
});
|
|
24
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
25
|
+
true: true,
|
|
26
|
+
false: undefined
|
|
27
|
+
});
|
|
28
|
+
const isInvalidProp = _figma.default.helpers.react.renderProp('isInvalid', isInvalid);
|
|
29
|
+
const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
|
|
30
|
+
const labelText = instance.findText('{Label}', {
|
|
31
|
+
traverseInstances: true
|
|
32
|
+
}).textContent;
|
|
33
|
+
const helperText = instance.findText('{HelperText}', {
|
|
34
|
+
traverseInstances: true
|
|
35
|
+
}).textContent;
|
|
36
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
37
|
+
traverseInstances: true
|
|
38
|
+
}).textContent;
|
|
39
|
+
const input = instance.findInstance('Input');
|
|
40
|
+
let inputSnippet;
|
|
41
|
+
if (input?.type === 'INSTANCE') {
|
|
42
|
+
inputSnippet = input.executeTemplate().example;
|
|
43
|
+
}
|
|
44
|
+
var _default = exports.default = {
|
|
45
|
+
id: 'field-input',
|
|
46
|
+
// Only import Field here; the nested Input template provides its own "import { Input } …" line.
|
|
47
|
+
// Code Connect merges the two separate import statements from the same package automatically.
|
|
48
|
+
imports: ["import { Field } from '@cdx-ui/components'"],
|
|
49
|
+
example: _figma.default.code`
|
|
50
|
+
<Field${isInvalidProp}${isDisabledProp}>
|
|
51
|
+
${showLabel ? _figma.default.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
52
|
+
${inputSnippet}
|
|
53
|
+
${!isInvalid && showHelperText ? _figma.default.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
54
|
+
${isInvalid && showErrorText ? _figma.default.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
55
|
+
</Field>`
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Field.Input.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","getEnum","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","labelText","findText","traverseInstances","textContent","helperText","errorText","input","findInstance","inputSnippet","type","executeTemplate","example","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Field.Input.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,SAAS,GAAGH,QAAQ,CAACI,UAAU,CAAC,aAAa,CAAC;AACpD,MAAMC,cAAc,GAAGL,QAAQ,CAACI,UAAU,CAAC,mBAAmB,CAAC;AAC/D,MAAME,aAAa,GAAGN,QAAQ,CAACI,UAAU,CAAC,kBAAkB,CAAC;;AAE7D;AACA;AACA,MAAMG,SAAS,GAAGP,QAAQ,CAACQ,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI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Y;AAChB,IAAI,CAACnB,SAAS,IAAIF,cAAc,GAAGJ,cAAK,CAACiC,IAAI,iBAAiBZ,UAAU,iBAAiB,GAAG,IAAI;AAChG,IAAIf,SAAS,IAAID,aAAa,GAAGL,cAAK,CAACiC,IAAI,gBAAgBX,SAAS,gBAAgB,GAAG,IAAI;AAC3F;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-CDS-V2--React-Native?node-id=427-4179
|
|
10
|
+
// source=packages/components/src/components/Field/index.tsx
|
|
11
|
+
// component=Field
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const showLabel = instance.getBoolean('Show Label?');
|
|
15
|
+
const showHelperText = instance.getBoolean('Show Helper Text?');
|
|
16
|
+
const showErrorText = instance.getBoolean('Show Error Text?');
|
|
17
|
+
|
|
18
|
+
// Enum-as-boolean: isInvalid / isDisabled are VARIANT properties in Figma (string values "true"/"false").
|
|
19
|
+
// Map "false" to undefined so renderProp omits them from the snippet.
|
|
20
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
21
|
+
true: true,
|
|
22
|
+
false: undefined
|
|
23
|
+
});
|
|
24
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
25
|
+
true: true,
|
|
26
|
+
false: undefined
|
|
27
|
+
});
|
|
28
|
+
const isInvalidProp = _figma.default.helpers.react.renderProp('isInvalid', isInvalid);
|
|
29
|
+
const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
|
|
30
|
+
const labelText = instance.findText('{Label}', {
|
|
31
|
+
traverseInstances: true
|
|
32
|
+
}).textContent;
|
|
33
|
+
const helperText = instance.findText('{HelperText}', {
|
|
34
|
+
traverseInstances: true
|
|
35
|
+
}).textContent;
|
|
36
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
37
|
+
traverseInstances: true
|
|
38
|
+
}).textContent;
|
|
39
|
+
const select = instance.findInstance('Select');
|
|
40
|
+
let selectSnippet;
|
|
41
|
+
if (select?.type === 'INSTANCE') {
|
|
42
|
+
selectSnippet = select.executeTemplate().example;
|
|
43
|
+
}
|
|
44
|
+
var _default = exports.default = {
|
|
45
|
+
id: 'field-select',
|
|
46
|
+
// Only import Field here; the nested Select template provides its own "import { Select } …" line.
|
|
47
|
+
// Code Connect merges the two separate import statements from the same package automatically.
|
|
48
|
+
imports: ["import { Field } from '@cdx-ui/components'"],
|
|
49
|
+
example: _figma.default.code`
|
|
50
|
+
<Field${isInvalidProp}${isDisabledProp}>
|
|
51
|
+
${showLabel ? _figma.default.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
52
|
+
${selectSnippet}
|
|
53
|
+
${!isInvalid && showHelperText ? _figma.default.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
54
|
+
${isInvalid && showErrorText ? _figma.default.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
55
|
+
</Field>`
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Field.Select.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","getEnum","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","labelText","findText","traverseInstances","textContent","helperText","errorText","select","findInstance","selectSnippet","type","executeTemplate","example","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Field.Select.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC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,GAAGxB,QAAQ,CAACyB,YAAY,CAAC,QAAQ,CAAC;AAC9C,IAAIC,aAA0D;AAC9D,IAAIF,MAAM,EAAEG,IAAI,KAAK,UAAU,EAAE;EAC/BD,aAAa,GAAGF,MAAM,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO;AAClD;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAEc;EACbiC,EAAE,EAAE,cAAc;EAClB;EACA;EACAC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDJ,OAAO,EAAE5B,cAAK,CAACiC,IAAI;AACrB,QAAQrB,aAAa,GAAGI,cAAc;AACtC,IAAId,SAAS,GAAGF,cAAK,CAACiC,IAAI,gBAAgBhB,SAAS,gBAAgB,GAAG,IAAI;AAC1E,IAAIQ,aAAa;AACjB,IAAI,CAACnB,SAAS,IAAIF,cAAc,GAAGJ,cAAK,CAACiC,IAAI,iBAAiBZ,UAAU,iBAAiB,GAAG,IAAI;AAChG,IAAIf,SAAS,IAAID,aAAa,GAAGL,cAAK,CAACiC,IAAI,gBAAgBX,SAAS,gBAAgB,GAAG,IAAI;AAC3F;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=399-3385
|
|
10
|
+
// source=packages/components/src/components/Heading/index.tsx
|
|
11
|
+
// component=Heading
|
|
12
|
+
// Use the same branch URL as Button: Code Connect is scoped per file key; main vs branch are separate targets.
|
|
13
|
+
|
|
14
|
+
const instance = _figma.default.selectedInstance;
|
|
15
|
+
|
|
16
|
+
// Figma size values are identical to code size values — no renaming needed.
|
|
17
|
+
const size = instance.getEnum('size', {
|
|
18
|
+
xl: 'xl',
|
|
19
|
+
lg: 'lg',
|
|
20
|
+
md: 'md',
|
|
21
|
+
sm: 'sm',
|
|
22
|
+
xs: 'xs'
|
|
23
|
+
});
|
|
24
|
+
const text = instance.findText('{Heading}').textContent;
|
|
25
|
+
var _default = exports.default = {
|
|
26
|
+
id: 'heading',
|
|
27
|
+
imports: ["import { Heading } from '@cdx-ui/components'"],
|
|
28
|
+
example: _figma.default.code`<Heading size="${size}">${text}</Heading>`
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Heading.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","size","getEnum","xl","lg","md","sm","xs","text","findText","textContent","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Heading.figma.ts"],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAJ1B;AACA;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;;AAEvC;AACA,MAAMC,IAAI,GAAGH,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACpCC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE;AACN,CAAC,CAAC;AAEF,MAAMC,IAAI,GAAIV,QAAQ,CAACW,QAAQ,CAAC,WAAW,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEzE;EACbgB,EAAE,EAAE,SAAS;EACbC,OAAO,EAAE,CAAC,8CAA8C,CAAC;EACzDC,OAAO,EAAEhB,cAAK,CAACiB,IAAI,kBAAkBf,IAAI,KAAKO,IAAI;AACpD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=397-33
|
|
10
|
+
// source=packages/components/src/components/Icon/index.tsx
|
|
11
|
+
// component=Icon
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const iconSnippet = instance.getInstanceSwap('as')?.executeTemplate().example;
|
|
15
|
+
var _default = exports.default = {
|
|
16
|
+
example: _figma.default.code`${iconSnippet}`,
|
|
17
|
+
imports: ["import { Icon } from '@cdx-ui/components'"],
|
|
18
|
+
id: 'icon'
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Icon.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","iconSnippet","getInstanceSwap","executeTemplate","example","_default","exports","code","imports","id"],"sourceRoot":"../../../src","sources":["figma/Icon.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,WAAW,GAAGH,QAAQ,CAACI,eAAe,CAAC,IAAI,CAAC,EAAEC,eAAe,CAAC,CAAC,CAACC,OAAO;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAE/D;EACbO,OAAO,EAAEL,cAAK,CAACQ,IAAI,GAAGN,WAAW,EAAE;EACnCO,OAAO,EAAE,CAAC,2CAA2C,CAAC;EACtDC,EAAE,EAAE;AACN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=427-5235
|
|
10
|
+
// source=packages/components/src/components/IconButton/index.tsx
|
|
11
|
+
// component=IconButton
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const variant = instance.getEnum('variant', {
|
|
15
|
+
solid: 'solid',
|
|
16
|
+
tint: 'tint',
|
|
17
|
+
ghost: 'ghost'
|
|
18
|
+
});
|
|
19
|
+
const color = instance.getEnum('color', {
|
|
20
|
+
neutral: 'neutral',
|
|
21
|
+
action: 'action',
|
|
22
|
+
danger: 'danger'
|
|
23
|
+
});
|
|
24
|
+
const size = instance.getEnum('size', {
|
|
25
|
+
default: 'default',
|
|
26
|
+
small: 'small'
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Enum-as-boolean: isDisabled is a VARIANT property in Figma ("true"/"false").
|
|
30
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
31
|
+
true: true,
|
|
32
|
+
false: undefined
|
|
33
|
+
});
|
|
34
|
+
const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
|
|
35
|
+
|
|
36
|
+
// icon: INSTANCE_SWAP → IconButton `as` (CdxIcon). Prefer metadata.props.componentName from icon Code Connect.
|
|
37
|
+
const iconResult = instance.getInstanceSwap('icon')?.executeTemplate();
|
|
38
|
+
const iconName = iconResult?.metadata?.props?.componentName;
|
|
39
|
+
const iconSnippet = iconName ?? iconResult?.example;
|
|
40
|
+
const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
|
|
41
|
+
var _default = exports.default = {
|
|
42
|
+
id: 'icon-button',
|
|
43
|
+
imports: ["import { IconButton } from '@cdx-ui/components'", ...iconImports],
|
|
44
|
+
example: _figma.default.code`
|
|
45
|
+
<IconButton as={${iconSnippet}} variant="${variant}" color="${color}" size="${size}"${isDisabledProp} />`
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=IconButton.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","solid","tint","ghost","color","neutral","action","danger","size","small","isDisabled","true","false","undefined","isDisabledProp","helpers","react","renderProp","iconResult","getInstanceSwap","executeTemplate","iconName","metadata","props","componentName","iconSnippet","example","iconImports","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/IconButton.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,OAAO,GAAGH,QAAQ,CAACI,OAAO,CAAC,SAAS,EAAE;EAC1CC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAA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
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-CDS-V2--React-Native?node-id=159-22
|
|
10
|
+
// source=packages/components/src/components/Input/index.tsx
|
|
11
|
+
// component=Input
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const variant = instance.getEnum('variant', {
|
|
15
|
+
outlined: 'outline'
|
|
16
|
+
});
|
|
17
|
+
const size = instance.getEnum('size', {
|
|
18
|
+
default: 'default'
|
|
19
|
+
});
|
|
20
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
21
|
+
true: true,
|
|
22
|
+
false: undefined
|
|
23
|
+
});
|
|
24
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
25
|
+
true: true,
|
|
26
|
+
false: undefined
|
|
27
|
+
});
|
|
28
|
+
const isInvalidProp = _figma.default.helpers.react.renderProp('isInvalid', isInvalid);
|
|
29
|
+
const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
|
|
30
|
+
const showValue = instance.getEnum('Show Value?', {
|
|
31
|
+
true: true,
|
|
32
|
+
false: false
|
|
33
|
+
});
|
|
34
|
+
const showPlaceholder = instance.getEnum('Show Placeholder?', {
|
|
35
|
+
true: true,
|
|
36
|
+
false: false
|
|
37
|
+
});
|
|
38
|
+
const valueText = instance.findText('{value}', {
|
|
39
|
+
traverseInstances: true
|
|
40
|
+
}).textContent;
|
|
41
|
+
const placeholder = instance.getString('placeholder');
|
|
42
|
+
const defaultValueProp = _figma.default.helpers.react.renderProp('defaultValue', showValue ? valueText : undefined);
|
|
43
|
+
const placeholderProp = _figma.default.helpers.react.renderProp('placeholder', showPlaceholder ? placeholder : undefined);
|
|
44
|
+
var _default = exports.default = {
|
|
45
|
+
id: 'input',
|
|
46
|
+
imports: ["import { Input } from '@cdx-ui/components'"],
|
|
47
|
+
example: _figma.default.code`
|
|
48
|
+
<Input variant="${variant}" size="${size}"${isInvalidProp}${isDisabledProp}>
|
|
49
|
+
<Input.Field${defaultValueProp}${placeholderProp} />
|
|
50
|
+
</Input>`
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Input.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","outlined","size","isInvalid","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","showValue","showPlaceholder","valueText","findText","traverseInstances","textContent","placeholder","getString","defaultValueProp","placeholderProp","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Input.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,OAAO,GAAGH,QAAQ,CAACI,OAAO,CAAC,SAAS,EAAE;EAC1CC,QAAQ,EAAE;AACZ,CAAC,CAAC;AACF,MAAMC,IAAI,GAAGN,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACpCL,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,MAAMQ,SAAS,GAAGP,QAAQ,CAACI,OAAO,CAAC,WAAW,EAAE;EAC9CI,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGX,QAAQ,CAACI,OAAO,CAAC,YAAY,EAAE;EAChDI,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAME,aAAa,GAAGX,cAA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perty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=449-449
|
|
10
|
+
// source=packages/components/src/components/ProgressSegmented/index.tsx
|
|
11
|
+
// component=ProgressSegmented
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
const segmentsCount = instance.getEnum('segments', {
|
|
15
|
+
'2': 2,
|
|
16
|
+
'3': 3,
|
|
17
|
+
'4': 4,
|
|
18
|
+
'5': 5,
|
|
19
|
+
'6': 6
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Figma `step=complete` maps to `isStepComplete` on the last step (all segments filled).
|
|
23
|
+
const stepRaw = instance.getEnum('step', {
|
|
24
|
+
'1': '1',
|
|
25
|
+
'2': '2',
|
|
26
|
+
'3': '3',
|
|
27
|
+
'4': '4',
|
|
28
|
+
'5': '5',
|
|
29
|
+
'6': '6',
|
|
30
|
+
complete: 'complete'
|
|
31
|
+
});
|
|
32
|
+
const isStepComplete = stepRaw === 'complete';
|
|
33
|
+
const step = isStepComplete ? segmentsCount : Number(stepRaw);
|
|
34
|
+
var _default = exports.default = {
|
|
35
|
+
id: 'progress-segmented',
|
|
36
|
+
imports: ["import { ProgressSegmented } from '@cdx-ui/components'"],
|
|
37
|
+
example: _figma.default.code`<ProgressSegmented segments={${segmentsCount}} step={${step}}${isStepComplete ? _figma.default.code` isStepComplete` : _figma.default.code``} />`
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=ProgressSegmented.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","segmentsCount","getEnum","stepRaw","complete","isStepComplete","step","Number","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/ProgressSegmented.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;AAEvC,MAAMC,aAAa,GAAGH,QAAQ,CAACI,OAAO,CAAC,UAAU,EAAE;EACjD,GAAG,EAAE,CAAC;EACN,GAAG,EAAE,CAAC;EACN,GAAG,EAAE,CAAC;EACN,GAAG,EAAE,CAAC;EACN,GAAG,EAAE;AACP,CAAC,CAAC;;AAEF;AACA,MAAMC,OAAO,GAAGL,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACvC,GAAG,EAAE,GAAG;EACR,GAAG,EAAE,GAAG;EACR,GAAG,EAAE,GAAG;EACR,GAAG,EAAE,GAAG;EACR,GAAG,EAAE,GAAG;EACR,GAAG,EAAE,GAAG;EACRE,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAGF,OAAO,KAAK,UAAU;AAC7C,MAAMG,IAAI,GAAGD,cAAc,GAAGJ,aAAa,GAAGM,MAAM,CAACJ,OAAO,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAZ,OAAA,GAE/C;EACba,EAAE,EAAE,oBAAoB;EACxBC,OAAO,EAAE,CAAC,wDAAwD,CAAC;EACnEC,OAAO,EAAEb,cAAK,CAACc,IAAI,gCAAgCZ,aAAa,WAAWK,IAAI,IAC7ED,cAAc,GAAGN,cAAK,CAACc,IAAI,iBAAiB,GAAGd,cAAK,CAACc,IAAI,EAAE;AAE/D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _figma = _interopRequireDefault(require("figma"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--React-Native-Components?node-id=2603-62
|
|
10
|
+
// source=packages/components/src/components/Radio/index.tsx
|
|
11
|
+
// component=Radio
|
|
12
|
+
|
|
13
|
+
const instance = _figma.default.selectedInstance;
|
|
14
|
+
|
|
15
|
+
// Enum-as-boolean: isDisabled and isInvalid are VARIANT properties in Figma.
|
|
16
|
+
// Map "false" to undefined so the prop is omitted when not set.
|
|
17
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
18
|
+
true: true,
|
|
19
|
+
false: undefined
|
|
20
|
+
});
|
|
21
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
22
|
+
true: true,
|
|
23
|
+
false: undefined
|
|
24
|
+
});
|
|
25
|
+
const showLabel = instance.getEnum('Show Label?', {
|
|
26
|
+
true: true,
|
|
27
|
+
false: false
|
|
28
|
+
});
|
|
29
|
+
const labelText = instance.findText('Label').textContent;
|
|
30
|
+
var _default = exports.default = {
|
|
31
|
+
id: 'radio',
|
|
32
|
+
imports: ["import { Radio } from '@cdx-ui/components'"],
|
|
33
|
+
example: _figma.default.code`
|
|
34
|
+
<Radio value="option" isDisabled={${isDisabled}} isInvalid={${isInvalid}}>
|
|
35
|
+
${showLabel ? _figma.default.code`<Radio.Label>${labelText}</Radio.Label>` : null}
|
|
36
|
+
</Radio>`
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=Radio.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","isDisabled","getEnum","true","false","undefined","isInvalid","showLabel","labelText","findText","textContent","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Radio.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;;AAEvC;AACA;AACA,MAAMC,UAAU,GAAGH,QAAQ,CAACI,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,SAAS,GAAGR,QAAQ,CAACI,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAME,SAAS,GAAGT,QAAQ,CAACI,OAAO,CAAC,aAAa,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AAEF,MAAMI,SAAS,GAAIV,QAAQ,CAACW,QAAQ,CAAC,OAAO,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAE1E;EACbgB,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDC,OAAO,EAAEhB,cAAK,CAACiB,IAAI;AACrB,oCAAoCf,UAAU,gBAAgBK,SAAS;AACvE,IAAIC,SAAS,GAAGR,cAAK,CAACiB,IAAI,gBAAgBR,SAAS,gBAAgB,GAAG,IAAI;AAC1E;AACA,CAAC","ignoreList":[]}
|