@techfides/ui-library-design 0.1.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 (231) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/assets/brands/digital-boost-group.svg +1 -0
  4. package/assets/brands/rtsg.svg +1 -0
  5. package/assets/brands/tech-it-out.svg +1 -0
  6. package/assets/brands/techfides.svg +1 -0
  7. package/css/index.css +8 -0
  8. package/css/theme.css +1640 -0
  9. package/dist/brands.d.ts +39 -0
  10. package/dist/brands.js +41 -0
  11. package/dist/brands.js.map +1 -0
  12. package/dist/charts/animation.js +14 -0
  13. package/dist/charts/animation.js.map +1 -0
  14. package/dist/charts/bars.d.ts +22 -0
  15. package/dist/charts/bars.js +61 -0
  16. package/dist/charts/bars.js.map +1 -0
  17. package/dist/charts/groupedBars.d.ts +20 -0
  18. package/dist/charts/groupedBars.js +82 -0
  19. package/dist/charts/groupedBars.js.map +1 -0
  20. package/dist/charts/paint.js +19 -0
  21. package/dist/charts/paint.js.map +1 -0
  22. package/dist/charts/spark.d.ts +17 -0
  23. package/dist/charts/spark.js +159 -0
  24. package/dist/charts/spark.js.map +1 -0
  25. package/dist/charts/tooltip.js +41 -0
  26. package/dist/charts/tooltip.js.map +1 -0
  27. package/dist/cn.d.ts +6 -0
  28. package/dist/cn.js +178 -0
  29. package/dist/cn.js.map +1 -0
  30. package/dist/control.d.ts +15 -0
  31. package/dist/control.js +13 -0
  32. package/dist/control.js.map +1 -0
  33. package/dist/index.d.ts +65 -0
  34. package/dist/index.js +65 -0
  35. package/dist/mark.d.ts +7 -0
  36. package/dist/mark.js +11 -0
  37. package/dist/mark.js.map +1 -0
  38. package/dist/parts/control.js +55 -0
  39. package/dist/parts/control.js.map +1 -0
  40. package/dist/parts/eyebrow.js +8 -0
  41. package/dist/parts/eyebrow.js.map +1 -0
  42. package/dist/parts/mark.js +52 -0
  43. package/dist/parts/mark.js.map +1 -0
  44. package/dist/parts/reveal.js +35 -0
  45. package/dist/parts/reveal.js.map +1 -0
  46. package/dist/parts/rouse.js +25 -0
  47. package/dist/parts/rouse.js.map +1 -0
  48. package/dist/parts/rule.js +12 -0
  49. package/dist/parts/rule.js.map +1 -0
  50. package/dist/parts/scroll.js +10 -0
  51. package/dist/parts/scroll.js.map +1 -0
  52. package/dist/parts/shell.js +23 -0
  53. package/dist/parts/shell.js.map +1 -0
  54. package/dist/parts/surface.js +15 -0
  55. package/dist/parts/surface.js.map +1 -0
  56. package/dist/parts/tone.js +13 -0
  57. package/dist/parts/tone.js.map +1 -0
  58. package/dist/parts/travel.js +11 -0
  59. package/dist/parts/travel.js.map +1 -0
  60. package/dist/recipes/accordion.d.ts +13 -0
  61. package/dist/recipes/accordion.js +42 -0
  62. package/dist/recipes/accordion.js.map +1 -0
  63. package/dist/recipes/alert.d.ts +16 -0
  64. package/dist/recipes/alert.js +21 -0
  65. package/dist/recipes/alert.js.map +1 -0
  66. package/dist/recipes/band.d.ts +8 -0
  67. package/dist/recipes/band.js +22 -0
  68. package/dist/recipes/band.js.map +1 -0
  69. package/dist/recipes/bars.d.ts +17 -0
  70. package/dist/recipes/bars.js +27 -0
  71. package/dist/recipes/bars.js.map +1 -0
  72. package/dist/recipes/brandMark.d.ts +5 -0
  73. package/dist/recipes/brandMark.js +7 -0
  74. package/dist/recipes/brandMark.js.map +1 -0
  75. package/dist/recipes/button.d.ts +23 -0
  76. package/dist/recipes/button.js +229 -0
  77. package/dist/recipes/button.js.map +1 -0
  78. package/dist/recipes/cardHeader.d.ts +10 -0
  79. package/dist/recipes/cardHeader.js +11 -0
  80. package/dist/recipes/cardHeader.js.map +1 -0
  81. package/dist/recipes/checkbox.d.ts +26 -0
  82. package/dist/recipes/checkbox.js +103 -0
  83. package/dist/recipes/checkbox.js.map +1 -0
  84. package/dist/recipes/chip.d.ts +26 -0
  85. package/dist/recipes/chip.js +123 -0
  86. package/dist/recipes/chip.js.map +1 -0
  87. package/dist/recipes/codeEditor.d.ts +74 -0
  88. package/dist/recipes/codeEditor.js +71 -0
  89. package/dist/recipes/codeEditor.js.map +1 -0
  90. package/dist/recipes/datePicker.d.ts +39 -0
  91. package/dist/recipes/datePicker.js +166 -0
  92. package/dist/recipes/datePicker.js.map +1 -0
  93. package/dist/recipes/dialog.d.ts +37 -0
  94. package/dist/recipes/dialog.js +116 -0
  95. package/dist/recipes/dialog.js.map +1 -0
  96. package/dist/recipes/feature.d.ts +15 -0
  97. package/dist/recipes/feature.js +48 -0
  98. package/dist/recipes/feature.js.map +1 -0
  99. package/dist/recipes/field.d.ts +26 -0
  100. package/dist/recipes/field.js +129 -0
  101. package/dist/recipes/field.js.map +1 -0
  102. package/dist/recipes/findings.d.ts +11 -0
  103. package/dist/recipes/findings.js +16 -0
  104. package/dist/recipes/findings.js.map +1 -0
  105. package/dist/recipes/heading.d.ts +17 -0
  106. package/dist/recipes/heading.js +37 -0
  107. package/dist/recipes/heading.js.map +1 -0
  108. package/dist/recipes/heartbeat.d.ts +23 -0
  109. package/dist/recipes/heartbeat.js +43 -0
  110. package/dist/recipes/heartbeat.js.map +1 -0
  111. package/dist/recipes/input.d.ts +17 -0
  112. package/dist/recipes/input.js +90 -0
  113. package/dist/recipes/input.js.map +1 -0
  114. package/dist/recipes/listItem.d.ts +6 -0
  115. package/dist/recipes/listItem.js +8 -0
  116. package/dist/recipes/listItem.js.map +1 -0
  117. package/dist/recipes/listbox.d.ts +12 -0
  118. package/dist/recipes/listbox.js +29 -0
  119. package/dist/recipes/listbox.js.map +1 -0
  120. package/dist/recipes/marquee.d.ts +19 -0
  121. package/dist/recipes/marquee.js +36 -0
  122. package/dist/recipes/marquee.js.map +1 -0
  123. package/dist/recipes/menu.d.ts +26 -0
  124. package/dist/recipes/menu.js +86 -0
  125. package/dist/recipes/menu.js.map +1 -0
  126. package/dist/recipes/metaRow.d.ts +14 -0
  127. package/dist/recipes/metaRow.js +19 -0
  128. package/dist/recipes/metaRow.js.map +1 -0
  129. package/dist/recipes/meter.d.ts +23 -0
  130. package/dist/recipes/meter.js +39 -0
  131. package/dist/recipes/meter.js.map +1 -0
  132. package/dist/recipes/motion.d.ts +6 -0
  133. package/dist/recipes/motion.js +34 -0
  134. package/dist/recipes/motion.js.map +1 -0
  135. package/dist/recipes/nebula.d.ts +9 -0
  136. package/dist/recipes/nebula.js +15 -0
  137. package/dist/recipes/nebula.js.map +1 -0
  138. package/dist/recipes/numberRange.d.ts +15 -0
  139. package/dist/recipes/numberRange.js +109 -0
  140. package/dist/recipes/numberRange.js.map +1 -0
  141. package/dist/recipes/paper.d.ts +22 -0
  142. package/dist/recipes/paper.js +42 -0
  143. package/dist/recipes/paper.js.map +1 -0
  144. package/dist/recipes/progressBar.d.ts +7 -0
  145. package/dist/recipes/progressBar.js +11 -0
  146. package/dist/recipes/progressBar.js.map +1 -0
  147. package/dist/recipes/queue.d.ts +16 -0
  148. package/dist/recipes/queue.js +27 -0
  149. package/dist/recipes/queue.js.map +1 -0
  150. package/dist/recipes/radioGroup.d.ts +27 -0
  151. package/dist/recipes/radioGroup.js +68 -0
  152. package/dist/recipes/radioGroup.js.map +1 -0
  153. package/dist/recipes/scopeSwitcher.d.ts +26 -0
  154. package/dist/recipes/scopeSwitcher.js +80 -0
  155. package/dist/recipes/scopeSwitcher.js.map +1 -0
  156. package/dist/recipes/scrollArea.d.ts +19 -0
  157. package/dist/recipes/scrollArea.js +43 -0
  158. package/dist/recipes/scrollArea.js.map +1 -0
  159. package/dist/recipes/searchPalette.d.ts +19 -0
  160. package/dist/recipes/searchPalette.js +63 -0
  161. package/dist/recipes/searchPalette.js.map +1 -0
  162. package/dist/recipes/sectionHeader.d.ts +9 -0
  163. package/dist/recipes/sectionHeader.js +10 -0
  164. package/dist/recipes/sectionHeader.js.map +1 -0
  165. package/dist/recipes/segmentedControl.d.ts +9 -0
  166. package/dist/recipes/segmentedControl.js +29 -0
  167. package/dist/recipes/segmentedControl.js.map +1 -0
  168. package/dist/recipes/select.d.ts +9 -0
  169. package/dist/recipes/select.js +21 -0
  170. package/dist/recipes/select.js.map +1 -0
  171. package/dist/recipes/separator.d.ts +14 -0
  172. package/dist/recipes/separator.js +59 -0
  173. package/dist/recipes/separator.js.map +1 -0
  174. package/dist/recipes/sidebar.d.ts +40 -0
  175. package/dist/recipes/sidebar.js +128 -0
  176. package/dist/recipes/sidebar.js.map +1 -0
  177. package/dist/recipes/sky.d.ts +20 -0
  178. package/dist/recipes/sky.js +127 -0
  179. package/dist/recipes/sky.js.map +1 -0
  180. package/dist/recipes/slider.d.ts +20 -0
  181. package/dist/recipes/slider.js +62 -0
  182. package/dist/recipes/slider.js.map +1 -0
  183. package/dist/recipes/stat.d.ts +30 -0
  184. package/dist/recipes/stat.js +52 -0
  185. package/dist/recipes/stat.js.map +1 -0
  186. package/dist/recipes/switch.d.ts +20 -0
  187. package/dist/recipes/switch.js +60 -0
  188. package/dist/recipes/switch.js.map +1 -0
  189. package/dist/recipes/table.d.ts +74 -0
  190. package/dist/recipes/table.js +182 -0
  191. package/dist/recipes/table.js.map +1 -0
  192. package/dist/recipes/tableFilter.d.ts +14 -0
  193. package/dist/recipes/tableFilter.js +28 -0
  194. package/dist/recipes/tableFilter.js.map +1 -0
  195. package/dist/recipes/tablePaging.d.ts +15 -0
  196. package/dist/recipes/tablePaging.js +50 -0
  197. package/dist/recipes/tablePaging.js.map +1 -0
  198. package/dist/recipes/tail.d.ts +20 -0
  199. package/dist/recipes/tail.js +48 -0
  200. package/dist/recipes/tail.js.map +1 -0
  201. package/dist/recipes/text.d.ts +25 -0
  202. package/dist/recipes/text.js +94 -0
  203. package/dist/recipes/text.js.map +1 -0
  204. package/dist/recipes/textarea.d.ts +13 -0
  205. package/dist/recipes/textarea.js +48 -0
  206. package/dist/recipes/textarea.js.map +1 -0
  207. package/dist/recipes/tile.d.ts +18 -0
  208. package/dist/recipes/tile.js +85 -0
  209. package/dist/recipes/tile.js.map +1 -0
  210. package/dist/recipes/tooltip.d.ts +12 -0
  211. package/dist/recipes/tooltip.js +26 -0
  212. package/dist/recipes/tooltip.js.map +1 -0
  213. package/dist/recipes/topBar.d.ts +15 -0
  214. package/dist/recipes/topBar.js +35 -0
  215. package/dist/recipes/topBar.js.map +1 -0
  216. package/dist/recipes/trail.d.ts +27 -0
  217. package/dist/recipes/trail.js +66 -0
  218. package/dist/recipes/trail.js.map +1 -0
  219. package/dist/recipes/userMenu.d.ts +11 -0
  220. package/dist/recipes/userMenu.js +38 -0
  221. package/dist/recipes/userMenu.js.map +1 -0
  222. package/dist/tally.d.ts +17 -0
  223. package/dist/tally.js +75 -0
  224. package/dist/tally.js.map +1 -0
  225. package/dist/tone.d.ts +26 -0
  226. package/dist/tone.js +26 -0
  227. package/dist/tone.js.map +1 -0
  228. package/dist/words.d.ts +116 -0
  229. package/dist/words.js +93 -0
  230. package/dist/words.js.map +1 -0
  231. package/package.json +72 -0
@@ -0,0 +1,128 @@
1
+ import { controlInert, controlPress, controlReach } from "../parts/control.js";
2
+ import { collapseMotion, drawerMotion, railCollapse, railMorph, scrimMirrorMotion } from "./motion.js";
3
+ import { eyebrowLead } from "../parts/eyebrow.js";
4
+ import { surfaceLifted, surfacePanel } from "../parts/surface.js";
5
+ import { cva } from "class-variance-authority";
6
+ //#region src/recipes/sidebar.ts
7
+ const CHILD_INSET = "pl-11";
8
+ const ROW_STRIDE = `calc(var(--spacing-tf-control-md) + var(--spacing))`;
9
+ const RAIL_STRIDE = `calc(var(--spacing-tf-control-md) + var(--spacing))`;
10
+ const sidebarTravel = (index, rail) => {
11
+ const step = String(index);
12
+ if (rail) return `0 calc(${RAIL_STRIDE} * ${step})`;
13
+ return `0 calc(${ROW_STRIDE} * ${step})`;
14
+ };
15
+ const MORPHS = railMorph;
16
+ const ITEM = [
17
+ "group relative flex flex-none items-center rounded-tf-control",
18
+ "text-tf-body text-tf-muted",
19
+ "interactive:hovered:text-tf-fg aria-[current=page]:text-tf-on-accent",
20
+ "not-aria-[current=page]:interactive:hovered:bg-tf-panel-hi",
21
+ `cursor-pointer ${MORPHS}`,
22
+ ...controlReach,
23
+ ...controlPress,
24
+ ...controlInert
25
+ ];
26
+ const sidebarRecipe = cva([
27
+ "sticky top-0 z-tf-dropdown hidden h-dvh min-h-0 flex-none flex-col gap-6 py-6 lg:flex",
28
+ "w-tf-sidebar data-rail:w-tf-rail",
29
+ "border-r border-tf-line-2 bg-tf-glass backdrop-blur-tf-glass",
30
+ "tf-icons font-tf-body text-tf-fg",
31
+ MORPHS
32
+ ]);
33
+ const sidebarScopeRecipe = cva("flex-none px-3");
34
+ const sidebarMobileBarRecipe = cva([
35
+ "fixed inset-x-0 top-0 z-tf-dropdown flex items-center gap-3 px-4 lg:hidden",
36
+ "h-tf-control-lg border-b border-tf-line-2 bg-tf-panel-2 backdrop-blur-tf-panel",
37
+ "tf-icons font-tf-body text-tf-fg"
38
+ ]);
39
+ const sidebarMobileHeadingsRecipe = cva("flex min-w-0 flex-1 flex-col gap-0");
40
+ const sidebarMobileEyebrowRecipe = cva(["truncate", eyebrowLead]);
41
+ const sidebarMobileTitleRecipe = cva("truncate font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg");
42
+ const sidebarOverlayBackdropRecipe = cva([
43
+ "fixed inset-0 z-tf-modal bg-tf-scrim backdrop-blur-tf-scrim",
44
+ ...scrimMirrorMotion,
45
+ "motion-reduce:animate-none"
46
+ ]);
47
+ const sidebarOverlayPositionerRecipe = cva("fixed inset-0 z-tf-modal flex flex-col font-tf-body");
48
+ const sidebarOverlayPanelRecipe = cva([
49
+ ...surfacePanel,
50
+ ...surfaceLifted,
51
+ "flex h-full w-full flex-col overflow-hidden rounded-tf-none",
52
+ "text-tf-body-sm font-medium text-tf-fg",
53
+ ...drawerMotion,
54
+ "motion-reduce:animate-none"
55
+ ]);
56
+ const sidebarOverlayHeadRecipe = cva("relative flex flex-none items-center gap-5 border-b border-tf-line-2 px-4 py-3");
57
+ const sidebarOverlayBrandRecipe = cva(["flex min-w-0 items-center gap-3", "[&_svg]:size-tf-icon-solo-sm [&_svg]:shrink-0"]);
58
+ const sidebarOverlayScopeRecipe = cva("ml-auto truncate text-tf-body-sm font-medium text-tf-fg");
59
+ const sidebarOverlayBodyRecipe = cva([
60
+ "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4",
61
+ "tf-scroll-thin tf-scroll-faded",
62
+ "[--tf-fade-foot:calc(var(--spacing)*2)] [--tf-fade-head:calc(var(--spacing)*2)]"
63
+ ]);
64
+ const sidebarOverlayNavRecipe = cva("flex flex-none flex-col gap-1");
65
+ const sidebarOverlaySeparatorRecipe = cva("h-px w-full flex-none bg-tf-line-2");
66
+ const sidebarOverlayItemActive = "aria-[current=page]:bg-tf-blend aria-[current=page]:blend-tf-accent";
67
+ const sidebarHeadRecipe = cva(["flex flex-none items-center gap-3 px-3", MORPHS]);
68
+ const sidebarBrandRecipe = cva([
69
+ "flex min-w-0 items-center gap-3 pl-3",
70
+ "in-data-rail:gap-0 in-data-rail:pl-4",
71
+ "[&_svg]:size-tf-icon-solo-sm [&_svg]:shrink-0",
72
+ MORPHS
73
+ ]);
74
+ const sidebarBrandStackRecipe = cva(["flex flex-col gap-px", railCollapse]);
75
+ const sidebarWordmarkRecipe = cva(["truncate font-tf-display text-tf-lead tracking-tf-tight"]);
76
+ const sidebarBrandSubtitleRecipe = cva("truncate text-tf-caption-sm text-tf-muted");
77
+ const sidebarToggleRecipe = cva("flex-none [&_svg]:size-tf-icon-solo-sm");
78
+ const sidebarSwitchRecipe = cva(["flex flex-none items-center justify-end in-data-rail:pr-2", MORPHS]);
79
+ const FADED = [
80
+ "tf-scroll-faded tf-scroll-thin",
81
+ "[--tf-fade-head:calc(var(--spacing)*2)] [--tf-fade-foot:calc(var(--spacing)*2)]",
82
+ "outline-hidden focused:outline-2 focused:-outline-offset-2 focused:outline-tf-accent-hi"
83
+ ].join(" ");
84
+ const sidebarNavRecipe = cva(["relative flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto px-3 py-2", FADED]);
85
+ const sidebarMarkRecipe = cva([
86
+ "pointer-events-none absolute inset-x-3 top-2 h-tf-control-md rounded-tf-control",
87
+ "in-data-rail:inset-x-4",
88
+ "bg-tf-blend blend-tf-accent",
89
+ `tf-slides-settle ${MORPHS}`
90
+ ]);
91
+ const sidebarGroupRecipe = cva("flex flex-none flex-col");
92
+ const sidebarItemRecipe = cva([
93
+ ...ITEM,
94
+ "h-tf-control-md min-h-tf-control-md w-full text-left",
95
+ "[&>svg]:size-tf-icon-sm [&>svg]:shrink-0"
96
+ ], {
97
+ defaultVariants: { level: "top" },
98
+ variants: { level: {
99
+ child: `${CHILD_INSET} pr-3`,
100
+ top: [
101
+ "gap-3 px-3",
102
+ "in-data-rail:gap-0",
103
+ "in-data-rail:px-[calc((var(--spacing-tf-rail)-var(--spacing)*6-var(--spacing-tf-icon-md))/2)]"
104
+ ].join(" ")
105
+ } }
106
+ });
107
+ const sidebarIconRecipe = cva([
108
+ "relative inline-flex size-tf-icon-md flex-none [&_svg]:size-tf-icon-md",
109
+ "[&_svg]:shrink-0",
110
+ MORPHS
111
+ ]);
112
+ const sidebarLabelRecipe = cva(["truncate text-left tf-text-trim", railCollapse]);
113
+ const sidebarChevronRecipe = cva([
114
+ "w-tf-icon-sm flex-none overflow-hidden in-data-rail:w-0 in-data-rail:opacity-0",
115
+ "group-aria-expanded:rotate-180",
116
+ MORPHS
117
+ ]);
118
+ const sidebarDotRecipe = cva([
119
+ "pointer-events-none absolute -right-1 -bottom-1",
120
+ "size-1 rounded-tf-pill bg-current opacity-0 in-data-rail:opacity-100",
121
+ MORPHS
122
+ ]);
123
+ const sidebarSubRecipe = cva(["flex flex-col gap-1 pt-1", ...collapseMotion]);
124
+ const sidebarFootRecipe = cva("relative mt-auto flex flex-none flex-col gap-1 px-3");
125
+ //#endregion
126
+ export { sidebarBrandRecipe, sidebarBrandStackRecipe, sidebarBrandSubtitleRecipe, sidebarChevronRecipe, sidebarDotRecipe, sidebarFootRecipe, sidebarGroupRecipe, sidebarHeadRecipe, sidebarIconRecipe, sidebarItemRecipe, sidebarLabelRecipe, sidebarMarkRecipe, sidebarMobileBarRecipe, sidebarMobileEyebrowRecipe, sidebarMobileHeadingsRecipe, sidebarMobileTitleRecipe, sidebarNavRecipe, sidebarOverlayBackdropRecipe, sidebarOverlayBodyRecipe, sidebarOverlayBrandRecipe, sidebarOverlayHeadRecipe, sidebarOverlayItemActive, sidebarOverlayNavRecipe, sidebarOverlayPanelRecipe, sidebarOverlayPositionerRecipe, sidebarOverlayScopeRecipe, sidebarOverlaySeparatorRecipe, sidebarRecipe, sidebarScopeRecipe, sidebarSubRecipe, sidebarSwitchRecipe, sidebarToggleRecipe, sidebarTravel, sidebarWordmarkRecipe };
127
+
128
+ //# sourceMappingURL=sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.js","names":[],"sources":["../../src/recipes/sidebar.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlInert, controlPress, controlReach } from '#parts/control'\nimport { eyebrowLead } from '#parts/eyebrow'\nimport { surfaceLifted, surfacePanel } from '#parts/surface'\n\nimport { collapseMotion, drawerMotion, railCollapse, railMorph, scrimMirrorMotion } from './motion'\n\nconst CHILD_INSET = 'pl-11'\n\nconst ROW_STRIDE = `calc(var(--spacing-tf-control-md) + var(--spacing))`\n\nconst RAIL_STRIDE = `calc(var(--spacing-tf-control-md) + var(--spacing))`\n\nconst sidebarTravel = (index: number, rail: boolean): string => {\n const step = String(index)\n\n if (rail) {\n return `0 calc(${RAIL_STRIDE} * ${step})`\n }\n return `0 calc(${ROW_STRIDE} * ${step})`\n}\n\nconst MORPHS = railMorph\n\nconst ITEM = [\n 'group relative flex flex-none items-center rounded-tf-control',\n 'text-tf-body text-tf-muted',\n 'interactive:hovered:text-tf-fg aria-[current=page]:text-tf-on-accent',\n 'not-aria-[current=page]:interactive:hovered:bg-tf-panel-hi',\n `cursor-pointer ${MORPHS}`,\n ...controlReach,\n ...controlPress,\n ...controlInert,\n]\n\nconst sidebarRecipe = cva([\n 'sticky top-0 z-tf-dropdown hidden h-dvh min-h-0 flex-none flex-col gap-6 py-6 lg:flex',\n 'w-tf-sidebar data-rail:w-tf-rail',\n 'border-r border-tf-line-2 bg-tf-glass backdrop-blur-tf-glass',\n 'tf-icons font-tf-body text-tf-fg',\n MORPHS,\n])\n\nconst sidebarScopeRecipe = cva('flex-none px-3')\n\nconst sidebarMobileBarRecipe = cva([\n 'fixed inset-x-0 top-0 z-tf-dropdown flex items-center gap-3 px-4 lg:hidden',\n 'h-tf-control-lg border-b border-tf-line-2 bg-tf-panel-2 backdrop-blur-tf-panel',\n 'tf-icons font-tf-body text-tf-fg',\n])\n\nconst sidebarMobileHeadingsRecipe = cva('flex min-w-0 flex-1 flex-col gap-0')\n\nconst sidebarMobileEyebrowRecipe = cva(['truncate', eyebrowLead])\n\nconst sidebarMobileTitleRecipe = cva(\n 'truncate font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg',\n)\n\nconst sidebarOverlayBackdropRecipe = cva([\n 'fixed inset-0 z-tf-modal bg-tf-scrim backdrop-blur-tf-scrim',\n ...scrimMirrorMotion,\n 'motion-reduce:animate-none',\n])\n\nconst sidebarOverlayPositionerRecipe = cva('fixed inset-0 z-tf-modal flex flex-col font-tf-body')\n\nconst sidebarOverlayPanelRecipe = cva([\n ...surfacePanel,\n ...surfaceLifted,\n 'flex h-full w-full flex-col overflow-hidden rounded-tf-none',\n 'text-tf-body-sm font-medium text-tf-fg',\n ...drawerMotion,\n 'motion-reduce:animate-none',\n])\n\nconst sidebarOverlayHeadRecipe = cva(\n 'relative flex flex-none items-center gap-5 border-b border-tf-line-2 px-4 py-3',\n)\n\nconst sidebarOverlayBrandRecipe = cva([\n 'flex min-w-0 items-center gap-3',\n '[&_svg]:size-tf-icon-solo-sm [&_svg]:shrink-0',\n])\n\nconst sidebarOverlayScopeRecipe = cva('ml-auto truncate text-tf-body-sm font-medium text-tf-fg')\n\nconst sidebarOverlayBodyRecipe = cva([\n 'flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4',\n 'tf-scroll-thin tf-scroll-faded',\n '[--tf-fade-foot:calc(var(--spacing)*2)] [--tf-fade-head:calc(var(--spacing)*2)]',\n])\n\nconst sidebarOverlayNavRecipe = cva('flex flex-none flex-col gap-1')\n\nconst sidebarOverlaySeparatorRecipe = cva('h-px w-full flex-none bg-tf-line-2')\n\nconst sidebarOverlayItemActive =\n 'aria-[current=page]:bg-tf-blend aria-[current=page]:blend-tf-accent'\n\nconst sidebarHeadRecipe = cva(['flex flex-none items-center gap-3 px-3', MORPHS])\n\nconst sidebarBrandRecipe = cva([\n 'flex min-w-0 items-center gap-3 pl-3',\n 'in-data-rail:gap-0 in-data-rail:pl-4',\n '[&_svg]:size-tf-icon-solo-sm [&_svg]:shrink-0',\n MORPHS,\n])\n\nconst sidebarBrandStackRecipe = cva(['flex flex-col gap-px', railCollapse])\n\nconst sidebarWordmarkRecipe = cva(['truncate font-tf-display text-tf-lead tracking-tf-tight'])\n\nconst sidebarBrandSubtitleRecipe = cva('truncate text-tf-caption-sm text-tf-muted')\n\nconst sidebarToggleRecipe = cva('flex-none [&_svg]:size-tf-icon-solo-sm')\n\nconst sidebarSwitchRecipe = cva([\n 'flex flex-none items-center justify-end in-data-rail:pr-2',\n MORPHS,\n])\n\nconst FADED = [\n 'tf-scroll-faded tf-scroll-thin',\n '[--tf-fade-head:calc(var(--spacing)*2)] [--tf-fade-foot:calc(var(--spacing)*2)]',\n 'outline-hidden focused:outline-2 focused:-outline-offset-2 focused:outline-tf-accent-hi',\n].join(' ')\n\nconst sidebarNavRecipe = cva([\n 'relative flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto px-3 py-2',\n FADED,\n])\n\nconst sidebarMarkRecipe = cva([\n 'pointer-events-none absolute inset-x-3 top-2 h-tf-control-md rounded-tf-control',\n 'in-data-rail:inset-x-4',\n 'bg-tf-blend blend-tf-accent',\n `tf-slides-settle ${MORPHS}`,\n])\n\nconst sidebarGroupRecipe = cva('flex flex-none flex-col')\n\nconst sidebarItemRecipe = cva(\n [\n ...ITEM,\n 'h-tf-control-md min-h-tf-control-md w-full text-left',\n '[&>svg]:size-tf-icon-sm [&>svg]:shrink-0',\n ],\n {\n defaultVariants: { level: 'top' },\n variants: {\n level: {\n child: `${CHILD_INSET} pr-3`,\n top: [\n 'gap-3 px-3',\n 'in-data-rail:gap-0',\n 'in-data-rail:px-[calc((var(--spacing-tf-rail)-var(--spacing)*6-var(--spacing-tf-icon-md))/2)]',\n ].join(' '),\n },\n },\n },\n)\n\nconst sidebarIconRecipe = cva([\n 'relative inline-flex size-tf-icon-md flex-none [&_svg]:size-tf-icon-md',\n '[&_svg]:shrink-0',\n MORPHS,\n])\n\nconst sidebarLabelRecipe = cva(['truncate text-left tf-text-trim', railCollapse])\n\nconst sidebarChevronRecipe = cva([\n 'w-tf-icon-sm flex-none overflow-hidden in-data-rail:w-0 in-data-rail:opacity-0',\n 'group-aria-expanded:rotate-180',\n MORPHS,\n])\n\nconst sidebarDotRecipe = cva([\n 'pointer-events-none absolute -right-1 -bottom-1',\n 'size-1 rounded-tf-pill bg-current opacity-0 in-data-rail:opacity-100',\n MORPHS,\n])\n\nconst sidebarSubRecipe = cva(['flex flex-col gap-1 pt-1', ...collapseMotion])\n\nconst sidebarFootRecipe = cva('relative mt-auto flex flex-none flex-col gap-1 px-3')\n\nexport {\n sidebarBrandRecipe,\n sidebarBrandStackRecipe,\n sidebarBrandSubtitleRecipe,\n sidebarChevronRecipe,\n sidebarDotRecipe,\n sidebarFootRecipe,\n sidebarGroupRecipe,\n sidebarHeadRecipe,\n sidebarIconRecipe,\n sidebarItemRecipe,\n sidebarLabelRecipe,\n sidebarMarkRecipe,\n sidebarMobileBarRecipe,\n sidebarMobileEyebrowRecipe,\n sidebarMobileHeadingsRecipe,\n sidebarMobileTitleRecipe,\n sidebarNavRecipe,\n sidebarOverlayBackdropRecipe,\n sidebarOverlayBodyRecipe,\n sidebarOverlayBrandRecipe,\n sidebarOverlayHeadRecipe,\n sidebarOverlayItemActive,\n sidebarOverlayNavRecipe,\n sidebarOverlayPanelRecipe,\n sidebarOverlayPositionerRecipe,\n sidebarOverlayScopeRecipe,\n sidebarOverlaySeparatorRecipe,\n sidebarRecipe,\n sidebarScopeRecipe,\n sidebarSubRecipe,\n sidebarSwitchRecipe,\n sidebarToggleRecipe,\n sidebarTravel,\n sidebarWordmarkRecipe,\n}\n"],"mappings":";;;;;;AAQA,MAAM,cAAc;AAEpB,MAAM,aAAa;AAEnB,MAAM,cAAc;AAEpB,MAAM,iBAAiB,OAAe,SAA0B;CAC9D,MAAM,OAAO,OAAO,KAAK;CAEzB,IAAI,MACF,OAAO,UAAU,YAAY,KAAK,KAAK;CAEzC,OAAO,UAAU,WAAW,KAAK,KAAK;AACxC;AAEA,MAAM,SAAS;AAEf,MAAM,OAAO;CACX;CACA;CACA;CACA;CACA,kBAAkB;CAClB,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,gBAAgB,IAAI;CACxB;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,qBAAqB,IAAI,gBAAgB;AAE/C,MAAM,yBAAyB,IAAI;CACjC;CACA;CACA;AACF,CAAC;AAED,MAAM,8BAA8B,IAAI,oCAAoC;AAE5E,MAAM,6BAA6B,IAAI,CAAC,YAAY,WAAW,CAAC;AAEhE,MAAM,2BAA2B,IAC/B,4EACF;AAEA,MAAM,+BAA+B,IAAI;CACvC;CACA,GAAG;CACH;AACF,CAAC;AAED,MAAM,iCAAiC,IAAI,qDAAqD;AAEhG,MAAM,4BAA4B,IAAI;CACpC,GAAG;CACH,GAAG;CACH;CACA;CACA,GAAG;CACH;AACF,CAAC;AAED,MAAM,2BAA2B,IAC/B,gFACF;AAEA,MAAM,4BAA4B,IAAI,CACpC,mCACA,+CACF,CAAC;AAED,MAAM,4BAA4B,IAAI,yDAAyD;AAE/F,MAAM,2BAA2B,IAAI;CACnC;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAA0B,IAAI,+BAA+B;AAEnE,MAAM,gCAAgC,IAAI,oCAAoC;AAE9E,MAAM,2BACJ;AAEF,MAAM,oBAAoB,IAAI,CAAC,0CAA0C,MAAM,CAAC;AAEhF,MAAM,qBAAqB,IAAI;CAC7B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,0BAA0B,IAAI,CAAC,wBAAwB,YAAY,CAAC;AAE1E,MAAM,wBAAwB,IAAI,CAAC,yDAAyD,CAAC;AAE7F,MAAM,6BAA6B,IAAI,2CAA2C;AAElF,MAAM,sBAAsB,IAAI,wCAAwC;AAExE,MAAM,sBAAsB,IAAI,CAC9B,6DACA,MACF,CAAC;AAED,MAAM,QAAQ;CACZ;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAEV,MAAM,mBAAmB,IAAI,CAC3B,yEACA,KACF,CAAC;AAED,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA,oBAAoB;AACtB,CAAC;AAED,MAAM,qBAAqB,IAAI,yBAAyB;AAExD,MAAM,oBAAoB,IACxB;CACE,GAAG;CACH;CACA;AACF,GACA;CACE,iBAAiB,EAAE,OAAO,MAAM;CAChC,UAAU,EACR,OAAO;EACL,OAAO,GAAG,YAAY;EACtB,KAAK;GACH;GACA;GACA;EACF,CAAC,CAAC,KAAK,GAAG;CACZ,EACF;AACF,CACF;AAEA,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;AACF,CAAC;AAED,MAAM,qBAAqB,IAAI,CAAC,mCAAmC,YAAY,CAAC;AAEhF,MAAM,uBAAuB,IAAI;CAC/B;CACA;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,CAAC,4BAA4B,GAAG,cAAc,CAAC;AAE5E,MAAM,oBAAoB,IAAI,qDAAqD"}
@@ -0,0 +1,20 @@
1
+ //#region src/recipes/sky.d.ts
2
+ interface StarLayer {
3
+ delay: string;
4
+ image: string;
5
+ position: string;
6
+ size: string;
7
+ }
8
+ interface Cloud {
9
+ delay: string;
10
+ shift: string;
11
+ }
12
+ declare const skyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ declare const driftRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
+ declare const starRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
15
+ declare const contentRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
16
+ declare const starLayers: (count: number, seed: string) => StarLayer[];
17
+ declare const cloudDrift: (seed: string) => Cloud;
18
+ //#endregion
19
+ export { type Cloud, type StarLayer, cloudDrift, contentRecipe, driftRecipe, skyRecipe, starLayers, starRecipe };
20
+ //# sourceMappingURL=sky.d.ts.map
@@ -0,0 +1,127 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/recipes/sky.ts
3
+ const DIM = 1;
4
+ const MID = 2;
5
+ const BRIGHT = 3;
6
+ const FAINT = 28;
7
+ const DUSKY = 40;
8
+ const STEADY = 55;
9
+ const CLEAR = 70;
10
+ const KEEN = 95;
11
+ const STAR_PX = [
12
+ DIM,
13
+ DIM,
14
+ MID,
15
+ MID,
16
+ BRIGHT
17
+ ];
18
+ const STAR_GLOW = [
19
+ FAINT,
20
+ DUSKY,
21
+ STEADY,
22
+ CLEAR,
23
+ KEEN
24
+ ];
25
+ const SEED_BASE = 7;
26
+ const SEED_STEP = 131;
27
+ const LEHMER_MULTIPLIER = 16807;
28
+ const LEHMER_MODULUS = 2147483647;
29
+ const FIRST = 0;
30
+ const ORIGIN = 0;
31
+ const ONE = 1;
32
+ const EDGE = 4;
33
+ const FIELD = 92;
34
+ const CLOUD_SHIFT = 26;
35
+ const HALF = .5;
36
+ const LAYERS = 4;
37
+ const HALO_AT = CLEAR;
38
+ const HALO_SCALE = 5;
39
+ const HALO_GLOW = 7;
40
+ const CORE_EDGE = 99;
41
+ const skyRecipe = cva([
42
+ "relative isolate overflow-hidden",
43
+ "rounded-tf-card bg-tf-bg",
44
+ "font-tf-body text-tf-fg"
45
+ ]);
46
+ const driftRecipe = cva([
47
+ "pointer-events-none absolute -inset-1/4",
48
+ "[rotate:var(--tf-sweep)] tf-turning",
49
+ "[animation-duration:calc(var(--tf-sweep-duration)*45)]"
50
+ ]);
51
+ const starRecipe = cva("pointer-events-none absolute inset-0 tf-twinkling bg-no-repeat");
52
+ const contentRecipe = cva("relative");
53
+ const hashOf = (seed) => {
54
+ let value = SEED_BASE;
55
+ for (const letter of seed) value = (value * SEED_STEP + (letter.codePointAt(FIRST) ?? ORIGIN)) % LEHMER_MODULUS;
56
+ return value + ONE;
57
+ };
58
+ const streamFrom = (seed) => {
59
+ let state = hashOf(seed);
60
+ return () => {
61
+ state = state * LEHMER_MULTIPLIER % LEHMER_MODULUS;
62
+ return state / LEHMER_MODULUS;
63
+ };
64
+ };
65
+ const pick = (choices, roll, fallback) => choices[Math.floor(roll * choices.length)] ?? fallback;
66
+ const glowOf = (strength) => `color-mix(in oklab, var(--color-tf-fg) ${String(strength)}%, transparent)`;
67
+ const circleOf = (strength) => {
68
+ const ink = glowOf(strength);
69
+ return `radial-gradient(circle closest-side, ${ink} 0, ${ink} ${String(CORE_EDGE)}%, transparent 100%)`;
70
+ };
71
+ const haloOf = (strength) => {
72
+ return `radial-gradient(circle closest-side, ${glowOf(strength)} 0, transparent 100%)`;
73
+ };
74
+ const speckFrom = (roll) => {
75
+ const step = roll();
76
+ return {
77
+ across: EDGE + roll() * FIELD,
78
+ down: EDGE + roll() * FIELD,
79
+ glow: pick(STAR_GLOW, step, FAINT),
80
+ px: pick(STAR_PX, step, DIM)
81
+ };
82
+ };
83
+ const spotOf = (speck) => `${String(speck.across)}% ${String(speck.down)}%`;
84
+ const sizeOf = (across) => `${String(across)}px ${String(across)}px`;
85
+ const draw = (sheet, speck) => {
86
+ if (speck.glow >= HALO_AT) {
87
+ sheet.images.push(haloOf(HALO_GLOW));
88
+ sheet.positions.push(spotOf(speck));
89
+ sheet.sizes.push(sizeOf(speck.px * HALO_SCALE));
90
+ }
91
+ sheet.images.push(circleOf(speck.glow));
92
+ sheet.positions.push(spotOf(speck));
93
+ sheet.sizes.push(sizeOf(speck.px));
94
+ };
95
+ const starLayers = (count, seed) => {
96
+ const roll = streamFrom(seed);
97
+ const sheets = Array.from({ length: LAYERS }, () => ({
98
+ images: [],
99
+ positions: [],
100
+ sizes: []
101
+ }));
102
+ for (let drawn = ORIGIN; drawn < count; drawn += ONE) {
103
+ const speck = speckFrom(roll);
104
+ const sheet = sheets[Math.floor(roll() * LAYERS)] ?? sheets[FIRST];
105
+ if (sheet) draw(sheet, speck);
106
+ }
107
+ return sheets.map((sheet, index) => ({
108
+ delay: `calc(var(--tf-twinkle-duration) * -${String(index / LAYERS)})`,
109
+ image: sheet.images.join(", "),
110
+ position: sheet.positions.join(", "),
111
+ size: sheet.sizes.join(", ")
112
+ }));
113
+ };
114
+ const cloudDrift = (seed) => {
115
+ const roll = streamFrom(`cloud:${seed}`);
116
+ const turn = roll();
117
+ const across = (roll() - HALF) * CLOUD_SHIFT;
118
+ const down = (roll() - HALF) * CLOUD_SHIFT;
119
+ return {
120
+ delay: `calc(var(--tf-sweep-duration) * -${String(turn)})`,
121
+ shift: `${String(across)}% ${String(down)}%`
122
+ };
123
+ };
124
+ //#endregion
125
+ export { cloudDrift, contentRecipe, driftRecipe, skyRecipe, starLayers, starRecipe };
126
+
127
+ //# sourceMappingURL=sky.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sky.js","names":[],"sources":["../../src/recipes/sky.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst DIM = 1\nconst MID = 2\nconst BRIGHT = 3\n\nconst FAINT = 28\nconst DUSKY = 40\nconst STEADY = 55\nconst CLEAR = 70\nconst KEEN = 95\n\nconst STAR_PX = [DIM, DIM, MID, MID, BRIGHT] as const\nconst STAR_GLOW = [FAINT, DUSKY, STEADY, CLEAR, KEEN] as const\n\nconst SEED_BASE = 7\nconst SEED_STEP = 131\nconst LEHMER_MULTIPLIER = 16_807\nconst LEHMER_MODULUS = 2_147_483_647\n\nconst FIRST = 0\nconst ORIGIN = 0\nconst ONE = 1\nconst EDGE = 4\nconst FIELD = 92\nconst CLOUD_SHIFT = 26\nconst HALF = 0.5\n\nconst LAYERS = 4\n\nconst HALO_AT = CLEAR\n\nconst HALO_SCALE = 5\n\nconst HALO_GLOW = 7\n\nconst CORE_EDGE = 99\n\ninterface Speck {\n across: number\n down: number\n glow: number\n px: number\n}\n\ninterface StarLayer {\n delay: string\n image: string\n position: string\n size: string\n}\n\ninterface Cloud {\n delay: string\n shift: string\n}\n\nconst skyRecipe = cva([\n 'relative isolate overflow-hidden',\n 'rounded-tf-card bg-tf-bg',\n 'font-tf-body text-tf-fg',\n])\n\nconst driftRecipe = cva([\n 'pointer-events-none absolute -inset-1/4',\n '[rotate:var(--tf-sweep)] tf-turning',\n '[animation-duration:calc(var(--tf-sweep-duration)*45)]',\n])\n\nconst starRecipe = cva('pointer-events-none absolute inset-0 tf-twinkling bg-no-repeat')\n\nconst contentRecipe = cva('relative')\n\nconst hashOf = (seed: string): number => {\n let value = SEED_BASE\n\n for (const letter of seed) {\n value = (value * SEED_STEP + (letter.codePointAt(FIRST) ?? ORIGIN)) % LEHMER_MODULUS\n }\n return value + ONE\n}\n\nconst streamFrom = (seed: string): (() => number) => {\n let state = hashOf(seed)\n\n return () => {\n state = (state * LEHMER_MULTIPLIER) % LEHMER_MODULUS\n return state / LEHMER_MODULUS\n }\n}\n\nconst pick = <Value>(choices: readonly Value[], roll: number, fallback: Value): Value =>\n choices[Math.floor(roll * choices.length)] ?? fallback\n\nconst glowOf = (strength: number): string =>\n `color-mix(in oklab, var(--color-tf-fg) ${String(strength)}%, transparent)`\n\nconst circleOf = (strength: number): string => {\n const ink = glowOf(strength)\n\n return `radial-gradient(circle closest-side, ${ink} 0, ${ink} ${String(CORE_EDGE)}%, transparent 100%)`\n}\n\nconst haloOf = (strength: number): string => {\n const ink = glowOf(strength)\n\n return `radial-gradient(circle closest-side, ${ink} 0, transparent 100%)`\n}\n\nconst speckFrom = (roll: () => number): Speck => {\n const step = roll()\n\n return {\n across: EDGE + roll() * FIELD,\n down: EDGE + roll() * FIELD,\n glow: pick(STAR_GLOW, step, FAINT),\n px: pick(STAR_PX, step, DIM),\n }\n}\n\nconst spotOf = (speck: Speck): string => `${String(speck.across)}% ${String(speck.down)}%`\n\nconst sizeOf = (across: number): string => `${String(across)}px ${String(across)}px`\n\ninterface Drawing {\n images: string[]\n positions: string[]\n sizes: string[]\n}\n\nconst draw = (sheet: Drawing, speck: Speck): void => {\n if (speck.glow >= HALO_AT) {\n sheet.images.push(haloOf(HALO_GLOW))\n sheet.positions.push(spotOf(speck))\n sheet.sizes.push(sizeOf(speck.px * HALO_SCALE))\n }\n sheet.images.push(circleOf(speck.glow))\n sheet.positions.push(spotOf(speck))\n sheet.sizes.push(sizeOf(speck.px))\n}\n\nconst starLayers = (count: number, seed: string): StarLayer[] => {\n const roll = streamFrom(seed)\n const sheets: Drawing[] = Array.from({ length: LAYERS }, () => ({\n images: [],\n positions: [],\n sizes: [],\n }))\n\n for (let drawn = ORIGIN; drawn < count; drawn += ONE) {\n const speck = speckFrom(roll)\n const sheet = sheets[Math.floor(roll() * LAYERS)] ?? sheets[FIRST]\n\n if (sheet) {\n draw(sheet, speck)\n }\n }\n return sheets.map((sheet, index) => ({\n delay: `calc(var(--tf-twinkle-duration) * -${String(index / LAYERS)})`,\n image: sheet.images.join(', '),\n position: sheet.positions.join(', '),\n size: sheet.sizes.join(', '),\n }))\n}\n\nconst cloudDrift = (seed: string): Cloud => {\n const roll = streamFrom(`cloud:${seed}`)\n const turn = roll()\n const across = (roll() - HALF) * CLOUD_SHIFT\n const down = (roll() - HALF) * CLOUD_SHIFT\n\n return {\n delay: `calc(var(--tf-sweep-duration) * -${String(turn)})`,\n shift: `${String(across)}% ${String(down)}%`,\n }\n}\n\nexport {\n type Cloud,\n type StarLayer,\n cloudDrift,\n contentRecipe,\n driftRecipe,\n skyRecipe,\n starLayers,\n starRecipe,\n}\n"],"mappings":";;AAEA,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,MAAM,SAAS;AAEf,MAAM,QAAQ;AACd,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,OAAO;AAEb,MAAM,UAAU;CAAC;CAAK;CAAK;CAAK;CAAK;AAAM;AAC3C,MAAM,YAAY;CAAC;CAAO;CAAO;CAAQ;CAAO;AAAI;AAEpD,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,oBAAoB;AAC1B,MAAM,iBAAiB;AAEvB,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,MAAM;AACZ,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,cAAc;AACpB,MAAM,OAAO;AAEb,MAAM,SAAS;AAEf,MAAM,UAAU;AAEhB,MAAM,aAAa;AAEnB,MAAM,YAAY;AAElB,MAAM,YAAY;AAqBlB,MAAM,YAAY,IAAI;CACpB;CACA;CACA;AACF,CAAC;AAED,MAAM,cAAc,IAAI;CACtB;CACA;CACA;AACF,CAAC;AAED,MAAM,aAAa,IAAI,gEAAgE;AAEvF,MAAM,gBAAgB,IAAI,UAAU;AAEpC,MAAM,UAAU,SAAyB;CACvC,IAAI,QAAQ;CAEZ,KAAK,MAAM,UAAU,MACnB,SAAS,QAAQ,aAAa,OAAO,YAAY,KAAK,KAAK,WAAW;CAExE,OAAO,QAAQ;AACjB;AAEA,MAAM,cAAc,SAAiC;CACnD,IAAI,QAAQ,OAAO,IAAI;CAEvB,aAAa;EACX,QAAS,QAAQ,oBAAqB;EACtC,OAAO,QAAQ;CACjB;AACF;AAEA,MAAM,QAAe,SAA2B,MAAc,aAC5D,QAAQ,KAAK,MAAM,OAAO,QAAQ,MAAM,MAAM;AAEhD,MAAM,UAAU,aACd,0CAA0C,OAAO,QAAQ,EAAE;AAE7D,MAAM,YAAY,aAA6B;CAC7C,MAAM,MAAM,OAAO,QAAQ;CAE3B,OAAO,wCAAwC,IAAI,MAAM,IAAI,GAAG,OAAO,SAAS,EAAE;AACpF;AAEA,MAAM,UAAU,aAA6B;CAG3C,OAAO,wCAFK,OAAO,QAE8B,EAAE;AACrD;AAEA,MAAM,aAAa,SAA8B;CAC/C,MAAM,OAAO,KAAK;CAElB,OAAO;EACL,QAAQ,OAAO,KAAK,IAAI;EACxB,MAAM,OAAO,KAAK,IAAI;EACtB,MAAM,KAAK,WAAW,MAAM,KAAK;EACjC,IAAI,KAAK,SAAS,MAAM,GAAG;CAC7B;AACF;AAEA,MAAM,UAAU,UAAyB,GAAG,OAAO,MAAM,MAAM,EAAE,IAAI,OAAO,MAAM,IAAI,EAAE;AAExF,MAAM,UAAU,WAA2B,GAAG,OAAO,MAAM,EAAE,KAAK,OAAO,MAAM,EAAE;AAQjF,MAAM,QAAQ,OAAgB,UAAuB;CACnD,IAAI,MAAM,QAAQ,SAAS;EACzB,MAAM,OAAO,KAAK,OAAO,SAAS,CAAC;EACnC,MAAM,UAAU,KAAK,OAAO,KAAK,CAAC;EAClC,MAAM,MAAM,KAAK,OAAO,MAAM,KAAK,UAAU,CAAC;CAChD;CACA,MAAM,OAAO,KAAK,SAAS,MAAM,IAAI,CAAC;CACtC,MAAM,UAAU,KAAK,OAAO,KAAK,CAAC;CAClC,MAAM,MAAM,KAAK,OAAO,MAAM,EAAE,CAAC;AACnC;AAEA,MAAM,cAAc,OAAe,SAA8B;CAC/D,MAAM,OAAO,WAAW,IAAI;CAC5B,MAAM,SAAoB,MAAM,KAAK,EAAE,QAAQ,OAAO,UAAU;EAC9D,QAAQ,CAAC;EACT,WAAW,CAAC;EACZ,OAAO,CAAC;CACV,EAAE;CAEF,KAAK,IAAI,QAAQ,QAAQ,QAAQ,OAAO,SAAS,KAAK;EACpD,MAAM,QAAQ,UAAU,IAAI;EAC5B,MAAM,QAAQ,OAAO,KAAK,MAAM,KAAK,IAAI,MAAM,MAAM,OAAO;EAE5D,IAAI,OACF,KAAK,OAAO,KAAK;CAErB;CACA,OAAO,OAAO,KAAK,OAAO,WAAW;EACnC,OAAO,sCAAsC,OAAO,QAAQ,MAAM,EAAE;EACpE,OAAO,MAAM,OAAO,KAAK,IAAI;EAC7B,UAAU,MAAM,UAAU,KAAK,IAAI;EACnC,MAAM,MAAM,MAAM,KAAK,IAAI;CAC7B,EAAE;AACJ;AAEA,MAAM,cAAc,SAAwB;CAC1C,MAAM,OAAO,WAAW,SAAS,MAAM;CACvC,MAAM,OAAO,KAAK;CAClB,MAAM,UAAU,KAAK,IAAI,QAAQ;CACjC,MAAM,QAAQ,KAAK,IAAI,QAAQ;CAE/B,OAAO;EACL,OAAO,oCAAoC,OAAO,IAAI,EAAE;EACxD,OAAO,GAAG,OAAO,MAAM,EAAE,IAAI,OAAO,IAAI,EAAE;CAC5C;AACF"}
@@ -0,0 +1,20 @@
1
+ //#region src/recipes/slider.d.ts
2
+ declare const sliderKnobSize = 20;
3
+ declare const sliderRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
+ declare const sliderHeadRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ declare const sliderLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ declare const sliderValueRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const sliderControlRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ declare const sliderTrackRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare const sliderRangeRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ declare const sliderNotchesRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ declare const sliderNotchRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ declare const sliderThumbRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ declare const sliderFootRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
+ declare const sliderHintRecipe: (props?: ({
15
+ invalid?: boolean | null | undefined;
16
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
+ declare const sliderBoundsRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ //#endregion
19
+ export { sliderBoundsRecipe, sliderControlRecipe, sliderFootRecipe, sliderHeadRecipe, sliderHintRecipe, sliderKnobSize, sliderLabelRecipe, sliderNotchRecipe, sliderNotchesRecipe, sliderRangeRecipe, sliderRecipe, sliderThumbRecipe, sliderTrackRecipe, sliderValueRecipe };
20
+ //# sourceMappingURL=slider.d.ts.map
@@ -0,0 +1,62 @@
1
+ import { controlReach } from "../parts/control.js";
2
+ import { markKnob } from "../parts/mark.js";
3
+ import { cva } from "class-variance-authority";
4
+ //#region src/recipes/slider.ts
5
+ const sliderKnobSize = 20;
6
+ const sliderRecipe = cva([
7
+ "flex w-full max-w-tf-panel flex-col gap-2",
8
+ "font-tf-body",
9
+ "data-disabled:cursor-not-allowed",
10
+ "data-disabled:**:data-[part=value-text]:text-tf-muted"
11
+ ]);
12
+ const sliderHeadRecipe = cva("flex items-baseline justify-between gap-4");
13
+ const sliderLabelRecipe = cva("text-tf-body text-tf-fg data-disabled:text-tf-muted");
14
+ const sliderValueRecipe = cva([
15
+ "font-tf-display text-tf-h4 font-bold tracking-tf-tight tabular-nums",
16
+ "text-tf-fg in-data-dragging:text-tf-accent-hi in-data-focus:text-tf-accent-hi",
17
+ "tf-transition motion-reduce:transition-none"
18
+ ]);
19
+ const sliderControlRecipe = cva([
20
+ "relative flex min-h-tf-target w-full items-center",
21
+ "not-data-readonly:interactive:cursor-pointer",
22
+ "data-readonly:cursor-default"
23
+ ]);
24
+ const sliderTrackRecipe = cva(["h-tf-mark-track w-full overflow-hidden rounded-tf-inline bg-tf-line", "data-disabled:opacity-50"]);
25
+ const sliderRangeRecipe = cva([
26
+ "h-tf-mark-track",
27
+ "bg-tf-blend-rise blend-tf-accent",
28
+ "data-invalid:blend-tf-danger",
29
+ "tf-transition not-data-dragging:tf-travels motion-reduce:transition-none"
30
+ ]);
31
+ const sliderNotchesRecipe = cva("pointer-events-none absolute inset-0");
32
+ const sliderNotchRecipe = cva([
33
+ "h-full w-tf-hairline",
34
+ "data-[state=over-value]:bg-tf-line-hi data-[state=under-value]:bg-tf-shade-under",
35
+ "tf-transition motion-reduce:transition-none"
36
+ ]);
37
+ const sliderThumbRecipe = cva([
38
+ ...markKnob,
39
+ "size-tf-icon-solo-sm blend-tf-accent",
40
+ "inset-ring inset-ring-tf-line-hi",
41
+ "in-data-invalid:inset-ring-tf-danger-hi",
42
+ "tf-glow tf-fill-scale tf-settled-quiet",
43
+ "interactive:hovered:tf-raised",
44
+ "not-data-dragging:tf-travels",
45
+ "data-dragging:bg-tf-fg-held data-dragging:tf-raised",
46
+ "motion-safe:data-dragging:scale-112",
47
+ "data-disabled:opacity-50",
48
+ ...controlReach
49
+ ]);
50
+ const sliderFootRecipe = cva("flex items-baseline justify-between gap-4");
51
+ const sliderHintRecipe = cva("text-tf-caption font-medium", {
52
+ defaultVariants: { invalid: false },
53
+ variants: { invalid: {
54
+ false: "text-tf-muted",
55
+ true: "text-tf-danger-hi tf-arrives"
56
+ } }
57
+ });
58
+ const sliderBoundsRecipe = cva("ms-auto shrink-0 text-tf-caption font-medium text-tf-muted tabular-nums");
59
+ //#endregion
60
+ export { sliderBoundsRecipe, sliderControlRecipe, sliderFootRecipe, sliderHeadRecipe, sliderHintRecipe, sliderKnobSize, sliderLabelRecipe, sliderNotchRecipe, sliderNotchesRecipe, sliderRangeRecipe, sliderRecipe, sliderThumbRecipe, sliderTrackRecipe, sliderValueRecipe };
61
+
62
+ //# sourceMappingURL=slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider.js","names":[],"sources":["../../src/recipes/slider.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlReach } from '#parts/control'\nimport { markKnob } from '#parts/mark'\n\nconst sliderKnobSize = 20\n\nconst sliderRecipe = cva([\n 'flex w-full max-w-tf-panel flex-col gap-2',\n 'font-tf-body',\n 'data-disabled:cursor-not-allowed',\n 'data-disabled:**:data-[part=value-text]:text-tf-muted',\n])\n\nconst sliderHeadRecipe = cva('flex items-baseline justify-between gap-4')\n\nconst sliderLabelRecipe = cva('text-tf-body text-tf-fg data-disabled:text-tf-muted')\n\nconst sliderValueRecipe = cva([\n 'font-tf-display text-tf-h4 font-bold tracking-tf-tight tabular-nums',\n 'text-tf-fg in-data-dragging:text-tf-accent-hi in-data-focus:text-tf-accent-hi',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst sliderControlRecipe = cva([\n 'relative flex min-h-tf-target w-full items-center',\n 'not-data-readonly:interactive:cursor-pointer',\n 'data-readonly:cursor-default',\n])\n\nconst sliderTrackRecipe = cva([\n 'h-tf-mark-track w-full overflow-hidden rounded-tf-inline bg-tf-line',\n 'data-disabled:opacity-50',\n])\n\nconst sliderRangeRecipe = cva([\n 'h-tf-mark-track',\n 'bg-tf-blend-rise blend-tf-accent',\n 'data-invalid:blend-tf-danger',\n 'tf-transition not-data-dragging:tf-travels motion-reduce:transition-none',\n])\n\nconst sliderNotchesRecipe = cva('pointer-events-none absolute inset-0')\n\nconst sliderNotchRecipe = cva([\n 'h-full w-tf-hairline',\n 'data-[state=over-value]:bg-tf-line-hi data-[state=under-value]:bg-tf-shade-under',\n 'tf-transition motion-reduce:transition-none',\n])\n\nconst sliderThumbRecipe = cva([\n ...markKnob,\n 'size-tf-icon-solo-sm blend-tf-accent',\n 'inset-ring inset-ring-tf-line-hi',\n 'in-data-invalid:inset-ring-tf-danger-hi',\n 'tf-glow tf-fill-scale tf-settled-quiet',\n 'interactive:hovered:tf-raised',\n 'not-data-dragging:tf-travels',\n 'data-dragging:bg-tf-fg-held data-dragging:tf-raised',\n 'motion-safe:data-dragging:scale-112',\n 'data-disabled:opacity-50',\n ...controlReach,\n])\n\nconst sliderFootRecipe = cva('flex items-baseline justify-between gap-4')\n\nconst sliderHintRecipe = 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 sliderBoundsRecipe = cva(\n 'ms-auto shrink-0 text-tf-caption font-medium text-tf-muted tabular-nums',\n)\n\nexport {\n sliderBoundsRecipe,\n sliderControlRecipe,\n sliderFootRecipe,\n sliderHeadRecipe,\n sliderHintRecipe,\n sliderKnobSize,\n sliderLabelRecipe,\n sliderNotchRecipe,\n sliderNotchesRecipe,\n sliderRangeRecipe,\n sliderRecipe,\n sliderThumbRecipe,\n sliderTrackRecipe,\n sliderValueRecipe,\n}\n"],"mappings":";;;;AAKA,MAAM,iBAAiB;AAEvB,MAAM,eAAe,IAAI;CACvB;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,2CAA2C;AAExE,MAAM,oBAAoB,IAAI,qDAAqD;AAEnF,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;AACF,CAAC;AAED,MAAM,sBAAsB,IAAI;CAC9B;CACA;CACA;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,CAC5B,uEACA,0BACF,CAAC;AAED,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,sBAAsB,IAAI,sCAAsC;AAEtE,MAAM,oBAAoB,IAAI;CAC5B;CACA;CACA;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI;CAC5B,GAAG;CACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;AACL,CAAC;AAED,MAAM,mBAAmB,IAAI,2CAA2C;AAExE,MAAM,mBAAmB,IAAI,+BAA+B;CAC1D,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EAAE,OAAO;EAAiB,MAAM;CAA+B,EAC1E;AACF,CAAC;AAED,MAAM,qBAAqB,IACzB,yEACF"}
@@ -0,0 +1,30 @@
1
+ import { SparkShape } from "../charts/spark.js";
2
+ import { Tone } from "../tone.js";
3
+ //#region src/recipes/stat.d.ts
4
+ declare const statAccents: readonly ["accent", "success", "warning", "info", "danger"];
5
+ type StatAccent = Tone;
6
+ declare const statDirections: readonly ["up", "down"];
7
+ type StatDirection = (typeof statDirections)[number];
8
+ declare const defaultStatAccent = "accent";
9
+ type StatSurface = 'glass' | 'flat';
10
+ declare const statSurfaces: readonly ["glass", "flat"];
11
+ declare const defaultStatSurface = "glass";
12
+ declare const statRecipe: (props?: ({
13
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | null | undefined;
14
+ surface?: "glass" | "flat" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ declare const statStackRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
17
+ declare const statLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ declare const statFigureRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
19
+ declare const statValueRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
20
+ declare const statUnitRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
21
+ declare const statHintRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
22
+ declare const statSparkShapes: readonly ["line", "bars"];
23
+ type StatSparkShape = SparkShape;
24
+ declare const defaultStatSparkShape = "line";
25
+ declare const statSparkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
26
+ declare const statChangeRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
27
+ declare const statTermRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
28
+ //#endregion
29
+ export { type StatAccent, type StatDirection, type StatSparkShape, type StatSurface, defaultStatAccent, defaultStatSparkShape, defaultStatSurface, statAccents, statChangeRecipe, statDirections, statFigureRecipe, statHintRecipe, statLabelRecipe, statRecipe, statSparkRecipe, statSparkShapes, statStackRecipe, statSurfaces, statTermRecipe, statUnitRecipe, statValueRecipe };
30
+ //# sourceMappingURL=stat.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { toneBlend } from "../tone.js";
2
+ import { defaultTone, tones } from "../parts/tone.js";
3
+ import { tileRoused } from "../parts/rouse.js";
4
+ import { cva } from "class-variance-authority";
5
+ //#region src/recipes/stat.ts
6
+ const statAccents = tones;
7
+ const statDirections = ["up", "down"];
8
+ const defaultStatAccent = defaultTone;
9
+ const BLEND = toneBlend;
10
+ const statSurfaces = ["glass", "flat"];
11
+ const defaultStatSurface = "glass";
12
+ const statRecipe = cva([
13
+ "@container relative isolate flex min-w-0 grow items-center gap-5 p-6",
14
+ "font-tf-body text-tf-fg tf-transition",
15
+ tileRoused
16
+ ], {
17
+ defaultVariants: {
18
+ accent: defaultStatAccent,
19
+ surface: defaultStatSurface
20
+ },
21
+ variants: {
22
+ accent: BLEND,
23
+ surface: {
24
+ flat: "",
25
+ glass: [
26
+ "rounded-tf-card bg-tf-glass shadow-tf-float backdrop-blur-tf-glass",
27
+ "tf-edge-sweep",
28
+ "motion-safe:tf-lands"
29
+ ].join(" ")
30
+ }
31
+ }
32
+ });
33
+ const statStackRecipe = cva("flex min-w-0 grow flex-wrap items-center gap-x-3 gap-y-1");
34
+ const statLabelRecipe = cva(["order-1 grow text-tf-body-sm font-medium text-tf-fg"]);
35
+ const statFigureRecipe = cva("order-3 m-0 flex basis-full flex-nowrap items-baseline gap-2");
36
+ const statValueRecipe = cva(["font-tf-display text-tf-figure font-bold tracking-tf-tight text-tf-fg", "motion-safe:tf-tallies"]);
37
+ const statUnitRecipe = cva("text-tf-unit font-tf-body font-medium text-tf-muted");
38
+ const statHintRecipe = cva("order-4 basis-full text-tf-caption-sm text-tf-muted");
39
+ const statSparkShapes = ["line", "bars"];
40
+ const defaultStatSparkShape = "line";
41
+ const statSparkRecipe = cva("order-5 mt-2 h-7 w-full basis-full");
42
+ const statChangeRecipe = cva([
43
+ "relative order-2 m-0 ml-auto inline-flex items-center gap-1",
44
+ "tf-edge-sweep rounded-tf-pill bg-tf-panel px-2 py-1 blend-tf-accent",
45
+ "text-tf-caption-sm font-normal whitespace-nowrap text-tf-accent-hi tabular-nums",
46
+ "tf-icons [&_svg]:size-tf-icon-sm [&_svg]:shrink-0"
47
+ ]);
48
+ const statTermRecipe = cva("sr-only");
49
+ //#endregion
50
+ export { defaultStatAccent, defaultStatSparkShape, defaultStatSurface, statAccents, statChangeRecipe, statDirections, statFigureRecipe, statHintRecipe, statLabelRecipe, statRecipe, statSparkRecipe, statSparkShapes, statStackRecipe, statSurfaces, statTermRecipe, statUnitRecipe, statValueRecipe };
51
+
52
+ //# sourceMappingURL=stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stat.js","names":[],"sources":["../../src/recipes/stat.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport type { SparkShape } from '#charts/spark'\nimport { tileRoused } from '#parts/rouse'\nimport { defaultTone, tones } from '#parts/tone'\nimport type { Tone } from '#tone'\nimport { toneBlend } from '#tone'\n\nconst statAccents = tones\n\ntype StatAccent = Tone\n\nconst statDirections = ['up', 'down'] as const\n\ntype StatDirection = (typeof statDirections)[number]\n\nconst defaultStatAccent = defaultTone\n\nconst BLEND = toneBlend\n\ntype StatSurface = 'glass' | 'flat'\n\nconst statSurfaces = ['glass', 'flat'] as const satisfies readonly StatSurface[]\n\nconst defaultStatSurface = 'glass' satisfies StatSurface\n\nconst statRecipe = cva(\n [\n '@container relative isolate flex min-w-0 grow items-center gap-5 p-6',\n 'font-tf-body text-tf-fg tf-transition',\n tileRoused,\n ],\n {\n defaultVariants: { accent: defaultStatAccent, surface: defaultStatSurface },\n variants: {\n accent: BLEND,\n surface: {\n flat: '',\n glass: [\n 'rounded-tf-card bg-tf-glass shadow-tf-float backdrop-blur-tf-glass',\n 'tf-edge-sweep',\n 'motion-safe:tf-lands',\n ].join(' '),\n } satisfies Record<StatSurface, string>,\n },\n },\n)\n\nconst statStackRecipe = cva('flex min-w-0 grow flex-wrap items-center gap-x-3 gap-y-1')\n\nconst statLabelRecipe = cva(['order-1 grow text-tf-body-sm font-medium text-tf-fg'])\n\nconst statFigureRecipe = cva('order-3 m-0 flex basis-full flex-nowrap items-baseline gap-2')\n\nconst statValueRecipe = cva([\n 'font-tf-display text-tf-figure font-bold tracking-tf-tight text-tf-fg',\n 'motion-safe:tf-tallies',\n])\n\nconst statUnitRecipe = cva('text-tf-unit font-tf-body font-medium text-tf-muted')\n\nconst statHintRecipe = cva('order-4 basis-full text-tf-caption-sm text-tf-muted')\n\nconst statSparkShapes = ['line', 'bars'] as const satisfies readonly SparkShape[]\n\ntype StatSparkShape = SparkShape\n\nconst defaultStatSparkShape = 'line' satisfies StatSparkShape\n\nconst statSparkRecipe = cva('order-5 mt-2 h-7 w-full basis-full')\n\nconst statChangeRecipe = cva([\n 'relative order-2 m-0 ml-auto inline-flex items-center gap-1',\n 'tf-edge-sweep rounded-tf-pill bg-tf-panel px-2 py-1 blend-tf-accent',\n 'text-tf-caption-sm font-normal whitespace-nowrap text-tf-accent-hi tabular-nums',\n 'tf-icons [&_svg]:size-tf-icon-sm [&_svg]:shrink-0',\n])\n\nconst statTermRecipe = cva('sr-only')\n\nexport {\n type StatAccent,\n type StatDirection,\n type StatSparkShape,\n type StatSurface,\n defaultStatAccent,\n defaultStatSparkShape,\n defaultStatSurface,\n statAccents,\n statChangeRecipe,\n statDirections,\n statFigureRecipe,\n statHintRecipe,\n statLabelRecipe,\n statRecipe,\n statSparkRecipe,\n statSparkShapes,\n statStackRecipe,\n statSurfaces,\n statTermRecipe,\n statUnitRecipe,\n statValueRecipe,\n}\n"],"mappings":";;;;;AAQA,MAAM,cAAc;AAIpB,MAAM,iBAAiB,CAAC,MAAM,MAAM;AAIpC,MAAM,oBAAoB;AAE1B,MAAM,QAAQ;AAId,MAAM,eAAe,CAAC,SAAS,MAAM;AAErC,MAAM,qBAAqB;AAE3B,MAAM,aAAa,IACjB;CACE;CACA;CACA;AACF,GACA;CACE,iBAAiB;EAAE,QAAQ;EAAmB,SAAS;CAAmB;CAC1E,UAAU;EACR,QAAQ;EACR,SAAS;GACP,MAAM;GACN,OAAO;IACL;IACA;IACA;GACF,CAAC,CAAC,KAAK,GAAG;EACZ;CACF;AACF,CACF;AAEA,MAAM,kBAAkB,IAAI,0DAA0D;AAEtF,MAAM,kBAAkB,IAAI,CAAC,qDAAqD,CAAC;AAEnF,MAAM,mBAAmB,IAAI,8DAA8D;AAE3F,MAAM,kBAAkB,IAAI,CAC1B,yEACA,wBACF,CAAC;AAED,MAAM,iBAAiB,IAAI,qDAAqD;AAEhF,MAAM,iBAAiB,IAAI,qDAAqD;AAEhF,MAAM,kBAAkB,CAAC,QAAQ,MAAM;AAIvC,MAAM,wBAAwB;AAE9B,MAAM,kBAAkB,IAAI,oCAAoC;AAEhE,MAAM,mBAAmB,IAAI;CAC3B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,iBAAiB,IAAI,SAAS"}
@@ -0,0 +1,20 @@
1
+ import { Tone } from "../tone.js";
2
+ //#region src/recipes/switch.d.ts
3
+ declare const switchAccents: readonly ["accent", "success", "warning", "info", "danger"];
4
+ type SwitchAccent = Tone;
5
+ declare const defaultSwitchAccent = "accent";
6
+ declare const switchRecipe: (props?: ({
7
+ plate?: "full" | "snug" | "bare" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ declare const switchControlRecipe: (props?: ({
10
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare const switchThumbRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ declare const switchLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
+ declare const switchTitleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
15
+ declare const switchHintRecipe: (props?: ({
16
+ invalid?: boolean | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
+ //#endregion
19
+ export { type SwitchAccent, defaultSwitchAccent, switchAccents, switchControlRecipe, switchHintRecipe, switchLabelRecipe, switchRecipe, switchThumbRecipe, switchTitleRecipe };
20
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1,60 @@
1
+ import { defaultMarkPlate } from "../mark.js";
2
+ import { toneBlend } from "../tone.js";
3
+ import { defaultTone, tones } from "../parts/tone.js";
4
+ import { markFace, markKnob, markPlate, markPlated, markPress, markRow, markStack, markTitle } from "../parts/mark.js";
5
+ import { cva } from "class-variance-authority";
6
+ //#region src/recipes/switch.ts
7
+ const switchAccents = tones;
8
+ const defaultSwitchAccent = defaultTone;
9
+ const TRACK = [
10
+ "box-border justify-start rounded-tf-control",
11
+ "w-[calc(var(--spacing-tf-icon-lg)*2)]",
12
+ "h-[calc(var(--spacing-tf-icon-md)+2*var(--spacing-tf-mark-inset))]",
13
+ "p-tf-mark-inset"
14
+ ];
15
+ const FILL = ["bg-tf-panel", "tf-ramp"];
16
+ const OFF = ["data-[state=unchecked]:interactive:not-data-readonly:hovered:bg-tf-panel-hi"];
17
+ const ON = [
18
+ "data-[state=checked]:tf-mark-lit",
19
+ "data-[state=checked]:tf-mark-glowing",
20
+ "data-[state=checked]:bg-tf-blend",
21
+ "data-[state=checked]:interactive:not-data-readonly:hovered:tf-blended"
22
+ ];
23
+ const switchRecipe = cva([...markRow, "justify-between gap-6"], {
24
+ defaultVariants: { plate: defaultMarkPlate },
25
+ variants: { plate: {
26
+ bare: `${markPlate.bare} ${markPlated.bare}`,
27
+ full: `${markPlate.full} ${markPlated.full}`,
28
+ snug: `${markPlate.snug} ${markPlated.snug}`
29
+ } }
30
+ });
31
+ const switchControlRecipe = cva([
32
+ ...markFace,
33
+ ...TRACK,
34
+ ...FILL,
35
+ ...OFF,
36
+ ...ON,
37
+ "data-invalid:blend-tf-danger data-invalid:tf-mark-failed"
38
+ ], {
39
+ defaultVariants: { accent: defaultSwitchAccent },
40
+ variants: { accent: toneBlend }
41
+ });
42
+ const switchThumbRecipe = cva([
43
+ ...markKnob,
44
+ "size-tf-icon-md",
45
+ "data-[state=checked]:translate-x-tf-icon-sm",
46
+ markPress
47
+ ]);
48
+ const switchLabelRecipe = cva(markStack);
49
+ const switchTitleRecipe = cva(markTitle);
50
+ const switchHintRecipe = cva("text-tf-caption font-medium", {
51
+ defaultVariants: { invalid: false },
52
+ variants: { invalid: {
53
+ false: "text-tf-muted",
54
+ true: "text-tf-danger-hi tf-arrives"
55
+ } }
56
+ });
57
+ //#endregion
58
+ export { defaultSwitchAccent, switchAccents, switchControlRecipe, switchHintRecipe, switchLabelRecipe, switchRecipe, switchThumbRecipe, switchTitleRecipe };
59
+
60
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","names":[],"sources":["../../src/recipes/switch.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport type { MarkPlate } from '#mark'\nimport { defaultMarkPlate } from '#mark'\nimport {\n markFace,\n markKnob,\n markPlate,\n markPlated,\n markPress,\n markRow,\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 switchAccents = tones\n\ntype SwitchAccent = Tone\n\nconst defaultSwitchAccent = defaultTone\n\nconst TRACK = [\n 'box-border justify-start rounded-tf-control',\n 'w-[calc(var(--spacing-tf-icon-lg)*2)]',\n 'h-[calc(var(--spacing-tf-icon-md)+2*var(--spacing-tf-mark-inset))]',\n 'p-tf-mark-inset',\n]\n\nconst FILL = ['bg-tf-panel', 'tf-ramp']\n\nconst OFF = ['data-[state=unchecked]:interactive:not-data-readonly:hovered:bg-tf-panel-hi']\n\nconst ON = [\n 'data-[state=checked]:tf-mark-lit',\n 'data-[state=checked]:tf-mark-glowing',\n 'data-[state=checked]:bg-tf-blend',\n 'data-[state=checked]:interactive:not-data-readonly:hovered:tf-blended',\n]\n\nconst switchRecipe = cva([...markRow, 'justify-between gap-6'], {\n defaultVariants: { plate: defaultMarkPlate },\n variants: {\n plate: {\n bare: `${markPlate.bare} ${markPlated.bare}`,\n full: `${markPlate.full} ${markPlated.full}`,\n snug: `${markPlate.snug} ${markPlated.snug}`,\n } satisfies Record<MarkPlate, string>,\n },\n})\n\nconst switchControlRecipe = cva(\n [\n ...markFace,\n ...TRACK,\n ...FILL,\n ...OFF,\n ...ON,\n 'data-invalid:blend-tf-danger data-invalid:tf-mark-failed',\n ],\n {\n defaultVariants: { accent: defaultSwitchAccent },\n variants: { accent: toneBlend },\n },\n)\n\nconst switchThumbRecipe = cva([\n ...markKnob,\n 'size-tf-icon-md',\n 'data-[state=checked]:translate-x-tf-icon-sm',\n markPress,\n])\n\nconst switchLabelRecipe = cva(markStack)\n\nconst switchTitleRecipe = cva(markTitle)\n\nconst switchHintRecipe = 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 SwitchAccent,\n defaultSwitchAccent,\n switchAccents,\n switchControlRecipe,\n switchHintRecipe,\n switchLabelRecipe,\n switchRecipe,\n switchThumbRecipe,\n switchTitleRecipe,\n}\n"],"mappings":";;;;;;AAkBA,MAAM,gBAAgB;AAItB,MAAM,sBAAsB;AAE5B,MAAM,QAAQ;CACZ;CACA;CACA;CACA;AACF;AAEA,MAAM,OAAO,CAAC,eAAe,SAAS;AAEtC,MAAM,MAAM,CAAC,6EAA6E;AAE1F,MAAM,KAAK;CACT;CACA;CACA;CACA;AACF;AAEA,MAAM,eAAe,IAAI,CAAC,GAAG,SAAS,uBAAuB,GAAG;CAC9D,iBAAiB,EAAE,OAAO,iBAAiB;CAC3C,UAAU,EACR,OAAO;EACL,MAAM,GAAG,UAAU,KAAK,GAAG,WAAW;EACtC,MAAM,GAAG,UAAU,KAAK,GAAG,WAAW;EACtC,MAAM,GAAG,UAAU,KAAK,GAAG,WAAW;CACxC,EACF;AACF,CAAC;AAED,MAAM,sBAAsB,IAC1B;CACE,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH;AACF,GACA;CACE,iBAAiB,EAAE,QAAQ,oBAAoB;CAC/C,UAAU,EAAE,QAAQ,UAAU;AAChC,CACF;AAEA,MAAM,oBAAoB,IAAI;CAC5B,GAAG;CACH;CACA;CACA;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,SAAS;AAEvC,MAAM,oBAAoB,IAAI,SAAS;AAEvC,MAAM,mBAAmB,IAAI,+BAA+B;CAC1D,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EAAE,OAAO;EAAiB,MAAM;CAA+B,EAC1E;AACF,CAAC"}