@techfides/ui-library-design 0.3.1 → 0.7.0

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 (189) hide show
  1. package/dist/anatomies.d.ts +1586 -0
  2. package/dist/anatomies.js +107 -0
  3. package/dist/anatomies.js.map +1 -0
  4. package/dist/anatomy.d.ts +13 -0
  5. package/dist/anatomy.js +6 -0
  6. package/dist/anatomy.js.map +1 -0
  7. package/dist/control.d.ts +1 -2
  8. package/dist/control.js +1 -2
  9. package/dist/control.js.map +1 -1
  10. package/dist/index.d.ts +55 -58
  11. package/dist/index.js +59 -62
  12. package/dist/recipes/accordion.d.ts +28 -1
  13. package/dist/recipes/accordion.js +29 -1
  14. package/dist/recipes/accordion.js.map +1 -1
  15. package/dist/recipes/alert.d.ts +45 -1
  16. package/dist/recipes/alert.js +45 -1
  17. package/dist/recipes/alert.js.map +1 -1
  18. package/dist/recipes/band.d.ts +11 -1
  19. package/dist/recipes/band.js +7 -1
  20. package/dist/recipes/band.js.map +1 -1
  21. package/dist/recipes/bars.d.ts +60 -1
  22. package/dist/recipes/bars.js +59 -1
  23. package/dist/recipes/bars.js.map +1 -1
  24. package/dist/recipes/brandMark.d.ts +8 -1
  25. package/dist/recipes/brandMark.js +7 -1
  26. package/dist/recipes/brandMark.js.map +1 -1
  27. package/dist/recipes/button.d.ts +41 -4
  28. package/dist/recipes/button.js +31 -2
  29. package/dist/recipes/button.js.map +1 -1
  30. package/dist/recipes/cardHeader.d.ts +18 -1
  31. package/dist/recipes/cardHeader.js +19 -1
  32. package/dist/recipes/cardHeader.js.map +1 -1
  33. package/dist/recipes/checkbox.d.ts +16 -1
  34. package/dist/recipes/checkbox.js +16 -3
  35. package/dist/recipes/checkbox.js.map +1 -1
  36. package/dist/recipes/chip.d.ts +41 -2
  37. package/dist/recipes/chip.js +34 -1
  38. package/dist/recipes/chip.js.map +1 -1
  39. package/dist/recipes/codeEditor.d.ts +8 -1
  40. package/dist/recipes/codeEditor.js +7 -1
  41. package/dist/recipes/codeEditor.js.map +1 -1
  42. package/dist/recipes/datePicker.d.ts +62 -1
  43. package/dist/recipes/datePicker.js +56 -3
  44. package/dist/recipes/datePicker.js.map +1 -1
  45. package/dist/recipes/dialog.d.ts +49 -1
  46. package/dist/recipes/dialog.js +40 -1
  47. package/dist/recipes/dialog.js.map +1 -1
  48. package/dist/recipes/feature.d.ts +30 -1
  49. package/dist/recipes/feature.js +30 -2
  50. package/dist/recipes/feature.js.map +1 -1
  51. package/dist/recipes/field.js +1 -1
  52. package/dist/recipes/findings.d.ts +33 -1
  53. package/dist/recipes/findings.js +34 -1
  54. package/dist/recipes/findings.js.map +1 -1
  55. package/dist/recipes/heading.d.ts +12 -2
  56. package/dist/recipes/heading.js +7 -1
  57. package/dist/recipes/heading.js.map +1 -1
  58. package/dist/recipes/heartbeat.d.ts +52 -2
  59. package/dist/recipes/heartbeat.js +51 -4
  60. package/dist/recipes/heartbeat.js.map +1 -1
  61. package/dist/recipes/ink.d.ts +11 -0
  62. package/dist/recipes/ink.js +13 -0
  63. package/dist/recipes/ink.js.map +1 -0
  64. package/dist/recipes/input.d.ts +55 -1
  65. package/dist/recipes/input.js +52 -2
  66. package/dist/recipes/input.js.map +1 -1
  67. package/dist/recipes/listItem.d.ts +18 -1
  68. package/dist/recipes/listItem.js +20 -1
  69. package/dist/recipes/listItem.js.map +1 -1
  70. package/dist/recipes/listbox.d.ts +22 -2
  71. package/dist/recipes/listbox.js +19 -1
  72. package/dist/recipes/listbox.js.map +1 -1
  73. package/dist/recipes/marquee.d.ts +26 -2
  74. package/dist/recipes/marquee.js +24 -1
  75. package/dist/recipes/marquee.js.map +1 -1
  76. package/dist/recipes/menu.d.ts +33 -1
  77. package/dist/recipes/menu.js +29 -1
  78. package/dist/recipes/menu.js.map +1 -1
  79. package/dist/recipes/metaRow.d.ts +11 -2
  80. package/dist/recipes/metaRow.js +7 -1
  81. package/dist/recipes/metaRow.js.map +1 -1
  82. package/dist/recipes/meter.d.ts +36 -2
  83. package/dist/recipes/meter.js +34 -1
  84. package/dist/recipes/meter.js.map +1 -1
  85. package/dist/recipes/motion.d.ts +9 -1
  86. package/dist/recipes/nebula.js +1 -1
  87. package/dist/recipes/numberRange.d.ts +44 -1
  88. package/dist/recipes/numberRange.js +36 -1
  89. package/dist/recipes/numberRange.js.map +1 -1
  90. package/dist/recipes/paper.d.ts +55 -2
  91. package/dist/recipes/paper.js +47 -4
  92. package/dist/recipes/paper.js.map +1 -1
  93. package/dist/recipes/progressBar.d.ts +8 -1
  94. package/dist/recipes/progressBar.js +7 -1
  95. package/dist/recipes/progressBar.js.map +1 -1
  96. package/dist/recipes/queue.d.ts +33 -1
  97. package/dist/recipes/queue.js +35 -1
  98. package/dist/recipes/queue.js.map +1 -1
  99. package/dist/recipes/radioGroup.d.ts +18 -1
  100. package/dist/recipes/radioGroup.js +21 -3
  101. package/dist/recipes/radioGroup.js.map +1 -1
  102. package/dist/recipes/scopeSwitcher.d.ts +38 -1
  103. package/dist/recipes/scopeSwitcher.js +40 -1
  104. package/dist/recipes/scopeSwitcher.js.map +1 -1
  105. package/dist/recipes/scrollArea.d.ts +12 -3
  106. package/dist/recipes/scrollArea.js +7 -1
  107. package/dist/recipes/scrollArea.js.map +1 -1
  108. package/dist/recipes/searchPalette.d.ts +48 -1
  109. package/dist/recipes/searchPalette.js +49 -1
  110. package/dist/recipes/searchPalette.js.map +1 -1
  111. package/dist/recipes/sectionHeader.d.ts +20 -2
  112. package/dist/recipes/sectionHeader.js +20 -3
  113. package/dist/recipes/sectionHeader.js.map +1 -1
  114. package/dist/recipes/segmentedControl.d.ts +8 -1
  115. package/dist/recipes/segmentedControl.js +7 -1
  116. package/dist/recipes/segmentedControl.js.map +1 -1
  117. package/dist/recipes/select.d.ts +57 -1
  118. package/dist/recipes/select.js +51 -1
  119. package/dist/recipes/select.js.map +1 -1
  120. package/dist/recipes/separator.d.ts +13 -2
  121. package/dist/recipes/separator.js +8 -2
  122. package/dist/recipes/separator.js.map +1 -1
  123. package/dist/recipes/sidebar.d.ts +128 -2
  124. package/dist/recipes/sidebar.js +125 -2
  125. package/dist/recipes/sidebar.js.map +1 -1
  126. package/dist/recipes/sky.d.ts +31 -1
  127. package/dist/recipes/sky.js +30 -1
  128. package/dist/recipes/sky.js.map +1 -1
  129. package/dist/recipes/slider.d.ts +15 -1
  130. package/dist/recipes/slider.js +14 -1
  131. package/dist/recipes/slider.js.map +1 -1
  132. package/dist/recipes/stat.d.ts +72 -3
  133. package/dist/recipes/stat.js +73 -3
  134. package/dist/recipes/stat.js.map +1 -1
  135. package/dist/recipes/switch.d.ts +10 -1
  136. package/dist/recipes/switch.js +9 -3
  137. package/dist/recipes/switch.js.map +1 -1
  138. package/dist/recipes/table.d.ts +63 -3
  139. package/dist/recipes/table.js +56 -2
  140. package/dist/recipes/table.js.map +1 -1
  141. package/dist/recipes/tail.d.ts +40 -5
  142. package/dist/recipes/tail.js +37 -5
  143. package/dist/recipes/tail.js.map +1 -1
  144. package/dist/recipes/text.d.ts +16 -3
  145. package/dist/recipes/text.js +8 -3
  146. package/dist/recipes/text.js.map +1 -1
  147. package/dist/recipes/textarea.d.ts +46 -1
  148. package/dist/recipes/textarea.js +41 -1
  149. package/dist/recipes/textarea.js.map +1 -1
  150. package/dist/recipes/tile.d.ts +23 -1
  151. package/dist/recipes/tile.js +19 -1
  152. package/dist/recipes/tile.js.map +1 -1
  153. package/dist/recipes/tooltip.d.ts +8 -1
  154. package/dist/recipes/tooltip.js +7 -1
  155. package/dist/recipes/tooltip.js.map +1 -1
  156. package/dist/recipes/topBar.d.ts +43 -1
  157. package/dist/recipes/topBar.js +44 -1
  158. package/dist/recipes/topBar.js.map +1 -1
  159. package/dist/recipes/trail.d.ts +55 -5
  160. package/dist/recipes/trail.js +47 -5
  161. package/dist/recipes/trail.js.map +1 -1
  162. package/dist/recipes/userMenu.d.ts +23 -1
  163. package/dist/recipes/userMenu.js +24 -1
  164. package/dist/recipes/userMenu.js.map +1 -1
  165. package/package.json +1 -2
  166. package/dist/charts/animation.js +0 -14
  167. package/dist/charts/animation.js.map +0 -1
  168. package/dist/charts/bars.d.ts +0 -22
  169. package/dist/charts/bars.js +0 -61
  170. package/dist/charts/bars.js.map +0 -1
  171. package/dist/charts/groupedBars.d.ts +0 -20
  172. package/dist/charts/groupedBars.js +0 -82
  173. package/dist/charts/groupedBars.js.map +0 -1
  174. package/dist/charts/paint.js +0 -19
  175. package/dist/charts/paint.js.map +0 -1
  176. package/dist/charts/spark.d.ts +0 -17
  177. package/dist/charts/spark.js +0 -159
  178. package/dist/charts/spark.js.map +0 -1
  179. package/dist/charts/tooltip.js +0 -41
  180. package/dist/charts/tooltip.js.map +0 -1
  181. package/dist/czech.d.ts +0 -6
  182. package/dist/czech.js +0 -100
  183. package/dist/czech.js.map +0 -1
  184. package/dist/tally.d.ts +0 -17
  185. package/dist/tally.js +0 -75
  186. package/dist/tally.js.map +0 -1
  187. package/dist/words.d.ts +0 -116
  188. package/dist/words.js +0 -96
  189. package/dist/words.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"bars.js","names":[],"sources":["../../src/recipes/bars.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst barsRecipe = cva([\n '@container relative isolate flex grow flex-col justify-between gap-4 p-6',\n 'rounded-tf-card bg-tf-glass shadow-tf-float backdrop-blur-tf-glass',\n 'tf-edge-sweep font-tf-body text-tf-fg tf-transition',\n])\n\nconst barsHeadRecipe = cva('flex flex-wrap items-start justify-between gap-4')\n\nconst barsTextRecipe = cva('flex flex-col gap-1')\n\nconst barsLabelRecipe = cva('text-tf-body-sm font-medium text-tf-fg')\n\nconst barsHintRecipe = cva('text-tf-caption-sm text-tf-muted')\n\nconst barsFootRecipe = cva('flex flex-col items-end gap-1 text-tf-caption-sm text-tf-muted')\n\nconst barsLegendRecipe = cva('flex items-center gap-2')\n\nconst barsLegendListRecipe = cva('flex flex-wrap items-center gap-4')\n\nconst barsLegendDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { tone: 'accent' },\n variants: {\n tone: {\n accent: 'bg-tf-blend blend-tf-accent',\n plain: '',\n },\n },\n})\n\nconst barsSummaryRecipe = cva('tabular-nums')\n\nconst barsChartRecipe = cva('h-36 w-full')\n\nexport {\n barsChartRecipe,\n barsFootRecipe,\n barsHeadRecipe,\n barsHintRecipe,\n barsLabelRecipe,\n barsLegendDotRecipe,\n barsLegendListRecipe,\n barsLegendRecipe,\n barsRecipe,\n barsSummaryRecipe,\n barsTextRecipe,\n}\n"],"mappings":";;AAEA,MAAM,aAAa,IAAI;CACrB;CACA;CACA;AACF,CAAC;AAED,MAAM,iBAAiB,IAAI,kDAAkD;AAE7E,MAAM,iBAAiB,IAAI,qBAAqB;AAEhD,MAAM,kBAAkB,IAAI,wCAAwC;AAEpE,MAAM,iBAAiB,IAAI,kCAAkC;AAE7D,MAAM,iBAAiB,IAAI,gEAAgE;AAE3F,MAAM,mBAAmB,IAAI,yBAAyB;AAEtD,MAAM,uBAAuB,IAAI,mCAAmC;AAEpE,MAAM,sBAAsB,IAAI,oCAAoC;CAClE,iBAAiB,EAAE,MAAM,SAAS;CAClC,UAAU,EACR,MAAM;EACJ,QAAQ;EACR,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,cAAc;AAE5C,MAAM,kBAAkB,IAAI,aAAa"}
1
+ {"version":3,"file":"bars.js","names":[],"sources":["../../src/recipes/bars.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\nconst barsRecipe = cva([\n '@container relative isolate flex grow flex-col justify-between gap-4 p-6',\n 'rounded-tf-card bg-tf-glass shadow-tf-float backdrop-blur-tf-glass',\n 'tf-edge-sweep font-tf-body text-tf-fg tf-transition',\n])\n\nconst barsHeadRecipe = cva('flex flex-wrap items-start justify-between gap-4')\n\nconst barsTextRecipe = cva('flex flex-col gap-1')\n\nconst barsLabelRecipe = cva('text-tf-body-sm font-medium text-tf-fg')\n\nconst barsHintRecipe = cva('text-tf-caption-sm text-tf-muted')\n\nconst barsFootRecipe = cva('flex flex-col items-end gap-1 text-tf-caption-sm text-tf-muted')\n\nconst barsLegendRecipe = cva('flex items-center gap-2')\n\nconst barsLegendListRecipe = cva('flex flex-wrap items-center gap-4')\n\nconst barsLegendDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { tone: 'accent' },\n variants: {\n tone: {\n accent: 'bg-tf-blend blend-tf-accent',\n plain: '',\n },\n },\n})\n\nconst barsSummaryRecipe = cva('tabular-nums')\n\nconst barsChartRecipe = cva('h-36 w-full')\n\nconst barsAnatomy = anatomy({\n chart: { part: 'chart', recipe: barsChartRecipe, required: true },\n dot: { part: 'dot', recipe: barsLegendDotRecipe, required: false },\n foot: { part: 'foot', recipe: barsFootRecipe, required: false },\n head: { part: 'head', recipe: barsHeadRecipe, required: true },\n hint: { part: 'hint', recipe: barsHintRecipe, required: false },\n label: { part: 'label', recipe: barsLabelRecipe, required: true },\n legend: { part: 'legend', recipe: barsLegendRecipe, required: false },\n legendList: { part: 'legend-list', recipe: barsLegendListRecipe, required: false },\n root: { part: 'bars', recipe: barsRecipe, required: true },\n summary: { part: 'summary', recipe: barsSummaryRecipe, required: false },\n text: { part: 'text', recipe: barsTextRecipe, required: true },\n})\n\nexport {\n barsAnatomy,\n barsChartRecipe,\n barsFootRecipe,\n barsHeadRecipe,\n barsHintRecipe,\n barsLabelRecipe,\n barsLegendDotRecipe,\n barsLegendListRecipe,\n barsLegendRecipe,\n barsRecipe,\n barsSummaryRecipe,\n barsTextRecipe,\n}\n"],"mappings":";;;AAIA,MAAM,aAAa,IAAI;CACrB;CACA;CACA;AACF,CAAC;AAED,MAAM,iBAAiB,IAAI,kDAAkD;AAE7E,MAAM,iBAAiB,IAAI,qBAAqB;AAEhD,MAAM,kBAAkB,IAAI,wCAAwC;AAEpE,MAAM,iBAAiB,IAAI,kCAAkC;AAE7D,MAAM,iBAAiB,IAAI,gEAAgE;AAE3F,MAAM,mBAAmB,IAAI,yBAAyB;AAEtD,MAAM,uBAAuB,IAAI,mCAAmC;AAEpE,MAAM,sBAAsB,IAAI,oCAAoC;CAClE,iBAAiB,EAAE,MAAM,SAAS;CAClC,UAAU,EACR,MAAM;EACJ,QAAQ;EACR,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,cAAc;AAE5C,MAAM,kBAAkB,IAAI,aAAa;AAEzC,MAAM,cAAc,QAAQ;CAC1B,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAK;CAChE,KAAK;EAAE,MAAM;EAAO,QAAQ;EAAqB,UAAU;CAAM;CACjE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAM;CAC9D,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAK;CAC7D,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAM;CAC9D,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAK;CAChE,QAAQ;EAAE,MAAM;EAAU,QAAQ;EAAkB,UAAU;CAAM;CACpE,YAAY;EAAE,MAAM;EAAe,QAAQ;EAAsB,UAAU;CAAM;CACjF,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAY,UAAU;CAAK;CACzD,SAAS;EAAE,MAAM;EAAW,QAAQ;EAAmB,UAAU;CAAM;CACvE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAK;AAC/D,CAAC"}
@@ -1,5 +1,12 @@
1
1
  //#region src/recipes/brandMark.d.ts
2
2
  declare const brandMarkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
+ declare const brandMarkAnatomy: {
4
+ readonly root: {
5
+ readonly part: "brand-mark";
6
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ readonly required: true;
8
+ };
9
+ };
3
10
  //#endregion
4
- export { brandMarkRecipe };
11
+ export { brandMarkAnatomy, brandMarkRecipe };
5
12
  //# sourceMappingURL=brandMark.d.ts.map
@@ -1,7 +1,13 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { cva } from "class-variance-authority";
2
3
  //#region src/recipes/brandMark.ts
3
4
  const brandMarkRecipe = cva("block size-tf-icon-solo-sm shrink-0");
5
+ const brandMarkAnatomy = anatomy({ root: {
6
+ part: "brand-mark",
7
+ recipe: brandMarkRecipe,
8
+ required: true
9
+ } });
4
10
  //#endregion
5
- export { brandMarkRecipe };
11
+ export { brandMarkAnatomy, brandMarkRecipe };
6
12
 
7
13
  //# sourceMappingURL=brandMark.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brandMark.js","names":[],"sources":["../../src/recipes/brandMark.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst brandMarkRecipe = cva('block size-tf-icon-solo-sm shrink-0')\n\nexport { brandMarkRecipe }\n"],"mappings":";;AAEA,MAAM,kBAAkB,IAAI,qCAAqC"}
1
+ {"version":3,"file":"brandMark.js","names":[],"sources":["../../src/recipes/brandMark.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\nconst brandMarkRecipe = cva('block size-tf-icon-solo-sm shrink-0')\n\nconst brandMarkAnatomy = anatomy({\n root: { part: 'brand-mark', recipe: brandMarkRecipe, required: true },\n})\n\nexport { brandMarkAnatomy, brandMarkRecipe }\n"],"mappings":";;;AAIA,MAAM,kBAAkB,IAAI,qCAAqC;AAEjE,MAAM,mBAAmB,QAAQ,EAC/B,MAAM;CAAE,MAAM;CAAc,QAAQ;CAAiB,UAAU;AAAK,EACtE,CAAC"}
@@ -2,7 +2,7 @@ import { Tone } from "../tone.js";
2
2
  //#region src/recipes/button.d.ts
3
3
  declare const buttonSpinnerRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
4
  declare const buttonWordsRecipe: (props?: ({
5
- size?: "sm" | "md" | "lg" | "xs" | null | undefined;
5
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'success' | 'warning' | 'info' | 'link';
8
8
  type ButtonAccent = Tone;
@@ -11,13 +11,50 @@ declare const buttonRecipe: (props?: ({
11
11
  fullWidth?: boolean | null | undefined;
12
12
  iconOnly?: boolean | null | undefined;
13
13
  leading?: boolean | null | undefined;
14
- size?: "sm" | "md" | "lg" | "xs" | null | undefined;
14
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
15
15
  trailing?: boolean | null | undefined;
16
- variant?: "success" | "warning" | "info" | "danger" | "ghost" | "secondary" | "link" | "primary" | null | undefined;
16
+ variant?: "ghost" | "success" | "warning" | "info" | "danger" | "secondary" | "link" | "primary" | null | undefined;
17
17
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
18
  declare const buttonVariants: readonly ["primary", "secondary", "ghost", "success", "warning", "danger", "info", "link"];
19
19
  declare const buttonSizes: readonly ["xs", "sm", "md", "lg"];
20
20
  declare const buttonAccents: readonly ["accent", "success", "warning", "info", "danger"];
21
+ declare const buttonAnatomy: {
22
+ readonly cloud: {
23
+ readonly part: "cloud";
24
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
25
+ readonly required: false;
26
+ };
27
+ readonly nebula: {
28
+ readonly part: "nebula";
29
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
30
+ readonly required: false;
31
+ };
32
+ readonly root: {
33
+ readonly part: "button";
34
+ readonly recipe: (props?: ({
35
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | null | undefined;
36
+ fullWidth?: boolean | null | undefined;
37
+ iconOnly?: boolean | null | undefined;
38
+ leading?: boolean | null | undefined;
39
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
40
+ trailing?: boolean | null | undefined;
41
+ variant?: "ghost" | "success" | "warning" | "info" | "danger" | "secondary" | "link" | "primary" | null | undefined;
42
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
43
+ readonly required: true;
44
+ };
45
+ readonly spinner: {
46
+ readonly part: "spinner";
47
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
48
+ readonly required: false;
49
+ };
50
+ readonly words: {
51
+ readonly part: "words";
52
+ readonly recipe: (props?: ({
53
+ size?: "xs" | "sm" | "md" | "lg" | null | undefined;
54
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
+ readonly required: false;
56
+ };
57
+ };
21
58
  //#endregion
22
- export { type ButtonAccent, type ButtonVariant, buttonAccents, buttonRecipe, buttonSizes, buttonSpinnerRecipe, buttonVariants, buttonWordsRecipe };
59
+ export { type ButtonAccent, type ButtonVariant, buttonAccents, buttonAnatomy, buttonRecipe, buttonSizes, buttonSpinnerRecipe, buttonVariants, buttonWordsRecipe };
23
60
  //# sourceMappingURL=button.d.ts.map
@@ -1,6 +1,8 @@
1
- import { toneBlend } from "../tone.js";
1
+ import { anatomy } from "../anatomy.js";
2
2
  import { controlBase, controlBox, controlGap, controlInert, controlReach, controlSizes, hitArea } from "../parts/control.js";
3
3
  import { defaultTone, tones } from "../parts/tone.js";
4
+ import { toneBlend } from "../tone.js";
5
+ import { nebulaCloudRecipe, nebulaVeilRecipe } from "./nebula.js";
4
6
  import { cva } from "class-variance-authority";
5
7
  //#region src/recipes/button.ts
6
8
  const HIT_AREA = hitArea("after:h-tf-target");
@@ -223,7 +225,34 @@ const buttonVariants = [
223
225
  ];
224
226
  const buttonSizes = ["xs", ...controlSizes];
225
227
  const buttonAccents = tones;
228
+ const buttonAnatomy = anatomy({
229
+ cloud: {
230
+ part: "cloud",
231
+ recipe: nebulaCloudRecipe,
232
+ required: false
233
+ },
234
+ nebula: {
235
+ part: "nebula",
236
+ recipe: nebulaVeilRecipe,
237
+ required: false
238
+ },
239
+ root: {
240
+ part: "button",
241
+ recipe: buttonRecipe,
242
+ required: true
243
+ },
244
+ spinner: {
245
+ part: "spinner",
246
+ recipe: buttonSpinnerRecipe,
247
+ required: false
248
+ },
249
+ words: {
250
+ part: "words",
251
+ recipe: buttonWordsRecipe,
252
+ required: false
253
+ }
254
+ });
226
255
  //#endregion
227
- export { buttonAccents, buttonRecipe, buttonSizes, buttonSpinnerRecipe, buttonVariants, buttonWordsRecipe };
256
+ export { buttonAccents, buttonAnatomy, buttonRecipe, buttonSizes, buttonSpinnerRecipe, buttonVariants, buttonWordsRecipe };
228
257
 
229
258
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":[],"sources":["../../src/recipes/button.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport type { ButtonSize } from '#control'\nimport {\n controlBase,\n controlBox,\n controlGap,\n controlInert,\n controlReach,\n controlSizes,\n hitArea,\n} from '#parts/control'\nimport { defaultTone, tones } from '#parts/tone'\nimport type { Tone } from '#tone'\nimport { toneBlend } from '#tone'\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst QUIET_HIT = hitArea('after:h-tf-target', 'after:w-tf-target')\n\nconst buttonFace = [\n 'isolate',\n 'justify-center',\n 'whitespace-nowrap',\n 'tracking-tf-tight',\n 'tf-cloud-md',\n]\n\nconst buttonSpinnerRecipe = cva([\n 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n 'tf-arrives motion-reduce:transition-none',\n])\n\nconst buttonWordsRecipe = cva(\n [\n 'inline-flex items-center justify-center tf-text-trim',\n 'tf-crossfades motion-reduce:transition-none',\n 'in-data-loading:opacity-0',\n ],\n {\n defaultVariants: { size: 'md' },\n variants: { size: controlGap },\n },\n)\n\nconst buttonTempo = ['tf-blend-drift', 'tf-weather-trail']\n\nconst buttonGeometry = {\n lg: `${controlBox.lg} rounded-tf-card px-8 font-medium`,\n md: `${controlBox.md} rounded-tf-block px-6`,\n sm: `${controlBox.sm} px-4 ${HIT_AREA}`,\n xs: `${controlBox.xs} px-2 ${QUIET_HIT}`,\n} satisfies Record<ButtonSize, string>\n\ntype ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'ghost'\n | 'danger'\n | 'success'\n | 'warning'\n | 'info'\n | 'link'\ntype ButtonAccent = Tone\n\nconst CLOUD = ['tf-cloud-brand', 'tf-clouded', 'interactive:hovered:tf-clouding'].join(' ')\nconst CLOUD_INK = ['tf-cloud-ink', 'tf-clouded', 'interactive:hovered:tf-clouding'].join(' ')\nconst CLOUD_ON_REACH = [\n 'tf-cloud-ink',\n 'tf-cloud-hidden',\n 'interactive:hovered:tf-clouding',\n 'interactive:hovered:tf-plated',\n].join(' ')\n\nconst BLEND = [\n 'bg-tf-blend',\n CLOUD,\n 'tf-edge-sweep tf-edge-milk tf-swept-top',\n 'tf-glow tf-lit-rest tf-settled',\n 'interactive:hovered:tf-blended',\n 'interactive:hovered:tf-milked',\n 'interactive:hovered:tf-lit-inside',\n 'interactive:hovered:tf-lifted',\n 'interactive:pressed:tf-pressed',\n 'motion-safe:interactive:pressed:tf-tilted',\n].join(' ')\nconst INK = [\n 'tf-ink-glide',\n 'data-loading:bg-none',\n '[&_svg]:tf-transition [&_svg]:text-tf-muted',\n].join(' ')\n\nconst MARK_ON_REACH = {\n accent: 'interactive:hovered:[&_svg]:text-tf-accent-hi',\n danger: 'interactive:hovered:[&_svg]:text-tf-danger-hi',\n info: 'interactive:hovered:[&_svg]:text-tf-info-hi',\n success: 'interactive:hovered:[&_svg]:text-tf-success-hi',\n warning: 'interactive:hovered:[&_svg]:text-tf-warning-hi',\n} satisfies Record<Tone, string>\n\nconst WORDS_ON_REACH = {\n accent: 'interactive:hovered:text-tf-accent-hi',\n danger: 'interactive:hovered:text-tf-danger-hi',\n info: 'interactive:hovered:text-tf-info-hi',\n success: 'interactive:hovered:text-tf-success-hi',\n warning: 'interactive:hovered:text-tf-warning-hi',\n} satisfies Record<Tone, string>\n\nconst FLAT_INK = 'text-tf-muted interactive:hovered:text-tf-fg'\n\nconst buttonPress = [\n 'motion-safe:interactive:pressed:translate-y-px',\n 'motion-reduce:interactive:pressed:brightness-95',\n]\n\nconst buttonRecipe = cva(\n [\n ...controlBase,\n ...buttonFace,\n ...buttonTempo,\n ...controlReach,\n ...buttonPress,\n ...controlInert,\n 'data-loading:opacity-100',\n ],\n {\n compoundVariants: [\n {\n class: 'tf-cloud-tight',\n variant: 'ghost',\n },\n ...tones.map((accent) => ({\n accent,\n class: `${toneBlend[accent]} ${WORDS_ON_REACH[accent]} ${MARK_ON_REACH[accent]}`,\n variant: 'ghost' as const,\n })),\n {\n class: FLAT_INK,\n iconOnly: true,\n variant: 'ghost',\n },\n {\n class: FLAT_INK,\n iconOnly: true,\n variant: 'secondary',\n },\n {\n class: 'px-0',\n iconOnly: true,\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-xs',\n iconOnly: true,\n size: 'xs',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-sm',\n iconOnly: true,\n size: 'sm',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-md',\n iconOnly: true,\n size: 'md',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-lg',\n iconOnly: true,\n size: 'lg',\n },\n {\n class: 'pr-7',\n size: 'lg',\n trailing: true,\n },\n {\n class: 'pr-5',\n size: 'md',\n trailing: true,\n },\n {\n class: 'pr-3',\n size: 'sm',\n trailing: true,\n },\n {\n class: 'pl-7',\n leading: true,\n size: 'lg',\n },\n {\n class: 'pl-5',\n leading: true,\n size: 'md',\n },\n {\n class: 'pl-3',\n leading: true,\n size: 'sm',\n },\n {\n class: 'h-auto w-auto justify-start bg-transparent p-0 shadow-none outline-offset-4',\n variant: 'link',\n },\n ],\n defaultVariants: {\n accent: defaultTone,\n fullWidth: false,\n iconOnly: false,\n leading: false,\n size: 'md',\n trailing: false,\n variant: 'primary',\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n success: '',\n warning: '',\n } satisfies Record<ButtonAccent, string>,\n fullWidth: {\n false: '',\n true: 'w-full',\n },\n iconOnly: {\n false: '',\n true: 'aspect-square',\n },\n leading: {\n false: '',\n true: '',\n },\n size: buttonGeometry,\n trailing: {\n false: '',\n true: '',\n },\n variant: {\n danger: `${BLEND} text-tf-on-semantic blend-tf-danger`,\n ghost: `${INK} text-tf-fg tf-plated-quiet ${CLOUD_ON_REACH}`,\n info: `${BLEND} text-tf-on-semantic blend-tf-info`,\n link: 'text-tf-accent-hi underline underline-offset-2 interactive:hovered:text-tf-accent',\n primary: `${BLEND} text-tf-on-accent blend-tf-accent`,\n secondary: `${INK} text-tf-blend ${MARK_ON_REACH.accent} tf-glow tf-settled-quiet interactive:hovered:tf-blend-hushed interactive:hovered:tf-lit-rest ${CLOUD_INK} tf-blend-outline blend-tf-accent`,\n success: `${BLEND} text-tf-on-semantic blend-tf-success`,\n warning: `${BLEND} text-tf-on-semantic blend-tf-warning`,\n } satisfies Record<ButtonVariant, string>,\n },\n },\n)\n\nconst buttonVariants = [\n 'primary',\n 'secondary',\n 'ghost',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'link',\n] as const satisfies readonly ButtonVariant[]\n\nconst buttonSizes = ['xs', ...controlSizes] as const satisfies readonly ButtonSize[]\n\nconst buttonAccents = tones\n\nexport {\n type ButtonAccent,\n type ButtonVariant,\n buttonRecipe,\n buttonSizes,\n buttonSpinnerRecipe,\n buttonAccents,\n buttonVariants,\n buttonWordsRecipe,\n}\n"],"mappings":";;;;;AAgBA,MAAM,WAAW,QAAQ,mBAAmB;AAE5C,MAAM,YAAY,QAAQ,qBAAqB,mBAAmB;AAElE,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,sBAAsB,IAAI,CAC9B,+DACA,0CACF,CAAC;AAED,MAAM,oBAAoB,IACxB;CACE;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,MAAM,KAAK;CAC9B,UAAU,EAAE,MAAM,WAAW;AAC/B,CACF;AAEA,MAAM,cAAc,CAAC,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AM;EACR;EACA;GACE,OAAO;GACP,UAAU;GACV,MAAM;EACR;EACA;GACE,OAAO;GACP,UAAU;GACV,MAAM;EACR;EACA;GACE,OAAO;GACP,MAAM;GACN,UAAU;EACZ;EACA;GACE,OAAO;GACP,MAAM;GACN,UAAU;EACZ;EACA;GACE,OAAO;GACP,MAAM;GACN,UAAU;EACZ;EACA;GACE,OAAO;GACP,SAAS;GACT,MAAM;EACR;EACA;GACE,OAAO;GACP,SAAS;GACT,MAAM;EACR;EACA;GACE,OAAO;GACP,SAAS;GACT,MAAM;EACR;EACA;GACE,OAAO;GACP,SAAS;EACX;CACF;CACA,iBAAiB;EACf,QAAQ;EACR,WAAW;EACX,UAAU;EACV,SAAS;EACT,MAAM;EACN,UAAU;EACV,SAAS;CACX;CACA,UAAU;EACR,QAAQ;GACN,QAAQ;GACR,QAAQ;GACR,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,WAAW;GACT,OAAO;GACP,MAAM;EACR;EACA,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,OAAO;GACP,MAAM;EACR;EACA,MAAM;EACN,UAAU;GACR,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,QAAQ,GAAG,MAAM;GACjB,OAAO,GAAG,IAAI,8BAA8B;GAC5C,MAAM,GAAG,MAAM;GACf,MAAM;GACN,SAAS,GAAG,MAAM;GAClB,WAAW,GAAG,IAAI,iBAAiB,cAAc,OAAO,gGAAgG,UAAU;GAClK,SAAS,GAAG,MAAM;GAClB,SAAS,GAAG,MAAM;EACpB;CACF;AACF,CACF;AAEA,MAAM,iBAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,cAAc,CAAC,MAAM,GAAG,YAAY;AAE1C,MAAM,gBAAgB"}
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../src/recipes/button.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport type { ButtonSize } from '#control'\nimport {\n controlBase,\n controlBox,\n controlGap,\n controlInert,\n controlReach,\n controlSizes,\n hitArea,\n} from '#parts/control'\nimport { defaultTone, tones } from '#parts/tone'\nimport type { Tone } from '#tone'\nimport { toneBlend } from '#tone'\n\nimport { nebulaCloudRecipe, nebulaVeilRecipe } from './nebula'\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst QUIET_HIT = hitArea('after:h-tf-target', 'after:w-tf-target')\n\nconst buttonFace = [\n 'isolate',\n 'justify-center',\n 'whitespace-nowrap',\n 'tracking-tf-tight',\n 'tf-cloud-md',\n]\n\nconst buttonSpinnerRecipe = cva([\n 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2',\n 'tf-arrives motion-reduce:transition-none',\n])\n\nconst buttonWordsRecipe = cva(\n [\n 'inline-flex items-center justify-center tf-text-trim',\n 'tf-crossfades motion-reduce:transition-none',\n 'in-data-loading:opacity-0',\n ],\n {\n defaultVariants: { size: 'md' },\n variants: { size: controlGap },\n },\n)\n\nconst buttonTempo = ['tf-blend-drift', 'tf-weather-trail']\n\nconst buttonGeometry = {\n lg: `${controlBox.lg} rounded-tf-card px-8 font-medium`,\n md: `${controlBox.md} rounded-tf-block px-6`,\n sm: `${controlBox.sm} px-4 ${HIT_AREA}`,\n xs: `${controlBox.xs} px-2 ${QUIET_HIT}`,\n} satisfies Record<ButtonSize, string>\n\ntype ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'ghost'\n | 'danger'\n | 'success'\n | 'warning'\n | 'info'\n | 'link'\ntype ButtonAccent = Tone\n\nconst CLOUD = ['tf-cloud-brand', 'tf-clouded', 'interactive:hovered:tf-clouding'].join(' ')\nconst CLOUD_INK = ['tf-cloud-ink', 'tf-clouded', 'interactive:hovered:tf-clouding'].join(' ')\nconst CLOUD_ON_REACH = [\n 'tf-cloud-ink',\n 'tf-cloud-hidden',\n 'interactive:hovered:tf-clouding',\n 'interactive:hovered:tf-plated',\n].join(' ')\n\nconst BLEND = [\n 'bg-tf-blend',\n CLOUD,\n 'tf-edge-sweep tf-edge-milk tf-swept-top',\n 'tf-glow tf-lit-rest tf-settled',\n 'interactive:hovered:tf-blended',\n 'interactive:hovered:tf-milked',\n 'interactive:hovered:tf-lit-inside',\n 'interactive:hovered:tf-lifted',\n 'interactive:pressed:tf-pressed',\n 'motion-safe:interactive:pressed:tf-tilted',\n].join(' ')\nconst INK = [\n 'tf-ink-glide',\n 'data-loading:bg-none',\n '[&_svg]:tf-transition [&_svg]:text-tf-muted',\n].join(' ')\n\nconst MARK_ON_REACH = {\n accent: 'interactive:hovered:[&_svg]:text-tf-accent-hi',\n danger: 'interactive:hovered:[&_svg]:text-tf-danger-hi',\n info: 'interactive:hovered:[&_svg]:text-tf-info-hi',\n success: 'interactive:hovered:[&_svg]:text-tf-success-hi',\n warning: 'interactive:hovered:[&_svg]:text-tf-warning-hi',\n} satisfies Record<Tone, string>\n\nconst WORDS_ON_REACH = {\n accent: 'interactive:hovered:text-tf-accent-hi',\n danger: 'interactive:hovered:text-tf-danger-hi',\n info: 'interactive:hovered:text-tf-info-hi',\n success: 'interactive:hovered:text-tf-success-hi',\n warning: 'interactive:hovered:text-tf-warning-hi',\n} satisfies Record<Tone, string>\n\nconst FLAT_INK = 'text-tf-muted interactive:hovered:text-tf-fg'\n\nconst buttonPress = [\n 'motion-safe:interactive:pressed:translate-y-px',\n 'motion-reduce:interactive:pressed:brightness-95',\n]\n\nconst buttonRecipe = cva(\n [\n ...controlBase,\n ...buttonFace,\n ...buttonTempo,\n ...controlReach,\n ...buttonPress,\n ...controlInert,\n 'data-loading:opacity-100',\n ],\n {\n compoundVariants: [\n {\n class: 'tf-cloud-tight',\n variant: 'ghost',\n },\n ...tones.map((accent) => ({\n accent,\n class: `${toneBlend[accent]} ${WORDS_ON_REACH[accent]} ${MARK_ON_REACH[accent]}`,\n variant: 'ghost' as const,\n })),\n {\n class: FLAT_INK,\n iconOnly: true,\n variant: 'ghost',\n },\n {\n class: FLAT_INK,\n iconOnly: true,\n variant: 'secondary',\n },\n {\n class: 'px-0',\n iconOnly: true,\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-xs',\n iconOnly: true,\n size: 'xs',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-sm',\n iconOnly: true,\n size: 'sm',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-md',\n iconOnly: true,\n size: 'md',\n },\n {\n class: 'tf-icons-solo [&_svg]:size-tf-icon-solo-lg',\n iconOnly: true,\n size: 'lg',\n },\n {\n class: 'pr-7',\n size: 'lg',\n trailing: true,\n },\n {\n class: 'pr-5',\n size: 'md',\n trailing: true,\n },\n {\n class: 'pr-3',\n size: 'sm',\n trailing: true,\n },\n {\n class: 'pl-7',\n leading: true,\n size: 'lg',\n },\n {\n class: 'pl-5',\n leading: true,\n size: 'md',\n },\n {\n class: 'pl-3',\n leading: true,\n size: 'sm',\n },\n {\n class: 'h-auto w-auto justify-start bg-transparent p-0 shadow-none outline-offset-4',\n variant: 'link',\n },\n ],\n defaultVariants: {\n accent: defaultTone,\n fullWidth: false,\n iconOnly: false,\n leading: false,\n size: 'md',\n trailing: false,\n variant: 'primary',\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n success: '',\n warning: '',\n } satisfies Record<ButtonAccent, string>,\n fullWidth: {\n false: '',\n true: 'w-full',\n },\n iconOnly: {\n false: '',\n true: 'aspect-square',\n },\n leading: {\n false: '',\n true: '',\n },\n size: buttonGeometry,\n trailing: {\n false: '',\n true: '',\n },\n variant: {\n danger: `${BLEND} text-tf-on-semantic blend-tf-danger`,\n ghost: `${INK} text-tf-fg tf-plated-quiet ${CLOUD_ON_REACH}`,\n info: `${BLEND} text-tf-on-semantic blend-tf-info`,\n link: 'text-tf-accent-hi underline underline-offset-2 interactive:hovered:text-tf-accent',\n primary: `${BLEND} text-tf-on-accent blend-tf-accent`,\n secondary: `${INK} text-tf-blend ${MARK_ON_REACH.accent} tf-glow tf-settled-quiet interactive:hovered:tf-blend-hushed interactive:hovered:tf-lit-rest ${CLOUD_INK} tf-blend-outline blend-tf-accent`,\n success: `${BLEND} text-tf-on-semantic blend-tf-success`,\n warning: `${BLEND} text-tf-on-semantic blend-tf-warning`,\n } satisfies Record<ButtonVariant, string>,\n },\n },\n)\n\nconst buttonVariants = [\n 'primary',\n 'secondary',\n 'ghost',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'link',\n] as const satisfies readonly ButtonVariant[]\n\nconst buttonSizes = ['xs', ...controlSizes] as const satisfies readonly ButtonSize[]\n\nconst buttonAccents = tones\n\nconst buttonAnatomy = anatomy({\n cloud: { part: 'cloud', recipe: nebulaCloudRecipe, required: false },\n nebula: { part: 'nebula', recipe: nebulaVeilRecipe, required: false },\n root: { part: 'button', recipe: buttonRecipe, required: true },\n spinner: { part: 'spinner', recipe: buttonSpinnerRecipe, required: false },\n words: { part: 'words', recipe: buttonWordsRecipe, required: false },\n})\n\nexport {\n type ButtonAccent,\n type ButtonVariant,\n buttonAccents,\n buttonAnatomy,\n buttonRecipe,\n buttonSizes,\n buttonSpinnerRecipe,\n buttonVariants,\n buttonWordsRecipe,\n}\n"],"mappings":";;;;;;;AAmBA,MAAM,WAAW,QAAQ,mBAAmB;AAE5C,MAAM,YAAY,QAAQ,qBAAqB,mBAAmB;AAElE,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,sBAAsB,IAAI,CAC9B,+DACA,0CACF,CAAC;AAED,MAAM,oBAAoB,IACxB;CACE;CACA;CACA;AACF,GACA;CACE,iBAAiB,EAAE,MAAM,KAAK;CAC9B,UAAU,EAAE,MAAM,WAAW;AAC/B,CACF;AAEA,MAAM,cAAc,CAAC,kBAAkB,kBAAkB;AAEzD,MAAM,iBAAiB;CACrB,IAAI,GAAG,WAAW,GAAG;CACrB,IAAI,GAAG,WAAW,GAAG;CACrB,IAAI,GAAG,WAAW,GAAG,QAAQ;CAC7B,IAAI,GAAG,WAAW,G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QAAQ;EAAmB,UAAU;CAAM;AACrE,CAAC"}
@@ -5,6 +5,23 @@ declare const cardHeaderRanks: readonly ["card", "module"];
5
5
  declare const cardHeaderRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
6
  declare const cardHeaderStackRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
7
  declare const cardHeaderActionRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ declare const cardHeaderAnatomy: {
9
+ readonly action: {
10
+ readonly part: "action";
11
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ readonly required: false;
13
+ };
14
+ readonly root: {
15
+ readonly part: "card-header";
16
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
17
+ readonly required: true;
18
+ };
19
+ readonly stack: {
20
+ readonly part: "stack";
21
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
22
+ readonly required: true;
23
+ };
24
+ };
8
25
  //#endregion
9
- export { type CardHeaderRank, cardHeaderActionRecipe, cardHeaderRanks, cardHeaderRecipe, cardHeaderStackRecipe, defaultCardHeaderRank };
26
+ export { type CardHeaderRank, cardHeaderActionRecipe, cardHeaderAnatomy, cardHeaderRanks, cardHeaderRecipe, cardHeaderStackRecipe, defaultCardHeaderRank };
10
27
  //# sourceMappingURL=cardHeader.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { cva } from "class-variance-authority";
2
3
  //#region src/recipes/cardHeader.ts
3
4
  const defaultCardHeaderRank = "card";
@@ -5,7 +6,24 @@ const cardHeaderRanks = ["card", "module"];
5
6
  const cardHeaderRecipe = cva("flex min-w-0 items-center gap-4");
6
7
  const cardHeaderStackRecipe = cva("flex min-w-0 flex-col gap-0");
7
8
  const cardHeaderActionRecipe = cva("ml-auto flex-none");
9
+ const cardHeaderAnatomy = anatomy({
10
+ action: {
11
+ part: "action",
12
+ recipe: cardHeaderActionRecipe,
13
+ required: false
14
+ },
15
+ root: {
16
+ part: "card-header",
17
+ recipe: cardHeaderRecipe,
18
+ required: true
19
+ },
20
+ stack: {
21
+ part: "stack",
22
+ recipe: cardHeaderStackRecipe,
23
+ required: true
24
+ }
25
+ });
8
26
  //#endregion
9
- export { cardHeaderActionRecipe, cardHeaderRanks, cardHeaderRecipe, cardHeaderStackRecipe, defaultCardHeaderRank };
27
+ export { cardHeaderActionRecipe, cardHeaderAnatomy, cardHeaderRanks, cardHeaderRecipe, cardHeaderStackRecipe, defaultCardHeaderRank };
10
28
 
11
29
  //# sourceMappingURL=cardHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cardHeader.js","names":[],"sources":["../../src/recipes/cardHeader.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\ntype CardHeaderRank = 'card' | 'module'\n\nconst defaultCardHeaderRank = 'card' satisfies CardHeaderRank\n\nconst cardHeaderRanks = ['card', 'module'] as const satisfies readonly CardHeaderRank[]\n\nconst cardHeaderRecipe = cva('flex min-w-0 items-center gap-4')\n\nconst cardHeaderStackRecipe = cva('flex min-w-0 flex-col gap-0')\n\nconst cardHeaderActionRecipe = cva('ml-auto flex-none')\n\nexport {\n type CardHeaderRank,\n cardHeaderActionRecipe,\n cardHeaderRanks,\n cardHeaderRecipe,\n cardHeaderStackRecipe,\n defaultCardHeaderRank,\n}\n"],"mappings":";;AAIA,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB,CAAC,QAAQ,QAAQ;AAEzC,MAAM,mBAAmB,IAAI,iCAAiC;AAE9D,MAAM,wBAAwB,IAAI,6BAA6B;AAE/D,MAAM,yBAAyB,IAAI,mBAAmB"}
1
+ {"version":3,"file":"cardHeader.js","names":[],"sources":["../../src/recipes/cardHeader.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\ntype CardHeaderRank = 'card' | 'module'\n\nconst defaultCardHeaderRank = 'card' satisfies CardHeaderRank\n\nconst cardHeaderRanks = ['card', 'module'] as const satisfies readonly CardHeaderRank[]\n\nconst cardHeaderRecipe = cva('flex min-w-0 items-center gap-4')\n\nconst cardHeaderStackRecipe = cva('flex min-w-0 flex-col gap-0')\n\nconst cardHeaderActionRecipe = cva('ml-auto flex-none')\n\nconst cardHeaderAnatomy = anatomy({\n action: { part: 'action', recipe: cardHeaderActionRecipe, required: false },\n root: { part: 'card-header', recipe: cardHeaderRecipe, required: true },\n stack: { part: 'stack', recipe: cardHeaderStackRecipe, required: true },\n})\n\nexport {\n type CardHeaderRank,\n cardHeaderActionRecipe,\n cardHeaderAnatomy,\n cardHeaderRanks,\n cardHeaderRecipe,\n cardHeaderStackRecipe,\n defaultCardHeaderRank,\n}\n"],"mappings":";;;AAMA,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB,CAAC,QAAQ,QAAQ;AAEzC,MAAM,mBAAmB,IAAI,iCAAiC;AAE9D,MAAM,wBAAwB,IAAI,6BAA6B;AAE/D,MAAM,yBAAyB,IAAI,mBAAmB;AAEtD,MAAM,oBAAoB,QAAQ;CAChC,QAAQ;EAAE,MAAM;EAAU,QAAQ;EAAwB,UAAU;CAAM;CAC1E,MAAM;EAAE,MAAM;EAAe,QAAQ;EAAkB,UAAU;CAAK;CACtE,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAuB,UAAU;CAAK;AACxE,CAAC"}
@@ -21,6 +21,21 @@ declare const checkboxTitleRecipe: (props?: import("class-variance-authority/typ
21
21
  declare const checkboxHintRecipe: (props?: ({
22
22
  invalid?: boolean | null | undefined;
23
23
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
+ declare const checkboxAnatomy: {
25
+ readonly dash: {
26
+ readonly part: "dash";
27
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
28
+ readonly required: true;
29
+ };
30
+ readonly root: {
31
+ readonly part: "checkbox";
32
+ readonly recipe: (props?: ({
33
+ labelled?: boolean | null | undefined;
34
+ plate?: "full" | "snug" | "bare" | null | undefined;
35
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
36
+ readonly required: true;
37
+ };
38
+ };
24
39
  //#endregion
25
- export { type CheckboxAccent, checkboxAccents, checkboxControlRecipe, checkboxDashRecipe, checkboxHintRecipe, checkboxIndicatorRecipe, checkboxLabelRecipe, checkboxMarkRecipe, checkboxRecipe, checkboxTitleRecipe, defaultCheckboxAccent };
40
+ export { type CheckboxAccent, checkboxAccents, checkboxAnatomy, checkboxControlRecipe, checkboxDashRecipe, checkboxHintRecipe, checkboxIndicatorRecipe, checkboxLabelRecipe, checkboxMarkRecipe, checkboxRecipe, checkboxTitleRecipe, defaultCheckboxAccent };
26
41
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1,6 +1,7 @@
1
- import { defaultMarkPlate, markPlates } from "../mark.js";
2
- import { toneBlend } from "../tone.js";
1
+ import { anatomy } from "../anatomy.js";
3
2
  import { defaultTone, tones } from "../parts/tone.js";
3
+ import { toneBlend } from "../tone.js";
4
+ import { defaultMarkPlate, markPlates } from "../mark.js";
4
5
  import { markBox, markFailed, markPlate, markPlated, markPress, markRow, markSquare, markStack, markTitle } from "../parts/mark.js";
5
6
  import { cva } from "class-variance-authority";
6
7
  //#region src/recipes/checkbox.ts
@@ -97,7 +98,19 @@ const checkboxHintRecipe = cva("text-tf-caption font-medium", {
97
98
  true: "text-tf-danger-hi tf-arrives"
98
99
  } }
99
100
  });
101
+ const checkboxAnatomy = anatomy({
102
+ dash: {
103
+ part: "dash",
104
+ recipe: checkboxDashRecipe,
105
+ required: true
106
+ },
107
+ root: {
108
+ part: "checkbox",
109
+ recipe: checkboxRecipe,
110
+ required: true
111
+ }
112
+ });
100
113
  //#endregion
101
- export { checkboxAccents, checkboxControlRecipe, checkboxDashRecipe, checkboxHintRecipe, checkboxIndicatorRecipe, checkboxLabelRecipe, checkboxMarkRecipe, checkboxRecipe, checkboxTitleRecipe, defaultCheckboxAccent };
114
+ export { checkboxAccents, checkboxAnatomy, checkboxControlRecipe, checkboxDashRecipe, checkboxHintRecipe, checkboxIndicatorRecipe, checkboxLabelRecipe, checkboxMarkRecipe, checkboxRecipe, checkboxTitleRecipe, defaultCheckboxAccent };
102
115
 
103
116
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":[],"sources":["../../src/recipes/checkbox.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport type { MarkPlate } from '#mark'\nimport { defaultMarkPlate, markPlates } from '#mark'\nimport {\n markBox,\n markFailed,\n markPlate,\n markPlated,\n markPress,\n markRow,\n markSquare,\n markStack,\n markTitle,\n} from '#parts/mark'\nimport { defaultTone, tones } from '#parts/tone'\nimport type { Tone } from '#tone'\nimport { toneBlend } from '#tone'\n\nconst checkboxAccents = tones\n\ntype CheckboxAccent = Tone\n\nconst defaultCheckboxAccent = defaultTone\n\nconst FILL = ['bg-tf-sunken', 'tf-ramp']\n\nconst OFF = ['data-[state=unchecked]:interactive:not-data-readonly:hovered:bg-tf-sunken-hi']\n\nconst ON = [\n 'data-[state=checked]:tf-mark-lit',\n 'data-[state=checked]:bg-tf-blend',\n 'data-[state=checked]:text-tf-on-accent',\n 'data-[state=checked]:tf-icons-solo',\n 'data-[state=checked]:interactive:not-data-readonly:hovered:tf-blended',\n]\n\nconst MIXED = [\n 'data-[state=indeterminate]:tf-mark-lit',\n 'data-[state=indeterminate]:bg-tf-blend',\n 'data-[state=indeterminate]:text-tf-on-accent',\n 'data-[state=indeterminate]:interactive:not-data-readonly:hovered:tf-blended',\n]\n\nconst GAPS = { bare: 'gap-2', full: 'gap-3', snug: 'gap-2' } satisfies Record<MarkPlate, string>\n\nconst platedRows = markPlates.map((plate) => ({\n class: `${GAPS[plate]} ${markPlate[plate]} ${markPlated[plate]}`,\n labelled: true,\n plate,\n}))\n\nconst platedSquares = markPlates.map((plate) => ({\n class: `${markSquare[plate]} ${markPlated[plate]}`,\n labelled: false,\n plate,\n}))\n\nconst checkboxRecipe = cva(markRow, {\n compoundVariants: [...platedRows, ...platedSquares],\n defaultVariants: { labelled: true, plate: defaultMarkPlate },\n variants: {\n labelled: { false: '', true: '' },\n plate: { bare: '', full: '', snug: '' } satisfies Record<MarkPlate, string>,\n },\n})\n\nconst checkboxControlRecipe = cva(\n [...markBox, 'rounded-tf-inline', markPress, ...FILL, ...OFF, ...ON, ...MIXED],\n {\n compoundVariants: [{ class: toneBlend.danger, invalid: true }],\n defaultVariants: { accent: defaultCheckboxAccent, invalid: false },\n variants: {\n accent: toneBlend,\n invalid: { false: '', true: markFailed },\n },\n },\n)\n\nconst checkboxIndicatorRecipe = cva('inline-flex tf-mark-draws items-center justify-center')\n\nconst checkboxMarkRecipe = cva('size-tf-mark-glyph')\n\nconst checkboxDashRecipe = cva([\n 'block h-[calc(var(--spacing-tf-hairline)*2)] w-tf-mark-dot rounded-tf-pill',\n 'bg-tf-on-accent',\n])\n\nconst checkboxLabelRecipe = cva([...markStack, 'flex-1'], {\n defaultVariants: { hidden: false },\n variants: {\n hidden: { false: '', true: 'sr-only' },\n },\n})\n\nconst checkboxTitleRecipe = cva(markTitle)\n\nconst checkboxHintRecipe = cva('text-tf-caption font-medium', {\n defaultVariants: { invalid: false },\n variants: {\n invalid: { false: 'text-tf-muted', true: 'text-tf-danger-hi tf-arrives' },\n },\n})\n\nexport {\n type CheckboxAccent,\n checkboxAccents,\n checkboxControlRecipe,\n checkboxDashRecipe,\n checkboxHintRecipe,\n checkboxIndicatorRecipe,\n checkboxLabelRecipe,\n checkboxMarkRecipe,\n checkboxRecipe,\n checkboxTitleRecipe,\n defaultCheckboxAccent,\n}\n"],"mappings":";;;;;;AAmBA,MAAM,kBAAkB;AAIxB,MAAM,wBAAwB;AAE9B,MAAM,OAAO,CAAC,gBAAgB,SAAS;AAEvC,MAAM,MAAM,CAAC,8EAA8E;AAE3F,MAAM,KAAK;CACT;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAQ;CACZ;CACA;CACA;CACA;AACF;AAEA,MAAM,OAAO;CAAE,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AS;EAAE,OAAO;EAAiB,MAAM;CAA+B,EAC1E;AACF,CAAC"}
1
+ {"version":3,"file":"checkbox.js","names":[],"sources":["../../src/recipes/checkbox.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport type { MarkPlate } from '#mark'\nimport { defaultMarkPlate, markPlates } from '#mark'\nimport {\n markBox,\n markFailed,\n markPlate,\n markPlated,\n markPress,\n markRow,\n markSquare,\n markStack,\n markTitle,\n} from '#parts/mark'\nimport { defaultTone, tones } from '#parts/tone'\nimport type { Tone } from '#tone'\nimport { toneBlend } from '#tone'\n\nconst checkboxAccents = tones\n\ntype CheckboxAccent = Tone\n\nconst defaultCheckboxAccent = defaultTone\n\nconst FILL = ['bg-tf-sunken', 'tf-ramp']\n\nconst OFF = ['data-[state=unchecked]:interactive:not-data-readonly:hovered:bg-tf-sunken-hi']\n\nconst ON = [\n 'data-[state=checked]:tf-mark-lit',\n 'data-[state=checked]:bg-tf-blend',\n 'data-[state=checked]:text-tf-on-accent',\n 'data-[state=checked]:tf-icons-solo',\n 'data-[state=checked]:interactive:not-data-readonly:hovered:tf-blended',\n]\n\nconst MIXED = [\n 'data-[state=indeterminate]:tf-mark-lit',\n 'data-[state=indeterminate]:bg-tf-blend',\n 'data-[state=indeterminate]:text-tf-on-accent',\n 'data-[state=indeterminate]:interactive:not-data-readonly:hovered:tf-blended',\n]\n\nconst GAPS = { bare: 'gap-2', full: 'gap-3', snug: 'gap-2' } satisfies Record<MarkPlate, string>\n\nconst platedRows = markPlates.map((plate) => ({\n class: `${GAPS[plate]} ${markPlate[plate]} ${markPlated[plate]}`,\n labelled: true,\n plate,\n}))\n\nconst platedSquares = markPlates.map((plate) => ({\n class: `${markSquare[plate]} ${markPlated[plate]}`,\n labelled: false,\n plate,\n}))\n\nconst checkboxRecipe = cva(markRow, {\n compoundVariants: [...platedRows, ...platedSquares],\n defaultVariants: { labelled: true, plate: defaultMarkPlate },\n variants: {\n labelled: { false: '', true: '' },\n plate: { bare: '', full: '', snug: '' } satisfies Record<MarkPlate, string>,\n },\n})\n\nconst checkboxControlRecipe = cva(\n [...markBox, 'rounded-tf-inline', markPress, ...FILL, ...OFF, ...ON, ...MIXED],\n {\n compoundVariants: [{ class: toneBlend.danger, invalid: true }],\n defaultVariants: { accent: defaultCheckboxAccent, invalid: false },\n variants: {\n accent: toneBlend,\n invalid: { false: '', true: markFailed },\n },\n },\n)\n\nconst checkboxIndicatorRecipe = cva('inline-flex tf-mark-draws items-center justify-center')\n\nconst checkboxMarkRecipe = cva('size-tf-mark-glyph')\n\nconst checkboxDashRecipe = cva([\n 'block h-[calc(var(--spacing-tf-hairline)*2)] w-tf-mark-dot rounded-tf-pill',\n 'bg-tf-on-accent',\n])\n\nconst checkboxLabelRecipe = cva([...markStack, 'flex-1'], {\n defaultVariants: { hidden: false },\n variants: {\n hidden: { false: '', true: 'sr-only' },\n },\n})\n\nconst checkboxTitleRecipe = cva(markTitle)\n\nconst checkboxHintRecipe = cva('text-tf-caption font-medium', {\n defaultVariants: { invalid: false },\n variants: {\n invalid: { false: 'text-tf-muted', true: 'text-tf-danger-hi tf-arrives' },\n },\n})\n\nconst checkboxAnatomy = anatomy({\n dash: { part: 'dash', recipe: checkboxDashRecipe, required: true },\n root: { part: 'checkbox', recipe: checkboxRecipe, required: true },\n})\n\nexport {\n type CheckboxAccent,\n checkboxAccents,\n checkboxAnatomy,\n checkboxControlRecipe,\n checkboxDashRecipe,\n checkboxHintRecipe,\n checkboxIndicatorRecipe,\n checkboxLabelRecipe,\n checkboxMarkRecipe,\n checkboxRecipe,\n checkboxTitleRecipe,\n defaultCheckboxAccent,\n}\n"],"mappings":";;;;;;;AAoBA,MAAM,kBAAkB;AAIxB,MAAM,wBAAwB;AAE9B,MAAM,OAAO,CAAC,gBAAgB,SAAS;AAEvC,MAAM,MAAM,CAAC,8EAA8E;AAE3F,MAAM,KAAK;CACT;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAQ;CAC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,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EAAE,OAAO;EAAiB,MAAM;CAA+B,EAC1E;AACF,CAAC;AAED,MAAM,kBAAkB,QAAQ;CAC9B,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAoB,UAAU;CAAK;CACjE,MAAM;EAAE,MAAM;EAAY,QAAQ;EAAgB,UAAU;CAAK;AACnE,CAAC"}
@@ -12,7 +12,7 @@ declare const chipRecipe: (props?: ({
12
12
  accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
13
13
  removable?: boolean | null | undefined;
14
14
  size?: "sm" | "md" | null | undefined;
15
- tone?: "quiet" | "outline" | "tint" | null | undefined;
15
+ tone?: "tint" | "outline" | "quiet" | null | undefined;
16
16
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
17
  declare const chipDotRecipe: (props?: ({
18
18
  accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
@@ -21,6 +21,45 @@ declare const chipTextRecipe: (props?: import("class-variance-authority/types").
21
21
  declare const chipLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
22
22
  declare const chipCountRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
23
23
  declare const chipCloseRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
24
+ declare const chipAnatomy: {
25
+ readonly close: {
26
+ readonly part: "close";
27
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
28
+ readonly required: false;
29
+ };
30
+ readonly count: {
31
+ readonly part: "count";
32
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
33
+ readonly required: false;
34
+ };
35
+ readonly dot: {
36
+ readonly part: "dot";
37
+ readonly recipe: (props?: ({
38
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
39
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
40
+ readonly required: false;
41
+ };
42
+ readonly label: {
43
+ readonly part: "label";
44
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
45
+ readonly required: true;
46
+ };
47
+ readonly root: {
48
+ readonly part: "chip";
49
+ readonly recipe: (props?: ({
50
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | "neutral" | null | undefined;
51
+ removable?: boolean | null | undefined;
52
+ size?: "sm" | "md" | null | undefined;
53
+ tone?: "tint" | "outline" | "quiet" | null | undefined;
54
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
+ readonly required: true;
56
+ };
57
+ readonly text: {
58
+ readonly part: "text";
59
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
60
+ readonly required: true;
61
+ };
62
+ };
24
63
  //#endregion
25
- export { type ChipAccent, type ChipSize, type ChipTone, chipAccents, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
64
+ export { type ChipAccent, type ChipSize, type ChipTone, chipAccents, chipAnatomy, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
26
65
  //# sourceMappingURL=chip.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { controlPress, controlReach, hitArea } from "../parts/control.js";
2
3
  import { cva } from "class-variance-authority";
3
4
  //#region src/recipes/chip.ts
@@ -117,7 +118,39 @@ const chipCloseRecipe = cva([
117
118
  ...controlPress,
118
119
  ...CLOSE_HELD
119
120
  ]);
121
+ const chipAnatomy = anatomy({
122
+ close: {
123
+ part: "close",
124
+ recipe: chipCloseRecipe,
125
+ required: false
126
+ },
127
+ count: {
128
+ part: "count",
129
+ recipe: chipCountRecipe,
130
+ required: false
131
+ },
132
+ dot: {
133
+ part: "dot",
134
+ recipe: chipDotRecipe,
135
+ required: false
136
+ },
137
+ label: {
138
+ part: "label",
139
+ recipe: chipLabelRecipe,
140
+ required: true
141
+ },
142
+ root: {
143
+ part: "chip",
144
+ recipe: chipRecipe,
145
+ required: true
146
+ },
147
+ text: {
148
+ part: "text",
149
+ recipe: chipTextRecipe,
150
+ required: true
151
+ }
152
+ });
120
153
  //#endregion
121
- export { chipAccents, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
154
+ export { chipAccents, chipAnatomy, chipCloseRecipe, chipCountRecipe, chipDotRecipe, chipLabelRecipe, chipRecipe, chipSizes, chipTextRecipe, chipTones, defaultChipAccent, defaultChipSize, defaultChipTone };
122
155
 
123
156
  //# sourceMappingURL=chip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","names":[],"sources":["../../src/recipes/chip.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlPress, controlReach, hitArea } from '#parts/control'\n\ntype ChipTone = 'quiet' | 'outline' | 'tint'\n\ntype ChipSize = 'sm' | 'md'\n\ntype ChipAccent = 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'\n\nconst defaultChipTone = 'quiet' satisfies ChipTone\n\nconst defaultChipSize = 'md' satisfies ChipSize\n\nconst defaultChipAccent = 'neutral' satisfies ChipAccent\n\nconst chipTones = ['quiet', 'outline', 'tint'] as const satisfies readonly ChipTone[]\n\nconst chipSizes = ['sm', 'md'] as const satisfies readonly ChipSize[]\n\nconst chipAccents = [\n 'neutral',\n 'accent',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const satisfies readonly ChipAccent[]\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst TINT = {\n accent: 'bg-tf-accent-tint text-tf-accent-hi [--tf-mark-rest:var(--color-tf-accent-edge)]',\n danger: 'bg-tf-danger-tint text-tf-danger-hi [--tf-mark-rest:var(--color-tf-danger-edge)]',\n info: 'bg-tf-info-tint text-tf-info-hi [--tf-mark-rest:var(--color-tf-info-edge)]',\n neutral: 'bg-tf-panel text-tf-fg',\n success: 'bg-tf-success-tint text-tf-success-hi [--tf-mark-rest:var(--color-tf-success-edge)]',\n warning: 'bg-tf-warning-tint text-tf-warning-hi [--tf-mark-rest:var(--color-tf-warning-edge)]',\n} satisfies Record<ChipAccent, string>\n\nconst OUTLINE = {\n accent: 'text-tf-accent-hi blend-tf-accent',\n danger: 'text-tf-danger-hi blend-tf-danger',\n info: 'text-tf-info-hi blend-tf-info',\n neutral: 'text-tf-fg blend-tf-accent',\n success: 'text-tf-success-hi blend-tf-success',\n warning: 'text-tf-warning-hi blend-tf-warning',\n} satisfies Record<ChipAccent, string>\n\nconst LEAVES = [\n 'motion-safe:tf-chip-arrives',\n 'data-[state=closed]:overflow-hidden',\n 'data-[state=closed]:**:data-[part=label]:flex-none',\n 'data-[state=closed]:motion-safe:tf-chip-departs',\n 'motion-reduce:animate-none',\n].join(' ')\n\nconst chipRecipe = cva(\n [\n 'relative isolate inline-flex max-w-full min-w-0 flex-none items-center rounded-tf-pill',\n 'font-tf-body font-medium whitespace-nowrap',\n 'tf-icons [&>svg]:shrink-0',\n 'data-disabled:opacity-50',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n ...chipAccents.map((accent) => ({ accent, class: TINT[accent], tone: 'tint' as const })),\n ...chipAccents.map((accent) => ({\n accent,\n class: OUTLINE[accent],\n tone: 'outline' as const,\n })),\n ],\n defaultVariants: {\n accent: defaultChipAccent,\n removable: false,\n size: defaultChipSize,\n tone: defaultChipTone,\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n neutral: '',\n success: '',\n warning: '',\n } satisfies Record<ChipAccent, string>,\n removable: { false: '', true: LEAVES },\n size: {\n md: 'h-tf-row gap-2 px-3 text-tf-body-sm [&>svg]:size-tf-icon-sm',\n sm: 'h-tf-chip-sm gap-1.5 px-2 text-tf-caption-sm [&>svg]:size-tf-icon-2xs',\n } satisfies Record<ChipSize, string>,\n tone: {\n outline: 'tf-blend-outline',\n quiet: 'bg-tf-panel text-tf-fg tf-mark-edge',\n tint: 'tf-mark-edge **:data-[part=count]:text-current',\n } satisfies Record<ChipTone, string>,\n },\n },\n)\n\nconst chipDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { accent: defaultChipAccent },\n variants: {\n accent: {\n accent: 'bg-tf-accent-hi',\n danger: 'bg-tf-danger-hi',\n info: 'bg-tf-info-hi',\n neutral: 'bg-tf-muted',\n success: 'bg-tf-success-hi',\n warning: 'bg-tf-warning-hi',\n } satisfies Record<ChipAccent, string>,\n },\n})\n\nconst chipTextRecipe = cva('flex min-w-0 items-baseline gap-[inherit]')\n\nconst chipLabelRecipe = cva('min-w-0 truncate')\n\nconst chipCountRecipe = cva('flex-none font-mono text-tf-caption-sm text-tf-muted tabular-nums')\n\nconst CLOSE_HELD = [\n 'disabled:cursor-not-allowed',\n 'aria-disabled:cursor-not-allowed',\n 'data-disabled:cursor-not-allowed',\n]\n\nconst chipCloseRecipe = cva([\n 'relative inline-flex size-tf-icon-md flex-none items-center justify-center rounded-tf-pill',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'text-tf-muted interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n HIT_AREA,\n ...controlReach,\n ...controlPress,\n ...CLOSE_HELD,\n])\n\nexport {\n type ChipAccent,\n type ChipSize,\n type ChipTone,\n chipAccents,\n chipCloseRecipe,\n chipCountRecipe,\n chipDotRecipe,\n chipLabelRecipe,\n chipRecipe,\n chipSizes,\n chipTextRecipe,\n chipTones,\n defaultChipAccent,\n defaultChipSize,\n defaultChipTone,\n}\n"],"mappings":";;;AAUA,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;CAAC;CAAS;CAAW;AAAM;AAE7C,MAAM,YAAY,CAAC,MAAM,IAAI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AAI;CAC1B;CACA;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,CAAC"}
1
+ {"version":3,"file":"chip.js","names":[],"sources":["../../src/recipes/chip.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\nimport { controlPress, controlReach, hitArea } from '#parts/control'\n\ntype ChipTone = 'quiet' | 'outline' | 'tint'\n\ntype ChipSize = 'sm' | 'md'\n\ntype ChipAccent = 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'\n\nconst defaultChipTone = 'quiet' satisfies ChipTone\n\nconst defaultChipSize = 'md' satisfies ChipSize\n\nconst defaultChipAccent = 'neutral' satisfies ChipAccent\n\nconst chipTones = ['quiet', 'outline', 'tint'] as const satisfies readonly ChipTone[]\n\nconst chipSizes = ['sm', 'md'] as const satisfies readonly ChipSize[]\n\nconst chipAccents = [\n 'neutral',\n 'accent',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const satisfies readonly ChipAccent[]\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst TINT = {\n accent: 'bg-tf-accent-tint text-tf-accent-hi [--tf-mark-rest:var(--color-tf-accent-edge)]',\n danger: 'bg-tf-danger-tint text-tf-danger-hi [--tf-mark-rest:var(--color-tf-danger-edge)]',\n info: 'bg-tf-info-tint text-tf-info-hi [--tf-mark-rest:var(--color-tf-info-edge)]',\n neutral: 'bg-tf-panel text-tf-fg',\n success: 'bg-tf-success-tint text-tf-success-hi [--tf-mark-rest:var(--color-tf-success-edge)]',\n warning: 'bg-tf-warning-tint text-tf-warning-hi [--tf-mark-rest:var(--color-tf-warning-edge)]',\n} satisfies Record<ChipAccent, string>\n\nconst OUTLINE = {\n accent: 'text-tf-accent-hi blend-tf-accent',\n danger: 'text-tf-danger-hi blend-tf-danger',\n info: 'text-tf-info-hi blend-tf-info',\n neutral: 'text-tf-fg blend-tf-accent',\n success: 'text-tf-success-hi blend-tf-success',\n warning: 'text-tf-warning-hi blend-tf-warning',\n} satisfies Record<ChipAccent, string>\n\nconst LEAVES = [\n 'motion-safe:tf-chip-arrives',\n 'data-[state=closed]:overflow-hidden',\n 'data-[state=closed]:**:data-[part=label]:flex-none',\n 'data-[state=closed]:motion-safe:tf-chip-departs',\n 'motion-reduce:animate-none',\n].join(' ')\n\nconst chipRecipe = cva(\n [\n 'relative isolate inline-flex max-w-full min-w-0 flex-none items-center rounded-tf-pill',\n 'font-tf-body font-medium whitespace-nowrap',\n 'tf-icons [&>svg]:shrink-0',\n 'data-disabled:opacity-50',\n 'tf-transition motion-reduce:transition-none',\n ],\n {\n compoundVariants: [\n ...chipAccents.map((accent) => ({ accent, class: TINT[accent], tone: 'tint' as const })),\n ...chipAccents.map((accent) => ({\n accent,\n class: OUTLINE[accent],\n tone: 'outline' as const,\n })),\n ],\n defaultVariants: {\n accent: defaultChipAccent,\n removable: false,\n size: defaultChipSize,\n tone: defaultChipTone,\n },\n variants: {\n accent: {\n accent: '',\n danger: '',\n info: '',\n neutral: '',\n success: '',\n warning: '',\n } satisfies Record<ChipAccent, string>,\n removable: { false: '', true: LEAVES },\n size: {\n md: 'h-tf-row gap-2 px-3 text-tf-body-sm [&>svg]:size-tf-icon-sm',\n sm: 'h-tf-chip-sm gap-1.5 px-2 text-tf-caption-sm [&>svg]:size-tf-icon-2xs',\n } satisfies Record<ChipSize, string>,\n tone: {\n outline: 'tf-blend-outline',\n quiet: 'bg-tf-panel text-tf-fg tf-mark-edge',\n tint: 'tf-mark-edge **:data-[part=count]:text-current',\n } satisfies Record<ChipTone, string>,\n },\n },\n)\n\nconst chipDotRecipe = cva('size-2 flex-none rounded-tf-pill', {\n defaultVariants: { accent: defaultChipAccent },\n variants: {\n accent: {\n accent: 'bg-tf-accent-hi',\n danger: 'bg-tf-danger-hi',\n info: 'bg-tf-info-hi',\n neutral: 'bg-tf-muted',\n success: 'bg-tf-success-hi',\n warning: 'bg-tf-warning-hi',\n } satisfies Record<ChipAccent, string>,\n },\n})\n\nconst chipTextRecipe = cva('flex min-w-0 items-baseline gap-[inherit]')\n\nconst chipLabelRecipe = cva('min-w-0 truncate')\n\nconst chipCountRecipe = cva('flex-none font-mono text-tf-caption-sm text-tf-muted tabular-nums')\n\nconst CLOSE_HELD = [\n 'disabled:cursor-not-allowed',\n 'aria-disabled:cursor-not-allowed',\n 'data-disabled:cursor-not-allowed',\n]\n\nconst chipCloseRecipe = cva([\n 'relative inline-flex size-tf-icon-md flex-none items-center justify-center rounded-tf-pill',\n '[&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'text-tf-muted interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n HIT_AREA,\n ...controlReach,\n ...controlPress,\n ...CLOSE_HELD,\n])\n\nconst chipAnatomy = anatomy({\n close: { part: 'close', recipe: chipCloseRecipe, required: false },\n count: { part: 'count', recipe: chipCountRecipe, required: false },\n dot: { part: 'dot', recipe: chipDotRecipe, required: false },\n label: { part: 'label', recipe: chipLabelRecipe, required: true },\n root: { part: 'chip', recipe: chipRecipe, required: true },\n text: { part: 'text', recipe: chipTextRecipe, required: true },\n})\n\nexport {\n type ChipAccent,\n type ChipSize,\n type ChipTone,\n chipAccents,\n chipAnatomy,\n chipCloseRecipe,\n chipCountRecipe,\n chipDotRecipe,\n chipLabelRecipe,\n chipRecipe,\n chipSizes,\n chipTextRecipe,\n chipTones,\n defaultChipAccent,\n defaultChipSize,\n defaultChipTone,\n}\n"],"mappings":";;;;AAWA,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,oBAAoB;AAE1B,MAAM,YAAY;CAAC;CAAS;CAAW;AAAM;AAE7C,MAAM,YAAY,CAAC,MAAM,IAAI;AAE7B,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,WAAW,QAAQ,mBAAmB;AAE5C,MAAM,OAAO;CACX,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,SAAS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AM;CACjE,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAM;CACjE,KAAK;EAAE,MAAM;EAAO,QAAQ;EAAe,UAAU;CAAM;CAC3D,OAAO;EAAE,MAAM;EAAS,QAAQ;EAAiB,UAAU;CAAK;CAChE,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAY,UAAU;CAAK;CACzD,MAAM;EAAE,MAAM;EAAQ,QAAQ;EAAgB,UAAU;CAAK;AAC/D,CAAC"}
@@ -69,6 +69,13 @@ declare const codeSyntaxColors: {
69
69
  punctuation: string;
70
70
  text: string;
71
71
  };
72
+ declare const codeEditorAnatomy: {
73
+ readonly root: {
74
+ readonly part: "code-editor";
75
+ readonly recipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
76
+ readonly required: true;
77
+ };
78
+ };
72
79
  //#endregion
73
- export { codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
80
+ export { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
74
81
  //# sourceMappingURL=codeEditor.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { anatomy } from "../anatomy.js";
1
2
  import { cva } from "class-variance-authority";
2
3
  //#region src/recipes/codeEditor.ts
3
4
  const PAD = "calc(var(--spacing) * 4)";
@@ -65,7 +66,12 @@ const codeSyntaxColors = {
65
66
  punctuation: "var(--color-tf-muted)",
66
67
  text: "var(--color-tf-success-hi)"
67
68
  };
69
+ const codeEditorAnatomy = anatomy({ root: {
70
+ part: "code-editor",
71
+ recipe: codeEditorRecipe,
72
+ required: true
73
+ } });
68
74
  //#endregion
69
- export { codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
75
+ export { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors };
70
76
 
71
77
  //# sourceMappingURL=codeEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codeEditor.js","names":[],"sources":["../../src/recipes/codeEditor.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst PAD = 'calc(var(--spacing) * 4)'\n\nconst LIFT = 'var(--color-tf-panel-2)'\n\nconst LEADING = 'var(--text-tf-caption-sm--line-height)'\n\nconst codeEditorRecipe = cva([\n 'relative isolate w-full overflow-hidden rounded-tf-control',\n 'empty:min-h-(--tf-code-height)',\n 'bg-tf-sunken font-tf-body blend-tf-accent',\n 'tf-edge-sweep tf-edge-plain reached:tf-edge-lit',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst codeEditorTheme = {\n '&': {\n backgroundColor: 'transparent',\n color: 'var(--color-tf-fg)',\n fontSize: 'var(--text-tf-caption-sm)',\n lineHeight: LEADING,\n maxHeight: 'var(--tf-code-height)',\n },\n '&.cm-focused': { outline: 'none' },\n '&:not(.cm-focused) .cm-activeLine': { backgroundColor: 'transparent' },\n '&:not(.cm-focused) .cm-activeLineGutter': {\n backgroundColor: 'transparent',\n color: 'inherit',\n },\n '.cm-activeLine': { backgroundColor: LIFT },\n '.cm-activeLineGutter': { backgroundColor: LIFT, color: 'var(--color-tf-fg)' },\n '.cm-content': {\n caretColor: 'var(--color-tf-accent-hi)',\n fontFamily: 'var(--font-mono)',\n padding: '0',\n },\n '.cm-cursor': { borderLeftColor: 'var(--color-tf-accent-hi)' },\n '.cm-gutters': {\n backgroundColor: 'transparent',\n border: 'none',\n color: 'var(--color-tf-muted)',\n fontFamily: 'var(--font-mono)',\n paddingLeft: PAD,\n },\n '.cm-line': {\n padding: `0 ${PAD}`,\n transition: 'background-color var(--tf-timing-quick)',\n },\n '.cm-lineNumbers .cm-gutterElement': { minWidth: 'calc(var(--spacing) * 4)' },\n '.cm-placeholder': { color: 'var(--color-tf-muted)' },\n '.cm-scroller': {\n fontFamily: 'inherit',\n lineHeight: LEADING,\n overflow: 'auto',\n padding: `${PAD} 0`,\n scrollbarColor: 'var(--color-tf-line-hi) transparent',\n scrollbarWidth: 'thin',\n },\n '.cm-selectionBackground': { backgroundColor: 'var(--color-tf-control) !important' },\n}\n\nconst codeSyntaxColors = {\n key: 'var(--color-tf-info-hi)',\n literal: 'var(--color-tf-accent-hi)',\n number: 'var(--color-tf-warning-hi)',\n punctuation: 'var(--color-tf-muted)',\n text: 'var(--color-tf-success-hi)',\n}\n\nexport { codeEditorRecipe, codeEditorTheme, codeSyntaxColors }\n"],"mappings":";;AAEA,MAAM,MAAM;AAEZ,MAAM,OAAO;AAEb,MAAM,UAAU;AAEhB,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB;CACtB,KAAK;EACH,iBAAiB;EACjB,OAAO;EACP,UAAU;EACV,YAAY;EACZ,WAAW;CACb;CACA,gBAAgB,EAAE,SAAS,OAAO;CAClC,qCAAqC,EAAE,iBAAiB,cAAc;CACtE,2CAA2C;EACzC,iBAAiB;EACjB,OAAO;CACT;CACA,kBAAkB,EAAE,iBAAiB,KAAK;CAC1C,wBAAwB;EAAE,iBAAiB;EAAM,OAAO;CAAqB;CAC7E,eAAe;EACb,YAAY;EACZ,YAAY;EACZ,SAAS;CACX;CACA,cAAc,EAAE,iBAAiB,4BAA4B;CAC7D,eAAe;EACb,iBAAiB;EACjB,QAAQ;EACR,OAAO;EACP,YAAY;EACZ,aAAa;CACf;CACA,YAAY;EACV,SAAS,KAAK;EACd,YAAY;CACd;CACA,qCAAqC,EAAE,UAAU,2BAA2B;CAC5E,mBAAmB,EAAE,OAAO,wBAAwB;CACpD,gBAAgB;EACd,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,SAAS,GAAG,IAAI;EAChB,gBAAgB;EAChB,gBAAgB;CAClB;CACA,2BAA2B,EAAE,iBAAiB,qCAAqC;AACrF;AAEA,MAAM,mBAAmB;CACvB,KAAK;CACL,SAAS;CACT,QAAQ;CACR,aAAa;CACb,MAAM;AACR"}
1
+ {"version":3,"file":"codeEditor.js","names":[],"sources":["../../src/recipes/codeEditor.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { anatomy } from '#anatomy'\n\nconst PAD = 'calc(var(--spacing) * 4)'\n\nconst LIFT = 'var(--color-tf-panel-2)'\n\nconst LEADING = 'var(--text-tf-caption-sm--line-height)'\n\nconst codeEditorRecipe = cva([\n 'relative isolate w-full overflow-hidden rounded-tf-control',\n 'empty:min-h-(--tf-code-height)',\n 'bg-tf-sunken font-tf-body blend-tf-accent',\n 'tf-edge-sweep tf-edge-plain reached:tf-edge-lit',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst codeEditorTheme = {\n '&': {\n backgroundColor: 'transparent',\n color: 'var(--color-tf-fg)',\n fontSize: 'var(--text-tf-caption-sm)',\n lineHeight: LEADING,\n maxHeight: 'var(--tf-code-height)',\n },\n '&.cm-focused': { outline: 'none' },\n '&:not(.cm-focused) .cm-activeLine': { backgroundColor: 'transparent' },\n '&:not(.cm-focused) .cm-activeLineGutter': {\n backgroundColor: 'transparent',\n color: 'inherit',\n },\n '.cm-activeLine': { backgroundColor: LIFT },\n '.cm-activeLineGutter': { backgroundColor: LIFT, color: 'var(--color-tf-fg)' },\n '.cm-content': {\n caretColor: 'var(--color-tf-accent-hi)',\n fontFamily: 'var(--font-mono)',\n padding: '0',\n },\n '.cm-cursor': { borderLeftColor: 'var(--color-tf-accent-hi)' },\n '.cm-gutters': {\n backgroundColor: 'transparent',\n border: 'none',\n color: 'var(--color-tf-muted)',\n fontFamily: 'var(--font-mono)',\n paddingLeft: PAD,\n },\n '.cm-line': {\n padding: `0 ${PAD}`,\n transition: 'background-color var(--tf-timing-quick)',\n },\n '.cm-lineNumbers .cm-gutterElement': { minWidth: 'calc(var(--spacing) * 4)' },\n '.cm-placeholder': { color: 'var(--color-tf-muted)' },\n '.cm-scroller': {\n fontFamily: 'inherit',\n lineHeight: LEADING,\n overflow: 'auto',\n padding: `${PAD} 0`,\n scrollbarColor: 'var(--color-tf-line-hi) transparent',\n scrollbarWidth: 'thin',\n },\n '.cm-selectionBackground': { backgroundColor: 'var(--color-tf-control) !important' },\n}\n\nconst codeSyntaxColors = {\n key: 'var(--color-tf-info-hi)',\n literal: 'var(--color-tf-accent-hi)',\n number: 'var(--color-tf-warning-hi)',\n punctuation: 'var(--color-tf-muted)',\n text: 'var(--color-tf-success-hi)',\n}\n\nconst codeEditorAnatomy = anatomy({\n root: { part: 'code-editor', recipe: codeEditorRecipe, required: true },\n})\n\nexport { codeEditorAnatomy, codeEditorRecipe, codeEditorTheme, codeSyntaxColors }\n"],"mappings":";;;AAIA,MAAM,MAAM;AAEZ,MAAM,OAAO;AAEb,MAAM,UAAU;AAEhB,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB;CACtB,KAAK;EACH,iBAAiB;EACjB,OAAO;EACP,UAAU;EACV,YAAY;EACZ,WAAW;CACb;CACA,gBAAgB,EAAE,SAAS,OAAO;CAClC,qCAAqC,EAAE,iBAAiB,cAAc;CACtE,2CAA2C;EACzC,iBAAiB;EACjB,OAAO;CACT;CACA,kBAAkB,EAAE,iBAAiB,KAAK;CAC1C,wBAAwB;EAAE,iBAAiB;EAAM,OAAO;CAAqB;CAC7E,eAAe;EACb,YAAY;EACZ,YAAY;EACZ,SAAS;CACX;CACA,cAAc,EAAE,iBAAiB,4BAA4B;CAC7D,eAAe;EACb,iBAAiB;EACjB,QAAQ;EACR,OAAO;EACP,YAAY;EACZ,aAAa;CACf;CACA,YAAY;EACV,SAAS,KAAK;EACd,YAAY;CACd;CACA,qCAAqC,EAAE,UAAU,2BAA2B;CAC5E,mBAAmB,EAAE,OAAO,wBAAwB;CACpD,gBAAgB;EACd,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,SAAS,GAAG,IAAI;EAChB,gBAAgB;EAChB,gBAAgB;CAClB;CACA,2BAA2B,EAAE,iBAAiB,qCAAqC;AACrF;AAEA,MAAM,mBAAmB;CACvB,KAAK;CACL,SAAS;CACT,QAAQ;CACR,aAAa;CACb,MAAM;AACR;AAEA,MAAM,oBAAoB,QAAQ,EAChC,MAAM;CAAE,MAAM;CAAe,QAAQ;CAAkB,UAAU;AAAK,EACxE,CAAC"}