@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,74 @@
1
+ //#region src/recipes/table.d.ts
2
+ type TableAlign = 'start' | 'end';
3
+ type TableFilterKind = 'text' | 'enum' | 'range';
4
+ declare const tablePinWidth = 52;
5
+ declare const tableActionsWidth = 160;
6
+ declare const tableRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const tableToolbarRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ declare const tableSearchRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare const tableAppliedRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ declare const tableSelectionRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ declare const tableSelectionCountRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ declare const tableSelectionActionsRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ declare const tableCardRecipe: (props?: ({
14
+ bordered?: boolean | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ declare const tableScrollRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
17
+ declare const tableGridRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ declare const tableHeadRowRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
19
+ declare const tableHeadCellRecipe: (props?: ({
20
+ align?: "end" | "start" | null | undefined;
21
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
22
+ declare const tableHeadingRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
23
+ declare const tableSortRecipe: (props?: ({
24
+ sorted?: boolean | null | undefined;
25
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
26
+ declare const tableSortLabelRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
27
+ declare const tableSortIconRecipe: (props?: ({
28
+ descending?: boolean | null | undefined;
29
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
30
+ declare const tableSortMarkRecipe: (props?: ({
31
+ sorted?: boolean | null | undefined;
32
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
33
+ declare const tableFilterMarkRecipe: (props?: ({
34
+ on?: boolean | null | undefined;
35
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
36
+ declare const tableRankRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
37
+ declare const tableFilterRecipe: (props?: ({
38
+ on?: boolean | null | undefined;
39
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
40
+ declare const tableRuleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
41
+ declare const tableBodyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
42
+ declare const tableGroupRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
43
+ declare const tableRowRecipe: (props?: ({
44
+ accent?: "accent" | "success" | "warning" | "info" | "danger" | "none" | null | undefined;
45
+ dense?: boolean | null | undefined;
46
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
47
+ declare const tableSelectCellRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
48
+ declare const tableMarkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
49
+ declare const tableCellRecipe: (props?: ({
50
+ align?: "end" | "start" | null | undefined;
51
+ mono?: boolean | null | undefined;
52
+ tabular?: boolean | null | undefined;
53
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
54
+ declare const tableValueRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
55
+ declare const tableExpandRecipe: (props?: ({
56
+ open?: boolean | null | undefined;
57
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
58
+ declare const tableExpandIconRecipe: (props?: ({
59
+ open?: boolean | null | undefined;
60
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
61
+ declare const tableActionsCellRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
62
+ declare const tableStepRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
63
+ declare const tableDetailRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
64
+ declare const tableDetailBodyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
65
+ declare const tableSkeletonBarRecipe: (props?: ({
66
+ numeric?: boolean | null | undefined;
67
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
68
+ declare const tableSkeletonMarkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
69
+ declare const tableEmptyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
70
+ declare const tableEmptyTitleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
71
+ declare const tableEmptyHintRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
72
+ //#endregion
73
+ export { type TableAlign, type TableFilterKind, tableActionsCellRecipe, tableActionsWidth, tableAppliedRecipe, tableBodyRecipe, tableCardRecipe, tableCellRecipe, tableDetailBodyRecipe, tableDetailRecipe, tableEmptyHintRecipe, tableEmptyRecipe, tableEmptyTitleRecipe, tableExpandIconRecipe, tableExpandRecipe, tableFilterMarkRecipe, tableFilterRecipe, tableGridRecipe, tableGroupRecipe, tableHeadCellRecipe, tableHeadRowRecipe, tableHeadingRecipe, tableMarkRecipe, tablePinWidth, tableRankRecipe, tableRecipe, tableRowRecipe, tableRuleRecipe, tableScrollRecipe, tableSearchRecipe, tableSelectCellRecipe, tableSelectionActionsRecipe, tableSelectionCountRecipe, tableSelectionRecipe, tableSkeletonBarRecipe, tableSkeletonMarkRecipe, tableSortIconRecipe, tableSortLabelRecipe, tableSortMarkRecipe, tableSortRecipe, tableStepRecipe, tableToolbarRecipe, tableValueRecipe };
74
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1,182 @@
1
+ import { toneTint } from "../tone.js";
2
+ import { controlInert, controlPress, controlQuietIcon, controlReach } from "../parts/control.js";
3
+ import { ruleFading } from "../parts/rule.js";
4
+ import { eyebrowQuiet, eyebrowType } from "../parts/eyebrow.js";
5
+ import { revealedControl, revealedIcon, shownControl, shownIcon } from "../parts/reveal.js";
6
+ import { cva } from "class-variance-authority";
7
+ //#region src/recipes/table.ts
8
+ const defaultTableAlign = "start";
9
+ const TIGHT = [
10
+ "flex size-tf-control-2xs flex-none items-center justify-center rounded-tf-inline",
11
+ "tf-icons [&_svg]:size-tf-icon-2xs [&_svg]:shrink-0",
12
+ "cursor-pointer tf-transition motion-reduce:transition-none",
13
+ "interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg",
14
+ ...controlReach,
15
+ ...controlInert
16
+ ];
17
+ const CELL = "flex min-w-0 items-center px-4";
18
+ const tablePinWidth = 52;
19
+ const tableActionsWidth = 160;
20
+ const tableRecipe = cva("flex w-full min-w-0 flex-col gap-8 font-tf-body");
21
+ const tableToolbarRecipe = cva("flex flex-wrap items-center gap-3");
22
+ const tableSearchRecipe = cva("max-w-tf-panel flex-none");
23
+ const tableAppliedRecipe = cva("flex flex-1 flex-wrap items-center justify-end gap-2");
24
+ const tableSelectionRecipe = cva(["flex flex-wrap items-center gap-4 rounded-tf-control bg-tf-accent-tint px-4 py-3", "animate-tf-in motion-reduce:animate-none"]);
25
+ const tableSelectionCountRecipe = cva("text-tf-body-sm font-medium text-tf-accent-hi");
26
+ const tableSelectionActionsRecipe = cva("ml-auto flex flex-wrap items-center gap-2");
27
+ const tableCardRecipe = cva("relative isolate rounded-tf-card", {
28
+ defaultVariants: { bordered: true },
29
+ variants: { bordered: {
30
+ false: "",
31
+ true: "tf-edge-sweep tf-swept blend-tf-accent tf-edge-plain"
32
+ } }
33
+ });
34
+ const tableScrollRecipe = cva(["tf-scroll-thin overflow-x-auto rounded-tf-card", "tf-resizes motion-reduce:transition-none"]);
35
+ const tableGridRecipe = cva("overflow-x-clip text-tf-body-sm font-medium text-tf-fg");
36
+ const tableHeadRowRecipe = cva("grid h-tf-control-md");
37
+ const tableHeadCellRecipe = cva([CELL, "gap-1 whitespace-nowrap"], {
38
+ defaultVariants: { align: defaultTableAlign },
39
+ variants: { align: {
40
+ end: "justify-end",
41
+ start: ""
42
+ } }
43
+ });
44
+ const tableHeadingRecipe = cva([`flex-none text-tf-caption ${eyebrowQuiet}`]);
45
+ const tableSortRecipe = cva([
46
+ "-ml-2 flex h-tf-row min-w-0 items-center gap-2 rounded-tf-inline px-2",
47
+ `text-tf-caption ${eyebrowType}`,
48
+ "tf-icons [&_svg]:size-tf-icon-2xs [&_svg]:shrink-0",
49
+ "cursor-pointer tf-transition motion-reduce:transition-none",
50
+ "interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg",
51
+ ...controlReach,
52
+ ...controlPress,
53
+ ...controlInert
54
+ ], {
55
+ defaultVariants: { sorted: false },
56
+ variants: { sorted: {
57
+ false: "text-tf-muted",
58
+ true: "text-tf-accent-hi"
59
+ } }
60
+ });
61
+ const tableSortLabelRecipe = cva("min-w-0 truncate");
62
+ const tableSortIconRecipe = cva("tf-transition motion-reduce:transition-none", {
63
+ defaultVariants: { descending: false },
64
+ variants: { descending: {
65
+ false: "",
66
+ true: "rotate-180"
67
+ } }
68
+ });
69
+ const tableSortMarkRecipe = cva("", {
70
+ defaultVariants: { sorted: false },
71
+ variants: { sorted: {
72
+ false: revealedIcon,
73
+ true: shownIcon
74
+ } }
75
+ });
76
+ const tableFilterMarkRecipe = cva("", {
77
+ defaultVariants: { on: false },
78
+ variants: { on: {
79
+ false: revealedControl,
80
+ true: shownControl
81
+ } }
82
+ });
83
+ const tableRankRecipe = cva(["flex-none rounded-tf-pill bg-tf-accent-tint px-1.5", "text-tf-caption-sm font-normal text-tf-accent-hi tabular-nums"]);
84
+ const tableFilterRecipe = cva(TIGHT, {
85
+ defaultVariants: { on: false },
86
+ variants: { on: {
87
+ false: "text-tf-muted",
88
+ true: "bg-tf-accent-tint text-tf-accent-hi"
89
+ } }
90
+ });
91
+ const tableRuleRecipe = cva(`block ${ruleFading}`);
92
+ const tableBodyRecipe = cva([
93
+ "data-[going=forward]:[--tf-page-from:calc(var(--spacing)*4)]",
94
+ "data-[going=back]:[--tf-page-from:calc(var(--spacing)*-4)]",
95
+ "data-[step=a]:motion-safe:animate-tf-page",
96
+ "data-[step=b]:motion-safe:animate-tf-page-again"
97
+ ]);
98
+ const tableGroupRecipe = cva("border-b border-tf-line-2 last:border-b-0");
99
+ const tableRowRecipe = cva(["grid tf-transition motion-reduce:transition-none", ...[
100
+ "relative",
101
+ "before:pointer-events-none before:absolute before:inset-0 before:content-['']",
102
+ "before:tf-transition before:motion-reduce:transition-none",
103
+ "not-data-selected:hovered:before:bg-tf-panel-2",
104
+ "data-selected:before:bg-tf-accent-tint"
105
+ ]], {
106
+ defaultVariants: {
107
+ accent: "none",
108
+ dense: false
109
+ },
110
+ variants: {
111
+ accent: {
112
+ ...toneTint,
113
+ none: ""
114
+ },
115
+ dense: {
116
+ false: "h-tf-control-lg",
117
+ true: "h-tf-control-md"
118
+ }
119
+ }
120
+ });
121
+ const tableSelectCellRecipe = cva("flex items-center justify-center");
122
+ const tableMarkRecipe = cva("flex");
123
+ const tableCellRecipe = cva([CELL, "gap-3"], {
124
+ defaultVariants: {
125
+ align: defaultTableAlign,
126
+ mono: false,
127
+ tabular: false
128
+ },
129
+ variants: {
130
+ align: {
131
+ end: "justify-end text-right",
132
+ start: ""
133
+ },
134
+ mono: {
135
+ false: "",
136
+ true: "font-mono"
137
+ },
138
+ tabular: {
139
+ false: "",
140
+ true: "whitespace-nowrap tabular-nums"
141
+ }
142
+ }
143
+ });
144
+ const tableValueRecipe = cva("min-w-0 truncate");
145
+ const tableExpandRecipe = cva(TIGHT, {
146
+ defaultVariants: { open: false },
147
+ variants: { open: {
148
+ false: "text-tf-muted",
149
+ true: "text-tf-accent-hi"
150
+ } }
151
+ });
152
+ const tableExpandIconRecipe = cva("tf-transition motion-reduce:transition-none", {
153
+ defaultVariants: { open: false },
154
+ variants: { open: {
155
+ false: "",
156
+ true: "rotate-90"
157
+ } }
158
+ });
159
+ const tableActionsCellRecipe = cva([
160
+ "sticky right-0 flex items-center justify-end gap-2 pr-3 pl-6",
161
+ "backdrop-blur-tf-panel in-data-turning:bg-tf-surface-quiet",
162
+ "before:absolute before:inset-y-0 before:left-0 before:w-tf-hairline before:bg-tf-line-2",
163
+ "before:content-['']"
164
+ ]);
165
+ const tableStepRecipe = cva(controlQuietIcon);
166
+ const tableDetailRecipe = cva("tf-unfolds bg-tf-sunken-hi motion-reduce:transition-none");
167
+ const tableDetailBodyRecipe = cva(["py-5 pr-6 pl-16", "animate-tf-fade-in motion-reduce:animate-none"]);
168
+ const tableSkeletonBarRecipe = cva("h-3 tf-breathing rounded-tf-pill bg-tf-panel", {
169
+ defaultVariants: { numeric: false },
170
+ variants: { numeric: {
171
+ false: "w-3/5",
172
+ true: "w-2/5"
173
+ } }
174
+ });
175
+ const tableSkeletonMarkRecipe = cva("size-tf-icon-lg flex-none tf-breathing rounded-tf-inline bg-tf-panel");
176
+ const tableEmptyRecipe = cva("flex flex-col items-center gap-2 px-6 py-14 text-center");
177
+ const tableEmptyTitleRecipe = cva("font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg");
178
+ const tableEmptyHintRecipe = cva("text-tf-body-sm font-medium text-tf-muted");
179
+ //#endregion
180
+ export { tableActionsCellRecipe, tableActionsWidth, tableAppliedRecipe, tableBodyRecipe, tableCardRecipe, tableCellRecipe, tableDetailBodyRecipe, tableDetailRecipe, tableEmptyHintRecipe, tableEmptyRecipe, tableEmptyTitleRecipe, tableExpandIconRecipe, tableExpandRecipe, tableFilterMarkRecipe, tableFilterRecipe, tableGridRecipe, tableGroupRecipe, tableHeadCellRecipe, tableHeadRowRecipe, tableHeadingRecipe, tableMarkRecipe, tablePinWidth, tableRankRecipe, tableRecipe, tableRowRecipe, tableRuleRecipe, tableScrollRecipe, tableSearchRecipe, tableSelectCellRecipe, tableSelectionActionsRecipe, tableSelectionCountRecipe, tableSelectionRecipe, tableSkeletonBarRecipe, tableSkeletonMarkRecipe, tableSortIconRecipe, tableSortLabelRecipe, tableSortMarkRecipe, tableSortRecipe, tableStepRecipe, tableToolbarRecipe, tableValueRecipe };
181
+
182
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","names":[],"sources":["../../src/recipes/table.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlInert, controlPress, controlQuietIcon, controlReach } from '#parts/control'\nimport { eyebrowQuiet, eyebrowType } from '#parts/eyebrow'\nimport { revealedControl, revealedIcon, shownControl, shownIcon } from '#parts/reveal'\nimport { ruleFading } from '#parts/rule'\nimport { toneTint } from '#tone'\n\ntype TableAlign = 'start' | 'end'\n\ntype TableFilterKind = 'text' | 'enum' | 'range'\n\nconst defaultTableAlign = 'start' satisfies TableAlign\n\nconst TIGHT = [\n 'flex size-tf-control-2xs flex-none items-center justify-center rounded-tf-inline',\n 'tf-icons [&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n 'interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n ...controlReach,\n ...controlInert,\n]\n\nconst CELL = 'flex min-w-0 items-center px-4'\n\nconst tablePinWidth = 52\n\nconst tableActionsWidth = 160\n\nconst tableRecipe = cva('flex w-full min-w-0 flex-col gap-8 font-tf-body')\n\nconst tableToolbarRecipe = cva('flex flex-wrap items-center gap-3')\n\nconst tableSearchRecipe = cva('max-w-tf-panel flex-none')\n\nconst tableAppliedRecipe = cva('flex flex-1 flex-wrap items-center justify-end gap-2')\n\nconst tableSelectionRecipe = cva([\n 'flex flex-wrap items-center gap-4 rounded-tf-control bg-tf-accent-tint px-4 py-3',\n 'animate-tf-in motion-reduce:animate-none',\n])\n\nconst tableSelectionCountRecipe = cva('text-tf-body-sm font-medium text-tf-accent-hi')\n\nconst tableSelectionActionsRecipe = cva('ml-auto flex flex-wrap items-center gap-2')\n\nconst tableCardRecipe = cva('relative isolate rounded-tf-card', {\n defaultVariants: { bordered: true },\n variants: {\n bordered: {\n false: '',\n true: 'tf-edge-sweep tf-swept blend-tf-accent tf-edge-plain',\n },\n },\n})\n\nconst tableScrollRecipe = cva([\n 'tf-scroll-thin overflow-x-auto rounded-tf-card',\n 'tf-resizes motion-reduce:transition-none',\n])\n\nconst tableGridRecipe = cva('overflow-x-clip text-tf-body-sm font-medium text-tf-fg')\n\nconst tableHeadRowRecipe = cva('grid h-tf-control-md')\n\nconst tableHeadCellRecipe = cva([CELL, 'gap-1 whitespace-nowrap'], {\n defaultVariants: { align: defaultTableAlign },\n variants: {\n align: {\n end: 'justify-end',\n start: '',\n } satisfies Record<TableAlign, string>,\n },\n})\n\nconst tableHeadingRecipe = cva([`flex-none text-tf-caption ${eyebrowQuiet}`])\n\nconst tableSortRecipe = cva(\n [\n '-ml-2 flex h-tf-row min-w-0 items-center gap-2 rounded-tf-inline px-2',\n `text-tf-caption ${eyebrowType}`,\n 'tf-icons [&_svg]:size-tf-icon-2xs [&_svg]:shrink-0',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n 'interactive:hovered:bg-tf-panel-hi interactive:hovered:text-tf-fg',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n ],\n {\n defaultVariants: { sorted: false },\n variants: {\n sorted: { false: 'text-tf-muted', true: 'text-tf-accent-hi' },\n },\n },\n)\n\nconst tableSortLabelRecipe = cva('min-w-0 truncate')\n\nconst tableSortIconRecipe = cva('tf-transition motion-reduce:transition-none', {\n defaultVariants: { descending: false },\n variants: {\n descending: { false: '', true: 'rotate-180' },\n },\n})\n\nconst tableSortMarkRecipe = cva('', {\n defaultVariants: { sorted: false },\n variants: {\n sorted: { false: revealedIcon, true: shownIcon },\n },\n})\n\nconst tableFilterMarkRecipe = cva('', {\n defaultVariants: { on: false },\n variants: {\n on: { false: revealedControl, true: shownControl },\n },\n})\n\nconst tableRankRecipe = cva([\n 'flex-none rounded-tf-pill bg-tf-accent-tint px-1.5',\n 'text-tf-caption-sm font-normal text-tf-accent-hi tabular-nums',\n])\n\nconst tableFilterRecipe = cva(TIGHT, {\n defaultVariants: { on: false },\n variants: {\n on: { false: 'text-tf-muted', true: 'bg-tf-accent-tint text-tf-accent-hi' },\n },\n})\n\nconst tableRuleRecipe = cva(`block ${ruleFading}`)\n\nconst PAGING = [\n 'data-[going=forward]:[--tf-page-from:calc(var(--spacing)*4)]',\n 'data-[going=back]:[--tf-page-from:calc(var(--spacing)*-4)]',\n 'data-[step=a]:motion-safe:animate-tf-page',\n 'data-[step=b]:motion-safe:animate-tf-page-again',\n]\n\nconst tableBodyRecipe = cva(PAGING)\n\nconst tableGroupRecipe = cva('border-b border-tf-line-2 last:border-b-0')\n\nconst A_WASH_OVER_WHATEVER_IS_THERE = [\n 'relative',\n \"before:pointer-events-none before:absolute before:inset-0 before:content-['']\",\n 'before:tf-transition before:motion-reduce:transition-none',\n 'not-data-selected:hovered:before:bg-tf-panel-2',\n 'data-selected:before:bg-tf-accent-tint',\n]\n\nconst tableRowRecipe = cva(\n ['grid tf-transition motion-reduce:transition-none', ...A_WASH_OVER_WHATEVER_IS_THERE],\n {\n defaultVariants: { accent: 'none', dense: false },\n variants: {\n accent: { ...toneTint, none: '' },\n dense: { false: 'h-tf-control-lg', true: 'h-tf-control-md' },\n },\n },\n)\n\nconst tableSelectCellRecipe = cva('flex items-center justify-center')\n\nconst tableMarkRecipe = cva('flex')\n\nconst tableCellRecipe = cva([CELL, 'gap-3'], {\n defaultVariants: { align: defaultTableAlign, mono: false, tabular: false },\n variants: {\n align: {\n end: 'justify-end text-right',\n start: '',\n } satisfies Record<TableAlign, string>,\n mono: { false: '', true: 'font-mono' },\n tabular: { false: '', true: 'whitespace-nowrap tabular-nums' },\n },\n})\n\nconst tableValueRecipe = cva('min-w-0 truncate')\n\nconst tableExpandRecipe = cva(TIGHT, {\n defaultVariants: { open: false },\n variants: {\n open: { false: 'text-tf-muted', true: 'text-tf-accent-hi' },\n },\n})\n\nconst tableExpandIconRecipe = cva('tf-transition motion-reduce:transition-none', {\n defaultVariants: { open: false },\n variants: {\n open: { false: '', true: 'rotate-90' },\n },\n})\n\nconst tableActionsCellRecipe = cva([\n 'sticky right-0 flex items-center justify-end gap-2 pr-3 pl-6',\n 'backdrop-blur-tf-panel in-data-turning:bg-tf-surface-quiet',\n 'before:absolute before:inset-y-0 before:left-0 before:w-tf-hairline before:bg-tf-line-2',\n \"before:content-['']\",\n])\n\nconst tableStepRecipe = cva(controlQuietIcon)\n\nconst tableDetailRecipe = cva('tf-unfolds bg-tf-sunken-hi motion-reduce:transition-none')\n\nconst tableDetailBodyRecipe = cva([\n 'py-5 pr-6 pl-16',\n 'animate-tf-fade-in motion-reduce:animate-none',\n])\n\nconst tableSkeletonBarRecipe = cva('h-3 tf-breathing rounded-tf-pill bg-tf-panel', {\n defaultVariants: { numeric: false },\n variants: {\n numeric: { false: 'w-3/5', true: 'w-2/5' },\n },\n})\n\nconst tableSkeletonMarkRecipe = cva(\n 'size-tf-icon-lg flex-none tf-breathing rounded-tf-inline bg-tf-panel',\n)\n\nconst tableEmptyRecipe = cva('flex flex-col items-center gap-2 px-6 py-14 text-center')\n\nconst tableEmptyTitleRecipe = cva(\n 'font-tf-display text-tf-h4 font-bold tracking-tf-tight text-tf-fg',\n)\n\nconst tableEmptyHintRecipe = cva('text-tf-body-sm font-medium text-tf-muted')\n\nexport {\n type TableAlign,\n type TableFilterKind,\n tableActionsCellRecipe,\n tableActionsWidth,\n tableAppliedRecipe,\n tableBodyRecipe,\n tableCardRecipe,\n tableCellRecipe,\n tableDetailBodyRecipe,\n tableDetailRecipe,\n tableEmptyHintRecipe,\n tableEmptyRecipe,\n tableEmptyTitleRecipe,\n tableExpandIconRecipe,\n tableExpandRecipe,\n tableFilterRecipe,\n tableGridRecipe,\n tableGroupRecipe,\n tableHeadCellRecipe,\n tableHeadRowRecipe,\n tableHeadingRecipe,\n tableMarkRecipe,\n tablePinWidth,\n tableRecipe,\n tableRowRecipe,\n tableRuleRecipe,\n tableScrollRecipe,\n tableSearchRecipe,\n tableSelectCellRecipe,\n tableSelectionActionsRecipe,\n tableSelectionCountRecipe,\n tableSelectionRecipe,\n tableSkeletonBarRecipe,\n tableSkeletonMarkRecipe,\n tableFilterMarkRecipe,\n tableRankRecipe,\n tableSortIconRecipe,\n tableSortMarkRecipe,\n tableSortLabelRecipe,\n tableSortRecipe,\n tableStepRecipe,\n tableToolbarRecipe,\n tableValueRecipe,\n}\n"],"mappings":";;;;;;;AAYA,MAAM,oBAAoB;AAE1B,MAAM,QAAQ;CACZ;CACA;CACA;CACA;CACA,GAAG;CACH,GAAG;AACL;AAEA,MAAM,OAAO;AAEb,MAAM,gBAAgB;AAEtB,MAAM,oBAAoB;AAE1B,MAAM,cAAc,IAAI,iDAAiD;AAEzE,MAAM,qBAAqB,IAAI,mCAAmC;AAElE,MAAM,oBAAoB,IAAI,0BAA0B;AAExD,MAAM,qBAAqB,IAAI,sDAAsD;AAErF,MAAM,uBAAuB,IAAI,CAC/B,oFACA,0CACF,CAAC;AAED,MAAM,4BAA4B,IAAI,+CAA+C;AAErF,MAAM,8BAA8B,IAAI,2CAA2C;AAEnF,MAAM,kBAAkB,IAAI,oCAAoC;CAC9D,iBAAiB,EAAE,UAAU,KAAK;CAClC,UAAU,EACR,UAAU;EACR,OAAO;EACP,MAAM;CACR,EACF;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,CAC5B,kDACA,0CACF,CAAC;AAED,MAAM,kBAAkB,IAAI,wDAAwD;AAEpF,MAAM,qBAAqB,IAAI,sBAAsB;AAErD,MAAM,sBAAsB,IAAI,CAAC,MAAM,yBAAyB,GAAG;CACjE,iBAAiB,EAAE,OAAO,kBAAkB;CAC5C,UAAU,EACR,OAAO;EACL,KAAK;EACL,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAM,qBAAqB,IAAI,CAAC,6BAA6B,cAAc,CAAC;AAE5E,MAAM,kBAAkB,IACtB;CACE;CACA,mBAAmB;CACnB;CACA;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,QAAQ,MAAM;CACjC,UAAU,EACR,QAAQ;EAAE,OAAO;EAAiB,MAAM;CAAoB,EAC9D;AACF,CACF;AAEA,MAAM,uBAAuB,IAAI,kBAAkB;AAEnD,MAAM,sBAAsB,IAAI,+CAA+C;CAC7E,iBAAiB,EAAE,YAAY,MAAM;CACrC,UAAU,EACR,YAAY;EAAE,OAAO;EAAI,MAAM;CAAa,EAC9C;AACF,CAAC;AAED,MAAM,sBAAsB,IAAI,IAAI;CAClC,iBAAiB,EAAE,QAAQ,MAAM;CACjC,UAAU,EACR,QAAQ;EAAE,OAAO;EAAc,MAAM;CAAU,EACjD;AACF,CAAC;AAED,MAAM,wBAAwB,IAAI,IAAI;CACpC,iBAAiB,EAAE,IAAI,MAAM;CAC7B,UAAU,EACR,IAAI;EAAE,OAAO;EAAiB,MAAM;CAAa,EACnD;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,CAC1B,sDACA,+DACF,CAAC;AAED,MAAM,oBAAoB,IAAI,OAAO;CACnC,iBAAiB,EAAE,IAAI,MAAM;CAC7B,UAAU,EACR,IAAI;EAAE,OAAO;EAAiB,MAAM;CAAsC,EAC5E;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,SAAS,YAAY;AASjD,MAAM,kBAAkB,IAAI;CAN1B;CACA;CACA;CACA;AAG+B,CAAC;AAElC,MAAM,mBAAmB,IAAI,2CAA2C;AAUxE,MAAM,iBAAiB,IACrB,CAAC,oDAAoD,GAAG;CARxD;CACA;CACA;CACA;CACA;AAIoF,CAAC,GACrF;CACE,iBAAiB;EAAE,QAAQ;EAAQ,OAAO;CAAM;CAChD,UAAU;EACR,QAAQ;GAAE,GAAG;GAAU,MAAM;EAAG;EAChC,OAAO;GAAE,OAAO;GAAmB,MAAM;EAAkB;CAC7D;AACF,CACF;AAEA,MAAM,wBAAwB,IAAI,kCAAkC;AAEpE,MAAM,kBAAkB,IAAI,MAAM;AAElC,MAAM,kBAAkB,IAAI,CAAC,MAAM,OAAO,GAAG;CAC3C,iBAAiB;EAAE,OAAO;EAAmB,MAAM;EAAO,SAAS;CAAM;CACzE,UAAU;EACR,OAAO;GACL,KAAK;GACL,OAAO;EACT;EACA,MAAM;GAAE,OAAO;GAAI,MAAM;EAAY;EACrC,SAAS;GAAE,OAAO;GAAI,MAAM;EAAiC;CAC/D;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,kBAAkB;AAE/C,MAAM,oBAAoB,IAAI,OAAO;CACnC,iBAAiB,EAAE,MAAM,MAAM;CAC/B,UAAU,EACR,MAAM;EAAE,OAAO;EAAiB,MAAM;CAAoB,EAC5D;AACF,CAAC;AAED,MAAM,wBAAwB,IAAI,+CAA+C;CAC/E,iBAAiB,EAAE,MAAM,MAAM;CAC/B,UAAU,EACR,MAAM;EAAE,OAAO;EAAI,MAAM;CAAY,EACvC;AACF,CAAC;AAED,MAAM,yBAAyB,IAAI;CACjC;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,gBAAgB;AAE5C,MAAM,oBAAoB,IAAI,0DAA0D;AAExF,MAAM,wBAAwB,IAAI,CAChC,mBACA,+CACF,CAAC;AAED,MAAM,yBAAyB,IAAI,gDAAgD;CACjF,iBAAiB,EAAE,SAAS,MAAM;CAClC,UAAU,EACR,SAAS;EAAE,OAAO;EAAS,MAAM;CAAQ,EAC3C;AACF,CAAC;AAED,MAAM,0BAA0B,IAC9B,sEACF;AAEA,MAAM,mBAAmB,IAAI,yDAAyD;AAEtF,MAAM,wBAAwB,IAC5B,mEACF;AAEA,MAAM,uBAAuB,IAAI,2CAA2C"}
@@ -0,0 +1,14 @@
1
+ //#region src/recipes/tableFilter.d.ts
2
+ declare const tableFilterPanelRecipe: (props?: ({
3
+ wide?: boolean | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ declare const tableFilterTitleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ declare const tableFilterOptionsRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const tableFilterOptionRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ declare const tableFilterCountRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare const tableFilterFieldRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ declare const tableFilterRuleRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ declare const tableFilterFootRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ //#endregion
13
+ export { tableFilterCountRecipe, tableFilterFieldRecipe, tableFilterFootRecipe, tableFilterOptionRecipe, tableFilterOptionsRecipe, tableFilterPanelRecipe, tableFilterRuleRecipe, tableFilterTitleRecipe };
14
+ //# sourceMappingURL=tableFilter.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { ruleQuiet } from "../parts/rule.js";
2
+ import { overlayMotion } from "./motion.js";
3
+ import { eyebrowQuiet } from "../parts/eyebrow.js";
4
+ import { cva } from "class-variance-authority";
5
+ //#region src/recipes/tableFilter.ts
6
+ const tableFilterPanelRecipe = cva([
7
+ "flex origin-top flex-col gap-3 rounded-tf-card bg-tf-glass p-3 backdrop-blur-tf-glass",
8
+ "tf-edge-sweep font-tf-body text-tf-body-sm font-medium shadow-tf-float tf-edge-plain",
9
+ "z-tf-dropdown outline-hidden",
10
+ ...overlayMotion
11
+ ], {
12
+ defaultVariants: { wide: false },
13
+ variants: { wide: {
14
+ false: "w-72",
15
+ true: "w-84"
16
+ } }
17
+ });
18
+ const tableFilterTitleRecipe = cva(`text-tf-caption-sm ${eyebrowQuiet}`);
19
+ const tableFilterOptionsRecipe = cva(["-mx-1 flex tf-scroll-thin max-h-64 flex-col overflow-y-auto px-1 py-1.5"]);
20
+ const tableFilterOptionRecipe = cva("flex-none");
21
+ const tableFilterCountRecipe = cva(["flex-none rounded-tf-pill bg-tf-panel px-1.5", "font-mono text-tf-caption-sm text-tf-muted tabular-nums"]);
22
+ const tableFilterFieldRecipe = cva("w-full max-w-none");
23
+ const tableFilterRuleRecipe = cva(`block ${ruleQuiet}`);
24
+ const tableFilterFootRecipe = cva("flex items-center justify-between gap-2");
25
+ //#endregion
26
+ export { tableFilterCountRecipe, tableFilterFieldRecipe, tableFilterFootRecipe, tableFilterOptionRecipe, tableFilterOptionsRecipe, tableFilterPanelRecipe, tableFilterRuleRecipe, tableFilterTitleRecipe };
27
+
28
+ //# sourceMappingURL=tableFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableFilter.js","names":[],"sources":["../../src/recipes/tableFilter.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { eyebrowQuiet } from '#parts/eyebrow'\nimport { ruleQuiet } from '#parts/rule'\n\nimport { overlayMotion } from './motion'\n\nconst tableFilterPanelRecipe = cva(\n [\n 'flex origin-top flex-col gap-3 rounded-tf-card bg-tf-glass p-3 backdrop-blur-tf-glass',\n 'tf-edge-sweep font-tf-body text-tf-body-sm font-medium shadow-tf-float tf-edge-plain',\n 'z-tf-dropdown outline-hidden',\n ...overlayMotion,\n ],\n {\n defaultVariants: { wide: false },\n variants: {\n wide: { false: 'w-72', true: 'w-84' },\n },\n },\n)\n\nconst tableFilterTitleRecipe = cva(`text-tf-caption-sm ${eyebrowQuiet}`)\n\nconst tableFilterOptionsRecipe = cva([\n '-mx-1 flex tf-scroll-thin max-h-64 flex-col overflow-y-auto px-1 py-1.5',\n])\n\nconst tableFilterOptionRecipe = cva('flex-none')\n\nconst tableFilterCountRecipe = cva([\n 'flex-none rounded-tf-pill bg-tf-panel px-1.5',\n 'font-mono text-tf-caption-sm text-tf-muted tabular-nums',\n])\n\nconst tableFilterFieldRecipe = cva('w-full max-w-none')\n\nconst tableFilterRuleRecipe = cva(`block ${ruleQuiet}`)\n\nconst tableFilterFootRecipe = cva('flex items-center justify-between gap-2')\n\nexport {\n tableFilterCountRecipe,\n tableFilterFieldRecipe,\n tableFilterFootRecipe,\n tableFilterOptionRecipe,\n tableFilterOptionsRecipe,\n tableFilterPanelRecipe,\n tableFilterRuleRecipe,\n tableFilterTitleRecipe,\n}\n"],"mappings":";;;;;AAOA,MAAM,yBAAyB,IAC7B;CACE;CACA;CACA;CACA,GAAG;AACL,GACA;CACE,iBAAiB,EAAE,MAAM,MAAM;CAC/B,UAAU,EACR,MAAM;EAAE,OAAO;EAAQ,MAAM;CAAO,EACtC;AACF,CACF;AAEA,MAAM,yBAAyB,IAAI,sBAAsB,cAAc;AAEvE,MAAM,2BAA2B,IAAI,CACnC,yEACF,CAAC;AAED,MAAM,0BAA0B,IAAI,WAAW;AAE/C,MAAM,yBAAyB,IAAI,CACjC,gDACA,yDACF,CAAC;AAED,MAAM,yBAAyB,IAAI,mBAAmB;AAEtD,MAAM,wBAAwB,IAAI,SAAS,WAAW;AAEtD,MAAM,wBAAwB,IAAI,yCAAyC"}
@@ -0,0 +1,15 @@
1
+ //#region src/recipes/tablePaging.d.ts
2
+ declare const tableFootRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
+ declare const tableRangeRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
+ declare const tablePagingRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ declare const tablePageSizesRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ declare const tablePageSizeStripRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const tablePageSizeMarkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ declare const tablePageSizeRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ declare const tablePagesRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ declare const tablePageMarkRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ declare const tablePageRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ declare const tableGapRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
+ //#endregion
14
+ export { tableFootRecipe, tableGapRecipe, tablePageMarkRecipe, tablePageRecipe, tablePageSizeMarkRecipe, tablePageSizeRecipe, tablePageSizeStripRecipe, tablePageSizesRecipe, tablePagesRecipe, tablePagingRecipe, tableRangeRecipe };
15
+ //# sourceMappingURL=tablePaging.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { controlInert, controlPress, controlReach, hitArea } from "../parts/control.js";
2
+ import { cva } from "class-variance-authority";
3
+ //#region src/recipes/tablePaging.ts
4
+ const PAGE_INK = [
5
+ "font-mono tabular-nums",
6
+ "cursor-pointer tf-transition motion-reduce:transition-none",
7
+ ...controlReach,
8
+ ...controlPress,
9
+ ...controlInert
10
+ ];
11
+ const CURRENT = "data-selected:text-tf-on-accent";
12
+ const HIT_AREA = hitArea("after:h-tf-target");
13
+ const tableFootRecipe = cva("flex flex-wrap items-center gap-4 border-t border-tf-line-2 px-4 py-3");
14
+ const tableRangeRecipe = cva("text-tf-caption font-medium text-tf-muted");
15
+ const tablePagingRecipe = cva("ml-auto flex flex-wrap items-center gap-4");
16
+ const tablePageSizesRecipe = cva("flex items-center gap-2 text-tf-caption font-medium text-tf-muted");
17
+ const tablePageSizeStripRecipe = cva("relative isolate flex gap-1 rounded-tf-pill bg-tf-panel p-1");
18
+ const tablePageSizeMarkRecipe = cva([
19
+ "absolute z-[-1] rounded-tf-pill bg-tf-blend blend-tf-accent",
20
+ "top-(--top) left-(--left) h-(--height) w-(--width)",
21
+ "[--transition-duration:var(--tf-duration-1)]",
22
+ "[--transition-timing-function:var(--ease-tf)]"
23
+ ]);
24
+ const tablePageSizeRecipe = cva([
25
+ "relative flex h-tf-control-2xs items-center rounded-tf-pill px-3 text-tf-caption-sm",
26
+ HIT_AREA,
27
+ ...PAGE_INK,
28
+ "text-tf-muted interactive:hovered:text-tf-fg",
29
+ "data-[state=checked]:text-tf-on-accent"
30
+ ]);
31
+ const tablePagesRecipe = cva("relative isolate flex items-center gap-1");
32
+ const tablePageMarkRecipe = cva([
33
+ "absolute inset-y-0 left-0 z-[-1] rounded-tf-inline bg-tf-blend blend-tf-accent",
34
+ "w-(--width) translate-x-(--left)",
35
+ "transition-[translate,width] duration-(--tf-duration-1) ease-(--ease-tf)",
36
+ "motion-reduce:transition-none"
37
+ ]);
38
+ const tablePageRecipe = cva([
39
+ "relative flex h-tf-row min-w-tf-row items-center justify-center rounded-tf-inline px-2",
40
+ "text-tf-caption font-medium",
41
+ HIT_AREA,
42
+ ...PAGE_INK,
43
+ "text-tf-fg interactive:hovered:bg-tf-panel-hi",
44
+ CURRENT
45
+ ]);
46
+ const tableGapRecipe = cva(["flex h-tf-row min-w-tf-row items-center justify-center", "text-tf-caption font-medium text-tf-muted"]);
47
+ //#endregion
48
+ export { tableFootRecipe, tableGapRecipe, tablePageMarkRecipe, tablePageRecipe, tablePageSizeMarkRecipe, tablePageSizeRecipe, tablePageSizeStripRecipe, tablePageSizesRecipe, tablePagesRecipe, tablePagingRecipe, tableRangeRecipe };
49
+
50
+ //# sourceMappingURL=tablePaging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tablePaging.js","names":[],"sources":["../../src/recipes/tablePaging.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { controlInert, controlPress, controlReach, hitArea } from '#parts/control'\n\nconst PAGE_INK = [\n 'font-mono tabular-nums',\n 'cursor-pointer tf-transition motion-reduce:transition-none',\n ...controlReach,\n ...controlPress,\n ...controlInert,\n]\n\nconst CURRENT = 'data-selected:text-tf-on-accent'\n\nconst HIT_AREA = hitArea('after:h-tf-target')\n\nconst tableFootRecipe = cva('flex flex-wrap items-center gap-4 border-t border-tf-line-2 px-4 py-3')\n\nconst tableRangeRecipe = cva('text-tf-caption font-medium text-tf-muted')\n\nconst tablePagingRecipe = cva('ml-auto flex flex-wrap items-center gap-4')\n\nconst tablePageSizesRecipe = cva(\n 'flex items-center gap-2 text-tf-caption font-medium text-tf-muted',\n)\n\nconst tablePageSizeStripRecipe = cva('relative isolate flex gap-1 rounded-tf-pill bg-tf-panel p-1')\n\nconst tablePageSizeMarkRecipe = cva([\n 'absolute z-[-1] rounded-tf-pill bg-tf-blend blend-tf-accent',\n 'top-(--top) left-(--left) h-(--height) w-(--width)',\n '[--transition-duration:var(--tf-duration-1)]',\n '[--transition-timing-function:var(--ease-tf)]',\n])\n\nconst tablePageSizeRecipe = cva([\n 'relative flex h-tf-control-2xs items-center rounded-tf-pill px-3 text-tf-caption-sm',\n HIT_AREA,\n ...PAGE_INK,\n 'text-tf-muted interactive:hovered:text-tf-fg',\n 'data-[state=checked]:text-tf-on-accent',\n])\n\nconst tablePagesRecipe = cva('relative isolate flex items-center gap-1')\n\nconst tablePageMarkRecipe = cva([\n 'absolute inset-y-0 left-0 z-[-1] rounded-tf-inline bg-tf-blend blend-tf-accent',\n 'w-(--width) translate-x-(--left)',\n 'transition-[translate,width] duration-(--tf-duration-1) ease-(--ease-tf)',\n 'motion-reduce:transition-none',\n])\n\nconst tablePageRecipe = cva([\n 'relative flex h-tf-row min-w-tf-row items-center justify-center rounded-tf-inline px-2',\n 'text-tf-caption font-medium',\n HIT_AREA,\n ...PAGE_INK,\n 'text-tf-fg interactive:hovered:bg-tf-panel-hi',\n CURRENT,\n])\n\nconst tableGapRecipe = cva([\n 'flex h-tf-row min-w-tf-row items-center justify-center',\n 'text-tf-caption font-medium text-tf-muted',\n])\n\nexport {\n tableFootRecipe,\n tableGapRecipe,\n tablePageMarkRecipe,\n tablePageRecipe,\n tablePageSizeMarkRecipe,\n tablePageSizeRecipe,\n tablePageSizeStripRecipe,\n tablePageSizesRecipe,\n tablePagesRecipe,\n tablePagingRecipe,\n tableRangeRecipe,\n}\n"],"mappings":";;;AAIA,MAAM,WAAW;CACf;CACA;CACA,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,UAAU;AAEhB,MAAM,WAAW,QAAQ,mBAAmB;AAE5C,MAAM,kBAAkB,IAAI,uEAAuE;AAEnG,MAAM,mBAAmB,IAAI,2CAA2C;AAExE,MAAM,oBAAoB,IAAI,2CAA2C;AAEzE,MAAM,uBAAuB,IAC3B,mEACF;AAEA,MAAM,2BAA2B,IAAI,6DAA6D;AAElG,MAAM,0BAA0B,IAAI;CAClC;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,sBAAsB,IAAI;CAC9B;CACA;CACA,GAAG;CACH;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,IAAI,0CAA0C;AAEvE,MAAM,sBAAsB,IAAI;CAC9B;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI;CAC1B;CACA;CACA;CACA,GAAG;CACH;CACA;AACF,CAAC;AAED,MAAM,iBAAiB,IAAI,CACzB,0DACA,2CACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ //#region src/recipes/tail.d.ts
2
+ declare const tailSeverities: readonly ["quiet", "plain", "warning", "danger", "success"];
3
+ type TailSeverity = (typeof tailSeverities)[number];
4
+ declare const defaultTailSeverity = "plain";
5
+ declare const tailRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ declare const tailScrollRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ declare const tailLineRecipe: (props?: ({
8
+ severity?: "success" | "warning" | "danger" | "plain" | "quiet" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ declare const tailGutterRecipe: (props?: ({
11
+ severity?: "success" | "warning" | "danger" | "plain" | "quiet" | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
+ declare const tailAtRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
14
+ declare const tailTextRecipe: (props?: ({
15
+ severity?: "success" | "warning" | "danger" | "plain" | "quiet" | null | undefined;
16
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
17
+ declare const tailEmptyRecipe: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
18
+ //#endregion
19
+ export { type TailSeverity, defaultTailSeverity, tailAtRecipe, tailEmptyRecipe, tailGutterRecipe, tailLineRecipe, tailRecipe, tailScrollRecipe, tailSeverities, tailTextRecipe };
20
+ //# sourceMappingURL=tail.d.ts.map
@@ -0,0 +1,48 @@
1
+ import { cva } from "class-variance-authority";
2
+ //#region src/recipes/tail.ts
3
+ const tailSeverities = [
4
+ "quiet",
5
+ "plain",
6
+ "warning",
7
+ "danger",
8
+ "success"
9
+ ];
10
+ const defaultTailSeverity = "plain";
11
+ const tailRecipe = cva(["overflow-hidden rounded-tf-block bg-tf-sunken-quiet", "shadow-[inset_0_0_0_var(--spacing-tf-hairline)_var(--color-tf-line-2)]"]);
12
+ const tailScrollRecipe = cva("tf-scroll-thin overflow-x-auto overflow-y-auto");
13
+ const tailLineRecipe = cva("grid min-w-max grid-cols-[3px_6.5rem_1fr] items-center gap-x-3 py-0.5", {
14
+ defaultVariants: { severity: defaultTailSeverity },
15
+ variants: { severity: {
16
+ danger: "bg-tf-danger-wash",
17
+ plain: "",
18
+ quiet: "",
19
+ success: "bg-tf-success-tint",
20
+ warning: "bg-tf-warning-tint"
21
+ } }
22
+ });
23
+ const tailGutterRecipe = cva("h-full", {
24
+ defaultVariants: { severity: defaultTailSeverity },
25
+ variants: { severity: {
26
+ danger: "bg-tf-danger-hi",
27
+ plain: "bg-transparent",
28
+ quiet: "bg-transparent",
29
+ success: "bg-tf-success-hi",
30
+ warning: "bg-tf-warning-hi"
31
+ } }
32
+ });
33
+ const tailAtRecipe = cva("py-0.5 pl-3 font-mono text-tf-caption-sm text-tf-muted");
34
+ const tailTextRecipe = cva("py-0.5 pr-3 font-mono text-tf-caption-sm whitespace-nowrap", {
35
+ defaultVariants: { severity: defaultTailSeverity },
36
+ variants: { severity: {
37
+ danger: "text-tf-danger-hi",
38
+ plain: "text-tf-fg",
39
+ quiet: "text-tf-muted",
40
+ success: "text-tf-success-hi",
41
+ warning: "text-tf-warning-hi"
42
+ } }
43
+ });
44
+ const tailEmptyRecipe = cva("p-5 text-center text-tf-caption font-medium text-tf-muted");
45
+ //#endregion
46
+ export { defaultTailSeverity, tailAtRecipe, tailEmptyRecipe, tailGutterRecipe, tailLineRecipe, tailRecipe, tailScrollRecipe, tailSeverities, tailTextRecipe };
47
+
48
+ //# sourceMappingURL=tail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tail.js","names":[],"sources":["../../src/recipes/tail.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nconst tailSeverities = ['quiet', 'plain', 'warning', 'danger', 'success'] as const\n\ntype TailSeverity = (typeof tailSeverities)[number]\n\nconst defaultTailSeverity = 'plain' satisfies TailSeverity\n\nconst tailRecipe = cva([\n 'overflow-hidden rounded-tf-block bg-tf-sunken-quiet',\n 'shadow-[inset_0_0_0_var(--spacing-tf-hairline)_var(--color-tf-line-2)]',\n])\n\nconst tailScrollRecipe = cva('tf-scroll-thin overflow-x-auto overflow-y-auto')\n\nconst tailLineRecipe = cva(\n 'grid min-w-max grid-cols-[3px_6.5rem_1fr] items-center gap-x-3 py-0.5',\n {\n defaultVariants: { severity: defaultTailSeverity },\n variants: {\n severity: {\n danger: 'bg-tf-danger-wash',\n plain: '',\n quiet: '',\n success: 'bg-tf-success-tint',\n warning: 'bg-tf-warning-tint',\n } satisfies Record<TailSeverity, string>,\n },\n },\n)\n\nconst tailGutterRecipe = cva('h-full', {\n defaultVariants: { severity: defaultTailSeverity },\n variants: {\n severity: {\n danger: 'bg-tf-danger-hi',\n plain: 'bg-transparent',\n quiet: 'bg-transparent',\n success: 'bg-tf-success-hi',\n warning: 'bg-tf-warning-hi',\n } satisfies Record<TailSeverity, string>,\n },\n})\n\nconst tailAtRecipe = cva('py-0.5 pl-3 font-mono text-tf-caption-sm text-tf-muted')\n\nconst tailTextRecipe = cva('py-0.5 pr-3 font-mono text-tf-caption-sm whitespace-nowrap', {\n defaultVariants: { severity: defaultTailSeverity },\n variants: {\n severity: {\n danger: 'text-tf-danger-hi',\n plain: 'text-tf-fg',\n quiet: 'text-tf-muted',\n success: 'text-tf-success-hi',\n warning: 'text-tf-warning-hi',\n } satisfies Record<TailSeverity, string>,\n },\n})\n\nconst tailEmptyRecipe = cva('p-5 text-center text-tf-caption font-medium text-tf-muted')\n\nexport {\n type TailSeverity,\n defaultTailSeverity,\n tailAtRecipe,\n tailEmptyRecipe,\n tailGutterRecipe,\n tailLineRecipe,\n tailRecipe,\n tailScrollRecipe,\n tailSeverities,\n tailTextRecipe,\n}\n"],"mappings":";;AAEA,MAAM,iBAAiB;CAAC;CAAS;CAAS;CAAW;CAAU;AAAS;AAIxE,MAAM,sBAAsB;AAE5B,MAAM,aAAa,IAAI,CACrB,uDACA,wEACF,CAAC;AAED,MAAM,mBAAmB,IAAI,gDAAgD;AAE7E,MAAM,iBAAiB,IACrB,yEACA;CACE,iBAAiB,EAAE,UAAU,oBAAoB;CACjD,UAAU,EACR,UAAU;EACR,QAAQ;EACR,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;CACX,EACF;AACF,CACF;AAEA,MAAM,mBAAmB,IAAI,UAAU;CACrC,iBAAiB,EAAE,UAAU,oBAAoB;CACjD,UAAU,EACR,UAAU;EACR,QAAQ;EACR,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;CACX,EACF;AACF,CAAC;AAED,MAAM,eAAe,IAAI,wDAAwD;AAEjF,MAAM,iBAAiB,IAAI,8DAA8D;CACvF,iBAAiB,EAAE,UAAU,oBAAoB;CACjD,UAAU,EACR,UAAU;EACR,QAAQ;EACR,OAAO;EACP,OAAO;EACP,SAAS;EACT,SAAS;CACX,EACF;AACF,CAAC;AAED,MAAM,kBAAkB,IAAI,2DAA2D"}
@@ -0,0 +1,25 @@
1
+ //#region src/recipes/text.d.ts
2
+ type TextSize = 'caption-sm' | 'caption' | 'body-sm' | 'body' | 'lead';
3
+ type TextTone = 'fg' | 'muted' | 'accent' | 'danger' | 'info' | 'success' | 'warning';
4
+ type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold';
5
+ type TextFamily = 'sans' | 'mono' | 'display';
6
+ declare const defaultTextSize = "body";
7
+ declare const defaultTextTone = "fg";
8
+ declare const defaultTextWeight = "normal";
9
+ declare const defaultTextFamily = "sans";
10
+ declare const textSizes: readonly ["caption-sm", "caption", "body-sm", "body", "lead"];
11
+ declare const textTones: readonly ["fg", "muted", "accent", "danger", "info", "success", "warning"];
12
+ declare const textWeights: readonly ["normal", "medium", "semibold", "bold"];
13
+ declare const textFamilies: readonly ["sans", "mono", "display"];
14
+ declare const restingWeight: (size: TextSize, uppercase?: boolean) => TextWeight;
15
+ declare const textRecipe: (props?: ({
16
+ family?: "display" | "sans" | "mono" | null | undefined;
17
+ size?: "caption-sm" | "caption" | "body-sm" | "body" | "lead" | null | undefined;
18
+ tabular?: boolean | null | undefined;
19
+ tone?: "accent" | "success" | "warning" | "info" | "danger" | "fg" | "muted" | null | undefined;
20
+ uppercase?: boolean | null | undefined;
21
+ weight?: "normal" | "medium" | "semibold" | "bold" | null | undefined;
22
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
+ //#endregion
24
+ export { type TextFamily, type TextSize, type TextTone, type TextWeight, defaultTextFamily, defaultTextSize, defaultTextTone, defaultTextWeight, restingWeight, textFamilies, textRecipe, textSizes, textTones, textWeights };
25
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { toneText } from "../tone.js";
2
+ import { eyebrowType } from "../parts/eyebrow.js";
3
+ import { cva } from "class-variance-authority";
4
+ //#region src/recipes/text.ts
5
+ const defaultTextSize = "body";
6
+ const defaultTextTone = "fg";
7
+ const defaultTextWeight = "normal";
8
+ const defaultTextFamily = "sans";
9
+ const textSizes = [
10
+ "caption-sm",
11
+ "caption",
12
+ "body-sm",
13
+ "body",
14
+ "lead"
15
+ ];
16
+ const textTones = [
17
+ "fg",
18
+ "muted",
19
+ "accent",
20
+ "danger",
21
+ "info",
22
+ "success",
23
+ "warning"
24
+ ];
25
+ const textWeights = [
26
+ "normal",
27
+ "medium",
28
+ "semibold",
29
+ "bold"
30
+ ];
31
+ const textFamilies = [
32
+ "sans",
33
+ "mono",
34
+ "display"
35
+ ];
36
+ const SIZE_WEIGHT = {
37
+ body: "normal",
38
+ "body-sm": "medium",
39
+ caption: "medium",
40
+ "caption-sm": "medium",
41
+ lead: "normal"
42
+ };
43
+ const restingWeight = (size, uppercase) => {
44
+ if (uppercase === true) return "medium";
45
+ return SIZE_WEIGHT[size];
46
+ };
47
+ const TONE_CLASS = {
48
+ ...toneText,
49
+ fg: "text-tf-fg",
50
+ muted: "text-tf-muted"
51
+ };
52
+ const textRecipe = cva("tf-transition motion-reduce:transition-none", {
53
+ defaultVariants: {
54
+ family: defaultTextFamily,
55
+ size: defaultTextSize,
56
+ tabular: false,
57
+ tone: "fg",
58
+ uppercase: false,
59
+ weight: defaultTextWeight
60
+ },
61
+ variants: {
62
+ family: {
63
+ display: "font-tf-display",
64
+ mono: "font-mono",
65
+ sans: "font-tf-body"
66
+ },
67
+ size: {
68
+ body: "text-tf-body",
69
+ "body-sm": "text-tf-body-sm",
70
+ caption: "text-tf-caption",
71
+ "caption-sm": "text-tf-caption-sm",
72
+ lead: "max-w-tf-measure text-tf-lead"
73
+ },
74
+ tabular: {
75
+ false: "",
76
+ true: "tabular-nums"
77
+ },
78
+ tone: TONE_CLASS,
79
+ uppercase: {
80
+ false: "",
81
+ true: eyebrowType
82
+ },
83
+ weight: {
84
+ bold: "font-bold",
85
+ medium: "font-medium",
86
+ normal: "font-normal",
87
+ semibold: "font-semibold"
88
+ }
89
+ }
90
+ });
91
+ //#endregion
92
+ export { defaultTextFamily, defaultTextSize, defaultTextTone, defaultTextWeight, restingWeight, textFamilies, textRecipe, textSizes, textTones, textWeights };
93
+
94
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","names":[],"sources":["../../src/recipes/text.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nimport { eyebrowType } from '#parts/eyebrow'\nimport { toneText } from '#tone'\n\ntype TextSize = 'caption-sm' | 'caption' | 'body-sm' | 'body' | 'lead'\n\ntype TextTone = 'fg' | 'muted' | 'accent' | 'danger' | 'info' | 'success' | 'warning'\n\ntype TextWeight = 'normal' | 'medium' | 'semibold' | 'bold'\n\ntype TextFamily = 'sans' | 'mono' | 'display'\n\nconst defaultTextSize = 'body' satisfies TextSize\n\nconst defaultTextTone = 'fg' satisfies TextTone\n\nconst defaultTextWeight = 'normal' satisfies TextWeight\n\nconst defaultTextFamily = 'sans' satisfies TextFamily\n\nconst textSizes = [\n 'caption-sm',\n 'caption',\n 'body-sm',\n 'body',\n 'lead',\n] as const satisfies readonly TextSize[]\n\nconst textTones = [\n 'fg',\n 'muted',\n 'accent',\n 'danger',\n 'info',\n 'success',\n 'warning',\n] as const satisfies readonly TextTone[]\n\nconst textWeights = [\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const satisfies readonly TextWeight[]\n\nconst textFamilies = ['sans', 'mono', 'display'] as const satisfies readonly TextFamily[]\n\nconst SIZE_WEIGHT = {\n body: 'normal',\n 'body-sm': 'medium',\n caption: 'medium',\n 'caption-sm': 'medium',\n lead: 'normal',\n} satisfies Record<TextSize, TextWeight>\n\nconst restingWeight = (size: TextSize, uppercase?: boolean): TextWeight => {\n if (uppercase === true) {\n return 'medium'\n }\n return SIZE_WEIGHT[size]\n}\n\nconst TONE_CLASS = {\n ...toneText,\n fg: 'text-tf-fg',\n muted: 'text-tf-muted',\n} satisfies Record<TextTone, string>\n\nconst textRecipe = cva('tf-transition motion-reduce:transition-none', {\n defaultVariants: {\n family: defaultTextFamily,\n size: defaultTextSize,\n tabular: false,\n tone: defaultTextTone,\n uppercase: false,\n weight: defaultTextWeight,\n },\n variants: {\n family: {\n display: 'font-tf-display',\n mono: 'font-mono',\n sans: 'font-tf-body',\n } satisfies Record<TextFamily, string>,\n size: {\n body: 'text-tf-body',\n 'body-sm': 'text-tf-body-sm',\n caption: 'text-tf-caption',\n 'caption-sm': 'text-tf-caption-sm',\n lead: 'max-w-tf-measure text-tf-lead',\n } satisfies Record<TextSize, string>,\n tabular: { false: '', true: 'tabular-nums' },\n tone: TONE_CLASS,\n uppercase: { false: '', true: eyebrowType },\n weight: {\n bold: 'font-bold',\n medium: 'font-medium',\n normal: 'font-normal',\n semibold: 'font-semibold',\n } satisfies Record<TextWeight, string>,\n },\n})\n\nexport {\n type TextFamily,\n type TextSize,\n type TextTone,\n type TextWeight,\n defaultTextFamily,\n defaultTextSize,\n defaultTextTone,\n defaultTextWeight,\n restingWeight,\n textFamilies,\n textRecipe,\n textSizes,\n textTones,\n textWeights,\n}\n"],"mappings":";;;;AAaA,MAAM,kBAAkB;AAExB,MAAM,kBAAkB;AAExB,MAAM,oBAAoB;AAE1B,MAAM,oBAAoB;AAE1B,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,YAAY;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,cAAc;CAClB;CACA;CACA;CACA;AACF;AAEA,MAAM,eAAe;CAAC;CAAQ;CAAQ;AAAS;AAE/C,MAAM,cAAc;CAClB,MAAM;CACN,WAAW;CACX,SAAS;CACT,cAAc;CACd,MAAM;AACR;AAEA,MAAM,iBAAiB,MAAgB,cAAoC;CACzE,IAAI,cAAc,MAChB,OAAO;CAET,OAAO,YAAY;AACrB;AAEA,MAAM,aAAa;CACjB,GAAG;CACH,IAAI;CACJ,OAAO;AACT;AAEA,MAAM,aAAa,IAAI,+CAA+C;CACpE,iBAAiB;EACf,QAAQ;EACR,MAAM;EACN,SAAS;EACT,MAAA;EACA,WAAW;EACX,QAAQ;CACV;CACA,UAAU;EACR,QAAQ;GACN,SAAS;GACT,MAAM;GACN,MAAM;EACR;EACA,MAAM;GACJ,MAAM;GACN,WAAW;GACX,SAAS;GACT,cAAc;GACd,MAAM;EACR;EACA,SAAS;GAAE,OAAO;GAAI,MAAM;EAAe;EAC3C,MAAM;EACN,WAAW;GAAE,OAAO;GAAI,MAAM;EAAY;EAC1C,QAAQ;GACN,MAAM;GACN,QAAQ;GACR,QAAQ;GACR,UAAU;EACZ;CACF;AACF,CAAC"}