@noix-dev/brix-vue 0.0.0-stage → 0.2.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 (255) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -2
  3. package/package.json +117 -3
  4. package/src/components/address-field/AddressField.vue +337 -0
  5. package/src/components/address-field/index.ts +1 -0
  6. package/src/components/appearance-picker/AppearancePicker.vue +502 -0
  7. package/src/components/appearance-picker/AppearanceSegment.vue +175 -0
  8. package/src/components/appearance-picker/index.ts +44 -0
  9. package/src/components/autofill/AutoFillDialog.vue +264 -0
  10. package/src/components/autofill/index.ts +1 -0
  11. package/src/components/badge/Badge.vue +23 -0
  12. package/src/components/badge/index.ts +106 -0
  13. package/src/components/build-stamp/BuildStamp.vue +62 -0
  14. package/src/components/build-stamp/index.ts +1 -0
  15. package/src/components/button/Button.vue +31 -0
  16. package/src/components/button/index.ts +122 -0
  17. package/src/components/card/Card.vue +29 -0
  18. package/src/components/card/CardAction.vue +17 -0
  19. package/src/components/card/CardContent.vue +14 -0
  20. package/src/components/card/CardDescription.vue +14 -0
  21. package/src/components/card/CardFooter.vue +22 -0
  22. package/src/components/card/CardHeader.vue +22 -0
  23. package/src/components/card/CardTitle.vue +29 -0
  24. package/src/components/card/index.ts +47 -0
  25. package/src/components/chart/BarChart.vue +123 -0
  26. package/src/components/chart/StackedBarChart.vue +149 -0
  27. package/src/components/chart/appearanceRevision.ts +22 -0
  28. package/src/components/chart/chartColor.ts +59 -0
  29. package/src/components/chart/index.ts +6 -0
  30. package/src/components/checkbox/Checkbox.vue +61 -0
  31. package/src/components/checkbox/index.ts +1 -0
  32. package/src/components/code-editor/CodeEditor.vue +352 -0
  33. package/src/components/code-editor/index.ts +9 -0
  34. package/src/components/code-editor/syntaxTheme.ts +110 -0
  35. package/src/components/colour-picker/ColourPicker.vue +421 -0
  36. package/src/components/colour-picker/index.ts +1 -0
  37. package/src/components/combobox/Combobox.vue +337 -0
  38. package/src/components/combobox/index.ts +1 -0
  39. package/src/components/comments/CommentComposer.vue +302 -0
  40. package/src/components/comments/CommentMessage.vue +259 -0
  41. package/src/components/comments/CommentThread.vue +250 -0
  42. package/src/components/comments/commentBody.ts +185 -0
  43. package/src/components/comments/commentLevels.ts +139 -0
  44. package/src/components/comments/commentNode.ts +35 -0
  45. package/src/components/comments/composer.ts +20 -0
  46. package/src/components/comments/index.ts +29 -0
  47. package/src/components/confirm-dialog/ConfirmDialog.vue +153 -0
  48. package/src/components/confirm-dialog/index.ts +1 -0
  49. package/src/components/containers/Box.vue +42 -0
  50. package/src/components/containers/Section.vue +88 -0
  51. package/src/components/containers/SectionAction.vue +17 -0
  52. package/src/components/containers/SectionContent.vue +14 -0
  53. package/src/components/containers/SectionDescription.vue +14 -0
  54. package/src/components/containers/SectionHeader.vue +22 -0
  55. package/src/components/containers/SectionTitle.vue +17 -0
  56. package/src/components/containers/index.ts +9 -0
  57. package/src/components/data-table/ColumnMenu.vue +241 -0
  58. package/src/components/data-table/DataTable.vue +447 -0
  59. package/src/components/data-table/ExpandCaret.vue +34 -0
  60. package/src/components/data-table/SortableHead.vue +184 -0
  61. package/src/components/data-table/TableLoadingRow.vue +13 -0
  62. package/src/components/data-table/TableProgressRow.vue +26 -0
  63. package/src/components/data-table/columns.ts +13 -0
  64. package/src/components/data-table/index.ts +3 -0
  65. package/src/components/data-table/pinned.ts +19 -0
  66. package/src/components/data-table/rowActivation.ts +14 -0
  67. package/src/components/data-table/sort.ts +13 -0
  68. package/src/components/data-table/types.ts +23 -0
  69. package/src/components/date-picker/CalendarPanel.vue +432 -0
  70. package/src/components/date-picker/DateField.vue +293 -0
  71. package/src/components/date-picker/DatePicker.vue +147 -0
  72. package/src/components/date-picker/UntilDatePicker.vue +96 -0
  73. package/src/components/date-picker/dateFieldGuard.ts +87 -0
  74. package/src/components/date-picker/index.ts +4 -0
  75. package/src/components/date-picker/useDateField.ts +37 -0
  76. package/src/components/date-range-picker/DateRangePicker.vue +247 -0
  77. package/src/components/date-range-picker/index.ts +1 -0
  78. package/src/components/date-time-picker/DateTimePicker.vue +291 -0
  79. package/src/components/date-time-picker/index.ts +1 -0
  80. package/src/components/dialog/Dialog.vue +250 -0
  81. package/src/components/dialog/DialogSurface.vue +214 -0
  82. package/src/components/dialog/dialogEdges.ts +65 -0
  83. package/src/components/dialog/dialogSizes.ts +35 -0
  84. package/src/components/dialog/index.ts +12 -0
  85. package/src/components/dialog/toastHost.ts +18 -0
  86. package/src/components/dropdown/Dropdown.vue +101 -0
  87. package/src/components/dropdown/DropdownItems.vue +154 -0
  88. package/src/components/dropdown/dropdown.ts +64 -0
  89. package/src/components/dropdown/index.ts +2 -0
  90. package/src/components/file-preview/FilePreview.vue +78 -0
  91. package/src/components/file-preview/index.ts +1 -0
  92. package/src/components/file-upload/FileUpload.vue +234 -0
  93. package/src/components/file-upload/index.ts +1 -0
  94. package/src/components/filter-check-menu/FilterCheckMenu.vue +562 -0
  95. package/src/components/filter-check-menu/filterCheckOption.ts +10 -0
  96. package/src/components/filter-check-menu/index.ts +2 -0
  97. package/src/components/form-field/FormField.vue +74 -0
  98. package/src/components/form-field/index.ts +2 -0
  99. package/src/components/form-field/types.ts +5 -0
  100. package/src/components/frames/FrameCentred.vue +137 -0
  101. package/src/components/frames/FrameSidebar.vue +113 -0
  102. package/src/components/frames/FrameSplit.vue +109 -0
  103. package/src/components/frames/index.ts +3 -0
  104. package/src/components/icon/BellIcon.vue +27 -0
  105. package/src/components/icon/BoldIcon.vue +31 -0
  106. package/src/components/icon/CalendarDaysIcon.vue +33 -0
  107. package/src/components/icon/CheckIcon.vue +31 -0
  108. package/src/components/icon/ChevronDownIcon.vue +30 -0
  109. package/src/components/icon/ChevronLeftIcon.vue +31 -0
  110. package/src/components/icon/ChevronRightIcon.vue +31 -0
  111. package/src/components/icon/ChevronUpIcon.vue +30 -0
  112. package/src/components/icon/CircleAlertIcon.vue +29 -0
  113. package/src/components/icon/ClockIcon.vue +31 -0
  114. package/src/components/icon/Columns3Icon.vue +32 -0
  115. package/src/components/icon/FlipHorizontalIcon.vue +29 -0
  116. package/src/components/icon/ItalicIcon.vue +28 -0
  117. package/src/components/icon/LinkIcon.vue +27 -0
  118. package/src/components/icon/ListIcon.vue +29 -0
  119. package/src/components/icon/ListOrderedIcon.vue +28 -0
  120. package/src/components/icon/PenLineIcon.vue +31 -0
  121. package/src/components/icon/PlusIcon.vue +28 -0
  122. package/src/components/icon/RotateCcwIcon.vue +28 -0
  123. package/src/components/icon/RotateCwIcon.vue +28 -0
  124. package/src/components/icon/SearchIcon.vue +31 -0
  125. package/src/components/icon/StarIcon.vue +29 -0
  126. package/src/components/icon/TriangleAlertIcon.vue +29 -0
  127. package/src/components/icon/UnderlineIcon.vue +27 -0
  128. package/src/components/icon/Undo2Icon.vue +28 -0
  129. package/src/components/icon/XIcon.vue +31 -0
  130. package/src/components/icon/ZoomInIcon.vue +30 -0
  131. package/src/components/icon/ZoomOutIcon.vue +29 -0
  132. package/src/components/icon/index.ts +37 -0
  133. package/src/components/icon-picker/IconPicker.vue +560 -0
  134. package/src/components/icon-picker/index.ts +1 -0
  135. package/src/components/image-crop-dialog/CropRatioRow.vue +132 -0
  136. package/src/components/image-crop-dialog/CropVariantStrip.vue +277 -0
  137. package/src/components/image-crop-dialog/ImageCropDialog.vue +1541 -0
  138. package/src/components/image-crop-dialog/index.ts +16 -0
  139. package/src/components/image-upload/ImageUpload.vue +345 -0
  140. package/src/components/image-upload/index.ts +2 -0
  141. package/src/components/input/Input.vue +48 -0
  142. package/src/components/input/index.ts +1 -0
  143. package/src/components/keycap/Keycap.vue +49 -0
  144. package/src/components/keycap/index.ts +1 -0
  145. package/src/components/label/Label.vue +26 -0
  146. package/src/components/label/index.ts +1 -0
  147. package/src/components/menu/MenuCheckboxItem.vue +63 -0
  148. package/src/components/menu/MenuContent.vue +45 -0
  149. package/src/components/menu/MenuGroup.vue +22 -0
  150. package/src/components/menu/MenuItem.vue +34 -0
  151. package/src/components/menu/MenuLabel.vue +22 -0
  152. package/src/components/menu/MenuRadioGroup.vue +22 -0
  153. package/src/components/menu/MenuRadioItem.vue +50 -0
  154. package/src/components/menu/MenuRoot.vue +25 -0
  155. package/src/components/menu/MenuSeparator.vue +27 -0
  156. package/src/components/menu/MenuSub.vue +29 -0
  157. package/src/components/menu/MenuSubContent.vue +48 -0
  158. package/src/components/menu/MenuSubTrigger.vue +49 -0
  159. package/src/components/menu/MenuTrigger.vue +22 -0
  160. package/src/components/menu/index.ts +20 -0
  161. package/src/components/menu/menuClasses.ts +74 -0
  162. package/src/components/morph-select/MorphSelect.vue +150 -0
  163. package/src/components/morph-select/index.ts +1 -0
  164. package/src/components/nav/NavFlyout.vue +343 -0
  165. package/src/components/nav/NavGroup.vue +306 -0
  166. package/src/components/nav/NavItem.vue +243 -0
  167. package/src/components/nav/NavNodes.ts +66 -0
  168. package/src/components/nav/NavSection.vue +105 -0
  169. package/src/components/nav/NavSidebar.vue +137 -0
  170. package/src/components/nav/index.ts +5 -0
  171. package/src/components/nav/navChain.ts +112 -0
  172. package/src/components/nav/navClasses.ts +229 -0
  173. package/src/components/nav/navNode.ts +10 -0
  174. package/src/components/nav/navRegistry.ts +24 -0
  175. package/src/components/notification-list/NotificationList.vue +314 -0
  176. package/src/components/notification-list/index.ts +2 -0
  177. package/src/components/notification-list/notifications.ts +21 -0
  178. package/src/components/pagination/Pagination.vue +296 -0
  179. package/src/components/pagination/index.ts +1 -0
  180. package/src/components/pin-field/PinField.vue +332 -0
  181. package/src/components/pin-field/index.ts +1 -0
  182. package/src/components/popover-panel/PopoverPanel.vue +115 -0
  183. package/src/components/popover-panel/index.ts +5 -0
  184. package/src/components/rating/Rating.vue +201 -0
  185. package/src/components/rating/index.ts +1 -0
  186. package/src/components/record-avatar/RecordAvatar.vue +76 -0
  187. package/src/components/record-avatar/index.ts +1 -0
  188. package/src/components/result-window/ResultWindow.vue +399 -0
  189. package/src/components/result-window/index.ts +2 -0
  190. package/src/components/result-window/results.ts +75 -0
  191. package/src/components/rich-editor/RichEditor.vue +370 -0
  192. package/src/components/rich-editor/RichEditorLinkDialog.vue +133 -0
  193. package/src/components/rich-editor/index.ts +8 -0
  194. package/src/components/row-actions/RowActions.vue +262 -0
  195. package/src/components/row-actions/index.ts +2 -0
  196. package/src/components/row-actions/rowActions.ts +44 -0
  197. package/src/components/search-select/SearchSelect.vue +599 -0
  198. package/src/components/search-select/index.ts +2 -0
  199. package/src/components/search-select/types.ts +14 -0
  200. package/src/components/segmented-choice/SegmentedChoice.vue +136 -0
  201. package/src/components/segmented-choice/index.ts +2 -0
  202. package/src/components/segmented-choice/segmentedOption.ts +6 -0
  203. package/src/components/select/Select.vue +18 -0
  204. package/src/components/select/SelectContent.vue +73 -0
  205. package/src/components/select/SelectGroup.vue +21 -0
  206. package/src/components/select/SelectItem.vue +47 -0
  207. package/src/components/select/SelectItemText.vue +12 -0
  208. package/src/components/select/SelectLabel.vue +17 -0
  209. package/src/components/select/SelectScrollDownButton.vue +36 -0
  210. package/src/components/select/SelectScrollUpButton.vue +36 -0
  211. package/src/components/select/SelectSeparator.vue +19 -0
  212. package/src/components/select/SelectTrigger.vue +52 -0
  213. package/src/components/select/SelectValue.vue +12 -0
  214. package/src/components/select/index.ts +11 -0
  215. package/src/components/session/IdleTimer.vue +71 -0
  216. package/src/components/session/SessionDialogs.vue +177 -0
  217. package/src/components/session/index.ts +2 -0
  218. package/src/components/split-button/SplitButton.vue +122 -0
  219. package/src/components/split-button/index.ts +2 -0
  220. package/src/components/split-button/splitButtonItem.ts +7 -0
  221. package/src/components/switch/Switch.vue +60 -0
  222. package/src/components/switch/index.ts +1 -0
  223. package/src/components/table/Table.vue +51 -0
  224. package/src/components/table/TableBody.vue +14 -0
  225. package/src/components/table/TableCaption.vue +17 -0
  226. package/src/components/table/TableCell.vue +22 -0
  227. package/src/components/table/TableEmpty.vue +72 -0
  228. package/src/components/table/TableFooter.vue +17 -0
  229. package/src/components/table/TableHead.vue +22 -0
  230. package/src/components/table/TableHeader.vue +14 -0
  231. package/src/components/table/TableRow.vue +22 -0
  232. package/src/components/table/index.ts +9 -0
  233. package/src/components/tabs/Tabs.vue +173 -0
  234. package/src/components/tabs/index.ts +2 -0
  235. package/src/components/tabs/tabItem.ts +12 -0
  236. package/src/components/textarea/LimitedTextarea.vue +81 -0
  237. package/src/components/textarea/TextLimitCounter.vue +107 -0
  238. package/src/components/textarea/Textarea.vue +42 -0
  239. package/src/components/textarea/index.ts +4 -0
  240. package/src/components/textarea/textLimit.ts +43 -0
  241. package/src/components/time-picker/TimePicker.vue +522 -0
  242. package/src/components/time-picker/index.ts +1 -0
  243. package/src/components/toast/ToastHost.vue +276 -0
  244. package/src/components/toast/index.ts +1 -0
  245. package/src/components/update-notice/UpdateNotice.vue +103 -0
  246. package/src/components/update-notice/index.ts +1 -0
  247. package/src/components/user-menu/UserMenu.vue +154 -0
  248. package/src/components/user-menu/index.ts +1 -0
  249. package/src/index.ts +182 -0
  250. package/src/lib/cn.ts +21 -0
  251. package/src/lib/panelFocus.ts +65 -0
  252. package/src/lib/sessionMonitor.ts +390 -0
  253. package/src/lib/slotContent.ts +17 -0
  254. package/src/lib/updateCheck.ts +133 -0
  255. package/src/styles.css +82 -0
@@ -0,0 +1,137 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * The centred frame: a sticky top bar, one column of content at a maximum width, and a footer
4
+ * under the column. It is the shape of a public page.
5
+ *
6
+ * Who scrolls: the document, not the frame. The root has no height, clips nothing and owns no
7
+ * scroll container, so the content simply grows and the page around the frame scrolls. This is
8
+ * the owner's ruling in `docs/specs/2026-11-30-wave-3-layout-and-navigation.md`, section "The
9
+ * frames": a column with a footer under it wants the footer at the end of the document, not
10
+ * pinned in sight. `FrameSidebar` is the opposite shape (it takes the height it is given and
11
+ * scrolls its content region), and the two differ on purpose. Because the frame has no height of
12
+ * its own, it also needs none of the shrink declarations the sibling frames carry: nothing here
13
+ * is a flex item with something to clip.
14
+ *
15
+ * The bar is `sticky top-0`, so it holds still at the top of the scrolling window while the
16
+ * column passes under it. The wrapper draws no ground of its own: the bar slot's content owns
17
+ * its background, and a slot that paints none lets the column show through it as it scrolls.
18
+ * Arbitrary content in the bar slot is stuck all the same, at whatever height it has; the frame
19
+ * neither measures nor limits it. Anything sticky inside the column (a table head, a jump
20
+ * target) has to offset itself by the bar's height, which the frame does not know.
21
+ *
22
+ * The bar sits on the chrome rung of the stacking scale, `docs/decisions/0018-stacking-order.md`,
23
+ * whose table lists "application chrome: a sticky top bar, a navigation column" as one layer
24
+ * above the panels drawn in place. A sticky element with no layer is painted in DOM order, so
25
+ * any later sibling that has a ground paints over it. The ADR's reason for the rung is the one
26
+ * this frame needs: a listbox that opens near the bar scrolls under it instead of over it.
27
+ *
28
+ * The column is `mx-auto w-full` at one of three named maximum widths, which the `width` prop
29
+ * picks: `narrow` 480px, `default` 560px, `wide` 672px. 560px is the first record's "max-width
30
+ * 560px, centred" (`docs/design/wave-3-layout.html`, `.centred .main`) and stays the default, so
31
+ * a consumer who names no width gets the figure the frame shipped with. The other two are the
32
+ * owner's approval of 2026-12-03 on `docs/design/wave-3-centred-widths.html`, which renders every
33
+ * proposed width side by side and measures the characters a line holds at each.
34
+ *
35
+ * The steps are not interchangeable. The record measures each step's line in characters as the
36
+ * page is rendering, and against the 60-to-75 band a reader is comfortable in, `narrow` and
37
+ * `default` fall inside it and `wide` falls outside on purpose: `wide` is the step for a
38
+ * two-column form, a table or a figure that needs the room, and prose set in it is harder to read
39
+ * than prose in the other two. A consumer who puts prose there has chosen that. The counts
40
+ * themselves are not repeated here — they are a property of the font, since only `kingfisher`
41
+ * names Figtree in `--font-sans` and a theme on the system stack fits more characters into the
42
+ * same pixels, so the record measures them live and `docs/design/README.md` records the readings
43
+ * with the instrument that took them. The pixel figures are what is approved.
44
+ *
45
+ * Every step is an absolute maximum and not a proportion: the record's own frame box is 1192px
46
+ * wide, and no figure was chosen as a share of it. In a frame narrower than the step the column
47
+ * takes the whole width. Whatever the default slot holds is centred and width-limited with it: a
48
+ * table or an image wider than the column does not widen it and is not clipped either, it
49
+ * overflows the column's edge. Content that needs the full width does not belong in this frame's
50
+ * default slot — the step is a cap on the column, not a layout the content can argue with.
51
+ *
52
+ * The column carries the record's content padding, 18px above, 20px at the sides, 24px below
53
+ * (the same figures as `FrameSidebar`'s content region). It is border-box, so the step includes
54
+ * the side padding: at `default` the text measures 520px, not 560px. Side padding is `px`, a
55
+ * logical property, and no inline edge is drawn anywhere, so the frame mirrors in a right-to-left
56
+ * page. The footer's top border is a block edge, which does not flip.
57
+ *
58
+ * The footer is the record's `.foot`: 9px 14px padding, 11px type, a top border, the `--card`
59
+ * ground, and a row with a 14px gap. It spans the frame and is not held to the column's width.
60
+ *
61
+ * The frame emits no landmark elements: every region is a plain `div`. A consumer building a
62
+ * whole page puts the `<header>` and `<main>` inside the slots.
63
+ *
64
+ * Regions render only when their slot has content, so an absent or empty slot leaves no element
65
+ * behind, the column included. Presence is decided per use, so each slot function runs twice per
66
+ * render: once for the presence decision and once for the outlet. A slot that does work pays for
67
+ * it twice. "Content" is judged on the vnodes the slot returns, before any component in them has
68
+ * rendered: a slot whose only node is a component counts as filled even when that component
69
+ * renders nothing. A caller who may have nothing to show puts the `v-if` on the
70
+ * `<template #bar>` or `<template #footer>` itself. The package imports no router; link-bearing
71
+ * content arrives through the slots.
72
+ */
73
+ import type { HTMLAttributes } from 'vue';
74
+ import { useSlots } from 'vue';
75
+ import { cn } from '../../lib/cn';
76
+ import { hasContent } from '../../lib/slotContent';
77
+
78
+ /** The named steps of the column's maximum width. `default` is the step the frame shipped with. */
79
+ type Width = 'narrow' | 'default' | 'wide';
80
+
81
+ /**
82
+ * Each step's maximum width, as a class rather than a style binding: the figure stays visible in
83
+ * the rendered DOM, where it can be read off the element instead of out of a computed style.
84
+ */
85
+ const COLUMN_WIDTHS: Record<Width, string> = {
86
+ narrow: 'max-w-[480px]',
87
+ default: 'max-w-[560px]',
88
+ wide: 'max-w-[672px]',
89
+ };
90
+
91
+ const props = withDefaults(
92
+ defineProps<{
93
+ class?: HTMLAttributes['class'];
94
+ /**
95
+ * Which step the column's maximum width takes. Absent, `default` — the record's 560px.
96
+ * `wide` is deliberately past the comfortable reading measure; see the note above.
97
+ */
98
+ width?: Width;
99
+ }>(),
100
+ {
101
+ width: 'default',
102
+ },
103
+ );
104
+
105
+ defineSlots<{
106
+ /** The top bar. It sticks to the top of the scrolling window. Absent, no bar is drawn. */
107
+ bar?: () => unknown;
108
+ /** The column of content, centred at a maximum width. Absent, no column is drawn. */
109
+ default?: () => unknown;
110
+ /** The footer, under the column. Absent, no footer is drawn. */
111
+ footer?: () => unknown;
112
+ }>();
113
+
114
+ const slots = useSlots();
115
+ </script>
116
+
117
+ <template>
118
+ <div data-slot="frame-centred" :class="cn(props.class)">
119
+ <div v-if="hasContent(slots.bar)" data-slot="frame-bar" class="sticky top-0 z-30">
120
+ <slot name="bar" />
121
+ </div>
122
+ <div
123
+ v-if="hasContent(slots.default)"
124
+ data-slot="frame-content"
125
+ :class="cn('mx-auto w-full px-5 pt-[18px] pb-6', COLUMN_WIDTHS[props.width])"
126
+ >
127
+ <slot />
128
+ </div>
129
+ <div
130
+ v-if="hasContent(slots.footer)"
131
+ data-slot="frame-footer"
132
+ class="flex gap-3.5 border-t border-border bg-card px-3.5 py-[9px] text-[11px] text-muted-foreground"
133
+ >
134
+ <slot name="footer" />
135
+ </div>
136
+ </div>
137
+ </template>
@@ -0,0 +1,113 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * The sidebar frame: a top bar over a navigation column beside a scrolling content region.
4
+ *
5
+ * Who scrolls: the content region, and only it. The frame clips at its own edge (`overflow-hidden`
6
+ * on the root), the bar and the navigation region do not shrink, and the navigation column
7
+ * scrolls itself (`navSidebarClass` carries `overflow-y-auto`). The frame therefore adds no
8
+ * scroll to the nav region: a second mechanism there would give a long menu two scrollbars.
9
+ * This is the owner's ruling of 2026-12-03 in
10
+ * `docs/specs/2026-11-30-wave-3-layout-and-navigation.md`, section "The frames", paragraph
11
+ * "Who scrolls": the content region is the only scroll container inside the frame, while the
12
+ * chrome holds still.
13
+ *
14
+ * Height: `h-full`, not `h-dvh`. The frame obeys the frame, not the window: a consumer embeds it
15
+ * in a pane, a preview or a card and hands it the height, and a viewport unit would overflow
16
+ * any of those. The consumer that wants the whole viewport gives the frame the viewport.
17
+ *
18
+ * `min-h-0` on the body is load-bearing. The body is a flex item of a column root, where
19
+ * `min-height: auto` is content-based, and it carries no overflow of its own; without `min-h-0`
20
+ * it cannot shrink below its content and the content region would never scroll.
21
+ *
22
+ * The content region needs no `min-w-0`, because `overflow-y-auto` already suppresses a flex
23
+ * item's automatic minimum size. Measured at 600px of frame width with a 1500px child beside a
24
+ * 100px column: 500px with the declaration, 500px without.
25
+ *
26
+ * The nav region is `grid`, so that its column gets a definite height. The column declares no
27
+ * height, and a block child of the region is not stretched, so it would take its natural height,
28
+ * spill past the region, and its own `overflow-y-auto` would never engage: the last menu rows
29
+ * would be reachable by no scrollbar. As a grid item the column stretches to the region's
30
+ * height and scrolls itself. `grid` and not `flex`, because the slot may hold anything: with
31
+ * `flex` (a row) two root nodes lay out side by side and each is stretched to the region's
32
+ * height, so a logo above a menu would render wrong; a one-column grid stacks them. Measured on
33
+ * `/frame-sidebar`, the two are identical for the single `NavSidebar` column (readings under
34
+ * "the nav region is `grid`" in `docs/design/README.md`). A column the consumer puts under a
35
+ * logo gets the height the logo leaves and scrolls itself. A separate point, about
36
+ * the column and not about the region: the
37
+ * column needs no `min-h-0` of its own. That was measured, and the six readings under
38
+ * "`min-h-0` is deliberately absent from the column" in `docs/design/README.md` are the proof.
39
+ * The column keeps ownership of the scroll; the frame only supplies the height a scroll needs.
40
+ *
41
+ * The nav region declares no width, because the navigation column owns its width (216px open,
42
+ * 56px as a rail). The frame does not re-declare it, so the two cannot disagree.
43
+ *
44
+ * The content region carries the record's padding, 18px above, 20px at the sides, 24px below.
45
+ * Side padding is `px`, a logical property, and no physical edge is drawn, so the frame mirrors.
46
+ *
47
+ * The footer is the record's `.foot` (`docs/design/wave-3-layout.html`, the last child of frame
48
+ * 1's `.app`): the same wrapper and classes as `FrameCentred`'s footer plus `shrink-0`, which keeps the
49
+ * flex-column root from compressing it under a tall body. It is the last child of
50
+ * the root, after the body row, so it spans the whole frame under the navigation column and a
51
+ * long content region scrolls under a footer that stays. Leave the slot out and no row is drawn.
52
+ *
53
+ * The frame emits no landmark elements: every region is a plain `div`. A consumer building a
54
+ * whole page puts the `<header>`, `<nav>` and `<main>` inside the slots.
55
+ *
56
+ * Regions render only when their slot has content, so an absent or empty slot leaves no element
57
+ * behind, the content region included. Presence is decided per use, so each slot function runs
58
+ * twice per render: once for the presence decision and once for the outlet. A slot that does
59
+ * work pays for it twice. "Content" is judged on the vnodes the slot returns, before any component in them has
60
+ * rendered: a slot whose only node is a component counts as filled even when that component
61
+ * renders nothing. A caller who may have nothing to show puts the `v-if` on the
62
+ * `<template #bar>`, `<template #nav>` or `<template #footer>` itself. The package imports no router; link-bearing
63
+ * content arrives through the slots.
64
+ */
65
+ import type { HTMLAttributes } from 'vue';
66
+ import { useSlots } from 'vue';
67
+ import { cn } from '../../lib/cn';
68
+ import { hasContent } from '../../lib/slotContent';
69
+
70
+ const props = defineProps<{
71
+ class?: HTMLAttributes['class'];
72
+ }>();
73
+
74
+ defineSlots<{
75
+ /** The top bar, across the whole frame. Absent, the body takes the whole height. */
76
+ bar?: () => unknown;
77
+ /** The navigation column. It owns its width and its own scroll. Absent, no column is drawn. */
78
+ nav?: () => unknown;
79
+ /** The scrolling content region. Absent, no region is drawn. */
80
+ default?: () => unknown;
81
+ /** The footer, under the body and across the whole frame. Absent, no footer is drawn. */
82
+ footer?: () => unknown;
83
+ }>();
84
+
85
+ const slots = useSlots();
86
+ </script>
87
+
88
+ <template>
89
+ <div data-slot="frame-sidebar" :class="cn('flex h-full flex-col overflow-hidden', props.class)">
90
+ <div v-if="hasContent(slots.bar)" data-slot="frame-bar" class="shrink-0">
91
+ <slot name="bar" />
92
+ </div>
93
+ <div class="flex min-h-0 flex-1">
94
+ <div v-if="hasContent(slots.nav)" data-slot="frame-nav" class="grid shrink-0">
95
+ <slot name="nav" />
96
+ </div>
97
+ <div
98
+ v-if="hasContent(slots.default)"
99
+ data-slot="frame-content"
100
+ class="flex-1 overflow-y-auto px-5 pt-[18px] pb-6"
101
+ >
102
+ <slot />
103
+ </div>
104
+ </div>
105
+ <div
106
+ v-if="hasContent(slots.footer)"
107
+ data-slot="frame-footer"
108
+ class="flex shrink-0 gap-3.5 border-t border-border bg-card px-3.5 py-[9px] text-[11px] text-muted-foreground"
109
+ >
110
+ <slot name="footer" />
111
+ </div>
112
+ </div>
113
+ </template>
@@ -0,0 +1,109 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * A two-region entry frame: a brand region beside a form region.
4
+ *
5
+ * The breakpoint is a container query, not a media query, because the approved record binds
6
+ * the frame's width and not the window's: "Desktop frames are 55/45; below 640px of frame width
7
+ * the brand slot becomes a band above the form." A frame embedded in a narrow pane must stack
8
+ * while the window is wide. The root declares the named container; the grid beneath it carries
9
+ * the query, because an element cannot be queried against itself.
10
+ *
11
+ * The brand region is a slot with replaceable filling: the record shows it as a brand panel,
12
+ * as an image panel, and not at all. So the component holds no brand content of its own.
13
+ *
14
+ * The proportions and the breakpoint are not props. The record fixes them, so neither is a
15
+ * caller's choice, and a `size` or `ratio` prop would be a value no approval covers.
16
+ *
17
+ * Regions render only when their slot has content, so an absent or empty slot leaves no element
18
+ * behind and the other region takes the whole frame. The form region scrolls on its own, so a
19
+ * long form stays reachable while the brand region holds still.
20
+ *
21
+ * "Content" is judged on the vnodes the slot returns, before any component in them has rendered.
22
+ * A slot whose only node is a component therefore always counts as filled, even when that
23
+ * component renders nothing, and the frame draws an empty region. A caller who may have nothing
24
+ * to show puts the `v-if` on the `<template #brand>` or `<template #form>` itself, not inside
25
+ * the component the template holds.
26
+ *
27
+ * Centring without clipping: the form region centres a form that fits, with `safe` alignment
28
+ * (`items-center-safe justify-center-safe`). Plain `center` on an overflowing flex box pushes
29
+ * half the overflow above the top edge, and scrolling has no negative range to reach it, so a
30
+ * long form lost its heading and first fields. `safe` falls back to start alignment only when
31
+ * the content overflows, which keeps the record's desktop centring and keeps the top
32
+ * reachable; it needs no wrapper element around the slot. An engine that does not support the
33
+ * `safe` keyword drops the declaration and falls back to `normal`, which is also top-aligned and
34
+ * fully scrollable (measured in Chrome 156), so the degradation loses the centring and never
35
+ * the reachability. Stacked (`docs/design/style.css:150-157`), the
36
+ * region starts at the top instead. The record's own desktop rule has the same defect, hidden
37
+ * because its frame is a fixed height with forms built to fit.
38
+ *
39
+ * Padding: the region carries the record's padding, 32px on desktop and 24px stacked
40
+ * (`--s6` / `--s5`), so a form never touches the region's edges. The brand region has none:
41
+ * its padding belongs to its filling, as the record's `.panel-brand` and `.panel-image` differ.
42
+ *
43
+ * The frame clips at its own edge, as the record's frame does (`overflow:hidden`,
44
+ * `docs/design/style.css:96`), so a filling taller or wider than the frame is cut off rather
45
+ * than painted over the page. Anything that must escape the frame has to portal out of it:
46
+ * `PopoverPanel`, `SelectContent` and `MenuContent` do. A panel anchored in the page instead,
47
+ * such as the `Combobox` listbox (`absolute z-20`, `docs/decisions/0018-stacking-order.md`), is
48
+ * clipped by the form region's own `overflow-auto` and scrolls inside it.
49
+ *
50
+ * Presence is decided per use, so each slot function runs up to three times per render: two
51
+ * presence decisions (the grid's columns and the region's `v-if`) and the real `<slot>` render.
52
+ * With the brand absent, `&&` short-circuits and the form slot runs twice.
53
+ *
54
+ * `min-h-0` and `min-w-0` on the brand region are load-bearing: without them a grid item will
55
+ * not shrink below its content, so a wide brand filling would collapse the 55/45 split to its
56
+ * own width and a tall one would grow the brand box past the frame. The form region needs none,
57
+ * because `overflow-auto` already suppresses a grid item's automatic minimum size.
58
+ */
59
+ import type { HTMLAttributes } from 'vue';
60
+ import { useSlots } from 'vue';
61
+ import { cn } from '../../lib/cn';
62
+ import { hasContent } from '../../lib/slotContent';
63
+
64
+ const props = defineProps<{
65
+ class?: HTMLAttributes['class'];
66
+ }>();
67
+
68
+ defineSlots<{
69
+ /** The 55% region. Absent, the form takes the whole frame. */
70
+ brand?: () => unknown;
71
+ /**
72
+ * The 45% region. Absent, the brand takes the whole frame. The region is a flex row that
73
+ * centres a single child, as the record's `.fwrap` is one wrapper, so a form with several
74
+ * root nodes wraps them in one element or they lay out side by side.
75
+ */
76
+ form?: () => unknown;
77
+ }>();
78
+
79
+ const slots = useSlots();
80
+ </script>
81
+
82
+ <template>
83
+ <div
84
+ data-slot="frame-split"
85
+ :class="cn('@container/frame-split h-full overflow-hidden', props.class)"
86
+ >
87
+ <div
88
+ :class="
89
+ cn(
90
+ 'grid h-full',
91
+ hasContent(slots.brand) && hasContent(slots.form)
92
+ ? 'grid-cols-[55fr_45fr] @max-[640px]/frame-split:grid-cols-1 @max-[640px]/frame-split:grid-rows-[auto_1fr]'
93
+ : 'grid-cols-1',
94
+ )
95
+ "
96
+ >
97
+ <div v-if="hasContent(slots.brand)" data-slot="frame-brand" class="min-h-0 min-w-0">
98
+ <slot name="brand" />
99
+ </div>
100
+ <div
101
+ v-if="hasContent(slots.form)"
102
+ data-slot="frame-form"
103
+ class="flex items-center-safe justify-center-safe overflow-auto p-8 @max-[640px]/frame-split:items-start @max-[640px]/frame-split:p-6"
104
+ >
105
+ <slot name="form" />
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </template>
@@ -0,0 +1,3 @@
1
+ export { default as FrameSplit } from './FrameSplit.vue';
2
+ export { default as FrameSidebar } from './FrameSidebar.vue';
3
+ export { default as FrameCentred } from './FrameCentred.vue';
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * An outline bell, for the notification list's trigger. See `CheckIcon` for why the caller's
6
+ * attributes are bound last.
7
+ */
8
+ defineOptions({ inheritAttrs: false });
9
+ </script>
10
+
11
+ <template>
12
+ <svg
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ viewBox="0 0 24 24"
15
+ fill="none"
16
+ stroke="currentColor"
17
+ stroke-width="2"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ aria-hidden="true"
21
+ focusable="false"
22
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
23
+ >
24
+ <path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
25
+ <path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
26
+ </svg>
27
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT; see the contract in `index.ts`. `v-bind` is written
6
+ * last so a caller's attributes win, and `class` is merged through `cn`.
7
+ *
8
+ * Deviation from the shared contract: `stroke-width` is 2.4, not 2. A bold glyph drawn at
9
+ * the shared weight is hardly heavier than its neighbours in a 16px toolbar; 2.4 is the
10
+ * weight the approved design (docs/design/slice-e.html) uses. Still only a default.
11
+ */
12
+ defineOptions({ inheritAttrs: false });
13
+ </script>
14
+
15
+ <template>
16
+ <svg
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ viewBox="0 0 24 24"
19
+ fill="none"
20
+ stroke="currentColor"
21
+ stroke-width="2.4"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ aria-hidden="true"
25
+ focusable="false"
26
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
27
+ >
28
+ <path d="M7 5h6a3.5 3.5 0 0 1 0 7H7z" />
29
+ <path d="M7 12h7a3.5 3.5 0 0 1 0 7H7z" />
30
+ </svg>
31
+ </template>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error. `class` is the one attribute that is merged
9
+ * rather than replaced, by `cn`, so `size-3` beats the `size-4`.
10
+ *
11
+ * Drawn by `date-picker/DateField.vue` as the default of its `calendar-icon` slot.
12
+ */
13
+ defineOptions({ inheritAttrs: false });
14
+ </script>
15
+
16
+ <template>
17
+ <svg
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ viewBox="0 0 24 24"
20
+ fill="none"
21
+ stroke="currentColor"
22
+ stroke-width="2"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ aria-hidden="true"
26
+ focusable="false"
27
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
28
+ >
29
+ <rect x="3" y="4" width="18" height="18" rx="2" />
30
+ <path d="M16 2v4M8 2v4M3 10h18" />
31
+ <path d="M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01" />
32
+ </svg>
33
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error, and the first consumer in this repository hit
9
+ * exactly that: `appearance-picker/AppearanceSegment.vue` needs this glyph at weight 3 and
10
+ * carries its own copy of the path because it could not get it. `class` is the one
11
+ * attribute that is merged rather than replaced, by `cn`, so `size-3` beats the `size-4`.
12
+ */
13
+ defineOptions({ inheritAttrs: false });
14
+ </script>
15
+
16
+ <template>
17
+ <svg
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ viewBox="0 0 24 24"
20
+ fill="none"
21
+ stroke="currentColor"
22
+ stroke-width="2"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ aria-hidden="true"
26
+ focusable="false"
27
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
28
+ >
29
+ <path d="m5 12 5 5 9-10" />
30
+ </svg>
31
+ </template>
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error. The first consumer in this repository to hit
9
+ * exactly that needed a different glyph, the check (see `CheckIcon.vue`). `class` is the one
10
+ * attribute that is merged rather than replaced, by `cn`, so `size-3` beats the `size-4`.
11
+ */
12
+ defineOptions({ inheritAttrs: false });
13
+ </script>
14
+
15
+ <template>
16
+ <svg
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ viewBox="0 0 24 24"
19
+ fill="none"
20
+ stroke="currentColor"
21
+ stroke-width="2"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ aria-hidden="true"
25
+ focusable="false"
26
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
27
+ >
28
+ <path d="m6 9 6 6 6-6" />
29
+ </svg>
30
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error. `class` is the one attribute that is merged
9
+ * rather than replaced, by `cn`, so `size-3` beats the `size-4`.
10
+ *
11
+ * Drawn by `date-picker/CalendarPanel.vue` as the default of its `prev-icon` slot.
12
+ */
13
+ defineOptions({ inheritAttrs: false });
14
+ </script>
15
+
16
+ <template>
17
+ <svg
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ viewBox="0 0 24 24"
20
+ fill="none"
21
+ stroke="currentColor"
22
+ stroke-width="2"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ aria-hidden="true"
26
+ focusable="false"
27
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
28
+ >
29
+ <path d="m15 18-6-6 6-6" />
30
+ </svg>
31
+ </template>
@@ -0,0 +1,31 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error. `class` is the one attribute that is merged
9
+ * rather than replaced, by `cn`, so `size-3` beats the `size-4`.
10
+ *
11
+ * Drawn by `date-picker/CalendarPanel.vue` as the default of its `next-icon` slot.
12
+ */
13
+ defineOptions({ inheritAttrs: false });
14
+ </script>
15
+
16
+ <template>
17
+ <svg
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ viewBox="0 0 24 24"
20
+ fill="none"
21
+ stroke="currentColor"
22
+ stroke-width="2"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ aria-hidden="true"
26
+ focusable="false"
27
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
28
+ >
29
+ <path d="m9 18 6-6-6-6" />
30
+ </svg>
31
+ </template>
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * Every attribute below is a DEFAULT. `v-bind="$attrs"` is written last on purpose: the
6
+ * compiler emits `mergeProps` in source order and the last argument wins, so a caller's
7
+ * `stroke-width="3"` replaces the 2 rather than being silently dropped. Written first — as
8
+ * these were — it is dropped with no error. The first consumer in this repository to hit
9
+ * exactly that needed a different glyph, the check (see `CheckIcon.vue`). `class` is the one
10
+ * attribute that is merged rather than replaced, by `cn`, so `size-3` beats the `size-4`.
11
+ */
12
+ defineOptions({ inheritAttrs: false });
13
+ </script>
14
+
15
+ <template>
16
+ <svg
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ viewBox="0 0 24 24"
19
+ fill="none"
20
+ stroke="currentColor"
21
+ stroke-width="2"
22
+ stroke-linecap="round"
23
+ stroke-linejoin="round"
24
+ aria-hidden="true"
25
+ focusable="false"
26
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
27
+ >
28
+ <path d="m18 15-6-6-6 6" />
29
+ </svg>
30
+ </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../../lib/cn';
3
+
4
+ /**
5
+ * A circle holding an exclamation mark, the glyph beside a message that something could not be done. Every attribute below is a DEFAULT: `v-bind="$attrs"` is written last, so a
6
+ * caller's `stroke-width` replaces the 2, and `class` is merged through `cn` so `size-3` beats the
7
+ * `size-4`. Drawn inline because the package ships no icon set (ADR 0013).
8
+ */
9
+ defineOptions({ inheritAttrs: false });
10
+ </script>
11
+
12
+ <template>
13
+ <svg
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ viewBox="0 0 24 24"
16
+ fill="none"
17
+ stroke="currentColor"
18
+ stroke-width="2"
19
+ stroke-linecap="round"
20
+ stroke-linejoin="round"
21
+ aria-hidden="true"
22
+ focusable="false"
23
+ v-bind="{ ...$attrs, class: cn('size-4', $attrs.class as string | undefined) }"
24
+ >
25
+ <circle cx="12" cy="12" r="10" />
26
+ <path d="M12 8v4" />
27
+ <path d="M12 16h.01" />
28
+ </svg>
29
+ </template>