@cdx-ui/components 0.0.1-beta.70 → 0.0.1-beta.72

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.
Files changed (76) hide show
  1. package/lib/commonjs/components/Alert/index.js +263 -0
  2. package/lib/commonjs/components/Alert/index.js.map +1 -0
  3. package/lib/commonjs/components/Alert/styles.js +87 -0
  4. package/lib/commonjs/components/Alert/styles.js.map +1 -0
  5. package/lib/commonjs/components/QuickActionButton/index.js +133 -0
  6. package/lib/commonjs/components/QuickActionButton/index.js.map +1 -0
  7. package/lib/commonjs/components/QuickActionButton/styles.js +17 -0
  8. package/lib/commonjs/components/QuickActionButton/styles.js.map +1 -0
  9. package/lib/commonjs/components/index.js +24 -0
  10. package/lib/commonjs/components/index.js.map +1 -1
  11. package/lib/commonjs/figma/Alert.Button.figma.js +31 -0
  12. package/lib/commonjs/figma/Alert.Button.figma.js.map +1 -0
  13. package/lib/commonjs/figma/Alert.Close.figma.js +24 -0
  14. package/lib/commonjs/figma/Alert.Close.figma.js.map +1 -0
  15. package/lib/commonjs/figma/Alert.Description.figma.js +20 -0
  16. package/lib/commonjs/figma/Alert.Description.figma.js.map +1 -0
  17. package/lib/commonjs/figma/Alert.Title.figma.js +20 -0
  18. package/lib/commonjs/figma/Alert.Title.figma.js.map +1 -0
  19. package/lib/commonjs/figma/Alert.figma.js +42 -0
  20. package/lib/commonjs/figma/Alert.figma.js.map +1 -0
  21. package/lib/commonjs/figma/QuickActionButton.figma.js +38 -0
  22. package/lib/commonjs/figma/QuickActionButton.figma.js.map +1 -0
  23. package/lib/module/components/Alert/index.js +259 -0
  24. package/lib/module/components/Alert/index.js.map +1 -0
  25. package/lib/module/components/Alert/styles.js +84 -0
  26. package/lib/module/components/Alert/styles.js.map +1 -0
  27. package/lib/module/components/QuickActionButton/index.js +129 -0
  28. package/lib/module/components/QuickActionButton/index.js.map +1 -0
  29. package/lib/module/components/QuickActionButton/styles.js +13 -0
  30. package/lib/module/components/QuickActionButton/styles.js.map +1 -0
  31. package/lib/module/components/index.js +2 -0
  32. package/lib/module/components/index.js.map +1 -1
  33. package/lib/module/figma/Alert.Button.figma.js +25 -0
  34. package/lib/module/figma/Alert.Button.figma.js.map +1 -0
  35. package/lib/module/figma/Alert.Close.figma.js +18 -0
  36. package/lib/module/figma/Alert.Close.figma.js.map +1 -0
  37. package/lib/module/figma/Alert.Description.figma.js +14 -0
  38. package/lib/module/figma/Alert.Description.figma.js.map +1 -0
  39. package/lib/module/figma/Alert.Title.figma.js +14 -0
  40. package/lib/module/figma/Alert.Title.figma.js.map +1 -0
  41. package/lib/module/figma/Alert.figma.js +36 -0
  42. package/lib/module/figma/Alert.figma.js.map +1 -0
  43. package/lib/module/figma/QuickActionButton.figma.js +32 -0
  44. package/lib/module/figma/QuickActionButton.figma.js.map +1 -0
  45. package/lib/typescript/components/Alert/index.d.ts +67 -0
  46. package/lib/typescript/components/Alert/index.d.ts.map +1 -0
  47. package/lib/typescript/components/Alert/styles.d.ts +19 -0
  48. package/lib/typescript/components/Alert/styles.d.ts.map +1 -0
  49. package/lib/typescript/components/Button/styles.d.ts +4 -4
  50. package/lib/typescript/components/Chip/styles.d.ts +3 -3
  51. package/lib/typescript/components/IconButton/styles.d.ts +2 -2
  52. package/lib/typescript/components/QuickActionButton/index.d.ts +41 -0
  53. package/lib/typescript/components/QuickActionButton/index.d.ts.map +1 -0
  54. package/lib/typescript/components/QuickActionButton/styles.d.ts +7 -0
  55. package/lib/typescript/components/QuickActionButton/styles.d.ts.map +1 -0
  56. package/lib/typescript/components/Tile/styles.d.ts +1 -1
  57. package/lib/typescript/components/index.d.ts +2 -0
  58. package/lib/typescript/components/index.d.ts.map +1 -1
  59. package/lib/typescript/figma/Alert.Button.figma.d.ts +11 -0
  60. package/lib/typescript/figma/Alert.Button.figma.d.ts.map +1 -0
  61. package/lib/typescript/figma/Alert.Close.figma.d.ts +11 -0
  62. package/lib/typescript/figma/Alert.Close.figma.d.ts.map +1 -0
  63. package/lib/typescript/figma/Alert.Description.figma.d.ts +8 -0
  64. package/lib/typescript/figma/Alert.Description.figma.d.ts.map +1 -0
  65. package/lib/typescript/figma/Alert.Title.figma.d.ts +8 -0
  66. package/lib/typescript/figma/Alert.Title.figma.d.ts.map +1 -0
  67. package/lib/typescript/figma/Alert.figma.d.ts +8 -0
  68. package/lib/typescript/figma/Alert.figma.d.ts.map +1 -0
  69. package/lib/typescript/figma/QuickActionButton.figma.d.ts +8 -0
  70. package/lib/typescript/figma/QuickActionButton.figma.d.ts.map +1 -0
  71. package/package.json +4 -4
  72. package/src/components/Alert/index.tsx +318 -0
  73. package/src/components/Alert/styles.ts +88 -0
  74. package/src/components/QuickActionButton/index.tsx +161 -0
  75. package/src/components/QuickActionButton/styles.ts +42 -0
  76. package/src/components/index.ts +2 -0
@@ -0,0 +1,31 @@
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=6665-19528
10
+ // source=packages/components/src/components/Alert/index.tsx
11
+ // component=Alert.Button
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+ const buttonInstance = instance.findInstance('Button');
15
+ const buttonSnippet = buttonInstance?.type === 'INSTANCE' ? buttonInstance.executeTemplate().example : null;
16
+ const labelHandle = instance.findText('Button.Label', {
17
+ traverseInstances: true
18
+ });
19
+ const label = labelHandle?.textContent;
20
+ var _default = exports.default = {
21
+ id: 'alert-button',
22
+ imports: ["import { Button } from '@cdx-ui/components'"],
23
+ metadata: {
24
+ nestable: true
25
+ },
26
+ example: buttonSnippet ?? (label ? _figma.default.code`
27
+ <Button variant="ghost" size="small">
28
+ <Button.Label>${label}</Button.Label>
29
+ </Button>` : null)
30
+ };
31
+ //# sourceMappingURL=Alert.Button.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","buttonInstance","findInstance","buttonSnippet","type","executeTemplate","example","labelHandle","findText","traverseInstances","label","textContent","_default","exports","id","imports","metadata","nestable","code"],"sourceRoot":"../../../src","sources":["figma/Alert.Button.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,cAAc,GAAGH,QAAQ,CAACI,YAAY,CAAC,QAAQ,CAAC;AACtD,MAAMC,aAAa,GACjBF,cAAc,EAAEG,IAAI,KAAK,UAAU,GAAGH,cAAc,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAEvF,MAAMC,WAAW,GAAGT,QAAQ,CAACU,QAAQ,CAAC,cAAc,EAAE;EACpDC,iBAAiB,EAAE;AACrB,CAAC,CAAsC;AACvC,MAAMC,KAAK,GAAGH,WAAW,EAAEI,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAExB;EACbiB,EAAE,EAAE,cAAc;EAClBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,QAAQ,EAAE;IAAEC,QAAQ,EAAE;EAAK,CAAC;EAC5BX,OAAO,EACLH,aAAa,KACZO,KAAK,GACFX,cAAK,CAACmB,IAAI;AAClB;AACA,kBAAkBR,KAAK;AACvB,UAAU,GACF,IAAI;AACZ,CAAC","ignoreList":[]}
@@ -0,0 +1,24 @@
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=6665-19498
10
+ // source=packages/components/src/components/Alert/index.tsx
11
+ // component=Alert.Close
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+ const iconButtonInstance = instance.findInstance('IconButton');
15
+ const iconButtonSnippet = iconButtonInstance?.type === 'INSTANCE' ? iconButtonInstance.executeTemplate().example : null;
16
+ var _default = exports.default = {
17
+ id: 'alert-close',
18
+ imports: ["import { IconButton } from '@cdx-ui/components'", "import { Close } from '@cdx-ui/icons'"],
19
+ metadata: {
20
+ nestable: true
21
+ },
22
+ example: iconButtonSnippet ?? _figma.default.code`<IconButton variant="ghost" size="small" as={Close} accessibilityLabel="Dismiss" />`
23
+ };
24
+ //# sourceMappingURL=Alert.Close.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","iconButtonInstance","findInstance","iconButtonSnippet","type","executeTemplate","example","_default","exports","id","imports","metadata","nestable","code"],"sourceRoot":"../../../src","sources":["figma/Alert.Close.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,kBAAkB,GAAGH,QAAQ,CAACI,YAAY,CAAC,YAAY,CAAC;AAC9D,MAAMC,iBAAiB,GACrBF,kBAAkB,EAAEG,IAAI,KAAK,UAAU,GAAGH,kBAAkB,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEjF;EACbY,EAAE,EAAE,aAAa;EACjBC,OAAO,EAAE,CACP,iDAAiD,EACjD,uCAAuC,CACxC;EACDC,QAAQ,EAAE;IAAEC,QAAQ,EAAE;EAAK,CAAC;EAC5BN,OAAO,EACLH,iBAAiB,IACjBJ,cAAK,CAACc,IAAI;AACd,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=6572-8580
10
+ // source=packages/components/src/components/Alert/index.tsx
11
+ // component=Alert.Description
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+ const description = instance.findText('{description}').textContent;
15
+ var _default = exports.default = {
16
+ id: 'alert-description',
17
+ imports: ["import { Alert } from '@cdx-ui/components'"],
18
+ example: _figma.default.code`<Alert.Description>${description}</Alert.Description>`
19
+ };
20
+ //# sourceMappingURL=Alert.Description.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","description","findText","textContent","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Alert.Description.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,GAAIH,QAAQ,CAACI,QAAQ,CAAC,eAAe,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEpF;EACbS,EAAE,EAAE,mBAAmB;EACvBC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDC,OAAO,EAAET,cAAK,CAACU,IAAI,sBAAsBR,WAAW;AACtD,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=6572-8577
10
+ // source=packages/components/src/components/Alert/index.tsx
11
+ // component=Alert.Title
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+ const title = instance.findText('{title}').textContent;
15
+ var _default = exports.default = {
16
+ id: 'alert-title',
17
+ imports: ["import { Alert } from '@cdx-ui/components'"],
18
+ example: _figma.default.code`<Alert.Title>${title}</Alert.Title>`
19
+ };
20
+ //# sourceMappingURL=Alert.Title.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","title","findText","textContent","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Alert.Title.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,KAAK,GAAIH,QAAQ,CAACI,QAAQ,CAAC,SAAS,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAExE;EACbS,EAAE,EAAE,aAAa;EACjBC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDC,OAAO,EAAET,cAAK,CAACU,IAAI,gBAAgBR,KAAK;AAC1C,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=6665-19536
10
+ // source=packages/components/src/components/Alert/index.tsx
11
+ // component=Alert
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+ const severity = instance.getEnum('severity', {
15
+ danger: 'danger',
16
+ warning: 'warning',
17
+ success: 'success',
18
+ info: 'info'
19
+ });
20
+ const showHeadline = instance.getBoolean('Show Headline?');
21
+ const headlineInstance = instance.findInstance('Alert.Headline');
22
+ const headlineSnippet = showHeadline && headlineInstance?.type === 'INSTANCE' ? headlineInstance.executeTemplate().example : null;
23
+ const messageInstance = instance.findInstance('Alert.Message');
24
+ const messageSnippet = messageInstance?.type === 'INSTANCE' ? messageInstance.executeTemplate().example : null;
25
+ const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
26
+ const trailingSlot = instance.getSlot('Alert.TrailingSlot');
27
+ const trailingChildren = showTrailingSlot && trailingSlot ? _figma.default.helpers.react.renderChildren(trailingSlot) : null;
28
+ var _default = exports.default = {
29
+ id: 'alert',
30
+ imports: ["import { Alert } from '@cdx-ui/components'"],
31
+ example: _figma.default.code`
32
+ <Alert severity="${severity}">
33
+ <Alert.Icon />
34
+ ${headlineSnippet}
35
+ ${messageSnippet}
36
+ ${trailingChildren ? _figma.default.code`
37
+ <Alert.Actions>
38
+ ${trailingChildren}
39
+ </Alert.Actions>` : null}
40
+ </Alert>`
41
+ };
42
+ //# sourceMappingURL=Alert.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","severity","getEnum","danger","warning","success","info","showHeadline","getBoolean","headlineInstance","findInstance","headlineSnippet","type","executeTemplate","example","messageInstance","messageSnippet","showTrailingSlot","trailingSlot","getSlot","trailingChildren","helpers","react","renderChildren","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Alert.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,QAAQ,GAAGH,QAAQ,CAACI,OAAO,CAAC,UAAU,EAAE;EAC5CC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAGT,QAAQ,CAACU,UAAU,CAAC,gBAAgB,CAAC;AAE1D,MAAMC,gBAAgB,GAAGX,QAAQ,CAACY,YAAY,CAAC,gBAAgB,CAAC;AAChE,MAAMC,eAAe,GACnBJ,YAAY,IAAIE,gBAAgB,EAAEG,IAAI,KAAK,UAAU,GACjDH,gBAAgB,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO,GAC1C,IAAI;AAEV,MAAMC,eAAe,GAAGjB,QAAQ,CAACY,YAAY,CAAC,eAAe,CAAC;AAC9D,MAAMM,cAAc,GAClBD,eAAe,EAAEH,IAAI,KAAK,UAAU,GAAGG,eAAe,CAACF,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAEzF,MAAMG,gBAAgB,GAAGnB,QAAQ,CAACU,UAAU,CAAC,oBAAoB,CAAC;AAClE,MAAMU,YAAY,GAAGpB,QAAQ,CAACqB,OAAO,CAAC,oBAAoB,CAAC;AAC3D,MAAMC,gBAAgB,GACpBH,gBAAgB,IAAIC,YAAY,GAAGnB,cAAK,CAACsB,OAAO,CAACC,KAAK,CAACC,cAAc,CAACL,YAAY,CAAC,GAAG,IAAI;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAE9E;EACb6B,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDb,OAAO,EAAEf,cAAK,CAAC6B,IAAI;AACrB,mBAAmB3B,QAAQ;AAC3B;AACA,IAAIU,eAAe;AACnB,IAAIK,cAAc;AAClB,IACII,gBAAgB,GACZrB,cAAK,CAAC6B,IAAI;AAClB;AACA,MAAMR,gBAAgB;AACtB,mBAAmB,GACX,IAAI;AACZ;AAEA,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--Components?node-id=5283-1723
10
+ // source=packages/components/src/components/QuickActionButton/index.tsx
11
+ // component=QuickActionButton
12
+
13
+ const instance = _figma.default.selectedInstance;
14
+
15
+ // Enum-as-boolean: isDisabled is a VARIANT property in Figma ("true"/"false").
16
+ const isDisabled = instance.getEnum('isDisabled', {
17
+ true: true,
18
+ false: undefined
19
+ });
20
+ const isDisabledProp = _figma.default.helpers.react.renderProp('isDisabled', isDisabled);
21
+
22
+ // icon: INSTANCE_SWAP → QuickActionButton.Icon `as` (ForgeIcon).
23
+ // Prefer metadata.props.componentName from the icon Code Connect template.
24
+ const iconResult = instance.getInstanceSwap('icon')?.executeTemplate();
25
+ const iconName = iconResult?.metadata?.props?.componentName;
26
+ const iconSnippet = iconName ?? iconResult?.example;
27
+ const iconImports = iconName ? [`import { ${iconName} } from '@cdx-ui/icons'`] : [];
28
+ const labelText = instance.findText('{label}').textContent;
29
+ var _default = exports.default = {
30
+ id: 'quick-action-button',
31
+ imports: ["import { QuickActionButton } from '@cdx-ui/components'", ...iconImports],
32
+ example: _figma.default.code`
33
+ <QuickActionButton${isDisabledProp}>
34
+ <QuickActionButton.Icon as={${iconSnippet}} />
35
+ <QuickActionButton.Label>${labelText}</QuickActionButton.Label>
36
+ </QuickActionButton>`
37
+ };
38
+ //# sourceMappingURL=QuickActionButton.figma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","isDisabled","getEnum","true","false","undefined","isDisabledProp","helpers","react","renderProp","iconResult","getInstanceSwap","executeTemplate","iconName","metadata","props","componentName","iconSnippet","example","iconImports","labelText","findText","textContent","_default","exports","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/QuickActionButton.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,MAAMC,UAAU,GAAGH,QAAQ,CAACI,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,cAAc,GAAGP,cAAK,CAACQ,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAER,UAAU,CAAC;;AAE/E;AACA;AACA,MAAMS,UAAU,GAAGZ,QAAQ,CAACa,eAAe,CAAC,MAAM,CAAC,EAAEC,eAAe,CAAC,CAAC;AACtE,MAAMC,QAAQ,GAAGH,UAAU,EAAEI,QAAQ,EAAEC,KAAK,EAAEC,aAAmC;AACjF,MAAMC,WAAW,GAAGJ,QAAQ,IAAIH,UAAU,EAAEQ,OAAO;AAEnD,MAAMC,WAAW,GAAGN,QAAQ,GAAG,CAAC,YAAYA,QAAQ,yBAAyB,CAAC,GAAG,EAAE;AAEnF,MAAMO,SAAS,GAAItB,QAAQ,CAACuB,QAAQ,CAAC,SAAS,CAAC,CAAgCC,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAE5E;EACb4B,EAAE,EAAE,qBAAqB;EACzBC,OAAO,EAAE,CAAC,wDAAwD,EAAE,GAAGP,WAAW,CAAC;EACnFD,OAAO,EAAEnB,cAAK,CAAC4B,IAAI;AACrB,oBAAoBrB,cAAc;AAClC,gCAAgCW,WAAW;AAC3C,6BAA6BG,SAAS;AACtC;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+
3
+ import React, { forwardRef, useMemo } from 'react';
4
+ import { Text, View } from 'react-native';
5
+ import { Slot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
6
+ import { CheckCircle, EmergencyHome, Info, Warning } from '@cdx-ui/icons';
7
+ import { cn, ParentContext, useParentContext, useStyleContext } from '@cdx-ui/utils';
8
+ import { Icon } from '../Icon';
9
+ import { alertActionsVariants, alertBodyVariants, alertDescriptionVariants, alertIconVariants, alertRootVariants, alertTextVariants, alertTitleVariants } from './styles';
10
+
11
+ // =============================================================================
12
+ // CONTEXT
13
+ // =============================================================================
14
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
+ const SCOPE = 'ALERT';
16
+ const useAlertStyleContext = () => {
17
+ const ctx = useStyleContext(SCOPE);
18
+ return {
19
+ severity: ctx?.severity ?? 'info'
20
+ };
21
+ };
22
+
23
+ // Severity → default icon mapping
24
+ const SEVERITY_ICONS = {
25
+ danger: EmergencyHome,
26
+ warning: Warning,
27
+ success: CheckCircle,
28
+ info: Info
29
+ };
30
+
31
+ // =============================================================================
32
+ // ROOT
33
+ // =============================================================================
34
+
35
+ const AlertRoot = /*#__PURE__*/forwardRef(({
36
+ asChild,
37
+ severity = 'info',
38
+ className,
39
+ style,
40
+ children,
41
+ ...props
42
+ }, ref) => {
43
+ const isAssertive = severity === 'danger' || severity === 'warning';
44
+ const parent = useParentContext();
45
+ const ctx = useMemo(() => ({
46
+ ...parent,
47
+ [SCOPE]: {
48
+ severity
49
+ }
50
+ }), [parent, severity]);
51
+ const rootClassName = cn(alertRootVariants({
52
+ severity
53
+ }), className);
54
+ const role = isAssertive ? 'alert' : 'status';
55
+ const liveRegion = isAssertive ? 'assertive' : 'polite';
56
+ const dataProps = mergeDataAttributes(props, dataAttributes({
57
+ slot: 'alert'
58
+ }));
59
+ if (asChild) {
60
+ return /*#__PURE__*/_jsx(ParentContext.Provider, {
61
+ value: ctx,
62
+ children: /*#__PURE__*/_jsx(Slot, {
63
+ ref: ref,
64
+ className: rootClassName,
65
+ style: style,
66
+ role: role,
67
+ accessibilityLiveRegion: liveRegion,
68
+ ...props,
69
+ ...dataProps,
70
+ children: children
71
+ })
72
+ });
73
+ }
74
+
75
+ // Split children into three regions:
76
+ // 1. Alert.Icon — rendered at inline-start (left)
77
+ // 2. Alert.Actions — rendered at inline-end (right), beside the text
78
+ // 3. Everything else (Title, Description) — text column, flex-1
79
+ //
80
+ // Layout: [Icon] [flex-1 flex-row: [text flex-1] [Actions]]
81
+ const childArray = React.Children.toArray(children);
82
+ const iconChild = childArray.find(child => /*#__PURE__*/React.isValidElement(child) && child.type === AlertIconComponent);
83
+ const actionsChild = childArray.find(child => /*#__PURE__*/React.isValidElement(child) && child.type === AlertActions);
84
+ const textChildren = childArray.filter(child => ! /*#__PURE__*/React.isValidElement(child) || child.type !== AlertIconComponent && child.type !== AlertActions);
85
+ const hasBody = textChildren.length > 0 || !!actionsChild;
86
+ return /*#__PURE__*/_jsx(ParentContext.Provider, {
87
+ value: ctx,
88
+ children: /*#__PURE__*/_jsxs(View, {
89
+ ref: ref,
90
+ className: rootClassName,
91
+ style: style,
92
+ role: role,
93
+ accessibilityLiveRegion: liveRegion,
94
+ ...props,
95
+ ...dataProps,
96
+ children: [iconChild, hasBody ? /*#__PURE__*/_jsxs(View, {
97
+ className: alertBodyVariants(),
98
+ children: [textChildren.length > 0 ? /*#__PURE__*/_jsx(View, {
99
+ className: alertTextVariants(),
100
+ children: textChildren
101
+ }) : null, actionsChild]
102
+ }) : null]
103
+ })
104
+ });
105
+ });
106
+ AlertRoot.displayName = 'Alert';
107
+
108
+ // =============================================================================
109
+ // ICON
110
+ // =============================================================================
111
+
112
+ const AlertIconComponent = /*#__PURE__*/forwardRef(({
113
+ asChild,
114
+ as: asOverride,
115
+ className,
116
+ style,
117
+ ...props
118
+ }, ref) => {
119
+ const {
120
+ severity
121
+ } = useAlertStyleContext();
122
+ const computedClassName = cn(alertIconVariants({
123
+ severity
124
+ }), className);
125
+ if (asChild) {
126
+ return /*#__PURE__*/_jsx(Slot, {
127
+ ref: ref,
128
+ className: computedClassName,
129
+ style: style,
130
+ ...props,
131
+ ...mergeDataAttributes(props, dataAttributes({
132
+ slot: 'alert-icon'
133
+ }))
134
+ });
135
+ }
136
+ return /*#__PURE__*/_jsx(Icon, {
137
+ as: asOverride ?? SEVERITY_ICONS[severity],
138
+ className: computedClassName,
139
+ style: style,
140
+ ...props,
141
+ ...mergeDataAttributes(props, dataAttributes({
142
+ slot: 'alert-icon'
143
+ }))
144
+ });
145
+ });
146
+ AlertIconComponent.displayName = 'Alert.Icon';
147
+
148
+ // =============================================================================
149
+ // TITLE
150
+ // =============================================================================
151
+
152
+ const AlertTitle = /*#__PURE__*/forwardRef(({
153
+ asChild,
154
+ className,
155
+ style,
156
+ children,
157
+ ...props
158
+ }, ref) => {
159
+ const {
160
+ severity
161
+ } = useAlertStyleContext();
162
+ const computedClassName = cn(alertTitleVariants({
163
+ severity
164
+ }), className);
165
+ const Comp = asChild ? Slot : Text;
166
+ return /*#__PURE__*/_jsx(Comp, {
167
+ ref: ref,
168
+ className: computedClassName,
169
+ style: style,
170
+ ...props,
171
+ ...mergeDataAttributes(props, dataAttributes({
172
+ slot: 'alert-title'
173
+ })),
174
+ children: children
175
+ });
176
+ });
177
+ AlertTitle.displayName = 'Alert.Title';
178
+
179
+ // =============================================================================
180
+ // DESCRIPTION
181
+ // =============================================================================
182
+
183
+ const AlertDescription = /*#__PURE__*/forwardRef(({
184
+ asChild,
185
+ className,
186
+ style,
187
+ children,
188
+ ...props
189
+ }, ref) => {
190
+ const {
191
+ severity
192
+ } = useAlertStyleContext();
193
+ const computedClassName = cn(alertDescriptionVariants({
194
+ severity
195
+ }), className);
196
+ const Comp = asChild ? Slot : Text;
197
+ return /*#__PURE__*/_jsx(Comp, {
198
+ ref: ref,
199
+ className: computedClassName,
200
+ style: style,
201
+ ...props,
202
+ ...mergeDataAttributes(props, dataAttributes({
203
+ slot: 'alert-description'
204
+ })),
205
+ children: children
206
+ });
207
+ });
208
+ AlertDescription.displayName = 'Alert.Description';
209
+
210
+ // =============================================================================
211
+ // ACTIONS
212
+ // =============================================================================
213
+
214
+ const AlertActions = /*#__PURE__*/forwardRef(({
215
+ asChild,
216
+ className,
217
+ style,
218
+ children,
219
+ ...props
220
+ }, ref) => {
221
+ const {
222
+ severity
223
+ } = useAlertStyleContext();
224
+ const computedClassName = cn(alertActionsVariants(), className);
225
+ const Comp = asChild ? Slot : View;
226
+
227
+ // Auto-inject color={severity} on direct Button / IconButton children unless
228
+ // the consumer already provides a color prop.
229
+ const injectedChildren = React.Children.map(children, child => {
230
+ if (! /*#__PURE__*/React.isValidElement(child)) return child;
231
+ if ('color' in child.props) return child;
232
+ return /*#__PURE__*/React.cloneElement(child, {
233
+ color: severity
234
+ });
235
+ });
236
+ return /*#__PURE__*/_jsx(Comp, {
237
+ ref: ref,
238
+ className: computedClassName,
239
+ style: style,
240
+ ...props,
241
+ ...mergeDataAttributes(props, dataAttributes({
242
+ slot: 'alert-actions'
243
+ })),
244
+ children: asChild ? children : injectedChildren
245
+ });
246
+ });
247
+ AlertActions.displayName = 'Alert.Actions';
248
+
249
+ // =============================================================================
250
+ // COMPOUND EXPORT
251
+ // =============================================================================
252
+
253
+ export const Alert = Object.assign(AlertRoot, {
254
+ Icon: AlertIconComponent,
255
+ Title: AlertTitle,
256
+ Description: AlertDescription,
257
+ Actions: AlertActions
258
+ });
259
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","forwardRef","useMemo","Text","View","Slot","dataAttributes","mergeDataAttributes","CheckCircle","EmergencyHome","Info","Warning","cn","ParentContext","useParentContext","useStyleContext","Icon","alertActionsVariants","alertBodyVariants","alertDescriptionVariants","alertIconVariants","alertRootVariants","alertTextVariants","alertTitleVariants","jsx","_jsx","jsxs","_jsxs","SCOPE","useAlertStyleContext","ctx","severity","SEVERITY_ICONS","danger","warning","success","info","AlertRoot","asChild","className","style","children","props","ref","isAssertive","parent","rootClassName","role","liveRegion","dataProps","slot","Provider","value","accessibilityLiveRegion","childArray","Children","toArray","iconChild","find","child","isValidElement","type","AlertIconComponent","actionsChild","AlertActions","textChildren","filter","hasBody","length","displayName","as","asOverride","computedClassName","AlertTitle","Comp","AlertDescription","injectedChildren","map","cloneElement","color","Alert","Object","assign","Title","Description","Actions"],"sourceRoot":"../../../../src","sources":["components/Alert/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAClE,SAASC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACzE,SAASC,IAAI,EAAEC,cAAc,EAAEC,mBAAmB,QAAQ,oBAAoB;AAE9E,SAASC,WAAW,EAAEC,aAAa,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,EAAE,EAAEC,aAAa,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,eAAe;AACpF,SAASC,IAAI,QA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KAAK;IACnE,IAAI,OAAO,IAAIA,KAAK,CAACjB,KAAK,EAAE,OAAOiB,KAAK;IACxC,oBAAO3D,KAAK,CAAC8E,YAAY,CAACnB,KAAK,EAAE;MAAEoB,KAAK,EAAEhD;IAAS,CAAC,CAAC;EACvD,CAAC,CAAC;EAEF,oBACEN,IAAA,CAACiD,IAAI;IACH/B,GAAG,EAAEA,GAAI;IACTJ,SAAS,EAAEiC,iBAAkB;IAC7BhC,KAAK,EAAEA,KAAM;IAAA,GACTE,KAAK;IAAA,GACLnC,mBAAmB,CAACmC,KAAK,EAAEpC,cAAc,CAAC;MAAE4C,IAAI,EAAE;IAAgB,CAAC,CAAC,CAAC;IAAAT,QAAA,EAExEH,OAAO,GAAGG,QAAQ,GAAGmC;EAAgB,CAClC,CAAC;AAEX,CACF,CAAC;AAEDZ,YAAY,CAACK,WAAW,GAAG,eAAe;;AAE1C;AACA;AACA;;AASA,OAAO,MAAMW,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC7C,SAAS,EAAE;EAC5CrB,IAAI,EAAE8C,kBAAkB;EACxBqB,KAAK,EAAEV,UAAU;EACjBW,WAAW,EAAET,gBAAgB;EAC7BU,OAAO,EAAErB;AACX,CAAC,CAA2B","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ import { cva } from 'class-variance-authority';
4
+
5
+ // ── Severity type ────────────────────────────────────────────────────────────
6
+
7
+ // ── Root ─────────────────────────────────────────────────────────────────────
8
+
9
+ export const alertRootVariants = cva(['flex-row items-start', 'gap-2 px-3', 'rounded-[var(--border-radius-default)]'], {
10
+ variants: {
11
+ severity: {
12
+ danger: 'bg-surface-danger-subtle',
13
+ warning: 'bg-surface-warning-subtle',
14
+ success: 'bg-surface-success-subtle',
15
+ info: 'bg-surface-info-subtle'
16
+ }
17
+ },
18
+ defaultVariants: {
19
+ severity: 'info'
20
+ }
21
+ });
22
+
23
+ // ── Icon ─────────────────────────────────────────────────────────────────────
24
+
25
+ export const alertIconVariants = cva(['size-5 shrink-0 mt-3'], {
26
+ variants: {
27
+ severity: {
28
+ danger: 'text-content-danger-on-subtle',
29
+ warning: 'text-content-warning-on-subtle',
30
+ success: 'text-content-success-on-subtle',
31
+ info: 'text-content-info-on-subtle'
32
+ }
33
+ },
34
+ defaultVariants: {
35
+ severity: 'info'
36
+ }
37
+ });
38
+
39
+ // ── Body (internal row: text area + trailing actions) ────────────────────────
40
+
41
+ export const alertBodyVariants = cva(['flex-1 flex-row items-start gap-2 min-w-0']);
42
+
43
+ // ── Text (internal flex-col for title + description) ─────────────────────────
44
+
45
+ export const alertTextVariants = cva(['flex-1 flex-col gap-1 min-w-0 mt-3 mb-3']);
46
+
47
+ // ── Title ────────────────────────────────────────────────────────────────────
48
+
49
+ export const alertTitleVariants = cva(['body-md font-semibold'], {
50
+ variants: {
51
+ severity: {
52
+ danger: 'text-content-danger-on-subtle',
53
+ warning: 'text-content-warning-on-subtle',
54
+ success: 'text-content-success-on-subtle',
55
+ info: 'text-content-info-on-subtle'
56
+ }
57
+ },
58
+ defaultVariants: {
59
+ severity: 'info'
60
+ }
61
+ });
62
+
63
+ // ── Description ──────────────────────────────────────────────────────────────
64
+
65
+ export const alertDescriptionVariants = cva(['body-md'], {
66
+ variants: {
67
+ severity: {
68
+ danger: 'text-content-danger-on-subtle',
69
+ warning: 'text-content-warning-on-subtle',
70
+ success: 'text-content-success-on-subtle',
71
+ info: 'text-content-info-on-subtle'
72
+ }
73
+ },
74
+ defaultVariants: {
75
+ severity: 'info'
76
+ }
77
+ });
78
+
79
+ // ── Actions ──────────────────────────────────────────────────────────────────
80
+
81
+ export const alertActionsVariants = cva(['shrink-0 flex-row items-center gap-1.5 mt-1.5 mb-1.5']);
82
+
83
+ // ── Types ─────────────────────────────────────────────────────────────────────
84
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cva","alertRootVariants","variants","severity","danger","warning","success","info","defaultVariants","alertIconVariants","alertBodyVariants","alertTextVariants","alertTitleVariants","alertDescriptionVariants","alertActionsVariants"],"sourceRoot":"../../../../src","sources":["components/Alert/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,0BAA0B;;AAEjE;;AAIA;;AAEA,OAAO,MAAMC,iBAAiB,GAAGD,GAAG,CAClC,CAAC,sBAAsB,EAAE,YAAY,EAAE,wCAAwC,CAAC,EAChF;EACEE,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,MAAM,EAAE,0BAA0B;MAClCC,OAAO,EAAE,2BAA2B;MACpCC,OAAO,EAAE,2BAA2B;MACpCC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,QAAQ,EAAE;EACZ;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAMM,iBAAiB,GAAGT,GAAG,CAAC,CAAC,sBAAsB,CAAC,EAAE;EAC7DE,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,MAAM,EAAE,+BAA+B;MACvCC,OAAO,EAAE,gCAAgC;MACzCC,OAAO,EAAE,gCAAgC;MACzCC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMO,iBAAiB,GAAGV,GAAG,CAAC,CAAC,2CAA2C,CAAC,CAAC;;AAEnF;;AAEA,OAAO,MAAMW,iBAAiB,GAAGX,GAAG,CAAC,CAAC,yCAAyC,CAAC,CAAC;;AAEjF;;AAEA,OAAO,MAAMY,kBAAkB,GAAGZ,GAAG,CAAC,CAAC,uBAAuB,CAAC,EAAE;EAC/DE,QAAQ,EAAE;IACRC,QAAQ,EAAE;MACRC,MAAM,EAAE,+BAA+B;MACvCC,OAAO,EAAE,gCAAgC;MACzCC,OAAO,EAAE,gCAAgC;MACzCC,IAAI,EAAE;IACR;EACF,CAAC;EACDC,eAAe,EAAE;IACfL,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;;AAEF;;AAEA,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